Blesta
  • Package
  • Class
  • Tree
  • Deprecated

Packages

  • blesta
    • app
      • controllers
      • models
    • components
      • areyouahuman
      • auth
        • motp
        • oath
      • delivery
        • interfax
        • postal
          • methods
      • download
      • email
      • events
        • default
      • exchange
        • rates
          • google
            • finance
          • yahoo
            • finance
      • gateway
        • payments
      • gateways
      • invoice
        • delivery
        • templates
          • quickbooks
            • invoice
      • json
      • modules
      • net
        • amazon
          • s3
        • http
        • net
          • geo
            • ip
      • plugins
      • recaptcha
      • reports
        • aging
          • invoices
        • custom
          • report
        • invoice
          • creation
        • tax
          • liability
        • transactions
          • applied
          • received
      • security
      • session
        • cart
      • settingscollection
      • upgrades
        • tasks
      • upload
      • vcard
    • helpers
      • currency
        • format
      • data
        • structure
          • array
          • string
      • text
        • parser
      • widget
        • client
  • minPHP
    • components
      • input
      • record
    • helpers
      • color
      • data
        • structure
      • date
      • form
      • html
      • javascript
      • xml
    • lib
  • None
  • PHP

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

Magic methods summary

Properties summary

public string $error
#

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

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

Blesta API documentation generated by ApiGen 2.8.0