summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/usr/local/www/services_ntpd.php1
-rw-r--r--src/usr/local/www/system_groupmanager_addprivs.php61
-rw-r--r--src/usr/local/www/system_usermanager_addprivs.php16
3 files changed, 69 insertions, 9 deletions
diff --git a/src/usr/local/www/services_ntpd.php b/src/usr/local/www/services_ntpd.php
index 3340bdf..04d4397 100644
--- a/src/usr/local/www/services_ntpd.php
+++ b/src/usr/local/www/services_ntpd.php
@@ -79,6 +79,7 @@ if (empty($config['ntpd']['interface'])) {
$pconfig['interface'] = explode(",", $config['installedpackages']['openntpd']['config'][0]['interface']);
unset($config['installedpackages']['openntpd']);
write_config("Upgraded settings from openttpd");
+ print('<h2>What?</h2>');
} else {
$pconfig['interface'] = array();
}
diff --git a/src/usr/local/www/system_groupmanager_addprivs.php b/src/usr/local/www/system_groupmanager_addprivs.php
index 278c734..b39863a 100644
--- a/src/usr/local/www/system_groupmanager_addprivs.php
+++ b/src/usr/local/www/system_groupmanager_addprivs.php
@@ -156,12 +156,28 @@ if (isAjax()) {
print_info_box_np($savemsg);
}
+function build_priv_list() {
+ global $priv_list, $a_group;
+
+ $list = array();
+
+ foreach($priv_list as $pname => $pdata) {
+ if (in_array($pname, $a_group['priv']))
+ continue;
+
+ $list[$pname] = $pdata;
+ }
+
+ return($list);
+}
+
include("head.inc");
if ($input_errors)
print_input_errors($input_errors);
+
if ($savemsg)
- print_info_box($savemsg);
+ print_info_box($savemsg, success);
$tab_array = array();
$tab_array[] = array(gettext("Users"), false, "system_usermanager.php");
@@ -190,12 +206,51 @@ $section->addInput(new Form_Select(
'sysprivs',
'Assigned privileges',
$a_group['priv'],
- $priv_list,
+ build_priv_list(),
true
-))->setHelp('Hold down CTRL (pc)/COMMAND (mac) key to select')->setAttribute('style', 'height:400px;');
+))->addClass('multiselect')->setHelp('Hold down CTRL (pc)/COMMAND (mac) key to select')->setAttribute('style', 'height:400px;');
$form->add($section);
print $form;
+?>
+<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[
+events.push(function(){
+
+<?php
+
+ // Build a list of privilege descriptions
+ if (is_array($priv_list)) {
+ $id = 0;
+
+ $jdescs = "var descs = new Array();\n";
+ foreach ($priv_list as $pname => $pdata) {
+ if (in_array($pname, $a_group['priv'])) {
+ continue;
+ }
+
+ $desc = addslashes(preg_replace("/pfSense/i", $g['product_name'], $pdata));
+ $jdescs .= "descs[{$id}] = '{$desc}';\n";
+ $id++;
+ }
+
+ echo $jdescs;
+ }
+?>
+ // Set the number of options to display
+ $('.multiselect').attr("size","20");
+
+ // When the 'sysprivs" selector is clicked, we display a description
+ $('.multiselect').click(function() {
+ $('#pdesc').html('<span style="color: green;">' + descs[$(this).children('option:selected').index()] + '</span>');
+ });
+});
+//]]>
+</script>
+
+<?php
include('foot.inc');
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