Index: modules/upload/upload.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/upload/upload.admin.inc,v retrieving revision 1.6 diff -u -r1.6 upload.admin.inc --- modules/upload/upload.admin.inc 5 Jan 2008 22:43:41 -0000 1.6 +++ modules/upload/upload.admin.inc 10 Jan 2008 17:39:24 -0000 @@ -109,7 +109,7 @@ $form['settings_general']['upload_max_size'] = array('#value' => '
'. t('Your PHP settings limit the maximum file size per upload to %size.', array('%size' => format_size(file_upload_max_size()))) .'
'); - $roles = user_roles(0, 'upload files'); + $roles = user_roles(FALSE, 'upload files'); $form['roles'] = array('#type' => 'value', '#value' => $roles); foreach ($roles as $rid => $role) { Index: modules/user/user.admin.inc =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.admin.inc,v retrieving revision 1.15 diff -u -r1.15 user.admin.inc --- modules/user/user.admin.inc 10 Jan 2008 16:00:44 -0000 1.15 +++ modules/user/user.admin.inc 10 Jan 2008 17:39:25 -0000 @@ -172,7 +172,7 @@ $destination = drupal_get_destination(); $status = array(t('blocked'), t('active')); - $roles = user_roles(1); + $roles = user_roles(TRUE); $accounts = array(); while ($account = db_fetch_object($result)) { $accounts[$account->uid] = ''; @@ -617,9 +617,9 @@ * @see theme_user_admin_new_role() */ function user_admin_role() { - $id = arg(4); - if ($id) { - if (DRUPAL_ANONYMOUS_RID == $id || DRUPAL_AUTHENTICATED_RID == $id) { + $rid = arg(4); + if ($rid) { + if ($rid == DRUPAL_ANONYMOUS_RID || $rid == DRUPAL_AUTHENTICATED_RID) { drupal_goto('admin/user/roles'); } // Display the edit role form. @@ -635,7 +635,7 @@ ); $form['rid'] = array( '#type' => 'value', - '#value' => $id, + '#value' => $rid, ); $form['submit'] = array( '#type' => 'submit', Index: modules/user/user.module =================================================================== RCS file: /cvs/drupal/drupal/modules/user/user.module,v retrieving revision 1.886 diff -u -r1.886 user.module --- modules/user/user.module 10 Jan 2008 16:00:44 -0000 1.886 +++ modules/user/user.module 10 Jan 2008 17:39:26 -0000 @@ -1436,7 +1436,7 @@ $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 permissions')) { - $roles = user_roles(1); + $roles = user_roles(TRUE); unset($roles[DRUPAL_AUTHENTICATED_RID]); if ($roles) { $default = empty($edit['roles']) ? array() : array_keys($edit['roles']); @@ -1628,7 +1628,7 @@ * @return * An associative array with the role id as the key and the role name as value. */ -function user_roles($membersonly = FALSE, $permission = FALSE) { +function user_roles($membersonly = FALSE, $permission = NULL) { // System roles take the first two positions. $roles = array( DRUPAL_ANONYMOUS_RID => NULL, @@ -1641,9 +1641,19 @@ else { $result = db_query('SELECT * FROM {role} ORDER BY name'); } + while ($role = db_fetch_object($result)) { - if (!$membersonly || ($membersonly && $role->rid != DRUPAL_ANONYMOUS_RID)) { - $roles[$role->rid] = $role->name; + switch ($role->rid) { + case DRUPAL_ANONYMOUS_RID: + if (!$membersonly) { + $roles[$role->rid] = t($role->name); + } + break; + case DRUPAL_AUTHENTICATED_RID: + $roles[$role->rid] = t($role->name); + break; + default: + $roles[$role->rid] = $role->name; } } @@ -1670,7 +1680,7 @@ ); if (user_access('administer permissions')) { - $roles = user_roles(1); + $roles = user_roles(TRUE); unset($roles[DRUPAL_AUTHENTICATED_RID]); // Can't edit authenticated role. $add_roles = array(); @@ -1867,7 +1877,7 @@ function user_filters() { // Regular filters $filters = array(); - $roles = user_roles(1); + $roles = user_roles(TRUE); unset($roles[DRUPAL_AUTHENTICATED_RID]); // Don't list authorized role. if (count($roles)) { $filters['role'] = array(