Problem: Using different tables for Auth Components (Users and Admins
Tables)
I was thinking...
If I browse to /admin/users/ I will be asked for an admin login; and the
login will be checked with the admin table.
If I browse to /users/editProfile/ I well be asked for an user login; and
the login will be checked with the users table.
So, The only thing I have to do is check if I'm trying to access an /admin/
resource in beforeFilter; and then define how will I validate (which table).
Is this right? Does anyone how to do it, or any other suggestion?
Thanks!
Nicolás Andrade
On Mon, Apr 28, 2008 at 12:46 PM, Nicolás Andrade <
[EMAIL PROTECTED]> wrote:
> Hi to all; as a few days ago was suggested in this list; I started using
> AUTH component and Admin Routing to validate Administrators.
>
> Now, I've 2 "Users" models; (Front End) Users and Admins.
>
>
> Each Admin function has Admin_ on it's name. Ok.
>
> In the Users controller appears the problem.
>
>
> The Admin_DeleteUser method is Admin-Password-Protected by Auth, i.e.:
>
> function beforeFilter(){
> $this->Auth->userModel = 'Admin';
> $this->Auth->fields = array('username' => 'email', 'password'
> => 'password');
> }
>
>
> And now I have to protect the EditProfile method so each user must validate
> himself before editing his profile. I need double-auth; one related to
> Administration Functions and another related to Users functions.
>
> I mean
>
> Admin_DeleteUser() must be Admin protected using Admin model.
> EditProfile() (or User_EditProfile() if necessary) must be protected using
> User model.
>
>
> As English is not my primary language it's so hard to search this topic on
> Google. Any suggestion??
>
> Thanks thanks thanks!
>
>
> Nicolás
>
>
>
>
--
Nicolás Andrade
www.nicoandra.com.ar
www.treintaguita.com.ar
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---