Такс, ошибочка..
<?php
class ControllerCaptchaGoogleCaptcha extends Controller {
public function index($error = array()) {
$this->load->language('captcha/google_captcha');
$data['heading_title'] = $this->language->get('heading_title');
$data['entry_captcha'] = $this->language->get('entry_captcha');
$this->document->addScript('https://www.google.com/recaptcha/api.js');
if (isset($error['captcha'])) {
$data['error_captcha'] = $error['captcha'];
} else {
$data['error_captcha'] = '';
}
$data['site_key'] = $this->config->get('google_captcha_key');
$data['route'] = $this->request->get['route'];
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/captcha/google_captcha.tpl')) {
return $this->load->view($this->config->get('config_template') . '/template/captcha/google_captcha.tpl', $data);
} else {
return $this->load->view('default/template/captcha/google_captcha.tpl', $data);
}
}
public function validate() {
$this->load->language('captcha/google_captcha');
//$recaptcha = file_get_contents('https://www.google.com/recaptcha/api/siteverify?secret=' . urlencode($this->config->get('google_captcha_secret')) . '&response=' . $this->request->post['g-recaptcha-response'] . '&remoteip=' . $this->request->server['REMOTE_ADDR']);
if (!empty($this->request->post['g-recaptcha-response'])) {
$curlConfig = array(
CURLOPT_URL => 'https://www.google.com/recaptcha/api/siteverify',
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => array(
'secret' => $this->config->get('google_captcha_secret'),
'response' => $this->request->post['g-recaptcha-response'],
'remoteip' => $this->request->server['REMOTE_ADDR']
)
);
$curl = curl_init();
curl_setopt_array($curl, $curlConfig);
$recaptcha = curl_exec($curl);
if (!$recaptcha) {
trigger_error(curl_error($curl));
}
curl_close($curl);
$recaptcha = json_decode($recaptcha, true);
} else {
$recaptcha = array();
}
if (!$recaptcha['success']) {
return $this->language->get('error_captcha');
}
}
}
Вот переделал, но все вернулось обратно. Так же проходишь проверку все нормально, если не проходишь или просто жмешь продолжить выдает кракозябры и:
Notice: Undefined index: success in /home/mozgmozg/fazlmarket.ru/docs/system/storage/modification/catalog/controller/captcha/google_captcha.php on line 63