I am currently using Auth component to login and using ACL and ARO for
permission. my login function in user controller is as follows:
function login() {
if ($this->Session->read('Auth.User')) {
$this->Session->setFlash('You are logged in!');
//$this->redirect('/', null, false);
$this->autoRender = false;
$this->redirect(array('controller' => 'welcomes',
'action' =>
'index'));
}
}
while before filter in app_controller as follows:
function beforeFilter() {
//passwords are plain text so override with own hash method that
does nothing ...
App::import('Model', 'User');
$user =& new User();
$this->Auth->authenticate = $user; // the hashPasswords method
gets
called in the user model ...
$this->Auth->allowedActions = array('display');
$this->Auth->actionPath = 'controllers/';
//Configure AuthComponent
$this->Auth->authorize = 'actions';
$this->Auth->loginAction = array('controller' => 'users',
'action'
=> 'login');
$this->Auth->logoutRedirect = array('controller' => 'users',
'action' => 'login');
$this->Auth->loginRedirect = array('controller' => 'users',
'action'
=> 'index');
}
Could you please check and update me how to update the last login time
in users table.
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en