function autologout_boot in Automated Logout 6.2
Same name and namespace in other branches
- 6 autologout.module \autologout_boot()
- 7.2 autologout.module \autologout_boot()
Implementation of hook_boot(). NOTE: Do as little as possible here. A lot of modules are not loaded at this point.
File
- ./
autologout.module, line 127 - Used to automagically log out a user after a preset time, AjK May 2006
Code
function autologout_boot() {
// Do not start session for anonymous users,
// as it would break Pressflow's lazy sessions.
// (Copy of user_is_anonymous(), which is undefined
// when called from hook_boot() by drush.)
if (!$GLOBALS['user']->uid || !empty($GLOBALS['menu_admin'])) {
return;
}
if (!isset($_SESSION['autologout_hits'])) {
$_SESSION['autologout_hits'] = array();
}
$_SESSION['autologout_hits'][] = time();
}