Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
How to use Auth for multiple User types which reside in different database tables
Old 01-04-2011, 03:18 AM How to use Auth for multiple User types which reside in different database tables
Novice Talker

Posts: 9
Name: Rohan Chopdekar
Trades: 0
I've been using CakePHP for some time now. But I still fail to solve some issues on my own.
Its been difficult to understand how Cake Auth works but in these past few weeks I've managed to work with it.


Now to my issue:
I have 2 separate tables(Say for Admin Users and Normal Users). Both have different Controllers (Lets say they are AdminsController and UsersController).
Now I have completed Users module without any trouble. Users login and Admin Login are different views. As I dont want any normal User to be able to get their hands on Admin login page I've kept it separate from normal user login.

Users login works fine with Auth. But now I want to use another Auth for AdminController for some reason I am unable to make use the second Auth from AdminController and control automatically transfers to the Users Login

It would be great if someone could point in the correct direction. Please!

Thank You. In advance!!
rohan210 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-04-2011, 03:32 PM Re: How to use Auth for multiple User types which reside in different database tables
Super Spam Talker

Posts: 879
Name: Paul W
Trades: 0
Not sure what you're up to but http://book.cakephp.org/view/172/Authentication might help
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE


*** New:
Please login or register to view this content. Registration is FREE
PaulW is offline
Reply With Quote
View Public Profile
 
Old 01-05-2011, 09:04 AM Re: How to use Auth for multiple User types which reside in different database tables
Novice Talker

Posts: 9
Name: Rohan Chopdekar
Trades: 0
Sorry everyone
I was using Auth->userModel slightly wrong way.
I was adding it to my Admin Controller but not in User Controller so if you came here looking for an answer please use


**$this->Auth->userModel="User";**


in every controller in beforeFilter()

enjoy.......
rohan210 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to How to use Auth for multiple User types which reside in different database tables
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.44882 seconds with 12 queries