Your explanation is somewhat confusing for me. But following is my attempt to explain you about the solution you need.
First of all, if you looked at the description of 'logoutRedirect' parameter, it says 'specify where you want the user to go after they are logged out, with the default being the login action'. So, IMO, this value shouldn't go to the logout page.
If you have only one routing prefix, for example, 'admin', then you can use something like
$this->Auth->logoutRedirect = array('admin' => false, 'controller' => '<controller-name-here>', 'action' => '<action-name-here>');
or if you have more than one or want a generic solution then try
$this->Auth->logoutRedirect = '/<controller-name-here>/<action-name-here>';
You can use above in the views too to build URLs for the links.
Hope this helps.
Amit Badkas
PHP Applications for E-Biz: http://www.sanisoft.com
On Thu, Jan 6, 2011 at 11:48 AM, John Maxim <googol6@gmail.com> wrote:
and of course I meant this, typo:
> => false, 'controller' => 'users', 'action' => 'logout');
> $this->Auth->logoutRedirect = array(Configure::read('Routing.admin')
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others
On Jan 6, 2:11 pm, John Maxim <goog...@gmail.com> wrote:
> 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());
>
> > > 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
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:
Post a Comment