From a816feaddf335c67833785f13c52a546392ac8d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A1bor=20Hojtsy?= Date: Thu, 10 Jan 2008 16:00:44 +0000 Subject: #206078 by Pancho, traxer: order roles with system roles first (usability) --- modules/user/user.admin.inc | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'modules/user/user.admin.inc') diff --git a/modules/user/user.admin.inc b/modules/user/user.admin.inc index cda6fbb97..5ef118fe2 100644 --- a/modules/user/user.admin.inc +++ b/modules/user/user.admin.inc @@ -6,7 +6,6 @@ * Admin page callback file for the user module. */ - function user_admin($callback_arg = '') { $op = isset($_POST['op']) ? $_POST['op'] : $callback_arg; @@ -514,16 +513,10 @@ function user_admin_perm($form_state, $rid = NULL) { $role_permissions[$role->rid] = $role->perm .','; } + // Retrieve role names for columns. + $role_names = user_roles(); if (is_numeric($rid)) { - $result = db_query('SELECT rid, name FROM {role} r WHERE r.rid = %d ORDER BY name', $rid); - } - else { - $result = db_query('SELECT rid, name FROM {role} ORDER BY name'); - } - - $role_names = array(); - while ($role = db_fetch_object($result)) { - $role_names[$role->rid] = $role->name; + $role_names = array($rid => $role_names[$rid]); } // Render role/permission overview: @@ -557,7 +550,6 @@ function user_admin_perm($form_state, $rid = NULL) { return $form; } - function user_admin_perm_submit($form, &$form_state) { // Save permissions: $result = db_query('SELECT * FROM {role}'); -- cgit v1.2.3