Thanks Stu,
I am using Auth and ACL. For the posts_controller the only action anyone
can see is the index which is the list of posts. I want everyone to see them
different posts but if you try to view one and your not logged in I do not
want the user to be directed to the Auth login...I want to send then
elsewhere to a custom view explaining you need to be registered with
registration form or something like that.
So do I need to:
function beforeFilter()
{
parent::beforeFilter();
$this->Auth->allowedActions = array('index', 'view');
$this->Auth->autoRedirect = false;
}
Then in the view function check if logged in allow if not send them away?
Dave
-----Original Message-----
From: Stu [mailto:[email protected]]
Sent: April-07-09 12:22 PM
To: CakePHP
Subject: Re: Custom Redirect
Hi Dave,
For pages that a user is not allowed to see I use:
$this->render('/deny_page', null, false)
of course you'll need a 'deny_page' in your views directory.
I'm not sure if I do it the 'right' way seeing on I'm using a custom Auth
component, but I check whether or not the user has the appropriate
permissions in my function, if he doesn't he gets the 'deny_page' rendered
to him.
Hope this helps
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---