function verify_token($input) { global $vbulletin; $kc_o = new KeyCAPTCHA_CLASS($vbulletin->options['keycaptcha_privatekey']); $kc_field = isset($_POST['hash']) ? $_POST['hash'] : $_POST['humanverify']['hash']; if (!$kc_o->check_result($kc_field)) { $this->error = 'keycaptcha_wrong_solution'; return false; } return true; }
/** * Validate the input code * * @access public * @return boolean Validation successful * @since 1.0 */ public function validate() { $private_key = $this->settings['keycaptcha_privatekey']; if (!$private_key) { return ''; } $capcode = $_REQUEST['capcode']; $kc_o = new KeyCAPTCHA_CLASS($private_key); if (!$kc_o->check_result($capcode)) { return false; } return true; }
public function captcha_check() { if (!isset($this->captcha[$this->config->main['captcha']])) { return true; } switch ($this->config->main['captcha']) { case 1: $response = @$_POST['g-recaptcha-response']; $request = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=" . $this->config->main['rc_private'] . "&response=" . $response . "&remoteip=" . $this->user->ip); $request = json_decode($request); if (!$request->success) { return false; } return true; break; case 2: $response = @$_POST['capcode']; require MCR_TOOL_PATH . 'libs/keycaptcha.php'; $kc = new KeyCAPTCHA_CLASS('', $this); if (!$kc->check_result($response)) { return false; } return true; break; default: return true; break; } }
/** * This event is being triggered by application * on receiveing of the User submitted form, protected by CAPTCHA (Step 2) * @param $secretword string input. - Not used * * @param $Ok boolean output. true if Captcha application successfully * processed the event. */ function onCaptcha_Confirm($secretword, &$Ok) { $Ok = false; $capcode = JRequest::getVar('capcode', ''); $this->params = new JParameter(JPluginHelper::getPlugin('system', 'keycaptcha')->params); // 3.0 //$kc_o = new KeyCAPTCHA_CLASS($this->params->get('keycaptcha_site_private_key')); $kc_o = new KeyCAPTCHA_CLASS($this->params->keycaptcha_site_private_key); if ($kc_o->check_result($capcode)) { $Ok = true; } return $Ok; }