public function actionPasswordReset() { $model = new PasswordResetForm(); if ($model->load(Yii::$app->request->post()) && $model->validate()) { if ($model->resetPasword()) { Yii::$app->getSession()->setFlash('success', Module::t('module', 'FLASH_PASSWORD_RESET_EMAIL')); return $this->goHome(); } else { Yii::$app->getSession()->setFlash('error', Module::t('module', 'FLASH_PASSWORD_RESET_ERROR')); } } return $this->render('passwordReset', ['model' => $model]); }
public function actionResetPassword($token) { try { $model = new PasswordResetForm($token); } catch (InvalidParamException $e) { throw new BadRequestHttpException($e->getMessage()); } if ($model->load(Yii::$app->request->post()) && $model->validate() && $model->resetPassword()) { Yii::$app->getSession()->setFlash('success', 'Спасибо! Пароль успешно изменён.'); return $this->goHome(); } return $this->render('resetPassword', ['model' => $model]); }
public function actionPasswordReset($token) { try { $model = new PasswordResetForm($token); } catch (InvalidParamException $e) { throw new BadRequestHttpException($e->getMessage()); } if ($model->load(Yii::$app->request->post()) && $model->validate() && $model->resetPassword()) { Yii::$app->getSession()->setFlash('success', Yii::t('app', 'FLASH_PASSWORD_RESET_SUCCESS')); return $this->goHome(); } return $this->render('passwordReset', ['model' => $model]); }