summaryrefslogtreecommitdiffstats
path: root/src
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
parent840390d11bd9b8ef267a9d62e21a5e1cea57fd63 (diff)
downloadpfsense-e680db0c7c7b493df4b38a6d823710d34d3593f8.zip
pfsense-e680db0c7c7b493df4b38a6d823710d34d3593f8.tar.gz
Fixed #5535
Diffstat (limited to 'src')
-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