function masquerade_user_delete

cis7 masquerade.module masquerade_user_delete($account)
cle7 masquerade.module masquerade_user_delete($account)
elmsmedia7 masquerade.module masquerade_user_delete($account)
icor7 masquerade.module masquerade_user_delete($account)
meedjum_blog7 masquerade.module masquerade_user_delete($account)
mooc7 masquerade.module masquerade_user_delete($account)

Implements hook_user_delete().

File

sites/all/modules/ulmus/masquerade/masquerade.module, line 535
The masquerade module allows administrators to masquerade as other user.

Code

function masquerade_user_delete($account) {
  // Cleanup tables.
  $query = db_delete('masquerade_users');
  $conditions = db_or();
  $conditions->condition('uid_from', $account->uid);
  $conditions->condition('uid_to', $account->uid);
  $query->condition($conditions);
  $query->execute();
  // Cleanup variables.
  $switches = variable_get('masquerade_quick_switches', array());
  $switches_new = array_diff($switches, array($account->uid));
  if ($switches != $switches_new) {
    variable_set('masquerade_quick_switches', $switches_new);
    // @TODO Implement block cache cleaning.
    menu_rebuild();
  }
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.