--- user.module.dist 2005-08-24 16:01:24.000000000 +0100 +++ user.module 2005-08-24 16:31:06.000000000 +0100 @@ -949,13 +949,19 @@ global $base_url; $edit = $_POST['edit']; - if ($edit['name'] && !($account = user_load(array('name' => $edit['name'], 'status' => 1)))) { - form_set_error('name', t('Sorry. The username %name is not recognized.', array('%name' => theme('placeholder', $edit['name'])))); + if ($edit['name']) { + $account = user_load(array('name' => $edit['name'], 'status' => 1)); + if (!$account->uid) { + form_set_error('name', t('Sorry. The username %name is not recognized.', array('%name' => theme('placeholder', $edit['name'])))); + } } - else if ($edit['mail'] && !($account = user_load(array('mail' => $edit['mail'], 'status' => 1)))) { - form_set_error('mail', t('Sorry. The e-mail address %email is not recognized.', array('%email' => theme('placeholder', $edit['mail'])))); + else if ($edit['mail']) { + $account = user_load(array('mail' => $edit['mail'], 'status' => 1)); + if (!$account->uid) { + form_set_error('mail', t('Sorry. The e-mail address %email is not recognized.', array('%email' => theme('placeholder', $edit['mail'])))); + } } - if ($account) { + if ($account->uid) { $from = variable_get('site_mail', ini_get('sendmail_from')); // Mail one time login URL and instructions. @@ -976,9 +982,6 @@ drupal_goto('user'); } else { - if ($edit) { - drupal_set_message(t('You must provide either a username or e-mail address.'), 'error'); - } // Display form: $output = '

'. t('Enter your username or your e-mail address.') .'

'; $output .= form_textfield(t('Username'), 'name', $edit['name'], 30, 64);