コード例 #1
0
 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]);
 }
コード例 #2
0
ファイル: DefaultController.php プロジェクト: Gertz1/kozpp
 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]);
 }
コード例 #3
0
ファイル: DefaultController.php プロジェクト: sunfun/seokeys
 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]);
 }