0
votes

I'm using CakePHP 1.3 version for this project.

I am working with Auth for Users and Admins login stuff.

I want to manage User & Admin login separately, any ideas how? I means users credentials are in Users table and Admin credentials in Admin table, and both should be logged into via from their separate login pages.

Thanks !

2
I am trying to implement the same thing in my project. Did you find a solution to your problem. Your help is appreciated. Thanks. - himanshu dhiman
needs to recall the code, will update you shortly - Aditya P Bhatt

2 Answers

0
votes

For complicated, multi roles application where you have different actors having different resources they can access, you can go with ACL

http://book.cakephp.org/view/1543/Simple-Acl-controlled-Application

But if you only have admin and user, it's probably preferable to just put the info in the same table (rather than having separate tables) and have a roles table along with roles_users table for mapping the roles, and in your controller, you manually define the role access.

As far as 1.2 goes, ACL is not very straightforward to implement and might be an overkill if you just need some sort of simple separation.

0
votes

set Auth->userModel to the appropriate model in beforeFilter() of each controller: http://book.cakephp.org/view/1265/AuthComponent-Variables

Set up the login pages as usual http://book.cakephp.org/view/1250/Authentication and Auth will take care of the rest for you.