| 1 |
<?php |
| 2 |
class AccuaForm_Validation_Captcha extends Validation { |
| 3 |
protected $message = "Error: The reCATPCHA response provided was incorrect. Please re-try."; |
| 4 |
protected $privateKey; |
| 5 |
|
| 6 |
public function isValid($value) { |
| 7 |
require_once(dirname(__FILE__) . "/../../PFBC/Resources/recaptchalib.php"); |
| 8 |
$resp = recaptcha_check_answer ($this->privateKey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]); |
| 9 |
if($resp->is_valid) |
| 10 |
return true; |
| 11 |
else |
| 12 |
return false; |
| 13 |
} |
| 14 |
} |
| 15 |
|