mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Standardize privilege page and sorting between users and groups. Fixes #7587
This commit is contained in:
parent
8abe827287
commit
2c1a08a8a3
@ -3244,4 +3244,8 @@ function addrtolower($ip) {
|
||||
return($ip);
|
||||
}
|
||||
}
|
||||
|
||||
function compare_by_name($a, $b) {
|
||||
return strcasecmp($a['name'], $b['name']);
|
||||
}
|
||||
?>
|
||||
|
||||
@ -53,6 +53,7 @@ if (!is_array($a_group['priv'])) {
|
||||
|
||||
// Make a local copy and sort it
|
||||
$spriv_list = $priv_list;
|
||||
uasort($spriv_list, "compare_by_name");
|
||||
|
||||
if ($_POST['save']) {
|
||||
|
||||
@ -146,7 +147,17 @@ if (isset($groupid)) {
|
||||
));
|
||||
}
|
||||
|
||||
$section = new Form_Section('Add Privileges for '. $a_group['name']);
|
||||
$section = new Form_Section('Group Privileges');
|
||||
|
||||
$name_string = $a_group['name'];
|
||||
if (!empty($a_group['descr'])) {
|
||||
$name_string .= " ({$a_group['descr']})";
|
||||
}
|
||||
|
||||
$section->addInput(new Form_StaticText(
|
||||
'Group',
|
||||
$name_string
|
||||
));
|
||||
|
||||
$section->addInput(new Form_Select(
|
||||
'sysprivs',
|
||||
|
||||
@ -28,10 +28,6 @@
|
||||
##|*MATCH=system_usermanager_addprivs.php*
|
||||
##|-PRIV
|
||||
|
||||
function admusercmp($a, $b) {
|
||||
return strcasecmp($a['name'], $b['name']);
|
||||
}
|
||||
|
||||
require_once("guiconfig.inc");
|
||||
require_once("pfsense-utils.inc");
|
||||
|
||||
@ -55,7 +51,7 @@ if (!is_array($a_user['priv'])) {
|
||||
|
||||
// Make a local copy and sort it
|
||||
$spriv_list = $priv_list;
|
||||
uasort($spriv_list, "admusercmp");
|
||||
uasort($spriv_list, "compare_by_name");
|
||||
|
||||
if ($_POST['save']) {
|
||||
unset($input_errors);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user