Documentation

CRM_Utils_ReCAPTCHA
in package

Tags
copyright

CiviCRM LLC https://civicrm.org/licensing

Table of Contents

Properties

$_captcha  : mixed
$_name  : mixed
$_phrase  : mixed
$_url  : mixed
$_singleton  : CRM_Utils_ReCAPTCHA
Singleton.

Methods

checkAndAddCaptchaToForm()  : mixed
This checks the form criteria to see if reCAPTCHA should be added and then it adds it to the form if required.
checkResponse()  : bool
enableCaptchaOnForm()  : mixed
Enable ReCAPTCHA on form
hasSettingsAvailable()  : mixed
Check if reCaptcha settings is avilable to add on form.
singleton()  : CRM_Utils_ReCAPTCHA
Singleton function used to manage this object.
validate()  : mixed
QuickForm validate callback
add()  : mixed
Add element to form.
checkStandardConditionsForEnableReCAPTCHA()  : bool
Check the standard conditions for adding a ReCAPTCHA to the form

Properties

$_singleton

Singleton.

private static CRM_Utils_ReCAPTCHA $_singleton = \NULL

We only need one instance of this object. So we use the singleton pattern and cache the instance in this variable

Methods

checkAndAddCaptchaToForm()

This checks the form criteria to see if reCAPTCHA should be added and then it adds it to the form if required.

public static checkAndAddCaptchaToForm(string $formName, CRM_Core_Form &$form) : mixed

DO NOT USE OUTSIDE OF CiviCRM core.

Parameters
$formName : string
$form : CRM_Core_Form
Tags
throws
CRM_Core_Exception
throws
UnauthorizedException

checkResponse()

public static checkResponse(string $response) : bool
Parameters
$response : string
Return values
bool

enableCaptchaOnForm()

Enable ReCAPTCHA on form

public static enableCaptchaOnForm(CRM_Core_Form &$form[, bool $checkStandardConditions = TRUE ]) : mixed

DO NOT USE OUTSIDE OF CiviCRM core.

Parameters
$form : CRM_Core_Form
$checkStandardConditions : bool = TRUE

Check the standard conditions before adding?

hasSettingsAvailable()

Check if reCaptcha settings is avilable to add on form.

public static hasSettingsAvailable() : mixed

checkStandardConditionsForEnableReCAPTCHA()

Check the standard conditions for adding a ReCAPTCHA to the form

private static checkStandardConditionsForEnableReCAPTCHA() : bool
Return values
bool

        
On this page

Search results