Пример #1
0
 public function actionChangePassword()
 {
     $model = new PasswordChangeForm($this->findModel());
     if ($model->load(Yii::$app->request->post()) && $model->changePassword()) {
         return $this->redirect(['user']);
     } else {
         return $this->render('changePassword', ['model' => $model]);
     }
 }
Пример #2
0
 public function actionChangePassword()
 {
     $user = $this->findModel();
     $model = new PasswordChangeForm($user);
     if ($model->load(Yii::$app->request->post()) && $model->changePassword()) {
         Yii::$app->getSession()->setFlash('success', Module::t('module', 'FLASH_PASSWORD_RESET_SUCCESS'));
         return $this->goHome();
     }
     return $this->render('passwordChange', ['model' => $model]);
 }
Пример #3
0
 public function actionPasswordChange()
 {
     $user = $this->findModel();
     $model = new PasswordChangeForm($user);
     if ($model->load(Yii::$app->request->post()) && $model->changePassword()) {
         Yii::$app->getSession()->setFlash('success', Yii::t('app', 'FLASH_PASSWORD_CHANGE_SUCCESS'));
         return $this->redirect(['index']);
     } else {
         return $this->render('passwordChange', ['model' => $model]);
     }
 }
Пример #4
0
 public function actionChangePassword()
 {
     $model = new PasswordChangeForm();
     if ($model->load(Yii::$app->request->post()) && $model->validate()) {
         $model->setNewPassword();
         Yii::$app->getSession()->setFlash('success', 'Спасибо! Успешно обновили пароль.');
         return $this->refresh();
     } else {
         return $this->render('passwordChange', ['model' => $model]);
     }
 }