Re: Basic ACL tutorial in 1.3 book will not work because Auth is not setting Auth.User
Can anyone help me?
On Sunday, August 5, 2012 7:13:02 PM UTC-4, osucoder wrote:
I cannot get the login function to work after following the acl tutorial. I'm getting an "Auth.User doesn't exist" error when I dump the Session variable after calling "$this->Session->read('Auth.--User);" If searched all over the place for an answer and I am yet to find one. Any help would be greatly appreciated. Thank you. app_controller1 <?php2 class AppController extends Controller {3 var $components = array('Acl', 'Auth', 'Session', 'Cookie');4 var $helpers = array('Html', 'Form', 'Session');5 function beforeFilter(){6 //Configure AuthComponent7 $this->Auth->actionPath = 'controllers/';8 $this->Auth->authorize = 'actions';9 $this->Auth->loginAction = array('controller'=>'users', 'action'=>'login');10 $this->Auth->logoutRedirect = array('controller'=>'users', 'action'=>'logout');11 $this->Auth->loginRedirect = array('controller'=>'posts', 'action'=>'add');12 $this->Auth->allowedActions = array('display');13 }14 }15 ?>login action67 function login(){8 if($this->Session->read('Auth.User')){ 9 $this->Session->setFlash('You are logged in!');10 $this->redirect('/', null, false);1112 }13 debug($this->Auth, true);14 }
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com.
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en-US.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home