I have a very strange problem in that on one machine Yii::app()->user->id; returns the username, but on another machine running identical code I'm getting the id number as expected. I'm using the User Management Module 0.5, though I don't know if that's anything to do with it. The only difference between the machines is one is x64 and the other is x32 - again - I don't think that has anything to do with it.
How could Yii::app()->user->id be getting the username? What have I missed?
Page 1 of 1
Yii::app()->user->id; is returning username instead of id number
#2
Posted 10 May 2010 - 01:39 AM
By default getId() method returns username it has to be overriden to return id...
Check this documentation http://www.yiiframew...-identity-class
Check this documentation http://www.yiiframew...-identity-class
Quote
We also override the getId method toreturn the _id variable which is set during authentication (the defaultimplementation would return the username as the ID).
Find more about me.... btw. Do you know your WAN IP?
Share this topic:
Page 1 of 1

Help












