You are here

function _autologout_logout in Automated Logout 7.4

Same name and namespace in other branches
  1. 6.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 663
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('Autologout', 'Session automatically closed for %name by autologout.', array(
      '%name' => $user->name,
    ));
  }

  // Destroy the current session.
  module_invoke_all('user_logout', $user);
  session_destroy();

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