autologout.install in Automated Logout 6.4
Same filename and directory in other branches
Install file for JS Logout Module
File
autologout.installView source
<?php
/**
* @file
* Install file for JS Logout Module
*/
/**
* Implements hook_uninstall().
*/
function autologout_uninstall() {
variable_del('autologout_timeout');
variable_del('autologout_use_watchdog');
variable_del('autologout_redirect_url');
variable_del('autologout_message');
variable_del('autologout_padding');
variable_del('autologout_enforce_admin');
variable_del('autologout_no_dialog');
foreach (user_roles(TRUE) as $key => $role) {
variable_del('autologout_role_' . $key);
}
}
/**
* Upgrade autologout 2.x series to 4.x series.
*/
function autologout_update_6400() {
$ret = array();
$old_settings = variable_get('autologout', FALSE);
if (!empty($old_settings)) {
if (!empty($old_settings['enabled'])) {
variable_set('autologout_enabled', $old_settings['enabled']);
}
if (!empty($old_settings['timeout'])) {
variable_set('autologout_timeout', $old_settings['timeout']);
}
if (!empty($old_settings['use_watchdog'])) {
variable_set('autologout_use_watchdog', $old_settings['use_watchdog']);
}
if (!empty($old_settings['logout_message'])) {
variable_set('autologout_message', $old_settings['logout_message']);
}
if (!empty($old_settings['redirect_url'])) {
variable_set('autologout_redirect_url', $old_settings['redirect_url']);
}
if (!empty($old_settings['refresh_delta']) && $old_settings['refresh_delta'] >= 0) {
variable_set('autologout_padding', $old_settings['refresh_delta']);
}
}
// Delete the autologout table.
if (db_table_exists('autologout')) {
// This functionality no longer exists.
db_drop_table($ret, 'autologout');
}
cache_clear_all();
return $ret;
}
Functions
Name | Description |
---|---|
autologout_uninstall | Implements hook_uninstall(). |
autologout_update_6400 | Upgrade autologout 2.x series to 4.x series. |