1.Adapt the config of your Auth component regarding userModel
, fields
and passwordHasher
:
public $components = array(
'DebugKit.Toolbar',
'Session',
'Auth' => array(
'loginRedirect' => array('controller' => 'Employee', 'action' => 'index'),
'logoutRedirect' => array('controller' => 'Employee', 'action' => 'login'),
'authError' => 'You must be logged in to view this page.',
'loginError' => 'Invalid Username or Password entered, please try again.',
'authenticate' => array(
'Form' => array(
'fields' => array('username' => 'username', 'password' => 'password'),
'userModel'=>'Employee',
'passwordHasher' => 'name of your password hasher'
))
));
2.Regarding CakePHP´s code convetion rename your controller to EmployeeController
3.In your Employee model instead your isUniqueUsername
and isUniqueEmail
you better use validation rule isUnique
4.Use same password hasher for creating password and update password