Blesta
  • Package
  • Class
  • Tree
  • Deprecated

Packages

  • blesta
    • app
      • components
        • events
          • default
      • controllers
      • models
    • components
      • auth
      • delivery
        • interfax
        • postal
          • methods
      • download
      • email
      • exchange
        • rates
          • foxrate
          • google
            • finance
          • yahoo
            • finance
      • gateway
        • payments
      • gateways
      • invoice
        • delivery
        • templates
      • json
      • modules
      • net
        • http
        • net
          • amazon
            • s3
          • geo
            • ip
      • plugins
      • recaptcha
      • security
      • session
        • cart
      • settingscollection
      • upgrades
      • upload
      • vcard
    • helpers
      • currency
        • format
      • data
        • structure
          • array
          • string
      • text
        • parser
  • com
    • tecnick
      • tcpdf
        • blesta
          • components
            • invoice
              • templates
                • quickbooks
                  • invoice
                • templates
                  • default
  • Crypt
    • AES
    • DES
    • Hash
    • Random
    • RC4
    • Rijndael
    • RSA
    • TerraDES
  • File
    • ANSI
    • ASN1
    • X509
  • Math
    • BigInteger
  • minPHP
    • components
      • input
      • record
    • helpers
      • color
      • data
        • structure
      • date
      • html
      • xml
    • lib
  • Net
    • SFTP
    • SSH1
    • SSH2
  • None
  • PHP
  • PHPMailer
  • Services
    • JSON
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Transport

Classes

  • Recaptcha

Class Recaptcha

Supplies methods for creating and verifying a reCAPTCHA captcha challenge.

Package: blesta\components\recaptcha
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

Establish a new instance of reCAPTCHA with the given private/public keys

Parameters

$private_key
string
$private_key The private key, as supplied by reCAPTCHA
$public_key
string
$public_key The public key, as supplied by reCAPTCHA
public string
# getHtml( string $theme = null, string $custom_widget = "recaptcha_widget" )

Fetches all HTML, including javascript to display the captcha form elements

Fetches all HTML, including javascript to display the captcha form elements

Parameters

$theme
string
$theme The reCAPTCHA theme to use, or 'custom' for a custom theme.
$custom_widget
string
$custom_widget The custom widget (i.e. HTML id attribute value) to use for the 'custom' theme.

Returns

string
The HTML to display
public
# setCustomBody( string $html )

Sets the given HTML to be used for a custom theme when Recaptcha::getHtml is called.

Sets the given HTML to be used for a custom theme when Recaptcha::getHtml is called.

Parameters

$html
string
$html The HTML to use for the custom theme

See

Recaptcha::getHtml()
public
# setCustomOptions( array $options )

Sets options to be set in the javascript 'RecaptchaOptions' variable, things like 'lang', 'theme', 'custom_translations', etc.

Sets options to be set in the javascript 'RecaptchaOptions' variable, things like 'lang', 'theme', 'custom_translations', etc.

Parameters

$options
array
$options A single-dimensional string indexed array (key/value pairs)
public boolean
# verify( string $challenge, string $response )

Verifies that the captcha was answered successfully by making a request to the remote reCAPTCHA server.

Verifies that the captcha was answered successfully by making a request to the remote reCAPTCHA server.

Parameters

$challenge
string
$challenge The value of the 'recaptcha_challenge_field' form field.
$response
string
$response The value of the 'recaptcha_response_field' form field.

Returns

boolean
True if the response is valid, false otherwise. If false, the error can be access via Recpatch::$error
private string
# captchaBody( )

Builds the captcha body

Builds the captcha body

Returns

string
HTML/javascript used to build the captcha
private string
# customBody( )

Builds the custom captcha body

Builds the custom captcha body

Returns

string
HTML used for the custom captcha body
private string
# captchaOptions( )

Builds the custom javascript options and sets them to the javascript 'RecaptchaOptions' variable.

Builds the custom javascript options and sets them to the javascript 'RecaptchaOptions' variable.

Returns

string
The HTML/javscript for defining custom options for this captcha
private string
# getScheme( )

Determine whether this server is currently running under a secure HTTP connection, and return the appropriate scheme.

Determine whether this server is currently running under a secure HTTP connection, and return the appropriate scheme.

Returns

string
The scheme currently in use (http:// or https://)

Magic methods summary

Properties summary

public string $error
#

The error, if Recaptcha::verify() returned false

The error, if Recaptcha::verify() returned false

private string $uri
#

The URI to the reCAPTCHA API

The URI to the reCAPTCHA API

private string $private_key
#

The secret key for this captcha

The secret key for this captcha

private string $public_key
#

The public key for this captcha

The public key for this captcha

private string $custom_body
#

The HTML to use for the custom captcha body

The HTML to use for the custom captcha body

private array $custom_options
#

The javascript options to set for this captcha

The javascript options to set for this captcha

Blesta API documentation generated by ApiGen 2.8.0