2014-12-04

In this wiki I will show how could wo pass the third parameter to UserIdentity on login authenticate. So we can do separate login authentcation from two or more different models from single login form.

In LoginForm Model -

Added a new variable like - usertype. also we will pass it's to UserIdentity same as username & password.

eg.

In Login View -

Here i'm using two different user type authentication - User & Agency

In Controller (actionLogin method) -

In UserIdentity

Need to update UserIdentity.php (In Component directory). Here we will getting third parameter 'usertype' as per we define & pass in LoginForm model.

We will update the CUserIdentity construct method to getting third parameter 'usertype' values.
http://www.yiiframework.com/doc/api/1.1/CUserIdentity#__construct-detail

Multi user login facility from single login from. Try this, working great in yii 1.1

Show more