Thursday, July 18, 2013

Re: User Authentication with 2 different tables

Hi Marius,

I guess best is you use two authentication objects.
Didn't try the following, but it should give you an idea:


public $components = array(      'Auth' => array(          'authenticate' => array(              'WebUserForm' => array(                  'fields' => array('username' => 'username')              ),              'AdminUserForm' => array(                  'fields' => array('username' => 'adminname')              )          )      )  );

Where both authentication objects inherit from the Form Auth component.

Greetings
Marc

On Wednesday, July 10, 2013 1:45:44 PM UTC+2, Marius Heil wrote:
Hello,

what's the best approach for the following?:
I have normal web users and admin users, admin users
I need the admin users to stay in a different database than the webusers

My admin users and web users have a different table structure that I do not want to merge.
So I basically just want authentication and authorization with those two tables, what should I do?

Thanks,
Marius

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

No comments: