You are here

function _autologout_logout in Automated Logout 6.4

Same name and namespace in other branches
  1. 7.4 autologout.module \_autologout_logout()

Helper to perform the actual logout.

2 calls to _autologout_logout()
autologout_ahah_logout in ./autologout.module
AJAX callback that performs the actual logout and redirects the user.
autologout_init in ./autologout.module
Implements hook_init().

File

./autologout.module, line 657
Used to automagically log out a user after a preset time.

Code

function _autologout_logout() {
  global $user;
  if (variable_get('autologout_use_watchdog', FALSE)) {
    watchdog('user', 'Session automatically closed for %name by autologout.', array(
      '%name' => $user->name,
    ));
  }

  // Determine if we are looking at Pressflow.
  $null = NULL;
  $_SESSION['autologout'] = TRUE;
  user_module_invoke('logout', $null, $user);
  if (!defined('CACHE_EXTERNAL')) {

    // Not Pressflow!
    session_destroy();
  }
  else {

    // Pressflow!
    drupal_session_destroy();
  }

  // Load the anonymous user.
  $user = drupal_anonymous_user();
}