Wednesday, May 21, 2014

cakePhp 2.5 Auth login problem

Hello,

I have a table named accounts having fields id, email and passwd.
In my AppController.php beforeFilter() function i have this code.

$this->Auth->authorize = array('Controllers');
$this->Auth->authenticate = array('all' => array('scope' => array('Account.enabled' => 'Y')), 'Form' => array('userModel' => 'Account', 'fields' => array('username' => 'email', 'password' => 'passwd')));
$this->Auth->loginAction = array('controller' => 'accounts', 'action' => 'login');
$this->Auth->logoutRedirect = array('controller' => 'accounts', 'action' => 'login');
$this->Auth->allow(array('login', 'logout'));


After entering the correct login details in the login form (/accounts/login) i am getting this message "You are not authorized to access that location.".

Please let me know what i am doing wrong here and also how do i access the logged in user values in Views.

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

No comments: