Hi
I'm using CakePHP's Auth component and it's in my app_controller.php. The problem is I want to allow specific views in the built-in pages controller. How do I do that? Thanks in advance!
Hi
I'm using CakePHP's Auth component and it's in my app_controller.php. The problem is I want to allow specific views in the built-in pages controller. How do I do that? Thanks in advance!
Copy the pages_controller.php file in cake/libs/controllers to your app/controllers/ dir. Then you can modify it to do anything you want. With the auth component, the typical way to allow specific access is like this:
class PagesController extends AppController {
...
function beforeFilter() {
$this->Auth->allow( 'action1', 'allowedAction2' );
}
...
I recommend highly copying the file to your controllers dir, rather than editing it in place, because it will make upgrading cake much easier, and less likely that you accidentally overwrite some stuff.