SilverStripe\Akismet\AkismetSpamProtector
Spam protector for Akismet
- Author: Damian Mooyman
Synopsis
class AkismetSpamProtector
implements
SpamProtector
{
- // members
- private static string $api_key = '';
- protected string $apiKey = '';
- private static string $bypass_permission = 'ADMIN';
- private static boolean $bypass_members = false;
- private static boolean $require_confirmation = false;
- private static boolean $save_spam = false;
- private array $fieldMapping = ;
- // methods
- public $this setApiKey()
- public string getApiKey()
- public AkismetService|null getService()
- public void getFormField()
- public void setFieldMapping()
Hierarchy
Uses
- SilverStripe\Core\Injector\Injectable
Implements
- SilverStripe\SpamProtection\SpamProtector
Members
private
- $api_key
—
string
Set this to your API key - $bypass_members
—
boolean
Set to try to bypass check for all logged in users - $bypass_permission
—
string
Permission required to bypass check - $fieldMapping — array
- $require_confirmation
—
boolean
IMPORTANT: If you are operating in a country (such as Germany) that has content transmission disclosure requirements, set this to true in order to require a user prompt prior to submission of user data to the Akismet servers - $save_spam
—
boolean
Set to true to disable spam errors, instead saving this field to the dataobject with the spam detection as a flag. This will disable validation errors when spam is encountered.
protected
- $apiKey
—
string
The API key that will be used for the service. Can be set on the singleton to take priority over configuration.
Methods
public
- getApiKey() — Get the API key. Priority is given first to explicitly set values on a singleton, then to configuration values and finally to environment values.
- getFormField()
- getService() — Retrieves Akismet API object, or null if not configured
- setApiKey() — Set the API key
- setFieldMapping()