summaryrefslogtreecommitdiff
path: root/modules/user
diff options
context:
space:
mode:
Diffstat (limited to 'modules/user')
-rw-r--r--modules/user/user.pages.inc8
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/user/user.pages.inc b/modules/user/user.pages.inc
index 697a82d2c..25f4528f0 100644
--- a/modules/user/user.pages.inc
+++ b/modules/user/user.pages.inc
@@ -76,9 +76,11 @@ function user_pass_submit($form, &$form_state) {
$account = $form_state['values']['account'];
// Mail one time login URL and instructions using current language.
- _user_mail_notify('password_reset', $account, $language);
- watchdog('user', 'Password reset instructions mailed to %name at %email.', array('%name' => $account->name, '%email' => $account->mail));
- drupal_set_message(t('Further instructions have been sent to your e-mail address.'));
+ $mail = _user_mail_notify('password_reset', $account, $language);
+ if (!empty($mail)) {
+ watchdog('user', 'Password reset instructions mailed to %name at %email.', array('%name' => $account->name, '%email' => $account->mail));
+ drupal_set_message(t('Further instructions have been sent to your e-mail address.'));
+ }
$form_state['redirect'] = 'user';
return;