开发者

Cakephp ACL authentication issue - I'm locked out

I've followed the CakePHP Cookbook ACL tutorial

And as of right now I'm just trying to add users using the scaffolding method. I'm trying to go to /users/add but it always redirects me to the login screen even though I have added $this->Auth->allow('*'); in beforeFilter() temporarily to allow access to all pages. I've done this in both the UsersController and GroupsController as the tutorial asked.

Below is my code for UsersController which I think will be the most relevant of all the files. Let me know if any other piece of code is required.

<?开发者_如何转开发php
class UsersController extends AppController {
 var $name = 'Users';
 var $scaffold;

 function beforeFilter() {
     parent::beforeFilter();
     $this->Auth->allow('*');
 }

 function login() {
    //Auth Magic
 }

 function logout() {
    //Leave empty for now.
 }
} 
?>

I think I've pretty much followed the tutorial, any ideas as to what I may be missing?

Thanks. I've been stuck on this for a while. =(


I followed the recent version of the tutuorial here:

http://book.cakephp.org/view/1543/Simple-Acl-controlled-Application

And then I found myself having issues with login and logout. However on adding the following lines, I was set ok!

in users_controller.php:

function beforeFilter() {
 $this->Auth->allow('login','logout');
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