camspiers/honeypot

There is no license information available for the latest version (3.0.0) of this package.

Installs: 47 083

Dependents: 0

Suggesters: 0

Security: 0

Stars: 7

Watchers: 2

Forks: 14

Open Issues: 5

Type:silverstripe-vendormodule

3.0.0 2019-08-14 03:01 UTC

This package is auto-updated.

Last update: 2024-03-19 10:31:21 UTC


README

A SilverStripe 4.x compatible version of camspiers/honeypot

Installation (with composer)

$ composer require heyday/silverstripe-honeypot

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

---
name: spamprotection
---
SilverStripe\SpamProtection\Extension\FormSpamProtectionExtension:
  default_spam_protector: Heyday\SilverStripe\HoneyPot\HoneyPotSpamProtector

Or, on a form by form basis

use Heyday\SilverStripe\HoneyPot\HoneyPotField;
use SilverStripe\Forms\Form;
use SilverStripe\Control\Controller;
use SilverStripe\Forms\FieldList;

/**
 * Class SomeForm
 */
class SomeForm extends Form
{
    /**
     * @param Controller $controller
     */
    public function __construct(Controller $controller)
    {
        $fields = new FieldList();
        $fields->push(new HoneyPotField('Website')); // 'Website' here can be any old string
        ...
    }
}