you have to set up the Auth object with the allowed actions in your
controller:
i.e. in my users_controller
function beforeFilter() {
$this->Auth->userModel = 'User';
$this->Auth->sessionKey = 'My';
$this->Auth->loginRedirect = '/users/index';
$this->Auth->allowedActions = array('index', 'register',
'logout','login');
}
there is a set function wich takes an array as argument, surely a
better way to setup your object.
I'm not sure if it is better to have a call to Auth in each controller
or put it in the app_controller, may depend on your application i
guess.
Hope this helps, because I'm struggling too with this component and
these are just experiments, not good code :)
On 27 feb, 17:08, "Digital Spaghetti"
<[EMAIL PROTECTED]> wrote:
> Hey guys,
>
> I'm reasonably new to CakePHP, really only had a play about with it so
> far but I am ready to take it to the next level.
>
> The first thing I am building into my app is the user system, so users
> can log in and get access to specific areas. I've decided to go with
> 1.2.x.x branch since it has the new Auth component but I've come
> across problems already.
>
> In my AppController class, I have added the Auth component, but now
> every page I look at, it's asking me to log in as a user (via /users/
> login as the default in Auth), but of course I don't want this on
> every page, only pages that are under admin.
>
> Can anyone direct me the proper usage of this component, as it's not
> well documented yet (at least to a level I can read) and how to only
> have it ask for login on certain controller functions (like /admin/
> posts/add for example).
>
> Tane
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---