/** * Finds user by [[username]] * * @return User|null */ public function getUser() { if ($this->_user === false) { $this->_user = User::findByEmail($this->email); } return $this->_user; }
/** * 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; }
public function existEmail($attribute, $params) { if (User::findByEmail($this->{$attribute})) { $this->addError($attribute, $params['message']); return false; } else { return true; } }
/** * 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; }