You are here

function _honeypot_log in Honeypot 7

Same name and namespace in other branches
  1. 8 honeypot.module \_honeypot_log()
  2. 6 honeypot.module \_honeypot_log()
  3. 2.0.x honeypot.module \_honeypot_log()

Log blocked form submissions.

Parameters

string $form_id: Form ID for the form on which submission was blocked.

string $type: String indicating the reason the submission was blocked. Allowed values:

  • honeypot: If honeypot field was filled in.
  • honeypot_time: If form was completed before the configured time limit.
2 calls to _honeypot_log()
_honeypot_honeypot_validate in ./honeypot.module
Validate honeypot field.
_honeypot_time_restriction_validate in ./honeypot.module
Validate honeypot's time restriction field.

File

./honeypot.module, line 407
Honeypot module, for deterring spam bots from completing Drupal forms.

Code

function _honeypot_log($form_id, $type) {
  honeypot_log_failure($form_id, $type);
  if (variable_get('honeypot_log', 0)) {
    $variables = array(
      '%form' => $form_id,
      '@cause' => $type == 'honeypot' ? t('submission of a value in the honeypot field') : t('submission of the form in less than minimum required time'),
    );
    watchdog('honeypot', 'Blocked submission of %form due to @cause.', $variables);
  }
}