uses the Auth Component.
What I'm wondering is if it is possible to show a "Page Denied" page
instead of the Login page when a user tries to access a restricted
page.
I have my authorization set up by component. At the top of each
controller I have a beforeFilter function, and a $this->Auth->allow
for those actions that are available.
We have been tightening up the site and I'm sure this will cause some
bad links and I don't really want it to be any easier to find the
login screen for out website. As the site works now if someone tries
to access an action that's protected it redirects them to a "Login"
screen (I'm sure this is pretty standard for how most CakePHP sites
are set up).
Is there a way that I can have these redirected to a "access deneid"
page (/pages/access_denied) page instead of the login screen? I only
want the login screen to be displayed is someone types in http://homepage.com/admin
Here is my Auth stuff in the app_controller.php setup:
$this->Auth->loginAction = '/admin/users/login';
$this->Auth->loginRedirect = '/admin/users/login';
$this->Auth->logoutRedirect = '/';
$this->Auth->allow('display', );
$this->Auth->authorize = 'controller';
if (isset($this->params['admin'])) {
$this->layout = 'admin_default';
}
function isAuthorized(){
return true;
}
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:
Post a Comment