CRM_Utils_ReCAPTCHA
in package
Tags
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
$_captcha
protected
mixed
$_captcha
= \NULL
$_name
protected
mixed
$_name
= \NULL
$_phrase
protected
mixed
$_phrase
= \NULL
$_url
protected
mixed
$_url
= \NULL
$_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
checkResponse()
public
static checkResponse(string $response) : bool
Parameters
- $response : string
Return values
boolenableCaptchaOnForm()
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
singleton()
Singleton function used to manage this object.
public
static & singleton() : CRM_Utils_ReCAPTCHA
Return values
CRM_Utils_ReCAPTCHAvalidate()
QuickForm validate callback
public
static validate(mixed $value, CRM_Core_Form $form) : mixed
Parameters
- $value : mixed
- $form : CRM_Core_Form
add()
Add element to form.
private
static add(CRM_Core_Form &$form) : mixed
Parameters
- $form : CRM_Core_Form
checkStandardConditionsForEnableReCAPTCHA()
Check the standard conditions for adding a ReCAPTCHA to the form
private
static checkStandardConditionsForEnableReCAPTCHA() : bool