From 794b53e19523bc1e4c6228d50c3b298314199051 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Thu, 26 Jan 2006 08:51:10 +0000 Subject: - Patch #46137 by drumm/moshe: load anonymous user if authentication failed. --- modules/user/user.module | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'modules/user/user.module') diff --git a/modules/user/user.module b/modules/user/user.module index 405607a7b..e91ba37e6 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -884,8 +884,10 @@ function user_login_submit($form_id, $form_values) { function user_authenticate($name, $pass) { global $user; - // Try to log in the user locally: - $user = user_load(array('name' => $name, 'pass' => $pass, 'status' => 1)); + // Try to log in the user locally. Don't set $user unless successful. + if ($account = user_load(array('name' => $name, 'pass' => $pass, 'status' => 1))) { + $user = $account; + }; // Strip name and server from ID: if ($server = strrchr($name, '@')) { -- cgit v1.2.3