NSWDPC\SpamProtection\RecaptchaV3SpamProtector
Spam protector class, when set and you call $form->enableSpamProtection() The RecaptchaV3Field will be added to the form
- Author: James Ellis <james.ellis@dpc.nsw.gov.au>
Synopsis
class RecaptchaV3SpamProtector
implements
SpamProtector
{
- // members
- private static integer $steps = 5;
- private static string $default_name = "recaptcha_protector";
- protected string $execute_action = "autoprotection/submit";
- protected integer $threshold = 1;
- // methods
- public RecaptchaV3Field getFormField()
- public void setFieldMapping()
- public static int getDefaultThreshold()
- public static array getRange()
- public static DropdownField getRangeField()
- public static TextField getActionField()
Hierarchy
Uses
- Silverstripe\Core\Config\Configurable
Implements
- SilverStripe\SpamProtection\SpamProtector
Members
private
- $default_name — int
- $steps — int
protected
- $execute_action — string
- $threshold — string
Methods
public
- getActionField() — Get a text field to allow user entry of an action for a form
- getDefaultThreshold() — Based on the value set in configuration for {@link TokenRespone}, return a threshold based on that If the configured value is out of bounds, the value of 70 is returned
- getFormField() — Return the field for the spam protector
- getRange() — Return range of allowed thresholds for use in forms The values returned are a percentage - 100 = all, 0 = none
- getRangeField() — Get a dropdown field to allow user-selection of a score for a form
- setFieldMapping() — In the RecaptchaV3 field, we use setFieldMapping to assign values to the field prior to getFormField being called