Wednesday, January 5, 2011

Re: Logging out from Admin/ that should point to App/Users Controller

It's here: http://book.cakephp.org/view/1271/logoutRedirect

$this->Auth->logoutRedirect = array(Configure::read('Routing.admin')
=> false, 'controller' => 'members', 'action' => 'logout');

It can't find the users controller from App/ .. since I enabled Admin
routing I guess. Whenever I go to website.com/admin/acl .. as I
click my logout link which works when I'm in website.com/(models)

--does not work when I'm in website.com/admin/acl

That's why I ask whether to redirect from:

1. App controller
2. Function logout
3. My layout logout link

?

It seems most likely to be in App controller, but it currently has:

$this->Auth->logoutRedirect = array('controller' => 'users', 'action'
=> 'login');

I tried replacing it with the first one:

$this->Auth->logoutRedirect = array(Configure::read('Routing.admin')
=> false, 'controller' => 'members', 'action' => 'logout');

I changed both action to logout and login to no avail. (for the above)

So my question now reverted back to:

Redirecting from :

1. App controller
2. Function logout
3. My layout logout link

?


On Jan 6, 12:29 pm, Amit Badkas <amit.sanis...@gmail.com> wrote:
> Hi,
>
> What do you mean by "It can't find the users controller"? Isn't the logout
> link outputting the URL correctly and/or isn't the redirection in logout()
> action working correctly?
>
> Also you have used "Configure::read('Routing.admin')" to set the
> 'logoutRedirect' URL but as per thehttp://book.cakephp.org/view/950/Prefix-Routing, there is nothing
> like 'Routing.admin' configuration option.
>
> Amit Badkas
>
> PHP Applications for E-Biz:http://www.sanisoft.com
>
> On Wed, Jan 5, 2011 at 10:52 PM, John Maxim <goog...@gmail.com> wrote:
>
> >http://book.cakephp.org/view/950/Prefix-Routing
>
> > Hi I have enabled admin/
>
> > When I'm herehttp://example.com/admin/acl
>
> > I find that as I click on my logout link which is currently;
> > controller=>users, action=>logout
>
> > It can't find the users controller, how should I change it?;
>
> > In my app controller I have this:
>
> > $this->Auth->logoutRedirect = array(Configure::read('Routing.admin')
> > => false, 'controller' => 'users', 'action' => 'login')
>
> > But it still doesn't work, my logout function:
> > this->redirect($this->Auth->logout());
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > 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<cake-php%2Bunsubscribe@googlegroups.com>For more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

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: