Friday, March 4, 2011

Re: CakeDC Users Plugin - redirect based on role?

In the beforeFilter of your AppController you could set 
$this->Auth->autoRedirect = false

And then just manually fill in your login action

function login(){
if(!empty($this->data['User']) && $this->Auth->login($this->data))
if($this->Session->read('Auth.redirect')){ //if you got redirected to login by trying to access a protected function- it will redirect there instead of dashboard 
$this->redirect($this->Session->read('Auth.redirect'));
} else {
//check your group here and redirect based on that
}
}

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
 
 
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: