diff options
Diffstat (limited to 'modules/user')
-rw-r--r-- | modules/user/user.admin.inc | 46 | ||||
-rw-r--r-- | modules/user/user.install | 4 | ||||
-rw-r--r-- | modules/user/user.module | 90 | ||||
-rw-r--r-- | modules/user/user.pages.inc | 10 |
4 files changed, 75 insertions, 75 deletions
diff --git a/modules/user/user.admin.inc b/modules/user/user.admin.inc index 8174878a4..3884698f7 100644 --- a/modules/user/user.admin.inc +++ b/modules/user/user.admin.inc @@ -139,9 +139,9 @@ function user_admin_account() { t('Operations') ); - $sql = 'SELECT DISTINCT u.uid, u.name, u.status, u.created, u.access FROM {users} u LEFT JOIN {users_roles} ur ON u.uid = ur.uid '. $filter['join'] .' WHERE u.uid != 0 '. $filter['where']; + $sql = 'SELECT DISTINCT u.uid, u.name, u.status, u.created, u.access FROM {users} u LEFT JOIN {users_roles} ur ON u.uid = ur.uid ' . $filter['join'] . ' WHERE u.uid != 0 ' . $filter['where']; $sql .= tablesort_sql($header); - $query_count = 'SELECT COUNT(DISTINCT u.uid) FROM {users} u LEFT JOIN {users_roles} ur ON u.uid = ur.uid '. $filter['join'] .' WHERE u.uid != 0 '. $filter['where']; + $query_count = 'SELECT COUNT(DISTINCT u.uid) FROM {users} u LEFT JOIN {users_roles} ur ON u.uid = ur.uid ' . $filter['join'] . ' WHERE u.uid != 0 ' . $filter['where']; $result = pager_query($sql, 50, 0, $query_count, $filter['args']); $form['options'] = array( @@ -243,14 +243,14 @@ function user_admin_settings() { ); // These email tokens are shared for all settings, so just define // the list once to help ensure they stay in sync. - $email_token_help = t('Available variables are:') .' !username, !site, !password, !uri, !uri_brief, !mailto, !date, !login_uri, !edit_uri, !login_url.'; + $email_token_help = t('Available variables are:') . ' !username, !site, !password, !uri, !uri_brief, !mailto, !date, !login_uri, !edit_uri, !login_url.'; $form['email']['admin_created'] = array( '#type' => 'fieldset', '#title' => t('Welcome, new user created by administrator'), '#collapsible' => TRUE, '#collapsed' => (variable_get('user_register', 1) != 0), - '#description' => t('Customize welcome e-mail messages sent to new member accounts created by an administrator.') .' '. $email_token_help, + '#description' => t('Customize welcome e-mail messages sent to new member accounts created by an administrator.') . ' ' . $email_token_help, ); $form['email']['admin_created']['user_mail_register_admin_created_subject'] = array( '#type' => 'textfield', @@ -270,7 +270,7 @@ function user_admin_settings() { '#title' => t('Welcome, no approval required'), '#collapsible' => TRUE, '#collapsed' => (variable_get('user_register', 1) != 1), - '#description' => t('Customize welcome e-mail messages sent to new members upon registering, when no administrator approval is required.') .' '. $email_token_help + '#description' => t('Customize welcome e-mail messages sent to new members upon registering, when no administrator approval is required.') . ' ' . $email_token_help ); $form['email']['no_approval_required']['user_mail_register_no_approval_required_subject'] = array( '#type' => 'textfield', @@ -290,7 +290,7 @@ function user_admin_settings() { '#title' => t('Welcome, awaiting administrator approval'), '#collapsible' => TRUE, '#collapsed' => (variable_get('user_register', 1) != 2), - '#description' => t('Customize welcome e-mail messages sent to new members upon registering, when administrative approval is required.') .' '. $email_token_help, + '#description' => t('Customize welcome e-mail messages sent to new members upon registering, when administrative approval is required.') . ' ' . $email_token_help, ); $form['email']['pending_approval']['user_mail_register_pending_approval_subject'] = array( '#type' => 'textfield', @@ -310,7 +310,7 @@ function user_admin_settings() { '#title' => t('Password recovery email'), '#collapsible' => TRUE, '#collapsed' => TRUE, - '#description' => t('Customize e-mail messages sent to users who request a new password.') .' '. $email_token_help, + '#description' => t('Customize e-mail messages sent to users who request a new password.') . ' ' . $email_token_help, ); $form['email']['password_reset']['user_mail_password_reset_subject'] = array( '#type' => 'textfield', @@ -330,7 +330,7 @@ function user_admin_settings() { '#title' => t('Account activation email'), '#collapsible' => TRUE, '#collapsed' => TRUE, - '#description' => t('Enable and customize e-mail messages sent to users upon account activation (when an administrator activates an account of a user who has already registered, on a site where administrative approval is required).') .' '. $email_token_help, + '#description' => t('Enable and customize e-mail messages sent to users upon account activation (when an administrator activates an account of a user who has already registered, on a site where administrative approval is required).') . ' ' . $email_token_help, ); $form['email']['activated']['user_mail_status_activated_notify'] = array( '#type' => 'checkbox', @@ -355,7 +355,7 @@ function user_admin_settings() { '#title' => t('Account blocked email'), '#collapsible' => TRUE, '#collapsed' => TRUE, - '#description' => t('Enable and customize e-mail messages sent to users when their accounts are blocked.') .' '. $email_token_help, + '#description' => t('Enable and customize e-mail messages sent to users when their accounts are blocked.') . ' ' . $email_token_help, ); $form['email']['blocked']['user_mail_status_blocked_notify'] = array( '#type' => 'checkbox', @@ -380,7 +380,7 @@ function user_admin_settings() { '#title' => t('Account deleted email'), '#collapsible' => TRUE, '#collapsed' => TRUE, - '#description' => t('Enable and customize e-mail messages sent to users when their accounts are deleted.') .' '. $email_token_help, + '#description' => t('Enable and customize e-mail messages sent to users when their accounts are deleted.') . ' ' . $email_token_help, ); $form['email']['deleted']['user_mail_status_deleted_notify'] = array( '#type' => 'checkbox', @@ -431,7 +431,7 @@ function user_admin_settings() { '#prefix' => '<div class="user-admin-picture-radios">', '#suffix' => '</div>', ); - drupal_add_js(drupal_get_path('module', 'user') .'/user.js'); + drupal_add_js(drupal_get_path('module', 'user') . '/user.js'); // If JS is enabled, and the radio is defaulting to off, hide all // the settings on page load via .css using the js-hide class so // that there's no flicker. @@ -440,7 +440,7 @@ function user_admin_settings() { $css_class .= ' js-hide'; } $form['pictures']['settings'] = array( - '#prefix' => '<div class="'. $css_class .'">', + '#prefix' => '<div class="' . $css_class . '">', '#suffix' => '</div>', ); $form['pictures']['settings']['user_picture_path'] = array( @@ -449,7 +449,7 @@ function user_admin_settings() { '#default_value' => variable_get('user_picture_path', 'pictures'), '#size' => 30, '#maxlength' => 255, - '#description' => t('Subdirectory in the directory %dir where pictures will be stored.', array('%dir' => file_directory_path() .'/')), + '#description' => t('Subdirectory in the directory %dir where pictures will be stored.', array('%dir' => file_directory_path() . '/')), ); $form['pictures']['settings']['user_picture_default'] = array( '#type' => 'textfield', @@ -505,7 +505,7 @@ function user_admin_perm($form_state, $rid = NULL) { // always search for "$perm," to make sure we do not confuse // permissions that are substrings of each other. while ($role = db_fetch_object($result)) { - $role_permissions[$role->rid] = $role->perm .','; + $role_permissions[$role->rid] = $role->perm . ','; } // Retrieve role names for columns. @@ -537,7 +537,7 @@ function user_admin_perm($form_state, $rid = NULL) { ); foreach ($role_names as $rid => $name) { // Builds arrays for checked boxes for each role - if (strpos($role_permissions[$rid], $perm .',') !== FALSE) { + if (strpos($role_permissions[$rid], $perm . ',') !== FALSE) { $status[$rid][] = $perm; } } @@ -589,7 +589,7 @@ function theme_user_admin_perm($form) { $row = array(); // Module name if (is_numeric($key)) { - $row[] = array('data' => t('@module module', array('@module' => drupal_render($form['permission'][$key]))), 'class' => 'module', 'id' => 'module-'. $form['permission'][$key]['#value'], 'colspan' => count($form['role_names']) + 1); + $row[] = array('data' => t('@module module', array('@module' => drupal_render($form['permission'][$key]))), 'class' => 'module', 'id' => 'module-' . $form['permission'][$key]['#value'], 'colspan' => count($form['role_names']) + 1); } else { // Permission row. @@ -599,7 +599,7 @@ function theme_user_admin_perm($form) { ); foreach (element_children($form['checkboxes']) as $rid) { if (is_array($form['checkboxes'][$rid])) { - $row[] = array('data' => drupal_render($form['checkboxes'][$rid][$key]), 'class' => 'checkbox', 'title' => $roles[$rid] .' : '. t($key)); + $row[] = array('data' => drupal_render($form['checkboxes'][$rid][$key]), 'class' => 'checkbox', 'title' => $roles[$rid] . ' : ' . t($key)); } } } @@ -764,9 +764,9 @@ function theme_user_admin_account($form) { function theme_user_admin_new_role($form) { $header = array(t('Name'), array('data' => t('Operations'), 'colspan' => 2)); foreach (user_roles() as $rid => $name) { - $edit_permissions = l(t('edit permissions'), 'admin/user/permissions/'. $rid); + $edit_permissions = l(t('edit permissions'), 'admin/user/permissions/' . $rid); if (!in_array($rid, array(DRUPAL_ANONYMOUS_RID, DRUPAL_AUTHENTICATED_RID))) { - $rows[] = array($name, l(t('edit role'), 'admin/user/roles/edit/'. $rid), $edit_permissions); + $rows[] = array($name, l(t('edit role'), 'admin/user/roles/edit/' . $rid), $edit_permissions); } else { $rows[] = array($name, t('locked'), $edit_permissions); @@ -802,17 +802,17 @@ function theme_user_filters($form) { $output = '<ul class="clear-block">'; if (!empty($form['current'])) { foreach (element_children($form['current']) as $key) { - $output .= '<li>'. drupal_render($form['current'][$key]) .'</li>'; + $output .= '<li>' . drupal_render($form['current'][$key]) . '</li>'; } } - $output .= '<li><dl class="multiselect">'. (!empty($form['current']) ? '<dt><em>'. t('and') .'</em> '. t('where') .'</dt>' : '') .'<dd class="a">'; + $output .= '<li><dl class="multiselect">' . (!empty($form['current']) ? '<dt><em>' . t('and') . '</em> ' . t('where') . '</dt>' : '') . '<dd class="a">'; foreach (element_children($form['filter']) as $key) { $output .= drupal_render($form['filter'][$key]); } $output .= '</dd>'; - $output .= '<dt>'. t('is') .'</dt><dd class="b">'; + $output .= '<dt>' . t('is') . '</dt><dd class="b">'; foreach (element_children($form['status']) as $key) { $output .= drupal_render($form['status'][$key]); @@ -820,7 +820,7 @@ function theme_user_filters($form) { $output .= '</dd>'; $output .= '</dl>'; - $output .= '<div class="container-inline" id="user-admin-buttons">'. drupal_render($form['buttons']) .'</div>'; + $output .= '<div class="container-inline" id="user-admin-buttons">' . drupal_render($form['buttons']) . '</div>'; $output .= '</li></ul>'; return $output; diff --git a/modules/user/user.install b/modules/user/user.install index 5f63f05ea..c2c6f2830 100644 --- a/modules/user/user.install +++ b/modules/user/user.install @@ -295,7 +295,7 @@ function user_update_7000(&$sandbox) { $new_hash = user_hash_password($account['pass'], $hash_count_log2); if ($new_hash) { // Indicate an updated password. - $new_hash = 'U'. $new_hash; + $new_hash = 'U' . $new_hash; db_query("UPDATE {users} SET pass = '%s' WHERE uid = %d", $new_hash, $account['uid']); } } @@ -303,7 +303,7 @@ function user_update_7000(&$sandbox) { $sandbox['user_from'] += $count; if (!$has_rows) { $ret['#finished'] = 1; - $ret[] = array('success' => TRUE, 'query' => "UPDATE {users} SET pass = 'U'. user_hash_password(pass) WHERE uid > 0"); + $ret[] = array('success' => TRUE, 'query' => "UPDATE {users} SET pass = 'U' . user_hash_password(pass) WHERE uid > 0"); } } return $ret; diff --git a/modules/user/user.module b/modules/user/user.module index 4b6c65ae2..9314ccd32 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -17,7 +17,7 @@ define('EMAIL_MAX_LENGTH', 64); */ function user_module_invoke($type, &$array, &$user, $category = NULL) { foreach (module_list() as $module) { - $function = $module .'_user'; + $function = $module . '_user'; if (function_exists($function)) { $function($type, $array, $user, $category); } @@ -164,7 +164,7 @@ function user_load($array = array()) { $params[] = $value; } } - $result = db_query('SELECT * FROM {users} u WHERE '. implode(' AND ', $query), $params); + $result = db_query('SELECT * FROM {users} u WHERE ' . implode(' AND ', $query), $params); if ($user = db_fetch_object($result)) { $user = drupal_unpack($user); @@ -354,14 +354,14 @@ function user_validate_name($name) { if (substr($name, -1) == ' ') return t('The username cannot end with a space.'); if (strpos($name, ' ') !== FALSE) return t('The username cannot contain multiple spaces in a row.'); if (ereg("[^\x80-\xF7 [:alnum:]@_.-]", $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 + 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}]/u', // NULL byte $name)) { return t('The username contains an illegal character.'); @@ -394,7 +394,7 @@ function user_validate_picture(&$form, &$form_state) { // files table as a temporary file. We'll make a copy and let the garbage // collector delete the original upload. $info = image_get_info($file->filepath); - $destination = variable_get('user_picture_path', 'pictures') .'/picture-'. $form['#uid'] .'.'. $info['extension']; + $destination = variable_get('user_picture_path', 'pictures') . '/picture-' . $form['#uid'] . '.' . $info['extension']; if (file_copy($file, $destination, FILE_EXISTS_REPLACE)) { $form_state['values']['picture'] = $file->filepath; } @@ -470,7 +470,7 @@ function user_access($string, $account = NULL, $reset = FALSE) { // To reduce the number of SQL queries, we cache the user's permissions // in a static variable. if (!isset($perm[$account->uid])) { - $result = db_query("SELECT p.perm FROM {role} r INNER JOIN {permission} p ON p.rid = r.rid WHERE r.rid IN (". db_placeholders($account->roles) .")", array_keys($account->roles)); + $result = db_query("SELECT p.perm FROM {role} r INNER JOIN {permission} p ON p.rid = r.rid WHERE r.rid IN (" . db_placeholders($account->roles) . ")", array_keys($account->roles)); $perms = array(); while ($row = db_fetch_object($result)) { @@ -511,9 +511,9 @@ function user_perm() { * Ensure that user pictures (avatars) are always downloadable. */ function user_file_download($file) { - if (strpos($file, variable_get('user_picture_path', 'pictures') .'/picture-') === 0) { + if (strpos($file, variable_get('user_picture_path', 'pictures') . '/picture-') === 0) { $info = image_get_info(file_create_path($file)); - return array('Content-type: '. $info['mime_type']); + return array('Content-type: ' . $info['mime_type']); } } @@ -535,13 +535,13 @@ function user_search($op = 'search', $keys = NULL, $skip_access_check = FALSE) { // Administrators can also search in the otherwise private email field. $result = pager_query("SELECT name, uid, mail FROM {users} WHERE LOWER(name) LIKE LOWER('%%%s%%') OR LOWER(mail) LIKE LOWER('%%%s%%')", 15, 0, NULL, $keys, $keys); while ($account = db_fetch_object($result)) { - $find[] = array('title' => $account->name .' ('. $account->mail .')', 'link' => url('user/'. $account->uid, array('absolute' => TRUE))); + $find[] = array('title' => $account->name . ' (' . $account->mail . ')', 'link' => url('user/' . $account->uid, array('absolute' => TRUE))); } } else { $result = pager_query("SELECT name, uid FROM {users} WHERE LOWER(name) LIKE LOWER('%%%s%%')", 15, 0, NULL, $keys); while ($account = db_fetch_object($result)) { - $find[] = array('title' => $account->name, 'link' => url('user/'. $account->uid, array('absolute' => TRUE))); + $find[] = array('title' => $account->name, 'link' => url('user/' . $account->uid, array('absolute' => TRUE))); } } return $find; @@ -1011,7 +1011,7 @@ function user_menu() { foreach ($categories as $key => $category) { // 'account' is already handled by the MENU_DEFAULT_LOCAL_TASK. if ($category['name'] != 'account') { - $items['user/%user_category/edit/'. $category['name']] = array( + $items['user/%user_category/edit/' . $category['name']] = array( 'title callback' => 'check_plain', 'title arguments' => array($category['title']), 'page callback' => 'user_edit', @@ -1031,7 +1031,7 @@ function user_menu() { } function user_init() { - drupal_add_css(drupal_get_path('module', 'user') .'/user.css', 'module'); + drupal_add_css(drupal_get_path('module', 'user') . '/user.css', 'module'); } function user_current_load($arg) { @@ -1153,7 +1153,7 @@ function user_login(&$form_state) { // If we are already logged on, go to the user page instead. if ($user->uid) { - drupal_goto('user/'. $user->uid); + drupal_goto('user/' . $user->uid); } // Display login form: @@ -1296,7 +1296,7 @@ function user_authenticate_finalize(&$edit) { function user_login_submit($form, &$form_state) { global $user; if ($user->uid) { - $form_state['redirect'] = 'user/'. $user->uid; + $form_state['redirect'] = 'user/' . $user->uid; return; } } @@ -1327,13 +1327,13 @@ function user_external_login_register($name, $module) { } user_set_authmaps($account, array("authname_$module" => $name)); $user = $account; - watchdog('user', 'New external user: %name using module %module.', array('%name' => $name, '%module' => $module), WATCHDOG_NOTICE, l(t('edit'), 'user/'. $user->uid .'/edit')); + watchdog('user', 'New external user: %name using module %module.', array('%name' => $name, '%module' => $module), WATCHDOG_NOTICE, l(t('edit'), 'user/' . $user->uid . '/edit')); } } function user_pass_reset_url($account) { $timestamp = time(); - return url("user/reset/$account->uid/$timestamp/". user_pass_rehash($account->pass, $timestamp, $account->login), array('absolute' => TRUE)); + return url("user/reset/$account->uid/$timestamp/" . user_pass_rehash($account->pass, $timestamp, $account->login), array('absolute' => TRUE)); } function user_pass_rehash($password, $timestamp, $login) { @@ -1441,7 +1441,7 @@ function user_edit_form(&$form_state, $uid, $edit, $register = FALSE) { else { $form['picture']['picture_delete'] = array('#type' => 'hidden'); } - $form['picture']['picture_upload'] = array('#type' => 'file', '#title' => t('Upload picture'), '#size' => 48, '#description' => t('Your virtual face or picture. Maximum dimensions are %dimensions and the maximum size is %size kB.', array('%dimensions' => variable_get('user_picture_dimensions', '85x85'), '%size' => variable_get('user_picture_file_size', '30'))) .' '. variable_get('user_picture_guidelines', '')); + $form['picture']['picture_upload'] = array('#type' => 'file', '#title' => t('Upload picture'), '#size' => 48, '#description' => t('Your virtual face or picture. Maximum dimensions are %dimensions and the maximum size is %size kB.', array('%dimensions' => variable_get('user_picture_dimensions', '85x85'), '%size' => variable_get('user_picture_file_size', '30'))) . ' ' . variable_get('user_picture_guidelines', '')); $form['#validate'][] = 'user_validate_picture'; } $form['#uid'] = $uid; @@ -1497,7 +1497,7 @@ function user_delete($edit, $uid) { db_query('DELETE FROM {users} WHERE uid = %d', $uid); db_query('DELETE FROM {users_roles} WHERE uid = %d', $uid); db_query('DELETE FROM {authmap} WHERE uid = %d', $uid); - $variables = array('%name' => $account->name, '%email' => '<'. $account->mail .'>'); + $variables = array('%name' => $account->name, '%email' => '<' . $account->mail . '>'); watchdog('user', 'Deleted user: %name %email.', $variables, WATCHDOG_NOTICE); module_invoke_all('user', 'delete', $edit, $account); } @@ -1526,8 +1526,8 @@ function user_build_content(&$account) { function user_mail($key, &$message, $params) { $language = $message['language']; $variables = user_mail_tokens($params['account'], $language); - $message['subject'] .= _user_mail_text($key .'_subject', $language, $variables); - $message['body'][] = _user_mail_text($key .'_body', $language, $variables); + $message['subject'] .= _user_mail_text($key . '_subject', $language, $variables); + $message['body'][] = _user_mail_text($key . '_body', $language, $variables); } /** @@ -1538,7 +1538,7 @@ function user_mail($key, &$message, $params) { function _user_mail_text($key, $language = NULL, $variables = array()) { $langcode = isset($language) ? $language->language : NULL; - if ($admin_setting = variable_get('user_mail_'. $key, FALSE)) { + if ($admin_setting = variable_get('user_mail_' . $key, FALSE)) { // An admin setting overrides the default string. return strtr($admin_setting, $variables); } @@ -1653,12 +1653,12 @@ function user_user_operations($form_state = array()) { $add_roles = array(); foreach ($roles as $key => $value) { - $add_roles['add_role-'. $key] = $value; + $add_roles['add_role-' . $key] = $value; } $remove_roles = array(); foreach ($roles as $key => $value) { - $remove_roles['remove_role-'. $key] = $value; + $remove_roles['remove_role-' . $key] = $value; } if (count($roles)) { @@ -1763,7 +1763,7 @@ function user_multiple_delete_confirm(&$form_state) { // array_filter() returns only elements with TRUE values. foreach (array_filter($edit['accounts']) as $uid => $value) { $user = db_result(db_query('SELECT name FROM {users} WHERE uid = %d', $uid)); - $form['accounts'][$uid] = array('#type' => 'hidden', '#value' => $uid, '#prefix' => '<li>', '#suffix' => check_plain($user) ."</li>\n"); + $form['accounts'][$uid] = array('#type' => 'hidden', '#value' => $uid, '#prefix' => '<li>', '#suffix' => check_plain($user) . "</li>\n"); } $form['operation'] = array('#type' => 'hidden', '#value' => 'delete'); @@ -1792,18 +1792,18 @@ function user_help($path, $arg) { switch ($path) { case 'admin/help#user': - $output = '<p>'. t('The user module allows users to register, login, and log out. Users benefit from being able to sign on because it associates content they create with their account and allows various permissions to be set for their roles. The user module supports user roles which establish fine grained permissions allowing each role to do only what the administrator wants them to. Each user is assigned to one or more roles. By default there are two roles <em>anonymous</em> - a user who has not logged in, and <em>authenticated</em> a user who has signed up and who has been authorized.') .'</p>'; - $output .= '<p>'. t("Users can use their own name or handle and can specify personal configuration settings through their individual <em>My account</em> page. Users must authenticate by supplying a local username and password or through their OpenID, an optional and secure method for logging into many websites with a single username and password. In some configurations, users may authenticate using a username and password from another Drupal site, or through some other site-specific mechanism.") .'</p>'; - $output .= '<p>'. t('A visitor accessing your website is assigned a unique ID, or session ID, which is stored in a cookie. The cookie does not contain personal information, but acts as a key to retrieve information from your site. Users should have cookies enabled in their web browser when using your site.') .'</p>'; - $output .= '<p>'. t('For more information, see the online handbook entry for <a href="@user">User module</a>.', array('@user' => 'http://drupal.org/handbook/modules/user/')) .'</p>'; + $output = '<p>' . t('The user module allows users to register, login, and log out. Users benefit from being able to sign on because it associates content they create with their account and allows various permissions to be set for their roles. The user module supports user roles which establish fine grained permissions allowing each role to do only what the administrator wants them to. Each user is assigned to one or more roles. By default there are two roles <em>anonymous</em> - a user who has not logged in, and <em>authenticated</em> a user who has signed up and who has been authorized.') . '</p>'; + $output .= '<p>' . t("Users can use their own name or handle and can specify personal configuration settings through their individual <em>My account</em> page. Users must authenticate by supplying a local username and password or through their OpenID, an optional and secure method for logging into many websites with a single username and password. In some configurations, users may authenticate using a username and password from another Drupal site, or through some other site-specific mechanism.") . '</p>'; + $output .= '<p>' . t('A visitor accessing your website is assigned a unique ID, or session ID, which is stored in a cookie. The cookie does not contain personal information, but acts as a key to retrieve information from your site. Users should have cookies enabled in their web browser when using your site.') . '</p>'; + $output .= '<p>' . t('For more information, see the online handbook entry for <a href="@user">User module</a>.', array('@user' => 'http://drupal.org/handbook/modules/user/')) . '</p>'; return $output; case 'admin/user/user': - return '<p>'. t('Drupal allows users to register, login, log out, maintain user profiles, etc. Users of the site may not use their own names to post content until they have signed up for a user account.') .'</p>'; + return '<p>' . t('Drupal allows users to register, login, log out, maintain user profiles, etc. Users of the site may not use their own names to post content until they have signed up for a user account.') . '</p>'; case 'admin/user/user/create': case 'admin/user/user/account/create': - return '<p>'. t("This web page allows administrators to register new users. Users' e-mail addresses and usernames must be unique.") .'</p>'; + return '<p>' . t("This web page allows administrators to register new users. Users' e-mail addresses and usernames must be unique.") . '</p>'; case 'admin/user/permissions': - return '<p>'. t('Permissions let you control what users can do on your site. Each user role (defined on the <a href="@role">user roles page</a>) has its own set of permissions. For example, you could give users classified as "Administrators" permission to "administer nodes" but deny this power to ordinary, "authenticated" users. You can use permissions to reveal new features to privileged users (those with subscriptions, for example). Permissions also allow trusted users to share the administrative burden of running a busy site.', array('@role' => url('admin/user/roles'))) .'</p>'; + return '<p>' . t('Permissions let you control what users can do on your site. Each user role (defined on the <a href="@role">user roles page</a>) has its own set of permissions. For example, you could give users classified as "Administrators" permission to "administer nodes" but deny this power to ordinary, "authenticated" users. You can use permissions to reveal new features to privileged users (those with subscriptions, for example). Permissions also allow trusted users to share the administrative burden of running a busy site.', array('@role' => url('admin/user/roles'))) . '</p>'; case 'admin/user/roles': return t('<p>Roles allow you to fine tune the security and administration of Drupal. A role defines a group of users that have certain privileges as defined in <a href="@permissions">user permissions</a>. Examples of roles include: anonymous user, authenticated user, moderator, administrator and so on. In this area you will define the <em>role names</em> of the various roles. To delete a role choose "edit".</p><p>By default, Drupal comes with two user roles:</p> <ul> @@ -1811,7 +1811,7 @@ function user_help($path, $arg) { <li>Authenticated user: this role is automatically granted to all logged in users.</li> </ul>', array('@permissions' => url('admin/user/permissions'))); case 'admin/user/search': - return '<p>'. t('Enter a simple pattern ("*" may be used as a wildcard match) to search for a username or e-mail address. For example, one may search for "br" and Drupal might return "brian", "brad", and "brenda@example.com".') .'</p>'; + return '<p>' . t('Enter a simple pattern ("*" may be used as a wildcard match) to search for a username or e-mail address. For example, one may search for "br" and Drupal might return "brian", "brad", and "brenda@example.com".') . '</p>'; } } @@ -1906,8 +1906,8 @@ function user_build_filter_query() { $args[] = $value; $join[] = $filters[$key]['join']; } - $where = !empty($where) ? 'AND '. implode(' AND ', $where) : ''; - $join = !empty($join) ? ' '. implode(' ', array_unique($join)) : ''; + $where = !empty($where) ? 'AND ' . implode(' AND ', $where) : ''; + $join = !empty($join) ? ' ' . implode(' ', array_unique($join)) : ''; return array('where' => $where, 'join' => $join, @@ -1979,7 +1979,7 @@ function user_mail_tokens($account, $language) { '!mailto' => $account->mail, '!date' => format_date(time(), 'medium', '', NULL, $language->language), '!login_uri' => url('user', array('absolute' => TRUE, 'language' => $language)), - '!edit_uri' => url('user/'. $account->uid .'/edit', array('absolute' => TRUE, 'language' => $language)), + '!edit_uri' => url('user/' . $account->uid . '/edit', array('absolute' => TRUE, 'language' => $language)), ); if (!empty($account->password)) { $tokens['!password'] = $account->password; @@ -2038,7 +2038,7 @@ function user_preferred_language($account, $default = NULL) { function _user_mail_notify($op, $account, $language = NULL) { // By default, we always notify except for deleted and blocked. $default_notify = ($op != 'status_deleted' && $op != 'status_blocked'); - $notify = variable_get('user_mail_'. $op .'_notify', $default_notify); + $notify = variable_get('user_mail_' . $op . '_notify', $default_notify); if ($notify) { $params['account'] = $account; $language = $language ? $language : user_preferred_language($account); @@ -2064,7 +2064,7 @@ function _user_password_dynamic_validation() { global $user; // Only need to do once per page. if (!$complete) { - drupal_add_js(drupal_get_path('module', 'user') .'/user.js', 'module'); + drupal_add_js(drupal_get_path('module', 'user') . '/user.js', 'module'); drupal_add_js(array( 'password' => array( @@ -2202,7 +2202,7 @@ function user_register_submit($form, &$form_state) { } $form_state['user'] = $account; - watchdog('user', 'New user: %name (%email).', array('%name' => $name, '%email' => $mail), WATCHDOG_NOTICE, l(t('edit'), 'user/'. $account->uid .'/edit')); + watchdog('user', 'New user: %name (%email).', array('%name' => $name, '%email' => $mail), WATCHDOG_NOTICE, l(t('edit'), 'user/' . $account->uid . '/edit')); // The first user may login immediately, and receives a customized welcome e-mail. if ($account->uid == 1) { @@ -2270,7 +2270,7 @@ function user_register() { // If we aren't admin but already logged on, go to the user page instead. if (!$admin && $user->uid) { - drupal_goto('user/'. $user->uid); + drupal_goto('user/' . $user->uid); } $form = array(); diff --git a/modules/user/user.pages.inc b/modules/user/user.pages.inc index e2c991607..8a32f87c4 100644 --- a/modules/user/user.pages.inc +++ b/modules/user/user.pages.inc @@ -102,11 +102,11 @@ function user_pass_reset(&$form_state, $uid, $timestamp, $hashed_pass, $action = // user, which invalidates further use of the one-time login link. user_authenticate_finalize($form_state['values']); drupal_set_message(t('You have just used your one-time login link. It is no longer necessary to use this link to login. Please change your password.')); - drupal_goto('user/'. $user->uid .'/edit'); + drupal_goto('user/' . $user->uid . '/edit'); } else { $form['message'] = array('#value' => t('<p>This is a one-time login for %user_name and will expire on %expiration_date.</p><p>Click on this button to login to the site and change your password.</p>', array('%user_name' => $account->name, '%expiration_date' => format_date($timestamp + $timeout)))); - $form['help'] = array('#value' => '<p>'. t('This login can be used only once.') .'</p>'); + $form['help'] = array('#value' => '<p>' . t('This login can be used only once.') . '</p>'); $form['submit'] = array('#type' => 'submit', '#value' => t('Log in')); $form['#action'] = url("user/reset/$uid/$timestamp/$hashed_pass/login"); return $form; @@ -291,7 +291,7 @@ function user_edit_delete_submit($form, &$form_state) { unset($_REQUEST['destination']); } // Note: We redirect from user/uid/edit to user/uid/delete to make the tabs disappear. - $form_state['redirect'] = array("user/". $form_state['values']['_account']->uid ."/delete", $destination); + $form_state['redirect'] = array("user/" . $form_state['values']['_account']->uid . "/delete", $destination); } /** @@ -306,7 +306,7 @@ function user_confirm_delete(&$form_state, $account) { return confirm_form($form, t('Are you sure you want to delete the account %name?', array('%name' => $account->name)), - 'user/'. $account->uid, + 'user/' . $account->uid, t('All submissions made by this user will be attributed to the anonymous account. This action cannot be undone.'), t('Delete'), t('Cancel')); } @@ -356,7 +356,7 @@ function user_edit_submit($form, &$form_state) { function user_page() { global $user; if ($user->uid) { - menu_set_active_item('user/'. $user->uid); + menu_set_active_item('user/' . $user->uid); return menu_execute_active_handler(); } else { |