You are here

function captcha_cron in CAPTCHA 6.2

Same name and namespace in other branches
  1. 8 captcha.module \captcha_cron()
  2. 7 captcha.module \captcha_cron()

Implementation of hook_cron().

Remove old entries from captcha_sessions table.

File

./captcha.module, line 139
This module enables basic CAPTCHA functionality: administrators can add a CAPTCHA to desired forms that users without the 'skip CAPTCHA' permission (typically anonymous visitors) have to solve.

Code

function captcha_cron() {

  // remove challenges older than 1 day
  db_query('DELETE FROM {captcha_sessions} WHERE timestamp < %d', time() - 60 * 60 * 24);
}