tags:

views:

282

answers:

2

I have a rather simple CakePHP app that uses the Auth component to restrict access to the admin funcitons. That all works fine and good but I use the Pages Controller to display the home page and Admin main page.

How can I set up auth to control access to pages like '/' for home and '/admin'?

+4  A: 

Copy the PagesController from the /cake/libs/controller/ directory into your regular /app/controller/ directory and modify it as needed.

deceze
A: 

I don't believe you can use the Auth component to effectively protect static pages because the pages controller uses a single action, display(), to render all static pages. Since generally you'll do something like Auth->allow('display') to allow access to your static pages like '/', there isn't an effective way to specify allow/deny of individual static pages.

GTM