/var/www/vhosts/nabawater/frontend/controllers
NameSizeModeActions
AdsController.php16160644editdlrm
BranchController.php910030644editdlrm
CmsController.php19540644editdlrm
DriverController.php26350644editdlrm
HomeController.php24080644editdlrm
ItemController.php63130644editdlrm
OrderController.php55780644editdlrm
PageController.php13990644editdlrm
PaymentController.php331140644editdlrm
SiteController.php9920644editdlrm
UserController.php456530644editdlrm
Edit: /var/www/vhosts/nabawater/frontend/controllers/CmsController.php (1954B)
request->isAjax) { $url = 'https://www.google.com/recaptcha/api/siteverify'; $data = array( 'secret' => Configuration::get(Configuration::RECAPTCHA_SECRET_KEY), 'response' => $_POST['g-recaptcha-response'] ); $options = array( 'http' => array ( 'header' => "Content-Type: application/x-www-form-urlencoded\r\n", 'method' => 'POST', 'content' => http_build_query($data) ) ); $context = stream_context_create($options); $result = file_get_contents($url, false, $context); $response = json_decode($result); if ($response->success != true) { print_r($response);exit; $result= ["msg"=> Yii::t('frontend','Invalid request try again some time'),'status'=> Com::ERROR]; return $this->asJson($result); } $model = new Enquiry(); $post = Yii::$app->getRequest()->post(); $model->setScenario($model::ENQUIRY); if($model->load($post) && $model->validate()){ $model->save(); $result= ["msg"=> Yii::t('frontend','Successfull'),'status'=> Com::SUCCESS]; return $this->asJson($result); } print_r($model->getErrors()); die; } } }