You are here

function persistent_login_cron in Persistent Login 7

Same name and namespace in other branches
  1. 8 persistent_login.module \persistent_login_cron()
  2. 5 persistent_login.module \persistent_login_cron()
  3. 6 persistent_login.module \persistent_login_cron()

Implements hook_cron().

File

./persistent_login.module, line 321
Provide a "Remember Me" checkbox in the login form.

Code

function persistent_login_cron() {
  _persistent_login_invalidate('cron', 'expires > 0 AND expires < :expires', array(
    ':expires' => REQUEST_TIME,
  ));

  // Remove old login invalidation history
  if (0 < ($history_days = variable_get('persistent_login_history', 0))) {
    db_query('DELETE FROM {persistent_login_history} WHERE at < :time', array(
      ':time' => REQUEST_TIME - 86400 * $history_days,
    ));
  }
}