25 protected $name =
'email';
26 protected $title =
'E-mail';
27 protected $type =
'email';
61 $email = $this->email;
62 $username = $this->username;
63 $password = $this->password;
64 $password_hash = Yii::app()->getModule(
'user')->encrypting($password);
65 $this->authenticated =
false;
67 if ($this->authField ==
'email') {
68 $user =
User::model()->findByAttributes(array(
'email' => $email,
'password' => $password_hash));
69 }
else if ($this->authField ==
'username') {
70 $user =
User::model()->findByAttributes(array(
'username' => $username,
'password' => $password_hash));
75 $this->attributes[
'id'] = $this->attributes[
'email'] = $this->attributes[
'displayId'] = $username;
76 $this->authenticated =
true;
81 Yii::log(
"EmailService auth resulted with code $this->errorCode.", CLogger::LEVEL_INFO);
82 return $this->authenticated;
93 Yii::app()->request->redirect(isset($url) ? $url : $this->
getRedirectUrl(),
true);
104 Yii::app()->request->redirect(isset($url) ? $url : $this->
getCancelUrl(),
false);
107 public function getEmail()
112 public function getName()
114 return $this->username;
117 public function getError()