diff options
53 files changed, 2361 insertions, 5949 deletions
diff --git a/config/arpwatch/arpwatch.xml b/config/arpwatch/arpwatch.xml index a40422d4..aa6a9ae8 100644 --- a/config/arpwatch/arpwatch.xml +++ b/config/arpwatch/arpwatch.xml @@ -1,28 +1,30 @@ <?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$ */ +/* ====================================================================================== */ /* arpwatch.xml - part of pfSense (https://www.pfsense.org) - Copyright (C) 2007-2014 Electric Sheep Fencing LP + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2007-2015 Electric Sheep Fencing LP 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 @@ -34,15 +36,13 @@ 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>ARP Monitoring Daemon</description> - <requirements>None</requirements> - <faq>Currently there are no FAQ items provided.</faq> <name>arpwatch</name> - <version>2.1.a14 pkg v1.1.1</version> + <version>1.1.2</version> <title>arpwatch: Settings</title> <aftersaveredirect>pkg_edit.php?xml=arpwatch.xml&id=0</aftersaveredirect> <menu> @@ -71,12 +71,12 @@ <configpath>installedpackages->package->$packagename->configuration->settings</configpath> <additional_files_needed> <prefix>/usr/local/www/</prefix> - <chmod>a+rx</chmod> + <chmod>0755</chmod> <item>https://packages.pfsense.org/packages/config/arpwatch/arpwatch_reports.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/sbin/</prefix> - <chmod>a+rx</chmod> + <chmod>0755</chmod> <item>https://packages.pfsense.org/packages/config/arpwatch/sm.php</item> </additional_files_needed> <fields> @@ -90,33 +90,44 @@ <fielddescr>Enable E-mail Notifications</fielddescr> <fieldname>enable_email</fieldname> <type>checkbox</type> - <description>Sends an E-mail notification for each new station and ARP change as they are seen <strong>instead of</strong> local reports.<br/>NOTE: Only works on pfSense 2.1 or later. <br/>NOTE 2: Disables local reports which rely on arpwatch debug mode, which does not work with e-mail notifications.<br/>Configure SMTP and address settings in System > Advanced on the Notifications tab</description> + <description> + <![CDATA[ + Sends an E-mail notification for each new station and ARP change as they are seen <strong>, instead of</strong> local reports.<br /> + NOTE: Disables local reports which rely on arpwatch debug mode, which does not work with e-mail notifications.<br /> + Configure SMTP and address settings in System - Advanced on the Notifications tab. + ]]> + </description> </field> </fields> <custom_php_global_functions> <![CDATA[ function sync_package_arpwatch() { global $config; - $pf_version=substr(trim(file_get_contents("/etc/version")),0,3); conf_mount_rw(); - config_lock(); $log_file = "/var/log/arp.dat"; - if($_POST['interface'] != "") { - $int = $_POST['interface']; - } else { - $int = $config['installedpackages']['arpwatch']['config'][0]['interface']; - } + + /* E-mail notifications setup */ $mail = ""; $debug = ""; - if(($pf_version > 2.0) && (isset($_POST['enable_email']) || ($config['installedpackages']['arpwatch']['config'][0]['enable_email'] == "on"))) { - if (!empty($config['notifications']['smtp']['notifyemailaddress'])) + if (isset($_POST['enable_email']) || ($config['installedpackages']['arpwatch']['config'][0]['enable_email'] == "on")) { + if (!empty($config['notifications']['smtp']['notifyemailaddress'])) { $mail = " -m \"{$config['notifications']['smtp']['notifyemailaddress']}\""; + } } else { $debug = "-d"; } + + /* Listening interface setup */ + if ($_POST['interface'] != "") { + $int = $_POST['interface']; + } else { + $int = $config['installedpackages']['arpwatch']['config'][0]['interface']; + } $int = convert_friendly_interface_to_real_interface_name($int); - $start = "touch {$log_file}\n"; - $start .= "/usr/local/sbin/arpwatch {$debug} -f {$log_file} {$mail} -i {$int} > /var/log/arpwatch.reports 2>&1 &"; + + /* Create init script */ + $start = "/usr/bin/touch {$log_file}\n"; + $start .= "/usr/local/sbin/arpwatch {$debug} -f {$log_file} {$mail} -i {$int} > /var/log/arpwatch.reports 2>&1 &"; $stop = "/usr/bin/killall arpwatch"; write_rcfile(array( "file" => "arpwatch.sh", @@ -124,9 +135,9 @@ "stop" => $stop ) ); + restart_service("arpwatch"); conf_mount_ro(); - config_unlock(); } ]]> </custom_php_global_functions> @@ -141,4 +152,9 @@ @link("/usr/sbin/sm.php", "/usr/sbin/sendmail"); ]]> </custom_php_install_command> + <custom_php_resync_config_command> + <![CDATA[ + sync_package_arpwatch(); + ]]> + </custom_php_resync_config_command> </packagegui> diff --git a/config/arpwatch/arpwatch_reports.php b/config/arpwatch/arpwatch_reports.php index 9b3b1c6c..c1ab376f 100755 --- a/config/arpwatch/arpwatch_reports.php +++ b/config/arpwatch/arpwatch_reports.php @@ -1,61 +1,65 @@ #!/usr/local/bin/php <?php /* - $Id$ + arpwatch_reports.php + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2005 Colin Smith + Copyright (C) 2007-2015 ESF, LLC + All rights reserved. - arpwatch_reports.php - Copyright (C) 2005 Colin Smith - All rights reserved. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: - 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. - 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. - 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. + 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("guiconfig.inc"); require_once("service-utils.inc"); $logfile = "/var/log/arp.dat"; if ($_POST['clear']) { - stop_service("arpwatch"); + conf_mount_rw(); + stop_service("arpwatch"); unlink_if_exists($logfile); touch($logfile); start_service("arpwatch"); + conf_mount_ro(); } -if(file_exists($logfile)) { +if (file_exists($logfile)) { $rawrep = file($logfile); - foreach($rawrep as $line) { - $todo = preg_split('/\s/', $line); + foreach ($rawrep as $line) { + $todo = preg_split('/\s/', $line); $rawmac = explode(":", trim($todo[0])); - foreach($rawmac as $set) $mac[] = str_pad($set, 2, "0", STR_PAD_LEFT); + foreach ($rawmac as $set) { + $mac[] = str_pad($set, 2, "0", STR_PAD_LEFT); + } $newmac = implode(":", $mac); - $report[$todo[1]][] = array( - "mac" => $newmac, - "timestamp" => trim($todo[2]), - "hostname" => trim($todo[3]) ? trim($todo[3]) : "Unknown" - ); + $report[$todo[1]][] = array( + "mac" => $newmac, + "timestamp" => trim($todo[2]), + "hostname" => trim($todo[3]) ? trim($todo[3]) : "Unknown" + ); unset($mac); } } + $pgtitle = "arpwatch: Reports"; include("head.inc"); @@ -64,23 +68,23 @@ include("head.inc"); <body link="#0000CC" vlink="#0000CC" alink="#0000CC"> <?php include("fbegin.inc"); ?> <table width="100%" border="0" cellpadding="0" cellspacing="0"> - <tr> - <td> + <tr> + <td> <?php - $tab_array = array(); - $tab_array[] = array("Settings", false, "pkg_edit.php?xml=arpwatch.xml&id=0"); + $tab_array = array(); + $tab_array[] = array("Settings", false, "pkg_edit.php?xml=arpwatch.xml&id=0"); $tab_array[] = array("Reports", true, "arpwatch_reports.php"); display_top_tabs($tab_array); ?> - </td> - </tr> - <tr> - <td> - <div id="mainarea"> - <table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0"> - <tr> - <td colspan="4" class="listtopic">arp.dat entries</td> - </tr> + </td> + </tr> + <tr> + <td> + <div id="mainarea"> + <table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0"> + <tr> + <td colspan="4" class="listtopic">arp.dat entries</td> + </tr> <tr> <td width="15%" class="listhdrr">IP</td> <td width="25%" class="listhdrr">Timestamp</td> @@ -88,14 +92,14 @@ include("head.inc"); <td width="45%" class="listhdrr">Hostname</td> </tr> <?php - if($report) - foreach($report as $ip => $rawentries) { + if ($report) { + foreach ($report as $ip => $rawentries) { $printip = true; $entries = $rawentries; sort($entries); - foreach($entries as $entry) { + foreach ($entries as $entry) { echo '<tr>'; - if($printip) { + if ($printip) { echo '<td class="listlr">' . $ip . '</td>'; $stampclass = "listr"; $printip = false; @@ -111,17 +115,21 @@ include("head.inc"); echo '</tr>'; } } + } ?> - <tr> - <td> - <br> - <form action="arpwatch_reports.php" method="post"> - <input name="clear" type="submit" class="formbtn" value="Clear log"> - </form> - </td> - </tr> - </table> - </div> - </td> - </tr> + <tr> + <td> + <br /> + <form action="arpwatch_reports.php" method="post"> + <input name="clear" type="submit" class="formbtn" value="Clear log" /> + </form> + </td> + </tr> + </table> + </div> + </td> + </tr> </table> +<?php include("fend.inc"); ?> +</body> +</html> diff --git a/config/arpwatch/sm.php b/config/arpwatch/sm.php index 2e1cc4a0..4df6cead 100644 --- a/config/arpwatch/sm.php +++ b/config/arpwatch/sm.php @@ -1,33 +1,49 @@ #!/usr/local/bin/php -q <?php +/* + sm.php + part of pfSense (https://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. +*/ require_once("config.inc"); require_once("globals.inc"); require_once("notices.inc"); -$pf_version=substr(trim(file_get_contents("/etc/version")),0,3); -if (($pf_version < 2.1)) { - $error = "Sending e-mail on this version of pfSense is not supported. Please use pfSense 2.1 or later"; - log_error($error); - echo "{$error}\n"; - return; -} - $options = getopt("s::"); - $message = ""; -if($options['s'] <> "") { +if ($options['s'] <> "") { $subject = $options['s']; } - $in = file("php://stdin"); -foreach($in as $line){ +foreach ($in as $line) { $line = trim($line); - if ( (substr($line, 0, 6) == "From: ") - || (substr($line, 0, 6) == "Date: ") - || (substr($line, 0, 4) == "To: ")) + if ((substr($line, 0, 6) == "From: ") || (substr($line, 0, 6) == "Date: ") || (substr($line, 0, 4) == "To: ")) { continue; + } if (empty($subject) && (substr($line, 0, 9) == "Subject: ")) { $subject = substr($line, 9); continue; @@ -35,8 +51,10 @@ foreach($in as $line){ $message .= "$line\n"; } -if (!empty($subject)) +if (!empty($subject)) { send_smtp_message($message, $subject); -else +} else { send_smtp_message($message); -?>
\ No newline at end of file +} + +?> diff --git a/config/haproxy-devel/haproxy.xml b/config/haproxy-devel/haproxy.xml index e057bfb2..386e43a7 100644 --- a/config/haproxy-devel/haproxy.xml +++ b/config/haproxy-devel/haproxy.xml @@ -3,46 +3,46 @@ <?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?> <packagegui> <copyright> - <![CDATA[ + <![CDATA[ /* $Id$ */ -/* ========================================================================== */ +/* ====================================================================================== */ /* - haproxy.xml - part of pfSense (http://www.pfSense.com) - Copyright (C) 2009 Scott Ullrich - All rights reserved. - */ -/* ========================================================================== */ + haproxy.xml + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2009 Scott Ullrich + 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: + 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. - 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> + 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> <name>haproxy</name> - <version>1.0</version> + <version>0.28</version> <title>HAProxy</title> <aftersaveredirect>/pkg_edit.php?xml=haproxy_pools.php</aftersaveredirect> <include_file>/usr/local/pkg/haproxy.inc</include_file> @@ -75,72 +75,58 @@ <configpath>installedpackages->haproxy->config</configpath> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/haproxy-devel/pkg/haproxy.inc</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/haproxy-devel/www/haproxy_listeners.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/haproxy-devel/www/haproxy_listeners_edit.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/haproxy-devel/www/haproxy_global.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/haproxy-devel/www/haproxy_files.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/haproxy-devel/www/haproxy_pools.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/haproxy-devel/www/haproxy_pool_edit.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/haproxy-devel/www/haproxy_stats.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/haproxy-devel/www/haproxy_templates.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/haproxy-devel/pkg/haproxy_socketinfo.inc</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/haproxy-devel/pkg/haproxy_xmlrpcsyncclient.inc</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/haproxy-devel/pkg/haproxy_htmllist.inc</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/haproxy-devel/pkg/haproxy_utils.inc</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/widgets/widgets/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/haproxy-devel/www/widgets/widgets/haproxy.widget.php</item> </additional_files_needed> <additional_files_needed> @@ -150,31 +136,20 @@ </additional_files_needed> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/haproxy-devel/pkg/pkg_haproxy_tabs.inc</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/haproxy-devel/pkg/haproxy_upgrade_config.inc</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/javascript/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/haproxy-devel/www/javascript/haproxy_geturl.js</item> </additional_files_needed> - <custom_delete_php_command> - </custom_delete_php_command> - <custom_add_php_command> - </custom_add_php_command> - <custom_php_resync_config_command> - </custom_php_resync_config_command> <custom_php_install_command> haproxy_custom_php_install_command(); </custom_php_install_command> <custom_php_deinstall_command> haproxy_custom_php_deinstall_command(); </custom_php_deinstall_command> - <custom_php_command_before_form> - </custom_php_command_before_form> </packagegui> diff --git a/config/haproxy1_5/haproxy.xml b/config/haproxy1_5/haproxy.xml index 7468b211..c59b2592 100644 --- a/config/haproxy1_5/haproxy.xml +++ b/config/haproxy1_5/haproxy.xml @@ -2,47 +2,47 @@ <!DOCTYPE packagegui SYSTEM "../schema/packages.dtd"> <?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?> <packagegui> - <copyright> - <![CDATA[ + <copyright> + <![CDATA[ /* $Id$ */ -/* ========================================================================== */ +/* ====================================================================================== */ /* - haproxy.xml - part of pfSense (http://www.pfSense.com) - Copyright (C) 2009 Scott Ullrich - All rights reserved. - */ -/* ========================================================================== */ + haproxy.xml + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2009 Scott Ullrich + 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: + 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. - 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> + 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> <name>haproxy</name> - <version>1.0</version> + <version>0.28</version> <title>HAProxy</title> <aftersaveredirect>/pkg_edit.php?xml=haproxy_pools.php</aftersaveredirect> <include_file>/usr/local/pkg/haproxy.inc</include_file> @@ -75,72 +75,58 @@ <configpath>installedpackages->haproxy->config</configpath> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/haproxy1_5/pkg/haproxy.inc</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/haproxy1_5/www/haproxy_listeners.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/haproxy1_5/www/haproxy_listeners_edit.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/haproxy1_5/www/haproxy_global.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/haproxy1_5/www/haproxy_files.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/haproxy1_5/www/haproxy_pools.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/haproxy1_5/www/haproxy_pool_edit.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/haproxy1_5/www/haproxy_stats.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/haproxy1_5/www/haproxy_templates.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/haproxy1_5/pkg/haproxy_socketinfo.inc</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/haproxy1_5/pkg/haproxy_xmlrpcsyncclient.inc</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/haproxy1_5/pkg/haproxy_htmllist.inc</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/haproxy1_5/pkg/haproxy_utils.inc</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/widgets/widgets/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/haproxy1_5/www/widgets/widgets/haproxy.widget.php</item> </additional_files_needed> <additional_files_needed> @@ -150,31 +136,20 @@ </additional_files_needed> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/haproxy1_5/pkg/pkg_haproxy_tabs.inc</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/haproxy1_5/pkg/haproxy_upgrade_config.inc</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/javascript/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/haproxy1_5/www/javascript/haproxy_geturl.js</item> </additional_files_needed> - <custom_delete_php_command> - </custom_delete_php_command> - <custom_add_php_command> - </custom_add_php_command> - <custom_php_resync_config_command> - </custom_php_resync_config_command> <custom_php_install_command> haproxy_custom_php_install_command(); </custom_php_install_command> <custom_php_deinstall_command> haproxy_custom_php_deinstall_command(); </custom_php_deinstall_command> - <custom_php_command_before_form> - </custom_php_command_before_form> </packagegui> diff --git a/config/ladvd/ladvd.inc b/config/ladvd/ladvd.inc index acf277b3..da37a1a9 100644 --- a/config/ladvd/ladvd.inc +++ b/config/ladvd/ladvd.inc @@ -1,7 +1,10 @@ <?php /* ladvd.inc - Copyright (C) 2006 Scott Ullrich + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2014 Andrea Tuccia + Copyright (C) 2014 Ermal Luçi + Copyright (C) 2015 ESF, LLC All rights reserved. Redistribution and use in source and binary forms, with or without @@ -25,7 +28,6 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - require_once("globals.inc"); require_once("util.inc"); require_once("functions.inc"); @@ -50,39 +52,39 @@ function ladvd_resync_config() { $cmdline = ""; if (!empty($ladvd_conf['autoenable'])) { - $cmdline .= "-a "; + $cmdline .= "-a "; } if (!empty($ladvd_conf['silent'])) { - $cmdline .= "-s "; + $cmdline .= "-s "; } if (!empty($ladvd_conf['management'])) { - $cmdline .= "-m " . escapeshellarg(get_real_interface($ladvd_conf['management'])) . " "; + $cmdline .= "-m " . escapeshellarg(get_real_interface($ladvd_conf['management'])) . " "; } if (!empty($ladvd_conf['location'])) { - $cmdline .= "-l '{$ladvd_conf['location']}' "; + $cmdline .= "-l '{$ladvd_conf['location']}' "; } if (!empty($ladvd_conf['lldp'])) { - $cmdline .= "-L "; + $cmdline .= "-L "; } if (!empty($ladvd_conf['cdp'])) { - $cmdline .= "-C "; + $cmdline .= "-C "; } if (!empty($ladvd_conf['edp'])) { - $cmdline .= "-E "; + $cmdline .= "-E "; } if (!empty($ladvd_conf['fdp'])) { - $cmdline .= "-F "; + $cmdline .= "-F "; } if (!empty($ladvd_conf['ndp'])) { - $cmdline .= "-N "; + $cmdline .= "-N "; } $ifaces = explode(",", $ladvd_conf['iface_array']); @@ -91,7 +93,7 @@ function ladvd_resync_config() { write_rcfile(array( "file" => "ladvd.sh", - "start" => "/usr/local/sbin/ladvd $cmdline", + "start" => "/usr/local/sbin/ladvd {$cmdline}", "stop" => "/usr/bin/killall -9 ladvd" ) ); diff --git a/config/ladvd/ladvd.xml b/config/ladvd/ladvd.xml index 0367a19a..5862afca 100644 --- a/config/ladvd/ladvd.xml +++ b/config/ladvd/ladvd.xml @@ -1,15 +1,25 @@ <?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[ +<![CDATA[ +/* $Id$ */ +/* ====================================================================================== */ /* ladvd.xml - Copyright (C) 2006 Scott Ullrich + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2014 Andrea Tuccia + Copyright (C) 2014 Ermal Luçi + 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. @@ -17,6 +27,7 @@ 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 @@ -28,11 +39,12 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +/* ====================================================================================== */ ]]> </copyright> <description>Link Layer Discovery Protocol</description> <name>LADVD</name> - <version>1.0.2</version> + <version>1.0.4.2</version> <category>Network Management</category> <title>Services: LADVD</title> <savetext>Save</savetext> @@ -41,13 +53,11 @@ <additional_files_needed> <item>https://packages.pfsense.org/packages/config/ladvd/ladvd.inc</item> <prefix>/usr/local/pkg/</prefix> - <chmod>0644</chmod> </additional_files_needed> - <additional_files_needed> - <prefix>/usr/local/www/</prefix> - <chmod>0755</chmod> - <item>https://packages.pfsense.org/packages/config/ladvd/status_ladvd.php</item> - </additional_files_needed> + <additional_files_needed> + <prefix>/usr/local/www/</prefix> + <item>https://packages.pfsense.org/packages/config/ladvd/status_ladvd.php</item> + </additional_files_needed> <menu> <name>LADVD</name> <tooltiptext>Modify LADVD settings.</tooltiptext> @@ -59,12 +69,12 @@ <tooltiptext></tooltiptext> <section>Status</section> <url>/status_ladvd.php</url> - </menu> + </menu> <service> <name>ladvd</name> <rcfile>ladvd.sh</rcfile> <executable>ladvd</executable> - <description>Send and decode link layer advertisements</description> + <description>Send and decode link layer advertisements.</description> </service> <tabs> <tab> @@ -81,7 +91,7 @@ <field> <fielddescr>Enable ladvd</fielddescr> <fieldname>enable</fieldname> - <description>Enable or disable ladvd</description> + <description>Enable or disable ladvd.</description> <enablefields>iface_array[],autoenable,silent,management,location,lldp,cdp,edp,ndp</enablefields> <type>checkbox</type> </field> @@ -92,7 +102,7 @@ <multiple>true</multiple> <size>3</size> <type>interfaces_selection</type> - <description>Select the interfaces that LADVD will bind to. You can use the CTRL or COMMAND key to select multiple interfaces.</description> + <description>Select the interfaces that LADVD will bind to. You can use the CTRL or COMMAND key to select multiple interfaces.</description> </field> <field> <fielddescr>Auto-enable protocols</fielddescr> diff --git a/config/ladvd/status_ladvd.php b/config/ladvd/status_ladvd.php index 3333145a..86e7187c 100644 --- a/config/ladvd/status_ladvd.php +++ b/config/ladvd/status_ladvd.php @@ -1,7 +1,10 @@ <?php /* status_ladvd.php - Copyright (C) 2006 Scott Ullrich + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2014 Andrea Tuccia + Copyright (C) 2014 Ermal Luçi + Copyright (C) 2015 ESF, LLC All rights reserved. Redistribution and use in source and binary forms, with or without @@ -15,7 +18,7 @@ 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 + 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 @@ -25,7 +28,6 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - require("guiconfig.inc"); $pgtitle = "LADVD: Status"; @@ -37,9 +39,9 @@ $control_script = "/usr/local/sbin/ladvdc"; function listCmds() { global $commands; echo "<br/>This status page includes the following information:\n"; - echo "<ul width=\"100%\">\n"; + echo "<ul>\n"; for ($i = 0; isset($commands[$i]); $i++ ) { - echo "<li><strong><a href=\"#" . $commands[$i][0] . "\">" . $commands[$i][0] . "</a></strong></li>\n"; + echo "<li><strong><a href=\"#" . str_replace(' ', '_', $commands[$i][0]) . "\">" . $commands[$i][0] . "</a></strong></li>\n"; } echo "</ul>\n"; } @@ -59,11 +61,12 @@ function defCmdT($title, $command) { } function doCmdT($title, $command) { - echo "<p>\n"; - echo "<a name=\"" . $title . "\">\n"; + echo "<div>\n"; + echo "<a name=\"" . str_replace(' ', '_', $title) . "\" />\n"; echo "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n"; echo "<tr><td class=\"listtopic\">" . $title . "</td></tr>\n"; - echo "<tr><td class=\"listlr\"><pre>"; /* no newline after pre */ + /* no newline after pre */ + echo "<tr><td class=\"listlr\"><pre>"; $execOutput = ""; $execStatus = ""; @@ -72,47 +75,43 @@ function doCmdT($title, $command) { echo htmlspecialchars($line, ENT_NOQUOTES); } pclose($fd); - echo "</pre></tr>\n"; + echo "</pre></td></tr>\n"; echo "</table>\n"; + echo "</div>\n"; } ?> -<html> - <body link="#0000CC" vlink="#0000CC" alink="#0000CC"> - <?php include("fbegin.inc"); ?> - <?php if ($savemsg) print_info_box($savemsg); ?> +<body link="#0000CC" vlink="#0000CC" alink="#0000CC"> +<?php include("fbegin.inc"); ?> +<?php if ($savemsg) print_info_box($savemsg); ?> - <table width="100%" border="0" cellpadding="0" cellspacing="0"> - <tr><td class="tabnavtbl"> +<table width="100%" border="0" cellpadding="0" cellspacing="0"> + <tr><td class="tabnavtbl"> <?php - $tab_array = array(); - $tab_array[] = array(gettext("General"), false, "/pkg_edit.php?xml=ladvd.xml&id=0"); - $tab_array[] = array(gettext("Status"), true, "/status_ladvd.php"); - display_top_tabs($tab_array); - ?> - </td></tr> - <tr> - <td> - <div id="mainarea"> - <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0"> - <tr> - <td> + $tab_array = array(); + $tab_array[] = array(gettext("General"), false, "/pkg_edit.php?xml=ladvd.xml&id=0"); + $tab_array[] = array(gettext("Status"), true, "/status_ladvd.php"); + display_top_tabs($tab_array); +?> + </td></tr> + <tr><td> + <div id="mainarea"> + <table class="tabcont" width="100%" border="0" cellpadding="6" cellspacing="0"> + <tr><td> <?php - defCmdT("LADVD Devices", "{$control_script}"); - defCmdT("LADVD Detailed decode", "{$control_script} -f"); + defCmdT("LADVD Devices", "{$control_script}"); + defCmdT("LADVD Detailed decode", "{$control_script} -f"); ?> - <div id="cmdspace" style="width:100%"> - <?php listCmds(); ?> - <?php execCmds(); ?> - </div> - </td> - </tr> - </table> - </div> - </td> - </tr> + <div id="cmdspace" style="width:100%"> + <?php listCmds(); ?> + <?php execCmds(); ?> + </div> + </td></tr> </table> - <?php include("fend.inc"); ?> - </body> + </div> + </td></tr> +</table> +<?php include("fend.inc"); ?> +</body> </html> diff --git a/config/lcdproc/lcdproc.inc b/config/lcdproc/lcdproc.inc index 2251618c..9aecfa3b 100644 --- a/config/lcdproc/lcdproc.inc +++ b/config/lcdproc/lcdproc.inc @@ -1,347 +1,323 @@ <?php -/* $Id$ */ /* - lcdproc.inc - Copyright (C) 2007 Seth Mos <seth.mos@dds.nl> - 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. + lcdproc.inc + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2007-2009 Seth Mos <seth.mos@dds.nl> + Copyright (C) 2009 Scott Ullrich + Copyright (C) 2011 Michele Di Maria + 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("config.inc"); - require_once("functions.inc"); - - /* LCDproc */ - define('LCDPROC_RCFILE', '/usr/local/etc/rc.d/lcdproc.sh'); - define('LCDPROC_CLIENT', '/tmp/lcdclient.sh'); - $pfs_version = substr(trim(file_get_contents("/etc/version")),0,3); - if ($pfs_version == "2.1" || $pfs_version == "2.2") { - define('LCDPROC_CONFIG', '/usr/pbi/lcdproc-' . php_uname('m') . '/local/etc/LCDd.conf'); - } else { - define('LCDPROC_CONFIG','/usr/local/etc/LCDd.conf'); +require_once("config.inc"); +require_once("functions.inc"); + +/* LCDproc */ +define('LCDPROC_RCFILE', '/usr/local/etc/rc.d/lcdproc.sh'); +define('LCDPROC_CLIENT', '/tmp/lcdclient.sh'); +$pfs_version = substr(trim(file_get_contents("/etc/version")), 0, 3); +if ($pfs_version == "2.1" || $pfs_version == "2.2") { + define('LCDPROC_CONFIG', '/usr/pbi/lcdproc-' . php_uname('m') . '/local/etc/LCDd.conf'); +} else { + define('LCDPROC_CONFIG','/usr/local/etc/LCDd.conf'); +} +define('LCDPROC_HOST','127.0.0.1'); +define('LCDPROC_PORT','13666'); + +function lcdproc_notice ($msg) { + syslog(LOG_NOTICE, "lcdproc: {$msg}"); +} + +function lcdproc_warn ($msg) { + syslog(LOG_WARNING, "lcdproc: {$msg}"); +} + +function lcdproc_write_config($file, $text) { + $handle = fopen($file, 'w'); + if (!$handle) { + lcdproc_warn("Could not open {$file} for writing."); + exit; } - define('LCDPROC_HOST','127.0.0.1'); - define('LCDPROC_PORT','13666'); - - function lcdproc_notice ($msg) { syslog(LOG_NOTICE, "lcdproc: {$msg}"); } - function lcdproc_warn ($msg) { syslog(LOG_WARNING, "lcdproc: {$msg}"); } - - function lcdproc_action ($action) { - if (file_exists(LCDPROC_RCFILE)) - mwexec(LCDPROC_RCFILE.' '.$action); + fwrite($handle, $text); + fclose($handle); +} + +function lcdproc_write_script($file, $text) { + $handle = fopen($file, 'wx'); + if (!$handle) { + lcdproc_warn("Could not open {$file} for writing."); + exit; } - - function lcdproc_running () { - if((int)exec('pgrep LCDd | wc -l') > 0) - return true; - return false; - } - - function lcdproc_write_config($file, $text) { - $handle = fopen($file, 'w'); - if(!$handle) { - lcdproc_warn("Could not open {$file} for writing."); - exit; + fwrite($handle, $text); + fclose($handle); + chmod($file, 0755); +} + +function validate_form_lcdproc($post, &$input_errors) { + if ($post['comport']) { + switch ($post['comport']) { + case "none": + continue; + break; + case "com2": + continue; + break; + case "ucom1": + continue; + break; + case "ucom2": + continue; + break; + case "lpt1": + continue; + break; + case "ugen0.2": + continue; + break; + case "ugen1.2": + continue; + break; + case "ugen2.2": + continue; + break; + default: + $input_errors[] = "The chosen com port is not valid"; + break; } - fwrite($handle, $text); - fclose($handle); } - - function lcdproc_write_script($file, $text) { - $handle = fopen($file, 'wx'); - if(!$handle) { - lcdproc_warn("Could not open {$file} for writing."); - exit; + if ($post['size']) { + switch ($post['size']) { + case "12x1": + continue; + break; + case "12x2": + continue; + break; + case "12x4": + continue; + break; + case "16x1": + continue; + break; + case "16x2": + continue; + break; + case "16x4": + continue; + break; + case "20x1": + continue; + break; + case "20x2": + continue; + break; + case "20x4": + continue; + break; + default: + $input_errors[] = "The chosen display size is not valid"; + break; } - fwrite($handle, $text); - fclose($handle); - chmod($file, 0755); - } - - function before_form_lcdproc(&$pkg) { - global $config; - - config_lock(); - - config_unlock(); - } - - function before_form_lcdproc_screens(&$pkg) { - global $config; - - config_lock(); - - config_unlock(); } - - function validate_form_lcdproc($post, &$input_errors) { - if($post['comport']) { - switch($post['comport']) { - case "none": - continue; - break; - case "com2": - continue; - break; - case "ucom1": - continue; - break; - case "ucom2": - continue; - break; - case "lpt1": - continue; - break; - case "ugen0.2": - continue; - break; - case "ugen1.2": - continue; - break; - case "ugen2.2": - continue; - break; - default: - $input_errors[] = "The chosen com port is not valid"; - break; - } +} + +function sync_package_lcdproc_screens() { + sync_package_lcdproc(); +} + +function sync_package_lcdproc() { + global $g; + global $config; + global $input_errors; + + $lcdproc_config = $config['installedpackages']['lcdproc']['config'][0]; + $lcdproc_screens_config = $config['installedpackages']['lcdprocscreens']['config'][0]; + + /* Since config is written before this file invoked, we don't need to read post data */ + if ($lcdproc_config['enable'] && ($lcdproc_config['comport'] != "none")) { + switch ($lcdproc_config['comport']) { + case "com2": + $realport = "/dev/cua1"; + break; + case "ucom1": + $realport = "/dev/cuaU0"; + break; + case "ucom2": + $realport = "/dev/cuaU1"; + break; + case "lpt1": + $realport = "/dev/lpt0"; + break; + case "ugen0.2": + $realport = "/dev/ugen0.2"; + break; + case "ugen1.2": + $realport = "/dev/ugen1.2"; + break; + case "ugen2.2": + $realport = "/dev/ugen2.2"; + break; + default: + lcdproc_warn("The selected com port is not valid!"); + return; } - if($post['size']) { - switch($post['size']) { - case "12x1": - continue; - break; - case "12x2": - continue; - break; - case "12x4": - continue; - break; - case "16x1": - continue; - break; - case "16x2": - continue; - break; - case "16x4": - continue; - break; - case "20x1": - continue; - break; - case "20x2": - continue; - break; - case "20x4": - continue; - break; - default: - $input_errors[] = "The chosen display size is not valid"; - break; - } - } - } - function validate_form_lcdproc_screens($post, &$input_errors) { - // No validation required ?! - } - - function sync_package_lcdproc_screens() { - sync_package_lcdproc(); - } - function sync_package_lcdproc() { - global $g; - global $config; - global $input_errors; - - config_lock(); - - $lcdproc_config = $config['installedpackages']['lcdproc']['config'][0]; - $lcdproc_screens_config = $config['installedpackages']['lcdprocscreens']['config'][0]; - - /* since config is written before this file invoked we don't need to read post data */ - if($lcdproc_config['enable'] && ($lcdproc_config['comport'] != "none")) { - switch($lcdproc_config['comport']) { - case "com2": - $realport = "/dev/cua1"; - break; - case "ucom1": - $realport = "/dev/cuaU0"; - break; - case "ucom2": - $realport = "/dev/cuaU1"; - break; - case "lpt1": - $realport = "/dev/lpt0"; - break; - case "ugen0.2": - $realport = "/dev/ugen0.2"; - break; - case "ugen1.2": - $realport = "/dev/ugen1.2"; - break; - case "ugen2.2": - $realport = "/dev/ugen2.2"; - break; - default: - lcdproc_warn("The selected com port is not valid!"); - return; - } - - $config_text = "[server]\n"; - $config_text .= "Driver={$lcdproc_config[driver]}\n"; - $config_text .= "Bind=127.0.0.1\n"; - $config_text .= "Port=13666\n"; - $config_text .= "ReportLevel=3\n"; - $config_text .= "ReportToSyslog=yes\n"; - $config_text .= "WaitTime=5\n"; - $config_text .= "User=nobody\n"; - $config_text .= "ServerScreen=no\n"; - $config_text .= "Foreground=no\n"; - $config_text .= "DriverPath=/usr/local/lib/lcdproc/\n"; - $config_text .= "GoodBye=\"Thanks for using\"\n"; - $config_text .= "GoodBye=\" {$g['product_name']} \"\n"; - /* FIXME: Specific to the pyramid project */ - $config_text .= "ToggleRotateKey=Enter\n"; - $config_text .= "PrevScreenKey=Left\n"; - $config_text .= "NextScreenKey=Right\n"; - $config_text .= "ScrollUpKey=Up\n"; - $config_text .= "ScrollDownKey=Down\n"; - /* FIXME: pyramid test menu */ - $config_text .= "[menu]\n"; - $config_text .= "MenuKey=Escape\n"; - $config_text .= "EnterKey=Enter\n"; - $config_text .= "UpKey=Up\n"; - $config_text .= "DownKey=Down\n"; - /* lcdproc default driver definitions */ - switch($lcdproc_config[driver]) { - case "SureElec": - $config_text .= "[{$lcdproc_config['driver']}]\n"; - $config_text .= "driverpath =/usr/local/lib/lcdproc/\n"; - $config_text .= "Device={$realport}\n"; - $config_text .= "Size={$lcdproc_config['size']}\n"; - $config_text .= "Edition=2\n"; - $config_text .= "Contrast=200\n"; - $config_text .= "Brightness=480\n"; - $config_text .= "Speed=19200\n"; - break; - case "nexcom": - $config_text .= "[{$lcdproc_config['driver']}]\n"; - $config_text .= "driverpath =/usr/local/lib/lcdproc/\n"; - $config_text .= "Device={$realport}\n"; - $config_text .= "Size={$lcdproc_config['size']}\n"; - break; - case "bayrad": - $config_text .= "[{$lcdproc_config['driver']}]\n"; - $config_text .= "Device={$realport}\n"; - $config_text .= "Speed=9600\n"; - break; - case "picolcd": - $config_text .= "[{$lcdproc_config['driver']}]\n"; - $config_text .= "driverpath=/usr/local/lib/lcdproc/\n"; - $config_text .= "Device={$realport}\n"; - $config_text .= "Size={$lcdproc_config['size']}\n"; - $config_text .= "KeyTimeout=500\n"; - $config_text .= "Brightness=1000\n"; - $config_text .= "Blacklight_Timer=60\n"; - $config_text .= "Contrast=1000\n"; - $config_text .= "Keylights=on\n"; - $config_text .= "Key0Light=on\n"; - $config_text .= "Key1Light=off\n"; - $config_text .= "Key2Light=off\n"; - $config_text .= "Key3Light=off\n"; - $config_text .= "Key4Light=off\n"; - $config_text .= "Key5Light=off\n"; - break; - case "CFontz": - $config_text .= "[{$lcdproc_config['driver']}]\n"; - $config_text .= "Device={$realport}\n"; - $config_text .= "Size={$lcdproc_config['size']}\n"; - $config_text .= "Contrast=350\n"; - $config_text .= "Brightness=1000\n"; - $config_text .= "OffBrightness=50\n"; - $config_text .= "Speed=9600\n"; - $config_text .= "NewFirmware=no\n"; - $config_text .= "Reboot=no\n"; - break; - case "CFontz633": - $config_text .= "[{$lcdproc_config['driver']}]\n"; - $config_text .= "Device={$realport}\n"; - $config_text .= "Size={$lcdproc_config['size']}\n"; - $config_text .= "Contrast=350\n"; - $config_text .= "Brightness=1000\n"; - $config_text .= "OffBrightness=50\n"; - $config_text .= "Speed=19200\n"; - $config_text .= "NewFirmware=yes\n"; - $config_text .= "Reboot=yes\n"; - break; - case "CFontzPacket": - $config_text .= "[{$lcdproc_config['driver']}]\n"; - $config_text .= "Device={$realport}\n"; - $config_text .= "Model=635\n"; - $config_text .= "Size={$lcdproc_config['size']}\n"; - $config_text .= "Contrast=350\n"; - $config_text .= "Brightness=1000\n"; - $config_text .= "OffBrightness=50\n"; - $config_text .= "Speed=115200\n"; - $config_text .= "NewFirmware=yes\n"; - $config_text .= "Reboot=yes\n"; - break; - case "curses": - $config_text .= "[{$lcdproc_config['driver']}]\n"; - $config_text .= "Foreground=blue\n"; - $config_text .= "Background=cyan\n"; - $config_text .= "Backlight=red\n"; - $config_text .= "Size={$lcdproc_config['size']}\n"; - $config_text .= "TopLeftX=7\n"; - $config_text .= "TopLeftY=7\n"; - $config_text .= "UseACS=no\n"; - break; - case "CwLynx": - $config_text .= "[{$lcdproc_config['driver']}]\n"; - $config_text .= "Model=12232\n"; - $config_text .= "Device={$realport}\n"; - $config_text .= "Size={$lcdproc_config['size']}\n"; - $config_text .= "Speed=19200\n"; - $config_text .= "Reboot=no\n"; - break; - case "pyramid": - $config_text .= "[{$lcdproc_config['driver']}]\n"; - $config_text .= "Device={$realport}\n"; - $config_text .= "Size={$lcdproc_config['size']}\n"; - break; - case "ea65": - $config_text .= "[{$lcdproc_config['driver']}]\n"; - $config_text .= "Device={$realport}\n"; - $config_text .= "OffBrightness=0\n"; - $config_text .= "Brightness=500\n"; - break; - default: - lcdproc_warn("The chosen lcdproc driver is not a valid choice"); - unset($lcdproc_config[driver]); - } + $config_text = "[server]\n"; + $config_text .= "Driver={$lcdproc_config[driver]}\n"; + $config_text .= "Bind=127.0.0.1\n"; + $config_text .= "Port=13666\n"; + $config_text .= "ReportLevel=3\n"; + $config_text .= "ReportToSyslog=yes\n"; + $config_text .= "WaitTime=5\n"; + $config_text .= "User=nobody\n"; + $config_text .= "ServerScreen=no\n"; + $config_text .= "Foreground=no\n"; + $config_text .= "DriverPath=/usr/local/lib/lcdproc/\n"; + $config_text .= "GoodBye=\"Thanks for using\"\n"; + $config_text .= "GoodBye=\" {$g['product_name']} \"\n"; + /* FIXME: Specific to the pyramid project */ + $config_text .= "ToggleRotateKey=Enter\n"; + $config_text .= "PrevScreenKey=Left\n"; + $config_text .= "NextScreenKey=Right\n"; + $config_text .= "ScrollUpKey=Up\n"; + $config_text .= "ScrollDownKey=Down\n"; + /* FIXME: pyramid test menu */ + $config_text .= "[menu]\n"; + $config_text .= "MenuKey=Escape\n"; + $config_text .= "EnterKey=Enter\n"; + $config_text .= "UpKey=Up\n"; + $config_text .= "DownKey=Down\n"; + + /* lcdproc default driver definitions */ + switch ($lcdproc_config[driver]) { + case "SureElec": + $config_text .= "[{$lcdproc_config['driver']}]\n"; + $config_text .= "driverpath =/usr/local/lib/lcdproc/\n"; + $config_text .= "Device={$realport}\n"; + $config_text .= "Size={$lcdproc_config['size']}\n"; + $config_text .= "Edition=2\n"; + $config_text .= "Contrast=200\n"; + $config_text .= "Brightness=480\n"; + $config_text .= "Speed=19200\n"; + break; + case "nexcom": + $config_text .= "[{$lcdproc_config['driver']}]\n"; + $config_text .= "driverpath =/usr/local/lib/lcdproc/\n"; + $config_text .= "Device={$realport}\n"; + $config_text .= "Size={$lcdproc_config['size']}\n"; + break; + case "bayrad": + $config_text .= "[{$lcdproc_config['driver']}]\n"; + $config_text .= "Device={$realport}\n"; + $config_text .= "Speed=9600\n"; + break; + case "picolcd": + $config_text .= "[{$lcdproc_config['driver']}]\n"; + $config_text .= "driverpath=/usr/local/lib/lcdproc/\n"; + $config_text .= "Device={$realport}\n"; + $config_text .= "Size={$lcdproc_config['size']}\n"; + $config_text .= "KeyTimeout=500\n"; + $config_text .= "Brightness=1000\n"; + $config_text .= "Blacklight_Timer=60\n"; + $config_text .= "Contrast=1000\n"; + $config_text .= "Keylights=on\n"; + $config_text .= "Key0Light=on\n"; + $config_text .= "Key1Light=off\n"; + $config_text .= "Key2Light=off\n"; + $config_text .= "Key3Light=off\n"; + $config_text .= "Key4Light=off\n"; + $config_text .= "Key5Light=off\n"; + break; + case "CFontz": + $config_text .= "[{$lcdproc_config['driver']}]\n"; + $config_text .= "Device={$realport}\n"; + $config_text .= "Size={$lcdproc_config['size']}\n"; + $config_text .= "Contrast=350\n"; + $config_text .= "Brightness=1000\n"; + $config_text .= "OffBrightness=50\n"; + $config_text .= "Speed=9600\n"; + $config_text .= "NewFirmware=no\n"; + $config_text .= "Reboot=no\n"; + break; + case "CFontz633": + $config_text .= "[{$lcdproc_config['driver']}]\n"; + $config_text .= "Device={$realport}\n"; + $config_text .= "Size={$lcdproc_config['size']}\n"; + $config_text .= "Contrast=350\n"; + $config_text .= "Brightness=1000\n"; + $config_text .= "OffBrightness=50\n"; + $config_text .= "Speed=19200\n"; + $config_text .= "NewFirmware=yes\n"; + $config_text .= "Reboot=yes\n"; + break; + case "CFontzPacket": + $config_text .= "[{$lcdproc_config['driver']}]\n"; + $config_text .= "Device={$realport}\n"; + $config_text .= "Model=635\n"; + $config_text .= "Size={$lcdproc_config['size']}\n"; + $config_text .= "Contrast=350\n"; + $config_text .= "Brightness=1000\n"; + $config_text .= "OffBrightness=50\n"; + $config_text .= "Speed=115200\n"; + $config_text .= "NewFirmware=yes\n"; + $config_text .= "Reboot=yes\n"; + break; + case "curses": + $config_text .= "[{$lcdproc_config['driver']}]\n"; + $config_text .= "Foreground=blue\n"; + $config_text .= "Background=cyan\n"; + $config_text .= "Backlight=red\n"; + $config_text .= "Size={$lcdproc_config['size']}\n"; + $config_text .= "TopLeftX=7\n"; + $config_text .= "TopLeftY=7\n"; + $config_text .= "UseACS=no\n"; + break; + case "CwLynx": + $config_text .= "[{$lcdproc_config['driver']}]\n"; + $config_text .= "Model=12232\n"; + $config_text .= "Device={$realport}\n"; + $config_text .= "Size={$lcdproc_config['size']}\n"; + $config_text .= "Speed=19200\n"; + $config_text .= "Reboot=no\n"; + break; + case "pyramid": + $config_text .= "[{$lcdproc_config['driver']}]\n"; + $config_text .= "Device={$realport}\n"; + $config_text .= "Size={$lcdproc_config['size']}\n"; + break; + case "ea65": + $config_text .= "[{$lcdproc_config['driver']}]\n"; + $config_text .= "Device={$realport}\n"; + $config_text .= "OffBrightness=0\n"; + $config_text .= "Brightness=500\n"; + break; + default: + lcdproc_warn("The chosen lcdproc driver is not a valid choice"); + unset($lcdproc_config[driver]); + } - /* generate rc file start and stop */ - $client_script = <<<EOD + /* Generate rc file start and stop */ + $client_script = <<<EOD #!/bin/sh # script starts a lcd client and always keeps it active. @@ -355,8 +331,8 @@ done EOD; - /* generate rc file start and stop */ - $stop = <<<EOD + /* Generate rc file start and stop */ + $stop = <<<EOD if [ `ps auxw |awk '/LCD[d]/ {print $2}'| wc -l` != 0 ]; then ps auxw |awk '/LCD[d]/ {print $2}'|xargs kill @@ -368,47 +344,47 @@ if [ `ps auxw |awk '/lcdclient.s[h]/ {print $2}'| wc -l` != 0 ]; then fi EOD; - $start = $stop ."\n"; - $start .= "\t/usr/local/sbin/LCDd -c ". LCDPROC_CONFIG ."\n"; - $start .= "\t". LCDPROC_CLIENT ." &\n"; - - /* write out the configuration */ - conf_mount_rw(); - lcdproc_write_script(LCDPROC_CLIENT, $client_script); - lcdproc_write_config(LCDPROC_CONFIG, $config_text); - write_rcfile(array( - 'file' => 'lcdproc.sh', - 'start' => $start, - 'stop' => $stop - )); - conf_mount_ro(); - /* or restart lcdproc if settings were changed */ - if(lcdproc_running($_POST['comport'])) { - lcdproc_notice("Restarting service lcdproc"); - lcdproc_action('restart'); - } + $start = $stop ."\n"; + $start .= "\t/usr/local/sbin/LCDd -c ". LCDPROC_CONFIG ."\n"; + $start .= "\t". LCDPROC_CLIENT ." &\n"; + + /* Write out the configuration */ + conf_mount_rw(); + lcdproc_write_script(LCDPROC_CLIENT, $client_script); + lcdproc_write_config(LCDPROC_CONFIG, $config_text); + write_rcfile(array( + 'file' => 'lcdproc.sh', + 'start' => $start, + 'stop' => $stop + )); + conf_mount_ro(); + + /* Or restart lcdproc if settings were changed */ + if (is_process_running("LCDd") && ($_POST['comport'] != "")) { + lcdproc_notice("Restarting service lcdproc"); + restart_service("lcdproc"); } + } - if((! $lcdproc_config['driver']) || ($lcdproc_config['comport'] == "none")) { - /* no parameters user does not want lcdproc running */ - /* lets stop the service and remove the rc file */ + if ((! $lcdproc_config['driver']) || ($lcdproc_config['comport'] == "none")) { + /* No parameters - user does not want lcdproc running */ + /* Let's stop the service and remove the rc file */ - if(file_exists(LCDPROC_RCFILE)) { - if(!$lcdproc_config['enable']) { - lcdproc_notice('Stopping service: lcdproc disabled'); - } else { - lcdproc_notice('Stopping service: no com port selected'); - } - lcdproc_action('stop'); - conf_mount_rw(); - unlink(LCDPROC_RCFILE); - unlink(LCDPROC_CLIENT); - unlink(LCDPROC_CONFIG); - conf_mount_ro(); + if (file_exists(LCDPROC_RCFILE)) { + if (!$lcdproc_config['enable']) { + lcdproc_notice('Stopping service: lcdproc disabled'); + } else { + lcdproc_notice('Stopping service: no com port selected'); } + stop_service("lcdproc"); + conf_mount_rw(); + unlink(LCDPROC_RCFILE); + unlink(LCDPROC_CLIENT); + unlink(LCDPROC_CONFIG); + conf_mount_ro(); } - config_unlock(); } +} ?> diff --git a/config/lcdproc/lcdproc.xml b/config/lcdproc/lcdproc.xml index 8f268b49..4f109e47 100644 --- a/config/lcdproc/lcdproc.xml +++ b/config/lcdproc/lcdproc.xml @@ -1,8 +1,51 @@ <?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$ */ +/* ====================================================================================== */ +/* + lcdproc.xml + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2007-2009 Seth Mos <seth.mos@dds.nl> + Copyright (C) 2009 Scott Ullrich + Copyright (C) 2011 Michele Di Maria + 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. +*/ +/* ====================================================================================== */ + ]]> + </copyright> <title>Services: LCDproc</title> <name>lcdproc</name> - <version>0.5.5 pkg.v.1.0.1</version> + <version>1.0.3</version> <savetext>Save</savetext> <include_file>/usr/local/pkg/lcdproc.inc</include_file> <tabs> @@ -18,44 +61,41 @@ </tabs> <menu> <name>LCDproc</name> - <tooltiptext>Set LCDproc settings such as display driver and com port</tooltiptext> + <tooltiptext>Set LCDproc settings such as display driver and COM port.</tooltiptext> <section>Services</section> <url>/pkg_edit.php?xml=lcdproc.xml&id=0</url> </menu> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/lcdproc/lcdproc.inc</item> - <prefix>/usr/local/pkg/</prefix> - <chmod>0755</chmod> + <prefix>/usr/local/pkg/</prefix> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/lcdproc/lcdproc_screens.xml</item> - <prefix>/usr/local/pkg/</prefix> - <chmod>0755</chmod> + <prefix>/usr/local/pkg/</prefix> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/lcdproc/lcdproc_client.php</item> - <prefix>/usr/local/pkg/</prefix> - <chmod>0755</chmod> + <prefix>/usr/local/pkg/</prefix> </additional_files_needed> <additional_files_needed> <item>https://files.pfsense.org/packages/lcdproc/nexcom.so</item> - <prefix>/usr/local/lib/lcdproc/</prefix> - <chmod>0755</chmod> + <prefix>/usr/local/lib/lcdproc/</prefix> + <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <item>https://files.pfsense.org/packages/lcdproc/SureElec.so</item> - <prefix>/usr/local/lib/lcdproc/</prefix> - <chmod>0755</chmod> - </additional_files_needed> + <prefix>/usr/local/lib/lcdproc/</prefix> + <chmod>0755</chmod> + </additional_files_needed> <additional_files_needed> <item>https://files.pfsense.org/packages/lcdproc/picolcd.so</item> - <prefix>/usr/local/lib/lcdproc/</prefix> - <chmod>0755</chmod> + <prefix>/usr/local/lib/lcdproc/</prefix> + <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <item>https://files.pfsense.org/packages/lcdproc/libusb.so.2</item> - <prefix>/usr/local/lib/lcdproc/</prefix> - <chmod>0755</chmod> + <prefix>/usr/local/lib/lcdproc/</prefix> + <chmod>0755</chmod> </additional_files_needed> <service> <name>lcdproc</name> @@ -71,8 +111,8 @@ </field> <field> <fieldname>comport</fieldname> - <fielddescr>Com Port</fielddescr> - <description>Set the com port LCDproc should use.</description> + <fielddescr>COM Port</fielddescr> + <description>Set the COM port LCDproc should use.</description> <type>select</type> <options> <option> @@ -81,15 +121,15 @@ </option> <option> <value>com2</value> - <name>Serial Com port 2 (/dev/cua1)</name> + <name>Serial COM port 2 (/dev/cua1)</name> </option> <option> <value>ucom1</value> - <name>USB Com port 1 (/dev/cuaU0)</name> + <name>USB COM port 1 (/dev/cuaU0)</name> </option> <option> <value>ucom2</value> - <name>USB Com port 2 (/dev/cuaU1)</name> + <name>USB COM port 2 (/dev/cuaU1)</name> </option> <option> <value>lpt1</value> @@ -97,16 +137,16 @@ </option> <option> <value>ugen0.2</value> - <name>USB Com port 1 alternate (/dev/ugen0.2)</name> - </option> + <name>USB COM port 1 alternate (/dev/ugen0.2)</name> + </option> <option> <value>ugen1.2</value> - <name>USB Com port 2 alternate (/dev/ugen1.2)</name> + <name>USB COM port 2 alternate (/dev/ugen1.2)</name> </option> <option> <value>ugen2.2</value> - <name>USB Com port 3 alternate (/dev/ugen2.2)</name> - </option> + <name>USB COM port 3 alternate (/dev/ugen2.2)</name> + </option> </options> <default_value>ucom1</default_value> </field> @@ -272,7 +312,7 @@ <option> <value>pyramid</value> <name>pyramid</name> - </option> + </option> <option> <value>picolcd</value> <name>picolcd</name> @@ -304,7 +344,7 @@ <option> <value>SureElec</value> <name>SureElec</name> - </option> + </option> <option> <value>svga</value> <name>svga</name> @@ -335,7 +375,7 @@ <field> <fieldname>refresh_frequency</fieldname> <fielddescr>Refresh frequency</fielddescr> - <description>Set the refresh frequency of the information on the LCD Panel</description> + <description>Set the refresh frequency of the information on the LCD Panel.</description> <type>select</type> <options> <option> @@ -360,11 +400,8 @@ </option> </options> <default_value>5</default_value> - </field> + </field> </fields> - <custom_php_command_before_form> - before_form_lcdproc($pkg); - </custom_php_command_before_form> <custom_php_validation_command> validate_form_lcdproc($_POST, $input_errors); </custom_php_validation_command> diff --git a/config/lcdproc/lcdproc_client.php b/config/lcdproc/lcdproc_client.php index 464d6260..e59e8635 100644 --- a/config/lcdproc/lcdproc_client.php +++ b/config/lcdproc/lcdproc_client.php @@ -1,721 +1,705 @@ <?php -/* $Id$ */ /* - lcdproc_client.php - Copyright (C) 2007 Seth Mos <seth.mos@dds.nl> - 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. + lcdproc_client.inc + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2007-2009 Seth Mos <seth.mos@dds.nl> + Copyright (C) 2009 Scott Ullrich + Copyright (C) 2011 Michele Di Maria + 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. */ - - /* trick interface into running this. we are only - * calling from useland so this is not a security issue - */ - require_once("config.inc"); - require_once("functions.inc"); - require_once("/usr/local/pkg/lcdproc.inc"); - - function get_pfstate() { - global $config; - $matches = ""; - if (isset($config['system']['maximumstates']) and $config['system']['maximumstates'] > 0) - $maxstates="/{$config['system']['maximumstates']}"; - else - $maxstates="/10000"; - - $curentries = `/sbin/pfctl -si |grep current`; - if (preg_match("/([0-9]+)/", $curentries, $matches)) { - $curentries = $matches[1]; - } - return $curentries . $maxstates; +require_once("config.inc"); +require_once("functions.inc"); +require_once("/usr/local/pkg/lcdproc.inc"); + +function get_pfstate() { + global $config; + $matches = ""; + if (isset($config['system']['maximumstates']) and $config['system']['maximumstates'] > 0) { + $maxstates = "/{$config['system']['maximumstates']}"; + } else { + $maxstates = "/10000"; } - - function disk_usage() { - $dfout = ""; - exec("/bin/df -h | /usr/bin/grep -w '/' | /usr/bin/awk '{ print $5 }' | /usr/bin/cut -d '%' -f 1", $dfout); - $diskusage = trim($dfout[0]); - - return $diskusage; + $curentries = shell_exec('/sbin/pfctl -si | grep current'); + if (preg_match("/([0-9]+)/", $curentries, $matches)) { + $curentries = $matches[1]; } - - function mem_usage() { - $memory = ""; - exec("/sbin/sysctl -n vm.stats.vm.v_page_count vm.stats.vm.v_inactive_count " . - "vm.stats.vm.v_cache_count vm.stats.vm.v_free_count", $memory); - - $totalMem = $memory[0]; - $availMem = $memory[1] + $memory[2] + $memory[3]; - $usedMem = $totalMem - $availMem; - $memUsage = round(($usedMem * 100) / $totalMem, 0); - - return $memUsage; + return $curentries . $maxstates; +} + +function disk_usage() { + $dfout = ""; + exec("/bin/df -h | /usr/bin/grep -w '/' | /usr/bin/awk '{ print $5 }' | /usr/bin/cut -d '%' -f 1", $dfout); + $diskusage = trim($dfout[0]); + return $diskusage; +} + +function mem_usage() { + $memory = ""; + exec("/sbin/sysctl -n vm.stats.vm.v_page_count vm.stats.vm.v_inactive_count " . + "vm.stats.vm.v_cache_count vm.stats.vm.v_free_count", $memory); + + $totalMem = $memory[0]; + $availMem = $memory[1] + $memory[2] + $memory[3]; + $usedMem = $totalMem - $availMem; + $memUsage = round(($usedMem * 100) / $totalMem, 0); + return $memUsage; +} + +/* Calculates non-idle CPU time and returns as a percentage */ +function cpu_usage() { + $duration = 1; + $diff = array('user', 'nice', 'sys', 'intr', 'idle'); + $cpuTicks = array_combine($diff, explode(" ", shell_exec('/sbin/sysctl -n kern.cp_time'))); + sleep($duration); + $cpuTicks2 = array_combine($diff, explode(" ", shell_exec('/sbin/sysctl -n kern.cp_time'))); + + $totalStart = array_sum($cpuTicks); + $totalEnd = array_sum($cpuTicks2); + + // Something wrapped ?!?! + if ($totalEnd <= $totalStart) { + return 0; } - /*function array_combine($arr1, $arr2) { - $out = array(); - - $arr1 = array_values($arr1); - $arr2 = array_values($arr2); + // Calculate total cycles used + $totalUsed = ($totalEnd - $totalStart) - ($cpuTicks2['idle'] - $cpuTicks['idle']); - foreach($arr1 as $key1 => $value1) { - $out[(string)$value1] = $arr2[$key1]; - } - - return $out; - }*/ - - /* Calculates non-idle CPU time and returns as a percentage */ - function cpu_usage() { - $duration = 1; - $diff = array('user', 'nice', 'sys', 'intr', 'idle'); - $cpuTicks = array_combine($diff, explode(" ", `/sbin/sysctl -n kern.cp_time`)); - sleep($duration); - $cpuTicks2 = array_combine($diff, explode(" ", `/sbin/sysctl -n kern.cp_time`)); - - $totalStart = array_sum($cpuTicks); - $totalEnd = array_sum($cpuTicks2); - - // Something wrapped ?!?! - if ($totalEnd <= $totalStart) - return 0; + // Calculate the percentage used + $cpuUsage = floor(100 * ($totalUsed / ($totalEnd - $totalStart))); + return $cpuUsage; +} - // Calculate total cycles used - $totalUsed = ($totalEnd - $totalStart) - ($cpuTicks2['idle'] - $cpuTicks['idle']); - - // Calculate the percentage used - $cpuUsage = floor(100 * ($totalUsed / ($totalEnd - $totalStart))); - - return $cpuUsage; +function get_uptime_stats() { + exec("/usr/bin/uptime", $output, $ret); + if (stristr($output[0], "day")) { + $temp = explode(" ", $output[0]); + $status = "$temp[2] $temp[3] $temp[4] $temp[5] $temp[6] $temp[7] ". substr($temp[8], 0, -1); + } else { + $temp = explode(" ", $output[0]); + $status = "$temp[2] $temp[3] $temp[4] $temp[5] $temp[6] ". substr($temp[7], 0, -1); } - - function get_uptime_stats() { - exec("/usr/bin/uptime", $output, $ret); - if(stristr($output[0], "day")) { - $temp = explode(" ", $output[0]); - $status = "$temp[2] $temp[3] $temp[4] $temp[5] $temp[6] $temp[7] ". substr($temp[8], 0, -1); + return($status); +} + +function get_loadavg_stats() { + exec("/usr/bin/uptime", $output, $ret); + if (stristr($output[0], "day")) { + $temp = explode(" ", $output[0]); + $status = "$temp[11] $temp[12] $temp[13]"; + } else { + $temp = explode(" ", $output[0]); + $status = "$temp[10] $temp[11] $temp[12]"; + } + return($status); +} + +function get_mbuf_stats() { + exec("netstat -mb | grep \"mbufs in use\" | awk '{ print $1 }' | cut -d\"/\" -f1", $mbufs_inuse); + exec("netstat -mb | grep \"mbufs in use\" | awk '{ print $1 }' | cut -d\"/\" -f3", $mbufs_total); + $status = "$mbufs_inuse[0] \/ $mbufs_total[0]"; + + return($status); +} + +function get_cpufrequency() { + $cpufreqs = ""; + exec("/sbin/sysctl -n dev.cpu.0.freq_levels", $cpufreqs); + $cpufreqs = explode(" ", trim($cpufreqs[0])); + $maxfreq = explode("/", $cpufreqs[0]); + $maxfreq = $maxfreq[0]; + $curfreq = ""; + exec("/sbin/sysctl -n dev.cpu.0.freq", $curfreq); + $curfreq = trim($curfreq[0]); + $status = "$curfreq\/$maxfreq Mhz"; + return($status); +} + +function get_interfaces_stats() { + global $g; + global $config; + $ifstatus = array(); + $i = 0; + $ifdescrs = array('wan' => 'WAN', 'lan' => 'LAN'); + for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++) { + $ifdescrs['opt' . $j] = $config['interfaces']['opt' . $j]['descr']; + } + foreach ($ifdescrs as $ifdescr => $ifname) { + $ifinfo = get_interface_info($ifdescr); + if ($ifinfo['status'] == "up") { + $online = "Up"; } else { - $temp = explode(" ", $output[0]); - $status = "$temp[2] $temp[3] $temp[4] $temp[5] $temp[6] ". substr($temp[7], 0, -1); + $online = "Down"; } - return($status); - } - - function get_loadavg_stats() { - exec("/usr/bin/uptime", $output, $ret); - if(stristr($output[0], "day")) { - $temp = explode(" ", $output[0]); - $status = "$temp[11] $temp[12] $temp[13]"; + if (!empty($ifinfo['ipaddr'])) { + $ip = htmlspecialchars($ifinfo['ipaddr']); } else { - $temp = explode(" ", $output[0]); - $status = "$temp[10] $temp[11] $temp[12]"; + $ip = "-"; } - return($status); + $ifstatus[] = htmlspecialchars($ifname) ." [$online]"; } - - function get_mbuf_stats() { - exec("netstat -mb | grep \"mbufs in use\" | awk '{ print $1 }' | cut -d\"/\" -f1", $mbufs_inuse); - exec("netstat -mb | grep \"mbufs in use\" | awk '{ print $1 }' | cut -d\"/\" -f3", $mbufs_total); - $status = "$mbufs_inuse[0] \/ $mbufs_total[0]"; - return($status); + $status = " ". implode(", ", $ifstatus); + return($status); +} + +function get_slbd_stats() { + global $g; + global $config; + + if (!is_array($config['load_balancer']['lbpool'])) { + $config['load_balancer']['lbpool'] = array(); } - - function get_cpufrequency(){ - $cpufreqs = ""; - exec("/sbin/sysctl -n dev.cpu.0.freq_levels", $cpufreqs); - $cpufreqs = explode(" ", trim($cpufreqs[0])); - $maxfreq = explode("/", $cpufreqs[0]); - $maxfreq = $maxfreq[0]; - $curfreq = ""; - exec("/sbin/sysctl -n dev.cpu.0.freq", $curfreq); - $curfreq = trim($curfreq[0]); - $status = "$curfreq\/$maxfreq Mhz"; - return($status); + $a_pool = &$config['load_balancer']['lbpool']; + + $slbd_logfile = "{$g['varlog_path']}/slbd.log"; + + $nentries = $config['syslog']['nentries']; + if (!$nentries) { + $nentries = 50; } - function get_interfaces_stats() { - global $g; - global $config; - $ifstatus = array(); - $i = 0; - $ifdescrs = array('wan' => 'WAN', 'lan' => 'LAN'); - for ($j = 1; isset($config['interfaces']['opt' . $j]); $j++) { - $ifdescrs['opt' . $j] = $config['interfaces']['opt' . $j]['descr']; - } - foreach ($ifdescrs as $ifdescr => $ifname){ - $ifinfo = get_interface_info($ifdescr); - if($ifinfo['status'] == "up") { - $online = "Up"; - } else { - $online = "Down"; - } - if(!empty($ifinfo['ipaddr'])) { - $ip = htmlspecialchars($ifinfo['ipaddr']); + $now = time(); + $year = date("Y"); + $pstatus = ""; + $i = 0; + foreach ($a_pool as $vipent) { + $pstatus[] = "{$vipent['name']}"; + if ($vipent['type'] == "gateway") { + $poolfile = "{$g['tmp_path']}/{$vipent['name']}.pool"; + if (file_exists("$poolfile")) { + $poolstatus = file_get_contents("$poolfile"); } else { - $ip = "-"; + continue; } - $ifstatus[] = htmlspecialchars($ifname) ." [$online]"; - } - $status = " ". implode(", ", $ifstatus); - return($status); - } - - function get_slbd_stats() { - global $g; - global $config; - - if (!is_array($config['load_balancer']['lbpool'])) { - $config['load_balancer']['lbpool'] = array(); - } - $a_pool = &$config['load_balancer']['lbpool']; - - $slbd_logfile = "{$g['varlog_path']}/slbd.log"; - - $nentries = $config['syslog']['nentries']; - if (!$nentries) - $nentries = 50; - - $now = time(); - $year = date("Y"); - $pstatus = ""; - $i = 0; - foreach ($a_pool as $vipent) { - $pstatus[] = "{$vipent['name']}"; - if ($vipent['type'] == "gateway") { - $poolfile = "{$g['tmp_path']}/{$vipent['name']}.pool"; - if(file_exists("$poolfile")) { - $poolstatus = file_get_contents("$poolfile"); + foreach ((array) $vipent['servers'] as $server) { + $lastchange = ""; + $svr = split("\|", $server); + $monitorip = $svr[1]; + if (stristr($poolstatus, $monitorip)) { + $online = "Up"; } else { - continue; - } - foreach ((array) $vipent['servers'] as $server) { - $lastchange = ""; - $svr = split("\|", $server); - $monitorip = $svr[1]; - if(stristr($poolstatus, $monitorip)) { - $online = "Up"; - } else { - $online = "Down"; - } - $pstatus[] = strtoupper($svr[0]) ." [{$online}]"; + $online = "Down"; } - } else { - $pstatus[] = "{$vipent['monitor']}"; + $pstatus[] = strtoupper($svr[0]) ." [{$online}]"; } + } else { + $pstatus[] = "{$vipent['monitor']}"; } - if(count($a_pool) == 0) { - $pstatus[] = "Disabled"; - } - $status = implode(", ", $pstatus); - return($status); } - - function get_carp_stats () { - global $g; - global $config; - - if(is_array($config['virtualip']['vip'])) { - $carpint = 0; - $initcount = 0; - $mastercount = 0; - $backupcount = 0; - foreach($config['virtualip']['vip'] as $carp) { - if ($carp['mode'] != "carp") { - continue; - } - $ipaddress = $carp['subnet']; - $password = $carp['password']; - $netmask = $carp['subnet_bits']; - $vhid = $carp['vhid']; - $advskew = $carp['advskew']; - $carp_int = find_carp_interface($ipaddress); - $status = get_carp_interface_status($carp_int); - switch($status) { - case "MASTER": - $mastercount++; - break; - case "BACKUP": - $backupcount++; - break; - case "INIT": - $initcount++; - break; - } + if (count($a_pool) == 0) { + $pstatus[] = "Disabled"; + } + $status = implode(", ", $pstatus); + return($status); +} + +function get_carp_stats () { + global $g; + global $config; + + if (is_array($config['virtualip']['vip'])) { + $carpint = 0; + $initcount = 0; + $mastercount = 0; + $backupcount = 0; + foreach($config['virtualip']['vip'] as $carp) { + if ($carp['mode'] != "carp") { + continue; + } + $ipaddress = $carp['subnet']; + $password = $carp['password']; + $netmask = $carp['subnet_bits']; + $vhid = $carp['vhid']; + $advskew = $carp['advskew']; + $carp_int = find_carp_interface($ipaddress); + $status = get_carp_interface_status($carp_int); + switch($status) { + case "MASTER": + $mastercount++; + break; + case "BACKUP": + $backupcount++; + break; + case "INIT": + $initcount++; + break; } - $status = "M/B/I {$mastercount}/{$backupcount}/{$initcount}"; - } else { - $status = "CARP Disabled"; } - return($status); + $status = "M/B/I {$mastercount}/{$backupcount}/{$initcount}"; + } else { + $status = "CARP Disabled"; } + return($status); +} - function get_ipsec_tunnel_sad() { - /* query SAD */ - if(file_exists("/usr/local/sbin/setkey")) - $fd = @popen("/usr/local/sbin/setkey -D", "r"); - else - $fd = @popen("/sbin/setkey -D", "r"); - $sad = array(); - if ($fd) { - while (!feof($fd)) { - $line = chop(fgets($fd)); - if (!$line) - continue; - if ($line == "No SAD entries.") - break; - if ($line[0] != "\t") { - if (is_array($cursa)) - $sad[] = $cursa; - $cursa = array(); - list($cursa['src'],$cursa['dst']) = explode(" ", $line); - $i = 0; - } else { - $linea = explode(" ", trim($line)); - if ($i == 1) { - $cursa['proto'] = $linea[0]; - $cursa['spi'] = substr($linea[2], strpos($linea[2], "x")+1, -1); - } else if ($i == 2) { - $cursa['ealgo'] = $linea[1]; - } else if ($i == 3) { - $cursa['aalgo'] = $linea[1]; - } +function get_ipsec_tunnel_sad() { + /* query SAD */ + if (file_exists("/usr/local/sbin/setkey")) { + $fd = @popen("/usr/local/sbin/setkey -D", "r"); + } else { + $fd = @popen("/sbin/setkey -D", "r"); + } + $sad = array(); + if ($fd) { + while (!feof($fd)) { + $line = chop(fgets($fd)); + if (!$line) { + continue; + } + if ($line == "No SAD entries.") { + break; + } + if ($line[0] != "\t") { + if (is_array($cursa)) { + $sad[] = $cursa; + $cursa = array(); } - $i++; + list($cursa['src'],$cursa['dst']) = explode(" ", $line); + $i = 0; + } else { + $linea = explode(" ", trim($line)); + if ($i == 1) { + $cursa['proto'] = $linea[0]; + $cursa['spi'] = substr($linea[2], strpos($linea[2], "x")+1, -1); + } else if ($i == 2) { + $cursa['ealgo'] = $linea[1]; + } else if ($i == 3) { + $cursa['aalgo'] = $linea[1]; } - if (is_array($cursa) && count($cursa)) - $sad[] = $cursa; - pclose($fd); + } + $i++; } - return($sad); - } - - function get_ipsec_tunnel_src($tunnel) { - global $g, $config, $sad; - $if = "WAN"; - if ($tunnel['interface']) { - $if = $tunnel['interface']; - $realinterface = convert_friendly_interface_to_real_interface_name($if); - $interfaceip = find_interface_ip($realinterface); + if (is_array($cursa) && count($cursa)) { + $sad[] = $cursa; } - return $interfaceip; + pclose($fd); } - - function output_ipsec_tunnel_status($tunnel) { - global $g, $config, $sad; - $if = "WAN"; - $interfaceip = get_ipsec_tunnel_src($tunnel); - $foundsrc = false; - $founddst = false; - - if(!is_array($sad)) { - /* we have no sad array, bail */ - return(false); - } - foreach($sad as $sa) { - if($sa['src'] == $interfaceip) - $foundsrc = true; - if($sa['dst'] == $tunnel['remote-gateway']) - $founddst = true; + return($sad); +} + +function get_ipsec_tunnel_src($tunnel) { + global $g, $config, $sad; + $if = "WAN"; + if ($tunnel['interface']) { + $if = $tunnel['interface']; + $realinterface = convert_friendly_interface_to_real_interface_name($if); + $interfaceip = find_interface_ip($realinterface); + } + return $interfaceip; +} + +function output_ipsec_tunnel_status($tunnel) { + global $g, $config, $sad; + $if = "WAN"; + $interfaceip = get_ipsec_tunnel_src($tunnel); + $foundsrc = false; + $founddst = false; + + if (!is_array($sad)) { + /* we have no sad array, bail */ + return(false); + } + foreach($sad as $sa) { + if ($sa['src'] == $interfaceip) { + $foundsrc = true; } - if($foundsrc && $founddst) { - /* tunnel is up */ - $iconfn = "pass"; - return(true); - } else { - /* tunnel is down */ - $iconfn = "reject"; - return(false); + if ($sa['dst'] == $tunnel['remote-gateway']) { + $founddst = true; } } + if ($foundsrc && $founddst) { + /* tunnel is up */ + $iconfn = "pass"; + return(true); + } else { + /* tunnel is down */ + $iconfn = "reject"; + return(false); + } +} - function get_ipsec_stats() { - global $g, $config, $sad; - $sad = array(); - $sad = get_ipsec_tunnel_sad(); +function get_ipsec_stats() { + global $g, $config, $sad; + $sad = array(); + $sad = get_ipsec_tunnel_sad(); - $activecounter = 0; - $inactivecounter = 0; + $activecounter = 0; + $inactivecounter = 0; - if($config['ipsec']['tunnel']) { - foreach ($config['ipsec']['tunnel'] as $tunnel){ - $ipsecstatus = false; + if ($config['ipsec']['tunnel']) { + foreach ($config['ipsec']['tunnel'] as $tunnel) { + $ipsecstatus = false; - $tun_disabled = "false"; - $foundsrc = false; - $founddst = false; - - if (isset($tunnel['disabled'])) { - $tun_disabled = "true"; - continue; - } - - if(output_ipsec_tunnel_status($tunnel)) { - /* tunnel is up */ - $iconfn = "true"; - $activecounter++; - } else { - /* tunnel is down */ - $iconfn = "false"; - $inactivecounter++; - } + $tun_disabled = "false"; + $foundsrc = false; + $founddst = false; + + if (isset($tunnel['disabled'])) { + $tun_disabled = "true"; + continue; } - } - if (is_array($config['ipsec']['tunnel'])) { - $status = "Up/Down $activecounter/$inactivecounter"; - } else { - $status = "IPSEC Disabled"; + if (output_ipsec_tunnel_status($tunnel)) { + /* tunnel is up */ + $iconfn = "true"; + $activecounter++; + } else { + /* tunnel is down */ + $iconfn = "false"; + $inactivecounter++; + } } - return($status); } - - /* Define functions */ - function send_lcd_commands($lcd, $lcd_cmds) { - if(!is_array($lcd_cmds) || (empty($lcd_cmds))) { - lcdproc_warn("Failed to interpret lcd commands"); - return; - } - foreach($lcd_cmds as $lcd_cmd) { - $cmd_output = ""; - if(! fwrite($lcd, "$lcd_cmd\n")) { - lcdproc_warn("Connection to LCDd process lost $errstr ($errno)"); - die(); - } - $cmd_output = fgets($lcd, 256); - // FIXME: add support for interpreting menu commands here. - if(preg_match("/^huh?/", $cmd_output)) { - lcdproc_notice("LCDd output: \"$cmd_output\". Executed \"$lcd_cmd\""); - } - } + if (is_array($config['ipsec']['tunnel'])) { + $status = "Up/Down $activecounter/$inactivecounter"; + } else { + $status = "IPSEC Disabled"; } + return($status); +} - function get_lcdpanel_width(){ - global $config; - $lcdproc_size_config = $config['installedpackages']['lcdproc']['config'][0]; - if (is_null($lcdproc_size_config['size'])) { - return "16"; +function send_lcd_commands($lcd, $lcd_cmds) { + if (!is_array($lcd_cmds) || (empty($lcd_cmds))) { + lcdproc_warn("Failed to interpret lcd commands"); + return; + } + foreach($lcd_cmds as $lcd_cmd) { + $cmd_output = ""; + if (! fwrite($lcd, "$lcd_cmd\n")) { + lcdproc_warn("Connection to LCDd process lost $errstr ($errno)"); + die(); } - else - { - $dimensions = split("x", $lcdproc_size_config['size']); - return $dimensions[0]; + $cmd_output = fgets($lcd, 256); + // FIXME: add support for interpreting menu commands here. + if (preg_match("/^huh?/", $cmd_output)) { + lcdproc_notice("LCDd output: \"$cmd_output\". Executed \"$lcd_cmd\""); } } +} + +function get_lcdpanel_width() { + global $config; + $lcdproc_size_config = $config['installedpackages']['lcdproc']['config'][0]; + if (is_null($lcdproc_size_config['size'])) { + return "16"; + } else { + $dimensions = split("x", $lcdproc_size_config['size']); + return $dimensions[0]; + } +} - function get_lcdpanel_height(){ - global $config; - $lcdproc_size_config = $config['installedpackages']['lcdproc']['config'][0]; - if (is_null($lcdproc_size_config['size'])) { - return "2"; - } - else - { - $dimensions = split("x", $lcdproc_size_config['size']); - return $dimensions[1]; - } - } +function get_lcdpanel_height() { + global $config; + $lcdproc_size_config = $config['installedpackages']['lcdproc']['config'][0]; + if (is_null($lcdproc_size_config['size'])) { + return "2"; + } else { + $dimensions = split("x", $lcdproc_size_config['size']); + return $dimensions[1]; + } +} - function get_lcdpanel_refresh_frequency(){ - global $config; - $lcdproc_size_config = $config['installedpackages']['lcdproc']['config'][0]; - $value = $lcdproc_size_config['refresh_frequency']; - if (is_null($value)) { - return "5"; - } - else - { - return $value; - } +function get_lcdpanel_refresh_frequency() { + global $config; + $lcdproc_size_config = $config['installedpackages']['lcdproc']['config'][0]; + $value = $lcdproc_size_config['refresh_frequency']; + if (is_null($value)) { + return "5"; + } else { + return $value; } +} - function add_summary_declaration(&$lcd_cmds, $name) { - $lcdpanel_height = get_lcdpanel_height(); - if ($lcdpanel_height >= "4") - { - $lcd_cmds[] = "widget_add $name title_summary scroller"; - $lcd_cmds[] = "widget_add $name text_summary scroller"; - } +function add_summary_declaration(&$lcd_cmds, $name) { + $lcdpanel_height = get_lcdpanel_height(); + if ($lcdpanel_height >= "4") { + $lcd_cmds[] = "widget_add $name title_summary scroller"; + $lcd_cmds[] = "widget_add $name text_summary scroller"; } +} - function add_summary_values(&$lcd_cmds, $name, $lcd_summary_data, $lcdpanel_width) { - if ($lcd_summary_data != "") - { - $lcd_cmds[] = "widget_set $name title_summary 1 3 $lcdpanel_width 3 h 2 \"CPU MEM STATES\""; - $lcd_cmds[] = "widget_set $name text_summary 1 4 $lcdpanel_width 4 h 2 \"{$lcd_summary_data}\""; - } +function add_summary_values(&$lcd_cmds, $name, $lcd_summary_data, $lcdpanel_width) { + if ($lcd_summary_data != "") { + $lcd_cmds[] = "widget_set $name title_summary 1 3 $lcdpanel_width 3 h 2 \"CPU MEM STATES\""; + $lcd_cmds[] = "widget_set $name text_summary 1 4 $lcdpanel_width 4 h 2 \"{$lcd_summary_data}\""; } +} - function build_interface($lcd) { - global $g; - global $config; - $lcdproc_screens_config = $config['installedpackages']['lcdprocscreens']['config'][0]; - $refresh_frequency = get_lcdpanel_refresh_frequency() * 10; +function build_interface($lcd) { + global $g; + global $config; + $lcdproc_screens_config = $config['installedpackages']['lcdprocscreens']['config'][0]; + $refresh_frequency = get_lcdpanel_refresh_frequency() * 10; - $lcd_cmds = array(); - $lcd_cmds[] = "hello"; - $lcd_cmds[] = "client_set name pfSense"; - $lcd_cmds[] = "screen_add welcome_scr"; - $lcd_cmds[] = "screen_set welcome_scr heartbeat off"; - $lcd_cmds[] = "screen_set welcome_scr name welcome"; - $lcd_cmds[] = "screen_set welcome_scr duration $refresh_frequency"; - $lcd_cmds[] = "widget_add welcome_scr title_wdgt title"; - $lcd_cmds[] = "widget_add welcome_scr text_wdgt scroller"; - add_summary_declaration($lcd_cmds, "welcome_scr"); + $lcd_cmds = array(); + $lcd_cmds[] = "hello"; + $lcd_cmds[] = "client_set name pfSense"; + $lcd_cmds[] = "screen_add welcome_scr"; + $lcd_cmds[] = "screen_set welcome_scr heartbeat off"; + $lcd_cmds[] = "screen_set welcome_scr name welcome"; + $lcd_cmds[] = "screen_set welcome_scr duration $refresh_frequency"; + $lcd_cmds[] = "widget_add welcome_scr title_wdgt title"; + $lcd_cmds[] = "widget_add welcome_scr text_wdgt scroller"; + add_summary_declaration($lcd_cmds, "welcome_scr"); - /* process screens to display */ - if(is_array($lcdproc_screens_config)) { - foreach($lcdproc_screens_config as $name => $screen) { - if($screen == "on") { - switch($name) { - case "scr_time": - $lcd_cmds[] = "screen_add $name"; - $lcd_cmds[] = "screen_set $name heartbeat off"; - $lcd_cmds[] = "screen_set $name name $name"; - $lcd_cmds[] = "screen_set $name duration $refresh_frequency"; - $lcd_cmds[] = "widget_add $name title_wdgt string"; - $lcd_cmds[] = "widget_add $name text_wdgt scroller"; - break; - case "scr_uptime": - $lcd_cmds[] = "screen_add $name"; - $lcd_cmds[] = "screen_set $name heartbeat off"; - $lcd_cmds[] = "screen_set $name name $name"; - $lcd_cmds[] = "screen_set $name duration $refresh_frequency"; - $lcd_cmds[] = "widget_add $name title_wdgt string"; - $lcd_cmds[] = "widget_add $name text_wdgt scroller"; - break; - case "scr_hostname": - $lcd_cmds[] = "screen_add $name"; - $lcd_cmds[] = "screen_set $name heartbeat off"; - $lcd_cmds[] = "screen_set $name name $name"; - $lcd_cmds[] = "screen_set $name duration $refresh_frequency"; - $lcd_cmds[] = "widget_add $name title_wdgt string"; - $lcd_cmds[] = "widget_add $name text_wdgt scroller"; - break; - case "scr_system": - $lcd_cmds[] = "screen_add $name"; - $lcd_cmds[] = "screen_set $name heartbeat off"; - $lcd_cmds[] = "screen_set $name name $name"; - $lcd_cmds[] = "screen_set $name duration $refresh_frequency"; - $lcd_cmds[] = "widget_add $name title_wdgt string"; - $lcd_cmds[] = "widget_add $name text_wdgt scroller"; - break; - case "scr_disk": - $lcd_cmds[] = "screen_add $name"; - $lcd_cmds[] = "screen_set $name heartbeat off"; - $lcd_cmds[] = "screen_set $name name $name"; - $lcd_cmds[] = "screen_set $name duration $refresh_frequency"; - $lcd_cmds[] = "widget_add $name title_wdgt string"; - $lcd_cmds[] = "widget_add $name text_wdgt scroller"; - break; - case "scr_load": - $lcd_cmds[] = "screen_add $name"; - $lcd_cmds[] = "screen_set $name heartbeat off"; - $lcd_cmds[] = "screen_set $name name $name"; - $lcd_cmds[] = "screen_set $name duration $refresh_frequency"; - $lcd_cmds[] = "widget_add $name title_wdgt string"; - $lcd_cmds[] = "widget_add $name text_wdgt scroller"; - break; - case "scr_states": - $lcd_cmds[] = "screen_add $name"; - $lcd_cmds[] = "screen_set $name heartbeat off"; - $lcd_cmds[] = "screen_set $name name $name"; - $lcd_cmds[] = "screen_set $name duration $refresh_frequency"; - $lcd_cmds[] = "widget_add $name title_wdgt string"; - $lcd_cmds[] = "widget_add $name text_wdgt scroller"; - break; - case "scr_carp": - $lcd_cmds[] = "screen_add $name"; - $lcd_cmds[] = "screen_set $name heartbeat off"; - $lcd_cmds[] = "screen_set $name name $name"; - $lcd_cmds[] = "screen_set $name duration $refresh_frequency"; - $lcd_cmds[] = "widget_add $name title_wdgt string"; - $lcd_cmds[] = "widget_add $name text_wdgt scroller"; - break; - case "scr_ipsec": - $lcd_cmds[] = "screen_add $name"; - $lcd_cmds[] = "screen_set $name heartbeat off"; - $lcd_cmds[] = "screen_set $name name $name"; - $lcd_cmds[] = "screen_set $name duration $refresh_frequency"; - $lcd_cmds[] = "widget_add $name title_wdgt string"; - $lcd_cmds[] = "widget_add $name text_wdgt scroller"; - break; - case "scr_slbd": - $lcd_cmds[] = "screen_add $name"; - $lcd_cmds[] = "screen_set $name heartbeat off"; - $lcd_cmds[] = "screen_set $name name $name"; - $lcd_cmds[] = "screen_set $name duration $refresh_frequency"; - $lcd_cmds[] = "widget_add $name title_wdgt string"; - $lcd_cmds[] = "widget_add $name text_wdgt scroller"; - break; - case "scr_interfaces": - $lcd_cmds[] = "screen_add $name"; - $lcd_cmds[] = "screen_set $name heartbeat off"; - $lcd_cmds[] = "screen_set $name name $name"; - $lcd_cmds[] = "screen_set $name duration $refresh_frequency"; - $lcd_cmds[] = "widget_add $name title_wdgt string"; - $lcd_cmds[] = "widget_add $name text_wdgt scroller"; - break; - case "scr_mbuf": - $lcd_cmds[] = "screen_add $name"; - $lcd_cmds[] = "screen_set $name heartbeat off"; - $lcd_cmds[] = "screen_set $name name $name"; - $lcd_cmds[] = "screen_set $name duration $refresh_frequency"; - $lcd_cmds[] = "widget_add $name title_wdgt string"; - $lcd_cmds[] = "widget_add $name text_wdgt scroller"; - break; - case "scr_cpufrequency": - $lcd_cmds[] = "screen_add $name"; - $lcd_cmds[] = "screen_set $name heartbeat off"; - $lcd_cmds[] = "screen_set $name name $name"; - $lcd_cmds[] = "screen_set $name duration $refresh_frequency"; - $lcd_cmds[] = "widget_add $name title_wdgt string"; - $lcd_cmds[] = "widget_add $name text_wdgt scroller"; - break; - } - add_summary_declaration($lcd_cmds, $name); - } - } - } - send_lcd_commands($lcd, $lcd_cmds); - } - - function loop_status($lcd) { - global $g; - global $config; - $lcdproc_screens_config = $config['installedpackages']['lcdprocscreens']['config'][0]; - $lcdpanel_width = get_lcdpanel_width(); - $lcdpanel_height = get_lcdpanel_height(); - if(empty($g['product_name'])) { - $g['product_name'] = "pfSense"; - } - $version = @file_get_contents("/etc/version"); - $version = trim($version); - $refresh_frequency = get_lcdpanel_refresh_frequency(); - /* keep a counter to see how many times we can loop */ - $i = 1; - while($i) { - /* prepare the summary data */ - if ($lcdpanel_height >= "4") { - $summary_states = split("/",get_pfstate()); - $lcd_summary_data = sprintf("%02d%% %02d%% %6d", cpu_usage(), mem_usage(), $summary_states[0]); - } - else { - $lcd_summary_data = "";} - - $lcd_cmds = array(); - $lcd_cmds[] = "widget_set welcome_scr title_wdgt \"Welcome to\""; - $lcd_cmds[] = "widget_set welcome_scr text_wdgt 1 2 $lcdpanel_width 2 h 2 \"{$g['product_name']} {$version}\""; - add_summary_values($lcd_cmds, "welcome_scr", $lcd_summary_data, $lcdpanel_width); - - /* process screens to display */ - foreach((array) $lcdproc_screens_config as $name => $screen) { - if($screen != "on") { - continue; - } - switch($name) { + /* process screens to display */ + if (is_array($lcdproc_screens_config)) { + foreach($lcdproc_screens_config as $name => $screen) { + if ($screen == "on") { + switch ($name) { case "scr_time": - $time = date("n/j/Y H:i"); - $lcd_cmds[] = "widget_set $name title_wdgt 1 1 \"+ System Time\""; - $lcd_cmds[] = "widget_set $name text_wdgt 1 2 $lcdpanel_width 2 h 2 \"{$time}\""; + $lcd_cmds[] = "screen_add $name"; + $lcd_cmds[] = "screen_set $name heartbeat off"; + $lcd_cmds[] = "screen_set $name name $name"; + $lcd_cmds[] = "screen_set $name duration $refresh_frequency"; + $lcd_cmds[] = "widget_add $name title_wdgt string"; + $lcd_cmds[] = "widget_add $name text_wdgt scroller"; break; case "scr_uptime": - $uptime = get_uptime_stats(); - $lcd_cmds[] = "widget_set $name title_wdgt 1 1 \"+ System Uptime\""; - $lcd_cmds[] = "widget_set $name text_wdgt 1 2 $lcdpanel_width 2 h 2 \"{$uptime}\""; + $lcd_cmds[] = "screen_add $name"; + $lcd_cmds[] = "screen_set $name heartbeat off"; + $lcd_cmds[] = "screen_set $name name $name"; + $lcd_cmds[] = "screen_set $name duration $refresh_frequency"; + $lcd_cmds[] = "widget_add $name title_wdgt string"; + $lcd_cmds[] = "widget_add $name text_wdgt scroller"; break; case "scr_hostname": - exec("/bin/hostname", $output, $ret); - $hostname = $output[0]; - $lcd_cmds[] = "widget_set $name title_wdgt 1 1 \"+ System Name\""; - $lcd_cmds[] = "widget_set $name text_wdgt 1 2 $lcdpanel_width 2 h 2 \"{$hostname}\""; + $lcd_cmds[] = "screen_add $name"; + $lcd_cmds[] = "screen_set $name heartbeat off"; + $lcd_cmds[] = "screen_set $name name $name"; + $lcd_cmds[] = "screen_set $name duration $refresh_frequency"; + $lcd_cmds[] = "widget_add $name title_wdgt string"; + $lcd_cmds[] = "widget_add $name text_wdgt scroller"; break; case "scr_system": - $processor = cpu_usage(); - $memory = mem_usage(); - $lcd_cmds[] = "widget_set $name title_wdgt 1 1 \"+ System Stats\""; - $lcd_cmds[] = "widget_set $name text_wdgt 1 2 $lcdpanel_width 2 h 2 \"CPU {$processor}%, Mem {$memory}%\""; + $lcd_cmds[] = "screen_add $name"; + $lcd_cmds[] = "screen_set $name heartbeat off"; + $lcd_cmds[] = "screen_set $name name $name"; + $lcd_cmds[] = "screen_set $name duration $refresh_frequency"; + $lcd_cmds[] = "widget_add $name title_wdgt string"; + $lcd_cmds[] = "widget_add $name text_wdgt scroller"; break; case "scr_disk": - $disk = disk_usage(); - $lcd_cmds[] = "widget_set $name title_wdgt 1 1 \"+ Disk Use\""; - $lcd_cmds[] = "widget_set $name text_wdgt 1 2 $lcdpanel_width 2 h 2 \"Disk {$disk}%\""; + $lcd_cmds[] = "screen_add $name"; + $lcd_cmds[] = "screen_set $name heartbeat off"; + $lcd_cmds[] = "screen_set $name name $name"; + $lcd_cmds[] = "screen_set $name duration $refresh_frequency"; + $lcd_cmds[] = "widget_add $name title_wdgt string"; + $lcd_cmds[] = "widget_add $name text_wdgt scroller"; break; case "scr_load": - $loadavg = get_loadavg_stats(); - $lcd_cmds[] = "widget_set $name title_wdgt 1 1 \"+ Load Averages\""; - $lcd_cmds[] = "widget_set $name text_wdgt 1 2 $lcdpanel_width 2 h 2 \"{$loadavg}\""; + $lcd_cmds[] = "screen_add $name"; + $lcd_cmds[] = "screen_set $name heartbeat off"; + $lcd_cmds[] = "screen_set $name name $name"; + $lcd_cmds[] = "screen_set $name duration $refresh_frequency"; + $lcd_cmds[] = "widget_add $name title_wdgt string"; + $lcd_cmds[] = "widget_add $name text_wdgt scroller"; break; case "scr_states": - $states = get_pfstate(); - $lcd_cmds[] = "widget_set $name title_wdgt 1 1 \"+ Traffic States\""; - $lcd_cmds[] = "widget_set $name text_wdgt 1 2 $lcdpanel_width 2 h 2 \"Curr/Max {$states}\""; + $lcd_cmds[] = "screen_add $name"; + $lcd_cmds[] = "screen_set $name heartbeat off"; + $lcd_cmds[] = "screen_set $name name $name"; + $lcd_cmds[] = "screen_set $name duration $refresh_frequency"; + $lcd_cmds[] = "widget_add $name title_wdgt string"; + $lcd_cmds[] = "widget_add $name text_wdgt scroller"; break; case "scr_carp": - $carp = get_carp_stats(); - $lcd_cmds[] = "widget_set $name title_wdgt 1 1 \"+ CARP State\""; - $lcd_cmds[] = "widget_set $name text_wdgt 1 2 $lcdpanel_width 2 h 2 \"{$carp}\""; + $lcd_cmds[] = "screen_add $name"; + $lcd_cmds[] = "screen_set $name heartbeat off"; + $lcd_cmds[] = "screen_set $name name $name"; + $lcd_cmds[] = "screen_set $name duration $refresh_frequency"; + $lcd_cmds[] = "widget_add $name title_wdgt string"; + $lcd_cmds[] = "widget_add $name text_wdgt scroller"; break; case "scr_ipsec": - $ipsec = get_ipsec_stats(); - $lcd_cmds[] = "widget_set $name title_wdgt 1 1 \"+ IPsec Tunnels\""; - $lcd_cmds[] = "widget_set $name text_wdgt 1 2 $lcdpanel_width 2 h 2 \"{$ipsec}\""; + $lcd_cmds[] = "screen_add $name"; + $lcd_cmds[] = "screen_set $name heartbeat off"; + $lcd_cmds[] = "screen_set $name name $name"; + $lcd_cmds[] = "screen_set $name duration $refresh_frequency"; + $lcd_cmds[] = "widget_add $name title_wdgt string"; + $lcd_cmds[] = "widget_add $name text_wdgt scroller"; break; case "scr_slbd": - $slbd = get_slbd_stats(); - $lcd_cmds[] = "widget_set $name title_wdgt 1 1 \"+ Load Balancer\""; - $lcd_cmds[] = "widget_set $name text_wdgt 1 2 $lcdpanel_width 2 h 2 \"{$slbd}\""; + $lcd_cmds[] = "screen_add $name"; + $lcd_cmds[] = "screen_set $name heartbeat off"; + $lcd_cmds[] = "screen_set $name name $name"; + $lcd_cmds[] = "screen_set $name duration $refresh_frequency"; + $lcd_cmds[] = "widget_add $name title_wdgt string"; + $lcd_cmds[] = "widget_add $name text_wdgt scroller"; break; case "scr_interfaces": - $interfaces = get_interfaces_stats(); - $lcd_cmds[] = "widget_set $name title_wdgt 1 1 \"+ Interfaces\""; - $lcd_cmds[] = "widget_set $name text_wdgt 1 2 $lcdpanel_width 2 h 2 \"{$interfaces}\""; + $lcd_cmds[] = "screen_add $name"; + $lcd_cmds[] = "screen_set $name heartbeat off"; + $lcd_cmds[] = "screen_set $name name $name"; + $lcd_cmds[] = "screen_set $name duration $refresh_frequency"; + $lcd_cmds[] = "widget_add $name title_wdgt string"; + $lcd_cmds[] = "widget_add $name text_wdgt scroller"; break; case "scr_mbuf": - $mbufstats = get_mbuf_stats(); - $lcd_cmds[] = "widget_set $name title_wdgt 1 1 \"+ MBuf Usage\""; - $lcd_cmds[] = "widget_set $name text_wdgt 1 2 $lcdpanel_width 2 h 2 \"{$mbufstats}\""; + $lcd_cmds[] = "screen_add $name"; + $lcd_cmds[] = "screen_set $name heartbeat off"; + $lcd_cmds[] = "screen_set $name name $name"; + $lcd_cmds[] = "screen_set $name duration $refresh_frequency"; + $lcd_cmds[] = "widget_add $name title_wdgt string"; + $lcd_cmds[] = "widget_add $name text_wdgt scroller"; break; case "scr_cpufrequency": - $cpufreq = get_cpufrequency(); - $lcd_cmds[] = "widget_set $name title_wdgt 1 1 \"+ CPU Frequency\""; - $lcd_cmds[] = "widget_set $name text_wdgt 1 2 $lcdpanel_width 2 h 2 \"{$cpufreq}\""; - break; + $lcd_cmds[] = "screen_add $name"; + $lcd_cmds[] = "screen_set $name heartbeat off"; + $lcd_cmds[] = "screen_set $name name $name"; + $lcd_cmds[] = "screen_set $name duration $refresh_frequency"; + $lcd_cmds[] = "widget_add $name title_wdgt string"; + $lcd_cmds[] = "widget_add $name text_wdgt scroller"; + break; } - add_summary_values($lcd_cmds, $name, $lcd_summary_data, $lcdpanel_width); + add_summary_declaration($lcd_cmds, $name); } - send_lcd_commands($lcd, $lcd_cmds); - sleep($refresh_frequency); - $i++; } } + send_lcd_commands($lcd, $lcd_cmds); +} + +function loop_status($lcd) { + global $g; + global $config; + $lcdproc_screens_config = $config['installedpackages']['lcdprocscreens']['config'][0]; + $lcdpanel_width = get_lcdpanel_width(); + $lcdpanel_height = get_lcdpanel_height(); + if (empty($g['product_name'])) { + $g['product_name'] = "pfSense"; + } + $version = @file_get_contents("/etc/version"); + $version = trim($version); + $refresh_frequency = get_lcdpanel_refresh_frequency(); + /* keep a counter to see how many times we can loop */ + $i = 1; + while ($i) { + /* prepare the summary data */ + if ($lcdpanel_height >= "4") { + $summary_states = split("/",get_pfstate()); + $lcd_summary_data = sprintf("%02d%% %02d%% %6d", cpu_usage(), mem_usage(), $summary_states[0]); + } else { + $lcd_summary_data = ""; + } - /* Connect to the LCDd port and interface with the LCD */ - $lcd = fsockopen(LCDPROC_HOST, LCDPROC_PORT, $errno, $errstr, 10); - if (!$lcd) { - lcdproc_warn("Failed to connect to LCDd process $errstr ($errno)"); - } else { - build_interface($lcd); - loop_status($lcd); - /* loop exited? Close fd and wait for the script to kick in again */ - fclose($lcd); + $lcd_cmds = array(); + $lcd_cmds[] = "widget_set welcome_scr title_wdgt \"Welcome to\""; + $lcd_cmds[] = "widget_set welcome_scr text_wdgt 1 2 $lcdpanel_width 2 h 2 \"{$g['product_name']} {$version}\""; + add_summary_values($lcd_cmds, "welcome_scr", $lcd_summary_data, $lcdpanel_width); + + /* process screens to display */ + foreach((array) $lcdproc_screens_config as $name => $screen) { + if ($screen != "on") { + continue; + } + switch($name) { + case "scr_time": + $time = date("n/j/Y H:i"); + $lcd_cmds[] = "widget_set $name title_wdgt 1 1 \"+ System Time\""; + $lcd_cmds[] = "widget_set $name text_wdgt 1 2 $lcdpanel_width 2 h 2 \"{$time}\""; + break; + case "scr_uptime": + $uptime = get_uptime_stats(); + $lcd_cmds[] = "widget_set $name title_wdgt 1 1 \"+ System Uptime\""; + $lcd_cmds[] = "widget_set $name text_wdgt 1 2 $lcdpanel_width 2 h 2 \"{$uptime}\""; + break; + case "scr_hostname": + exec("/bin/hostname", $output, $ret); + $hostname = $output[0]; + $lcd_cmds[] = "widget_set $name title_wdgt 1 1 \"+ System Name\""; + $lcd_cmds[] = "widget_set $name text_wdgt 1 2 $lcdpanel_width 2 h 2 \"{$hostname}\""; + break; + case "scr_system": + $processor = cpu_usage(); + $memory = mem_usage(); + $lcd_cmds[] = "widget_set $name title_wdgt 1 1 \"+ System Stats\""; + $lcd_cmds[] = "widget_set $name text_wdgt 1 2 $lcdpanel_width 2 h 2 \"CPU {$processor}%, Mem {$memory}%\""; + break; + case "scr_disk": + $disk = disk_usage(); + $lcd_cmds[] = "widget_set $name title_wdgt 1 1 \"+ Disk Use\""; + $lcd_cmds[] = "widget_set $name text_wdgt 1 2 $lcdpanel_width 2 h 2 \"Disk {$disk}%\""; + break; + case "scr_load": + $loadavg = get_loadavg_stats(); + $lcd_cmds[] = "widget_set $name title_wdgt 1 1 \"+ Load Averages\""; + $lcd_cmds[] = "widget_set $name text_wdgt 1 2 $lcdpanel_width 2 h 2 \"{$loadavg}\""; + break; + case "scr_states": + $states = get_pfstate(); + $lcd_cmds[] = "widget_set $name title_wdgt 1 1 \"+ Traffic States\""; + $lcd_cmds[] = "widget_set $name text_wdgt 1 2 $lcdpanel_width 2 h 2 \"Curr/Max {$states}\""; + break; + case "scr_carp": + $carp = get_carp_stats(); + $lcd_cmds[] = "widget_set $name title_wdgt 1 1 \"+ CARP State\""; + $lcd_cmds[] = "widget_set $name text_wdgt 1 2 $lcdpanel_width 2 h 2 \"{$carp}\""; + break; + case "scr_ipsec": + $ipsec = get_ipsec_stats(); + $lcd_cmds[] = "widget_set $name title_wdgt 1 1 \"+ IPsec Tunnels\""; + $lcd_cmds[] = "widget_set $name text_wdgt 1 2 $lcdpanel_width 2 h 2 \"{$ipsec}\""; + break; + case "scr_slbd": + $slbd = get_slbd_stats(); + $lcd_cmds[] = "widget_set $name title_wdgt 1 1 \"+ Load Balancer\""; + $lcd_cmds[] = "widget_set $name text_wdgt 1 2 $lcdpanel_width 2 h 2 \"{$slbd}\""; + break; + case "scr_interfaces": + $interfaces = get_interfaces_stats(); + $lcd_cmds[] = "widget_set $name title_wdgt 1 1 \"+ Interfaces\""; + $lcd_cmds[] = "widget_set $name text_wdgt 1 2 $lcdpanel_width 2 h 2 \"{$interfaces}\""; + break; + case "scr_mbuf": + $mbufstats = get_mbuf_stats(); + $lcd_cmds[] = "widget_set $name title_wdgt 1 1 \"+ MBuf Usage\""; + $lcd_cmds[] = "widget_set $name text_wdgt 1 2 $lcdpanel_width 2 h 2 \"{$mbufstats}\""; + break; + case "scr_cpufrequency": + $cpufreq = get_cpufrequency(); + $lcd_cmds[] = "widget_set $name title_wdgt 1 1 \"+ CPU Frequency\""; + $lcd_cmds[] = "widget_set $name text_wdgt 1 2 $lcdpanel_width 2 h 2 \"{$cpufreq}\""; + break; + } + add_summary_values($lcd_cmds, $name, $lcd_summary_data, $lcdpanel_width); + } + send_lcd_commands($lcd, $lcd_cmds); + sleep($refresh_frequency); + $i++; } +} + +/* Connect to the LCDd port and interface with the LCD */ +$lcd = fsockopen(LCDPROC_HOST, LCDPROC_PORT, $errno, $errstr, 10); +if (!$lcd) { + lcdproc_warn("Failed to connect to LCDd process $errstr ($errno)"); +} else { + build_interface($lcd); + loop_status($lcd); + /* loop exited? Close fd and wait for the script to kick in again */ + fclose($lcd); +} + ?> diff --git a/config/lcdproc/lcdproc_screens.xml b/config/lcdproc/lcdproc_screens.xml index d8cc2382..def770e6 100644 --- a/config/lcdproc/lcdproc_screens.xml +++ b/config/lcdproc/lcdproc_screens.xml @@ -1,8 +1,51 @@ <?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$ */ +/* ====================================================================================== */ +/* + lcdproc_screens.xml + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2007-2009 Seth Mos <seth.mos@dds.nl> + Copyright (C) 2009 Scott Ullrich + Copyright (C) 2011 Michele Di Maria + 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. +*/ +/* ====================================================================================== */ + ]]> + </copyright> <title>Services: LCDproc: Screens</title> <name>lcdproc_screens</name> - <version>0.5.2_1-p9</version> + <version>1.0.3</version> <savetext>Save</savetext> <include_file>/usr/local/pkg/lcdproc.inc</include_file> <tabs> @@ -18,7 +61,7 @@ </tabs> <menu> <name>LCDproc</name> - <tooltiptext>Set LCDproc settings such as display driver and com port</tooltiptext> + <tooltiptext>Set LCDproc settings such as display driver and COM port.</tooltiptext> <section>Services</section> <url>/pkg_edit.php?xml=lcdproc.xml&id=0</url> </menu> @@ -82,19 +125,13 @@ <fielddescr>Enable Mbuf</fielddescr> <fieldname>scr_mbuf</fieldname> <type>checkbox</type> - </field> + </field> <field> <fielddescr>Enable CPU Frequency</fielddescr> <fieldname>scr_cpufrequency</fieldname> <type>checkbox</type> - </field> + </field> </fields> - <custom_php_command_before_form> - before_form_lcdproc_screens($pkg); - </custom_php_command_before_form> - <custom_php_validation_command> - validate_form_lcdproc_screens($_POST, $input_errors); - </custom_php_validation_command> <custom_php_resync_config_command> sync_package_lcdproc_screens(); </custom_php_resync_config_command> diff --git a/config/netio/netio.xml b/config/netio/netio.xml index 8e49f64c..34f188c2 100644 --- a/config/netio/netio.xml +++ b/config/netio/netio.xml @@ -1,52 +1,48 @@ <?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[ + <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. - */ -/* ========================================================================== */ + netio.xml + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2009 Bill Marquette + 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: + 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. - 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. - 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. - */ -/* ========================================================================== */ - ]]> + 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>netio</name> - <version>1.14</version> + <version>1.27</version> <title>netio: Client</title> <preoutput>yes</preoutput> <donotsave>true</donotsave> @@ -80,15 +76,19 @@ <field> <fielddescr>Port</fielddescr> <fieldname>port</fieldname> - <description>Enter the port that netio will connect to. (default 18767)</description> + <description>Enter the port that netio will connect to. (Default: 18767)</description> <type>input</type> </field> </fields> <custom_add_php_command> - mwexec("killall netio"); + <![CDATA[ + mwexec("/usr/bin/killall netio"); $netio_options = ""; - if($_POST['port'] != "") $netio_options .= " -p {$_POST['port']}"; - $netio_options .= $_POST['hostname']; - system("/usr/local/bin/netio " . $netio_options); + if ($_POST['port'] != "") { + $netio_options .= " -p {$_POST['port']}"; + $netio_options .= $_POST['hostname']; + system("/usr/local/bin/netio " . $netio_options); + } + ]]> </custom_add_php_command> </packagegui> diff --git a/config/netio/netioserver.xml b/config/netio/netioserver.xml index 4c32ee19..da73e902 100644 --- a/config/netio/netioserver.xml +++ b/config/netio/netioserver.xml @@ -1,52 +1,48 @@ <?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[ + <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. - */ -/* ========================================================================== */ + netioserver.xml + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2009 Bill Marquette + 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: + 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. - 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. - 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. - */ -/* ========================================================================== */ - ]]> + 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>netioserver</name> - <version>1.14</version> + <version>1.27</version> <title>netio: Server</title> <preoutput>yes</preoutput> <donotsave>true</donotsave> @@ -71,13 +67,17 @@ <field> <fielddescr>Port</fielddescr> <fieldname>port</fieldname> - <description>Enter the port that netio will bind to. (default 18767)</description> + <description>Enter the port that netio will bind to. (Default: 18767)</description> <type>input</type> </field> </fields> <custom_add_php_command> - mwexec("killall netio"); - if($_POST['port'] != "") $netioserver_options = " -p {$_POST['port']}"; - system("/usr/local/bin/netio -s" . $netioserver_options); + <![CDATA[ + mwexec("/usr/bin/killall netio"); + if($_POST['port'] != "") { + $netioserver_options = " -p {$_POST['port']}"; + system("/usr/local/bin/netio -s" . $netioserver_options); + } + ]]> </custom_add_php_command> </packagegui> diff --git a/config/notes/notes.inc b/config/notes/notes.inc index 29b51396..ddc54a3f 100644 --- a/config/notes/notes.inc +++ b/config/notes/notes.inc @@ -1,14 +1,11 @@ <?php -/* $Id$ */ -/* -/* ========================================================================== */ /* notes.inc + part of pfSense (https://www.pfSense.org/) Copyright (C) 2008 Mark J Crane + 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: @@ -30,62 +27,11 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ - -function notes_sync_package() { - - //global $config; - -} - - -function notes_install_command() { - - global $config; - conf_mount_rw(); - config_lock(); - - if (!is_dir('/usr/local/www/packages/')) { - exec("mkdir /usr/local/www/packages/"); - } - - //if (!is_dir('/usr/local/www/packages/notes/')) { - // exec("mkdir /usr/local/www/packages/notes/"); - //} - - //rename PHP files from .tmp to .php - //exec("cp /tmp/notes.tmp /usr/local/www/packages/phpservice/notes.php"); - //unlink_if_exists("/tmp/notes.tmp"); - - //write_config(); - - //write_rcfile(array( - // "file" => "notes.sh", - // "start" => "/usr/local/bin/php /usr/local/pkg/notes.php", - // "stop" => "rm /tmp/phpmonitor.pid" - // ) - //); - - notes_sync_package(); - - //if (pkg_is_service_running('notes')) { - //documentation purposes - //} - - conf_mount_ro(); - config_unlock(); - -} - - function notes_deinstall_command() { - conf_mount_rw(); - config_lock(); unlink_if_exists("/usr/local/pkg/notes.xml"); unlink_if_exists("/usr/local/pkg/notes.inc"); conf_mount_ro(); - config_unlock(); - } -?>
\ No newline at end of file +?> diff --git a/config/notes/notes.xml b/config/notes/notes.xml index 34d2f676..e74a76f1 100644 --- a/config/notes/notes.xml +++ b/config/notes/notes.xml @@ -1,21 +1,24 @@ <?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[ +<![CDATA[ /* $Id$ */ -/* ========================================================================== */ +/* ====================================================================================== */ /* notes.xml + part of pfSense (https://www.pfSense.org/) Copyright (C) 2008 Mark J Crane + 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. @@ -23,6 +26,7 @@ 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 @@ -34,14 +38,12 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* ========================================================================== */ - ]]> +/* ====================================================================================== */ + ]]> </copyright> <description>Notes</description> - <requirements>Describe your package requirements here</requirements> - <faq>Currently there are no FAQ items provided.</faq> <name>Notes</name> - <version>0.2.5</version> + <version>0.2.6</version> <title>Settings</title> <include_file>/usr/local/pkg/notes.inc</include_file> <menu> @@ -61,7 +63,6 @@ <configpath>installedpackages->package->$packagename->configuration->notes</configpath> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> - <chmod>0755</chmod> <item>https://packages.pfsense.org/packages/config/notes/notes.inc</item> </additional_files_needed> <adddeleteeditpagefields> @@ -84,11 +85,15 @@ <field> <fielddescr>Category</fielddescr> <fieldname>category</fieldname> - <description>Enter a category.</description> + <description>Enter the category.</description> <type>input</type> </field> <field> - <fielddescr><b>Notes</b> <br /> <br /></fielddescr> + <fielddescr> + <![CDATA[ + <strong>Notes</strong><br /><br /> + ]]> + </fielddescr> <fieldname>notes</fieldname> <description></description> <type>textarea</type> @@ -98,18 +103,7 @@ <rows>20</rows> </field> </fields> - <custom_add_php_command> - </custom_add_php_command> - <custom_php_resync_config_command> - notes_sync_package(); - </custom_php_resync_config_command> - <custom_delete_php_command> - notes_sync_package(); - </custom_delete_php_command> - <custom_php_install_command> - notes_install_command(); - </custom_php_install_command> <custom_php_deinstall_command> notes_deinstall_command(); </custom_php_deinstall_command> -</packagegui>
\ No newline at end of file +</packagegui> diff --git a/config/ntop/bin/librrd_th.so.2 b/config/ntop/bin/librrd_th.so.2 Binary files differdeleted file mode 100755 index eae27341..00000000 --- a/config/ntop/bin/librrd_th.so.2 +++ /dev/null diff --git a/config/ntop/ntop.xml b/config/ntop/ntop.xml deleted file mode 100644 index 5a7cd47a..00000000 --- a/config/ntop/ntop.xml +++ /dev/null @@ -1,157 +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) 2008 Scott Ullrich - 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> - <name>ntop</name> - <version>3.0</version> - <title>Diagnostics: ntop Settings</title> - <savetext>Change</savetext> - <aftersaveredirect>pkg_edit.php?xml=ntop.xml&id=0</aftersaveredirect> - <additional_files_needed> - <prefix>/usr/local/lib/</prefix> - <chmod>0755</chmod> - <item>https://packages.pfsense.org/packages/config/ntop/bin/librrd_th.so.2</item> - </additional_files_needed> - <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&id=0</url> - </menu> - <menu> - <name>ntop</name> - <tooltiptext>Access ntop</tooltiptext> - <section>Diagnostics</section> - <url>http://$myurl:3000</url> - <depends_on_service>ntop</depends_on_service> - </menu> - <service> - <name>ntop</name> - <rcfile>ntop.sh</rcfile> - <executable>ntop</executable> - <description>NTOP bandwidth monitoring/graphing</description> - </service> - <tabs> - <tab> - <text>ntop Settings</text> - <url>/pkg_edit.php?xml=ntop.xml&id=0</url> - <active/> - </tab> - <tab> - <text>Access ntop</text> - <url>http://$myurl:3000</url> - </tab> - </tabs> - <fields> - <field> - <fielddescr>ntop Admin Password</fielddescr> - <fieldname>password</fieldname> - <description>Enter the password for the NTOP Web GUI. Minimum 5 characters.</description> - <type>password</type> - </field> - <field> - <fielddescr>ntop Admin Password AGAIN</fielddescr> - <fieldname>passwordagain</fieldname> - <type>password</type> - </field> - <field> - <fielddescr>Interface</fielddescr> - <fieldname>interface_array</fieldname> - <type>interfaces_selection</type> - <size>3</size> - <value>lan</value> - <multiple>true</multiple> - </field> - </fields> - <custom_php_global_functions> - function sync_package_ntop() { - conf_mount_rw(); - config_lock(); - global $config; - global $input_errors; - $ntop_config =& $_POST; - $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"); - if($ntop_config['password'] and $ntop_config['passwordagain']) { - if($ntop_config['password'] == $ntop_config['passwordagain']) { - $first = 0; - foreach($_POST['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; - } - } - exec("/usr/local/bin/ntop --set-admin-password=" . $_POST['password'] . " &", $ntopout); - $start = "/usr/local/bin/ntop -i " . $ifaces_final . " -u root -d --ipv4 -M -x 8102 -X 8192 &"; - write_rcfile(array( - "file" => "ntop.sh", - "start" => $start, - "stop" => "/usr/bin/killall ntop" - ) - ); - restart_service("ntop"); - } else { - $input_errors[] = "The provided passwords did not match."; - } - } else { - $input_errors[] = "You must provide (and confirm) ntop's password."; - } - conf_mount_ro(); - config_unlock(); - } - </custom_php_global_functions> - <custom_add_php_command> - sync_package_ntop(); - </custom_add_php_command> - <custom_php_resync_config_command> - sync_package_ntop(); - </custom_php_resync_config_command> - <custom_php_install_command> - </custom_php_install_command> - <custom_php_deinstall_command> - exec("rm /usr/local/etc/rc.d/ntop*"); - </custom_php_deinstall_command> -</packagegui>
\ No newline at end of file diff --git a/config/olsrd/olsrd.inc b/config/olsrd/olsrd.inc index 9eee0196..4e15f9cf 100644 --- a/config/olsrd/olsrd.inc +++ b/config/olsrd/olsrd.inc @@ -1,34 +1,64 @@ <?php -/* COPYRIGHT */ - +/* + olsrd.inc + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2012 Ermal Luçi + 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("config.inc"); function setup_wireless_olsr() { global $config, $g; - if ($g['platform'] == 'jail' || !$config['installedpackages']['olsrd'] || !$config['installedpackages']) + if ($g['platform'] == 'jail' || !$config['installedpackages']['olsrd'] || !$config['installedpackages']) { return; - if(isset($config['system']['developerspew'])) { + } + if (isset($config['system']['developerspew'])) { $mt = microtime(); echo "setup_wireless_olsr($interface) being called $mt\n"; } conf_mount_rw(); - foreach($config['installedpackages']['olsrd']['config'] as $olsrd) { + foreach ($config['installedpackages']['olsrd']['config'] as $olsrd) { $olsr_enable = $olsrd['enable']; if ($olsr_enable <> "on") { - if (is_process_running("olsrd")) + if (is_process_running("olsrd")) { mwexec("/usr/bin/killall olsrd", true); + } return; } $fd = fopen("{$g['varetc_path']}/olsr.conf", "w"); - if($olsrd['announcedynamicroute'] or $olsrd['enableannounce'] == "on") { + if ($olsrd['announcedynamicroute'] or $olsrd['enableannounce'] == "on") { $enableannounce .= "\nHna4\n"; $enableannounce .= "{\n"; - if($olsrd['announcedynamicroute']) + } + if ($olsrd['announcedynamicroute']) { $enableannounce .= "\t{$olsrd['announcedynamicroute']}\n"; - if($olsrd['enableannounce'] == "on") + } + if ($olsrd['enableannounce'] == "on") { $enableannounce .= "0.0.0.0 0.0.0.0"; $enableannounce .= "\n}\n"; } else { @@ -171,8 +201,8 @@ MprCoverage 3 EODA; -if($olsrd['enablehttpinfo'] == "on") { - $olsr .= <<<EODB + if ($olsrd['enablehttpinfo'] == "on") { + $olsr .= <<<EODB LoadPlugin "/usr/local/lib/olsrd_httpinfo.so.0.1" { @@ -182,11 +212,11 @@ LoadPlugin "/usr/local/lib/olsrd_httpinfo.so.0.1" EODB; -} + } -if($olsrd['enabledsecure'] == "on") { - @file_put_contents("{$g['tmp_path']}/olsrkey.txt", $olsrd['securekey']); - $olsr .= <<<EODC + if ($olsrd['enabledsecure'] == "on") { + @file_put_contents("{$g['tmp_path']}/olsrkey.txt", $olsrd['securekey']); + $olsr .= <<<EODC LoadPlugin "/usr/local/lib/olsrd_secure.so.0.5" { @@ -195,9 +225,9 @@ LoadPlugin "/usr/local/lib/olsrd_secure.so.0.5" EODC; -} + } -if($olsrd['enabledyngw'] == "on") { + if ($olsrd['enabledyngw'] == "on") { /* unset default route, olsr auto negotiates */ mwexec("/sbin/route delete default"); @@ -222,13 +252,13 @@ LoadPlugin "/usr/local/lib/olsrd_dyn_gw.so.0.4" EODE; -} + } -foreach($config['installedpackages']['olsrd']['config'] as $conf) { - $interfaces = explode(',', $conf['iface_array']); - foreach($interfaces as $interface) { - $realinterface = convert_friendly_interface_to_real_interface_name($interface); -$olsr .= <<<EODAD + foreach ($config['installedpackages']['olsrd']['config'] as $conf) { + $interfaces = explode(',', $conf['iface_array']); + foreach ($interfaces as $interface) { + $realinterface = convert_friendly_interface_to_real_interface_name($interface); + $olsr .= <<<EODAD Interface "{$realinterface}" { @@ -271,20 +301,21 @@ Interface "{$realinterface}" EODAD; + } + break; } - break; + + fwrite($fd, $olsr); + fclose($fd); + } - fwrite($fd, $olsr); - fclose($fd); - } - if (is_process_running("olsrd")) + if (is_process_running("olsrd")) { mwexec("/usr/bin/killall olsrd", true); + } sleep(2); - mwexec_bg("/usr/local/sbin/olsrd -f {$g['varetc_path']}/olsr.conf"); - conf_mount_ro(); } diff --git a/config/olsrd/olsrd.xml b/config/olsrd/olsrd.xml index 3939f357..464f730d 100644 --- a/config/olsrd/olsrd.xml +++ b/config/olsrd/olsrd.xml @@ -1,19 +1,59 @@ <?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$ */ +/* ====================================================================================== */ +/* + olsrd.xml + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2012 Ermal Luçi + 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. +*/ +/* ====================================================================================== */ + ]]> + </copyright> <name>olsrd</name> - <version>1.0</version> + <version>1.0.3</version> <title>OLSRD</title> <include_file>/usr/local/pkg/olsrd.inc</include_file> - <!-- Menu is where this packages menu will appear --> <menu> <name>OLSRD</name> <section>Services</section> <configfile>olsrd.xml</configfile> </menu> <service> - <name>OLSRD</name> - <rcfile>/usr/local/sbin/olsrd -f /var/etc/olsr.conf</rcfile> - </service> + <name>OLSRD</name> + <rcfile>/usr/local/sbin/olsrd -f /var/etc/olsr.conf</rcfile> + </service> <tabs> <tab> <text>OLSRD Settings</text> @@ -22,20 +62,15 @@ </tab> </tabs> <additional_files_needed> - <prefix>/usr/local/pkg/</prefix> - <chmod>0755</chmod> - <item>https://packages.pfsense.org/packages/config/olsrd/olsrd.inc</item> - </additional_files_needed> - <!-- configpath gets expanded out automatically and config items will be - stored in that location --> + <prefix>/usr/local/pkg/</prefix> + <item>https://packages.pfsense.org/packages/config/olsrd/olsrd.inc</item> + </additional_files_needed> <configpath>['installedpackages']['OLSRD']['config']</configpath> - <!-- fields gets invoked when the user adds or edits a item. the following items - will be parsed and rendered for the user as a gui with input, and selectboxes. --> <fields> <field> <fielddescr>Enable OLSR</fielddescr> <fieldname>enable</fieldname> - <description>Enables the dynamic mesh linking daemon</description> + <description>Enables the dynamic mesh linking daemon.</description> <type>checkbox</type> </field> <field> @@ -56,18 +91,18 @@ <multiple>true</multiple> <size>3</size> <type>interfaces_selection</type> - <description>Select the interfaces that OLSR will bind to. You can use the CTRL or COMMAND key to select multiple interfaces.</description> + <description>Select the interfaces that OLSR will bind to. You can use the CTRL or COMMAND key to select multiple interfaces.</description> </field> <field> <fielddescr>Enable HTTPInfo Plugin</fielddescr> <fieldname>enablehttpinfo</fieldname> - <description>Enables the OLSR stats web server</description> + <description>Enables the OLSR stats web server.</description> <type>checkbox</type> </field> <field> <fielddescr>HTTPInfo Port</fielddescr> <fieldname>port</fieldname> - <description>Port that HTTPInfo will listen on</description> + <description>Port that HTTPInfo will listen on.</description> <type>input</type> </field> <field> @@ -85,19 +120,19 @@ <field> <fielddescr>Enable Dynamic Gateway</fielddescr> <fieldname>enabledyngw</fieldname> - <description>Enables the OLSR Dynamic Gateways feature</description> + <description>Enables the OLSR Dynamic Gateways feature.</description> <type>checkbox</type> </field> <field> <fielddescr>Announce self as Dynamic Gateway</fielddescr> <fieldname>enableannounce</fieldname> - <description>Enables the OLSR Dynamic Gateways Announcing feature</description> + <description>Enables the OLSR Dynamic Gateways Announcing feature.</description> <type>checkbox</type> </field> <field> <fielddescr>Announce Dynamic local route</fielddescr> <fieldname>announcedynamicroute</fieldname> - <description>Enter the IP/Netmask</description> + <description>Enter the IP/Netmask.</description> <type>textarea</type> <rows>3</rows> <cols>50</cols> @@ -105,7 +140,7 @@ <field> <fielddescr>Ping</fielddescr> <fieldname>ping</fieldname> - <description>Pings this host to ensure connectivity</description> + <description>Pings this host to ensure connectivity.</description> <type>input</type> </field> <field> @@ -117,7 +152,7 @@ <field> <fielddescr>Enable Secure Mode</fielddescr> <fieldname>enabledsecure</fieldname> - <description>Enables the secure mode</description> + <description>Enables the secure mode.</description> <type>checkbox</type> </field> <field> diff --git a/config/openbgpd/openbgpd.xml b/config/openbgpd/openbgpd.xml index e7d77786..83e0122c 100644 --- a/config/openbgpd/openbgpd.xml +++ b/config/openbgpd/openbgpd.xml @@ -2,78 +2,73 @@ <!DOCTYPE packagegui SYSTEM "../schema/packages.dtd"> <?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?> <packagegui> - <copyright> - <![CDATA[ + <copyright> + <![CDATA[ /* $Id$ */ -/* ========================================================================== */ +/* ====================================================================================== */ /* - openbgpd.xml - Copyright (C) 2007 Scott Ullrich (sullrich@gmail.com) - part of pfSense (http://www.pfSense.com) - All rights reserved. - */ -/* ========================================================================== */ + openbgpd.xml + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2007 Scott Ullrich (sullrich@gmail.com) + 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: + 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. - 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> + 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> <name>OpenBGPD</name> - <version>1</version> + <version>0.9.3.4</version> <title>Services: OpenBGPD</title> <include_file>/usr/local/pkg/openbgpd.inc</include_file> - <service> - <name>bgpd</name> - <rcfile>bgpd.sh</rcfile> - <executable>bgpd</executable> - <description>OpenBSD BGP Daemon</description> - </service> + <service> + <name>bgpd</name> + <rcfile>bgpd.sh</rcfile> + <executable>bgpd</executable> + <description>OpenBSD BGP Daemon</description> + </service> <additional_files_needed> <prefix>/usr/local/www/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/openbgpd/openbgpd_status.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/openbgpd/openbgpd_raw.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/openbgpd/openbgpd.inc</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/openbgpd/openbgpd_groups.xml</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/openbgpd/openbgpd_neighbors.xml</item> </additional_files_needed> <menu> @@ -121,18 +116,24 @@ <field> <fielddescr>Holdtime</fielddescr> <fieldname>holdtime</fieldname> - <description>Set the holdtime in seconds. The holdtime is reset to its initial value every time either a KEEPALIVE or an UPDATE message is received from the neighbor. If the holdtime expires the session is dropped. The default is 90 seconds. Neighboring systems negotiate the holdtime used when the connection is established in the OPEN messages. Each neighbor announces its configured hold- time; the smaller one is then agreed upon.</description> + <description> + <![CDATA[ + Set the holdtime in seconds. The holdtime is reset to its initial value every time either a KEEPALIVE or an UPDATE message is received from the neighbor.<br /> + If the holdtime expires the session is dropped. The default is 90 seconds. Neighboring systems negotiate the holdtime used when the connection is established in the OPEN messages.<br /> + Each neighbor announces its configured hold- time; the smaller one is then agreed upon. + ]]> + </description> <type>input</type> </field> <field> <fielddescr>fib-update</fielddescr> <fieldname>fibupdate</fieldname> - <description>If set to no, do not update the Forwarding Information Base a.k.a. the kernel routing table. The default is yes.</description> + <description>If set to no, do not update the Forwarding Information Base a.k.a. the kernel routing table. The default is yes.</description> <type>select</type> <options> - <option><name>yes</name><value>yes</value></option> - <option><name>no</name><value>no</value></option> + <option><name>yes</name><value>yes</value></option> + <option><name>no</name><value>no</value></option> </options> </field> <field> @@ -151,24 +152,34 @@ <field> <fielddescr>CARP Status IP</fielddescr> <fieldname>carpstatusip</fieldname> - <description>IP address used to determine the CARP status. When the VIP is in BACKUP status, bgpd will not be started. <br/>NOTE: On 2.1.x and before this requires changes to /etc/rc.carpmaster to start bgpd and /etc/rc.carpbackup to stop bgpd or it will not be fully effective. On pfSense 2.2.x and later, full support is automatic.</description> + <description> + <![CDATA[ + IP address used to determine the CARP status. When the VIP is in BACKUP status, bgpd will not be started.<br /> + NOTE: On 2.1.x and before this requires changes to /etc/rc.carpmaster to start bgpd and /etc/rc.carpbackup to stop bgpd or it will not be fully effective. On pfSense 2.2.x and later, full support is automatic. + ]]> + </description> <type>input</type> <size>25</size> </field> <field> <fielddescr>Networks</fielddescr> <fieldname>network</fieldname> - <type>rowhelper</type> - <description></description> - <rowhelper> + <type>rowhelper</type> + <description></description> + <rowhelper> <rowhelperfield> - <fielddescr>Announce the specified network as belonging to our AS. If set to "(inet|inet6)connected", inet or inet6 routes to directly attached networks will be announced. If set to "(inet|inet6) static", all inet or inet6 static routes will be announced.</fielddescr> - <fieldname>networks</fieldname> - <description>Network that you would like to advertise</description> - <type>input</type> - <size>45</size> + <fielddescr> + <![CDATA[ + Announce the specified network as belonging to our AS. If set to "(inet|inet6)connected", inet or inet6 routes to directly attached networks will be announced.<br /> + If set to "(inet|inet6) static", all inet or inet6 static routes will be announced. + ]]> + </fielddescr> + <fieldname>networks</fieldname> + <description>Network that you would like to advertise</description> + <type>input</type> + <size>45</size> </rowhelperfield> - </rowhelper> + </rowhelper> </field> </fields> <custom_php_deinstall_command> diff --git a/config/openvpn_tapfix_20x/openvpn_tapfix_203.patch b/config/openvpn_tapfix_20x/openvpn_tapfix_203.patch deleted file mode 100644 index 897a1199..00000000 --- a/config/openvpn_tapfix_20x/openvpn_tapfix_203.patch +++ /dev/null @@ -1,290 +0,0 @@ -diff --git /etc/inc/openvpn.inc.orig /etc/inc/openvpn.inc -index 777b395..701a032 100644 ---- a/etc/inc/openvpn.inc -+++ b/etc/inc/openvpn.inc -@@ -394,19 +394,37 @@ function openvpn_reconfigure($mode, $settings) { - // If the CIDR is less than a /30, OpenVPN will complain if you try to - // use the server directive. It works for a single client without it. - // See ticket #1417 -- if ($cidr < 30) { -+ if (!empty($ip) && !empty($mask) && ($cidr < 30)) { - $conf .= "server {$ip} {$mask}\n"; - $conf .= "client-config-dir {$g['varetc_path']}/openvpn-csc\n"; - } - case 'p2p_shared_key': -- list($ip1, $ip2) = openvpn_get_interface_ip($ip, $mask); -- $conf .= "ifconfig $ip1 $ip2\n"; -+ if (!empty($ip) && !empty($mask)) { -+ list($ip1, $ip2) = openvpn_get_interface_ip($ip, $mask); -+ $conf .= "ifconfig $ip1 $ip2\n"; -+ } - break; - case 'server_tls': - case 'server_user': - case 'server_tls_user': -- $conf .= "server {$ip} {$mask}\n"; -- $conf .= "client-config-dir {$g['varetc_path']}/openvpn-csc\n"; -+ if (!empty($ip) && !empty($mask)) { -+ $conf .= "server {$ip} {$mask}\n"; -+ $conf .= "client-config-dir {$g['varetc_path']}/openvpn-csc\n"; -+ } else { -+ if ($settings['serverbridge_dhcp']) { -+ if ((!empty($settings['serverbridge_interface'])) && (strcmp($settings['serverbridge_interface'], "none"))) { -+ $biface_ip=get_interface_ip($settings['serverbridge_interface']); -+ $biface_sm=gen_subnet_mask(get_interface_subnet($settings['serverbridge_interface'])); -+ if (is_ipaddr($biface_ip) && is_ipaddr($settings['serverbridge_dhcp_start']) && is_ipaddr($settings['serverbridge_dhcp_end'])) { -+ $conf .= "server-bridge {$biface_ip} {$biface_sm} {$settings['serverbridge_dhcp_start']} {$settings['serverbridge_dhcp_end']}\n"; -+ } else { -+ $conf .= "mode server\n"; -+ } -+ } else { -+ $conf .= "mode server\n"; -+ } -+ } -+ } - break; - } - -@@ -452,7 +452,9 @@ function openvpn_reconfigure($mode, $settings) { - case 'server_user': - $conf .= "client-cert-not-required\n"; - case 'server_tls_user': -- $conf .= "username-as-common-name\n"; -+ /* username-as-common-name is not compatible with server-bridge */ -+ if (stristr($conf, "server-bridge") === false) -+ $conf .= "username-as-common-name\n"; - if (!empty($settings['authmode'])) { - $authcfgs = explode(",", $settings['authmode']); - $sed = "\$authmodes=array("; - -diff --git /usr/local/www/vpn_openvpn_server.php.orig /usr/local/www/vpn_openvpn_server.php -index 0ef67a7..bd9f527 100644 ---- a/usr/local/www/vpn_openvpn_server.php -+++ b/usr/local/www/vpn_openvpn_server.php -@@ -147,6 +147,11 @@ if($_GET['act']=="edit"){ - $pconfig['dynamic_ip'] = $a_server[$id]['dynamic_ip']; - $pconfig['pool_enable'] = $a_server[$id]['pool_enable']; - -+ $pconfig['serverbridge_dhcp'] = $a_server[$id]['serverbridge_dhcp']; -+ $pconfig['serverbridge_interface'] = $a_server[$id]['serverbridge_interface']; -+ $pconfig['serverbridge_dhcp_start'] = $a_server[$id]['serverbridge_dhcp_start']; -+ $pconfig['serverbridge_dhcp_end'] = $a_server[$id]['serverbridge_dhcp_end']; -+ - $pconfig['dns_domain'] = $a_server[$id]['dns_domain']; - if ($pconfig['dns_domain']) - $pconfig['dns_domain_enable'] = true; -@@ -188,7 +193,6 @@ if($_GET['act']=="edit"){ - $pconfig['duplicate_cn'] = isset($a_server[$id]['duplicate_cn']); - } - } -- - if ($_POST) { - - unset($input_errors); -@@ -284,9 +288,22 @@ if ($_POST) { - $reqdfieldsn = array(gettext('Shared key')); - } - -- $reqdfields[] = 'tunnel_network'; -- $reqdfieldsn[] = gettext('Tunnel network'); -- -+ if ($pconfig['dev_mode'] != "tap") { -+ $reqdfields[] = 'tunnel_network'; -+ $reqdfieldsn[] = gettext('Tunnel network'); -+ } else { -+ if ($pconfig['serverbridge_dhcp'] && $pconfig['tunnel_network']) -+ $input_errors[] = gettext("Using a tunnel network and server bridge settings together is not allowed."); -+ if (($pconfig['serverbridge_dhcp_start'] && !$pconfig['serverbridge_dhcp_end']) -+ || (!$pconfig['serverbridge_dhcp_start'] && $pconfig['serverbridge_dhcp_end'])) -+ $input_errors[] = gettext("Server Bridge DHCP Start and End must both be empty, or defined."); -+ if (($pconfig['serverbridge_dhcp_start'] && !is_ipaddr($pconfig['serverbridge_dhcp_start']))) -+ $input_errors[] = gettext("Server Bridge DHCP Start must be an IPv4 address."); -+ if (($pconfig['serverbridge_dhcp_end'] && !is_ipaddr($pconfig['serverbridge_dhcp_end']))) -+ $input_errors[] = gettext("Server Bridge DHCP End must be an IPv4 address."); -+ if (ip2ulong($pconfig['serverbridge_dhcp_start']) > ip2ulong($pconfig['serverbridge_dhcp_end'])) -+ $input_errors[] = gettext("The Server Bridge DHCP range is invalid (start higher than end)."); -+ } - do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); - - if (!$input_errors) { -@@ -341,6 +358,11 @@ if ($_POST) { - $server['dynamic_ip'] = $pconfig['dynamic_ip']; - $server['pool_enable'] = $pconfig['pool_enable']; - -+ $server['serverbridge_dhcp'] = $pconfig['serverbridge_dhcp']; -+ $server['serverbridge_interface'] = $pconfig['serverbridge_interface']; -+ $server['serverbridge_dhcp_start'] = $pconfig['serverbridge_dhcp_start']; -+ $server['serverbridge_dhcp_end'] = $pconfig['serverbridge_dhcp_end']; -+ - if ($pconfig['dns_domain_enable']) - $server['dns_domain'] = $pconfig['dns_domain']; - -@@ -559,6 +581,56 @@ function netbios_change() { - } - } - -+function tuntap_change() { -+ -+ mindex = document.iform.mode.selectedIndex; -+ mvalue = document.iform.mode.options[mindex].value; -+ -+ switch(mvalue) { -+ case "p2p_tls": -+ case "p2p_shared_key": -+ p2p = true; -+ break; -+ default: -+ p2p = false; -+ break; -+ } -+ -+ index = document.iform.dev_mode.selectedIndex; -+ value = document.iform.dev_mode.options[index].value; -+ switch(value) { -+ case "tun": -+ document.getElementById("ipv4_tunnel_network").className="vncellreq"; -+ document.getElementById("serverbridge_dhcp").style.display="none"; -+ document.getElementById("serverbridge_interface").style.display="none"; -+ document.getElementById("serverbridge_dhcp_start").style.display="none"; -+ document.getElementById("serverbridge_dhcp_end").style.display="none"; -+ break; -+ case "tap": -+ document.getElementById("ipv4_tunnel_network").className="vncell"; -+ if (!p2p) { -+ document.getElementById("serverbridge_dhcp").style.display=""; -+ document.getElementById("serverbridge_interface").style.display=""; -+ document.getElementById("serverbridge_dhcp_start").style.display=""; -+ document.getElementById("serverbridge_dhcp_end").style.display=""; -+ if (document.iform.serverbridge_dhcp.checked) { -+ document.iform.serverbridge_interface.disabled = false; -+ document.iform.serverbridge_dhcp_start.disabled = false; -+ document.iform.serverbridge_dhcp_end.disabled = false; -+ } else { -+ document.iform.serverbridge_interface.disabled = true; -+ document.iform.serverbridge_dhcp_start.disabled = true; -+ document.iform.serverbridge_dhcp_end.disabled = true; -+ } -+ } else { -+ document.iform.serverbridge_dhcp.disabled = true; -+ document.iform.serverbridge_interface.disabled = true; -+ document.iform.serverbridge_dhcp_start.disabled = true; -+ document.iform.serverbridge_dhcp_end.disabled = true; -+ } -+ break; -+ } -+} - //--> - </script> - <?php -@@ -619,7 +691,7 @@ if ($savemsg) - <tr> - <td width="22%" valign="top" class="vncellreq"><?=gettext("Server Mode");?></td> - <td width="78%" class="vtable"> -- <select name='mode' id='mode' class="formselect" onchange='mode_change()'> -+ <select name='mode' id='mode' class="formselect" onchange='mode_change(); tuntap_change()'> - <?php - foreach ($openvpn_server_modes as $name => $desc): - $selected = ""; -@@ -666,7 +738,7 @@ if ($savemsg) - <tr> - <td width="22%" valign="top" class="vncellreq"><?=gettext("Device Mode"); ?></td> - <td width="78%" class="vtable"> -- <select name="dev_mode" class="formselect"> -+ <select name="dev_mode" class="formselect" onchange='tuntap_change()'> - <?php - foreach ($openvpn_dev_mode as $device): - $selected = ""; -@@ -976,7 +1048,7 @@ if ($savemsg) - <td colspan="2" valign="top" class="listtopic"><?=gettext("Tunnel Settings"); ?></td> - </tr> - <tr> -- <td width="22%" valign="top" class="vncellreq"><?=gettext("Tunnel Network"); ?></td> -+ <td width="22%" valign="top" class="vncellreq" id="ipv4_tunnel_network"><?=gettext("Tunnel Network"); ?></td> - <td width="78%" class="vtable"> - <input name="tunnel_network" type="text" class="formfld unknown" size="20" value="<?=htmlspecialchars($pconfig['tunnel_network']);?>"> - <br> -@@ -989,6 +1061,76 @@ if ($savemsg) - "to connecting clients. (see Address Pool)"); ?> - </td> - </tr> -+ <tr id="serverbridge_dhcp"> -+ <td width="22%" valign="top" class="vncell"><?=gettext("Bridge DHCP"); ?></td> -+ <td width="78%" class="vtable"> -+ <table border="0" cellpadding="2" cellspacing="0"> -+ <tr> -+ <td> -+ <?php set_checked($pconfig['serverbridge_dhcp'],$chk); ?> -+ <input name="serverbridge_dhcp" type="checkbox" value="yes" <?=$chk;?> onchange='tuntap_change()' /> -+ </td> -+ <td> -+ <span class="vexpl"> -+ <?=gettext("Allow clients on the bridge to obtain DHCP."); ?><br> -+ </span> -+ </td> -+ </tr> -+ </table> -+ </td> -+ </tr> -+ <tr id="serverbridge_interface"> -+ <td width="22%" valign="top" class="vncell"><?=gettext("Bridge Interface"); ?></td> -+ <td width="78%" class="vtable"> -+ <select name="serverbridge_interface" class="formselect"> -+ <?php -+ $serverbridge_interface['none'] = "none"; -+ $serverbridge_interface = array_merge($serverbridge_interface, get_configured_interface_with_descr()); -+ $carplist = get_configured_carp_interface_list(); -+ foreach ($carplist as $cif => $carpip) -+ $serverbridge_interface[$cif.'|'.$carpip] = $carpip." (".get_vip_descr($carpip).")"; -+ $aliaslist = get_configured_ip_aliases_list(); -+ foreach ($aliaslist as $aliasip => $aliasif) -+ $serverbridge_interface[$aliasif.'|'.$aliasip] = $aliasip." (".get_vip_descr($aliasip).")"; -+ foreach ($serverbridge_interface as $iface => $ifacename): -+ $selected = ""; -+ if ($iface == $pconfig['serverbridge_interface']) -+ $selected = "selected"; -+ ?> -+ <option value="<?=$iface;?>" <?=$selected;?>> -+ <?=htmlspecialchars($ifacename);?> -+ </option> -+ <?php endforeach; ?> -+ </select> <br> -+ <?=gettext("The interface to which this tap instance will be, " . -+ "bridged. This is not done automatically. You must assign this " . -+ "interface and create the bridge separately. " . -+ "This setting controls which existing IP address and subnet " . -+ "mask are used by OpenVPN for the bridge. Setting this to " . -+ "'none' will cause the Server Bridge DHCP settings below to be ignored."); ?> -+ </td> -+ </tr> -+ <tr id="serverbridge_dhcp_start"> -+ <td width="22%" valign="top" class="vncell"><?=gettext("Server Bridge DHCP Start"); ?></td> -+ <td width="78%" class="vtable"> -+ <input name="serverbridge_dhcp_start" type="text" class="formfld unknown" size="20" value="<?=htmlspecialchars($pconfig['serverbridge_dhcp_start']);?>"> -+ <br> -+ <?=gettext("When using tap mode as multi-point server, " . -+ "you may optionally supply a DHCP range to use on the " . -+ "interface to which this tap instance is bridged. " . -+ "If these settings are left blank, DHCP will be passed " . -+ "through to the LAN, and the interface setting above " . -+ "will be ignored."); ?> -+ </td> -+ </tr> -+ <tr id="serverbridge_dhcp_end"> -+ <td width="22%" valign="top" class="vncell"><?=gettext("Server Bridge DHCP End"); ?></td> -+ <td width="78%" class="vtable"> -+ <input name="serverbridge_dhcp_end" type="text" class="formfld unknown" size="20" value="<?=htmlspecialchars($pconfig['serverbridge_dhcp_end']);?>"> -+ <br> -+ <?=gettext(""); ?> -+ </td> -+ </tr> - <tr id="gwredir_opts"> - <td width="22%" valign="top" class="vncell"><?=gettext("Redirect Gateway"); ?></td> - <td width="78%" class="vtable"> -@@ -1486,6 +1628,7 @@ dns_server_change(); - wins_server_change(); - ntp_server_change(); - netbios_change(); -+tuntap_change(); - //--> - </script> - </body> diff --git a/config/openvpn_tapfix_20x/openvpn_tapfix_20x.inc b/config/openvpn_tapfix_20x/openvpn_tapfix_20x.inc deleted file mode 100644 index 8f574212..00000000 --- a/config/openvpn_tapfix_20x/openvpn_tapfix_20x.inc +++ /dev/null @@ -1,25 +0,0 @@ -<?php - -function openvpn_tapfix_20x_install() { - global $g, $config; - $pfs_version = substr(trim(file_get_contents("/etc/version")),0,5); - switch ($pfs_version) { - case "2.0.3": - $patch_file = "openvpn_tapfix_203.patch"; - break; - default: - $patch_file = "openvpn_tapfix_20x.patch"; - } - // Test to make sure the patch is not already applied. - $out = `patch -fslC --reverse -p1 -b .before_openvpn_tapfix_20x -d / -i /usr/local/pkg/{$patch_file} |& grep -ci reject`; - if ($out == 0) { - // If the patch has not already been applied, test to see if it will apply cleanly. - $out = `patch -fsNlC -p1 -b .before_openvpn_tapfix_20x -d / -i /usr/local/pkg/{$patch_file} |& grep -ci reject`; - if ($out == 0) { - // The patch should apply cleanly, let 'er rip. - mwexec("patch -fsNl -p1 -b .before_openvpn_tapfix_20x -d / -i /usr/local/pkg/{$patch_file} "); - } - } -} - -?>
\ No newline at end of file diff --git a/config/openvpn_tapfix_20x/openvpn_tapfix_20x.patch b/config/openvpn_tapfix_20x/openvpn_tapfix_20x.patch deleted file mode 100644 index ed4232bb..00000000 --- a/config/openvpn_tapfix_20x/openvpn_tapfix_20x.patch +++ /dev/null @@ -1,301 +0,0 @@ -diff --git /etc/inc/openvpn.inc.orig /etc/inc/openvpn.inc -index 777b395..701a032 100644 ---- a/etc/inc/openvpn.inc -+++ b/etc/inc/openvpn.inc -@@ -394,21 +394,39 @@ function openvpn_reconfigure($mode, $settings) { - // If the CIDR is less than a /30, OpenVPN will complain if you try to - // use the server directive. It works for a single client without it. - // See ticket #1417 -- if ($cidr < 30) { -+ if (!empty($ip) && !empty($mask) && ($cidr < 30)) { - $conf .= "server {$ip} {$mask}\n"; - $conf .= "client-config-dir {$g['varetc_path']}/openvpn-csc\n"; - } - case 'p2p_shared_key': -- $baselong = ip2long32($ip) & ip2long($mask); -- $ip1 = long2ip32($baselong + 1); -- $ip2 = long2ip32($baselong + 2); -- $conf .= "ifconfig $ip1 $ip2\n"; -+ if (!empty($ip) && !empty($mask)) { -+ $baselong = ip2long32($ip) & ip2long($mask); -+ $ip1 = long2ip32($baselong + 1); -+ $ip2 = long2ip32($baselong + 2); -+ $conf .= "ifconfig $ip1 $ip2\n"; -+ } - break; - case 'server_tls': - case 'server_user': - case 'server_tls_user': -- $conf .= "server {$ip} {$mask}\n"; -- $conf .= "client-config-dir {$g['varetc_path']}/openvpn-csc\n"; -+ if (!empty($ip) && !empty($mask)) { -+ $conf .= "server {$ip} {$mask}\n"; -+ $conf .= "client-config-dir {$g['varetc_path']}/openvpn-csc\n"; -+ } else { -+ if ($settings['serverbridge_dhcp']) { -+ if ((!empty($settings['serverbridge_interface'])) && (strcmp($settings['serverbridge_interface'], "none"))) { -+ $biface_ip=get_interface_ip($settings['serverbridge_interface']); -+ $biface_sm=gen_subnet_mask(get_interface_subnet($settings['serverbridge_interface'])); -+ if (is_ipaddr($biface_ip) && is_ipaddr($settings['serverbridge_dhcp_start']) && is_ipaddr($settings['serverbridge_dhcp_end'])) { -+ $conf .= "server-bridge {$biface_ip} {$biface_sm} {$settings['serverbridge_dhcp_start']} {$settings['serverbridge_dhcp_end']}\n"; -+ } else { -+ $conf .= "mode server\n"; -+ } -+ } else { -+ $conf .= "mode server\n"; -+ } -+ } -+ } - break; - } - -@@ -452,7 +452,9 @@ function openvpn_reconfigure($mode, $settings) { - case 'server_user': - $conf .= "client-cert-not-required\n"; - case 'server_tls_user': -- $conf .= "username-as-common-name\n"; -+ /* username-as-common-name is not compatible with server-bridge */ -+ if (stristr($conf, "server-bridge") === false) -+ $conf .= "username-as-common-name\n"; - if (!empty($settings['authmode'])) { - $authcfgs = explode(",", $settings['authmode']); - $sed = "\$authmodes=array("; - -@@ -1021,4 +1039,4 @@ function openvpn_refresh_crls() { - } - } - --?> -\ No newline at end of file -+?> -diff --git /usr/local/www/vpn_openvpn_server.php.orig /usr/local/www/vpn_openvpn_server.php -index 0ef67a7..bd9f527 100644 ---- a/usr/local/www/vpn_openvpn_server.php -+++ b/usr/local/www/vpn_openvpn_server.php -@@ -147,6 +147,11 @@ if($_GET['act']=="edit"){ - $pconfig['dynamic_ip'] = $a_server[$id]['dynamic_ip']; - $pconfig['pool_enable'] = $a_server[$id]['pool_enable']; - -+ $pconfig['serverbridge_dhcp'] = $a_server[$id]['serverbridge_dhcp']; -+ $pconfig['serverbridge_interface'] = $a_server[$id]['serverbridge_interface']; -+ $pconfig['serverbridge_dhcp_start'] = $a_server[$id]['serverbridge_dhcp_start']; -+ $pconfig['serverbridge_dhcp_end'] = $a_server[$id]['serverbridge_dhcp_end']; -+ - $pconfig['dns_domain'] = $a_server[$id]['dns_domain']; - if ($pconfig['dns_domain']) - $pconfig['dns_domain_enable'] = true; -@@ -188,7 +193,6 @@ if($_GET['act']=="edit"){ - $pconfig['duplicate_cn'] = isset($a_server[$id]['duplicate_cn']); - } - } -- - if ($_POST) { - - unset($input_errors); -@@ -284,9 +288,22 @@ if ($_POST) { - $reqdfieldsn = array(gettext('Shared key')); - } - -- $reqdfields[] = 'tunnel_network'; -- $reqdfieldsn[] = gettext('Tunnel network'); -- -+ if ($pconfig['dev_mode'] != "tap") { -+ $reqdfields[] = 'tunnel_network'; -+ $reqdfieldsn[] = gettext('Tunnel network'); -+ } else { -+ if ($pconfig['serverbridge_dhcp'] && $pconfig['tunnel_network']) -+ $input_errors[] = gettext("Using a tunnel network and server bridge settings together is not allowed."); -+ if (($pconfig['serverbridge_dhcp_start'] && !$pconfig['serverbridge_dhcp_end']) -+ || (!$pconfig['serverbridge_dhcp_start'] && $pconfig['serverbridge_dhcp_end'])) -+ $input_errors[] = gettext("Server Bridge DHCP Start and End must both be empty, or defined."); -+ if (($pconfig['serverbridge_dhcp_start'] && !is_ipaddr($pconfig['serverbridge_dhcp_start']))) -+ $input_errors[] = gettext("Server Bridge DHCP Start must be an IPv4 address."); -+ if (($pconfig['serverbridge_dhcp_end'] && !is_ipaddr($pconfig['serverbridge_dhcp_end']))) -+ $input_errors[] = gettext("Server Bridge DHCP End must be an IPv4 address."); -+ if (ip2ulong($pconfig['serverbridge_dhcp_start']) > ip2ulong($pconfig['serverbridge_dhcp_end'])) -+ $input_errors[] = gettext("The Server Bridge DHCP range is invalid (start higher than end)."); -+ } - do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); - - if (!$input_errors) { -@@ -341,6 +358,11 @@ if ($_POST) { - $server['dynamic_ip'] = $pconfig['dynamic_ip']; - $server['pool_enable'] = $pconfig['pool_enable']; - -+ $server['serverbridge_dhcp'] = $pconfig['serverbridge_dhcp']; -+ $server['serverbridge_interface'] = $pconfig['serverbridge_interface']; -+ $server['serverbridge_dhcp_start'] = $pconfig['serverbridge_dhcp_start']; -+ $server['serverbridge_dhcp_end'] = $pconfig['serverbridge_dhcp_end']; -+ - if ($pconfig['dns_domain_enable']) - $server['dns_domain'] = $pconfig['dns_domain']; - -@@ -559,6 +581,56 @@ function netbios_change() { - } - } - -+function tuntap_change() { -+ -+ mindex = document.iform.mode.selectedIndex; -+ mvalue = document.iform.mode.options[mindex].value; -+ -+ switch(mvalue) { -+ case "p2p_tls": -+ case "p2p_shared_key": -+ p2p = true; -+ break; -+ default: -+ p2p = false; -+ break; -+ } -+ -+ index = document.iform.dev_mode.selectedIndex; -+ value = document.iform.dev_mode.options[index].value; -+ switch(value) { -+ case "tun": -+ document.getElementById("ipv4_tunnel_network").className="vncellreq"; -+ document.getElementById("serverbridge_dhcp").style.display="none"; -+ document.getElementById("serverbridge_interface").style.display="none"; -+ document.getElementById("serverbridge_dhcp_start").style.display="none"; -+ document.getElementById("serverbridge_dhcp_end").style.display="none"; -+ break; -+ case "tap": -+ document.getElementById("ipv4_tunnel_network").className="vncell"; -+ if (!p2p) { -+ document.getElementById("serverbridge_dhcp").style.display=""; -+ document.getElementById("serverbridge_interface").style.display=""; -+ document.getElementById("serverbridge_dhcp_start").style.display=""; -+ document.getElementById("serverbridge_dhcp_end").style.display=""; -+ if (document.iform.serverbridge_dhcp.checked) { -+ document.iform.serverbridge_interface.disabled = false; -+ document.iform.serverbridge_dhcp_start.disabled = false; -+ document.iform.serverbridge_dhcp_end.disabled = false; -+ } else { -+ document.iform.serverbridge_interface.disabled = true; -+ document.iform.serverbridge_dhcp_start.disabled = true; -+ document.iform.serverbridge_dhcp_end.disabled = true; -+ } -+ } else { -+ document.iform.serverbridge_dhcp.disabled = true; -+ document.iform.serverbridge_interface.disabled = true; -+ document.iform.serverbridge_dhcp_start.disabled = true; -+ document.iform.serverbridge_dhcp_end.disabled = true; -+ } -+ break; -+ } -+} - //--> - </script> - <?php -@@ -619,7 +691,7 @@ if ($savemsg) - <tr> - <td width="22%" valign="top" class="vncellreq"><?=gettext("Server Mode");?></td> - <td width="78%" class="vtable"> -- <select name='mode' id='mode' class="formselect" onchange='mode_change()'> -+ <select name='mode' id='mode' class="formselect" onchange='mode_change(); tuntap_change()'> - <?php - foreach ($openvpn_server_modes as $name => $desc): - $selected = ""; -@@ -666,7 +738,7 @@ if ($savemsg) - <tr> - <td width="22%" valign="top" class="vncellreq"><?=gettext("Device Mode"); ?></td> - <td width="78%" class="vtable"> -- <select name="dev_mode" class="formselect"> -+ <select name="dev_mode" class="formselect" onchange='tuntap_change()'> - <?php - foreach ($openvpn_dev_mode as $device): - $selected = ""; -@@ -976,7 +1048,7 @@ if ($savemsg) - <td colspan="2" valign="top" class="listtopic"><?=gettext("Tunnel Settings"); ?></td> - </tr> - <tr> -- <td width="22%" valign="top" class="vncellreq"><?=gettext("Tunnel Network"); ?></td> -+ <td width="22%" valign="top" class="vncellreq" id="ipv4_tunnel_network"><?=gettext("Tunnel Network"); ?></td> - <td width="78%" class="vtable"> - <input name="tunnel_network" type="text" class="formfld unknown" size="20" value="<?=htmlspecialchars($pconfig['tunnel_network']);?>"> - <br> -@@ -989,6 +1061,76 @@ if ($savemsg) - "to connecting clients. (see Address Pool)"); ?> - </td> - </tr> -+ <tr id="serverbridge_dhcp"> -+ <td width="22%" valign="top" class="vncell"><?=gettext("Bridge DHCP"); ?></td> -+ <td width="78%" class="vtable"> -+ <table border="0" cellpadding="2" cellspacing="0"> -+ <tr> -+ <td> -+ <?php set_checked($pconfig['serverbridge_dhcp'],$chk); ?> -+ <input name="serverbridge_dhcp" type="checkbox" value="yes" <?=$chk;?> onchange='tuntap_change()' /> -+ </td> -+ <td> -+ <span class="vexpl"> -+ <?=gettext("Allow clients on the bridge to obtain DHCP."); ?><br> -+ </span> -+ </td> -+ </tr> -+ </table> -+ </td> -+ </tr> -+ <tr id="serverbridge_interface"> -+ <td width="22%" valign="top" class="vncell"><?=gettext("Bridge Interface"); ?></td> -+ <td width="78%" class="vtable"> -+ <select name="serverbridge_interface" class="formselect"> -+ <?php -+ $serverbridge_interface['none'] = "none"; -+ $serverbridge_interface = array_merge($serverbridge_interface, get_configured_interface_with_descr()); -+ $carplist = get_configured_carp_interface_list(); -+ foreach ($carplist as $cif => $carpip) -+ $serverbridge_interface[$cif.'|'.$carpip] = $carpip." (".get_vip_descr($carpip).")"; -+ $aliaslist = get_configured_ip_aliases_list(); -+ foreach ($aliaslist as $aliasip => $aliasif) -+ $serverbridge_interface[$aliasif.'|'.$aliasip] = $aliasip." (".get_vip_descr($aliasip).")"; -+ foreach ($serverbridge_interface as $iface => $ifacename): -+ $selected = ""; -+ if ($iface == $pconfig['serverbridge_interface']) -+ $selected = "selected"; -+ ?> -+ <option value="<?=$iface;?>" <?=$selected;?>> -+ <?=htmlspecialchars($ifacename);?> -+ </option> -+ <?php endforeach; ?> -+ </select> <br> -+ <?=gettext("The interface to which this tap instance will be, " . -+ "bridged. This is not done automatically. You must assign this " . -+ "interface and create the bridge separately. " . -+ "This setting controls which existing IP address and subnet " . -+ "mask are used by OpenVPN for the bridge. Setting this to " . -+ "'none' will cause the Server Bridge DHCP settings below to be ignored."); ?> -+ </td> -+ </tr> -+ <tr id="serverbridge_dhcp_start"> -+ <td width="22%" valign="top" class="vncell"><?=gettext("Server Bridge DHCP Start"); ?></td> -+ <td width="78%" class="vtable"> -+ <input name="serverbridge_dhcp_start" type="text" class="formfld unknown" size="20" value="<?=htmlspecialchars($pconfig['serverbridge_dhcp_start']);?>"> -+ <br> -+ <?=gettext("When using tap mode as multi-point server, " . -+ "you may optionally supply a DHCP range to use on the " . -+ "interface to which this tap instance is bridged. " . -+ "If these settings are left blank, DHCP will be passed " . -+ "through to the LAN, and the interface setting above " . -+ "will be ignored."); ?> -+ </td> -+ </tr> -+ <tr id="serverbridge_dhcp_end"> -+ <td width="22%" valign="top" class="vncell"><?=gettext("Server Bridge DHCP End"); ?></td> -+ <td width="78%" class="vtable"> -+ <input name="serverbridge_dhcp_end" type="text" class="formfld unknown" size="20" value="<?=htmlspecialchars($pconfig['serverbridge_dhcp_end']);?>"> -+ <br> -+ <?=gettext(""); ?> -+ </td> -+ </tr> - <tr id="gwredir_opts"> - <td width="22%" valign="top" class="vncell"><?=gettext("Redirect Gateway"); ?></td> - <td width="78%" class="vtable"> -@@ -1486,6 +1628,7 @@ dns_server_change(); - wins_server_change(); - ntp_server_change(); - netbios_change(); -+tuntap_change(); - //--> - </script> - </body> diff --git a/config/openvpn_tapfix_20x/openvpn_tapfix_20x.xml b/config/openvpn_tapfix_20x/openvpn_tapfix_20x.xml deleted file mode 100644 index ef498545..00000000 --- a/config/openvpn_tapfix_20x/openvpn_tapfix_20x.xml +++ /dev/null @@ -1,70 +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$ */ -/* ========================================================================== */ -/* - openvpn_tapfix_20x.xml - part of pfSense (http://www.pfSense.com) - Copyright (C) 2011 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>OpenVPN tap Bridging Fix</description> - <requirements>pfSense 2.0.x</requirements> - <faq>None</faq> - <name>OpenVPN tap Bridging Fix</name> - <version>0.4</version> - <title>OpenVPN tap Bridging Fix</title> - <include_file>/usr/local/pkg/openvpn_tapfix_20x.inc</include_file> - <additional_files_needed> - <prefix>/usr/local/pkg/</prefix> - <chmod>077</chmod> - <item>https://packages.pfsense.org/packages/config/openvpn_tapfix_20x/openvpn_tapfix_20x.inc</item> - </additional_files_needed> - <additional_files_needed> - <prefix>/usr/local/pkg/</prefix> - <chmod>077</chmod> - <item>https://packages.pfsense.org/packages/config/openvpn_tapfix_20x/openvpn_tapfix_20x.patch</item> - </additional_files_needed> - <additional_files_needed> - <prefix>/usr/local/pkg/</prefix> - <chmod>077</chmod> - <item>https://packages.pfsense.org/packages/config/openvpn_tapfix_20x/openvpn_tapfix_203.patch</item> - </additional_files_needed> - <custom_php_install_command> - openvpn_tapfix_20x_install(); - </custom_php_install_command> -</packagegui> diff --git a/config/quagga_ospfd/quagga_ospfd.xml b/config/quagga_ospfd/quagga_ospfd.xml index 617b5da0..01d67d8a 100644 --- a/config/quagga_ospfd/quagga_ospfd.xml +++ b/config/quagga_ospfd/quagga_ospfd.xml @@ -1,32 +1,70 @@ +<?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$ */ +/* ====================================================================================== */ +/* + quagga_ospfd.xml + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2012-2015 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. +*/ +/* ====================================================================================== */ + ]]> + </copyright> <name>quagga_ospfd</name> - <version>0.6.5</version> + <version>0.6.6</version> <title>Services: Quagga OSPFd</title> <include_file>/usr/local/pkg/quagga_ospfd.inc</include_file> <aftersaveredirect>pkg_edit.php?xml=quagga_ospfd.xml&id=0</aftersaveredirect> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> - <chmod>644</chmod> <item>https://packages.pfsense.org/packages/config/quagga_ospfd/quagga_ospfd.inc</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> - <chmod>644</chmod> <item>https://packages.pfsense.org/packages/config/quagga_ospfd/quagga_ospfd_interfaces.xml</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> - <chmod>644</chmod> <item>http://www.pfsense.com/packages/config/quagga_ospfd/quagga_ospfd_raw.xml</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/</prefix> - <chmod>644</chmod> <item>https://packages.pfsense.org/packages/config/quagga_ospfd/status_ospfd.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/bin/</prefix> - <chmod>777</chmod> + <chmod>755</chmod> <item>https://packages.pfsense.org/packages/config/quagga_ospfd/quaggactl</item> </additional_files_needed> <menu> @@ -76,11 +114,7 @@ <field> <fielddescr>Master Password</fielddescr> <fieldname>password</fieldname> - <description> - <![CDATA[ - Password to access the Zebra and OSPF management daemons. Required. - ]]> - </description> + <description>Password to access the Zebra and OSPF management daemons. Required.</description> <type>input</type> <required/> </field> @@ -101,7 +135,8 @@ <fieldname>routerid</fieldname> <description> <![CDATA[ - Specify the Router ID. RID is the highest logical (loopback) IP address configured on a router. For more information on router identifiers see <a target='_new' href='http://en.wikipedia.org/wiki/Open_Shortest_Path_First'>wikipedia</a>. + Specify the Router ID. RID is the highest logical (loopback) IP address configured on a router.<br /> + For more information on router identifiers see <a href='http://en.wikipedia.org/wiki/Open_Shortest_Path_First'>wikipedia</a>. ]]> </description> <type>input</type> @@ -111,7 +146,8 @@ <fieldname>area</fieldname> <description> <![CDATA[ - OSPFd area for this instance of OSPF. For more information on Areas see <a target='_new' href='http://en.wikipedia.org/wiki/Open_Shortest_Path_First#Area_types'>wikipedia</a>. + OSPFd area for this instance of OSPF.<br /> + For more information on Areas see <a href='http://en.wikipedia.org/wiki/Open_Shortest_Path_First#Area_types'>wikipedia</a>. ]]> </description> <type>input</type> @@ -151,19 +187,29 @@ <field> <fielddescr>SPF Hold Time</fielddescr> <fieldname>spfholdtime</fieldname> - <description>Set the SPF holdtime in MILLIseconds. The minimum time between two consecutive shortest path first calculations. The default value is 5 seconds; the valid range is 1-5 seconds.</description> + <description> + <![CDATA[ + Set the SPF holdtime in <strong>milli</strong>seconds. The minimum time between two consecutive shortest path first calculations.<br /> + The default value is 5 seconds; the valid range is 1-5 seconds. + ]]> + </description> <type>input</type> </field> <field> <fielddescr>SPF Delay</fielddescr> <fieldname>spfdelay</fieldname> - <description>Set SPF delay in MILLIseconds. The delay between receiving an update to the link state database and starting the shortest path first calculation. The default value is 1; valid range is 1-10 seconds.</description> + <description> + <![CDATA[ + Set SPF delay in <strong>milli</strong>seconds. The delay between receiving an update to the link state database and starting the shortest path first calculation.<br /> + The default value is 1; valid range is 1-10 seconds. + ]]> + </description> <type>input</type> </field> <field> <fielddescr>RFC 1583 compatible</fielddescr> <fieldname>rfc1583</fieldname> - <description>If set to yes, decisions regarding AS-external routes are evaluated according to RFC 1583. The default is no.</description> + <description>If set to yes, decisions regarding AS-external routes are evaluated according to RFC 1583. The default is no.</description> <type>checkbox</type> </field> <field> @@ -202,7 +248,12 @@ <field> <fielddescr>CARP Status IP</fielddescr> <fieldname>carpstatusip</fieldname> - <description>IP address used to determine the CARP status. When the VIP is in BACKUP status, quagga will not be started. <br/>NOTE: Requires changes to /etc/rc.carpmaster to start quagga and /etc/rc.carpbackup to stop quagga or it will not be fully effective.</description> + <description> + <![CDATA[ + IP address used to determine the CARP status. When the VIP is in BACKUP status, quagga will not be started.<br /> + NOTE: Requires changes to /etc/rc.carpmaster to start quagga and /etc/rc.carpbackup to stop quagga or it will not be fully effective. + ]]> + </description> <type>input</type> <size>25</size> </field> diff --git a/config/quagga_ospfd/quagga_ospfd_interfaces.xml b/config/quagga_ospfd/quagga_ospfd_interfaces.xml index f9953112..ef594bfd 100644 --- a/config/quagga_ospfd/quagga_ospfd_interfaces.xml +++ b/config/quagga_ospfd/quagga_ospfd_interfaces.xml @@ -1,12 +1,53 @@ +<?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$ */ +/* ====================================================================================== */ +/* + quagga_ospfd_interfaces.xml + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2012-2015 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. +*/ +/* ====================================================================================== */ + ]]> + </copyright> <name>quagga_ospfd_interfaces</name> - <version>0.1</version> + <version>0.6.6</version> <title>Services: Quagga OSPFd</title> <include_file>/usr/local/pkg/quagga_ospfd.inc</include_file> <aftersaveredirect>pkg.php?xml=quagga_ospfd_interfaces.xml</aftersaveredirect> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/quagga_ospfd/quagga_ospfd.inc</item> </additional_files_needed> <menu> @@ -17,23 +58,23 @@ <url>/pkg_edit.php?xml=quagga_ospfd.xml&id=0</url> </menu> <tabs> - <tab> - <text>Global Settings</text> - <url>pkg_edit.php?xml=quagga_ospfd.xml&id=0</url> - </tab> - <tab> - <text>Interface Settings</text> - <url>pkg.php?xml=quagga_ospfd_interfaces.xml</url> - <active/> - </tab> - <tab> - <text>Raw Config</text> - <url>pkg_edit.php?xml=quagga_ospfd_raw.xml&id=0</url> - </tab> - <tab> - <text>Status</text> - <url>/status_ospfd.php</url> - </tab> + <tab> + <text>Global Settings</text> + <url>pkg_edit.php?xml=quagga_ospfd.xml&id=0</url> + </tab> + <tab> + <text>Interface Settings</text> + <url>pkg.php?xml=quagga_ospfd_interfaces.xml</url> + <active/> + </tab> + <tab> + <text>Raw Config</text> + <url>pkg_edit.php?xml=quagga_ospfd_raw.xml&id=0</url> + </tab> + <tab> + <text>Status</text> + <url>/status_ospfd.php</url> + </tab> </tabs> <adddeleteeditpagefields> <columnitem> @@ -87,7 +128,7 @@ <field> <fielddescr>Interface is Passive</fielddescr> <fieldname>passive</fieldname> - <description>Prevent transmission and reception of OSPF packets on this interface. The specified interface will be announced as a stub network.</description> + <description>Prevent transmission and reception of OSPF packets on this interface. The specified interface will be announced as a stub network.</description> <type>checkbox</type> </field> <field> @@ -112,7 +153,10 @@ <fielddescr>Router Priority</fielddescr> <fieldname>routerpriorityelections</fieldname> <description> - Router priority when participating in elections for DR (Default 1) Valid range is 0-255. 0 will cause the router to not participate in election. + <![CDATA[ + Router priority when participating in elections for DR (Default 1)<br /> + Valid range is 0-255. 0 will cause the router to not participate in election. + ]]> </description> <type>input</type> </field> diff --git a/config/quagga_ospfd/quagga_ospfd_raw.xml b/config/quagga_ospfd/quagga_ospfd_raw.xml index b34558de..3b56cc52 100644 --- a/config/quagga_ospfd/quagga_ospfd_raw.xml +++ b/config/quagga_ospfd/quagga_ospfd_raw.xml @@ -1,12 +1,53 @@ +<?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$ */ +/* ====================================================================================== */ +/* + quagga_ospfd_raw.xml + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2012-2015 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. +*/ +/* ====================================================================================== */ + ]]> + </copyright> <name>quagga_ospfd_raw</name> - <version>0.1</version> + <version>0.6.6</version> <title>Services: Quagga OSPFd</title> <include_file>/usr/local/pkg/quagga_ospfd.inc</include_file> <aftersaveredirect>pkg_edit.php?xml=quagga_ospfd_raw.xml&id=0</aftersaveredirect> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> - <chmod>077</chmod> <item>http://www.pfsense.com/packages/config/quagga_ospfd/quagga_ospfd.inc</item> </additional_files_needed> <menu> @@ -17,23 +58,23 @@ <url>/pkg_edit.php?xml=quagga_ospfd.xml&id=0</url> </menu> <tabs> - <tab> - <text>Global Settings</text> - <url>pkg_edit.php?xml=quagga_ospfd.xml&id=0</url> - </tab> - <tab> - <text>Interface Settings</text> - <url>pkg.php?xml=quagga_ospfd_interfaces.xml</url> - </tab> - <tab> - <text>Raw Config</text> - <url>pkg_edit.php?xml=quagga_ospfd_raw.xml&id=0</url> - <active/> - </tab> - <tab> - <text>Status</text> - <url>/status_ospfd.php</url> - </tab> + <tab> + <text>Global Settings</text> + <url>pkg_edit.php?xml=quagga_ospfd.xml&id=0</url> + </tab> + <tab> + <text>Interface Settings</text> + <url>pkg.php?xml=quagga_ospfd_interfaces.xml</url> + </tab> + <tab> + <text>Raw Config</text> + <url>pkg_edit.php?xml=quagga_ospfd_raw.xml&id=0</url> + <active/> + </tab> + <tab> + <text>Status</text> + <url>/status_ospfd.php</url> + </tab> </tabs> <service> <name>Quagga OSPFd</name> @@ -49,7 +90,12 @@ <field> <fielddescr>ospfd.conf</fielddescr> <fieldname>ospfd</fieldname> - <description>Note: Once you click "Save" below, the assistant (in the "Global Settings" and "Interface Settings" tabs above) will be overridden with whatever you type here. To get back the assisted config save this form below once with both empty input fields.</description> + <description> + <![CDATA[ + Note: Once you click "Save" below, the assistant (in the "Global Settings" and "Interface Settings" tabs above) will be overridden with whatever you type here.<br /> + To get back the assisted config save this form below once with both empty input fields. + ]]> + </description> <type>textarea</type> <encoding>base64</encoding> <rows>30</rows> @@ -58,7 +104,12 @@ <field> <fielddescr>zebra.conf</fielddescr> <fieldname>zebra</fieldname> - <description>Note: Once you click "Save" below, the assistant (in the "Global Settings" and "Interface Settings" tabs above) will be overridden with whatever you type here. To get back the assisted config save this form below once with both empty input fields.</description> + <description> + <![CDATA[ + Note: Once you click "Save" below, the assistant (in the "Global Settings" and "Interface Settings" tabs above) will be overridden with whatever you type here.<br /> + To get back the assisted config save this form below once with both empty input fields. + ]]> + </description> <type>textarea</type> <encoding>base64</encoding> <rows>30</rows> diff --git a/config/siproxd/siproxd.xml b/config/siproxd/siproxd.xml index 455fca9c..cca84138 100644 --- a/config/siproxd/siproxd.xml +++ b/config/siproxd/siproxd.xml @@ -4,15 +4,22 @@ <packagegui> <copyright> <![CDATA[ +/* $Id$ */ +/* ====================================================================================== */ /* siproxd.xml + part of pfSense (https://www.pfSense.org/) Copyright (C) 2006 Scott Ullrich Copyright (C) 2010 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. @@ -20,6 +27,7 @@ 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 @@ -31,13 +39,11 @@ 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>siproxdsettings</name> - <version>1.0.3</version> + <version>1.0.5</version> <title>siproxd: Settings</title> <include_file>/usr/local/pkg/siproxd.inc</include_file> <aftersaveredirect>/pkg_edit.php?xml=siproxd.xml&id=0</aftersaveredirect> @@ -69,17 +75,14 @@ </tabs> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/siproxd/siproxdusers.xml</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/siproxd/siproxd.inc</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/siproxd/siproxd_registered_phones.php</item> </additional_files_needed> <fields> @@ -104,7 +107,12 @@ <field> <fielddescr>Listening port</fielddescr> <fieldname>port</fieldname> - <description>Enter the port on which to listen for SIP traffic (default 5060). Do not change this unless you know what you're doing.</description> + <description> + <![CDATA[ + Enter the port on which to listen for SIP traffic (default 5060).<br /> + <strong> WARNING: Do not change this unless you know what you're doing.</strong> + ]]> + </description> <type>input</type> </field> <field> @@ -174,13 +182,23 @@ <field> <fielddescr>TCP inactivity timeout</fielddescr> <fieldname>tcp_timeout</fieldname> - <description>Inactivity timeout (seconds). After that an idling TCP connection is disconnected. NOTE: Making this too short may cause multiple parallel registrations for the same phone. This timeout must be set larger than the used registration interval.</description> + <description> + <![CDATA[ + Inactivity timeout (seconds). After that an idling TCP connection is disconnected.<br /> + NOTE: Making this too short may cause multiple parallel registrations for the same phone. This timeout must be set larger than the used registration interval. + ]]> + </description> <type>input</type> </field> <field> <fielddescr>TCP Connect Timeout</fielddescr> <fieldname>tcp_connect_timeout</fieldname> - <description>Defines How many msecs siproxd will wait for an successful connect when establishing an outgoing SIP signalling connection. This should be kept as short as possible as waiting for an TCP connection to establish is a BLOCKING operation - while waiting for a connect to succeed no SIP messages are processed (RTP is not affected).</description> + <description> + <![CDATA[ + Defines How many msecs siproxd will wait for an successful connect when establishing an outgoing SIP signalling connection.<br /> + This should be kept as short as possible as waiting for an TCP connection to establish is a BLOCKING operation - while waiting for a connect to succeed no SIP messages are processed (RTP is not affected). + ]]> + </description> <type>input</type> </field> <field> @@ -218,14 +236,23 @@ <field> <fielddescr>Expedited RTP Forwarding</fielddescr> <fieldname>expeditedforwarding</fieldname> - <description>This service is designed to allow ISPs to offer a service with attributes similar to a "leased line". This service offers the ULTIMATE IN LOW LOSS, LOW LATENCY AND LOW JITTER by ensuring that there is always sufficient room in output queues for the contracted expedited forwarding traffic. + <description> + <![CDATA[ + This service is designed to allow ISPs to offer a service with attributes similar to a "leased line".<br /> + This service offers the ULTIMATE IN LOW LOSS, LOW LATENCY AND LOW JITTER by ensuring that there is always sufficient room in output queues for the contracted expedited forwarding traffic. + ]]> </description> <type>checkbox</type> </field> <field> <fielddescr>Expedited SIP Forwarding</fielddescr> <fieldname>expeditedsipforwarding</fieldname> - <description>This service is designed to allow ISPs to offer a service with attributes similar to a "leased line". This service offers the ULTIMATE IN LOW LOSS, LOW LATENCY AND LOW JITTER by ensuring that there is always sufficient room in output queues for the contracted expedited forwarding traffic.</description> + <description> + <![CDATA[ + This service is designed to allow ISPs to offer a service with attributes similar to a "leased line".<br /> + This service offers the ULTIMATE IN LOW LOSS, LOW LATENCY AND LOW JITTER by ensuring that there is always sufficient room in output queues for the contracted expedited forwarding traffic. + ]]> + </description> <type>checkbox</type> </field> <field> @@ -257,13 +284,23 @@ <field> <fielddescr>Enable Fix Bogus Via Networks Plugin</fielddescr> <fieldname>plugin_fix_bogus_via</fieldname> - <description>Incoming (from public network) SIP messages are checked for broken SIP Via headers. If the IP address in the latest Via Header is part of the list below, it will be replaced by the IP where the SIP message has been received from.</description> + <description> + <![CDATA[ + Incoming (from public network) SIP messages are checked for broken SIP Via headers.<br /> + If the IP address in the latest Via Header is part of the list below, it will be replaced by the IP where the SIP message has been received from. + ]]> + </description> <type>checkbox</type> </field> <field> <fielddescr>Bogus Via Networks</fielddescr> <fieldname>plugin_fix_bogus_via_networks</fieldname> - <description>Comma separated list of networks which should have their via headers rewritten. Example: 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16</description> + <description> + <![CDATA[ + Comma separated list of networks which should have their via headers rewritten.<br /> + Example: 10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 + ]]> + </description> <type>input</type> </field> <field> @@ -325,7 +362,12 @@ <field> <fielddescr>TCP Debug Port</fielddescr> <fieldname>debug_port</fieldname> - <description>You may connect to this port from a remote machine and receive debug output. This allows better creation of debug output on embedded systems that do not have enough memory for large disk files. Port number 0 means this feature is disabled.</description> + <description> + <![CDATA[ + You may connect to this port from a remote machine and receive debug output. This allows better creation of debug output on embedded systems that do not have enough memory for large disk files.<br /> + NOTE: Port number 0 means this feature is disabled. + ]]> + </description> <type>input</type> </field> </fields> diff --git a/config/siproxd/siproxdusers.xml b/config/siproxd/siproxdusers.xml index 4ed4abc7..7a636a3b 100644 --- a/config/siproxd/siproxdusers.xml +++ b/config/siproxd/siproxdusers.xml @@ -2,51 +2,48 @@ <!DOCTYPE packagegui SYSTEM "./schema/packages.dtd"> <?xml-stylesheet type="text/xsl" href="./xsl/package.xsl"?> <packagegui> - <copyright> - <![CDATA[ + <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. - */ -/* ========================================================================== */ + siproxdusers.xml + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2006 Scott Ullrich + Copyright (C) 2010 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: + 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. - 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. - 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> + 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> <name>siproxdusers</name> - <version>0.5.9</version> + <version>1.0.5</version> <title>siproxd: Users</title> <include_file>/usr/local/pkg/siproxd.inc</include_file> <tabs> @@ -101,4 +98,4 @@ <custom_php_resync_config_command> sync_package_sipproxd_users(); </custom_php_resync_config_command> -</packagegui>
\ No newline at end of file +</packagegui> diff --git a/config/snort/snort.xml b/config/snort/snort.xml index 6c70b39e..e3e1cdad 100755 --- a/config/snort/snort.xml +++ b/config/snort/snort.xml @@ -3,51 +3,50 @@ <?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?> <packagegui> <copyright> - <![CDATA[ + <![CDATA[ /* $Id$ */ -/* ========================================================================== */ +/* ====================================================================================== */ /* - authng.xml - part of pfSense (https://www.pfsense.org) - 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. - */ -/* ========================================================================== */ + snort.xml + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2009-2010 Robert Zelaya + Copyright (C) 2011-2012 Ermal Luçi + Copyright (C) 2013-2015 Bill Meeks + Copyright (C) 2015 Electric Sheep Fencing LP + All rights reserved. +*/ +/* ====================================================================================== */ /* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: + 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. - 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. - 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. - */ -/* ========================================================================== */ - ]]> + 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>Snort IDS/IPS Package</description> - <requirements>None</requirements> - <faq>Currently there are no FAQ items provided.</faq> <name>Snort</name> - <version>2.9.7.3</version> - <title>Services:2.9.7.3 pkg v3.2.6</title> + <version>3.2.6</version> + <title>Services: Snort IDS</title> <include_file>/usr/local/pkg/snort/snort.inc</include_file> <menu> <name>Snort</name> @@ -65,258 +64,206 @@ </tabs> <additional_files_needed> <prefix>/usr/local/pkg/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort.inc</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/pkg/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_check_cron_misc.inc</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/pkg/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_conf_template.inc</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/pkg/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_migrate_config.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/pkg/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_post_install.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/pkg/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_sync.xml</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/pkg/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/deprecated_rules</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_alerts.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_barnyard.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_blocked.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_define_servers.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_download_rules.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_download_updates.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/pkg/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_check_for_rule_updates.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/pkg/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_defs.inc</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_interfaces.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_interfaces_edit.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_interfaces_global.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_rules.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_rules_edit.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_rulesets.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_preprocessors.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_passlist.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_passlist_edit.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_interfaces_suppress.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_interfaces_suppress_edit.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_list_view.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_rules_flowbits.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_edit_hat_data.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_frag3_engine.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_stream5_engine.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_httpinspect_engine.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_ftp_client_engine.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_ftp_server_engine.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_import_aliases.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_select_alias.php</item> </additional_files_needed> <additional_files_needed> <prefix>/etc/inc/priv/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort.priv.inc</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_ip_reputation.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_ip_list_mgmt.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_iprep_list_browser.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_interface_logs.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_log_mgmt.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_sid_mgmt.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/pkg/snort/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_generate_conf.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/widgets/javascript/</prefix> - <chmod>0644</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_alerts.js</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/widgets/widgets/</prefix> - <chmod>0644</chmod> <item>https://packages.pfsense.org/packages/config/snort/snort_alerts.widget.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/widgets/include/</prefix> - <chmod>0644</chmod> <item>https://packages.pfsense.org/packages/config/snort/widget-snort.inc</item> </additional_files_needed> <additional_files_needed> <prefix>/var/db/snort/sidmods/</prefix> - <chmod>0644</chmod> <item>https://packages.pfsense.org/packages/config/snort/disablesid-sample.conf</item> </additional_files_needed> <additional_files_needed> <prefix>/var/db/snort/sidmods/</prefix> - <chmod>0644</chmod> <item>https://packages.pfsense.org/packages/config/snort/enablesid-sample.conf</item> </additional_files_needed> <additional_files_needed> <prefix>/var/db/snort/sidmods/</prefix> - <chmod>0644</chmod> <item>https://packages.pfsense.org/packages/config/snort/modifysid-sample.conf</item> </additional_files_needed> <fields> </fields> - <custom_add_php_command> - </custom_add_php_command> <custom_php_resync_config_command> <![CDATA[ sync_snort_package_config(); diff --git a/config/snort/snort_sync.xml b/config/snort/snort_sync.xml index f3db2ce9..46922822 100755 --- a/config/snort/snort_sync.xml +++ b/config/snort/snort_sync.xml @@ -1,52 +1,50 @@ <?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[ + <copyright> + <![CDATA[ /* $Id$ */ -/* ========================================================================== */ +/* ====================================================================================== */ /* -snortsync.xml -part of pfSense (http://www.pfSense.com) -Copyright (C) 2013 Marcello Coutinho -based on pfblocker_sync.xml -All rights reserved. - -Based on m0n0wall (http://m0n0.ch/wall) -Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>. -All rights reserved. + snort.xml + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2013 Marcello Coutinho + Copyright (C) 2014-2015 Bill Meeks + Copyright (C) 2015 Electric Sheep Fencing LP + All rights reserved. */ -/* ========================================================================== */ +/* ====================================================================================== */ /* -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: + 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. -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. -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. + 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><![CDATA[Describe your package here]]></description> - <requirements>Describe your package requirements here</requirements> - <faq>Currently there are no FAQ items provided.</faq> +/* ====================================================================================== */ + ]]> + </copyright> + <description>Snort: XMLRPC Sync</description> <name>snortsync</name> - <version>1.0</version> + <version>3.2.6</version> <title>Snort: XMLRPC Sync</title> <include_file>/usr/local/pkg/snort/snort.inc</include_file> <tabs> diff --git a/config/suricata/suricata.xml b/config/suricata/suricata.xml index 79189b44..e2c4735c 100644 --- a/config/suricata/suricata.xml +++ b/config/suricata/suricata.xml @@ -1,46 +1,46 @@ <?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$ */ -/* ========================================================================== */ +/* ====================================================================================== */ /* - suricata.xml - part of the Suricata package for pfSense - Copyright (C) 2014 Bill meeks - - All rights reserved. - */ -/* ========================================================================== */ + suricata.xml + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2014-2015 Bill Meeks + All rights reserved. +*/ +/* ====================================================================================== */ /* - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: + 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. - 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. - 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. - */ -/* ========================================================================== */ + 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>Suricata IDS/IPS Package</description> - <requirements>None</requirements> <name>suricata</name> <version>2.0.8 pkg v2.1.6</version> <title>Services: Suricata IDS</title> @@ -60,259 +60,205 @@ <additional_files_needed> <item>https://packages.pfsense.org/packages/config/suricata/suricata.priv.inc</item> <prefix>/etc/inc/priv/</prefix> - <chmod>077</chmod> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/suricata/suricata.inc</item> <prefix>/usr/local/pkg/suricata/</prefix> - <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/suricata/suricata_sync.xml</item> <prefix>/usr/local/pkg/suricata/</prefix> - <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/suricata/suricata_check_cron_misc.inc</item> <prefix>/usr/local/pkg/suricata/</prefix> - <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/suricata/suricata_check_for_rule_updates.php</item> <prefix>/usr/local/pkg/suricata/</prefix> - <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/suricata/suricata_yaml_template.inc</item> <prefix>/usr/local/pkg/suricata/</prefix> - <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/suricata/suricata_generate_yaml.php</item> <prefix>/usr/local/pkg/suricata/</prefix> - <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/suricata/suricata_migrate_config.php</item> <prefix>/usr/local/pkg/suricata/</prefix> - <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/suricata/suricata_post_install.php</item> <prefix>/usr/local/pkg/suricata/</prefix> - <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/suricata/suricata_uninstall.php</item> <prefix>/usr/local/pkg/suricata/</prefix> - <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/suricata/suricata_defs.inc</item> <prefix>/usr/local/pkg/suricata/</prefix> - <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/suricata/suricata_geoipupdate.php</item> <prefix>/usr/local/pkg/suricata/</prefix> - <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/suricata/suricata_etiqrisk_update.php</item> <prefix>/usr/local/pkg/suricata/</prefix> - <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/suricata/deprecated_rules</item> <prefix>/usr/local/pkg/suricata/</prefix> - <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/suricata/suricata_download_updates.php</item> <prefix>/usr/local/www/suricata/</prefix> - <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/suricata/suricata_global.php</item> <prefix>/usr/local/www/suricata/</prefix> - <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/suricata/suricata_alerts.php</item> <prefix>/usr/local/www/suricata/</prefix> - <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/suricata/suricata_interfaces.php</item> <prefix>/usr/local/www/suricata/</prefix> - <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/suricata/suricata_interfaces_edit.php</item> <prefix>/usr/local/www/suricata/</prefix> - <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/suricata/suricata_download_rules.php</item> <prefix>/usr/local/www/suricata/</prefix> - <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/suricata/suricata_rules.php</item> <prefix>/usr/local/www/suricata/</prefix> - <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/suricata/suricata_rulesets.php</item> <prefix>/usr/local/www/suricata/</prefix> - <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/suricata/suricata_rules_flowbits.php</item> <prefix>/usr/local/www/suricata/</prefix> - <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/suricata/suricata_rules_edit.php</item> <prefix>/usr/local/www/suricata/</prefix> - <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/suricata/suricata_flow_stream.php</item> <prefix>/usr/local/www/suricata/</prefix> - <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/suricata/suricata_os_policy_engine.php</item> <prefix>/usr/local/www/suricata/</prefix> - <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/suricata/suricata_import_aliases.php</item> <prefix>/usr/local/www/suricata/</prefix> - <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/suricata/suricata_suppress.php</item> <prefix>/usr/local/www/suricata/</prefix> - <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/suricata/suricata_suppress_edit.php</item> <prefix>/usr/local/www/suricata/</prefix> - <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/suricata/suricata_logs_browser.php</item> <prefix>/usr/local/www/suricata/</prefix> - <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/suricata/suricata_logs_mgmt.php</item> <prefix>/usr/local/www/suricata/</prefix> - <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/suricata/suricata_sid_mgmt.php</item> <prefix>/usr/local/www/suricata/</prefix> - <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/suricata/suricata_list_view.php</item> <prefix>/usr/local/www/suricata/</prefix> - <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/suricata/suricata_app_parsers.php</item> <prefix>/usr/local/www/suricata/</prefix> - <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/suricata/suricata_libhtp_policy_engine.php</item> <prefix>/usr/local/www/suricata/</prefix> - <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/suricata/suricata_define_vars.php</item> <prefix>/usr/local/www/suricata/</prefix> - <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/suricata/suricata_barnyard.php</item> <prefix>/usr/local/www/suricata/</prefix> - <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/suricata/suricata_ip_list_mgmt.php</item> <prefix>/usr/local/www/suricata/</prefix> - <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/suricata/suricata_ip_reputation.php</item> <prefix>/usr/local/www/suricata/</prefix> - <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <item>https://packages.pfsense.org/packages/config/suricata/suricata_iprep_list_browser.php</item> <prefix>/usr/local/www/suricata/</prefix> - <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/widgets/javascript/</prefix> - <chmod>0644</chmod> <item>https://packages.pfsense.org/packages/config/suricata/suricata_alerts.js</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/widgets/widgets/</prefix> - <chmod>0644</chmod> <item>https://packages.pfsense.org/packages/config/suricata/suricata_alerts.widget.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/widgets/include/</prefix> - <chmod>0644</chmod> <item>https://packages.pfsense.org/packages/config/suricata/widget-suricata.inc</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/suricata/</prefix> - <chmod>0644</chmod> <item>https://packages.pfsense.org/packages/config/suricata/suricata_blocked.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/suricata/</prefix> - <chmod>0644</chmod> <item>https://packages.pfsense.org/packages/config/suricata/suricata_passlist.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/suricata/</prefix> - <chmod>0644</chmod> <item>https://packages.pfsense.org/packages/config/suricata/suricata_passlist_edit.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/suricata/</prefix> - <chmod>0644</chmod> <item>https://packages.pfsense.org/packages/config/suricata/suricata_select_alias.php</item> </additional_files_needed> <additional_files_needed> <prefix>/var/db/suricata/sidmods/</prefix> - <chmod>0644</chmod> <item>https://packages.pfsense.org/packages/config/suricata/disablesid-sample.conf</item> </additional_files_needed> <additional_files_needed> <prefix>/var/db/suricata/sidmods/</prefix> - <chmod>0644</chmod> <item>https://packages.pfsense.org/packages/config/suricata/enablesid-sample.conf</item> </additional_files_needed> <additional_files_needed> <prefix>/var/db/suricata/sidmods/</prefix> - <chmod>0644</chmod> <item>https://packages.pfsense.org/packages/config/suricata/modifysid-sample.conf</item> </additional_files_needed> <!-- configpath gets expanded out automatically and config items will be stored in that location --> <configpath>['installedpackages']['suricata']</configpath> - <tabs> - </tabs> - <fields> - </fields> <custom_php_install_command> <![CDATA[ include_once("/usr/local/pkg/suricata/suricata_post_install.php"); diff --git a/config/test_package/test.inc b/config/test_package/test.inc new file mode 100644 index 00000000..292f8d44 --- /dev/null +++ b/config/test_package/test.inc @@ -0,0 +1,40 @@ +<?php +/* + test.inc + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2009 John Doe + Copyright (C) 2010-2012 Jane Roe + Copyright (C) 2014 Johnnie Doe + 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. +*/ +function sync_package_test() { + // Put your own code to execute on package reconfiguration here +} + +function sync_package_test_reinstall() { + // Put your code to execute on package (re)install here +} + +?> diff --git a/config/test_package/test_package.php b/config/test_package/test_package.php deleted file mode 100644 index 8d68cf39..00000000 --- a/config/test_package/test_package.php +++ /dev/null @@ -1,14 +0,0 @@ -<?php - -/* DISABLE_PHP_LINT_CHECKING */ - -class CommitTest { - function __construct() { - } - - public function testFunction() { - } -} - - -?>
\ No newline at end of file diff --git a/config/test_package/test_package.xml b/config/test_package/test_package.xml index 3e268fee..b073dba5 100644 --- a/config/test_package/test_package.xml +++ b/config/test_package/test_package.xml @@ -2,212 +2,165 @@ <!DOCTYPE packagegui SYSTEM "../schema/packages.dtd"> <?xml-stylesheet type="text/xsl" href="../xsl/package.xsl"?> <packagegui> - <copyright> - <![CDATA[ + <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. - */ -/* ========================================================================== */ + test_package.xml + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2009 John Doe + Copyright (C) 2010-2012 Jane Roe + Copyright (C) 2014 Johnnie Doe + 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: + 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. + 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. + 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. - */ -/* ========================================================================== */ - ]]> + + 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>Snort</name> - <version>2.6.0.2</version> - <title>Services: Snort</title> - <include_file>/usr/local/pkg/snort.inc</include_file> + <description>Describe your package here</description> + <requirements>Describe your package requirements here</requirements> + <faq>Currently there are no FAQ items provided.</faq> + <name>Test</name> + <version>1.0</version> + <title>Services: Test</title> + <include_file>/usr/local/pkg/test.inc</include_file> <menu> - <name>Snort</name> - <tooltiptext>Setup snort specific settings</tooltiptext> + <name>Test</name> + <tooltiptext>Setup test specific settings</tooltiptext> <section>Services</section> - <url>/pkg_edit.php?xml=snort.xml&id=0</url> + <url>/pkg_edit.php?xml=test_package.xml&id=0</url> </menu> <service> - <name>snort</name> - <rcfile>snort.sh</rcfile> - <executable>snort</executable> + <name>test</name> + <rcfile>test.sh</rcfile> + <executable>test</executable> </service> <tabs> <tab> - <text>Snort Settings</text> - <url>/pkg_edit.php?xml=snort.xml&id=0</url> + <text>Test Settings</text> + <url>/pkg_edit.php?xml=test_package.xml&id=0</url> <active/> </tab> <tab> - <text>Update Snort Rules</text> - <url>/snort_download_rules.php</url> - </tab> - <tab> - <text>Snort Rulesets</text> - <url>/snort_rulesets.php</url> - </tab> - <tab> - <text>Snort Blocked</text> - <url>/snort_blocked.php</url> + <text>Update Test Rules</text> + <url>/test_download_rules.php</url> </tab> <tab> - <text>Snort Whitelist</text> - <url>/pkg.php?xml=snort_whitelist.xml</url> + <text>Test Whitelist</text> + <url>/pkg.php?xml=test_whitelist.xml</url> </tab> <tab> - <text>Snort Alerts</text> - <url>/snort_alerts.php</url> + <text>Test Alerts</text> + <url>/test_alerts.php</url> </tab> </tabs> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> - <chmod>077</chmod> - <item>https://packages.pfsense.org/packages/config/snort/snort.inc</item> + <item>https://packages.pfsense.org/packages/config/test/test.inc</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/bin/</prefix> - <chmod>077</chmod> - <item>https://packages.pfsense.org/packages/config/snort/bin/snort2c</item> + <item>https://packages.pfsense.org/packages/config/test/bin/test</item> + <chmod>0755</chmod> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/</prefix> - <chmod>077</chmod> - <item>https://packages.pfsense.org/packages/config/snort/snort_download_rules.php</item> - </additional_files_needed> - <additional_files_needed> - <prefix>/usr/local/www/</prefix> - <chmod>077</chmod> - <item>https://packages.pfsense.org/packages/config/snort/snort_rulesets.php</item> - </additional_files_needed> - <additional_files_needed> - <prefix>/usr/local/pkg/</prefix> - <chmod>077</chmod> - <item>https://packages.pfsense.org/packages/config/snort/snort_whitelist.xml</item> + <item>https://packages.pfsense.org/packages/config/test/test_download_rules.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/</prefix> - <chmod>077</chmod> - <item>https://packages.pfsense.org/packages/config/snort/snort_blocked.php</item> + <item>https://packages.pfsense.org/packages/config/test/test_alerts.php</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> - <chmod>077</chmod> - <item>https://packages.pfsense.org/packages/config/snort/snort_check_for_rule_updates.php</item> - </additional_files_needed> - <additional_files_needed> - <prefix>/usr/local/www/</prefix> - <chmod>077</chmod> - <item>https://packages.pfsense.org/packages/config/snort/snort_alerts.php</item> - </additional_files_needed> - <additional_files_needed> - <prefix>/usr/local/pkg/pf/</prefix> - <chmod>077</chmod> - <item>https://packages.pfsense.org/packages/config/snort/snort_dynamic_ip_reload.php</item> + <item>https://packages.pfsense.org/packages/config/test/test_whitelist.xml</item> </additional_files_needed> <fields> <field> - <fielddescr>Interface</fielddescr> - <fieldname>iface_array</fieldname> - <description>Select all WAN type interfaces</description> + <fielddescr>Test Interface</fielddescr> + <fieldname>interfaces</fieldname> + <description>Select all LAN type interfaces</description> <type>interfaces_selection</type> <size>3</size> <value>lan</value> <multiple>true</multiple> + <required>true</required> </field> <field> <fielddescr>Performance</fielddescr> <fieldname>performance</fieldname> - <description>ac method is the fastest startup but consumes more a lot more memory. acs/ac-banded and ac-sparsebands/mwm/lowmem methods use quite a bit less.</description> + <description>Snail is slowest, warp is fastest.</description> <type>select</type> <options> <option> - <name>lowmem</name> - <value>lowmem</value> + <name>Snail</name> + <value>snailvalue</value> </option> <option> - <name>ac-std</name> - <value>ac-std</value> + <name>Low</name> + <value>lowvalue</value> </option> <option> - <name>ac</name> - <value>ac</value> + <name>Standard</name> + <value>stdvalue</value> </option> <option> - <name>ac-banded</name> - <value>ac-banded</value> + <name>Fast</name> + <value>fastvalue</value> </option> <option> - <name>ac-sparsebands</name> - <value>ac-sparsebands</value> - </option> - - <option> - <name>mwm</name> - <value>mwm</value> - </option> - <option> - <name>acs</name> - <value>acs</value> + <name>Warp</name> + <value>warpvalue</value> </option> </options> </field> <field> - <fielddescr>Oinkmaster code</fielddescr> - <fieldname>oinkmastercode</fieldname> - <description>Obtain a snort.org Oinkmaster code and paste here.</description> - <type>input</type> - <size>60</size> - <value></value> - </field> - <field> - <fielddescr>Block offenders</fielddescr> - <fieldname>blockoffenders</fieldname> - <description>Automatically block hosts that generate a snort alert.</description> + <fielddescr>Generate alerts</fielddescr> + <fieldname>testalerts</fieldname> + <description>Automatically generate alerts.</description> <type>checkbox</type> <size>60</size> </field> <field> <fielddescr>Update rules automatically</fielddescr> <fieldname>automaticrulesupdate</fieldname> - <description>Automatically check for and update rules once a week from snort.org.</description> + <description>Automatically check for and update rules once a week from example.org.</description> <type>checkbox</type> </field> </fields> <custom_add_php_command> - sync_package_snort(); + sync_package_test(); </custom_add_php_command> <custom_php_resync_config_command> - sync_package_snort(); + sync_package_test(); </custom_php_resync_config_command> <custom_php_install_command> - sync_package_snort_reinstall(); + sync_package_test_reinstall(); </custom_php_install_command> -</packagegui>
\ No newline at end of file +</packagegui> diff --git a/config/widescreen/bin/all.css_ b/config/widescreen/bin/all.css_ deleted file mode 100644 index d11dedca..00000000 --- a/config/widescreen/bin/all.css_ +++ /dev/null @@ -1,1413 +0,0 @@ -/* Element CSS Definitions */ -html, body, td, th, input, select { - font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; - font-size: 0.9em; - -} - -.infobox { - width:100%; -} - -.infoboxsave { - padding-right: 10px; -} - -.infoboxnptd2 { - width:100%; - color:white; - background-color:#990000; - padding-right: 10px; -} - -.infoboxnptd { - width:8%; - background-color:#990000; -} - -.infoboxnptable { - height:32px; - width:100%; - background-color:#990000; -} - -.infoboxnptable2 { - height:32px; - width:100%; - background-color:#990000; -} - -.infoboxnp { - background-color:#990000; - width:100%; -} - -.infoboxnpimg { - vertical-align:middle; - width:28px; - height:32px; - background-color:#990000; -} - -.inputerrorsleft { - background-color: #990000; - width: 36px; -} - -.inputerrorsright { - background-color: #FFD9D1; - color: #000000; - font-size: 11px; - padding-left: 8px; - padding-top: 6px; -} - -div.GraphLink { - position: relative; -} - -span.GraphLinkLine { - position: absolute; - background-color: #990000; - width: 100%; -} - -/* DOM Tooltip CSS definitions */ -div.niceTitle -{ - background-color: #333333; - color: #FFFFFF; - font-weight: bold; - font-size: 13px; - font-family: "Trebuchet MS", sans-serif; - width: 220px; - left: 0; - top: 0; - padding: 4px; - position: absolute; - text-align: left; - z-index: 20; - -moz-border-radius: 0 10px 10px 10px; - filter: progid:DXImageTransform.Microsoft.Alpha(opacity=87); - -moz-opacity: .87; - -khtml-opacity: .87; - opacity: .87; -} -div.niceTitle h1 -{ - background: #990000; - border-bottom: 1px dotted #FFFFFF; - font-weight: bold; - font-size: 13px; - font-family: "Trebuchet MS", sans-serif; - margin: 3px; - padding-top: 1px; - padding-bottom: 1px; - padding-left: 3px; - text-align: left; - left: 0; - top: 0; - -moz-border-radius: 0 8px 0 0; - -moz-opacity: 1; -} -div.niceTitle .contents -{ - margin: 0; - padding: 0 3px; - filter: progid:DXImageTransform.Microsoft.Alpha(opacity=100); - -moz-opacity: 1; - -khtml-opacity: 1; - opacity: 1; -} -div.niceTitle p -{ - background: #FFFFFF; - border: 1px solid #990000; - color: #000000; - font-size: 11px; - font-family: "Trebuchet MS", sans-serif; - padding: 5px; - margin: 3px; - text-align: left; - -moz-opacity: 1; - -moz-border-radius: 0 0 8px 8px; -} - -body { - margin: 0px auto; - align: left; - background: url('images/background.jpg') no-repeat; - background-position : left 0px; - background-attachment: fixed; - background-color: #7f7f7f; -} -a:link { - color: #550000; -} - -a:visited { - color: #550000; -} - -a:active { - color: #550000; -} - -a:hover { - color: #550000; -} - -form { - margin: 0px; -} -a { - text-decoration: none; -} -form input { - font-size: 1.1em; -} - -iframe { - z-index: 1; - border: 1px dashed #990000; -} -.iframe { - background-color: #FFFFFF; -} - -/* style of disabled formelements */ -#wrap div {margin:1em 0} -[disabled] { - color:#666666; - background:#eeeeee; -} - -/* ID Based CSS Definitions */ -/* margin: 0px auto makes the content centered, margin 0px 0px makes it aligned to the left */ -#wrapper { -/*+++ width: 810px;*/ - width: 100%; - margin: 0px 0px; -/* left: 0px; */ -} - -#header { - background: url('images/header.png') no-repeat; - background-position: 0px; - height: 40px; - min-width: 910px; -/*+++ width: 810px;*/ - width: 100%; - position: fixed; - left: 0; - margin-bottom: 5px; - z-index: 1; -} -#header-left { - position: relative; -/* background: url('images/logo.gif') no-repeat;*/ - background-position: center; - height: 40px; - width: 80px; - left: 0px; - top:0px; - float: left; -} -#header-leftright { -/*+++ position: relative;*/ - position: absolute; - background: url('images/header-mid.png') repeat-x; - background-position: center; - height: 40px; - left: 900px; - right:0; - top:0px; - z-index: 2; /*+++*/ -} -#header-left #status-link { - position: relative; - top: 0px; - left: 0px; -} -#header-right { -/*+++ position: relative;*/ - position: absolute; - /* background: url('images/header.gif') no-repeat; */ - height: 70px; - color: #fff; -/*+++ left: 0px;*/ -/* margin-left: 165px; +++*/ -/* left: -300px;*/ - right: 0px; - width: 400px; - z-index: 2;/*+++*/ -} -#header-right .alert { - position: relative; - /* background: url('images/alert.gif') no-repeat; */ - background-position: 4px 2px; - color: #fff; - height: 17px; - width: 500px; - padding: 4px; - padding-left: 27px; - float: left; -} -#header-right .container { -/*+++ position: relative;*/ - postition: absolute; -} -#header-right .container .left { -/*+++ position: relative; */ - position: absolute; - float: left; - font-size: 1.3em; - font-weight: bold; - top: 15px; - left: 4px; - display: none; -} -#header-right .container .right { -/*+++ position: relative;*/ - position: absolute; - float: right; - top: 22px; - padding-right: 4px; - z-index: 1; -} - -/* for forcing an alert run the following command from diagnostics>command, php command: -file_notice("blah", "blah blah...testing my new theme..."); -*/ - -#header-right .container .right #alerts { - position: fixed; - background: url('images/alert_bgr.png') no-repeat; - height: 40px; - width: 400px; - top: 0px; - left: 810px; - z-index: 2; - padding-top: 1px; - padding-left: 10px; - margin: 0px; -} - -#header-right .container .right #hostname { -/*+++ position: fixed;*/ - position: absolute; - background: url('images/hostname.png') no-repeat; - height: 40px; - width: 400px; - z-index: 1; - padding-right: 5px; - margin: 0px; -/*+++ top: 0px;*/ - top: -22px; -/*+++ left: 810px;*/ - left: 0px; /*+++*/ - font-size: 12px; - color: #000000; - font-weight: bold; - padding-left: 40px; - padding-top: 2px; - text-align: left; -} - - - - -table#marquee { - position: relative; - top: -4px; - left: 15px; - border: 0; - padding: 0; - margin: 0; - width: 350px; - background-color: transparent; - padding: 2px; - border: 0px; -} -span#marquee-container { - position: absolute; - visibility: hidden; - top: -100px; - left: -10000px; -} -div#marquee-text { -/* font-size: 1.18em; - font-weight: normal; - font-family: Verdana; - color: #ffffff; */ - font-size: 12px; - font-weight: normal; - font-style: italic; - color: #000000; -} -table#marquee div#container { - position: relative; - overflow: hidden; - width: 330px; - height: 16px; -} -table#marquee div#container div#scroller { - position: absolute; - left: 0px; - top: 0px; -} - - - - - -#content { - position: relative; - top: 0px; -/*+++ left: 75px; */ - left: 10%; - margin-top: 0px; - margin-left: 0px; - padding-top: 50px; -/*+++ padding-left: 20px;*/ - padding-left: 20px; -/*+++ width: 840px; */ - width: 80%; - min-width: 900px; - background-color: #ffffff; -/*+++ background-color: #009900;*/ -/*+++ background: url('images/horizontal.png') repeat-y;*/ -} - - -/* try to abuse left as a fadeout at the end of the page */ -/*+++ #left {*/ -/*+++ width: 810px; */ -/* width: 100%; - height: 1px; -}*/ -#left { - position: absolute; - top: 0; - width: 20px; - height: 100%; - left: -20px; - background: url('images/horiz-left.png') repeat-y; -} -#right { - position: relative; -/*+++ top: -10px;*/ - top: 10px; - left: 0px; -/*+++ width: 770px;*/ - width: 100%; - margin-top: 0px; -/*+++ margin-left: 5px;*/ - margin-right: 5px; - padding-top: 20px; -/*+++ padding-left: 10px;*/ -/*+++ padding-right: 10px;*/ - padding-bottom: 90px; - min-height: 400px; -/*+++ background-color: #000099; */ -} -#right-right { - position: absolute; - top: 0px; - right: -20px; - width: 20px; - height: 100%; - background: url('images/horiz-right.png') repeat-y; -} - -#footer { - position: absolute; -/* margin-bottom: 5px; */ -/*+++ background: url('images/footer.png') no-repeat;*/ -/* top: -100px; */ -/*+++ bottom: 0px;*/ -/*+++ left: 75px;*/ - left: 10%; -/*+++ width: 840px;*/ - width: 80%; - min-width: 900px; - height: 60px; - color: #000000; - text-align: center; - font-size: 0.9em; -/*+++ padding-top: 10px;*/ -/*+++ padding-left: 10px;*/ -/*+++ clear: both;*/ -} -#footer-left { - position: absolute; - left: -20px; - width: 30px; - height: 80px; - background: url('images/footer-left.png') no-repeat; -} -#footer-center { - position: absolute; - left: 10px; - width: 100%; - height: 80px; - background: url('images/footer-middle.png') repeat-x; -} -#footer-right { - position: absolute; - right: -40px; - width: 30px; - height: 80px; - background: url('images/footer-right.png') no-repeat; -} -#footer p { - padding: 0px; - margin: 0px; - -} - -/* Style the List */ -#navigation { - /* background: url('images/menu.gif') no-repeat; */ - /* width: 693px; */ -/* position: relative;*/ - position: fixed; - top: 0px; - left: 100px; - width: 810px; - padding: 0px; - height: 28px; - z-index: 1000; - -} -#navigation ul { - padding: 0; - margin: 0; - list-style: none; - text-align: center; -} -#navigation ul#menu { - padding-top: 3px; - padding-left: 5px; -} - -/* Style the List Elements */ -#navigation ul li { - float: left; - position: relative; - width: 7.0em; - top: 0px; - /* top: -1px; */ -} -/* Text mainmenubar */ -#navigation ul li div { - - background-image: url(images/mainmenu-right.gif); - background-position: 5% 50%; - background-repeat: no-repeat; - padding-top:0px; - font-size: 12px; - font-weight: normal; - color: #ffffff; - text-align: center; - height: 13px; - - - - -/* -background: url("images/mainmenuitem.gif") top left no-repeat; -vertical-align: top; -border: 0px; -width: 100px; -height:20px; -*/ - - -} -/* Make the List inside the List Elements */ -/* initially hidden with absolute position */ -#navigation ul li ul { - display: none; - position: absolute; -/* top: 2em; - left: -2px; */ - width: 120px; - font-weight: normal; -/* background: transparent bottom left no-repeat; /* This is key to making the menu maintain visibility when not on a link */ - /* background-color: #202020; */ - background: url("images/menubgr_footer.png") no-repeat; - background-position: bottom; -/* padding: 0em 0 0.4em 0; */ - padding-top: 5px; - padding-bottom: 10px; -} -/* to override top and left in browsers other than IE */ -/* which will position to the top right of the containing */ -/* li, rather than bottom left */ -#navigation ul li > ul { - top: auto; - left: auto; - left: -1px !important; -} -/* Show initial drop down upon mouse over, but do not show */ -/* nested side drop menus within listed elements */ -#navigation ul li:hover ul { - display: block; - cursor: pointer; -} -#navigation ul li:hover { - cursor: pointer; - cursor: pointer; -} -#navigation ul li:hover div { - text-decoration: none; - background-image: url(images/mainmenu-down.gif); - background-position: 5% 50%; - background-repeat: no-repeat; - -} - -#navigation ul li { - background-color: transparent; - color: #000000; -} -/* dropdownmenu */ -#navigation ul li ul li { - border: 0px solid #850000; - width: 120px; - height: 1.6em; - line-height: 1.6em; -/* background-color: #850000; */ - background: url(images/menubgr.png) repeat-y; - z-index: 2; -/* color: #000000; */ -/* filter:alpha(opacity=95); - -moz-opacity:0.95; - -khtml-opacity: 0.95; - opacity: 0.95; */ -} -#navigation ul li ul li:hover { -/* background-color: #666666; */ - background-image: url(images/menubgr_highlight.png); - background-repeat: repeat-y; -} - -/* textcolor in dropdownmenu */ -#navigation li li a { - display: block; - padding-left: 8px; - padding-right: 8px; - color: #ffffff; - font-size: 11px; - font-weight: normal; - text-align: left; -/* - background-image: url(images/menu-dot.gif); - background-position: 0% 50%; - background-repeat: no-repeat; -*/ -} - -#navigation ul li ul li a.navlnk:hover { - text-decoration: none; -} -#navigation ul li.first { - border-right: 0px; -} -#navigation ul li.middle { - border-right: 0px; -} -#navigation ul li.last { - -} - -#navigation ul li.dropfirst { - border-bottom: 0px; -} -#navigation ul li.dropmiddle { - border-bottom: 0px; -} -#navigation ul li.droplast { -} - -#wzdtabcont { - float: left; - background-color: #FFFFFF; - color: #000000; - padding: 0; -} - -ul#wzdnav { - font-size: 0.96em; - float: left; - width: 14.5em; - margin: 0; - padding-left: 18px; -} - -ul#wzdnav li { - list-style: none; - margin: 0; - padding-bottom: 0.2em; - padding-left: 0; -} - -ul#wzdnav a { - display: block; - padding: 0.3em; - font-weight: normal; -} - -#wzdnavbold a { - display: block; - padding: 0.3em; - font-weight: bold ! important; -} - -ul#wzdnav a:link { - color: black; - background-color: #eee; -} - -ul#wzdnav a:visited { - color: #666; - background-color: #eee; -} - -ul#wzdnav a:hover { - color: black; - background-color: white; -} - -ul#wzdnav a:active { - color: white; - background-color: gray; -} - -#graph { - position: relative; - z-index: 1; -} - -#logoutbtn { - position: absolute; - left: 95%; - vertical-align: middle; -} - -/* Class Based CSS Definitions */ -.pgtitle { - font-size: 18px; - color: #777777; - font-weight: bold; -} -.tfrtitle { - font-size: 18px; - color: #ffffff; - font-weight: bold; -} -.vncell { - background-color: #DDDDDD; - padding-right: 20px; - padding-left: 8px; - border-bottom: 1px solid #999999; -} -.formfld { - padding-left: 19px; - font-size: small; -} -.formselect { - font-size: 1.0em; -} -.langopt { - padding-left: 34px; - padding-top: 2px; - padding-bottom: 2px; -} -.saved { - /* background: url('/themes/nione/images/icons/icon_wzd_saved.png') no-repeat 0 1px #FFFFFF; */ - list-style-image: url('/themes/nervecenter/images/icons/icon_wzd_saved.png') ! important; -} -.notsaved { - /* background: url('/themes/nione/images/icons/icon_wzd_nsaved.png') no-repeat 0 1px #FFFFFF; */ - list-style-image: url('/themes/nervecenter/images/icons/icon_wzd_nsaved.png') ! important; -} -.en { - background: url('/themes/nervecenter/images/icons/icon_flag_en.png') no-repeat 0 1px #FFFFFF; -} -.de { - background: url('/themes/nervecenter/images/icons/icon_flag_de.png') no-repeat 0 1px #FFFFFF; -} -.es { - background: url('/themes/nervecenter/images/icons/icon_flag_es.png') no-repeat 0 1px #FFFFFF; -} -.pt_BR { - background: url('/themes/nervecenter/images/icons/icon_flag_pt_BR.png') no-repeat 0 1px #FFFFFF; -} -.host { - background: url('/themes/nervecenter/images/icons/icon_frmfld_host.png') no-repeat 0 1px #FFFFFF; -} -.search { - background: url('/themes/nervecenter/images/icons/icon_frmfld_search.png') no-repeat 0 1px #FFFFFF; -} -.file { - background: url('/themes/nervecenter/images/icons/icon_frmfld_file.png') no-repeat 0 1px #FFFFFF; -} -.mail { - background: url('/themes/nervecenter/images/icons/icon_frmfld_mail.png') no-repeat 0 1px #FFFFFF; -} -.imp { - background: url('/themes/nervecenter/images/icons/icon_frmfld_imp.png') no-repeat 0 1px #FFFFFF; -} -.pwd { - background: url('/themes/nervecenter/images/icons/icon_frmfld_pwd.png') no-repeat 0 1px #FFFFFF; -} -.user { - background: url('/themes/nervecenter/images/icons/icon_frmfld_user.png') no-repeat 0 1px #FFFFFF ; -} -.group { - background: url('/themes/nervecenter/images/icons/icon_frmfld_group.png') no-repeat 0 1px #FFFFFF; -} -.url { - background: url('/themes/nervecenter/images/icons/icon_frmfld_url.png') no-repeat 0 1px #FFFFFF; -} -.time { - background: url('/themes/nervecenter/images/icons/icon_frmfld_time.png') no-repeat 0 1px #FFFFFF; -} -.unknown { - background: url('/themes/nervecenter/images/icons/icon_frmfld_unknown.png') no-repeat 0 1px #FFFFFF; -} -.formfld_cert { - background: url('/themes/nervecenter/images/icons/icon_frmfld_cert.png') no-repeat 0 1px #FFFFFF; - padding-left: 28px; - font-family: Courier New, Courier, monospaced; - font-size: 11px; -} -.formfldalias { - background-color: #990000; - color: #FFFFFF; -} -.formpre { - font-family: Courier New, Courier, monospaced; - font-size: 10px; -} -.formbtn { - font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; - font-size: 13px; - font-weight: bold; -} -.formbtns { - font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; - font-size: 10px; - font-weight: bold; -} -.vvcell { - background-color: #FFFFC6; -} -.errmsg { - font-weight: bold; - color: #CC0000; -} -.red { - color: #CC0000; -} -.gray { - color: #A0A0A0; -} -.vexpl { - font-size: 11px; -} -.navlnk { - color: #FFFFFF; - text-decoration: none; - font-size: 13px; -} -.navlnks { - color: #FFFFFF; - text-decoration: none; - font-size: 11px; -} -.redlnk { - color: #990000; - text-decoration: none; -} -.tblnk { - color: #FFFFFF; - text-decoration: none; -} -.vncellreq { - background-color: #DDDDDD; - padding-right: 20px; - padding-left: 8px; - font-weight: bold; - border-bottom: 1px solid #999999; -} -.vncellt { - background-color: #DDDDDD; - padding-right: 20px; - padding-left: 8px; - padding-top: 4px; - padding-bottom: 4px; - font-weight: bold; - border-bottom: 1px solid #999999; -} -.vtable { - border-bottom: 1px solid #999999; -} -.vnsepcell { - background-color: #BBBBBB; - padding-right: 20px; - padding-left: 8px; - font-weight: bold; - border-bottom: 1px solid #999999; - font-size: 11px; -} -.cpline { - font-size: 11px; - color: #FFFFFF; -} -.hostname { - font-size: 11px; - color: #990000; - font-weight: bold; -} -.vnsepcellr { - background-color: #BBBBBB; - padding-right: 20px; - padding-left: 8px; - font-weight: bold; - border-right: 1px solid #999999; - border-bottom: 1px solid #999999; - font-size: 11px; -} -.listrborder { - background-color: #FFFFFF; - border-right: 1px solid #999999; - border-left: 1px solid #999999; - border-bottom: 1px solid #999999; - font-size: 11px; - padding-right: 6px; - padding-left: 6px; - padding-top: 4px; - padding-bottom: 4px; -} -.listr { - background-color: #FFFFFF; - border-right: 1px solid #999999; - border-bottom: 1px solid #999999; - font-size: 11px; - padding-right: 6px; - padding-left: 6px; - padding-top: 4px; - padding-bottom: 4px; -} -.listrpad { - border-right: 1px solid #999999; - border-bottom: 1px solid #999999; - font-size: 11px; - padding-right: 16px; - padding-left: 10px; - padding-top: 8px; - padding-bottom: 8px; -} -.listn { - font-size: 11px; - padding-right: 16px; - padding-left: 6px; - padding-top: 4px; - padding-bottom: 4px; -} -.listbg { - border-right: 1px solid #999999; - border-bottom: 1px solid #999999; - font-size: 11px; - color: #FFFFFF; - background-color: #990000; - padding-right: 16px; - padding-left: 6px; - padding-top: 4px; - padding-bottom: 4px; -} -.listbggrey { - border-right: 1px solid #999999; - border-bottom: 1px solid #999999; - font-size: 11px; - background-color: #999999; - padding-right: 16px; - padding-left: 6px; - padding-top: 4px; - padding-bottom: 4px; -} -.listhdr { - background-color: #BBBBBB; - padding-right: 16px; - padding-left: 6px; - font-weight: bold; - border-bottom: 1px solid #999999; - font-size: 11px; - padding-top: 5px; - padding-bottom: 5px; -} -.listhdr a { - color: #000000; -} -.listhdrr { - background-color: #BBBBBB; - padding-right: 16px; - padding-left: 6px; - font-weight: bold; - border-right: 1px solid #999999; - border-bottom: 1px solid #999999; - font-size: 11px; - padding-top: 5px; - padding-bottom: 5px; -} -.listhdrr a { - color: #000000; -} -.listlr { - background-color: #FFFFFF; - border-right: 1px solid #999999; - border-bottom: 1px solid #999999; - border-left: 1px solid #999999; - font-size: 11px; - padding-right: 6px; - padding-left: 6px; - padding-top: 4px; - padding-bottom: 4px; -} -.listlrns { - background-color: #FFFFFF; - border-right: 1px solid #999999; - border-bottom: 1px solid #999999; - border-left: 1px solid #999999; - font-size: 11px; - padding-top: 4px; - padding-bottom: 4px; -} -.list { - font-size: 11px; - padding-left: 6px; - padding-top: 2px; - padding-bottom: 2px; -} -.listt { - font-size: 11px; - padding-top: 5px; -} -.listhdrrns { - background-color: #BBBBBB; - padding-left: 6px; - padding-top: 5px; - padding-bottom: 5px; - padding-right: 6px; - font-weight: bold; - border-right: 1px solid #999999; - border-bottom: 1px solid #999999; - font-size: 11px; -} -.listbgns { - border-right: 1px solid #999999; - border-bottom: 1px solid #999999; - font-size: 11px; - background-color: #D9DEE8; - padding-left: 6px; - padding-right: 4px; - padding-top: 4px; - padding-bottom: 4px; -} -.listtopic { - border-right: 1px solid #999999; - font-size: 11px; - background-color: #990000; - padding-right: 16px; - padding-left: 6px; - color: #FFFFFF; - font-weight: bold; - padding-top: 5px; - padding-bottom: 5px; -} - -.optsect_t { - border-right: 1px solid #999999; - background-color: #990000; - padding-right: 6px; - padding-left: 6px; - padding-top: 2px; - padding-bottom: 2px; -} -.optsect_s { - font-size: 11px; - color: #FFFFFF; - font-weight: bold; -} -.tabnavtbl { -} - - -/* MISC CSS Definitions */ -ul#tabnav { - font-size: 11px; - font-weight: bold; - list-style-type: none; - margin: 0; - padding: 0; -} -ul#tabnav li.tabinact1 { - float: left; - background-color: #777777; - color: #FFFFFF; - padding: 0; - white-space: nowrap; -} -ul#tabnav li.tabinact { - float: left; - border-left: 1px solid #999999; - background-color: #777777; - color: #FFFFFF; - padding: 0; - white-space: nowrap; -} -ul#tabnav li.tabinact a { - float: left; - display: block; - text-decoration: none; - padding: 5px 8px 5px 8px; - color: #FFFFFF; -} -ul#tabnav li.tabinact1 a { - float: left; - display: block; - text-decoration: none; - padding: 5px 8px 5px 8px; - color: #FFFFFF; -} -ul#tabnav li.tabact { - float: left; - background-color: #EEEEEE; - color: #000000; - padding: 5px 8px 5px 8px; - white-space: nowrap; -} -.tabcont { - background-color: #DDDDDD; - padding-right: 12px; - padding-left: 12px; - padding-top: 12px; - padding-bottom: 12px; -} -.tabact { - float: left; - background-color: #EEEEEE; - color: #000000; - padding: 5px 8px 5px 8px; - white-space: nowrap; -} -.tabinact { - font-weight: bold; - float: left; - border-left: 1px solid #999999; - background-color: #777777; - color: #FFFFFF; - padding: 0; - white-space: nowrap; -} -.menu { - background-color: #000000; - white-space: nowrap; - padding: 0px 5px 0px 5px; - width: 100%; - vertical-align: top; -} - -/* style of disabled formelements */ -[disabled] { - color:#666666; - background:#eeeeee; -} - - -/* Auto Complete Suggestions */ -div.suggestions { - -moz-box-sizing: border-box; - /* box-sizing: border-box; */ - border: 1px solid black; - position: absolute; - background-color: #990000; - color: #FFF; -} - -div.suggestions div { - cursor: default; - padding: 0px 3px; - background-color: #990000; - color: #FFF; -} - -div.suggestions div.current { - background-color: #3366cc; - color: #FFF; -} -/* End Auto Complete Suggestions */ - - -/* Nifty Corners Crap */ -.rtop,.artop{display:block} -.rtop *,.artop *{display:block;height:1px;overflow:hidden;font-size:1px} -.artop *{border-style: solid;border-width:0 1px} -.r1,.rl1,.re1,.rel1{margin-left:5px} -.r1,.rr1,.re1,.rer1{margin-right:5px} -.r2,.rl2,.re2,.rel2,.ra1,.ral1{margin-left:3px} -.r2,.rr2,.re2,.rer2,.ra1,.rar1{margin-right:3px} -.r3,.rl3,.re3,.rel3,.ra2,.ral2,.rs1,.rsl1,.res1,.resl1{margin-left:2px} -.r3,.rr3,.re3,.rer3,.ra2,.rar2,.rs1,.rsr1,.res1,.resr1{margin-right:2px} -.r4,.rl4,.rs2,.rsl2,.re4,.rel4,.ra3,.ral3,.ras1,.rasl1,.res2,.resl2{margin-left:1px} -.r4,.rr4,.rs2,.rsr2,.re4,.rer4,.ra3,.rar3,.ras1,.rasr1,.res2,.resr2{margin-right:1px} -.rx1,.rxl1{border-left-width:5px} -.rx1,.rxr1{border-right-width:5px} -.rx2,.rxl2{border-left-width:3px} -.rx2,.rxr2{border-right-width:3px} -.re2,.rel2,.ra1,.ral1,.rx3,.rxl3,.rxs1,.rxsl1{border-left-width:2px} -.re2,.rer2,.ra1,.rar1,.rx3,.rxr3,.rxs1,.rxsr1{border-right-width:2px} -.rxl1,.rxl2,.rxl3,.rxl4,.rxsl1,.rxsl2,.ral1,.ral2,.ral3,.ral4,.rasl1,.rasl2{border-right-width:0} -.rxr1,.rxr2,.rxr3,.rxr4,.rxsr1,.rxsr2,.rar1,.rar2,.rar3,.rar4,.rasr1,.rasr2{border-left-width:0} -.r4,.rl4,.rr4,.re4,.rel4,.rer4,.ra4,.rar4,.ral4,.rx4,.rxl4,.rxr4{height:2px} -.rer1,.rel1,.re1,.res1,.resl1,.resr1{border-width:1px 0 0;height:0px !important;height /**/:1px} -/* End Nifty Corners Crap */ - - - -/* CSS for Dynamic Log Viewer */ -/* Author: Erik Kristensen */ -div#log div.log-entry { - clear: both; -} - -div#log div.log-entry span, -div#log div.log-header span { - padding: 3px 2px 3px 2px; - padding-left: 8px; -} - -div#log div.log-entry span.log-action { - padding-bottom: 6px; - padding-left: 5px; - padding-right: 5px; -} - -div#log div.log-header span { - border-top: 1px solid #999; - background-color: #bbb; - font-weight: bold; - text-align: left; -} - -div#log span.log-action, -div#log span.log-time, -div#log span.log-interface, -div#log span.log-source, -div#log span.log-destination, -div#log span.log-protocol { - float: left; - text-align: left; - border-left: 1px solid #999; - border-bottom: 1px solid #999; - -} - -div#log span.log-general { - -} - -div#log span.log-protocol { - border-right: 1px solid #999; -} - -div#log span.log-action { - width: 2em; - text-align: center; -} - -div#log span.log-time { - width: 12.5em; -} - -div#log span.log-interface { - width: 5em; -} - -div#log span.log-source, -div#log span.log-destination { - width: 17.6em; -} - -div#log span.log-protocol { - width: 5.5em; -} -/* END CSS FOR DYNAMIC LOG VIEWER */ - -#login { - background: #cccccc; - border: 0px solid #666666; - margin: 5em auto; - padding: 0em; - width: 340px; -} - -#login h1 { - background: url(images/misc/logon.png) no-repeat top left; - margin-top: 0; - display: block; - text-indent: -1000px; - height: 50px; - border-bottom: none; -} - -#login p { - font-size: 1em; - font-weight: bold; - padding: 3px; - margin: 0em; - text-indent: 10px; -} - -#login span { - font-size: 1em; - font-weight: bold; - width: 20%; - padding: 3px; - margin: 0em; - text-indent: 10px; -} - -#login p#text { - font-size: 1em; - font-weight: normal; - padding: 3px; - margin: 0em; - text-indent: 10px; -} - -#login #username, #password, #password2 { - font-size: small; - width: 60%; - padding-left:19px - padding: 3px; - margin: 0em; -} - -#login #submit { - font-size: 1em; - font-weight: bold; - padding: 3px; - margin: 0em; - text-indent: 10px; -} - -/* Widget CSS */ -.widgetsubheader { - border-right: 1px solid #999999; - font-size: 11px; - background-color: #B1B1B1; - padding-right: 6px; - padding-left: 6px; - color: #000000; - font-weight: bold; - padding-top: 5px; - padding-bottom: 5px; -} -.widgetheader { - border-right: 1px solid #999999; - font-size: 11px; - background-color: #990000; - padding-right: 6px; - padding-left: 6px; - color: #FFFFFF; - font-weight: bold; - padding-top: 5px; - padding-bottom: 5px; -} -.widgetdiv{ - margin-top:5px; - padding: 5px; - background:#CCCCCC; -} -.widgetconfigdiv{ - background:#BBBBBB; - font-size: 11px; - color: #000000; - padding-right: 5px; - padding-left: 5px; - padding-top: 5px; - padding-bottom: 5px; -} - -div#log div.log-entry-mini { - clear: both; -} - -div#log div.log-entry-mini span { - padding: 2px 2px 2px 2px; - padding-left: 8px; -} - -div#log span.log-action-mini-header, -div#log span.log-interface-mini-header, -div#log span.log-source-mini-header, -div#log span.log-destination-mini-header, -div#log span.log-protocol-mini-header { - float: left; - text-align: left; - background-color: #B1B1B1; - font-size: 12px; - border-left: 1px solid #999; - border-bottom: 1px solid #999; -} - -div#log span.log-action-mini, -div#log span.log-time-mini, -div#log span.log-interface-mini, -div#log span.log-source-mini, -div#log span.log-destination-mini, -div#log span.log-protocol-mini { - float: left; - text-align: left; - background-color: #FFFFFF; - font-size: 11px; - border-left: 1px solid #999; - border-bottom: 1px solid #999; -} - -div#log span.log-action-mini, -div#log span.log-action-mini-header { - width: 6%; -} - -div#log span.log-interface-mini, -div#log span.log-interface-mini-header { - width: 8%; -} - -div#log span.log-source-mini, -div#log span.log-destination-mini, -div#log span.log-source-mini-header, -div#log span.log-destination-mini-header { - width: 31%; -} - -div#log span.log-protocol-mini, -div#log span.log-protocol-mini-header { - width: 8%; - border-right: 1px solid #999; -} - -/* Sortable tables */ -table.sortable thead { - cursor: default; - background-color: #EEEEEE; - padding-right: 12px; - padding-left: 12px; - padding-top: 12px; - padding-bottom: 12px; -} diff --git a/config/widescreen/bin/fbegin.inc_ b/config/widescreen/bin/fbegin.inc_ deleted file mode 100644 index 73f26aaa..00000000 --- a/config/widescreen/bin/fbegin.inc_ +++ /dev/null @@ -1,430 +0,0 @@ -<script src="/javascript/sorttable.js"></script> - -<?php -/* - pfSense_MODULE: header -*/ - -require_once("globals.inc"); -require_once("functions.inc"); - -/* $Id$ */ - - -/* Determine automated help URL. Should output the page name and - parameters separately */ -$uri_split = ""; -preg_match("/\/(.*)\?(.*)/", $_SERVER["REQUEST_URI"], $uri_split); - -/* If there was no match, there were no parameters, just grab the filename - Otherwise, use the matched filename from above. */ -if (empty($uri_split[0])) { - $pagename = ltrim($_SERVER["REQUEST_URI"], '/'); -} else { - $pagename = $uri_split[1]; -} -/* If the page name is still empty, the user must have requested / (index.php) */ -if (empty($pagename)) { - $pagename = "index.php"; -} - -/* If the filename is pkg_edit.php or wizard.php, reparse looking - for the .xml filename */ -if (($pagename == "pkg.php") || ($pagename == "pkg_edit.php") || ($pagename == "wizard.php")) { - $param_split = explode('&', $uri_split[2]); - foreach ($param_split as $param) { - if (substr($param, 0, 4) == "xml=") { - $xmlfile = explode('=', $param); - $pagename = $xmlfile[1]; - } - } -} - -/* Build the full help URL. */ -$helpurl .= "{$g['help_base_url']}?page={$pagename}"; - -function return_ext_menu($section) { - global $config; - $htmltext = ""; - $extarray = array(); - if($config['installedpackages']['menu'] <> "") { - foreach($config['installedpackages']['menu'] as $menuitem) { - if($menuitem['section'] != $section) continue; - if($menuitem['url'] <> "") { - $addresswithport = getenv("HTTP_HOST"); - $colonpos = strpos($addresswithport, ":"); - if ($colonpos !== False){ - //my url is actually just the IP address of the pfsense box - $myurl = substr($addresswithport, 0, $colonpos); - } else { - $myurl = $addresswithport; - } - $description = str_replace('$myurl', $myurl, $menuitem['url']); - } else { - $description = '/pkg.php?xml=' . $menuitem['configfile']; - } - $extarray[] = array($menuitem['name'], $description); - } - } - return $extarray; -} - -function output_menu($arrayitem, $target="") { - foreach($arrayitem as $item) { - if($target) - $targetinfo = "target='{$target}'"; - echo '<li><a ' . $targetinfo. ' href="' . $item[1] . '" class="navlnk">' . $item[0] . '</a></li>' . "\n"; - } -} - -// System -$system_menu = array(); -$system_menu[] = array("Advanced", "/system_advanced_admin.php"); -$system_menu[] = array("Firmware", "/system_firmware.php"); -$system_menu[] = array("General Setup", "/system.php"); -$system_menu[] = array("Logout", "/index.php?logout"); -if ($g['platform'] == "pfSense" or $g['platform'] == "nanobsd") - $system_menu[] = array("Packages", "/pkg_mgr_installed.php"); -$system_menu[] = array("Setup Wizard", "/wizard.php?xml=setup_wizard.xml"); -$system_menu[] = array("Routing", "/system_gateways.php"); -$system_menu[] = array("Cert Manager", "/system_camanager.php"); -$system_menu[] = array("User Manager", "/system_usermanager.php"); -$system_menu = msort(array_merge($system_menu, return_ext_menu("System")),0); - -// Interfaces -$interfaces_menu = array(); -if (!isset($config['system']['webgui']['noassigninterfaces'])) - $interfaces_menu[] = array("(assign)", "/interfaces_assign.php"); -$opts = get_configured_interface_with_descr(false, true); -foreach ($opts as $oif => $odescr) - if (!isset($config['interfaces'][$oif]['ovpn'])) - $interfaces_menu[] = array(htmlspecialchars($odescr), "/interfaces.php?if={$oif}"); -$interfaces_menu = msort(array_merge($interfaces_menu, return_ext_menu("Interfaces")),0); - -// Firewall -$firewall_menu = array(); -$firewall_menu[] = array("Aliases", "/firewall_aliases.php"); -$firewall_menu[] = array("NAT", "/firewall_nat.php"); -$firewall_menu[] = array("Rules", "/firewall_rules.php"); -$firewall_menu[] = array("Schedules", "/firewall_schedule.php"); -$firewall_menu[] = array("Traffic Shaper", "/firewall_shaper.php"); -$firewall_menu[] = array("Virtual IPs", "/firewall_virtual_ip.php"); -$firewall_menu = msort(array_merge($firewall_menu, return_ext_menu("Firewall")),0); - -// Services -$services_menu = array(); -$services_menu[] = array("Captive Portal", "/services_captiveportal.php"); -$services_menu[] = array("DNS Forwarder", "/services_dnsmasq.php"); -$services_menu[] = array("DHCP Relay", "/services_dhcp_relay.php"); -if($g['services_dhcp_server_enable']) - $services_menu[] = array("DHCP Server", "/services_dhcp.php"); -$services_menu[] = array("Dynamic DNS", "/services_dyndns.php"); -$services_menu[] = array("IGMP proxy", "/services_igmpproxy.php"); -$services_menu[] = array("Load Balancer", "/load_balancer_pool.php"); -$services_menu[] = array("OLSR", "/pkg_edit.php?xml=olsrd.xml&id=0"); -$services_menu[] = array("PPPoE Server", "/vpn_pppoe.php"); -$services_menu[] = array("RIP", "/pkg_edit.php?xml=routed.xml&id=0"); -$services_menu[] = array("SNMP", "/services_snmp.php"); -if(count($config['interfaces']) > 1) { - /* no use for UPnP in single-interface deployments - remove to reduce user confusion - */ - $services_menu[] = array("UPnP & NAT-PMP", "/pkg_edit.php?xml=miniupnpd.xml&id=0"); -} -$services_menu[] = array("OpenNTPD", "/pkg_edit.php?xml=openntpd.xml&id=0"); -$services_menu[] = array("Wake on LAN", "/services_wol.php"); -$services_menu = msort(array_merge($services_menu, return_ext_menu("Services")),0); - -// VPN -$vpn_menu = array(); -$vpn_menu[] = array("IPsec", "/vpn_ipsec.php"); -$vpn_menu[] = array("OpenVPN", "/vpn_openvpn_server.php"); -$vpn_menu[] = array("PPTP", "/vpn_pptp.php"); -$vpn_menu[] = array("L2TP", "/vpn_l2tp.php"); -$vpn_menu = msort(array_merge($vpn_menu, return_ext_menu("VPN")),0); - -// Status -$status_menu = array(); -if (isset($config['captiveportal']['enable'])) - $status_menu[] = array("Captive Portal", "/status_captiveportal.php"); -$status_menu[] = array("CARP (failover)", "/carp_status.php"); -$status_menu[] = array("Dashboard", "/index.php"); -$status_menu[] = array("Gateways", "/status_gateways.php"); -$status_menu[] = array("DHCP Leases", "/status_dhcp_leases.php"); -$status_menu[] = array("Filter Reload", "/status_filter_reload.php"); -$status_menu[] = array("Interfaces", "/status_interfaces.php"); -$status_menu[] = array("IPsec", "/diag_ipsec.php"); -$status_menu[] = array("Load Balancer", "/status_lb_pool.php"); -$status_menu[] = array("OpenVPN", "/status_openvpn.php"); -if ($g['platform'] == "pfSense") - $status_menu[] = array("Package Logs", "/diag_pkglogs.php"); -$status_menu[] = array("Queues", "/status_queues.php"); -$status_menu[] = array("RRD Graphs", "/status_rrd_graph.php"); -$status_menu[] = array("Services", "/status_services.php"); -$status_menu[] = array("System Logs", "/diag_logs.php"); -$status_menu[] = array("Traffic Graph", "/status_graph.php?if=wan"); -if(count($config['interfaces']) > 1) - $status_menu[] = array("UPnP & NAT-PMP", "/status_upnp.php"); -$ifentries = get_configured_interface_with_descr(); -foreach ($ifentries as $ent => $entdesc) { - if (is_array($config['interfaces'][$ent]['wireless']) && - preg_match($g['wireless_regex'], $config['interfaces'][$ent]['if'])) - $ifdescrs[$ent] = $entdesc; -} -if (count($ifdescrs) > 0) - $status_menu[] = array("Wireless", "/status_wireless.php"); -$status_menu = msort(array_merge($status_menu, return_ext_menu("Status")),0); - -// Diagnostics -$diagnostics_menu = array(); -$diagnostics_menu[] = array("ARP Tables", "/diag_arp.php"); -$diagnostics_menu[] = array("Authentication", "/diag_authentication.php"); -$diagnostics_menu[] = array("Backup/Restore", "/diag_backup.php"); -$diagnostics_menu[] = array("Command Prompt", "/exec.php"); -$diagnostics_menu[] = array("DNS Lookup", "/diag_dns.php"); -$diagnostics_menu[] = array("Edit File", "/edit.php"); -$diagnostics_menu[] = array("Factory Defaults", "/diag_defaults.php"); -$diagnostics_menu[] = array("Halt System", "/halt.php" ); -$diagnostics_menu[] = array("Limiter Info", "/diag_limiter_info.php"); -$diagnostics_menu[] = array("NDP Table", "/diag_ndp.php"); -$diagnostics_menu[] = array("Ping", "/diag_ping.php"); -$diagnostics_menu[] = array("pfInfo", "/diag_pf_info.php"); -$diagnostics_menu[] = array("pfTOP", "/diag_system_pftop.php"); -$diagnostics_menu[] = array("Reboot", "/reboot.php"); -$diagnostics_menu[] = array("Routes", "/diag_routes.php"); -$diagnostics_menu[] = array("SMART Status", "/diag_smart.php"); -$diagnostics_menu[] = array("States", "/diag_dump_states.php"); -$diagnostics_menu[] = array("States Summary", "/diag_states_summary.php"); -$diagnostics_menu[] = array("System Activity", "/diag_system_activity.php"); -$diagnostics_menu[] = array("Tables", "/diag_tables.php"); -$diagnostics_menu[] = array("Traceroute", "/diag_traceroute.php"); -$diagnostics_menu[] = array("Packet Capture", "/diag_packet_capture.php"); -if($g['platform'] == "nanobsd") - $diagnostics_menu[] = array("NanoBSD", "/diag_nanobsd.php"); - -if (isset($config['system']['developer'])) { - echo "<li><hr width=\"80%\"/></li>"; - $diagnostics_menu[] = array("Restart HTTPD", "/restart_httpd.php"); -} -$diagnostics_menu = msort(array_merge($diagnostics_menu, return_ext_menu("Diagnostics")),0); - -if(! $g['disablehelpmenu']) { - $help_menu = array(); - $help_menu[] = array("About this Page", $helpurl); - $help_menu[] = array("User Forum", "https://www.pfsense.org/j.php?jumpto=forum"); - $help_menu[] = array("Documentation", "https://www.pfsense.org/j.php?jumpto=doc"); - $help_menu[] = array("Developers Wiki", "https://www.pfsense.org/j.php?jumpto=devwiki"); - $help_menu[] = array("Paid Support", "https://www.pfsense.org/j.php?jumpto=portal"); - $help_menu[] = array("pfSense Book", "https://www.pfsense.org/j.php?jumpto=book"); - $help_menu[] = array("Search portal", "https://www.pfsense.org/j.php?jumpto=searchportal"); - $help_menu[] = array("FreeBSD Handbook", "https://www.pfsense.org/j.php?jumpto=fbsdhandbook"); - $help_menu = msort(array_merge($help_menu, return_ext_menu("Help")),0); -} - -/* NOTICE ACKNOWLEDGE CODE by Erik Kristensen */ -if ($_REQUEST['noticeaction'] == 'acknowledge') { - $notice_id = htmlspecialchars($_REQUEST['noticeid']); - close_notice($notice_id); -} -/**********************************************/ - -?> - -<div id="wrapper"> - <div id="header"> - <div id="header-left"><a href="index.php" id="status-link"><img src="/themes/<?= $g['theme']; ?>/images/transparent.gif" border="0"></a></div> - <div id="header-leftright"> - <div id="header-right"> - <div class="container"> - <div class="left">webConfigurator</div> - <div class="right"> - -<? - if (are_notices_pending()) { - $notices = get_notices(); - - $requests=array(); - - ## Get Query Arguments from URL ### - foreach ($_REQUEST as $key => $value) { - if ($key != "PHPSESSID") - $requests[] = $key.'='.$value; - } - if(is_array($requests)) - $request_string = implode("&", $requests); - - if(is_array($notices)) { - foreach ($notices as $key => $value) { - $date = date("m-d-y H:i:s", $key); - $noticemsg = str_replace("'", "", $value['notice']); - $noticemsg = str_replace('"', "", $noticemsg); - $noticemsg = str_replace("\n", "", $noticemsg); - $noticemsg = str_replace("<p>", "", $noticemsg); - $noticemsg = str_replace("<pre>", "", $noticemsg); - $noticemsg = str_replace("</pre>", "", $noticemsg); - $noticemsg = str_replace("</p>", "", $noticemsg); - $noticemsg = str_replace("<br>", "", $noticemsg); - $extra_args = ""; - if($_GET['xml']) - $extraargs="&xml=" . htmlspecialchars($_GET['xml']); - if($_POST['xml']) - $extraargs="&xml=" . htmlspecialchars($_POST['xml']); - if($_GET['id']) - $extraargs="&xml=" . htmlspecialchars($_GET['id']); - if($_POST['id']) - $extraargs="&xml=" . htmlspecialchars($_POST['id']); - $notice_msgs = '<a href="?noticeaction=acknowledge¬iceid=all' . $extraargs . '">Acknowledge All</a> .:. '; - if ($value['url']) { - $notice_msgs .= $date.' - <a href="'.$url.'?' . htmlspecialchars($request_string) . '¬iceaction=acknowledge¬iceid='.$key.'">['.$value['id'].']</a>'; - } else { - $notice_msgs .= $date.' - <a href="?' . htmlspecialchars($request_string) . '¬iceaction=acknowledge¬iceid='.$key.'">['.$value['id'].']'.htmlspecialchars($noticemsg).'</a>'; - } - $notice_msgs .= " .:. "; - } - } -?> - <div id="alerts"> - <script type="text/javascript"> - var content='<div id="marquee-text"><?= $notice_msgs; ?></div>' - </script> - <script type="text/javascript" src="/javascript/ticker.js"></script> - </div> -<? - } else { -?> - <div id="hostname"> - <? print $config['system']['hostname'] . "." . $config['system']['domain']; ?> - </div> -<? - } -?> - </div> - </div> - </div> - </div> - <div id="navigation" style="z-index:1000"> - <ul id="menu"> - <li class="firstdrop"> - <div>System</div> - <ul class="subdrop"> - <?php - output_menu($system_menu); - ?> - </ul> - </li> - <li class="drop"> - <div>Interfaces</div> - <ul class="subdrop"> - <?php - output_menu($interfaces_menu); - ?> - </ul> - </li> - <li class="drop"> - <div>Firewall</div> - <ul class="subdrop"> - <?php - output_menu($firewall_menu); - ?> - </ul> - </li> - <li class="drop"> - <div>Services</div> - <ul class="subdrop"> - <? - output_menu($services_menu); - ?> - </ul> - </li> - <li class="drop"> - <div>VPN</div> - <ul class="subdrop"> - <?php - output_menu($vpn_menu); - ?> - </ul> - </li> - <li class="drop"> - <div>Status</div> - <ul class="subdrop"> - <?php - output_menu($status_menu); - ?> - </ul> - </li> - <li class="drop"> - <div>Diagnostics</div> - <ul id="diag" class="subdrop"> - <? - output_menu($diagnostics_menu); - ?> - </ul> - </li> - <?php if(! $g['disablehelpmenu']): ?> - <li class="lastdrop"> - <div>Help</div> - <ul id="help" class="subdrop"> - <? - output_menu($help_menu, "_new"); - ?> - </ul> - </li> - <?php endif; ?> - </ul> - </div> - </div> <!-- Header DIV --> - <div id="content"> - <div id="left"> - </div> <!-- Left DIV --> - - <div id="right"> - -<?php - - /* display a top alert bar if need be */ - $need_alert_display = false; - $found_notices = are_notices_pending(); - if($found_notices == true) { - $notices = get_notices(); - if(!$notices) { - $need_alert_display = true; - $display_text = print_notices() . "<br>"; - } - } - if($need_alert_display == true) { - echo "<div style=\"background-color:#000000\" id=\"roundalert\">"; - echo "<table>"; - echo "<tr><td><font color=\"#ffffff\">"; - echo " <img align=\"middle\" src=\"/top_notification.gif\"> "; - echo $display_text; - echo "</td>"; - echo "</tr>"; - echo "</table>"; - echo "</div>"; - } - -function add_to_menu($url, $name) { - if (isAllowedPage($url)) - echo "<li><a href=\"{$url}\" class=\"navlnk\">{$name}</a></li>\n"; -} -?> - -<div> -<span class="pgtitle"><a href="<?= $_SERVER['SCRIPT_NAME'] ?>"><?=genhtmltitle($pgtitle);?></a></span> -<span style="float:right; margin: 0 0 20px 20px;"> -<?php if(! empty($statusurl)): ?> -<a href="<?php echo $statusurl; ?>" target="_new" title="Status of items on this page."><img src="/themes/<?php echo $g['theme']; ?>/images/status.png" border="0"></a> -<?php endif; ?> -<?php if(! empty($logurl)): ?> -<a href="<?php echo $logurl; ?>" target="_new" title="Log entries for items on this page."><img src="/themes/<?php echo $g['theme']; ?>/images/log.png" border="0"></a> -<?php endif; ?> -<?php if(! $g['disablehelpicon']): ?> -<a href="<?php echo $helpurl; ?>" target="_new" title="Help for items on this page."><img src="/themes/<?php echo $g['theme']; ?>/images/help.png" border="0"></a> -<?php endif; ?> -</span> -</div> -<br /> - -<?php - $pgtitle_output = true; -?> diff --git a/config/widescreen/bin/fend.inc_ b/config/widescreen/bin/fend.inc_ deleted file mode 100644 index 1eb3ada8..00000000 --- a/config/widescreen/bin/fend.inc_ +++ /dev/null @@ -1,23 +0,0 @@ -<!-- - pfSense_MODULE: footer ---> - - </div> <!-- Right DIV --> - <div id="right-right"> - </div> - </div> <!-- Content DIV --> - - <div id="footer"> - <div id="footer-left"></div> - <div id="footer-center"> - <a target="_blank" href="<?=$g['product_website_footer']?>" class="redlnk"><?=$g['product_name']?></a> is © - <?=$g['product_copyright_years']?> by <a href="<?=$g['product_copyright_url']?>" class="tblnk"><?=$g['product_copyright']?></a>. All Rights Reserved. - [<a href="/license.php" class="tblnk">view license</a>] - </div> - <div id="footer-right"></div> - </div> <!-- Footer DIV --> - -</div> <!-- Wrapper Div --> - -<?php outputJavaScriptFileInline("/usr/local/www/themes/{$g['theme']}/bottom-loader.js"); ?> - diff --git a/config/widescreen/bin/footer-left.png b/config/widescreen/bin/footer-left.png Binary files differdeleted file mode 100644 index 7c068c21..00000000 --- a/config/widescreen/bin/footer-left.png +++ /dev/null diff --git a/config/widescreen/bin/footer-middle.png b/config/widescreen/bin/footer-middle.png Binary files differdeleted file mode 100644 index 2176e741..00000000 --- a/config/widescreen/bin/footer-middle.png +++ /dev/null diff --git a/config/widescreen/bin/footer-right.png b/config/widescreen/bin/footer-right.png Binary files differdeleted file mode 100644 index 33169290..00000000 --- a/config/widescreen/bin/footer-right.png +++ /dev/null diff --git a/config/widescreen/bin/header-mid.png b/config/widescreen/bin/header-mid.png Binary files differdeleted file mode 100644 index 93963c65..00000000 --- a/config/widescreen/bin/header-mid.png +++ /dev/null diff --git a/config/widescreen/bin/horiz-left.png b/config/widescreen/bin/horiz-left.png Binary files differdeleted file mode 100644 index 8f772a4f..00000000 --- a/config/widescreen/bin/horiz-left.png +++ /dev/null diff --git a/config/widescreen/bin/horiz-right.png b/config/widescreen/bin/horiz-right.png Binary files differdeleted file mode 100644 index edacbc23..00000000 --- a/config/widescreen/bin/horiz-right.png +++ /dev/null diff --git a/config/widescreen/bin/index.php_ b/config/widescreen/bin/index.php_ deleted file mode 100644 index a6ad1019..00000000 --- a/config/widescreen/bin/index.php_ +++ /dev/null @@ -1,775 +0,0 @@ -<?php -/* $Id$ */ -/* - index.php - Copyright (C) 2004, 2005 Scott Ullrich - All rights reserved. - - Originally part of m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2004 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. -*/ -/* - pfSense_BUILDER_BINARIES: /sbin/ifconfig - pfSense_MODULE: interfaces -*/ - -##|+PRIV -##|*IDENT=page-system-login/logout -##|*NAME=System: Login / Logout page / Dashboard -##|*DESCR=Allow access to the 'System: Login / Logout' page and Dashboard. -##|*MATCH=index.php* -##|-PRIV - -// Turn on buffering to speed up rendering -ini_set('output_buffering','true'); - -// Start buffering with a cache size of 100000 -ob_start(null, "1000"); - -## Load Essential Includes -require_once('functions.inc'); -require_once('guiconfig.inc'); -require_once('notices.inc'); - -##build list of widgets -$directory = "/usr/local/www/widgets/widgets/"; -$dirhandle = opendir($directory); -$filename = ""; -$widgetnames = array(); -$widgetfiles = array(); -$widgetlist = array(); - -while (false !== ($filename = readdir($dirhandle))) { - $periodpos = strpos($filename, "."); - $widgetname = substr($filename, 0, $periodpos); - $widgetnames[] = $widgetname; - if ($widgetname != "system_information") - $widgetfiles[] = $filename; -} - -##sort widgets alphabetically -sort($widgetfiles); - -##insert the system information widget as first, so as to be displayed first -array_unshift($widgetfiles, "system_information.widget.php"); - -##if no config entry found, initialize config entry -if (!is_array($config['widgets'])) { - $config['widgets'] = array(); -} - - if ($_POST && $_POST['submit']) { - $config['widgets']['sequence'] = $_POST['sequence']; - - foreach ($widgetnames as $widget){ - if ($_POST[$widget . '-config']){ - $config['widgets'][$widget . '-config'] = $_POST[$widget . '-config']; - } - } - - write_config(gettext("Widget configuration has been changed.")); - header("Location: index.php"); - exit; - } - - ## Load Functions Files - require_once('includes/functions.inc.php'); - - ## Check to see if we have a swap space, - ## if true, display, if false, hide it ... - if(file_exists("/usr/sbin/swapinfo")) { - $swapinfo = `/usr/sbin/swapinfo`; - if(stristr($swapinfo,'%') == true) $showswap=true; - } - - ## User recently restored his config. - ## If packages are installed lets resync - if(file_exists('/conf/needs_package_sync')) { - if($config['installedpackages'] <> '') { - conf_mount_rw(); - @unlink('/conf/needs_package_sync'); - conf_mount_ro(); - if($g['platform'] == "pfSense" || $g['platform'] == "nanobsd") { - header('Location: pkg_mgr_install.php?mode=reinstallall'); - exit; - } - } - } - - ## If it is the first time webConfigurator has been - ## accessed since initial install show this stuff. - if(file_exists('/conf/trigger_initial_wizard')) { - echo <<<EOF -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" - "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<html> -<head> - <title>{$g['product_name']}.localdomain - {$g['product_name']} first time setup</title> - <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> - <link rel="stylesheet" type="text/css" href="/niftycssprintCode.css" media="print" /> - <script type="text/javascript">var theme = "nervecenter"</script> - <script type="text/javascript" src="/themes/nervecenter/loader.js"></script> - -EOF; - - echo "<body link=\"#0000CC\" vlink=\"#0000CC\" alink=\"#0000CC\">\n"; - - if(file_exists("/usr/local/www/themes/{$g['theme']}/wizard.css")) - echo "<link rel=\"stylesheet\" href=\"/themes/{$g['theme']}/wizard.css\" media=\"all\" />\n"; - else - echo "<link rel=\"stylesheet\" href=\"/themes/{$g['theme']}/all.css\" media=\"all\" />"; - - echo "<form>\n"; - echo "<center>\n"; - echo "<img src=\"/themes/{$g['theme']}/images/logo.gif\" border=\"0\"><p>\n"; - echo "<div \" style=\"width:700px;background-color:#ffffff\" id=\"nifty\">\n"; - echo sprintf(gettext("Welcome to %s!\n"),$g['product_name']) . "<p>"; - echo gettext("One moment while we start the initial setup wizard.") . "<p>\n"; - echo gettext("Embedded platform users: Please be patient, the wizard takes a little longer to run than the normal GUI.") . "<p>\n"; - echo sprintf(gettext("To bypass the wizard, click on the %s logo on the initial page."),$g['product_name']) . "\n"; - echo "</div>\n"; - echo "<meta http-equiv=\"refresh\" content=\"1;url=wizard.php?xml=setup_wizard.xml\">\n"; - echo "<script type=\"text/javascript\">\n"; - echo "NiftyCheck();\n"; - echo "Rounded(\"div#nifty\",\"all\",\"#AAA\",\"#FFFFFF\",\"smooth\");\n"; - echo "</script>\n"; - exit; - } - - - ## Find out whether there's hardware encryption or not - unset($hwcrypto); - $fd = @fopen("{$g['varlog_path']}/dmesg.boot", "r"); - if ($fd) { - while (!feof($fd)) { - $dmesgl = fgets($fd); - if (preg_match("/^hifn.: (.*?),/", $dmesgl, $matches) or preg_match("/.*(VIA Padlock)/", $dmesgl, $matches) or preg_match("/^safe.: (\w.*)/", $dmesgl, $matches) or preg_match("/^ubsec.: (.*?),/", $dmesgl, $matches) or preg_match("/^padlock.: <(.*?)>,/", $dmesgl, $matches) or preg_match("/^glxsb.: (.*?),/", $dmesgl, $matches)) { - $hwcrypto = $matches[1]; - break; - } - } - fclose($fd); - } - -##build widget saved list information -if ($config['widgets'] && $config['widgets']['sequence'] != "") { - $pconfig['sequence'] = $config['widgets']['sequence']; - $widgetlist = $pconfig['sequence']; - $colpos = array(); - $savedwidgetfiles = array(); - $widgetname = ""; - $widgetlist = explode(",",$widgetlist); - - ##read the widget position and display information - foreach ($widgetlist as $widget){ - $dashpos = strpos($widget, "-"); - $widgetname = substr($widget, 0, $dashpos); - $colposition = strpos($widget, ":"); - $displayposition = strrpos($widget, ":"); - $colpos[] = substr($widget,$colposition+1, $displayposition - $colposition-1); - $displayarray[] = substr($widget,$displayposition+1); - $savedwidgetfiles[] = $widgetname . ".widget.php"; - } - - ##add widgets that may not be in the saved configuration, in case they are to be displayed later - foreach ($widgetfiles as $defaultwidgets){ - if (!in_array($defaultwidgets, $savedwidgetfiles)){ - $savedwidgetfiles[] = $defaultwidgets; - } - } - - ##find custom configurations of a particular widget and load its info to $pconfig - foreach ($widgetnames as $widget){ - if ($config['widgets'][$widget . '-config']){ - $pconfig[$widget . '-config'] = $config['widgets'][$widget . '-config']; - } - } - - $widgetlist = $savedwidgetfiles; -} else{ - // no saved widget sequence found, build default list. - $widgetlist = $widgetfiles; -} - -##build list of php include files -$phpincludefiles = array(); -$directory = "/usr/local/www/widgets/include/"; -$dirhandle = opendir($directory); -$filename = ""; -while (false !== ($filename = readdir($dirhandle))) { - $phpincludefiles[] = $filename; -} -foreach($phpincludefiles as $includename) { - if(!stristr($includename, ".inc")) - continue; - include($directory . $includename); -} - -##begin AJAX -$jscriptstr = <<<EOD -<script language="javascript" type="text/javascript"> - - -function widgetAjax(widget) { - uri = "widgets/widgets/" + widget + ".widget.php"; - var opt = { - // Use GET - method: 'get', - evalScripts: 'true', - asynchronous: true, - // Handle 404 - on404: function(t) { - alert('Error 404: location "' + t.statusText + '" was not found.'); - }, - // Handle other errors - onFailure: function(t) { - alert('Error ' + t.status + ' -- ' + t.statusText); - }, - onSuccess: function(t) { - widget2 = widget + "-loader"; - Effect.Fade(widget2, {queue:'front'}); - Effect.Appear(widget, {queue:'end'}); - } - } - new Ajax.Updater(widget, uri, opt); -} - - -function addWidget(selectedDiv){ - selectedDiv2 = selectedDiv + "-container"; - d = document; - textlink = d.getElementById(selectedDiv2); - Effect.Appear(selectedDiv2, {duration:1}); - if (textlink.style.display != "none") - { - Effect.Shake(selectedDiv2); - } - else - { - widgetAjax(selectedDiv); - selectIntLink = selectedDiv2 + "-input"; - textlink = d.getElementById(selectIntLink); - textlink.value = "show"; - showSave(); - } -} - -function configureWidget(selectedDiv){ - selectIntLink = selectedDiv + "-settings"; - d = document; - textlink = d.getElementById(selectIntLink); - if (textlink.style.display == "none") - Effect.BlindDown(selectIntLink, {duration:1}); - else - Effect.BlindUp(selectIntLink, {duration:1}); -} - -function showWidget(selectedDiv,swapButtons){ - //appear element - Effect.BlindDown(selectedDiv, {duration:1}); - showSave(); - d = document; - if (swapButtons){ - selectIntLink = selectedDiv + "-min"; - textlink = d.getElementById(selectIntLink); - textlink.style.display = "inline"; - - - selectIntLink = selectedDiv + "-open"; - textlink = d.getElementById(selectIntLink); - textlink.style.display = "none"; - - } - selectIntLink = selectedDiv + "-container-input"; - textlink = d.getElementById(selectIntLink); - textlink.value = "show"; - -} - -function minimizeWidget(selectedDiv,swapButtons){ - //fade element - Effect.BlindUp(selectedDiv, {duration:1}); - showSave(); - d = document; - if (swapButtons){ - selectIntLink = selectedDiv + "-open"; - textlink = d.getElementById(selectIntLink); - textlink.style.display = "inline"; - - selectIntLink = selectedDiv + "-min"; - textlink = d.getElementById(selectIntLink); - textlink.style.display = "none"; - } - selectIntLink = selectedDiv + "-container-input"; - textlink = d.getElementById(selectIntLink); - textlink.value = "hide"; - -} - -function closeWidget(selectedDiv){ - showSave(); - selectedDiv = selectedDiv + "-container"; - Effect.Fade(selectedDiv, {duration:1}); - d = document; - selectIntLink = selectedDiv + "-input"; - textlink = d.getElementById(selectIntLink); - textlink.value = "close"; -} - -function showSave(){ - d = document; - selectIntLink = "submit"; - textlink = d.getElementById(selectIntLink); - textlink.style.display = "inline"; -} - -function updatePref(){ - var widgets = document.getElementsByClassName('widgetdiv'); - var widgetSequence = ""; - var firstprint = false; - d = document; - for (i=0; i<widgets.length; i++){ - if (firstprint) - widgetSequence += ","; - var widget = widgets[i].id; - widgetSequence += widget + ":" + widgets[i].parentNode.id + ":"; - widget = widget + "-input"; - textlink = d.getElementById(widget).value; - widgetSequence += textlink; - firstprint = true; - } - selectLink = "sequence"; - textlink = d.getElementById(selectLink); - textlink.value = widgetSequence; - return true; -} - -function hideAllWidgets(){ - Effect.Fade('niftyOutter', {to: 0.2}); -} - -function showAllWidgets(){ - Effect.Fade('niftyOutter', {to: 1.0}); -} - - -function changeTabDIV(selectedDiv){ - var dashpos = selectedDiv.indexOf("-"); - var tabclass = selectedDiv.substring(0,dashpos); - d = document; - - //get deactive tabs first - tabclass = tabclass + "-class-tabdeactive"; - var tabs = document.getElementsByClassName(tabclass); - var incTabSelected = selectedDiv + "-deactive"; - for (i=0; i<tabs.length; i++){ - var tab = tabs[i].id; - dashpos = tab.lastIndexOf("-"); - var tab2 = tab.substring(0,dashpos) + "-deactive"; - if (tab2 == incTabSelected){ - tablink = d.getElementById(tab2); - tablink.style.display = "none"; - tab2 = tab.substring(0,dashpos) + "-active"; - tablink = d.getElementById(tab2); - tablink.style.display = "table-cell"; - - //now show main div associated with link clicked - tabmain = d.getElementById(selectedDiv); - tabmain.style.display = "block"; - } - else - { - tab2 = tab.substring(0,dashpos) + "-deactive"; - tablink = d.getElementById(tab2); - tablink.style.display = "table-cell"; - tab2 = tab.substring(0,dashpos) + "-active"; - tablink = d.getElementById(tab2); - tablink.style.display = "none"; - - //hide sections we don't want to see - tab2 = tab.substring(0,dashpos); - tabmain = d.getElementById(tab2); - tabmain.style.display = "none"; - - } - } -} - -</script> -EOD; -$closehead = false; - -## Set Page Title and Include Header -$pgtitle = array(sprintf(gettext("%s Dashboard"), $g['product_name'])); -include("head.inc"); - -echo "\t<script type=\"text/javascript\" src=\"javascript/domTT/domLib.js\"></script>\n"; -echo "\t<script type=\"text/javascript\" src=\"javascript/domTT/domTT.js\"></script>\n"; -echo "\t<script type=\"text/javascript\" src=\"javascript/domTT/behaviour.js\"></script>\n"; -echo "\t<script type=\"text/javascript\" src=\"javascript/domTT/fadomatic.js\"></script>\n"; - -?> - -<body link="#0000CC" vlink="#0000CC" alink="#0000CC"> -<form action="index.php" method="post"> -<script language="javascript" type="text/javascript"> -// <![CDATA[ - columns = ['col1','col2','col3','col4','col5','col6']; -// ]]> - var currwidth; - currwidth = document.documentElement.clientWidth; - window.onresize = function (){ - if (currwidth != document.documentElement.clientWidth){ - // let's refresh window if width was changed - window.location.href=window.location.href; - }; - currwidth = document.documentElement.clientWidth; - } -</script> - -<?php -include("fbegin.inc"); -echo $jscriptstr; - if(!file_exists("/usr/local/www/themes/{$g['theme']}/no_big_logo")) - echo "<center><img src=\"./themes/".$g['theme']."/images/logobig.jpg\"></center><br>"; -?> -<div id="widgetcontainer" style="display:none"> - <div id="content1"><h1><?=gettext("Available Widgets"); ?></h1><p><?php - $widgetfiles_add = $widgetfiles; - sort($widgetfiles_add); - foreach($widgetfiles_add as $widget) { - if(!stristr($widget, "widget.php")) - continue; - - $periodpos = strpos($widget, "."); - $widgetname = substr($widget, 0, $periodpos); - $nicename = $widgetname; - $nicename = str_replace("_", " ", $nicename); - //make the title look nice - $nicename = ucwords($nicename); - - $widgettitle = $widgetname . "_title"; - $widgettitlelink = $widgetname . "_title_link"; - if ($$widgettitle != "") - { - //echo widget title - ?> - <span style="cursor: pointer;" onclick='return addWidget("<?php echo $widgetname; ?>")'> - <u><?php echo $$widgettitle; ?></u></span><br> - <?php - } - else {?> - <span style="cursor: pointer;" onclick='return addWidget("<?php echo $widgetname; ?>")'> - <u><?php echo $nicename; ?></u></span><br><?php - } - } - ?> - </p> - </div> -</div> - -<div id="welcomecontainer" style="display:none"> - <div id="welcome-container"> - <h1> - <div style="float:left;width:80%;padding: 2px"> - <?=gettext("Welcome to the Dashboard page"); ?>! - </div> - <div onclick="domTT_close(this);showAllWidgets();" style="float:right;width:8%; cursor:pointer;padding: 5px;" > - <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_close.gif" /> - </div> - <div style="clear:both;"></div> - </h1> - <p> - <?=gettext("This page allows you to customize the information you want to be displayed!");?><br/> - <?=gettext("To get started click the");?> <img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif"> <?=gettext("icon to add widgets.");?><br/> - <br/> - <?=gettext("You can move any widget around by clicking and dragging the title.");?> - </p> - </div> -</div> - -<input type="hidden" value="" name="sequence" id="sequence"> -<img src="./themes/<?= $g['theme']; ?>/images/icons/icon_plus.gif" alt="<?=gettext("Click here to add widgets"); ?>" style="cursor: pointer;" onmouseup="domTT_activate(this, event, 'content', document.getElementById('content1'), 'type', 'velcro', 'delay', 0, 'fade', 'both', 'fadeMax', 100, 'styleClass', 'niceTitle');" /> - -<img src="./themes/<?= $g['theme']; ?>/images/icons/icon_info_pkg.gif" alt="<?=gettext("Click here for help"); ?>" style="cursor: help;" onmouseup="hideAllWidgets();domTT_activate(this, event, 'content', document.getElementById('welcome-container'), 'type', 'sticky', 'closeLink', '','delay', 0, 'fade', 'both', 'fadeMax', 100, 'styleClass', 'niceTitle');" /> - - - - <input id="submit" name="submit" type="submit" style="display:none" onclick="return updatePref();" class="formbtn" value="<?=gettext("Save Settings");?>" /> -</p> - -<div id="niftyOutter"> - <?php - $widgetcounter = 0; - $directory = "/usr/local/www/widgets/widgets/"; - $firstprint = false; - ?> -<script language="javascript" type="text/javascript"> -var printed2 = false; -var printed3 = false; -var printed4 = false; -var printed5 = false; -var printed6 = false; -var numofcols = parseInt(currwidth/400); // one column is minimum 350px -if (numofcols < 2) numofcols = 2; -var colpercent; // column width in percents -if (numofcols <= 2) colpercent = parseInt(100/numofcols-2); -else colpercent = parseInt(100/numofcols-1); - -function PrintDiv(colpos){ - if (colpos == "col2" && printed2 == false){ - document.write("</div><div id=\"col2\" style=\"float:left;width:"+colpercent+"%;padding-bottom:40px;padding-left:10px;\">"); - printed2=true; - }else if (colpos == "col3" && numofcols >= 3 && printed3 == false){ - document.write("</div><div id=\"col3\" style=\"float:left;width:"+colpercent+"%;padding-bottom:40px;padding-left:10px;\">"); - printed3=true; - }else if (colpos == "col4" && numofcols >= 4 && printed4 == false){ - document.write("</div><div id=\"col4\" style=\"float:left;width:"+colpercent+"%;padding-bottom:40px;padding-left:10px;\">"); - printed4=true; - }else if (colpos == "col5" && numofcols >= 5 && printed5 == false){ - document.write("</div><div id=\"col5\" style=\"float:left;width:"+colpercent+"%;padding-bottom:40px;padding-left:10px;\">"); - printed5=true; - }else if (colpos == "col6" && numofcols >= 6 && printed6 == false){ - document.write("</div><div id=\"col6\" style=\"float:left;width:"+colpercent+"%;padding-bottom:40px;padding-left:10px;\">"); - printed6=true; - } -} -document.write("<div id=\"col1\" style=\"float:left;width:"+colpercent+"%;padding-bottom:40px;padding-left:10px;\">"); -</script> - <?php - - foreach($widgetlist as $widget) { - - if(!stristr($widget, "widget.php")) - continue; - $periodpos = strpos($widget, "."); - $widgetname = substr($widget, 0, $periodpos); - if ($widgetname != ""){ - $nicename = $widgetname; - $nicename = str_replace("_", " ", $nicename); - - //make the title look nice - $nicename = ucwords($nicename); - } - - if ($config['widgets'] && $pconfig['sequence'] != ""){ - switch($displayarray[$widgetcounter]){ - case "show": - $divdisplay = "block"; - $display = "block"; - $inputdisplay = "show"; - $showWidget = "none"; - $mindiv = "inline"; - break; - case "hide": - $divdisplay = "block"; - $display = "none"; - $inputdisplay = "hide"; - $showWidget = "inline"; - $mindiv = "none"; - break; - case "close": - $divdisplay = "none"; - $display = "block"; - $inputdisplay = "close"; - $showWidget = "none"; - $mindiv = "inline"; - break; - default: - $divdisplay = "none"; - $display = "block"; - $inputdisplay = "none"; - $showWidget = "none"; - $mindiv = "inline"; - break; - } - } else { - if ($firstprint == false){ - $divdisplay = "block"; - $display = "block"; - $inputdisplay = "show"; - $showWidget = "none"; - $mindiv = "inline"; - $firstprint = true; - } else { - switch ($widget) { - case "interfaces.widget.php": - case "traffic_graphs.widget.php": - $divdisplay = "block"; - $display = "block"; - $inputdisplay = "show"; - $showWidget = "none"; - $mindiv = "inline"; - break; - default: - $divdisplay = "none"; - $display = "block"; - $inputdisplay = "close"; - $showWidget = "none"; - $mindiv = "inline"; - break; - } - } - } - - if ($config['widgets'] && $pconfig['sequence'] != ""){ -?> - <script language="javascript" type="text/javascript"> - colpos="<?=$colpos[$widgetcounter]?>"; - PrintDiv(colpos); - </script> - -<?php - } -?> - <div style="clear:both;"></div> - <div id="<?php echo $widgetname;?>-container" class="widgetdiv" style="display:<?php echo $divdisplay; ?>;"> - <input type="hidden" value="<?php echo $inputdisplay;?>" id="<?php echo $widgetname;?>-container-input" name="<?php echo $widgetname;?>-container-input"> - <div id="<?php echo $widgetname;?>-topic" class="widgetheader" style="cursor:move"> - <div style="float:left;"> - <?php - - $widgettitle = $widgetname . "_title"; - $widgettitlelink = $widgetname . "_title_link"; - if ($$widgettitle != "") - { - //only show link if defined - if ($$widgettitlelink != "") {?> - <u><span onClick="location.href='/<?php echo $$widgettitlelink;?>'" style="cursor:pointer"> - <?php } - //echo widget title - echo $$widgettitle; - if ($$widgettitlelink != "") { ?> - </span></u> - <?php } - } - else{ - if ($$widgettitlelink != "") {?> - <u><span onClick="location.href='/<?php echo $$widgettitlelink;?>'" style="cursor:pointer"> - <?php } - echo $nicename; - if ($$widgettitlelink != "") { ?> - </span></u> - <?php } - } - ?> - </div> - <div align="right" style="float:right;"> - <div id="<?php echo $widgetname;?>-configure" onclick='return configureWidget("<?php echo $widgetname;?>")' style="display:none; cursor:pointer" ><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_configure.gif" /></div> - <div id="<?php echo $widgetname;?>-open" onclick='return showWidget("<?php echo $widgetname;?>",true)' style="display:<?php echo $showWidget;?>; cursor:pointer" ><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_open.gif" /></div> - <div id="<?php echo $widgetname;?>-min" onclick='return minimizeWidget("<?php echo $widgetname;?>",true)' style="display:<?php echo $mindiv;?>; cursor:pointer" ><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_minus.gif"/></div> - <div id="<?php echo $widgetname;?>-close" onclick='return closeWidget("<?php echo $widgetname;?>",true)' style="display:inline; cursor:pointer" ><img src="./themes/<?= $g['theme']; ?>/images/icons/icon_close.gif" /></div> - </div> - <div style="clear:both;"></div> - </div> - <?php if ($divdisplay != "block") { ?> - <div id="<?php echo $widgetname;?>-loader" style="display:<?php echo $display; ?>;"> - <br> - <center> - <img src="./themes/<?= $g['theme']; ?>/images/misc/widget_loader.gif" width=25 height=25 alt="<?=gettext("Loading selected widget"); ?>..."> - </center> - <br> - </div> <?php } if ($divdisplay != "block") $display = none; ?> - <div id="<?php echo $widgetname;?>" style="display:<?php echo $display; ?>;"> - <?php - if ($divdisplay == "block") - { - include($directory . $widget); - } - ?> - </div> - <div style="clear:both;"></div> - </div> -<?php - $widgetcounter++; - - }//end foreach -?> - <script type="text/javascript"> - // If some columns still do not have widgets let's print them anyway so a user can move wigets to them - if (printed2 == false){ - document.write("</div><div id=\"col2\" style=\"float:left;width:"+colpercent+"%;padding-bottom:40px\">"); - } - if (numofcols >= 3 && printed3 == false){ - document.write("</div><div id=\"col3\" style=\"float:left;width:"+colpercent+"%;padding-bottom:40px\">"); - } - if (numofcols >= 4 && printed4 == false){ - document.write("</div><div id=\"col4\" style=\"float:left;width:"+colpercent+"%;padding-bottom:40px\">"); - } - if (numofcols >= 5 && printed5 == false){ - document.write("</div><div id=\"col5\" style=\"float:left;width:"+colpercent+"%;padding-bottom:40px\">"); - } - if (numofcols >= 6 && printed6 == false){ - document.write("</div><div id=\"col6\" style=\"float:left;width:"+colpercent+"%;padding-bottom:40px\">"); - } - </script> - </div> - <div style="clear:both;"></div> -</div> - -<!-- -<script type="text/javascript"> - document.write("+++test+++<br>"); - document.write("currwidth="+currwidth+"<br>"); - document.write("numofcols="+numofcols+"<br>"); - document.write("colpercent="+colpercent+"<br>"); -</script> ---> -<?php include("fend.inc"); ?> - -<script type="text/javascript"> - document.observe('dom:loaded', function(in_event) - { - Sortable.create("col1", {tag:'div',dropOnEmpty:true,containment:columns,handle:'widgetheader',constraint:false,only:'widgetdiv',onChange:showSave}); - Sortable.create("col2", {tag:'div',dropOnEmpty:true,containment:columns,handle:'widgetheader',constraint:false,only:'widgetdiv',onChange:showSave}); - Sortable.create("col3", {tag:'div',dropOnEmpty:true,containment:columns,handle:'widgetheader',constraint:false,only:'widgetdiv',onChange:showSave}); - Sortable.create("col4", {tag:'div',dropOnEmpty:true,containment:columns,handle:'widgetheader',constraint:false,only:'widgetdiv',onChange:showSave}); - Sortable.create("col5", {tag:'div',dropOnEmpty:true,containment:columns,handle:'widgetheader',constraint:false,only:'widgetdiv',onChange:showSave}); - Sortable.create("col6", {tag:'div',dropOnEmpty:true,containment:columns,handle:'widgetheader',constraint:false,only:'widgetdiv',onChange:showSave}); - <?php if (!$config['widgets'] && $pconfig['sequence'] != ""){ ?> - hideAllWidgets(); - domTT_activate('welcome1', null, 'x', 287, 'y', 107, 'content', document.getElementById('welcome-container'), 'type', 'sticky', 'closeLink', '','delay', 1000, 'fade', 'both', 'fadeMax', 100, 'styleClass', 'niceTitle'); - <?php } ?> - }); -</script> - -<?php - //build list of javascript include files - $jsincludefiles = array(); - $directory = "widgets/javascript/"; - $dirhandle = opendir($directory); - $filename = ""; - while (false !== ($filename = readdir($dirhandle))) { - $jsincludefiles[] = $filename; - } - foreach($jsincludefiles as $jsincludename) { - if(!stristr($jsincludename, ".js")) - continue; - echo "<script src='{$directory}{$jsincludename}' type='text/javascript'></script>\n"; - } -?> -</form> -</body> -</html> diff --git a/config/widescreen/widescreen.inc b/config/widescreen/widescreen.inc deleted file mode 100644 index 52c91d92..00000000 --- a/config/widescreen/widescreen.inc +++ /dev/null @@ -1,65 +0,0 @@ -<?php - -/** - * Author: Evgeny Yurchenko - * Email: ey@tm-k.com - * - * Developed for: pfSense.com - * - * Copyright (c) 2010, pfSense.com - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in thedocumentation and/or other materials provided with the distribution. - * Neither the name of the <ORGANIZATION> nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 COPYRIGHT HOLDER OR CONTRIBUTORS 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('filter.inc'); - -function widescreen_custom_php_install_command() -{ - exec("mkdir -p /usr/local/pkg/widescreen/backup"); - // Let's backup everything - copy("/usr/local/www/themes/pfsense_ng/all.css", "/usr/local/pkg/widescreen/backup/all.css.bak"); - copy("/usr/local/www/fbegin.inc", "/usr/local/pkg/widescreen/backup/fbegin.inc.bak"); - copy("/usr/local/www/fend.inc", "/usr/local/pkg/widescreen/backup/fend.inc.bak"); - copy("/usr/local/www/index.php", "/usr/local/pkg/widescreen/backup/index.php.bak"); - - // Install patches - copy("/usr/local/pkg/widescreen/all.css_", "/usr/local/www/themes/pfsense_ng/all.css"); - copy("/usr/local/pkg/widescreen/fbegin.inc_", "/usr/local/www/fbegin.inc"); - copy("/usr/local/pkg/widescreen/fend.inc_", "/usr/local/www/fend.inc"); - copy("/usr/local/pkg/widescreen/index.php_", "/usr/local/www/index.php"); - copy("/usr/local/pkg/widescreen/footer-left.png", "/usr/local/www/themes/pfsense_ng/images/footer-left.png"); - copy("/usr/local/pkg/widescreen/footer-middle.png", "/usr/local/www/themes/pfsense_ng/images/footer-middle.png"); - copy("/usr/local/pkg/widescreen/footer-right.png", "/usr/local/www/themes/pfsense_ng/images/footer-right.png"); - copy("/usr/local/pkg/widescreen/header-mid.png", "/usr/local/www/themes/pfsense_ng/images/header-mid.png"); - copy("/usr/local/pkg/widescreen/horiz-left.png", "/usr/local/www/themes/pfsense_ng/images/horiz-left.png"); - copy("/usr/local/pkg/widescreen/horiz-right.png", "/usr/local/www/themes/pfsense_ng/images/horiz-right.png"); -} - -function widescreen_custom_php_deinstall_command() -{ - copy("/usr/local/pkg/widescreen/backup/all.css.bak", "/usr/local/www/themes/pfsense_ng/all.css"); - copy("/usr/local/pkg/widescreen/backup/fbegin.inc.bak", "/usr/local/www/fbegin.inc"); - copy("/usr/local/pkg/widescreen/backup/fend.inc.bak", "/usr/local/www/fend.inc"); - copy("/usr/local/pkg/widescreen/backup/index.php.bak", "/usr/local/www/index.php"); - exec("rm /usr/local/www/themes/pfsense_ng/images/footer-left.png"); - exec("rm /usr/local/www/themes/pfsense_ng/images/footer-middle.png"); - exec("rm /usr/local/www/themes/pfsense_ng/images/footer-right.png"); - exec("rm /usr/local/www/themes/pfsense_ng/images/header-mid.png"); - exec("rm /usr/local/www/themes/pfsense_ng/images/horiz-left.png"); - exec("rm /usr/local/www/themes/pfsense_ng/images/horiz-right.png"); - exec("rm -r /usr/local/pkg/widescreen"); -} - -?>
\ No newline at end of file diff --git a/config/widescreen/widescreen.xml b/config/widescreen/widescreen.xml deleted file mode 100644 index 0692b533..00000000 --- a/config/widescreen/widescreen.xml +++ /dev/null @@ -1,71 +0,0 @@ -<?xml version="1.0" encoding="utf-8" ?> -<packagegui> - <description>Widescreen theme</description> - <requirements></requirements> - <name>widescreen</name> - <version>0.2</version> - <title>widescreen</title> - <aftersaveredirect></aftersaveredirect> - <include_file>/usr/local/pkg/widescreen/widescreen.inc</include_file> - <additional_files_needed> - <prefix>/usr/local/pkg/widescreen/</prefix> - <chmod>077</chmod> - <item>https://packages.pfsense.org/packages/config/widescreen/widescreen.inc</item> - </additional_files_needed> - <additional_files_needed> - <prefix>/usr/local/pkg/widescreen/</prefix> - <chmod>644</chmod> - <item>https://packages.pfsense.org/packages/config/widescreen/bin/all.css_</item> - </additional_files_needed> - <additional_files_needed> - <prefix>/usr/local/pkg/widescreen/</prefix> - <chmod>644</chmod> - <item>https://packages.pfsense.org/packages/config/widescreen/bin/fbegin.inc_</item> - </additional_files_needed> - <additional_files_needed> - <prefix>/usr/local/pkg/widescreen/</prefix> - <chmod>644</chmod> - <item>https://packages.pfsense.org/packages/config/widescreen/bin/fend.inc_</item> - </additional_files_needed> - <additional_files_needed> - <prefix>/usr/local/pkg/widescreen/</prefix> - <chmod>644</chmod> - <item>https://packages.pfsense.org/packages/config/widescreen/bin/footer-left.png</item> - </additional_files_needed> - <additional_files_needed> - <prefix>/usr/local/pkg/widescreen/</prefix> - <chmod>644</chmod> - <item>https://packages.pfsense.org/packages/config/widescreen/bin/footer-middle.png</item> - </additional_files_needed> - <additional_files_needed> - <prefix>/usr/local/pkg/widescreen/</prefix> - <chmod>644</chmod> - <item>https://packages.pfsense.org/packages/config/widescreen/bin/footer-right.png</item> - </additional_files_needed> - <additional_files_needed> - <prefix>/usr/local/pkg/widescreen/</prefix> - <chmod>644</chmod> - <item>https://packages.pfsense.org/packages/config/widescreen/bin/header-mid.png</item> - </additional_files_needed> - <additional_files_needed> - <prefix>/usr/local/pkg/widescreen/</prefix> - <chmod>644</chmod> - <item>https://packages.pfsense.org/packages/config/widescreen/bin/horiz-left.png</item> - </additional_files_needed> - <additional_files_needed> - <prefix>/usr/local/pkg/widescreen/</prefix> - <chmod>644</chmod> - <item>https://packages.pfsense.org/packages/config/widescreen/bin/horiz-right.png</item> - </additional_files_needed> - <additional_files_needed> - <prefix>/usr/local/pkg/widescreen/</prefix> - <chmod>644</chmod> - <item>https://packages.pfsense.org/packages/config/widescreen/bin/index.php_</item> - </additional_files_needed> - <custom_php_install_command> - widescreen_custom_php_install_command(); - </custom_php_install_command> - <custom_php_deinstall_command> - widescreen_custom_php_deinstall_command(); - </custom_php_deinstall_command> -</packagegui> diff --git a/config/widget-antivirus/antivirus_status.widget.php b/config/widget-antivirus/antivirus_status.widget.php index 6bca68a2..9c18d3f6 100644 --- a/config/widget-antivirus/antivirus_status.widget.php +++ b/config/widget-antivirus/antivirus_status.widget.php @@ -1,108 +1,96 @@ <?php /* - $Id: antivirus_statistics.widget.php - Copyright (C) 2010 Serg Dvoriancev <dv_serg@mail.ru>. - Part of pfSense widgets (www.pfsense.org) - originally based on m0n0wall (http://m0n0.ch/wall) - - Copyright (C) 2004-2005 T. Lechat <dev@lechat.org>, Manuel Kasper <mk@neon1.net> - and Jonathan Watt <jwatt@jwatt.org>. - 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. + antivirus_status.widget.php + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2010 Serg Dvoriancev <dv_serg@mail.ru> + 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("guiconfig.inc"); require_once("pfsense-utils.inc"); require_once("functions.inc"); -define('PATH_CLAMDB', '/var/db/clamav'); -$pfSversion = str_replace("\s", "", file_get_contents("/etc/version")); -if(preg_match("/^2.0/",$pfSversion)) - define('PATH_HAVPLOG', '/var/log/havp/access.log'); -else - define('PATH_HAVPLOG', '/var/log/access.log'); - +define('PATH_CLAMDB', '/var/db/clamav'); +define('PATH_HAVPLOG', '/var/log/access.log'); define('PATH_AVSTATUS', '/var/tmp/havp.status'); - -if (file_exists("/usr/local/pkg/havp.inc")) - require_once("/usr/local/pkg/havp.inc"); -else echo "No havp.inc found"; - -function havp_avdb_info($filename) -{ - $stl = "style='padding-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 4px; border-left: 1px solid #999999;'"; - $r = ''; - $path = PATH_CLAMDB . "/{$filename}"; - if (file_exists($path)) { - $handle = ''; - if ($handle = fopen($path, "r")) { - $s = fread($handle, 1024); - $s = explode(':', $s); - - # datetime - $dt = explode(" ", $s[1]); - $s[1] = strftime("%Y.%m.%d", strtotime("{$dt[0]} {$dt[1]} {$dt[2]}")); - if ($s[0] == 'ClamAV-VDB') - $r .= "<tr class='listr'><td>{$filename}</td><td $stl>{$s[1]}</td><td $stl>{$s[2]}</td><td $stl>{$s[7]}</td></tr>"; - } - fclose($handle); - } - return $r; +if (file_exists("/usr/local/pkg/havp.inc")) { + require_once("/usr/local/pkg/havp.inc"); +} else { + echo "No havp.inc found. You must have HAVP package installed to use this widget."; } -function dwg_avbases_info() -{ - $db = '<table width="100%" border="0" cellspacing="0" cellpadding="1" ><tbody>'; - $db .= '<tr class="vncellt" ><td>Database</td><td>Date</td><td>Ver.</td><td>Builder</td></tr>'; - $db .= havp_avdb_info("daily.cld"); - $db .= havp_avdb_info("daily.cvd"); - $db .= havp_avdb_info("bytecode.cld"); - $db .= havp_avdb_info("bytecode.cvd"); - $db .= havp_avdb_info("main.cld"); - $db .= havp_avdb_info("main.cvd"); - $db .= havp_avdb_info("safebrowsing.cld"); - $db .= havp_avdb_info("safebrowsing.cvd"); - $db .= '</tbody></table>'; - return $db; +function havp_avdb_info($filename) { + $stl = "style='padding-top: 0px; padding-bottom: 0px; padding-left: 4px; padding-right: 4px; border-left: 1px solid #999999;'"; + $r = ''; + $path = PATH_CLAMDB . "/{$filename}"; + if (file_exists($path)) { + $handle = ''; + if ($handle = fopen($path, "r")) { + $s = fread($handle, 1024); + $s = explode(':', $s); + # datetime + $dt = explode(" ", $s[1]); + $s[1] = strftime("%Y.%m.%d", strtotime("{$dt[0]} {$dt[1]} {$dt[2]}")); + if ($s[0] == 'ClamAV-VDB') { + $r .= "<tr class='listr'><td>{$filename}</td><td $stl>{$s[1]}</td><td $stl>{$s[2]}</td><td $stl>{$s[7]}</td></tr>"; + } + fclose($handle); + } + return $r; + } } -function avupdate_status() -{ - $s = "Not found."; - if (HVDEF_UPD_STATUS_FILE && file_exists(HVDEF_UPD_STATUS_FILE)) - $s = file_get_contents(HVDEF_UPD_STATUS_FILE); - return str_replace( "\n", "<br>", $s ); +function dwg_avbases_info() { + $db = '<table width="100%" border="0" cellspacing="0" cellpadding="1"><tbody>'; + $db .= '<tr class="vncellt" ><td>Database</td><td>Date</td><td>Ver.</td><td>Builder</td></tr>'; + $db .= havp_avdb_info("daily.cld"); + $db .= havp_avdb_info("daily.cvd"); + $db .= havp_avdb_info("bytecode.cld"); + $db .= havp_avdb_info("bytecode.cvd"); + $db .= havp_avdb_info("main.cld"); + $db .= havp_avdb_info("main.cvd"); + $db .= havp_avdb_info("safebrowsing.cld"); + $db .= havp_avdb_info("safebrowsing.cvd"); + $db .= '</tbody></table>'; + return $db; } -function dwg_av_statistic() -{ - $s = "Unknown."; - if (file_exists(PATH_HAVPLOG)) { - $log = file_get_contents(PATH_HAVPLOG); +function avupdate_status() { + $s = "Not found."; + if (HVDEF_UPD_STATUS_FILE && file_exists(HVDEF_UPD_STATUS_FILE)) { + $s = file_get_contents(HVDEF_UPD_STATUS_FILE); + return str_replace( "\n", "<br />", $s ); + } +} -$count = substr_count(strtolower($log), "virus clamd:"); -$s = "Found $count viruses (total)."; +function dwg_av_statistic() { + $s = "Unknown."; + if (file_exists(PATH_HAVPLOG)) { + $log = file_get_contents(PATH_HAVPLOG); + $count = substr_count(strtolower($log), "virus clamd:"); + $s = "Found $count viruses (total)."; /* # slowly worked - need apply cache or preparse stat @@ -123,59 +111,49 @@ $s = "Found $count viruses (total)."; $s .= "<tr align='center'><td>0</td><td>0</td><td>0</td><td>$count</td></tr>"; $s .= "</tbody></table>"; */ - } - - return $s; + } + return $s; } ?> - <table width="100%" border="0" cellspacing="0" cellpadding="0"> - <tbody> - <tr> - <td class="vncellt">HTTP Scanner</td> - <td class="listr" width=75%> - <?php - # havp version - echo exec("pkg_info | grep \"[h]avp\""); - ?> - </td> - </tr> - <tr> - <td class="vncellt">Antivirus Scanner</td> - <td class="listr" width=75%> - <?php - # Clamd version - echo exec("clamd -V"); - ?> - </td> - </tr> - <tr> - <td class="vncellt">Antivirus Bases</td> - <td class="listr" width=75%> - <?php - # Antivirus bases - if (function_exists("dwg_avbases_info")) - echo dwg_avbases_info(); - ?> - </td> - </tr> - <tr> - <td class="vncellt">Last Update</td> - <td class="listr" width=75%> - <?php - echo avupdate_status(); - ?> - </td> - </tr> - <tr> - <td class="vncellt">Statistic</td> - <td class="listr" width=75%> - <?php - echo dwg_av_statistic(); - ?> - </td> - </tr> - </tbody> - </table> - +<table width="100%" border="0" cellspacing="0" cellpadding="0"> + <tbody> + <tr> + <td class="vncellt">HTTP Scanner</td> + <td class="listr" width="75%"> + <?php + // HAVP version; note - obviously broken now + echo exec("pkg_info | grep \"[h]avp\""); + ?> + </td> + </tr> + <tr> + <td class="vncellt">Antivirus Scanner</td> + <td class="listr" width="75%"> + <?php + // ClamD version + echo exec("clamd -V"); + ?> + </td> + </tr> + <tr> + <td class="vncellt">Antivirus Bases</td> + <td class="listr" width="75%"> + <?php echo dwg_avbases_info(); ?> + </td> + </tr> + <tr> + <td class="vncellt">Last Update</td> + <td class="listr" width="75%"> + <?php echo avupdate_status(); ?> + </td> + </tr> + <tr> + <td class="vncellt">Statistics</td> + <td class="listr" width="75%"> + <?php echo dwg_av_statistic(); ?> + </td> + </tr> + </tbody> +</table> diff --git a/config/widget-antivirus/widget-antivirus.xml b/config/widget-antivirus/widget-antivirus.xml index 468baf13..91a6a392 100644 --- a/config/widget-antivirus/widget-antivirus.xml +++ b/config/widget-antivirus/widget-antivirus.xml @@ -4,64 +4,59 @@ <packagegui> <copyright> <![CDATA[ -/* $Id$ */ -/* ========================================================================== */ +/* $Id$ */ +/* ====================================================================================== */ /* - widget-antivirus.xml - part of pfSense (http://www.pfSense.com) - Copyright (C) 2009 Jim Pingle - All rights reserved. - - Based on m0n0wall (http://m0n0.ch/wall) - Copyright (C) 2003-2006 Manuel Kasper <mk@neon1.net>. - All rights reserved. - */ -/* ========================================================================== */ + widget-antivirus.xml + part of pfSense (https://www.pfSense.org/) + Copyright (C) 2009 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: + 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. - 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. - 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. - */ -/* ========================================================================== */ + 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>Antivirus status widget add-on for Dashboard package and HAVP</description> - <requirements>Dashboard package and HAVP</requirements> - <faq>Currently there are no FAQ items provided.</faq> + <description>Antivirus status widget add-on for HAVP</description> + <requirements>HAVP package</requirements> <name>widget-antivirus</name> - <version>0.1</version> + <version>0.1.1</version> <title>Widget - Antivirus Status</title> <include_file>/usr/local/pkg/widget-antivirus.inc</include_file> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> - <chmod>077</chmod> <item>https://packages.pfsense.org/packages/config/widget-antivirus/widget-antivirus.inc</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/widgets/include/</prefix> - <chmod>0644</chmod> <item>https://packages.pfsense.org/packages/config/widget-antivirus/antivirus_status.inc</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/www/widgets/widgets/</prefix> - <chmod>0644</chmod> <item>https://packages.pfsense.org/packages/config/widget-antivirus/antivirus_status.widget.php</item> </additional_files_needed> <custom_php_deinstall_command> diff --git a/pkg_config.10.xml b/pkg_config.10.xml index 7c9ce26c..541f9e72 100644 --- a/pkg_config.10.xml +++ b/pkg_config.10.xml @@ -157,7 +157,7 @@ </descr> <website>http://haproxy.1wt.eu/</website> <category>Services</category> - <version>0.27</version> + <version>0.28</version> <status>Release</status> <required_version>2.2</required_version> <config_file>https://packages.pfsense.org/packages/config/haproxy1_5/haproxy.xml</config_file> @@ -185,7 +185,7 @@ </descr> <website>http://haproxy.1wt.eu/</website> <category>Services</category> - <version>0.27</version> + <version>0.28</version> <status>Release</status> <required_version>2.2</required_version> <config_file>https://packages.pfsense.org/packages/config/haproxy-devel/haproxy.xml</config_file> @@ -326,7 +326,7 @@ <category>Status</category> <pkginfolink/> <config_file>https://packages.pfsense.org/packages/config/notes/notes.xml</config_file> - <version>0.2.5</version> + <version>0.2.6</version> <status>Alpha</status> <required_version>2.2</required_version> <maintainer>markjcrane@gmail.com</maintainer> @@ -427,7 +427,7 @@ <build_pbi> <port>net/olsrd</port> </build_pbi> - <version>1.0.2</version> + <version>1.0.3</version> <status>Stable</status> <required_version>2.2</required_version> <configurationfile>olsrd.xml</configurationfile> @@ -560,7 +560,7 @@ <build_pbi> <port>net/siproxd</port> </build_pbi> - <version>1.0.4</version> + <version>1.0.5</version> <status>Beta</status> <required_version>2.2</required_version> <configurationfile>siproxd.xml</configurationfile> @@ -580,7 +580,7 @@ <build_pbi> <port>net/openbgpd</port> </build_pbi> - <version>0.9.3_3</version> + <version>0.9.3.4</version> <status>STABLE</status> <pkginfolink>https://doc.pfsense.org/index.php/OpenBGPD_package</pkginfolink> <required_version>2.2</required_version> @@ -1004,7 +1004,7 @@ <category>Network Management</category> <config_file>https://packages.pfsense.org/packages/config/netio/netio.xml</config_file> <depends_on_package_pbi>netio-1.26-##ARCH##.pbi</depends_on_package_pbi> - <version>1.26</version> + <version>1.27</version> <required_version>2.2</required_version> <status>ALPHA</status> <configurationfile>netio.xml</configurationfile> @@ -1087,7 +1087,7 @@ <descr>LCD display driver.</descr> <website>http://www.lcdproc.org/</website> <category>Utility</category> - <version>1.0.2</version> + <version>1.0.3</version> <status>BETA</status> <required_version>2.2</required_version> <maintainer>seth.mos@dds.nl</maintainer> @@ -1137,7 +1137,7 @@ <build_pbi> <port>net-mgmt/arpwatch</port> </build_pbi> - <version>2.1.a15_8 pkg v1.1.2</version> + <version>1.1.3</version> <status>ALPHA</status> <required_version>2.2</required_version> <config_file>https://packages.pfsense.org/packages/config/arpwatch/arpwatch.xml</config_file> @@ -1271,7 +1271,7 @@ <descr>Dashboard widget for HAVP status.</descr> <category>System</category> <config_file>https://packages.pfsense.org/packages/config/widget-antivirus/widget-antivirus.xml</config_file> - <version>0.1</version> + <version>0.1.1</version> <status>BETA</status> <required_version>2.2</required_version> <configurationfile>widget-havp.xml</configurationfile> @@ -1378,7 +1378,7 @@ ]]> </descr> <maintainer>jimp@pfsense.org</maintainer> - <version>0.6.5</version> + <version>0.6.6</version> <category>Routing</category> <status>BETA</status> <depends_on_package_pbi>quagga-0.99.23.1_2-##ARCH##.pbi</depends_on_package_pbi> @@ -1701,7 +1701,7 @@ <descr>Send and decode link layer advertisements. Support for LLDP (Link Layer Discovery Protocol), CDP (Cisco Discovery Protocol), EDP (Extreme Discovery Protocol) and NDP (Nortel Discovery Protocol).</descr> <website>https://github.com/sspans/ladvd</website> <category>Network Management</category> - <version>1.0.4_1</version> + <version>1.0.4.2</version> <status>BETA</status> <depends_on_package_pbi>ladvd-1.0.4_1-##ARCH##.pbi</depends_on_package_pbi> <config_file>https://packages.pfsense.org/packages/config/ladvd/ladvd.xml</config_file> diff --git a/pkg_config.8.xml b/pkg_config.8.xml index b45bff1d..2e14d8df 100644 --- a/pkg_config.8.xml +++ b/pkg_config.8.xml @@ -1536,21 +1536,6 @@ <configurationfile>shellcmd.xml</configurationfile> </package> <package> - <name>widescreen</name> - <descr>The package makes pfSense adapt to browser's current width. It is particularly convenient for Status->Dashboard page that allocates columns for widgets according to browser's current width. ATTENTION: the package heavily modifies pfsense_ng theme and affects other's themes appearance. Please REFRESH your browser's window after installing/uninstalling this package.</descr> - <website/> - <pkginfolink></pkginfolink> - <category>Enhancements</category> - <version>0.2</version> - <status>BETA</status> - <required_version>2.0</required_version> - <maintainer>ey@tm-k.com</maintainer> - <config_file>https://packages.pfsense.org/packages/config/widescreen/widescreen.xml</config_file> - <configurationfile>widescreen.xml</configurationfile> - <!-- Disabling on 2.0.2 and 2.1 since it overwrites the menu --> - <maximum_version>2.0.1</maximum_version> - </package> - <package> <name>NRPE v2</name> <website>http://wiki.nagios.org/index.php/Howtos:nrpe_nsca</website> <descr>NRPE is an addon for Nagios that allows you to execute plugins on remote Linux/Unix hosts. This is useful if you need to monitor local resources/attributes like disk usage, CPU load, memory usage, etc. on a remote host.</descr> @@ -1617,16 +1602,6 @@ <configurationfile>mailreport.xml</configurationfile> </package> <package> - <name>OpenVPN tap Bridging Fix</name> - <descr>Patch to fix OpenVPN tap bridging on 2.0.x. WARNING! Cannot be uninstalled.</descr> - <category>System</category> - <config_file>https://packages.pfsense.org/packages/config/openvpn_tapfix_20x/openvpn_tapfix_20x.xml</config_file> - <version>0.4</version> - <status>BETA</status> - <required_version>2.0</required_version> - <maximum_version>2.0.4</maximum_version> - </package> - <package> <name>Quagga OSPF</name> <descr>OSPF routing protocol using Quagga -- WARNING! Installs files to the same place as OpenBGPD. Installing both will break things.</descr> <maintainer>jimp@pfsense.org</maintainer> diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64 index f52f2525..ec773fb9 100644 --- a/pkg_config.8.xml.amd64 +++ b/pkg_config.8.xml.amd64 @@ -1523,21 +1523,6 @@ <configurationfile>shellcmd.xml</configurationfile> </package> <package> - <name>widescreen</name> - <descr>The package makes pfSense adapt to browser's current width. It is particularly convenient for Status->Dashboard page that allocates columns for widgets according to browser's current width. ATTENTION: the package heavily modifies pfsense_ng theme and affects other's themes appearance. Please REFRESH your browser's window after installing/uninstalling this package.</descr> - <website/> - <pkginfolink></pkginfolink> - <category>Enhancements</category> - <version>0.2</version> - <status>BETA</status> - <required_version>2.0</required_version> - <maintainer>ey@tm-k.com</maintainer> - <config_file>https://packages.pfsense.org/packages/config/widescreen/widescreen.xml</config_file> - <configurationfile>widescreen.xml</configurationfile> - <!-- Disabling on 2.0.2 and 2.1 since it overwrites the menu --> - <maximum_version>2.0.1</maximum_version> - </package> - <package> <name>NRPE v2</name> <website>http://wiki.nagios.org/index.php/Howtos:nrpe_nsca</website> <descr>NRPE is an addon for Nagios that allows you to execute plugins on remote Linux/Unix hosts. This is useful if you need to monitor local resources/attributes like disk usage, CPU load, memory usage, etc. on a remote host.</descr> @@ -1604,16 +1589,6 @@ <configurationfile>mailreport.xml</configurationfile> </package> <package> - <name>OpenVPN tap Bridging Fix</name> - <descr>Patch to fix OpenVPN tap bridging on 2.0.x. WARNING! Cannot be uninstalled.</descr> - <category>System</category> - <config_file>https://packages.pfsense.org/packages/config/openvpn_tapfix_20x/openvpn_tapfix_20x.xml</config_file> - <version>0.4</version> - <status>BETA</status> - <required_version>2.0</required_version> - <maximum_version>2.0.4</maximum_version> - </package> - <package> <name>Quagga OSPF</name> <descr>OSPF routing protocol using Quagga -- WARNING! Installs files to the same place as OpenBGPD. Installing both will break things.</descr> <maintainer>jimp@pfsense.org</maintainer> |