I asked similar question a while back and no answers.

There is an $this->Auth->ajaxLogin = '/elements/users/expired_login'; option
you can add in app_controller

My problem is a lot of my ajax calls are waiting for a JSON response.status
true or false then do something based on that so nothing happens for me with
$this->Auth->ajaxLogin = '/elements/users/expired_login'; since that just
pumps out plain html, not JSON which is what I need.

If I get around to figuring it out I will post it here.

K

-----Original Message-----
From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of Julien Barbedette
Sent: Wednesday, February 23, 2011 1:40 PM
To: CakePHP
Subject: AJAX - ACL redirection

Hi,

By default, the Auth component used with the ACL component redirects
the user to the referer when this one can't access to the controller/
action (last lines of method startup in auth component):

                if ($this->isAuthorized($type)) {
                        return true;
                }

                $this->Session->setFlash($this->authError,
$this->flashElement,
array(), 'auth');
                $controller->redirect($controller->referer(), null, true);
                return false;

This is ok when you make a classic HTTP query but what about an AJAX
query? In my case, I don't want to display a complete page in my AJAX
dialog but only a message alerting the user that he can't access to
the page.

Any idea to manage that or if a  solution already exists?

Thanks

-- 
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help
others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at
http://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to