I have two irrelevant part in one application and I want to use different user databases and authentication methods to login users. Is this possible? How can I do this? Thanks.
I have two irrelevant part in one application and I want to use different user databases and authentication methods to login users. Is this possible? How can I do this? Thanks.
Yes possible. Here is a clue
It will be a little messy but doable. You will however need to refer to the correct connection when makeing your queries or inserts.
$connect1 = Yii::app()->db;
$connect2 = Yii::app()->anotherDB;
Thanks for your advise but actually I can use different tables in one db. It’s my fault to emphasize ‘different databases’.
The really tricky part is how do I rewrite UserIdentity or something to realize this two different login methods.
e.g. You can only login to b.domain.com in b.domain.com/login using tbl_user_b and the identity are not recognized in a.domain.com which should only be logged in via a.domain.com/login using tbl_user_a
I think this is really difficult because I have to rewrite many things including userIdentity, cookie, session or something.
If you are writing a multitenant app why not just use a clientID field instead of trying to keep separate tables for users at different domains.