You are here

function masquerade_cron in Masquerade 7

Same name and namespace in other branches
  1. 5 masquerade.module \masquerade_cron()
  2. 6 masquerade.module \masquerade_cron()

Implements hook_cron().

Cleanup masquerade records where people didn't use the switch back link that would have cleanly removed the user switch record.

File

./masquerade.module, line 80
The masquerade module allows administrators to masquerade as other user.

Code

function masquerade_cron() {

  // see http://drupal.org/node/268487 before modifying this query
  $subquery = db_select('sessions', 's');
  $subquery
    ->addField('s', 'sid');
  $query = db_delete('masquerade');
  $query
    ->condition('sid', $subquery, 'NOT IN');
  $query
    ->execute();
}