summaryrefslogtreecommitdiff
path: root/modules/user.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/user.module')
-rw-r--r--modules/user.module6
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/user.module b/modules/user.module
index 405607a7b..e91ba37e6 100644
--- a/modules/user.module
+++ b/modules/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, '@')) {