diff options
-rw-r--r-- | modules/user/user.install | 14 | ||||
-rw-r--r-- | modules/user/user.test | 18 |
2 files changed, 16 insertions, 16 deletions
diff --git a/modules/user/user.install b/modules/user/user.install index 11f4eb243..de002cf5e 100644 --- a/modules/user/user.install +++ b/modules/user/user.install @@ -257,13 +257,13 @@ function user_update_7000(&$sandbox) { $count = 1000; $result = db_query_range("SELECT uid, pass FROM {users} WHERE uid > 0 ORDER BY uid", $sandbox['user_from'], $count); while ($account = db_fetch_array($result)) { - $has_rows = TRUE; - $new_hash = user_hash_password($account['pass'], $hash_count_log2); - if ($new_hash) { - // Indicate an updated password. - $new_hash = 'U' . $new_hash; - db_query("UPDATE {users} SET pass = '%s' WHERE uid = %d", $new_hash, $account['uid']); - } + $has_rows = TRUE; + $new_hash = user_hash_password($account['pass'], $hash_count_log2); + if ($new_hash) { + // Indicate an updated password. + $new_hash = 'U' . $new_hash; + db_query("UPDATE {users} SET pass = '%s' WHERE uid = %d", $new_hash, $account['uid']); + } } $ret['#finished'] = $sandbox['user_from']/$sandbox['user_count']; $sandbox['user_from'] += $count; diff --git a/modules/user/user.test b/modules/user/user.test index 1de99f944..430d105d4 100644 --- a/modules/user/user.test +++ b/modules/user/user.test @@ -133,7 +133,7 @@ class UserValidationTestCase extends DrupalWebTestCase { foreach ($test_cases as $name => $test_case) { list($description, $test) = $test_case; $result = user_validate_name($name); - $this->$test($result, $description . ' ('. $name . ')'); + $this->$test($result, $description . ' (' . $name . ')'); } } @@ -465,9 +465,9 @@ class UserCancelTestCase extends DrupalWebTestCase { $edit = array(); $edit['operation'] = 'cancel'; foreach ($users as $uid => $account) { - $edit['accounts['. $uid .']'] = TRUE; + $edit['accounts[' . $uid . ']'] = TRUE; } - $edit['accounts['. $admin_user->uid .']'] = TRUE; + $edit['accounts[' . $admin_user->uid . ']'] = TRUE; $this->drupalPost('admin/user/user', $edit, t('Update')); $this->assertText(t('Are you sure you want to cancel these user accounts?'), t('Confirmation form to cancel accounts displayed.')); $this->assertText(t('When cancelling these accounts'), t('Allows to select account cancellation method.')); @@ -514,7 +514,7 @@ class UserPictureTestCase extends DrupalWebTestCase { $file_check = file_check_directory($file_dir, FILE_CREATE_DIRECTORY, 'file_directory_path'); $picture_dir = variable_get('user_picture_path', 'pictures'); - $picture_path = $file_dir .'/'.$picture_dir; + $picture_path = $file_dir . '/' .$picture_dir; $pic_check = file_check_directory($picture_path, FILE_CREATE_DIRECTORY, 'user_picture_path'); $this->_directory_test = is_writable($picture_path); @@ -607,7 +607,7 @@ class UserPictureTestCase extends DrupalWebTestCase { * * results: The image shouldn't be uploaded */ - function testWithoutGDinvalidDimension() { + function testWithoutGDinvalidDimension() { if ($this->_directory_test) if (!image_get_toolkit()) { @@ -632,7 +632,7 @@ class UserPictureTestCase extends DrupalWebTestCase { // Check if file is not uploaded. $this->assertFalse(is_file($pic_path), t('File was not uploaded.')); } - } + } /** * Do the test: @@ -641,7 +641,7 @@ class UserPictureTestCase extends DrupalWebTestCase { * * results: The image shouldn't be uploaded */ - function testWithoutGDinvalidSize() { + function testWithoutGDinvalidSize() { if ($this->_directory_test) if (!image_get_toolkit()) { $this->drupalLogin($this->user); @@ -699,7 +699,7 @@ class UserPictureTestCase extends DrupalWebTestCase { function saveUserPicture($image) { $edit = array('files[picture_upload]' => realpath($image->filepath)); - $this->drupalPost('user/' . $this->user->uid.'/edit', $edit, t('Save')); + $this->drupalPost('user/' . $this->user->uid . '/edit', $edit, t('Save')); $img_info = image_get_info($image->filepath); $picture_dir = variable_get('user_picture_path', 'pictures'); @@ -803,7 +803,7 @@ class UserAdminTestCase extends DrupalWebTestCase { $this->assertEqual($account->status, 1, 'User B not blocked'); $edit = array(); $edit['operation'] = 'block'; - $edit['accounts['. $account->uid .']'] = TRUE; + $edit['accounts[' . $account->uid . ']'] = TRUE; $this->drupalPost('admin/user/user', $edit, t('Update')); $account = user_load($user_b->uid, TRUE); $this->assertEqual($account->status, 0, 'User B blocked'); |