Question

Let's say I have 2 tables : Users and Customers.

Users table contained the admin and manager of the site.

Customers table contained the customer who want to buy something from the site.

Usually Cake Standard is to put everything under one table. But, Is there anyway in CakePHP 1.3 to have 2 different login with 2 different table?

I know specifically which table has to be used on different page. e.g:

If the site is :

www.domain.com/admin  --> This login page should use Users table (default has been implemented)

but now, I need to implement another login page for customer and I decide to separate the table to be cleaner on database part.

www.domain.com  --> This login page should use customers table.

So, how to achieve this? Is this a really bad practice?

No correct solution

OTHER TIPS

I honestly think this is indeed a bad practice. You should consider putting every kind of "loggable" user in the same table and having a column named role which defines privileges.

@lucasnadalutti is correct.
however, you dont need a different login page - just change the table in the AuthComponent settings.

$this->Auth->userModel = 'Member';

And, again: please don't do it. follow @lucasnadalutti's advice.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top