summaryrefslogtreecommitdiff
path: root/modules/user/user.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-12-18 00:56:18 +0000
committerDries Buytaert <dries@buytaert.net>2010-12-18 00:56:18 +0000
commit57b1af03188120e4e76b8e1304123b724dd25aca (patch)
treed72679b007bd727e5a64db107b797188da00ede0 /modules/user/user.module
parent4b687afc002b0608a730e82d4ad5d605347e55bc (diff)
downloadbrdo-57b1af03188120e4e76b8e1304123b724dd25aca.tar.gz
brdo-57b1af03188120e4e76b8e1304123b724dd25aca.tar.bz2
- Patch #991270 by carlos8f, chx: password_count_log2 var out of bounds is a sorry mess.
Diffstat (limited to 'modules/user/user.module')
-rw-r--r--modules/user/user.module7
1 files changed, 2 insertions, 5 deletions
diff --git a/modules/user/user.module b/modules/user/user.module
index d464a7a7b..5411d35e9 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -2169,7 +2169,7 @@ function user_login_final_validate($form, &$form_state) {
function user_authenticate($name, $password) {
$uid = FALSE;
if (!empty($name) && !empty($password)) {
- $account = db_query("SELECT * FROM {users} WHERE name = :name AND status = 1", array(':name' => $name))->fetchObject();
+ $account = user_load_by_name($name);
if ($account) {
// Allow alternate password hashing schemes.
require_once DRUPAL_ROOT . '/' . variable_get('password_inc', 'includes/password.inc');
@@ -2181,10 +2181,7 @@ function user_authenticate($name, $password) {
if (user_needs_new_hash($account)) {
$new_hash = user_hash_password($password);
if ($new_hash) {
- db_update('users')
- ->fields(array('pass' => $new_hash))
- ->condition('uid', $account->uid)
- ->execute();
+ user_save($account, array('pass' => $new_hash));
}
}
}