Wednesday, February 23, 2011

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+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: