No Matches
BxDolCaptcha Class Reference
Inheritance diagram for BxDolCaptcha:
BxDolFactory iBxDolFactoryObject BxBaseCaptchaHCaptcha BxBaseCaptchaReCAPTCHAInvisible BxBaseCaptchaReCAPTCHANew BxTemplCaptchaHCaptcha BxTemplCaptchaReCAPTCHAInvisible BxTemplCaptchaReCAPTCHANew

Public Member Functions

 display ($bDynamicMode=false)
 check ()
 getUserResponse ()
 isAvailable ()

Static Public Member Functions

static getObjectInstance ($sObject=false)

Protected Member Functions

 __construct ($aObject, $oTemplate)

Protected Attributes


Detailed Description

CAPTCHA objects.

Default captcha is stored in 'sys_captcha_default' setting option.

Creating the Captcha object:

Add record to 'sys_objects_captcha' table:

  • object: name of the captcha object, in the format: vendor prefix, underscore, module prefix, underscore, internal identifier or nothing; for example: bx_blogs - custom captcha in blogs module.
  • title: captcha title.
  • override_class_name: user defined class name which is derived from one of base captcha classes.
  • override_class_file: the location of the user defined class, leave it empty if class is located in system folders.

Example of usage

Display captcha:

$oCaptcha = BxDolCaptcha::getObjectInstance(); // get default captcha object instance
if ($oCaptcha) // check if captcha is available for using
echo $oCaptcha->display (); // output HTML which will automatically show captcha
static getObjectInstance($sObject=false)
Definition BxDolCaptcha.php:81

Check captcha:

$oCaptcha = BxDolCaptcha::getObjectInstance(); // get default captcha object instance
if ($oCaptcha && $oCaptcha->check ()) // check if captcha is correct
echo 'captcha is OK';
echo 'captcha is incorrect'; //

Constructor & Destructor Documentation

◆ __construct()

BxDolCaptcha::__construct ( $aObject,
$oTemplate )

Member Function Documentation

◆ check()

BxDolCaptcha::check ( )

◆ display()

BxDolCaptcha::display ( $bDynamicMode = false)

Display captcha.

$bDynamicMode- is AJAX mode or not, if true then HTML code with captcha is loaded dynamically.

Reimplemented in BxBaseCaptchaHCaptcha, BxBaseCaptchaReCAPTCHAInvisible, and BxBaseCaptchaReCAPTCHANew.

◆ getObjectInstance()

static BxDolCaptcha::getObjectInstance ( $sObject = false)

Get captcha object instance by object name

$sObjectobject name
object instance or false on error

Implements iBxDolFactoryObject.

◆ getUserResponse()

BxDolCaptcha::getUserResponse ( )

Return text entered by user

◆ isAvailable()

BxDolCaptcha::isAvailable ( )

Check if captcha is available, like all API keys are specified.

The documentation for this class was generated from the following file: