25 if (strpos($this->username,
"@")) {
26 $user =
User::model()->notsafe()->findByAttributes(array(
'email' => $this->username));
28 $user =
User::model()->notsafe()->findByAttributes(array(
'username' => $this->username));
31 if (strpos($this->username,
"@")) {
34 $this->errorCode = self::ERROR_USERNAME_INVALID;
36 } elseif (Yii::app()->getModule(
'user')->encrypting($this->password) !== $user->password) {
37 $this->errorCode = self::ERROR_PASSWORD_INVALID;
38 } elseif ($user->status == 0 && Yii::app()->getModule(
'user')->loginNotActiv ==
false) {
40 } elseif ($user->status == -1) {
43 $this->_id = $user->id;
44 $this->username = $user->username;
45 $this->errorCode = self::ERROR_NONE;
48 return !$this->errorCode;