diff options
Diffstat (limited to 'modules/user/user.module')
-rw-r--r-- | modules/user/user.module | 6 |
1 files changed, 4 insertions, 2 deletions
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, '@')) { |