Skip to content

Commit

Permalink
Merge pull request #3 from muskie9/editableSpamField
Browse files Browse the repository at this point in the history
Add HoneyPotSpamProtector.php
  • Loading branch information
camspiers committed May 1, 2015
2 parents 86b54d1 + 2ab5aa7 commit 3ee6dfc
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,11 @@ For a SilverStripe `2.4` compatible version use the branch `1.0`
## Installation (with composer)

$ composer require camspiers/honeypot

Set the default spam protector in *mysite/_config/spamprotection.yml*

---
name: spamprotection
---
FormSpamProtectionExtension:
default_spam_protector: HoneyPotSpamProtector
23 changes: 23 additions & 0 deletions code/HoneyPotSpamProtector.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?php

/**
* @package honeypot
*/

class HoneyPotSpamProtector implements SpamProtector {

/**
* Returns the {@link HoneyPotField} associated with this protector
*
* @return HoneyPotField
*/
public function getFormField($name = null, $title = null, $value = null) {
return new HoneyPotField($name, $title, $value);
}

/**
* Not used by HoneyPotSpamProtector
*/
public function setFieldMapping($fieldMapping) {}

}

0 comments on commit 3ee6dfc

Please sign in to comment.