You are here

function cas_cron in CAS 7

Same name and namespace in other branches
  1. 8 cas.module \cas_cron()
  2. 2.x cas.module \cas_cron()

Implements hook_cron().

File

./cas.module, line 417
Enables users to authenticate via a Central Authentication Service (CAS) Cas will currently work if the auto registration is turned on and will create user accounts automatically.

Code

function cas_cron() {

  // Clear old single logout session mapping data.
  $max_days = (int) variable_get('cas_single_logout_session_lifetime', 25);
  $seconds_in_day = 86400;
  $seconds = $max_days * $seconds_in_day;
  if ($seconds > 0) {
    db_delete('cas_login_data')
      ->condition('created', time() - $seconds, '<=')
      ->execute();
  }
}