\HoneyPotSpamProtector
Defines the spam protector that creates a "honey pot" on a form.
Honey pots are form fields that are hidden from the user's viewport. If they contain data
when the form is handled, the user can be identified as a bot.
- Author: Aaron Carlino <aaron@bluehousegroup.com>
Synopsis
class HoneyPotSpamProtector
extends ContactFormSpamProtector
{
- // members
- protected string $name = "ContactFormHoney";
- // Inherited members from ContactFormSpamProtector
- protected static boolean $log_spam_failures;
- protected static integer $spam_failure_limit;
- // methods
- public HoneyPotSpamProtector initialize()
- public boolean isSpam()
- public void logSpamAttempt()
- public HoneyPotSpamProtector setName()
- // Inherited methods from ContactFormSpamProtector
- public static void set_log_spam_failures()
- public static void set_spam_failure_limit()
- public static boolean ip_is_locked()
- public boolean isSpam()
- public string getMessage()
- public void initialize()
- public ContactFormSpamAttempt createSpamAttempt()
- public void logSpamAttempt()
Hierarchy
Extends
Members
protected
- $log_spam_failures — boolean
- $name — string
- $spam_failure_limit — int
Methods
public
- initialize() — Initializes the honey pot. Loads CSS, and adds the field
- isSpam() — Determines if the form post is spammy. If the field has value, it's probably a bot.
- logSpamAttempt() — Logs a spam attempt. Saves to the Notes field what the user entered in the honey pot
- setName() — Sets the name of the honey pot
Inherited from ContactFormSpamProtector
public
- createSpamAttempt() — Creates a failed spam attempt object witht the user's info
- getMessage() — Gets the message to return to the form when the spam question is failed
- initialize() — Initialize the spam protector, e.g. add fields to the form, load any requirements
- ip_is_locked() — Determine if an IP address is blocked by looking it up in the database and comparing to $spam_failure_limit
- isSpam() — Determine if the form data is spammy
- logSpamAttempt() — Logs a spam attempt to the database
- set_log_spam_failures() — If true, log the spam failures to the database
- set_spam_failure_limit() — Sets the number of tolerable spam failures before the form stops being rendered