Beispiel #1
0
 /**
  * @return string|\yii\web\Response
  */
 public function actionChangePassword()
 {
     $model = new ChangePasswordForm();
     if ($model->load(\Yii::$app->request->post()) && $model->changePassword()) {
         return $this->redirect(['details']);
     }
     return $this->render('change_password', ['model' => $model]);
 }
Beispiel #2
0
 public function actionChangePassword()
 {
     $user = $this->findModel();
     $model = new ChangePasswordForm($user);
     if ($model->load(Yii::$app->request->post()) && $model->changePassword()) {
         return $this->redirect(['index']);
     } else {
         return $this->render('changePassword', ['model' => $model]);
     }
 }
 /**
  * if already login go to dashboard
  * if not show login page
  **/
 public function actionIndex()
 {
     $model = new ChangePasswordForm();
     if (Yii::$app->request->isPost) {
         if ($model->load(Yii::$app->request->post()) && $model->change()) {
             Yii::$app->getSession()->setFlash('success', Yii::t('app', 'Password Anda Berhasil Diubah'));
             $model->clean();
         } else {
             Yii::$app->getSession()->setFlash('error', Yii::t('app', 'Password Anda Gagal Diubah'));
         }
     }
     return $this->render('index', ['model' => $model]);
 }