/** * 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 $this->send(); } return false; }
/** * 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) { $this->_model->token = Security::generateExpiringRandomString(); $this->_model->save(); return $this->send(); } return false; }
/** * Finds user by username. * * @return User|boolean User instance */ protected function getUser() { if ($this->_user === false) { $user = User::findByEmail($this->username, 'active'); if ($user !== null) { if ($this->module->isBackend) { if (Yii::$app->authManager->checkAccess($user->id, 'accessBackend')) { $this->_user = $user; } } else { $this->_user = $user; } } } return $this->_user; }