示例#1
0
 /**
  * Finds user by [[username]]
  *
  * @return User|null
  */
 public function getUser()
 {
     if ($this->_user === false) {
         $this->_user = User::findByEmail($this->email);
     }
     return $this->_user;
 }
示例#2
0
 /**
  * Send a recovery password token.
  *
  * @return boolean true if recovery token was successfully sent
  */
 public function recovery()
 {
     $this->_model = User::findByEmail($this->email, 'active');
     if ($this->_model !== null) {
         return Module::sendRecoveryEmail($this->_model);
     }
     return false;
 }
示例#3
0
 public function existEmail($attribute, $params)
 {
     if (User::findByEmail($this->{$attribute})) {
         $this->addError($attribute, $params['message']);
         return false;
     } else {
         return true;
     }
 }
示例#4
0
 /**
  * Resend email confirmation token
  *
  * @return boolean true if message was sent successfully
  */
 public function resend()
 {
     $this->_model = User::findByEmail($this->email, 'inactive');
     if ($this->_model !== null) {
         // Module::sendSignUpEmail($this->_model)
         return true;
     }
     return false;
 }