I am trying to add auth to my cakephp app using the tutorial here: http://www.endyourif.com/login-system-with-cakephp-in-under-10-minutes/
I have changed the code slightly from the tutorial as my users table has 'username' and 'password' columns instead of 'email'
It is for a control panel so the whole thing needs to be passworded, don't need per controller access etc.
When i use the form to login it gives me "Login failed. Invalid username or password." from $session->flash('auth'); - Does this mean its working, but it just cant find the user table row?
I have tried to hash the passwords in the database in case that's why it's not matching them.
Here is my app controller:
<?php
class AppController extends Controller {
var $helpers = array('Html', 'Javascript', 'Form', 'Session', 'AutoJavascript', 'Cache');
var $components = array('Session', 'Auth', 'Cookie'); // Adding an email class conflicts with the email controller
function beforeFilter() {
$this->Auth->userModel = 'User';
$this->Auth->loginAction = array('admin' => false, 'controller' => 'users', 'action' => 'login');
$this->Auth->loginRedirect = array('controller' => 'users', 'action' => 'index');
$this->Auth->allow('*');
}
}
?>
Is there something wrong in the tutorial?
Sorry, no demo available.
Thanks!