You are here

function recovery_pass_cron in Recovery Password (Email New Password) 7

Same name and namespace in other branches
  1. 8 recovery_pass.module \recovery_pass_cron()

Implements hook_cron().

File

./recovery_pass.module, line 290
Alters default Drupal password recovery process by overriding default submit.

Code

function recovery_pass_cron() {
  $expiry_period = strtotime("-" . variable_get('recovery_pass_expiry_period', '1') . " week");

  // Delete all records more created than one week ago.
  $entry_deleted = db_delete('recovery_pass')
    ->condition('changed', $expiry_period, '<')
    ->execute();
  if ($entry_deleted) {
    watchdog('recovery_pass', 'Error deleting entry from recovery_table at cron time.', array(), WATCHDOG_NOTICE, 'link');
  }
}