From ae05bf285a25b6453e0976205dc779044e46f1dc Mon Sep 17 00:00:00 2001 From: dozer111 Date: Wed, 22 Aug 2018 15:03:17 +0300 Subject: [PATCH] Get block to center --- frontend/controllers/SiteController.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/frontend/controllers/SiteController.php b/frontend/controllers/SiteController.php index 6e15c37..2031a38 100755 --- a/frontend/controllers/SiteController.php +++ b/frontend/controllers/SiteController.php @@ -209,8 +209,14 @@ 'scenario' => Feedback::SCENARIO_CONTACT, ] ); - if ($model->load(Yii::$app->request->post()) && $model->save()) { + if ($model->load(Yii::$app->request->post())) { + if (!empty($model->reCaptcha && $model->reCaptcha !== null || $model->reCaptcha != '')) + return [ + 'success' => 'false', + 'error' => 'You don`t confirm Recaptcha. Unblock JS to this' + ]; + $model->save(); return [ 'success' => true, 'message' => \Yii::t('app', 'Заявка успешно отправлена'), -- libgit2 0.21.4