Class Recaptcha
Supplies methods for creating and verifying a reCAPTCHA captcha challenge.
Copyright: Copyright (c) 2010, Phillips Data, Inc.
License: The Blesta License Agreement
Link: Blesta
Located at helpers/recaptcha/recaptcha.php
Methods summary
public
|
#
__construct( string $private_key, string $public_key )
Establish a new instance of reCAPTCHA with the given private/public keys |
public
string
|
#
getHtml( string $theme = null, string $custom_widget = "recaptcha_widget" )
Fetches all HTML, including javascript to display the captcha form elements |
public
|
#
setCustomBody( string $html )
Sets the given HTML to be used for a custom theme when Recaptcha::getHtml is called. |
public
|
#
setCustomOptions( array $options )
Sets options to be set in the javascript 'RecaptchaOptions' variable, things like 'lang', 'theme', 'custom_translations', etc. |
public
boolean
|
#
verify( string $challenge, string $response )
Verifies that the captcha was answered successfully by making a request to the remote reCAPTCHA server. |
private
string
|
|
private
string
|
|
private
string
|
#
captchaOptions( )
Builds the custom javascript options and sets them to the javascript 'RecaptchaOptions' variable. |
private
string
|
#
getScheme( )
Determine whether this server is currently running under a secure HTTP connection, and return the appropriate scheme. |
Magic methods summary
Properties summary
public
string
|
$error |
#
The error, if Recaptcha::verify() returned false |
private
string
|
$uri |
#
The URI to the reCAPTCHA API |
private
string
|
$private_key |
#
The secret key for this captcha |
private
string
|
$public_key |
#
The public key for this captcha |
private
string
|
$custom_body |
#
The HTML to use for the custom captcha body |
private
array
|
$custom_options |
#
The javascript options to set for this captcha |