From 464f4d3497617fadb9d7752868f1175849cfa6d2 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sat, 7 Jan 2012 08:21:00 -0800 Subject: Refactor to separate the framework from the app; drop message stuff, this app is just user management. Add a json view for individual users --- src/plugins/ReCaptcha.class.php | 47 ----------------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 src/plugins/ReCaptcha.class.php (limited to 'src/plugins/ReCaptcha.class.php') diff --git a/src/plugins/ReCaptcha.class.php b/src/plugins/ReCaptcha.class.php deleted file mode 100644 index 165493b..0000000 --- a/src/plugins/ReCaptcha.class.php +++ /dev/null @@ -1,47 +0,0 @@ -'', - 'private_key'=>''); - public static function description() { - return 'Add a reCaptcha to keep out spam users.'; - } - public static function configList() { - return array('public_key'=>'text', - 'private_key'=>'text'); - } - public function init() {} - - private $resp = null; - private function getResp() { - if ($this->resp===null) { - require_once('recaptchalib.php'); - @$response = $_POST['recaptcha_response_field']; - @$challenge = $_POST['recaptcha_challenge_field']; - $this->resp = recaptcha_check_answer($this->config['private_key'], - $_SERVER['REMOTE_ADDR'], - $challenge, - $response); - } - return $this->resp; - } - - private function getError() { - if ($_POST["recaptcha_response_field"] && !$this->antispam_verify()) { - return $this->getResp()->error; - } else { - return false; - } - } - - public function antispam_verify() { - return $this->getResp()->is_valid; - } - - public function antispam_html() { - require_once('recaptchalib.php'); - return recaptcha_get_html($this->config['public_key'], $this->getError()); - } -} -- cgit v1.2.3-2-g168b