aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/lcdproc/lcdproc.priv.inc40
-rw-r--r--config/lcdproc/lcdproc.xml12
-rw-r--r--config/lcdproc/lcdproc_screens.xml10
-rw-r--r--config/ntop2/ntop.inc157
-rw-r--r--config/ntop2/ntop.priv.inc37
-rw-r--r--config/ntop2/ntop.xml162
-rw-r--r--config/nut/nut.priv.inc40
-rw-r--r--config/nut/nut.xml8
-rw-r--r--config/phpsysinfo/phpsysinfo.inc156
-rw-r--r--config/phpsysinfo/phpsysinfo.xml121
10 files changed, 364 insertions, 379 deletions
diff --git a/config/lcdproc/lcdproc.priv.inc b/config/lcdproc/lcdproc.priv.inc
new file mode 100644
index 00000000..6b2c061f
--- /dev/null
+++ b/config/lcdproc/lcdproc.priv.inc
@@ -0,0 +1,40 @@
+<?php
+/*
+ lcdproc.priv.inc
+ part of pfSense (http://www.pfSense.org/)
+ Copyright (C) 2015 ESF, LLC
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+global $priv_list;
+
+$priv_list['page-services-lcdproc'] = array();
+$priv_list['page-services-lcdproc']['name'] = "WebCfg - Services: LCDproc package";
+$priv_list['page-services-lcdproc']['descr'] = "Allow access to LCDproc package GUI";
+$priv_list['page-services-lcdproc']['match'] = array();
+$priv_list['page-services-lcdproc']['match'][] = "pkg.php?xml=lcdproc.xml*";
+$priv_list['page-services-lcdproc']['match'][] = "pkg.php?xml=lcdproc_screens.xml*";
+$priv_list['page-services-lcdproc']['match'][] = "pkg_edit.php?xml=lcdproc.xml*";
+$priv_list['page-services-lcdproc']['match'][] = "pkg_edit.php?xml=lcdproc_screens.xml*";
+
+?>
diff --git a/config/lcdproc/lcdproc.xml b/config/lcdproc/lcdproc.xml
index 4f109e47..33e61288 100644
--- a/config/lcdproc/lcdproc.xml
+++ b/config/lcdproc/lcdproc.xml
@@ -45,31 +45,35 @@
</copyright>
<title>Services: LCDproc</title>
<name>lcdproc</name>
- <version>1.0.3</version>
+ <version>1.0.5</version>
<savetext>Save</savetext>
<include_file>/usr/local/pkg/lcdproc.inc</include_file>
<tabs>
<tab>
<text>Server</text>
- <url>/pkg_edit.php?xml=lcdproc.xml&amp;id=0</url>
+ <url>/pkg_edit.php?xml=lcdproc.xml</url>
<active/>
</tab>
<tab>
<text>Screens</text>
- <url>/pkg_edit.php?xml=lcdproc_screens.xml&amp;id=0</url>
+ <url>/pkg_edit.php?xml=lcdproc_screens.xml</url>
</tab>
</tabs>
<menu>
<name>LCDproc</name>
<tooltiptext>Set LCDproc settings such as display driver and COM port.</tooltiptext>
<section>Services</section>
- <url>/pkg_edit.php?xml=lcdproc.xml&amp;id=0</url>
+ <url>/pkg_edit.php?xml=lcdproc.xml</url>
</menu>
<additional_files_needed>
<item>https://packages.pfsense.org/packages/config/lcdproc/lcdproc.inc</item>
<prefix>/usr/local/pkg/</prefix>
</additional_files_needed>
<additional_files_needed>
+ <item>https://packages.pfsense.org/packages/config/lcdproc/lcdproc.priv.inc</item>
+ <prefix>/etc/inc/priv/</prefix>
+ </additional_files_needed>
+ <additional_files_needed>
<item>https://packages.pfsense.org/packages/config/lcdproc/lcdproc_screens.xml</item>
<prefix>/usr/local/pkg/</prefix>
</additional_files_needed>
diff --git a/config/lcdproc/lcdproc_screens.xml b/config/lcdproc/lcdproc_screens.xml
index def770e6..6b6e283b 100644
--- a/config/lcdproc/lcdproc_screens.xml
+++ b/config/lcdproc/lcdproc_screens.xml
@@ -44,18 +44,18 @@
]]>
</copyright>
<title>Services: LCDproc: Screens</title>
- <name>lcdproc_screens</name>
- <version>1.0.3</version>
+ <name>lcdprocscreens</name>
+ <version>1.0.5</version>
<savetext>Save</savetext>
<include_file>/usr/local/pkg/lcdproc.inc</include_file>
<tabs>
<tab>
<text>Server</text>
- <url>/pkg_edit.php?xml=lcdproc.xml&amp;id=0</url>
+ <url>/pkg_edit.php?xml=lcdproc.xml</url>
</tab>
<tab>
<text>Screens</text>
- <url>/pkg_edit.php?xml=lcdproc_screens.xml&amp;id=0</url>
+ <url>/pkg_edit.php?xml=lcdproc_screens.xml</url>
<active/>
</tab>
</tabs>
@@ -63,7 +63,7 @@
<name>LCDproc</name>
<tooltiptext>Set LCDproc settings such as display driver and COM port.</tooltiptext>
<section>Services</section>
- <url>/pkg_edit.php?xml=lcdproc.xml&amp;id=0</url>
+ <url>/pkg_edit.php?xml=lcdproc.xml</url>
</menu>
<fields>
<field>
diff --git a/config/ntop2/ntop.inc b/config/ntop2/ntop.inc
new file mode 100644
index 00000000..da017eac
--- /dev/null
+++ b/config/ntop2/ntop.inc
@@ -0,0 +1,157 @@
+<?php
+/*
+ ntop.inc
+ part of pfSense (http://www.pfSense.org/)
+ Copyright (C) 2011-2013 Jim Pingle
+ Copyright (C) 2015 ESF, LLC
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+require_once("pkg-utils.inc");
+
+function ntop_php_install_command() {
+ safe_mkdir("/var/db/ntop/rrd/graphics", 0755);
+ mwexec("/bin/chmod -R 0755 /var/db/ntop");
+ mwexec("/usr/sbin/chown -R nobody:nobody /var/db/ntop");
+ mwexec("/bin/cp -Rp /usr/local/lib/X11/fonts/webfonts/ /usr/local/lib/X11/fonts/TTF/");
+ ntop_upgrade_config();
+}
+
+function ntop_php_deinstall_command() {
+ global $config;
+
+ /* Wipe data and settings if the user does not wish to keep them */
+ if (is_array($config['installedpackages']['ntop'])) {
+ $ntop_config = $config['installedpackages']['ntop']['config'][0];
+ } else {
+ $ntop_config = array();
+ }
+ if ($ntop_config['keepdata'] != "on") {
+ if (is_dir("/var/db/ntop/")) {
+ mwexec("rm -rf /var/db/ntop/");
+ }
+ unset($config['installedpackages']['ntop']);
+ write_config("[ntop] Removed package settings on uninstall.");
+ log_error(gettext("[ntop] Removed package data and settings since 'Keep Data/Settings' is disabled."));
+ }
+}
+
+function ntop_upgrade_config() {
+ global $config;
+ /* Fix flipped --no-interface-merge configuration meaning */
+ if (is_array($config['installedpackages']['ntop'])) {
+ if (isset($config['installedpackages']['ntop']['config'][0]['allowmerge'])) {
+ $config['installedpackages']['ntop']['config'][0]['disallowmerge'] = "on";
+ unset($config['installedpackages']['ntop']['config'][0]['allowmerge']);
+ }
+ }
+}
+
+function sync_package_ntop() {
+ global $config, $g;
+
+ if (is_array($config['installedpackages']['ntop'])) {
+ $ntop_config = $config['installedpackages']['ntop']['config'][0];
+ } else {
+ $ntop_config = array();
+ }
+ conf_mount_rw();
+
+ /* Just stop services and unlink rc script if disabled */
+ if ($ntop_config['enable'] != "on") {
+ ntop_stop_service();
+ unlink_if_exists("/usr/local/etc/rc.d/ntop.sh");
+ return;
+ }
+
+ /* Set up ntop interfaces */
+ $ifaces_final = "";
+ $first = 0;
+ $mergeifs = $ntop_config['disallowmerge'] == "on" ? "-M" : "";
+
+ foreach ($ntop_config['interface_array'] as $iface) {
+ $if = convert_friendly_interface_to_real_interface_name($iface);
+ if ($if) {
+ if ($first == 1) {
+ $ifaces_final .= ",";
+ }
+ $ifaces_final .= $if;
+ $first = 1;
+ }
+ }
+
+ $start = "/usr/local/bin/ntop -i {$ifaces_final} -u root -d -4 {$mergeifs} -x 8102 -X 8192 &";
+ write_rcfile(array("file" => "ntop.sh", "start" => $start, "stop" => "/usr/bin/killall ntop"));
+
+ /* Set up admin password and (re)start services if not booting */
+ if ((function_exists("platform_booting")) && (!platform_booting())) {
+ ntop_stop_service();
+ ntop_set_password();
+ start_service("ntop");
+ } elseif (!($g['booting'])) {
+ ntop_stop_service();
+ ntop_set_password();
+ start_service("ntop");
+ }
+
+ conf_mount_ro();
+}
+
+function ntop_stop_service() {
+ if (is_service_running("ntop")) {
+ stop_service("ntop");
+ // Wait for ntop to shut down cleanly.
+ for ($i = 0; $i <= 10; $i++) {
+ if (!is_process_running("ntop")) {
+ break;
+ }
+ sleep(2);
+ }
+ }
+}
+
+function ntop_set_password() {
+ global $config;
+
+ if (is_array($config['installedpackages']['ntop'])) {
+ $ntop_config = $config['installedpackages']['ntop']['config'][0];
+ } else {
+ $ntop_config = array();
+ }
+ $ntop_password = $ntop_config['password'] ?: "admin";
+ unlink_if_exists("/var/db/ntop/ntop_pw.db");
+ mwexec("/usr/local/bin/ntop --set-admin-password={$ntop_password}");
+ sleep(2);
+}
+
+function ntop_validate_input($post, &$input_errors) {
+ if (empty($post['password']) || empty($post['passwordagain'])) {
+ $input_errors[] = "You must provide (and confirm) ntop's password.";
+ }
+
+ if ($post['password'] != $post['passwordagain']) {
+ $input_errors[] = "The provided passwords did not match.";
+ }
+}
+
+?>
diff --git a/config/ntop2/ntop.priv.inc b/config/ntop2/ntop.priv.inc
new file mode 100644
index 00000000..e8c80977
--- /dev/null
+++ b/config/ntop2/ntop.priv.inc
@@ -0,0 +1,37 @@
+<?php
+/*
+ ntop.priv.inc
+ part of pfSense (http://www.pfSense.org/)
+ Copyright (C) 2015 ESF, LLC
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+global $priv_list;
+
+$priv_list['page-diagnostics-ntop'] = array();
+$priv_list['page-diagnostics-ntop']['name'] = "WebCfg - Diagnostics: ntop package";
+$priv_list['page-diagnostics-ntop']['descr'] = "Allow access to ntop package GUI";
+$priv_list['page-diagnostics-ntop']['match'] = array();
+$priv_list['page-diagnostics-ntop']['match'][] = "pkg_edit.php?xml=ntop.xml*";
+
+?>
diff --git a/config/ntop2/ntop.xml b/config/ntop2/ntop.xml
index 6ba86525..5aab1e53 100644
--- a/config/ntop2/ntop.xml
+++ b/config/ntop2/ntop.xml
@@ -1,28 +1,31 @@
<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "./schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
+<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
+<?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?>
<packagegui>
<copyright>
<![CDATA[
/* $Id$ */
-/* ========================================================================== */
+/* ====================================================================================== */
/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2008 Scott Ullrich
+ ntop.xml
+ part of pfSense (https://www.pfSense.org/)
+ Copyright (C) 2011-2013 Jim Pingle
+ Copyright (C) 2015 ESF, LLC
All rights reserved.
*/
-/* ========================================================================== */
+/* ====================================================================================== */
/*
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
@@ -35,19 +38,26 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
-/* ========================================================================== */
+/* ====================================================================================== */
]]>
</copyright>
<name>ntop</name>
- <version>3.0</version>
+ <version>2.3.2</version>
<title>Diagnostics: ntop Settings</title>
- <savetext>Change</savetext>
- <aftersaveredirect>pkg_edit.php?xml=ntop.xml&amp;id=0</aftersaveredirect>
+ <include_file>/usr/local/pkg/ntop.inc</include_file>
+ <additional_files_needed>
+ <prefix>/usr/local/pkg/</prefix>
+ <item>https://packages.pfsense.org/packages/config/ntop2/ntop.inc</item>
+ </additional_files_needed>
+ <additional_files_needed>
+ <prefix>/etc/inc/priv/</prefix>
+ <item>https://packages.pfsense.org/packages/config/ntop2/ntop.priv.inc</item>
+ </additional_files_needed>
+ <aftersaveredirect>pkg_edit.php?xml=ntop.xml</aftersaveredirect>
<menu>
<name>ntop Settings</name>
- <tooltiptext>Set ntop settings such as password and port.</tooltiptext>
<section>Diagnostics</section>
- <url>/pkg_edit.php?xml=ntop.xml&amp;id=0</url>
+ <url>/pkg_edit.php?xml=ntop.xml</url>
</menu>
<menu>
<name>ntop</name>
@@ -60,12 +70,12 @@
<name>ntop</name>
<rcfile>ntop.sh</rcfile>
<executable>ntop</executable>
- <description>NTOP bandwidth monitoring/graphing</description>
+ <description>NTOP Network Traffic Monitor</description>
</service>
<tabs>
<tab>
- <text>ntop Settings</text>
- <url>/pkg_edit.php?xml=ntop.xml&amp;id=0</url>
+ <text>Settings</text>
+ <url>/pkg_edit.php?xml=ntop.xml</url>
<active/>
</tab>
<tab>
@@ -75,15 +85,37 @@
</tabs>
<fields>
<field>
+ <fielddescr>Enable ntop</fielddescr>
+ <fieldname>enable</fieldname>
+ <description>Check this to enable ntop.</description>
+ <type>checkbox</type>
+ </field>
+ <field>
+ <fielddescr>Keep Data/Settings</fielddescr>
+ <fieldname>keepdata</fieldname>
+ <description>
+ <![CDATA[
+ Check this to keep ntop settings, graphs and traffic data. (Default: on)<br />
+ <strong><span class="errmsg">Note:</span> If 'Keep Data/Settings' is disabled, all settings and data will be wiped on package uninstall/reinstall/upgrade!</strong>
+ ]]>
+ </description>
+ <type>checkbox</type>
+ <default_value>on</default_value>
+ </field>
+ <field>
<fielddescr>ntop Admin Password</fielddescr>
<fieldname>password</fieldname>
- <description>Enter the password for the NTOP Web GUI. Minimum 5 characters.</description>
+ <description>Enter the password for the NTOP Web GUI. Minimum 5 characters.</description>
<type>password</type>
+ <required>true</required>
+ <size>20</size>
</field>
<field>
- <fielddescr>ntop Admin Password AGAIN</fielddescr>
+ <fielddescr>Confirm ntop Admin Password</fielddescr>
<fieldname>passwordagain</fieldname>
<type>password</type>
+ <required>true</required>
+ <size>20</size>
</field>
<field>
<fielddescr>Interface</fielddescr>
@@ -92,82 +124,30 @@
<size>3</size>
<value>lan</value>
<multiple>true</multiple>
+ <hideinterfaceregex>loopback</hideinterfaceregex>
</field>
<field>
- <fielddescr>Allow merging interfaces&lt;br&gt;(Def: Do not merge)</fielddescr>
- <fieldname>allowmerge</fieldname>
+ <fielddescr>Disallow merging interfaces</fielddescr>
+ <fieldname>disallowmerge</fieldname>
+ <description>
+ <![CDATA[
+ By default, traffic information obtained by all the interfaces is merged together as if the traffic was seen by only one interface.<br />
+ Use this option to keep traffic separate by interface. (Default: Disabled)
+ ]]>
+ </description>
<type>checkbox</type>
</field>
</fields>
- <custom_php_global_functions>
- <![CDATA[
- function sync_package_ntop() {
- conf_mount_rw();
- global $config;
- global $input_errors;
- if ($_POST) {
- $config['installedpackages']['ntop']['config'] = array();
- $config['installedpackages']['ntop']['config'][0] = $_POST;
- }
- $ntop_config =& $config['installedpackages']['ntop']['config'][0];
- $if_final = "";
- $ifaces_final = "";
- system("/bin/mkdir -p /var/db/ntop");
- system("/bin/mkdir -p /var/db/ntop/rrd");
- system("/bin/mkdir -p /var/db/ntop/rrd/graphics");
- system("/bin/chmod -R 755 /var/db/ntop");
- system("/usr/sbin/chown -R nobody:nobody /var/db/ntop");
- system("/bin/cp -Rp /usr/local/lib/X11/fonts/webfonts/ /usr/local/lib/X11/fonts/TTF/");
- $first = 0;
- $mergeifs = ($ntop_config['allowmerge'] == "on") ? "" : "-M";
- foreach($ntop_config['interface_array'] as $iface) {
- $if = convert_friendly_interface_to_real_interface_name($iface);
- if($if) {
- if($first == 1)
- $ifaces_final .= ",";
- $ifaces_final .= $if;
- $first = 1;
- }
- }
- $start = "/usr/local/bin/ntop -i {$ifaces_final} -u root -d -4 {$mergeifs} -x 8102 -X 8192 &";
- write_rcfile(array(
- "file" => "ntop.sh",
- "start" => $start,
- "stop" => "/usr/bin/killall ntop"
- )
- );
- if (is_service_running("ntop")) {
- stop_service("ntop");
- // Wait for ntop to shut down cleanly.
- sleep(20);
- }
- if (empty($ntop_config['password']))
- $ntop_config['password'] = "admin";
- unlink_if_exists("/var/db/ntop/ntop_pw.db");
- exec("/usr/local/bin/ntop --set-admin-password={$ntop_config['password']}");
- sleep(2);
- start_service("ntop");
- conf_mount_ro();
- }
- ]]>
- </custom_php_global_functions>
- <custom_add_php_command>
- sync_package_ntop();
- </custom_add_php_command>
+ <custom_php_install_command>
+ ntop_php_install_command();
+ </custom_php_install_command>
+ <custom_php_deinstall_command>
+ ntop_php_deinstall_command();
+ </custom_php_deinstall_command>
<custom_php_resync_config_command>
sync_package_ntop();
</custom_php_resync_config_command>
- <custom_php_install_command>
- sync_package_ntop();
- </custom_php_install_command>
<custom_php_validation_command>
- <![CDATA[
- if ($_POST) {
- if (empty($_POST['password']) || empty($_POST['passwordagain']))
- $input_errors[] = "You must provide (and confirm) ntop's password.";
- if ($_POST['password'] != $_POST['passwordagain'])
- $input_errors[] = "The provided passwords did not match.";
- }
- ]]>
+ ntop_validate_input($_POST, $input_errors);
</custom_php_validation_command>
</packagegui>
diff --git a/config/nut/nut.priv.inc b/config/nut/nut.priv.inc
new file mode 100644
index 00000000..44cb7402
--- /dev/null
+++ b/config/nut/nut.priv.inc
@@ -0,0 +1,40 @@
+<?php
+/*
+ nut.priv.inc
+ part of pfSense (http://www.pfSense.org/)
+ Copyright (C) 2015 ESF, LLC
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
+ AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
+ OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ POSSIBILITY OF SUCH DAMAGE.
+*/
+global $priv_list;
+
+$priv_list['page-services-nut'] = array();
+$priv_list['page-services-nut']['name'] = "WebCfg - Services: NUT package";
+$priv_list['page-services-nut']['descr'] = "Allow access to NUT package GUI";
+
+$priv_list['page-services-nut']['match'] = array();
+$priv_list['page-services-nut']['match'][] = "pkg_edit.php?xml=nut.xml*";
+$priv_list['page-services-nut']['match'][] = "status_nut.php*";
+$priv_list['page-services-nut']['match'][] = "ups_status.widget.php*";
+
+?>
diff --git a/config/nut/nut.xml b/config/nut/nut.xml
index e066bc83..061a77de 100644
--- a/config/nut/nut.xml
+++ b/config/nut/nut.xml
@@ -41,7 +41,7 @@
]]>
</copyright>
<name>nut</name>
- <version>2.1.1</version>
+ <version>2.1.2</version>
<title>Services: NUT</title>
<savetext>Change</savetext>
<aftersaveredirect>/status_nut.php</aftersaveredirect>
@@ -65,7 +65,7 @@
</tab>
<tab>
<text>NUT Settings</text>
- <url>/pkg_edit.php?xml=nut.xml&amp;id=0</url>
+ <url>/pkg_edit.php?xml=nut.xml</url>
<active/>
</tab>
</tabs>
@@ -74,6 +74,10 @@
<item>https://packages.pfsense.org/packages/config/nut/nut.inc</item>
</additional_files_needed>
<additional_files_needed>
+ <prefix>/etc/inc/priv/</prefix>
+ <item>https://packages.pfsense.org/packages/config/nut/nut.priv.inc</item>
+ </additional_files_needed>
+ <additional_files_needed>
<prefix>/usr/local/www/</prefix>
<item>https://packages.pfsense.org/packages/config/nut/status_nut.php</item>
</additional_files_needed>
diff --git a/config/phpsysinfo/phpsysinfo.inc b/config/phpsysinfo/phpsysinfo.inc
deleted file mode 100644
index 54ece241..00000000
--- a/config/phpsysinfo/phpsysinfo.inc
+++ /dev/null
@@ -1,156 +0,0 @@
-<?php
-function phpsysinfo_install_deinstall() {
- conf_mount_rw();
- exec("cd /var/db/pkg/ && pkg_delete `ls | grep mbmon`");
- exec("rm -d -R /usr/local/www/phpsysinfo");
- conf_mount_ro();
-}
-
-function phpsysinfo_install_config() {
-global $config, $g;
- conf_mount_rw();
- exec("cd ..");
- exec("tar -zxovf /usr/local/pkg/phpsysinfo-2.5.4.tar.gz");
- exec("mv phpsysinfo /usr/local/www/phpsysinfo");
-
-// link shared libraries
-// if ((!file_exists("/lib/libm.so.4")) AND (file_exists("/lib/libm.so.5"))) {
-// exec("ln -s /lib/libm.so.5 /lib/libm.so.4");
-// }
-
- /* lines need in config.php */
-$default_lng = en;
-$default_template= pfSense;
-$hide_picklist = "false";
-$show_vhostname = "false";
-$sensor_program = '""';
-$show_mount_point = "false";
-$show_inodes = "false";
-$hide_mounts = "array()";
-$hide_fstypes = "array()";
-$loadbar = "false";
-$showerrors = "false";
-$temperatureformat = '"c-f"';
-$hide_picklist = $config['installedpackages']['phpsysinfo']['config'][0]['hidepicklist'];
-if($hide_picklist)
- $hide_picklist = "true";
- else
- $hide_picklist = "false";
- $sensor_program = $config['installedpackages']['phpsysinfo']['config'][0]['sensorprogram'];
-if($sensor_program)
- $sensor_program= "mbmon";
- else
- $sensor_program = '""';
- $show_mount_point = $config['installedpackages']['phpsysinfo']['config'][0]['showmountpoint'];
-if($show_mount_point)
- $show_mount_point = "true";
- else
- $show_mount_point = "false";
- $hide_fstypes = $config['installedpackages']['phpsysinfo']['config'][0]['hidefstypes'];
-if($hide_fstypes)
- $hide_fstypes = "$hide_fstypes";
- $show_inodes = $config['installedpackages']['phpsysinfo']['config'][0]['showinodes'];
-if($show_inodes)
- $show_inodes = "true";
- else
- $show_inodes = "false";
- $loadbar = $config['installedpackages']['phpsysinfo']['config'][0]['loadbar'];
-if($loadbar)
- $loadbar = "true";
- else
- $loadbar = "false";
- $showerrors = $config['installedpackages']['phpsysinfo']['config'][0]['showerrors'];
-if($showerrors)
- $showerrors = "true";
- else
- $showerrors = "false";
- $hf = fopen("/usr/local/www/phpsysinfo/config.php","w");
-if(!$hf) {
- log_error("could not open /usr/local/www/phpsysinfo/config.php for writing");
-exit;
-}
-
-fwrite($hf, '<?php');
-fwrite($hf, "\n");
-// webpath but not used
-fwrite($hf, '$webpath = "";');
-fwrite($hf, "\n");
-// define the default lang and template here
-fwrite($hf, '$default_lng=');
-fwrite($hf, "'");
-fwrite($hf, $default_lng);
-fwrite($hf, "'");
-fwrite($hf, ';');
-fwrite($hf, "\n");
-fwrite($hf, '$default_template=');
-fwrite($hf, "'");
-fwrite($hf, $default_template);
-fwrite($hf, "'");
-fwrite($hf, ';');
-fwrite($hf, "\n");
-// hide language and template picklist
-// false = display picklist
-// true = do not display picklist
-fwrite($hf, '$hide_picklist = ');
-fwrite($hf, $hide_picklist);
-fwrite($hf, ';');
-fwrite($hf, "\n");
-// display the virtual host name and address
-// default is canonical host name and address
-fwrite($hf, '$show_vhostname = ');
-fwrite($hf, $show_vhostname);
-fwrite($hf, ';');
-fwrite($hf, "\n");
-// define the motherboard monitoring program here
-fwrite($hf, '$sensor_program = ');
-fwrite($hf, $sensor_program);
-fwrite($hf, ';');
-fwrite($hf, "\n");
-// show mount point
-fwrite($hf, '$show_mount_point = ');
-fwrite($hf, $show_mount_point);
-fwrite($hf, ';');
-fwrite($hf, "\n");
-// show bind
-fwrite($hf, '$show_bind = false;');
-fwrite($hf, "\n");
-// show inode usage
-fwrite($hf, '$show_inodes = ');
-fwrite($hf, $show_inodes);
-fwrite($hf, ';');
-fwrite($hf, "\n");
-// show inode usage
-fwrite($hf, '$hide_mounts = ');
-fwrite($hf, $hide_mounts);
-fwrite($hf, ';');
-fwrite($hf, "\n");
-// Hide filesystem typess. Example: 'tmpfs', 'usbfs'
-fwrite($hf, '$hide_fstypes = array(');
-fwrite($hf, $hide_fstypes);
-fwrite($hf, ');');
-fwrite($hf, "\n");
-// show a graph for current cpuload
-fwrite($hf, '$loadbar = ');
-fwrite($hf, $loadbar);
-fwrite($hf, ';');
-fwrite($hf, "\n");
-// e.g. $addpaths = array('/opt/bin', '/opt/sbin');
-fwrite($hf, '$addpaths = array();');
-fwrite($hf, "\n");
-// display error messages at the top of the page
-fwrite($hf, '$showerrors = ');
-fwrite($hf, $showerrors);
-fwrite($hf, ';');
-fwrite($hf, "\n");
-// format in which temperature is displayed
-fwrite($hf, '$temperatureformat = ');
-fwrite($hf, $temperatureformat);
-fwrite($hf, ';');
-fwrite($hf, "\n");
-// The end of the config file
-fwrite($hf, '?>');
-fwrite($hf, "\n");
-fclose($hf);
- conf_mount_ro();
-}
-?>
diff --git a/config/phpsysinfo/phpsysinfo.xml b/config/phpsysinfo/phpsysinfo.xml
deleted file mode 100644
index 550c0785..00000000
--- a/config/phpsysinfo/phpsysinfo.xml
+++ /dev/null
@@ -1,121 +0,0 @@
-<?xml version="1.0" encoding="utf-8" ?>
-<!DOCTYPE packagegui SYSTEM "../schema/packages.dtd">
-<?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?>
-<packagegui>
- <copyright>
- <![CDATA[
-/* $Id$ */
-/* ========================================================================== */
-/*
- authng.xml
- part of pfSense (http://www.pfSense.com)
- Copyright (C) 2007 to whom it may belong
- All rights reserved.
-
- Based on m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>.
- All rights reserved.
- */
-/* ========================================================================== */
-/*
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions are met:
-
- 1. Redistributions of source code must retain the above copyright notice,
- this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
- INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
- OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- POSSIBILITY OF SUCH DAMAGE.
- */
-/* ========================================================================== */
- ]]>
- </copyright>
- <description>Describe your package here</description>
- <requirements>Describe your package requirements here</requirements>
- <faq>Currently there are no FAQ items provided.</faq>
- <name>phpsysinfo</name>
- <version>1.0</version>
- <title>phpsysinfo</title>
- <aftersaveredirect>/pkg_edit.php?xml=phpsysinfo.xml&amp;id=0</aftersaveredirect>
- <include_file>/usr/local/pkg/phpsysinfo.inc</include_file>
- <menu>
- <name>phpsysinfo</name>
- <tooltiptext></tooltiptext>
- <section>Status</section>
- <url>/pkg_edit.php?xml=phpsysinfo.xml&amp;id=0</url>
- </menu>
- <tabs>
- <tab>
- <text>phpsysinfo</text>
- <url>/pkg_edit.php?xml=phpsysinfo.xml&amp;id=0</url>
- <active/>
- </tab>
- <tab>
- <text>Access phpsysinfo</text>
- <url>/phpsysinfo</url>
- </tab>
- </tabs>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0644</chmod>
- <item>https://packages.pfsense.org/packages/config/phpsysinfo/phpsysinfo.inc</item>
- </additional_files_needed>
- <additional_files_needed>
- <prefix>/usr/local/pkg/</prefix>
- <chmod>0644</chmod>
- <item>https://files.pfsense.org/packages/phpsysinfo-2.5.4.tar.gz</item>
- </additional_files_needed>
- <fields>
- <field>
- <fielddescr>Hide picklist</fielddescr>
- <fieldname>hidepicklist</fieldname>
- <description>Hide language and template picklist</description>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>Show mbmon</fielddescr>
- <fieldname>sensorprogram</fieldname>
- <description>Define the motherboard monitoring program here. Note that not all motherboards are supported and some only partly.</description>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>Show mount point</fielddescr>
- <fieldname>showmountpoint</fieldname>
- <description>Show mount point</description>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>Show inodes</fielddescr>
- <fieldname>showinodes</fieldname>
- <description>Show inode usage</description>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>Show loadbar</fielddescr>
- <fieldname>loadbar</fieldname>
- <description>Show a graph for current cpuload</description>
- <type>checkbox</type>
- </field>
- <field>
- <fielddescr>Show errors</fielddescr>
- <fieldname>showerrors</fieldname>
- <description>Display error messages at the top of the page. Note that vmstat is added in 1.0.1-SNAPSHOT-03-15-2007 and later</description>
- <type>checkbox</type>
- </field>
- </fields>
- <custom_php_resync_config_command>phpsysinfo_install_config();</custom_php_resync_config_command>
- <custom_php_install_command>phpsysinfo_install_config();</custom_php_install_command>
- <custom_php_deinstall_command>phpsysinfo_install_deinstall();</custom_php_deinstall_command>
-</packagegui>