Commit ae05bf285a25b6453e0976205dc779044e46f1dc

Authored by alex
1 parent ba0b6a46

Get block to center

Showing 1 changed file with 7 additions and 1 deletions   Show diff stats
frontend/controllers/SiteController.php
@@ -209,8 +209,14 @@ @@ -209,8 +209,14 @@
209 'scenario' => Feedback::SCENARIO_CONTACT, 209 'scenario' => Feedback::SCENARIO_CONTACT,
210 ] 210 ]
211 ); 211 );
212 - if ($model->load(Yii::$app->request->post()) && $model->save()) { 212 + if ($model->load(Yii::$app->request->post())) {
213 213
  214 + if (!empty($model->reCaptcha && $model->reCaptcha !== null || $model->reCaptcha != ''))
  215 + return [
  216 + 'success' => 'false',
  217 + 'error' => 'You don`t confirm Recaptcha. Unblock JS to this'
  218 + ];
  219 + $model->save();
214 return [ 220 return [
215 'success' => true, 221 'success' => true,
216 'message' => \Yii::t('app', 'Заявка успешно отправлена'), 222 'message' => \Yii::t('app', 'Заявка успешно отправлена'),