From 09e27018929d40c6f609a617b974955840b12370 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Hojtsy?= Date: Fri, 12 Oct 2007 10:41:48 +0000 Subject: #181088 by fajerstarter, catch and JirkaRybka: rename 'access control' to 'permissions' for usability reasons --- INSTALL.txt | 2 +- modules/comment/comment.module | 2 +- modules/system/system.install | 14 ++++++++++++++ modules/system/system.module | 6 +++--- modules/upload/upload.module | 2 +- modules/user/user.admin.inc | 2 +- modules/user/user.module | 22 +++++++++++----------- 7 files changed, 32 insertions(+), 18 deletions(-) diff --git a/INSTALL.txt b/INSTALL.txt index f7ab0b6af..a2c9802e9 100644 --- a/INSTALL.txt +++ b/INSTALL.txt @@ -150,7 +150,7 @@ Use your administration panel to enable and configure services. For example: General Settings Administer > Site configuration > Site information Enable Modules Administer > Site building > Modules Configure Themes Administer > Site building > Themes -Set User Permissions Administer > User management > Access control +Set User Permissions Administer > User management > Permissions For more information on configuration options, read the instructions which accompany the different configuration settings and consult the various help diff --git a/modules/comment/comment.module b/modules/comment/comment.module index da3951cf9..478f19da3 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -520,7 +520,7 @@ function comment_form_alter(&$form, $form_state, $form_id) { COMMENT_ANONYMOUS_MAYNOT_CONTACT => t('Anonymous posters may not enter their contact information'), COMMENT_ANONYMOUS_MAY_CONTACT => t('Anonymous posters may leave their contact information'), COMMENT_ANONYMOUS_MUST_CONTACT => t('Anonymous posters must leave their contact information')), - '#description' => t('This option is enabled when anonymous users have permission to post comments on the permissions page.', array('@url' => url('admin/user/access', array('fragment' => 'module-comment')))), + '#description' => t('This option is enabled when anonymous users have permission to post comments on the permissions page.', array('@url' => url('admin/user/permissions', array('fragment' => 'module-comment')))), ); if (!user_access('post comments', user_load(array('uid' => 0)))) { $form['comment']['comment_anonymous']['#disabled'] = TRUE; diff --git a/modules/system/system.install b/modules/system/system.install index 9b29eeb02..8c98a05bd 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -4440,6 +4440,20 @@ function system_update_6033() { return $ret; } +/** + * Rename permission "administer access control" to "administer permissions". + */ +function system_update_6034() { + $ret = array(); + $result = db_query("SELECT rid, perm FROM {permission} ORDER BY rid"); + while ($role = db_fetch_object($result)) { + $renamed_permission = preg_replace('/administer access control/', 'administer permissions', $role->perm); + if ($renamed_permission != $role->perm) { + $ret[] = update_sql("UPDATE {permission} SET perm = '$renamed_permission' WHERE rid = $role->rid"); + } + } + return $ret; +} /** * @} End of "defgroup updates-5.x-to-6.x" diff --git a/modules/system/system.module b/modules/system/system.module index 7854b9559..87e1ba65c 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -43,7 +43,7 @@ function system_help($path, $arg) { case 'admin/build/themes/settings': return '

'. t('These options control the default display settings for your entire site, across all themes. Unless they have been overridden by a specific theme, these settings will be used.') .'

'; case 'admin/build/modules': - $output = '

'. t('Modules are plugins for Drupal that extend its core functionality. Here you can select which modules are enabled. Once a module is enabled, new permissions might be made available. Modules can automatically be temporarily disabled to reduce server load when your site becomes extremely busy by enabling the throttle.module and checking throttle.', array('@permissions' => url('admin/user/access'))); + $output = '

'. t('Modules are plugins for Drupal that extend its core functionality. Here you can select which modules are enabled. Once a module is enabled, new permissions might be made available. Modules can automatically be temporarily disabled to reduce server load when your site becomes extremely busy by enabling the throttle.module and checking throttle.', array('@permissions' => url('admin/user/permissions'))); if (module_exists('throttle')) { $output .= ' '. t('The auto-throttle functionality must be enabled on the throttle configuration page after having enabled the throttle module.', array('@throttle' => url('admin/settings/throttle'))); } @@ -1001,7 +1001,7 @@ function system_admin_compact_mode() { function system_get_module_admin_tasks($module) { static $items; - $admin_access = user_access('administer access control'); + $admin_access = user_access('administer permissions'); $admin_tasks = array(); if (!isset($items)) { @@ -1020,7 +1020,7 @@ function system_get_module_admin_tasks($module) { $admin_task_count = 0; // Check for permissions. if (module_hook($module, 'perm') && $admin_access) { - $admin_tasks[-1] = l(t('Configure permissions'), 'admin/user/access', array('fragment' => 'module-'. $module)); + $admin_tasks[-1] = l(t('Configure permissions'), 'admin/user/permissions', array('fragment' => 'module-'. $module)); } // Check for menu items that are admin links. diff --git a/modules/upload/upload.module b/modules/upload/upload.module index 93de16ed2..2fe77aca6 100644 --- a/modules/upload/upload.module +++ b/modules/upload/upload.module @@ -18,7 +18,7 @@ function upload_help($path, $arg) { $output .= '

