I don't for a minute think I have the answer but would hate you to
feel too lonely! This is just a wild suggestion and I apologise if
it's totally wrong. Have you thought about changing your $this->Auth-
>loginAction to point to your "Permission denied" page? Then if
someone does something that needs a login, they'll be directed there.
Then you can have your true login links pointing to the login page.
Would that work?


On Dec 7, 3:08 pm, Jesse <jesseainsk...@gmail.com> wrote:
> Anyone have an idea for this? I really need to get this feature
> implemented.
>
> -Jesse
>
> On Dec 3, 2:04 pm, Jesse <jesseainsk...@gmail.com> wrote:
>
>
>
> > I have a pretty complex site setup with an administration section that
> > 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 
> > inhttp://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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to