| @@ 65-70 (lines=6) @@ | ||
| 62 | throw new BadRequestHttpException($e->getMessage()); |
|
| 63 | } |
|
| 64 | ||
| 65 | if ($model->load(Yii::$app->request->post()) && $model->validate() && $model->resetPassword()) { |
|
| 66 | $this->trigger(self::EVENT_AFTER_RESET, $event); |
|
| 67 | Yii::$app->getSession()->setFlash('success', $this->successMessage); |
|
| 68 | ||
| 69 | return $this->redirectTo(Yii::$app->getHomeUrl()); |
|
| 70 | } |
|
| 71 | ||
| 72 | return $this->controller->render($this->view, [ |
|
| 73 | 'model' => $model, |
|
| @@ 71-80 (lines=10) @@ | ||
| 68 | return ActiveForm::validate($model); |
|
| 69 | } |
|
| 70 | ||
| 71 | if ($load && $model->validate()) { |
|
| 72 | if ($model->sendEmail()) { |
|
| 73 | $this->trigger(self::EVENT_AFTER_REQUEST, $event); |
|
| 74 | Yii::$app->getSession()->setFlash('success', $this->successMessage); |
|
| 75 | ||
| 76 | return $this->redirectTo(Yii::$app->getHomeUrl()); |
|
| 77 | } else { |
|
| 78 | Yii::$app->getSession()->setFlash('error', $this->errorMessage); |
|
| 79 | } |
|
| 80 | } |
|
| 81 | ||
| 82 | return $this->controller->render($this->view, [ |
|
| 83 | 'model' => $model, |
|