How do I secure all the admin actions in all controllers in cakePHP

Posted by Gaurav Sharma on Stack Overflow See other posts from Stack Overflow or by Gaurav Sharma
Published on 2010-05-17T07:24:43Z Indexed on 2010/05/17 7:40 UTC
Read the original article Hit count: 331

Hello Everyone,

I am developing an application using cakePHP v 1.3 on windows (XAMPP).

Most of the controllers are baked with the admin routing enabled. I want to secure the admin actions of every controller with a login page. How can I do this without repeating much ?

One solution to the problem is that "I check for login information in the admin_index action of every controller" and then show the login screen accordingly.
Is there any better way of doing this ?

The detault URL to admin (http://localhost/app/admin) is pointing to the index_admin action of users controller (created a new route for this in routes.php file)

Thanks

© Stack Overflow or respective owner

Related posts about cakephp

Related posts about admin-routing