You are here

function auto_login_url_cron in Auto Login URL 8

Same name and namespace in other branches
  1. 7 auto_login_url.module \auto_login_url_cron()
  2. 2.x auto_login_url.module \auto_login_url_cron()

Implements hook_cron().

File

./auto_login_url.module, line 43
Main file for auto_login_url module.

Code

function auto_login_url_cron() {
  $config = \Drupal::config('auto_login_url.settings');

  // Delete over one month auto logins.
  $connection = \Drupal::database();
  $connection
    ->delete('auto_login_url')
    ->condition('timestamp', time() - $config
    ->get('expiration'), '<=')
    ->execute();
}