function user_logout

7.x user.pages.inc user_logout()

Menu callback; logs the current user out, and redirects to the home page.

1 call to user_logout()
7 string references to 'user_logout'
drupal-6.bare.database.php in drupal/modules/simpletest/tests/upgrade/drupal-6.bare.database.php
Bare installation of Drupal 6.17, for test purposes.
drupal-6.filled.database.php in drupal/modules/simpletest/tests/upgrade/drupal-6.filled.database.php
Filled installation of Drupal 6.17, for test purposes.
TriggerUserTokenTestCase::testUserTriggerTokenReplacement in drupal/modules/trigger/trigger.test
Tests a variety of token replacements in actions.
trigger_test_action_info in drupal/modules/trigger/tests/trigger_test.module
Implements hook_action_info().
trigger_trigger_info in drupal/modules/trigger/trigger.module
Implements hook_trigger_info().

... See full list

File

drupal/modules/user/user.pages.inc, line 168
User page callback file for the user module.

Code

function user_logout() {
  global $user;

  watchdog('user', 'Session closed for %name.', array('%name' => $user->name));

  module_invoke_all('user_logout', $user);

  // Destroy the current session, and reset $user to the anonymous user.
  session_destroy();

  drupal_goto();
}