summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/system_usermanager_addprivs.php
diff options
context:
space:
mode:
authorStephen Beaver <sbeaver@netgate.com>2015-11-30 13:39:42 -0500
committerStephen Beaver <sbeaver@netgate.com>2015-11-30 13:40:05 -0500
commite680db0c7c7b493df4b38a6d823710d34d3593f8 (patch)
treef8cf790d7b275efaad9835ba5f73f7b4579ccb44 /src/usr/local/www/system_usermanager_addprivs.php
parent840390d11bd9b8ef267a9d62e21a5e1cea57fd63 (diff)
downloadpfsense-e680db0c7c7b493df4b38a6d823710d34d3593f8.zip
pfsense-e680db0c7c7b493df4b38a6d823710d34d3593f8.tar.gz
Fixed #5535
Diffstat (limited to 'src/usr/local/www/system_usermanager_addprivs.php')
-rw-r--r--src/usr/local/www/system_usermanager_addprivs.php16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/usr/local/www/system_usermanager_addprivs.php b/src/usr/local/www/system_usermanager_addprivs.php
index 3440c2d..1511608 100644
--- a/src/usr/local/www/system_usermanager_addprivs.php
+++ b/src/usr/local/www/system_usermanager_addprivs.php
@@ -91,6 +91,10 @@ if (!is_array($a_user['priv'])) {
$a_user['priv'] = array();
}
+// Make a local copy and sort it
+$spriv_list = $priv_list;
+uasort($spriv_list, admusercmp);
+
if ($_POST) {
conf_mount_rw();
@@ -136,11 +140,11 @@ if ($_POST) {
}
function build_priv_list() {
- global $priv_list, $a_user;
+ global $spriv_list, $a_user;
$list = array();
- foreach($priv_list as $pname => $pdata) {
+ foreach($spriv_list as $pname => $pdata) {
if (in_array($pname, $a_user['priv']))
continue;
@@ -196,7 +200,7 @@ $form->add($section);
print($form);
?>
-<div class="panel panel-body alert-info" id="pdesc">Select a privilege from the list above for a description"</div>
+<div class="panel panel-body alert-info col-sm-10 col-sm-offset-2" id="pdesc">Select a privilege from the list above for a description</div>
<script type="text/javascript">
//<![CDATA[
@@ -205,11 +209,11 @@ events.push(function(){
<?php
// Build a list of privilege descriptions
- if (is_array($priv_list)) {
+ if (is_array($spriv_list)) {
$id = 0;
$jdescs = "var descs = new Array();\n";
- foreach ($priv_list as $pname => $pdata) {
+ foreach ($spriv_list as $pname => $pdata) {
if (in_array($pname, $a_user['priv'])) {
continue;
}
@@ -226,7 +230,7 @@ events.push(function(){
// When the 'sysprivs" selector is clicked, we display a description
$('.multiselect').click(function() {
- $('#pdesc').html(descs[$(this).children('option:selected').index()]);
+ $('#pdesc').html('<span style="color: green;">' + descs[$(this).children('option:selected').index()] + '</span>');
});
});
//]]>
OpenPOWER on IntegriCloud