UndefinedOffset\NoCaptcha\Forms\NocaptchaField
Synopsis
class NocaptchaField
extends FormField
{
- // members
- private static $site_key;
- private static $secret_key;
- private static integer $recaptcha_version = 2;
- private static float $minimum_score = 0.4;
- private static $proxy_server;
- private static $proxy_auth;
- private static $proxy_port;
- private static boolean $verify_ssl = true;
- private static string $default_theme = 'light';
- private static string $default_type = 'image';
- private static string $default_size = 'normal';
- private static boolean $default_handle_submit = true;
- protected $_siteKey;
- protected $_secretKey;
- protected $_proxyServer;
- protected $_proxyAuth;
- protected $_proxyPort;
- private $_captchaTheme;
- private $_captchaType;
- private $_captchaSize;
- private $_captchaBadge;
- protected $verifyResponse;
- protected $minimumScore;
- private $handleSubmitEvents;
- // methods
- public void __construct()
- public string Field()
- protected void configureRequirementsForV2()
- protected void configureRequirementsForV3()
- public bool validate()
- public NocaptchaField setHandleSubmitEvents()
- public boolean getHandleSubmitEvents()
- public NocaptchaField setTheme()
- public string getCaptchaTheme()
- public NocaptchaField setCaptchaType()
- public string getCaptchaType()
- public NocaptchaField setCaptchaSize()
- public string getCaptchaSize()
- public NocaptchaField setCaptchaBadge()
- public string getCaptchaBadge()
- public string getSiteKey()
- public void setSiteKey()
- public void setSecretKey()
- public void setProxyServer()
- public void setProxyAuth()
- public void setProxyPort()
- public string getFormID()
- public array getVerifyResponse()
- public NocaptchaField setMinimumScore()
- public float getMinimumScore()
- public int getRecaptchaVersion()
Hierarchy
Extends
- SilverStripe\Forms\FormField
Members
private
- $_captchaBadge
—
string
Captcha badge, currently options are bottomright, bottomleft and inline - $_captchaSize
—
string
Captcha size, currently options are normal and compact - $_captchaTheme
—
string
Captcha theme, currently options are light and dark - $_captchaType
—
string
Captcha type, currently options are audio and image - $default_handle_submit
—
boolean
Whether form submit events are handled directly by this module. - $default_size
—
string
Captcha size, currently options are normal, compact and invisible - $default_theme
—
string
Captcha theme, currently options are light and dark - $default_type
—
string
Captcha type, currently options are audio and image - $handleSubmitEvents
—
boolean
Whether form submit events are handled directly by this module. -
$minimum_score
Reject spam under this score -
$proxy_auth
CURL Proxy authentication -
$proxy_port
CURL Proxy port -
$proxy_server
CURL Proxy Server location -
$recaptcha_version
Recaptcha version (2|3) -
$secret_key
Recaptcha Secret Key -
$site_key
Recaptcha Site Key -
$verify_ssl
Verify SSL Certificates
protected
-
$_proxyAuth
CURL Proxy authentication Configurable via Injector config -
$_proxyPort
CURL Proxy port Configurable via Injector config -
$_proxyServer
CURL Proxy Server location Configurable via Injector config -
$_secretKey
Recaptcha Site Key Configurable via Injector config -
$_siteKey
Recaptcha Site Key Configurable via Injector config - $minimumScore
—
float
Minimum score for this instance (0.0 = spam, 1.0 = good) - $verifyResponse
—
array
The verification response
Methods
protected
- configureRequirementsForV2() — Configure any javascript and css requirements that are specific for recaptcha v2.
- configureRequirementsForV3() — Configure any javascript and css requirements that are specific for recaptcha v3.
public
- __construct() — Creates a new Recaptcha 2 field.
- Field() — Adds in the requirements for the field
- getCaptchaBadge() — Gets the Badge position for this captcha
- getCaptchaSize() — Gets the size for this captcha
- getCaptchaTheme() — Gets the theme for this captcha
- getCaptchaType() — Gets the type for this captcha
- getFormID() — Gets the form's id
- getHandleSubmitEvents() — Get whether form submit events are handled directly by this module.
- getMinimumScore()
- getRecaptchaVersion() — Gets the version of recaptcha being used
- getSiteKey() — Gets the site key configured via NocaptchaField.site_key this is used in the template
- getVerifyResponse()
- setCaptchaBadge() — Sets the badge position for this captcha
- setCaptchaSize() — Sets the size for this captcha
- setCaptchaType() — Sets the type for this captcha
- setHandleSubmitEvents() — Sets whether form submit events are handled directly by this module.
- setMinimumScore()
- setProxyAuth() — Setter for _proxyAuth to allow injector config to override the value
- setProxyPort() — Setter for _proxyPort to allow injector config to override the value
- setProxyServer() — Setter for _proxyServer to allow injector config to override the value
- setSecretKey() — Setter for _secretKey to allow injector config to override the value
- setSiteKey() — Setter for _siteKey to allow injector config to override the value
- setTheme() — Sets the theme for this captcha
- validate() — Validates the captcha against the Recaptcha API