SproutCMS

This is the code documentation for the SproutCMS project

class Recaptcha

Implementation of Google (No CAPTCHA) ReCAPTCHA

Source code (3 results)

/config/sprout.php   Highlighted file source

Line 198: * Default class to handle CAPTCHA fields: 'DefaultCaptcha' or 'Recaptcha'
Line 200: $config['captcha'] = 'Recaptcha';
Line 204: * ReCAPTCHA keys, see https://www.google.com/recaptcha
Line 208: $config['recaptcha_public_key'] = 'please_generate_me_devel';
Line 209: $config['recaptcha_private_key'] = 'please_generate_me_devel';
Line 212: $config['recaptcha_public_key'] = 'please_generate_me';
Line 213: $config['recaptcha_private_key'] = 'please_generate_me';

/sprout/Helpers/Captcha.php   Highlighted file source

Line 42: * @param string $class_name e.g. DefaultCaptcha or Recaptcha

/sprout/Helpers/Recaptcha.php   Highlighted file source

Line 22: * Implementation of Google (No CAPTCHA) ReCAPTCHA
Line 24: class Recaptcha
Line 32: $key = Kohana::config('sprout.recaptcha_public_key');
Line 33: if (!$key) throw new Exception('ReCAPTCHA key not found');
Line 35: Needs::addJavascriptInclude('https://www.google.com/recaptcha/api.js');
Line 36: echo '<div class="g-recaptcha" data-sitekey="' . Enc::html($key) . '"></div>';
Line 45: if (empty($_POST['g-recaptcha-response'])) {
Line 51: $key = Kohana::config('sprout.recaptcha_private_key');
Line 52: if (!$key) throw new Exception('ReCAPTCHA key not found');
Line 57: $data['response'] = $_POST['g-recaptcha-response'];
Line 61: $res = HttpReq::req('https://www.google.com/recaptcha/api/siteverify', array('method' => 'post'), $data);

A total of 19 lines in 3 files were found