summaryrefslogtreecommitdiff
path: root/modules/user/user.module
diff options
context:
space:
mode:
authorDavid Rothstein <drothstein@gmail.com>2016-02-24 14:25:49 -0500
committerDavid Rothstein <drothstein@gmail.com>2016-02-24 14:25:49 -0500
commitb8d9c44f83eca57039f648a0edb0f369f8d3e6b4 (patch)
tree2b97fdea5a364b7abc6728fb364244c0a52cbc73 /modules/user/user.module
parent2f54b101bf722849e456d859876b27b90ad7e479 (diff)
downloadbrdo-b8d9c44f83eca57039f648a0edb0f369f8d3e6b4.tar.gz
brdo-b8d9c44f83eca57039f648a0edb0f369f8d3e6b4.tar.bz2
Revert "Drupal 7.43"
This reverts commit 2f54b101bf722849e456d859876b27b90ad7e479.
Diffstat (limited to 'modules/user/user.module')
-rw-r--r--modules/user/user.module16
1 files changed, 5 insertions, 11 deletions
diff --git a/modules/user/user.module b/modules/user/user.module
index d38de69b1..c33aa0982 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -1308,12 +1308,10 @@ function user_user_presave(&$edit, $account, $category) {
elseif (!empty($edit['picture_delete'])) {
$edit['picture'] = NULL;
}
- }
-
- // Filter out roles with empty values to avoid granting extra roles when
- // processing custom form submissions.
- if (isset($edit['roles'])) {
- $edit['roles'] = array_filter($edit['roles']);
+ // Prepare user roles.
+ if (isset($edit['roles'])) {
+ $edit['roles'] = array_filter($edit['roles']);
+ }
}
// Move account cancellation information into $user->data.
@@ -2229,11 +2227,7 @@ function user_login_final_validate($form, &$form_state) {
}
}
else {
- // Use $form_state['input']['name'] here to guarantee that we send
- // exactly what the user typed in. $form_state['values']['name'] may have
- // been modified by validation handlers that ran earlier than this one.
- $query = isset($form_state['input']['name']) ? array('name' => $form_state['input']['name']) : array();
- form_set_error('name', t('Sorry, unrecognized username or password. <a href="@password">Have you forgotten your password?</a>', array('@password' => url('user/password', array('query' => $query)))));
+ form_set_error('name', t('Sorry, unrecognized username or password. <a href="@password">Have you forgotten your password?</a>', array('@password' => url('user/password', array('query' => array('name' => $form_state['values']['name']))))));
watchdog('user', 'Login attempt failed for %user.', array('%user' => $form_state['values']['name']));
}
}