Version 3.1.4
This commit is contained in:
1 parent
1d4720f3e2
commit
ae5c01cc78
2563 files changed
+283048
-240689
No files matched your search
@@ -5,7 +5,7 @@
|
||||
* - Documentation and latest version
|
||||
* http://recaptcha.net/plugins/php/
|
||||
* - Get a reCAPTCHA API Key
|
||||
* http://recaptcha.net/api/getkey
|
||||
* https://www.google.com/recaptcha/admin/create
|
||||
* - Discussion group
|
||||
* http://groups.google.com/group/recaptcha
|
||||
*
|
||||
@@ -37,76 +37,54 @@
|
||||
/**
|
||||
* The reCAPTCHA server URL's
|
||||
*/
|
||||
define("RECAPTCHA_API_SERVER", "http://api.recaptcha.net");
|
||||
define("RECAPTCHA_API_SECURE_SERVER", "https://api-secure.recaptcha.net");
|
||||
define("RECAPTCHA_VERIFY_SERVER", "api-verify.recaptcha.net");
|
||||
define("RECAPTCHA_API_SERVER", "http://www.google.com/recaptcha/api");
|
||||
define("RECAPTCHA_API_SECURE_SERVER", "https://www.google.com/recaptcha/api");
|
||||
define("RECAPTCHA_VERIFY_SERVER", "www.google.com");
|
||||
|
||||
class captchaPlugin
|
||||
{
|
||||
/**
|
||||
* Registry object
|
||||
/**#@+
|
||||
* Registry objects
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
public $registry;
|
||||
|
||||
/**
|
||||
* Database object
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
public $DB;
|
||||
|
||||
/**
|
||||
* Settings object
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
public $settings;
|
||||
|
||||
/**
|
||||
* Request object
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
public $request;
|
||||
|
||||
/**
|
||||
* Language object
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
public $lang;
|
||||
|
||||
/**
|
||||
* Member object
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
public $member;
|
||||
|
||||
/**
|
||||
* Member data object
|
||||
*
|
||||
* @access protected
|
||||
* @var object
|
||||
*/
|
||||
public $memberData;
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* Error code from reCAPTCHA
|
||||
*
|
||||
* @access protected
|
||||
* @var string
|
||||
*/
|
||||
public $error;
|
||||
|
||||
/**
|
||||
* reCAPTCHA public key
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $public_key;
|
||||
|
||||
/**
|
||||
* reCAPTCHA private key
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $private_key;
|
||||
|
||||
/**
|
||||
* Flag whether to use SSL or not
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $useSSL;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
@@ -162,7 +140,7 @@ class captchaPlugin
|
||||
};
|
||||
</script>";
|
||||
|
||||
$html .= '<script type="text/javascript" src="'. $server . '/challenge?k=' . $this->public_key . '"></script>
|
||||
$html .= '<script type="text/javascript" src="'. $server . '/challenge?k=' . $this->public_key . '"></script>
|
||||
<noscript>
|
||||
<iframe src="'. $server . '/noscript?k=' . $this->public_key . '" height="300" width="500" frameborder="0"></iframe><br/>
|
||||
<textarea name="recaptcha_challenge_field" rows="3" cols="40"></textarea>
|
||||
@@ -198,7 +176,7 @@ class captchaPlugin
|
||||
return false;
|
||||
}
|
||||
|
||||
$response = $this->_recaptchaPost( RECAPTCHA_VERIFY_SERVER, "/verify",
|
||||
$response = $this->_recaptchaPost( RECAPTCHA_VERIFY_SERVER, "/recaptcha/api/verify",
|
||||
array (
|
||||
'privatekey' => $this->private_key,
|
||||
'remoteip' => $this->member->ip_address,
|
||||
@@ -207,7 +185,7 @@ class captchaPlugin
|
||||
)
|
||||
);
|
||||
|
||||
$answers = explode( "\n", $response [1] );
|
||||
$answers = explode( "\n", $response[1] );
|
||||
|
||||
if ( trim($answers[0]) == 'true' )
|
||||
{
|
||||
@@ -234,7 +212,7 @@ class captchaPlugin
|
||||
*/
|
||||
public function getSignupUrl( $domain = null, $appname = null )
|
||||
{
|
||||
return "http://recaptcha.net/api/getkey?" . $this->_encodeQueryString( array( 'domain' => $domain, 'app' => $appname ) );
|
||||
return "https://www.google.com/recaptcha/admin/create?" . $this->_encodeQueryString( array( 'domain' => $domain, 'app' => $appname ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user