views:

171

answers:

1

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. =(

A: 

I followed the recent version of the tutuorial [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'); }

ponsel