| @@ 116-132 (lines=17) @@ | ||
| 113 | * |
|
| 114 | * @return mixed |
|
| 115 | */ |
|
| 116 | public function actionContact() |
|
| 117 | { |
|
| 118 | $model = new ContactForm(); |
|
| 119 | if ($model->load(Yii::$app->request->post()) && $model->validate()) { |
|
| 120 | if ($model->sendEmail(Yii::$app->params['adminEmail'])) { |
|
| 121 | Yii::$app->session->setFlash('success', 'Thank you for contacting us. We will respond to you as soon as possible.'); |
|
| 122 | } else { |
|
| 123 | Yii::$app->session->setFlash('error', 'There was an error sending email.'); |
|
| 124 | } |
|
| 125 | ||
| 126 | return $this->refresh(); |
|
| 127 | } else { |
|
| 128 | return $this->render('contact', [ |
|
| 129 | 'model' => $model, |
|
| 130 | ]); |
|
| 131 | } |
|
| 132 | } |
|
| 133 | ||
| 134 | /** |
|
| 135 | * Displays about page. |
|
| @@ 170-186 (lines=17) @@ | ||
| 167 | * |
|
| 168 | * @return mixed |
|
| 169 | */ |
|
| 170 | public function actionRequestPasswordReset() |
|
| 171 | { |
|
| 172 | $model = new PasswordResetRequestForm(); |
|
| 173 | if ($model->load(Yii::$app->request->post()) && $model->validate()) { |
|
| 174 | if ($model->sendEmail()) { |
|
| 175 | Yii::$app->session->setFlash('success', 'Check your email for further instructions.'); |
|
| 176 | ||
| 177 | return $this->goHome(); |
|
| 178 | } else { |
|
| 179 | Yii::$app->session->setFlash('error', 'Sorry, we are unable to reset password for email provided.'); |
|
| 180 | } |
|
| 181 | } |
|
| 182 | ||
| 183 | return $this->render('requestPasswordResetToken', [ |
|
| 184 | 'model' => $model, |
|
| 185 | ]); |
|
| 186 | } |
|
| 187 | ||
| 188 | /** |
|
| 189 | * Resets password. |
|