Override UserIdentity


I have a problem overriding UserIdentity. I mean, how do I do that?

I have "UserIdentity.php" under "protected/components", but it seems that it is not being called. I've put an error_log command there at the very beginning of the file, and it does not show up in the log.

Should it automatically see my file under "components" or do I point the application to it somewhere?


The yii-skeleton-app is good reference for you


Depends on how do you use it.


$identity = new UserIdentity($this->email, $this->password); // NOT CUserIdentity

Thank you for the replies! I already had UserIdentity not CUserIdentity. But I somehow didn’t realize it was being used only on logging in, not on every page request. :-[

So, actually, it is working alright. I guess it is being called automatically somehow. Apparently the framework knows where to search for the file.

It is only used during authentication process (check where you call the 'new' operator).