After i login to the index.php page i get
Property "CWebUser.memberid" is not defined.
when i am trying to access any action
this is my UserIdentity class
class UserIdentity extends CUserIdentity
{
private $_id;
/**
* Authenticates a user.
* The example implementation makes sure if the username and password
* are both 'demo'.
* In practical applications, this should be changed to authenticate
* against some persistent user identity storage (e.g. database).
* @return boolean whether authentication succeeds.
*/
public function authenticate()
{
$user = Members::model()->findByAttributes(array('username'=>$this->username));
if ($user===null) {
$this->errorCode=self::ERROR_USERNAME_INVALID;
} else if ($user->password !== $this->password ) {
$this->errorCode=self::ERROR_PASSWORD_INVALID;
} else { // Okay!
$this->_id=$user->id;
$this->setState('username', $user->username);
$this->setState('memberid', $user->member_id);
$this->setState('createdate', $user->create_date);
$this->setState('membername', $user->member_name);
$this->errorCode=self::ERROR_NONE;
}
return !$this->errorCode;
}
public function getId()
{
return $this->_id;
}
}
i get this error when call
$memberid = Yii::app()->user->memberid;
in any action
the strang thing that only happen when deploy on remote server and never happen on my local machine