diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-07-01 12:47:30 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-07-01 12:47:30 +0000 |
commit | 5962cc5ab22bc07995b5886305255f93cab2a165 (patch) | |
tree | 5ab79c7b8b62b994c37ab0e82f45653b38eb6628 /modules/user | |
parent | 907faab2bbf0e4b701c7a2d73f653f513ff911cd (diff) | |
download | brdo-5962cc5ab22bc07995b5886305255f93cab2a165.tar.gz brdo-5962cc5ab22bc07995b5886305255f93cab2a165.tar.bz2 |
- Patch #477944 by DamZ: more streamlining and clean-up of session handling code.
Diffstat (limited to 'modules/user')
-rw-r--r-- | modules/user/user.module | 4 | ||||
-rw-r--r-- | modules/user/user.pages.inc | 6 |
2 files changed, 3 insertions, 7 deletions
diff --git a/modules/user/user.module b/modules/user/user.module index 6d884b5b9..29fb8c492 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -1970,10 +1970,8 @@ function _user_cancel($edit, $account, $method) { // After cancelling account, ensure that user is logged out. if ($account->uid == $user->uid) { - // Destroy the current session. + // Destroy the current session, and reset $user to the anonymous user. session_destroy(); - // Load the anonymous user. - $user = drupal_anonymous_user(); } else { drupal_session_destroy_uid($account->uid); diff --git a/modules/user/user.pages.inc b/modules/user/user.pages.inc index e9778e32e..bfeea5778 100644 --- a/modules/user/user.pages.inc +++ b/modules/user/user.pages.inc @@ -136,12 +136,10 @@ function user_logout() { watchdog('user', 'Session closed for %name.', array('%name' => $user->name)); - // Destroy the current session: - session_destroy(); module_invoke_all('user_logout', NULL, $user); - // Load the anonymous user - $user = drupal_anonymous_user(); + // Destroy the current session, and reset $user to the anonymous user. + session_destroy(); drupal_goto(); } |