summaryrefslogtreecommitdiff
path: root/modules/user
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2009-05-24 17:39:35 +0000
committerDries Buytaert <dries@buytaert.net>2009-05-24 17:39:35 +0000
commita24a6c2bba2d15ab835e0b0fce9354bb6fb16c5b (patch)
tree9194465a044c0fdad447eba2906f0472a4dff515 /modules/user
parenta5f42fd007bf3646261b431c52cde53657e21564 (diff)
downloadbrdo-a24a6c2bba2d15ab835e0b0fce9354bb6fb16c5b.tar.gz
brdo-a24a6c2bba2d15ab835e0b0fce9354bb6fb16c5b.tar.bz2
- Patch #471070 by stella: millions of code style fixes.
Diffstat (limited to 'modules/user')
-rw-r--r--modules/user/user.admin.inc2
-rw-r--r--modules/user/user.module88
-rw-r--r--modules/user/user.pages.inc8
-rw-r--r--modules/user/user.test8
4 files changed, 53 insertions, 53 deletions
diff --git a/modules/user/user.admin.inc b/modules/user/user.admin.inc
index 75cec521f..b3421cb71 100644
--- a/modules/user/user.admin.inc
+++ b/modules/user/user.admin.inc
@@ -147,7 +147,7 @@ function user_admin_account() {
$query->leftJoin('users_roles', 'ur', 'u.uid = ur.uid');
$query->condition('u.uid', 0, '<>');
user_build_filter_query($query);
-
+
$count_query = clone $query;
$count_query->addExpression('COUNT(DISTINCT u.uid)');
diff --git a/modules/user/user.module b/modules/user/user.module
index b780d299b..56fd181e1 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -399,7 +399,7 @@ function user_save($account, $edit = array(), $category = 'account') {
$edit = (array) $edit;
if (!isset($account->is_new)) {
- $account->is_new = empty($account->uid);
+ $account->is_new = empty($account->uid);
}
if (is_object($account) && !$account->is_new) {
user_module_invoke('update', $edit, $account, $category);
@@ -597,15 +597,15 @@ function user_validate_name($name) {
return t('The username contains an illegal character.');
}
if (preg_match('/[\x{80}-\x{A0}' . // Non-printable ISO-8859-1 + NBSP
- '\x{AD}' . // Soft-hyphen
- '\x{2000}-\x{200F}' . // Various space characters
- '\x{2028}-\x{202F}' . // Bidirectional text overrides
- '\x{205F}-\x{206F}' . // Various text hinting characters
- '\x{FEFF}' . // Byte order mark
- '\x{FF01}-\x{FF60}' . // Full-width latin
- '\x{FFF9}-\x{FFFD}' . // Replacement characters
- '\x{0}-\x{1F}]/u', // NULL byte and control characters
- $name)) {
+ '\x{AD}' . // Soft-hyphen
+ '\x{2000}-\x{200F}' . // Various space characters
+ '\x{2028}-\x{202F}' . // Bidirectional text overrides
+ '\x{205F}-\x{206F}' . // Various text hinting characters
+ '\x{FEFF}' . // Byte order mark
+ '\x{FF01}-\x{FF60}' . // Full-width latin
+ '\x{FFF9}-\x{FFFD}' . // Replacement characters
+ '\x{0}-\x{1F}]/u', // NULL byte and control characters
+ $name)) {
return t('The username contains an illegal character.');
}
if (drupal_strlen($name) > USERNAME_MAX_LENGTH) {
@@ -787,32 +787,32 @@ function user_is_blocked($name) {
* Implementation of hook_perm().
*/
function user_perm() {
- return array(
- 'administer permissions' => array(
- 'title' => t('Administer permissions'),
- 'description' => t('Manage the permissions assigned to user roles. %warning', array('%warning' => t('Warning: Give to trusted roles only; this permission has security implications.'))),
- ),
- 'administer users' => array(
- 'title' => t('Administer users'),
- 'description' => t('Manage or block users, and manage their role assignments.'),
- ),
- 'access user profiles' => array(
- 'title' => t('Access user profiles'),
- 'description' => t('View profiles of users on the site, which may contain personal information.'),
- ),
- 'change own username' => array(
- 'title' => t('Change own username'),
- 'description' => t('Select a different username.'),
- ),
- 'cancel account' => array(
- 'title' => t('Cancel account'),
- 'description' => t('Remove or disable own user account and unpublish, anonymize, or remove own submissions depending on the configured <a href="@user-settings-url">user settings</a>.', array('@user-settings-url' => url('admin/user/settings'))),
- ),
- 'select account cancellation method' => array(
- 'title' => t('Select method for cancelling own account'),
- 'description' => t('Select the method for cancelling own user account. %warning', array('%warning' => t('Warning: Give to trusted roles only; this permission has security implications.'))),
- ),
- );
+ return array(
+ 'administer permissions' => array(
+ 'title' => t('Administer permissions'),
+ 'description' => t('Manage the permissions assigned to user roles. %warning', array('%warning' => t('Warning: Give to trusted roles only; this permission has security implications.'))),
+ ),
+ 'administer users' => array(
+ 'title' => t('Administer users'),
+ 'description' => t('Manage or block users, and manage their role assignments.'),
+ ),
+ 'access user profiles' => array(
+ 'title' => t('Access user profiles'),
+ 'description' => t('View profiles of users on the site, which may contain personal information.'),
+ ),
+ 'change own username' => array(
+ 'title' => t('Change own username'),
+ 'description' => t('Select a different username.'),
+ ),
+ 'cancel account' => array(
+ 'title' => t('Cancel account'),
+ 'description' => t('Remove or disable own user account and unpublish, anonymize, or remove own submissions depending on the configured <a href="@user-settings-url">user settings</a>.', array('@user-settings-url' => url('admin/user/settings'))),
+ ),
+ 'select account cancellation method' => array(
+ 'title' => t('Select method for cancelling own account'),
+ 'description' => t('Select the method for cancelling own user account. %warning', array('%warning' => t('Warning: Give to trusted roles only; this permission has security implications.'))),
+ ),
+ );
}
/**
@@ -1059,7 +1059,7 @@ function user_block_list() {
function user_block_configure($delta = '') {
global $user;
- switch($delta) {
+ switch ($delta) {
case 'new':
$form['user_block_whois_new_count'] = array(
'#type' => 'select',
@@ -1678,13 +1678,13 @@ function user_authenticate($form_values = array()) {
require_once DRUPAL_ROOT . '/' . variable_get('password_inc', 'includes/password.inc');
if (user_check_password($password, $account)) {
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();
- }
+ $new_hash = user_hash_password($password);
+ if ($new_hash) {
+ db_update('users')
+ ->fields(array('pass' => $new_hash))
+ ->condition('uid', $account->uid)
+ ->execute();
+ }
}
$users = user_load_multiple(array($account->uid), array('status' => '1'));
$user = reset($users);
diff --git a/modules/user/user.pages.inc b/modules/user/user.pages.inc
index 804f152e6..8748635dc 100644
--- a/modules/user/user.pages.inc
+++ b/modules/user/user.pages.inc
@@ -12,7 +12,7 @@
function user_autocomplete($string = '') {
$matches = array();
if ($string) {
- $result = db_query_range("SELECT name FROM {users} WHERE LOWER(name) LIKE LOWER(:name)", array(':name' => $string .'%'), 0, 10);
+ $result = db_query_range("SELECT name FROM {users} WHERE LOWER(name) LIKE LOWER(:name)", array(':name' => $string . '%'), 0, 10);
foreach ($result as $user) {
$matches[$user->name] = check_plain($user->name);
}
@@ -161,7 +161,7 @@ function user_logout() {
* Contains the default "History" profile data for a user.
* - $page['content']['#account']:
* The user account of the profile being viewed.
- *
+ *
* To theme user profiles, copy modules/user/user-profile.tpl.php
* to your theme directory, and edit it as instructed in that file's comments.
*/
@@ -169,7 +169,7 @@ function user_view($account) {
drupal_set_title($account->name);
// Retrieve all profile fields and attach to $account->content.
user_build_content($account);
-
+
$build = $account->content;
$build += array(
'#theme' => 'user_profile',
@@ -189,7 +189,7 @@ function user_view($account) {
*/
function template_preprocess_user_profile(&$variables) {
$account = $variables['elements']['#account'];
-
+
$variables['profile'] = array();
// Sort sections by weight
uasort($account->content, 'element_sort');
diff --git a/modules/user/user.test b/modules/user/user.test
index 28c394025..9b5e6d471 100644
--- a/modules/user/user.test
+++ b/modules/user/user.test
@@ -69,9 +69,9 @@ class UserRegistrationTestCase extends DrupalWebTestCase {
$edit['pass[pass1]'] = '99999.0';
$edit['pass[pass2]'] = '99999';
$this->drupalPost(NULL, $edit, t('Save'));
- $this->assertText(t('The specified passwords do not match.'), t('Type mismatched passwords display an error message.'));
+ $this->assertText(t('The specified passwords do not match.'), t('Type mismatched passwords display an error message.'));
$this->assertNoText(t('The changes have been saved.'), t('Save user password with mismatched type in password confirm.'));
-
+
// Change user password.
$new_pass = user_password();
$edit = array();
@@ -522,7 +522,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);
@@ -1026,7 +1026,7 @@ class UserSaveTestCase extends DrupalWebTestCase {
// User ID must be a number that is not in the database.
$max_uid = db_result(db_query('SELECT MAX(uid) FROM {users}'));
$test_uid = $max_uid + mt_rand(1000, 1000000);
- $test_name = $this->randomName();
+ $test_name = $this->randomName();
// Create the base user, based on drupalCreateUser().
$user = array(