function honeypot_cron in Honeypot 8
Same name and namespace in other branches
- 6 honeypot.module \honeypot_cron()
- 7 honeypot.module \honeypot_cron()
- 2.0.x honeypot.module \honeypot_cron()
Implements hook_cron().
File
- ./
honeypot.module, line 35 - Honeypot module, for deterring spam bots from completing Drupal forms.
Code
function honeypot_cron() {
// Delete {honeypot_user} entries older than the value of honeypot_expire.
$expire_limit = \Drupal::config('honeypot.settings')
->get('expire');
\Drupal::database()
->delete('honeypot_user')
->condition('timestamp', \Drupal::time()
->getRequestTime() - $expire_limit, '<')
->execute();
}