function user_pass_submit

Form submission handler for user_pass().

See also

user_pass_validate()

File

modules/user/user.pages.inc, line 117

Code

function user_pass_submit($form, &$form_state) {
    global $language;
    $name = $form_state['values']['name'];
    if (isset($form_state['values']['account'])) {
        $account = $form_state['values']['account'];
        // Mail one time login URL and instructions using current language.
        $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,
            ));
        }
    }
    else {
        watchdog('user', 'Password reset form was submitted with an unknown or inactive account: %name.', array(
            '%name' => $name,
        ));
    }
    $password_reset_text = variable_get('user_password_reset_text', t('If %identifier is a valid account, an email will be sent with instructions to reset your password.'));
    drupal_set_message(format_string($password_reset_text, array(
        '%identifier' => $name,
    )));
    $form_state['redirect'] = 'user';
    return;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.