jbennecker/silverstripe-honeypotprotection

Installs: 80

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:silverstripe-vendormodule

1.0.4 2020-03-18 08:58 UTC

This package is auto-updated.

Last update: 2020-06-18 09:34:03 UTC


README

This module works by adding a normal text field which is visually hidden. The field is invalid when it's not empty. Bot will likely fill out the field, because they don't process css.

Requirements

Install

Install via composer.

composer require jbennecker/silverstripe-honeypotprotection

Set the default spam protector in src/_config/spamprotection.yml

---
name: spamprotection
---
SilverStripe\SpamProtection\Extension\FormSpamProtectionExtension:
  default_spam_protector: jbennecker\HoneypotProtection\HoneypotProtector

Usage

In custom forms add the field like this

use jbennecker\HoneypotProtection\HoneypotProtectorField;

....

$fields = new FieldList(
    ....
    HoneypotProtectorField::create('Phone') // Change title accordingly
)

For userforms simply add a spamprotector-field.