My AppController:
class AppController extends Controller {
public $components = array(
'Session',
'Auth'=>array(
'authenticate' => array(
'Form' => array(
'fields' => array('username'=>'Login','password'=>'Senha'),
'userModel'=> 'Usuario'
),
),
'loginAction' =>array('controller' => 'Usuarios','action' => 'login'),
'loginRedirect'=>array('controller'=>'usuarios', 'action'=>'index'),
'logoutRedirect'=>array('controller'=>'usuarios', 'action'=>'index'),
'authError'=>"You can't access that page",
'authorize'=>array('Controller'),
'loginError'=> 'Login errado'
)
);
public function isAuthorized($usuario=null) {
return true;
}
public function beforeFilter() {
$this->Auth->allow('index','view');
$this->set('logged_in', $this->Auth->loggedIn());
$this->set('current_user', $this->Auth->user());
}
}
?>
Everytime, goes to the AuthError message "You can't acces that page".
I did this using documentation and Andrew Perk videos.
thanks a lot
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:
Post a Comment