Monday, February 23, 2009

Re: logout not authorized to access

I thought it was not 'kosher' if you will to allow logout as that
would mess the Auth Component up (according to the Example in the
appendices anymore? Is this now no longer the case?

On Feb 18, 4:46 am, Chris <c.gra...@hpani.org.uk> wrote:
> I found the same thing.  I moved my login andlogoutfunctions to a
> security controller which handles other security based actions.
>
> You answered your own question as unfortunately even though Auth has a
> loginAction() method it doesnothave a logoutAction() method so it
> needs to be excluded manually.
>
> You can add a beforeFilter to the controller containing thelogout
> function like so:
>
> function beforeFilter() {
>         parent::beforeFilter();
>         $this->Auth->allow('logout');
>
> }
>
> That will ensure thatlogoutis ignored for all users.
>
> On Feb 10, 12:25 pm, yisn <myy...@gmail.com> wrote:
>
> > I followed the "Simple Acl controlled Application" in the Cookbook of
> > CakePHP, and got the message "You arenotauthorizedto access that
> > location" when try tologout. I logged in as a user who isnotallowed
> > to access the UsersController actions.
>
> > Do i need to grant the access to "logout" function for this user to
> > fix this problem? But the "login" function doesnotneed to be
> > granted, does the "auth" componentnotgrant access to "logout"
> > function itself?

--~--~---------~--~----~------------~-------~--~----~
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
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: