diff options
Diffstat (limited to 'usr/local/www/widgets')
17 files changed, 131 insertions, 97 deletions
diff --git a/usr/local/www/widgets/widgets/captive_portal_status.widget.php b/usr/local/www/widgets/widgets/captive_portal_status.widget.php index 1ca7007..d240d69 100644 --- a/usr/local/www/widgets/widgets/captive_portal_status.widget.php +++ b/usr/local/www/widgets/widgets/captive_portal_status.widget.php @@ -32,10 +32,13 @@ POSSIBILITY OF SUCH DAMAGE. */ +$nocsrf = true; + require_once("globals.inc"); require_once("guiconfig.inc"); require_once("pfsense-utils.inc"); require_once("functions.inc"); +require_once("captiveportal.inc"); ?> @@ -55,7 +58,7 @@ function clientcmp($a, $b) { $cpdb = array(); if (file_exists("{$g['vardb_path']}/captiveportal.db")) { - $captiveportallck = lock('captiveportal'); + $captiveportallck = lock('captiveportaldb'); $cpcontents = file("{$g['vardb_path']}/captiveportal.db", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); unlock($captiveportallck); } else diff --git a/usr/local/www/widgets/widgets/carp_status.widget.php b/usr/local/www/widgets/widgets/carp_status.widget.php index 6399579..a671308 100644 --- a/usr/local/www/widgets/widgets/carp_status.widget.php +++ b/usr/local/www/widgets/widgets/carp_status.widget.php @@ -27,10 +27,13 @@ POSSIBILITY OF SUCH DAMAGE. */ +$nocsrf = true; + require_once("guiconfig.inc"); require_once("pfsense-utils.inc"); require_once("functions.inc"); require_once("/usr/local/www/widgets/include/carp_status.inc"); + ?> <table bgcolor="#990000" width="100%" border="0" cellspacing="0" cellpadding="0"> <?php diff --git a/usr/local/www/widgets/widgets/gateways.widget.php b/usr/local/www/widgets/widgets/gateways.widget.php index db6a83a..4abe524 100644 --- a/usr/local/www/widgets/widgets/gateways.widget.php +++ b/usr/local/www/widgets/widgets/gateways.widget.php @@ -26,6 +26,9 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +$nocsrf = true; + require_once("guiconfig.inc"); require_once("pfsense-utils.inc"); require_once("functions.inc"); diff --git a/usr/local/www/widgets/widgets/gmirror_status.widget.php b/usr/local/www/widgets/widgets/gmirror_status.widget.php index cd73a0f..cbbead2 100644 --- a/usr/local/www/widgets/widgets/gmirror_status.widget.php +++ b/usr/local/www/widgets/widgets/gmirror_status.widget.php @@ -25,6 +25,8 @@ POSSIBILITY OF SUCH DAMAGE. */ +$nocsrf = true; + require_once("/usr/local/www/widgets/include/gmirror_status.inc"); if ($_GET['textonly'] == "true") { diff --git a/usr/local/www/widgets/widgets/installed_packages.widget.php b/usr/local/www/widgets/widgets/installed_packages.widget.php index 6795d36..3ecb0ec 100644 --- a/usr/local/www/widgets/widgets/installed_packages.widget.php +++ b/usr/local/www/widgets/widgets/installed_packages.widget.php @@ -1,36 +1,38 @@ <?php /* - $Id$ - Copyright 2007 Scott Dale - Part of pfSense widgets (www.pfsense.com) - originally based on m0n0wall (http://m0n0.ch/wall) + $Id$ + Copyright 2007 Scott Dale + Part of pfSense widgets (www.pfsense.com) + 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. + 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: + 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. */ +$nocsrf = true; + require_once("guiconfig.inc"); require_once("pfsense-utils.inc"); require_once("functions.inc"); @@ -48,76 +50,69 @@ $updateavailable = false; ?> <table width="100%" border="0" cellpadding="6" cellspacing="0"> - <tr> - <td width="15%" class="listhdrr">Package Name</td> - <td width="15%" class="listhdrr">Category</td> - <td width="30%" class="listhdrr">Package Version</td> - </tr> - <?php - if($config['installedpackages']['package'] != "") { - $instpkgs = array(); - foreach($config['installedpackages']['package'] as $instpkg) $instpkgs[] = $instpkg['name']; - asort($instpkgs); - $y=1; - foreach ($instpkgs as $index => $pkgname){ - + <tr> + <td width="15%" class="listhdrr">Package Name</td> + <td width="15%" class="listhdrr">Category</td> + <td width="30%" class="listhdrr">Package Version</td> + </tr> + <?php + if($config['installedpackages']['package'] != "") { + $instpkgs = array(); + foreach($config['installedpackages']['package'] as $instpkg) + $instpkgs[] = $instpkg['name']; + natcasesort($instpkgs); + $y=1; + foreach ($instpkgs as $index => $pkgname){ + $pkg = $config['installedpackages']['package'][$index]; - if($pkg['name'] <> "") { - ?> - <tr valign="top"> - <td class="listlr"> - <?= $pkg['name'] ?> - </td> - <td class="listlr"> - <?= $pkg['category'] ?> - </td> - <td class="listlr"> - <?php - $latest_package = $currentvers[$pkg['name']]['version']; - if($latest_package == false) - { - // We can't determine this package's version status. - echo "Current: Unknown.<br>Installed: " . $pkg['version']; - } - elseif(strcmp($pkg['version'], $latest_package) > 0) - { - /* we're running a newer version of the package */ - echo "Current: {$latest_package}"; - echo "<br>Installed: {$pkg['version']}"; - } - elseif(strcmp($pkg['version'], $latest_package) < 0) - { - /* our package is out of date */ - $updateavailable = true; - ?> - <div id="updatediv-<?php echo $y; ?>" style="color:red"> - <b>Update Available!</b></div><div style="float:left"> - Current: <?php echo $latest_package; ?><br/> - Installed: <?php echo $pkg['version']; ?></div><div style="float:right"> - <a href="pkg_mgr_install.php?mode=reinstallpkg&pkg=<?= $pkg['name']; ?>"><img title="Update this package." src="./themes/<?= $g['theme']; ?>/images/icons/icon_reinstall_pkg.gif" width="17" height="17" border="0"</a> - </div> - <?php $y++; - } - else - { - echo $pkg['version']; - } - ?></td> - </tr> - <?php - } - } - } else { - echo "<tr><td colspan=\"5\"><center>There are no packages currently installed.</td></tr>"; - } - ?> - </table> - + if($pkg['name'] <> "") { ?> + <tr valign="top"> + <td class="listlr"> + <?= $pkg['name'] ?> + </td> + <td class="listlr"> + <?= $pkg['category'] ?> + </td> + <td class="listlr"> + <?php + $latest_package = $currentvers[$pkg['name']]['version']; + if($latest_package == false) { + // We can't determine this package's version status. + echo "Current: Unknown.<br>Installed: " . $pkg['version']; + } elseif(strcmp($pkg['version'], $latest_package) > 0) { + /* we're running a newer version of the package */ + echo "Current: {$latest_package}"; + echo "<br>Installed: {$pkg['version']}"; + } elseif(strcmp($pkg['version'], $latest_package) < 0) { + /* our package is out of date */ + $updateavailable = true; + ?> + <div id="updatediv-<?php echo $y; ?>" style="color:red"> + <b>Update Available!</b></div><div style="float:left"> + Current: <?php echo $latest_package; ?><br/> + Installed: <?php echo $pkg['version']; ?></div><div style="float:right"> + <a href="pkg_mgr_install.php?mode=reinstallpkg&pkg=<?= $pkg['name']; ?>"><img title="Update this package." src="./themes/<?= $g['theme']; ?>/images/icons/icon_reinstall_pkg.gif" width="17" height="17" border="0"/></a> + </div> + <?php + $y++; + } else { + echo $pkg['version']; + } ?> + </td> + </tr> + <?php } + } + } else { + echo "<tr><td colspan=\"5\"><center>There are no packages currently installed.</td></tr>"; + } + ?> +</table> + <?php if ($updateavailable): ?> <script language="javascript" type="text/javascript"> window.onload = function(in_event) - { - for (y=1; y<=<?php echo $y;?>; y++){ + { + for (y=1; y<=<?php echo $y;?>; y++){ textID = "updatediv-" + y; Effect.Pulsate(textID,{from:0.1}); } diff --git a/usr/local/www/widgets/widgets/interface_statistics.widget.php b/usr/local/www/widgets/widgets/interface_statistics.widget.php index 3fcf8a6..7dca538 100644 --- a/usr/local/www/widgets/widgets/interface_statistics.widget.php +++ b/usr/local/www/widgets/widgets/interface_statistics.widget.php @@ -31,6 +31,8 @@ POSSIBILITY OF SUCH DAMAGE. */ +$nocsrf = true; + require_once("guiconfig.inc"); require_once("pfsense-utils.inc"); require_once("functions.inc"); diff --git a/usr/local/www/widgets/widgets/interfaces.widget.php b/usr/local/www/widgets/widgets/interfaces.widget.php index d74f690..626e067 100644 --- a/usr/local/www/widgets/widgets/interfaces.widget.php +++ b/usr/local/www/widgets/widgets/interfaces.widget.php @@ -30,6 +30,9 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +$nocsrf = true; + require_once("guiconfig.inc"); require_once("pfsense-utils.inc"); require_once("functions.inc"); diff --git a/usr/local/www/widgets/widgets/ipsec.widget.php b/usr/local/www/widgets/widgets/ipsec.widget.php index 4966dd7..dd0c10e 100644 --- a/usr/local/www/widgets/widgets/ipsec.widget.php +++ b/usr/local/www/widgets/widgets/ipsec.widget.php @@ -31,6 +31,8 @@ POSSIBILITY OF SUCH DAMAGE. */ +$nocsrf = true; + require_once("guiconfig.inc"); require_once("functions.inc"); require_once("ipsec.inc"); diff --git a/usr/local/www/widgets/widgets/load_balancer_status.widget.php b/usr/local/www/widgets/widgets/load_balancer_status.widget.php index 5993b67..63f8bc4 100644 --- a/usr/local/www/widgets/widgets/load_balancer_status.widget.php +++ b/usr/local/www/widgets/widgets/load_balancer_status.widget.php @@ -34,6 +34,8 @@ POSSIBILITY OF SUCH DAMAGE. */ +$nocsrf = true; + require_once("guiconfig.inc"); require_once("pfsense-utils.inc"); require_once("functions.inc"); diff --git a/usr/local/www/widgets/widgets/log.widget.php b/usr/local/www/widgets/widgets/log.widget.php index c46a6ab..84f6585 100644 --- a/usr/local/www/widgets/widgets/log.widget.php +++ b/usr/local/www/widgets/widgets/log.widget.php @@ -30,6 +30,9 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +$nocsrf = true; + require_once("guiconfig.inc"); require_once("pfsense-utils.inc"); require_once("functions.inc"); diff --git a/usr/local/www/widgets/widgets/openvpn.widget.php b/usr/local/www/widgets/widgets/openvpn.widget.php index 25454c8..fdf2e3c 100644 --- a/usr/local/www/widgets/widgets/openvpn.widget.php +++ b/usr/local/www/widgets/widgets/openvpn.widget.php @@ -1,4 +1,7 @@ <?php + +$nocsrf = true; + require_once("openvpn.inc"); /* Handle AJAX */ diff --git a/usr/local/www/widgets/widgets/picture.widget.php b/usr/local/www/widgets/widgets/picture.widget.php index 7f25af4..90bf288 100644 --- a/usr/local/www/widgets/widgets/picture.widget.php +++ b/usr/local/www/widgets/widgets/picture.widget.php @@ -26,6 +26,7 @@ POSSIBILITY OF SUCH DAMAGE. */ +$nocsrf = true; require_once("guiconfig.inc"); require_once("pfsense-utils.inc"); diff --git a/usr/local/www/widgets/widgets/rss.widget.php b/usr/local/www/widgets/widgets/rss.widget.php index d81fa4d..0843684 100644 --- a/usr/local/www/widgets/widgets/rss.widget.php +++ b/usr/local/www/widgets/widgets/rss.widget.php @@ -26,6 +26,8 @@ POSSIBILITY OF SUCH DAMAGE. */ +$nocsrf = true; + require_once("guiconfig.inc"); require_once("pfsense-utils.inc"); require_once("functions.inc"); diff --git a/usr/local/www/widgets/widgets/services_status.widget.php b/usr/local/www/widgets/widgets/services_status.widget.php index 862a069..f41e7f5 100644 --- a/usr/local/www/widgets/widgets/services_status.widget.php +++ b/usr/local/www/widgets/widgets/services_status.widget.php @@ -29,6 +29,8 @@ POSSIBILITY OF SUCH DAMAGE. */ +$nocsrf = true; + require_once("guiconfig.inc"); require_once("captiveportal.inc"); require_once("service-utils.inc"); @@ -175,7 +177,14 @@ if(isset($_POST['servicestatusfilter'])) { <?php $skipservices = explode(",", str_replace(" ", "", $config['widgets']['servicestatusfilter'])); +function service_name_compare($a, $b) { + if (strtolower($a['name']) == strtolower($b['name'])) + return 0; + return (strtolower($a['name']) < strtolower($b['name'])) ? -1 : 1; +} + if (count($services) > 0) { + uasort($services, "service_name_compare"); foreach($services as $service) { if((!$service['name']) || (in_array($service['name'], $skipservices))) continue; diff --git a/usr/local/www/widgets/widgets/system_information.widget.php b/usr/local/www/widgets/widgets/system_information.widget.php index 9604461..1b9683a 100644 --- a/usr/local/www/widgets/widgets/system_information.widget.php +++ b/usr/local/www/widgets/widgets/system_information.widget.php @@ -31,11 +31,12 @@ POSSIBILITY OF SUCH DAMAGE. */ +$nocsrf = true; + require_once("functions.inc"); require_once("guiconfig.inc"); require_once('notices.inc'); - if($_REQUEST['getupdatestatus']) { if(isset($curcfg['alturl']['enable'])) $updater_url = "{$config['system']['firmware']['alturl']['firmwareurl']}"; diff --git a/usr/local/www/widgets/widgets/traffic_graphs.widget.php b/usr/local/www/widgets/widgets/traffic_graphs.widget.php index 9d1e76c..4686d0b 100644 --- a/usr/local/www/widgets/widgets/traffic_graphs.widget.php +++ b/usr/local/www/widgets/widgets/traffic_graphs.widget.php @@ -31,6 +31,8 @@ POSSIBILITY OF SUCH DAMAGE. */ +$nocsrf = true; + require_once("guiconfig.inc"); require_once("pfsense-utils.inc"); require_once("functions.inc"); diff --git a/usr/local/www/widgets/widgets/wake_on_lan.widget.php b/usr/local/www/widgets/widgets/wake_on_lan.widget.php index bb253d0..598dc1f 100644 --- a/usr/local/www/widgets/widgets/wake_on_lan.widget.php +++ b/usr/local/www/widgets/widgets/wake_on_lan.widget.php @@ -25,6 +25,8 @@ POSSIBILITY OF SUCH DAMAGE. */ +$nocsrf = true; + require_once("/usr/local/www/widgets/include/wake_on_lan.inc"); if (is_array($config['wol']['wolentry'])) @@ -47,11 +49,7 @@ else if (count($wolcomputers) > 0) { foreach($wolcomputers as $wolent) { echo '<tr><td class="listlr">' . $wolent['descr'] . '<br />' . $wolent['mac'] . '</td>' . "\n"; - $wolifname = $config['interfaces'][$wolent['interface']]['descr']; - if ( empty( $wolifname ) ){ - $wolifname = ucase($wolent['interface']); - } - echo '<td class="listr">' . $wolifname . '</td>' . "\n"; + echo '<td class="listr">' . convert_friendly_interface_to_friendly_descr($wolent['interface']) . '</td>' . "\n"; $is_active = exec("/usr/sbin/arp -an |/usr/bin/grep {$wolent['mac']}| /usr/bin/wc -l|/usr/bin/awk '{print $1;}'"); if($is_active == 1) { |