Tuesday, March 31, 2009

Re: How to silently redirects to login page ?

$this->Auth->authError = null?

But in my opinion its a real bad idea to redirect an already logged in
(!) user to a login again. That will look to the user like the app is
acting wrong and is confusing. If hes logged in but not allowed to
access a certain area he should get a notice that can't be overlooked
displayed telling him "Sorry, you dont have permissions to access this
area!".

I would do a check if the user is logged in, change the AuthError
message in this case and redirect him back to the page from where he
came.

On Mar 30, 9:28 pm, iFeghali <igor.fegh...@gmail.com> wrote:
> Hi Martin,
>
> Yes I am talking exactly about that message. Changing it the way you
> suggest would make it very weird to users already logged in that are
> trying to access resources they are not allowed to. Also, I would like
> to have no message at all... just the login form.
>
> Thank you.
>
> On 30 mar, 15:28, Martin Westin <martin.westin...@gmail.com> wrote:
>
>
>
> > That would be the authError message you are seeing.
>
> > You can set it (from AppController::beforeFilter for example) like
> > this:
>
> > $this->Auth->authError = 'Hi, and welcome. Please login before
> > proceeding.';
--~--~---------~--~----~------------~-------~--~----~
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: