Wednesday, February 22, 2012

simple auth in 2.0

Hello,

I used CakePHP 1.3 and now I come to CakePHP 2.0.

Do not know how to do a simple authentication system.

I have this in AppController:

public $components = array('Cookie', 'RequestHandler', 'Session',
'Auth');

public function beforeFilter() {

$this->Auth->loginRedirect = array('controller' => 'index',
'action' => 'action_index');

if (isset($this->request->params['prefix']) && $this->request-
>params['prefix'] == 'admin') {
$this->layout = 'admin';
$this->set('Auth', $this->Auth->user());
} else {
$this->Auth->allow();
}
}

If someone knows that I do wrong?

thanks

--
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: