Thursday, February 23, 2012

Re: simple auth in 2.0

http://book.cakephp.org/2.0/en/tutorials-and-examples/blog-auth-example/auth.html
Simple Authentication and Authorization Application Tutorial

On 22 Feb., 21:23, pablosky <pablo00...@hotmail.com> wrote:
> 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: