1 user.pages.inc | user_pass_reset_form_submit($form, &$form_state) |
Submit handler for user_pass_reset_form().
File
- core/
modules/ user/ user.pages.inc, line 287 - User page callback file for the user module.
Code
function user_pass_reset_form_submit($form, &$form_state) {
global $user;
$user = $form['#account'];
$user->pass = $form_state['values']['pass'];
$user->save();
// user_login_finalize() also updates the login timestamp of the user, which
// invalidates further use of the one-time login link.
user_login_finalize();
// Clear any password reset flood events for this user.
flood_clear_event('pass_reset_user', $user->uid);
backdrop_set_message(t('Your account password has been updated.'));
watchdog('user', 'User %name used one-time password reset link at time %timestamp.', array('%name' => $form['#account']->name, '%timestamp' => format_date(REQUEST_TIME, 'long')));
backdrop_goto();
}