CakePHP's AuthComponent assumes you have a Users table that contains a username and password. I'd like to find a way to override the default tablename from Users to Accounts.
Background Information:
The way I have designed my database is to have a Users table and an Accounts table.
Accounts:
id
user_id
username
password
authentication service (for example, my site, Facebook, Google, OpenID, etc.)
Users:
The reason for this is so that
Now back to the problem....
CakePHP has documentation on changing the default field name, but I can't find anything on changing the default table name, but assume it would be similar in nature...
Example of changing the default field name:
function beforeFilter() {
$this->Auth->fields = array(
'username' => 'username',
'password' => 'secretword'
);
}
Is there a way to accomplish this or should I restructure the tables keeping with CakePHP convention and still accomplish the same thing?
In app_controller.php:
function beforeFilter() {
$this->Auth->userModel = 'Account';
}