diff options
author | Dries Buytaert <dries@buytaert.net> | 2010-12-11 02:13:56 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2010-12-11 02:13:56 +0000 |
commit | 15ec834950024902a4cae90dc3e189e07512f7e1 (patch) | |
tree | fa04ca22b5590c127dd1bca4a9c7059756ef11cc /modules/user/user.module | |
parent | c8a813f82ebdc9b77eedaa6abf9335aa96149752 (diff) | |
download | brdo-15ec834950024902a4cae90dc3e189e07512f7e1.tar.gz brdo-15ec834950024902a4cae90dc3e189e07512f7e1.tar.bz2 |
- Patch #991340 by alexpott: user_validate_current_pass() uses global and not the user object from the form.
Diffstat (limited to 'modules/user/user.module')
-rw-r--r-- | modules/user/user.module | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/modules/user/user.module b/modules/user/user.module index 4a636dad1..7682f2522 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -1149,8 +1149,6 @@ function user_account_form(&$form, &$form_state) { * @see user_account_form() */ function user_validate_current_pass(&$form, &$form_state) { - global $user; - $account = $form['#user']; foreach ($form_state['values']['current_pass_required_values'] as $key => $name) { // This validation only works for required textfields (like mail) or @@ -1158,7 +1156,7 @@ function user_validate_current_pass(&$form, &$form_state) { // that prevent them from being empty if they are changed. if ((strlen(trim($form_state['values'][$key])) > 0) && ($form_state['values'][$key] != $account->$key)) { require_once DRUPAL_ROOT . '/' . variable_get('password_inc', 'includes/password.inc'); - $current_pass_failed = empty($form_state['values']['current_pass']) || !user_check_password($form_state['values']['current_pass'], $user); + $current_pass_failed = empty($form_state['values']['current_pass']) || !user_check_password($form_state['values']['current_pass'], $account); if ($current_pass_failed) { form_set_error('current_pass', t("Your current password is missing or incorrect; it's required to change the %name.", array('%name' => $name))); form_set_error($key); |