'. t('For more information please read the configuration and customization handbook Upload page.', array('@upload' => 'http://drupal.org/handbook/modules/upload/')) .'

'; return $output; case 'admin/settings/upload': - return '

'. t('Users with the upload files permission can upload attachments. Users with the view uploaded files permission can view uploaded attachments. You can choose which post types can take attachments on the content types settings page.', array('@permissions' => url('admin/user/access'), '@types' => url('admin/settings/types'))) .'

'; + return '

'. t('Users with the upload files permission can upload attachments. Users with the view uploaded files permission can view uploaded attachments. You can choose which post types can take attachments on the content types settings page.', array('@permissions' => url('admin/user/permissions'), '@types' => url('admin/settings/types'))) .'

'; } } diff --git a/modules/user/user.admin.inc b/modules/user/user.admin.inc index 6744f140f..449ff29a3 100644 --- a/modules/user/user.admin.inc +++ b/modules/user/user.admin.inc @@ -955,7 +955,7 @@ 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/access/'. $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); } diff --git a/modules/user/user.module b/modules/user/user.module index fd18e2f5e..3d169127b 100644 --- a/modules/user/user.module +++ b/modules/user/user.module @@ -497,7 +497,7 @@ function user_fields() { * Implementation of hook_perm(). */ function user_perm() { - return array('administer access control', 'administer users', 'access user profiles', 'change own username'); + return array('administer permissions', 'administer users', 'access user profiles', 'change own username'); } /** @@ -923,12 +923,12 @@ function user_menu() { ); // Admin access pages - $items['admin/user/access'] = array( - 'title' => 'Access control', + $items['admin/user/permissions'] = array( + 'title' => 'Permissions', 'description' => 'Determine access to features by selecting permissions for roles.', 'page callback' => 'drupal_get_form', 'page arguments' => array('user_admin_perm'), - 'access arguments' => array('administer access control'), + 'access arguments' => array('administer permissions'), 'file' => 'user.admin.inc', ); $items['admin/user/roles'] = array( @@ -936,7 +936,7 @@ function user_menu() { 'description' => 'List, edit, or add user roles.', 'page callback' => 'drupal_get_form', 'page arguments' => array('user_admin_new_role'), - 'access arguments' => array('administer access control'), + 'access arguments' => array('administer permissions'), 'file' => 'user.admin.inc', ); $items['admin/user/roles/edit'] = array( @@ -949,7 +949,7 @@ function user_menu() { 'title' => 'Access rules', 'description' => 'List and create rules to disallow usernames, e-mail addresses, and IP addresses.', 'page callback' => 'user_admin_access', - 'access arguments' => array('administer access control'), + 'access arguments' => array('administer permissions'), 'file' => 'user.admin.inc', ); $items['admin/user/rules/list'] = array( @@ -1311,7 +1311,7 @@ function user_edit_form(&$form_state, $uid, $edit, $register = FALSE) { if ($admin) { $form['account']['status'] = array('#type' => 'radios', '#title' => t('Status'), '#default_value' => isset($edit['status']) ? $edit['status'] : 1, '#options' => array(t('Blocked'), t('Active'))); } - if (user_access('administer access control')) { + if (user_access('administer permissions')) { $roles = user_roles(1); unset($roles[DRUPAL_AUTHENTICATED_RID]); if ($roles) { @@ -1540,7 +1540,7 @@ function user_user_operations($form_state = array()) { ), ); - if (user_access('administer access control')) { + if (user_access('administer permissions')) { $roles = user_roles(1); unset($roles[DRUPAL_AUTHENTICATED_RID]); // Can't edit authenticated role. @@ -1574,7 +1574,7 @@ function user_user_operations($form_state = array()) { $operation = $operation_rid[0]; if ($operation == 'add_role' || $operation == 'remove_role') { $rid = $operation_rid[1]; - if (user_access('administer access control')) { + if (user_access('administer permissions')) { $operations[$form_state['values']['operation']] = array( 'callback' => 'user_multiple_role_edit', 'callback arguments' => array($operation, $rid), @@ -1695,14 +1695,14 @@ function user_help($path, $arg) { return '

'. t('This web page allows the administrators to register new users by hand. Note that you cannot have a user where either the e-mail address or the username match another user in the system.') .'

'; case 'admin/user/rules': return '

'. t('Set up username and e-mail address access rules for new and existing accounts (currently logged in accounts will not be logged out). If a username or e-mail address for an account matches any deny rule, but not an allow rule, then the account will not be allowed to be created or to log in. A host rule is effective for every page view, not just registrations.') .'

'; - case 'admin/user/access': + case 'admin/user/permissions': return '

'. t('Permissions let you control what users can do on your site. Each user role (defined on the user roles page) 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'))) .'

'; case 'admin/user/roles': return t('

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 user permissions. Examples of roles include: anonymous user, authenticated user, moderator, administrator and so on. In this area you will define the role names of the various roles. To delete a role choose "edit".

By default, Drupal comes with two user roles:

', array('@permissions' => url('admin/user/access'))); + ', array('@permissions' => url('admin/user/permissions'))); case 'admin/user/search': return '

'. 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".') .'

'; } -- cgit v1.2.3