You are here

function autologout_uninstall in Automated Logout 7.4

Same name and namespace in other branches
  1. 5 autologout.install \autologout_uninstall()
  2. 6.4 autologout.install \autologout_uninstall()
  3. 6 autologout.install \autologout_uninstall()
  4. 6.2 autologout.install \autologout_uninstall()
  5. 6.3 autologout.install \autologout_uninstall()
  6. 7.2 autologout.install \autologout_uninstall()

Implements hook_uninstall().

File

./autologout.install, line 11
Install file for JS Logout Module

Code

function autologout_uninstall() {
  variable_del('autologout_timeout');
  variable_del('autologout_use_watchdog');
  variable_del('autologout_redirect_url');
  variable_del('autologout_message');
  variable_del('autologout_inactivity_message');
  variable_del('autologout_padding');
  variable_del('autologout_enforce_admin');
  variable_del('autologout_role_logout');
  variable_del('autologout_max_timeout');
  variable_del('autologout_no_dialog');
  variable_del('autologout_whitelisted_ip_addresses');
  foreach (user_roles(TRUE) as $key => $role) {
    variable_del('autologout_role_' . $key);
    variable_del('autologout_role_' . $key . '_timeout');
  }
  $uids = array();

  // Remove all timeouts for individual users.
  $result = db_query("SELECT DISTINCT(uid) FROM {users}")
    ->fetchAll();
  foreach ($result as $uid) {
    $uid = $uid->uid;
    variable_del('autologout_user_' . $uid);
  }
}