aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2012-12-19 08:43:26 -0500
committerjim-p <jimp@pfsense.org>2012-12-19 08:43:26 -0500
commit4b9744c335eb78d2bd3b65472014bf37a52c0956 (patch)
tree0d13f9c97253ac1fcdb931afab4cdc51d4780d1b
parente95a728e12b48cbfddcd2d5e9b2c17a938ee3565 (diff)
downloadpfsense-packages-4b9744c335eb78d2bd3b65472014bf37a52c0956.tar.gz
pfsense-packages-4b9744c335eb78d2bd3b65472014bf37a52c0956.tar.bz2
pfsense-packages-4b9744c335eb78d2bd3b65472014bf37a52c0956.zip
Normalize line endings
-rw-r--r--config/mactovendor/bin/diag_arp.php_678
-rw-r--r--config/mactovendor/bin/status_dhcp_leases.php_868
-rw-r--r--config/mactovendor/bin/status_interfaces.php_706
-rw-r--r--config/mactovendor/bin/status_wireless.php_416
-rw-r--r--config/openvpn-client-export/source/dotnet2.nsh184
-rw-r--r--config/postfix/postfix_recipients.php6
-rw-r--r--config/squid-reverse/squid_reverse.inc374
7 files changed, 1616 insertions, 1616 deletions
diff --git a/config/mactovendor/bin/diag_arp.php_ b/config/mactovendor/bin/diag_arp.php_
index b72b73cd..97e9b4bc 100644
--- a/config/mactovendor/bin/diag_arp.php_
+++ b/config/mactovendor/bin/diag_arp.php_
@@ -1,339 +1,339 @@
-<?php
-/*
- diag_arp.php
- part of the pfSense project (http://www.pfsense.org)
- Copyright (C) 2004-2009 Scott Ullrich <sullrich@gmail.com>
-
- originally part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2005 Paul Taylor (paultaylor@winndixie.com) and 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: /bin/cat /usr/sbin/arp
- pfSense_MODULE: arp
-*/
-
-##|+PRIV
-##|*IDENT=page-diagnostics-arptable
-##|*NAME=Diagnostics: ARP Table page
-##|*DESCR=Allow access to the 'Diagnostics: ARP Table' page.
-##|*MATCH=diag_arp.php*
-##|-PRIV
-
-@ini_set('zlib.output_compression', 0);
-@ini_set('implicit_flush', 1);
-
-require("guiconfig.inc");
-
-function leasecmp($a, $b) {
- return strcmp($a[$_GET['order']], $b[$_GET['order']]);
-}
-
-function adjust_gmt($dt) {
- $ts = strtotime($dt . " GMT");
- return strftime("%Y/%m/%d %H:%M:%S", $ts);
-}
-
-function remove_duplicate($array, $field) {
- foreach ($array as $sub)
- $cmp[] = $sub[$field];
- $unique = array_unique($cmp);
- foreach ($unique as $k => $rien)
- $new[] = $array[$k];
- return $new;
-}
-
-// Define path to AWK
-$awk = "/usr/bin/awk";
-
-// Read in leases file
-$leasesfile = "{$g['dhcpd_chroot_path']}/var/db/dhcpd.leases";
-
-/* this pattern sticks comments into a single array item */
-$cleanpattern = "'{ gsub(\"#.*\", \"\");} { gsub(\";\", \"\"); print;}'";
-
-/* We then split the leases file by } */
-$splitpattern = "'BEGIN { RS=\"}\";} {for (i=1; i<=NF; i++) printf \"%s \", \$i; printf \"}\\n\";}'";
-
-/* stuff the leases file in a proper format into a array by line */
-exec("cat {$leasesfile} | {$awk} {$cleanpattern} | {$awk} {$splitpattern}", $leases_content);
-$leases_count = count($leases_content);
-
-$pools = array();
-$leases = array();
-$i = 0;
-$l = 0;
-$p = 0;
-// Put everything together again
-while($i < $leases_count) {
- /* split the line by space */
- $data = explode(" ", $leases_content[$i]);
- /* walk the fields */
- $f = 0;
- $fcount = count($data);
- /* with less then 20 fields there is nothing useful */
- if($fcount < 20) {
- $i++;
- continue;
- }
- while($f < $fcount) {
- switch($data[$f]) {
- case "failover":
- $pools[$p]['name'] = $data[$f+2];
- $pools[$p]['mystate'] = $data[$f+7];
- $pools[$p]['peerstate'] = $data[$f+14];
- $pools[$p]['mydate'] = $data[$f+10];
- $pools[$p]['mydate'] .= " " . $data[$f+11];
- $pools[$p]['peerdate'] = $data[$f+17];
- $pools[$p]['peerdate'] .= " " . $data[$f+18];
- $p++;
- $i++;
- continue 3;
- case "lease":
- $leases[$l]['ip'] = $data[$f+1];
- $leases[$l]['type'] = "dynamic";
- $f = $f+2;
- break;
- case "starts":
- $leases[$l]['start'] = $data[$f+2];
- $leases[$l]['start'] .= " " . $data[$f+3];
- $f = $f+3;
- break;
- case "ends":
- $leases[$l]['end'] = $data[$f+2];
- $leases[$l]['end'] .= " " . $data[$f+3];
- $f = $f+3;
- break;
- case "tstp":
- $f = $f+3;
- break;
- case "tsfp":
- $f = $f+3;
- break;
- case "atsfp":
- $f = $f+3;
- break;
- case "cltt":
- $f = $f+3;
- break;
- case "binding":
- switch($data[$f+2]) {
- case "active":
- $leases[$l]['act'] = "active";
- break;
- case "free":
- $leases[$l]['act'] = "expired";
- $leases[$l]['online'] = "offline";
- break;
- case "backup":
- $leases[$l]['act'] = "reserved";
- $leases[$l]['online'] = "offline";
- break;
- }
- $f = $f+1;
- break;
- case "next":
- /* skip the next binding statement */
- $f = $f+3;
- break;
- case "hardware":
- $leases[$l]['mac'] = $data[$f+2];
- /* check if it's online and the lease is active */
- if($leases[$l]['act'] == "active") {
- $online = exec("/usr/sbin/arp -an |/usr/bin/awk '/{$leases[$l]['ip']}/ {print}'|wc -l");
- if ($online == 1) {
- $leases[$l]['online'] = 'online';
- } else {
- $leases[$l]['online'] = 'offline';
- }
- }
- $f = $f+2;
- break;
- case "client-hostname":
- if($data[$f+1] <> "") {
- $leases[$l]['hostname'] = preg_replace('/"/','',$data[$f+1]);
- } else {
- $hostname = gethostbyaddr($leases[$l]['ip']);
- if($hostname <> "") {
- $leases[$l]['hostname'] = $hostname;
- }
- }
- $f = $f+1;
- break;
- case "uid":
- $f = $f+1;
- break;
- }
- $f++;
- }
- $l++;
- $i++;
-}
-
-/* remove duplicate items by mac address */
-if(count($leases) > 0) {
- $leases = remove_duplicate($leases,"ip");
-}
-
-if(count($pools) > 0) {
- $pools = remove_duplicate($pools,"name");
- asort($pools);
-}
-
-// Put this in an easy to use form
-$dhcpmac = array();
-$dhcpip = array();
-
-foreach ($leases as $value) {
- $dhcpmac[$value['mac']] = $value['hostname'];
- $dhcpip[$value['ip']] = $value['hostname'];
-}
-
-exec("/usr/sbin/arp -an",$rawdata);
-
-$i = 0;
-
-/* if list */
-$ifdescrs = get_configured_interface_with_descr();
-
-foreach ($ifdescrs as $key =>$interface) {
- $hwif[$config['interfaces'][$key]['if']] = $interface;
-}
-
-$data = array();
-foreach ($rawdata as $line) {
- $elements = explode(' ',$line);
-
- if ($elements[3] != "(incomplete)") {
- $arpent = array();
- $arpent['ip'] = trim(str_replace(array('(',')'),'',$elements[1]));
- $arpent['mac'] = trim($elements[3]);
- $arpent['interface'] = trim($elements[5]);
- $data[] = $arpent;
- }
-}
-
-function _getHostName($mac,$ip)
-{
- global $dhcpmac, $dhcpip;
-
- if ($dhcpmac[$mac])
- return $dhcpmac[$mac];
- else if ($dhcpip[$ip])
- return $dhcpip[$ip];
- else if(gethostbyaddr($ip) <> "" and gethostbyaddr($ip) <> $ip)
- return gethostbyaddr($ip);
- else
- return "";
-}
-
-$pgtitle = array(gettext("Diagnostics"),gettext("ARP Table"));
-include("head.inc");
-
-?>
-
-<body link="#000000" vlink="#000000" alink="#000000">
-
-<?php include("fbegin.inc"); ?>
-
-<div id="loading">
- <img src="/themes/<?=$g['theme'];?>/images/misc/loader.gif"><?= gettext("Loading, please wait..."); ?>
- <p/>&nbsp;
-</div>
-
-<?php
-
-// Flush buffers out to client so that they see Loading, please wait....
-for ($i = 0; $i < ob_get_level(); $i++) { ob_end_flush(); }
-ob_implicit_flush(1);
-
-// Resolve hostnames and replace Z_ with "". The intention
-// is to sort the list by hostnames, alpha and then the non
-// resolvable addresses will appear last in the list.
-foreach ($data as &$entry) {
- $dns = trim(_getHostName($entry['mac'], $entry['ip']));
- if(trim($dns))
- $entry['dnsresolve'] = "$dns";
- else
- $entry['dnsresolve'] = "Z_ ";
-}
-
-// Sort the data alpha first
-$data = msort($data, "dnsresolve");
-
-// Load MAC-Manufacturer table
-$macs=file("/usr/local/pkg/mactovendor/mac-prefixes");
-if ($macs){
- foreach ($macs as $line){
- if (preg_match('/([0-9A-Fa-f]{6}) (.*)$/', $line, $matches)){
- /* store values like this $mac_man['000C29']='VMware' */
- $mac_man["$matches[1]"]=$matches[2];
- }
- }
-}
-
-?>
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td>
- <table class="tabcont sortable" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="listhdrr"><?= gettext("IP address"); ?></td>
- <td class="listhdrr"><?= gettext("MAC address"); ?></td>
- <td class="listhdrr"><?= gettext("Hostname"); ?></td>
- <td class="listhdr"><?= gettext("Interface"); ?></td>
- <td class="list"></td>
- </tr>
- <?php foreach ($data as $entry): ?>
- <tr>
- <td class="listlr"><?=$entry['ip'];?></td>
- <td class="listr">
- <?php
- $mac=$entry['mac'];
- $mac_hi = strtoupper($mac[0] . $mac[1] . $mac[3] . $mac[4] . $mac[6] . $mac[7]);
- if(isset($mac_man[$mac_hi])){
- $mac_man_ar = explode(' ', $mac_man[$mac_hi]);
- print "<span title=\"$mac, {$mac_man[$mac_hi]}\">" . $mac_man_ar[0] . substr($mac, 8) . "</span>"; }
- else{ print $mac; }
- ?>
- </td>
- <td class="listr">
- <?php
- echo str_replace("Z_ ", "", $entry['dnsresolve']);
- ?>
- </td>
- <td class="listr"><?=$hwif[$entry['interface']];?></td>
- </tr>
- <?php endforeach; ?>
- </table>
- </td>
- </tr>
-</table>
-
-<?php include("fend.inc"); ?>
-
-<script type="text/javascript">
- $('loading').innerHTML = '';
-</script>
+<?php
+/*
+ diag_arp.php
+ part of the pfSense project (http://www.pfsense.org)
+ Copyright (C) 2004-2009 Scott Ullrich <sullrich@gmail.com>
+
+ originally part of m0n0wall (http://m0n0.ch/wall)
+ Copyright (C) 2005 Paul Taylor (paultaylor@winndixie.com) and 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: /bin/cat /usr/sbin/arp
+ pfSense_MODULE: arp
+*/
+
+##|+PRIV
+##|*IDENT=page-diagnostics-arptable
+##|*NAME=Diagnostics: ARP Table page
+##|*DESCR=Allow access to the 'Diagnostics: ARP Table' page.
+##|*MATCH=diag_arp.php*
+##|-PRIV
+
+@ini_set('zlib.output_compression', 0);
+@ini_set('implicit_flush', 1);
+
+require("guiconfig.inc");
+
+function leasecmp($a, $b) {
+ return strcmp($a[$_GET['order']], $b[$_GET['order']]);
+}
+
+function adjust_gmt($dt) {
+ $ts = strtotime($dt . " GMT");
+ return strftime("%Y/%m/%d %H:%M:%S", $ts);
+}
+
+function remove_duplicate($array, $field) {
+ foreach ($array as $sub)
+ $cmp[] = $sub[$field];
+ $unique = array_unique($cmp);
+ foreach ($unique as $k => $rien)
+ $new[] = $array[$k];
+ return $new;
+}
+
+// Define path to AWK
+$awk = "/usr/bin/awk";
+
+// Read in leases file
+$leasesfile = "{$g['dhcpd_chroot_path']}/var/db/dhcpd.leases";
+
+/* this pattern sticks comments into a single array item */
+$cleanpattern = "'{ gsub(\"#.*\", \"\");} { gsub(\";\", \"\"); print;}'";
+
+/* We then split the leases file by } */
+$splitpattern = "'BEGIN { RS=\"}\";} {for (i=1; i<=NF; i++) printf \"%s \", \$i; printf \"}\\n\";}'";
+
+/* stuff the leases file in a proper format into a array by line */
+exec("cat {$leasesfile} | {$awk} {$cleanpattern} | {$awk} {$splitpattern}", $leases_content);
+$leases_count = count($leases_content);
+
+$pools = array();
+$leases = array();
+$i = 0;
+$l = 0;
+$p = 0;
+// Put everything together again
+while($i < $leases_count) {
+ /* split the line by space */
+ $data = explode(" ", $leases_content[$i]);
+ /* walk the fields */
+ $f = 0;
+ $fcount = count($data);
+ /* with less then 20 fields there is nothing useful */
+ if($fcount < 20) {
+ $i++;
+ continue;
+ }
+ while($f < $fcount) {
+ switch($data[$f]) {
+ case "failover":
+ $pools[$p]['name'] = $data[$f+2];
+ $pools[$p]['mystate'] = $data[$f+7];
+ $pools[$p]['peerstate'] = $data[$f+14];
+ $pools[$p]['mydate'] = $data[$f+10];
+ $pools[$p]['mydate'] .= " " . $data[$f+11];
+ $pools[$p]['peerdate'] = $data[$f+17];
+ $pools[$p]['peerdate'] .= " " . $data[$f+18];
+ $p++;
+ $i++;
+ continue 3;
+ case "lease":
+ $leases[$l]['ip'] = $data[$f+1];
+ $leases[$l]['type'] = "dynamic";
+ $f = $f+2;
+ break;
+ case "starts":
+ $leases[$l]['start'] = $data[$f+2];
+ $leases[$l]['start'] .= " " . $data[$f+3];
+ $f = $f+3;
+ break;
+ case "ends":
+ $leases[$l]['end'] = $data[$f+2];
+ $leases[$l]['end'] .= " " . $data[$f+3];
+ $f = $f+3;
+ break;
+ case "tstp":
+ $f = $f+3;
+ break;
+ case "tsfp":
+ $f = $f+3;
+ break;
+ case "atsfp":
+ $f = $f+3;
+ break;
+ case "cltt":
+ $f = $f+3;
+ break;
+ case "binding":
+ switch($data[$f+2]) {
+ case "active":
+ $leases[$l]['act'] = "active";
+ break;
+ case "free":
+ $leases[$l]['act'] = "expired";
+ $leases[$l]['online'] = "offline";
+ break;
+ case "backup":
+ $leases[$l]['act'] = "reserved";
+ $leases[$l]['online'] = "offline";
+ break;
+ }
+ $f = $f+1;
+ break;
+ case "next":
+ /* skip the next binding statement */
+ $f = $f+3;
+ break;
+ case "hardware":
+ $leases[$l]['mac'] = $data[$f+2];
+ /* check if it's online and the lease is active */
+ if($leases[$l]['act'] == "active") {
+ $online = exec("/usr/sbin/arp -an |/usr/bin/awk '/{$leases[$l]['ip']}/ {print}'|wc -l");
+ if ($online == 1) {
+ $leases[$l]['online'] = 'online';
+ } else {
+ $leases[$l]['online'] = 'offline';
+ }
+ }
+ $f = $f+2;
+ break;
+ case "client-hostname":
+ if($data[$f+1] <> "") {
+ $leases[$l]['hostname'] = preg_replace('/"/','',$data[$f+1]);
+ } else {
+ $hostname = gethostbyaddr($leases[$l]['ip']);
+ if($hostname <> "") {
+ $leases[$l]['hostname'] = $hostname;
+ }
+ }
+ $f = $f+1;
+ break;
+ case "uid":
+ $f = $f+1;
+ break;
+ }
+ $f++;
+ }
+ $l++;
+ $i++;
+}
+
+/* remove duplicate items by mac address */
+if(count($leases) > 0) {
+ $leases = remove_duplicate($leases,"ip");
+}
+
+if(count($pools) > 0) {
+ $pools = remove_duplicate($pools,"name");
+ asort($pools);
+}
+
+// Put this in an easy to use form
+$dhcpmac = array();
+$dhcpip = array();
+
+foreach ($leases as $value) {
+ $dhcpmac[$value['mac']] = $value['hostname'];
+ $dhcpip[$value['ip']] = $value['hostname'];
+}
+
+exec("/usr/sbin/arp -an",$rawdata);
+
+$i = 0;
+
+/* if list */
+$ifdescrs = get_configured_interface_with_descr();
+
+foreach ($ifdescrs as $key =>$interface) {
+ $hwif[$config['interfaces'][$key]['if']] = $interface;
+}
+
+$data = array();
+foreach ($rawdata as $line) {
+ $elements = explode(' ',$line);
+
+ if ($elements[3] != "(incomplete)") {
+ $arpent = array();
+ $arpent['ip'] = trim(str_replace(array('(',')'),'',$elements[1]));
+ $arpent['mac'] = trim($elements[3]);
+ $arpent['interface'] = trim($elements[5]);
+ $data[] = $arpent;
+ }
+}
+
+function _getHostName($mac,$ip)
+{
+ global $dhcpmac, $dhcpip;
+
+ if ($dhcpmac[$mac])
+ return $dhcpmac[$mac];
+ else if ($dhcpip[$ip])
+ return $dhcpip[$ip];
+ else if(gethostbyaddr($ip) <> "" and gethostbyaddr($ip) <> $ip)
+ return gethostbyaddr($ip);
+ else
+ return "";
+}
+
+$pgtitle = array(gettext("Diagnostics"),gettext("ARP Table"));
+include("head.inc");
+
+?>
+
+<body link="#000000" vlink="#000000" alink="#000000">
+
+<?php include("fbegin.inc"); ?>
+
+<div id="loading">
+ <img src="/themes/<?=$g['theme'];?>/images/misc/loader.gif"><?= gettext("Loading, please wait..."); ?>
+ <p/>&nbsp;
+</div>
+
+<?php
+
+// Flush buffers out to client so that they see Loading, please wait....
+for ($i = 0; $i < ob_get_level(); $i++) { ob_end_flush(); }
+ob_implicit_flush(1);
+
+// Resolve hostnames and replace Z_ with "". The intention
+// is to sort the list by hostnames, alpha and then the non
+// resolvable addresses will appear last in the list.
+foreach ($data as &$entry) {
+ $dns = trim(_getHostName($entry['mac'], $entry['ip']));
+ if(trim($dns))
+ $entry['dnsresolve'] = "$dns";
+ else
+ $entry['dnsresolve'] = "Z_ ";
+}
+
+// Sort the data alpha first
+$data = msort($data, "dnsresolve");
+
+// Load MAC-Manufacturer table
+$macs=file("/usr/local/pkg/mactovendor/mac-prefixes");
+if ($macs){
+ foreach ($macs as $line){
+ if (preg_match('/([0-9A-Fa-f]{6}) (.*)$/', $line, $matches)){
+ /* store values like this $mac_man['000C29']='VMware' */
+ $mac_man["$matches[1]"]=$matches[2];
+ }
+ }
+}
+
+?>
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td>
+ <table class="tabcont sortable" width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td class="listhdrr"><?= gettext("IP address"); ?></td>
+ <td class="listhdrr"><?= gettext("MAC address"); ?></td>
+ <td class="listhdrr"><?= gettext("Hostname"); ?></td>
+ <td class="listhdr"><?= gettext("Interface"); ?></td>
+ <td class="list"></td>
+ </tr>
+ <?php foreach ($data as $entry): ?>
+ <tr>
+ <td class="listlr"><?=$entry['ip'];?></td>
+ <td class="listr">
+ <?php
+ $mac=$entry['mac'];
+ $mac_hi = strtoupper($mac[0] . $mac[1] . $mac[3] . $mac[4] . $mac[6] . $mac[7]);
+ if(isset($mac_man[$mac_hi])){
+ $mac_man_ar = explode(' ', $mac_man[$mac_hi]);
+ print "<span title=\"$mac, {$mac_man[$mac_hi]}\">" . $mac_man_ar[0] . substr($mac, 8) . "</span>"; }
+ else{ print $mac; }
+ ?>
+ </td>
+ <td class="listr">
+ <?php
+ echo str_replace("Z_ ", "", $entry['dnsresolve']);
+ ?>
+ </td>
+ <td class="listr"><?=$hwif[$entry['interface']];?></td>
+ </tr>
+ <?php endforeach; ?>
+ </table>
+ </td>
+ </tr>
+</table>
+
+<?php include("fend.inc"); ?>
+
+<script type="text/javascript">
+ $('loading').innerHTML = '';
+</script>
diff --git a/config/mactovendor/bin/status_dhcp_leases.php_ b/config/mactovendor/bin/status_dhcp_leases.php_
index 58ef71b0..311b617c 100644
--- a/config/mactovendor/bin/status_dhcp_leases.php_
+++ b/config/mactovendor/bin/status_dhcp_leases.php_
@@ -1,434 +1,434 @@
-<?php
-/* $Id$ */
-/*
- status_dhcp_leases.php
- Copyright (C) 2004-2009 Scott Ullrich
- All rights reserved.
-
- originially 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: /usr/bin/awk /bin/cat /usr/sbin/arp /usr/bin/wc /usr/bin/grep
- pfSense_MODULE: dhcpserver
-*/
-
-##|+PRIV
-##|*IDENT=page-status-dhcpleases
-##|*NAME=Status: DHCP leases page
-##|*DESCR=Allow access to the 'Status: DHCP leases' page.
-##|*MATCH=status_dhcp_leases.php*
-##|-PRIV
-
-require("guiconfig.inc");
-
-$pgtitle = array(gettext("Status"),gettext("DHCP leases"));
-
-$leasesfile = "{$g['dhcpd_chroot_path']}/var/db/dhcpd.leases";
-
-if (($_GET['deleteip']) && (is_ipaddr($_GET['deleteip']))) {
- /* Stop DHCPD */
- killbyname("dhcpd");
-
- /* Read existing leases */
- $leases_contents = explode("\n", file_get_contents($leasesfile));
- $newleases_contents = array();
- $i=0;
- while ($i < count($leases_contents)) {
- /* Find the lease(s) we want to delete */
- if ($leases_contents[$i] == "lease {$_GET['deleteip']} {") {
- /* Skip to the end of the lease declaration */
- do {
- $i++;
- } while ($leases_contents[$i] != "}");
- } else {
- /* It's a line we want to keep, copy it over. */
- $newleases_contents[] = $leases_contents[$i];
- }
- $i++;
- }
-
- /* Write out the new leases file */
- $fd = fopen($leasesfile, 'w');
- fwrite($fd, implode("\n", $newleases_contents));
- fclose($fd);
-
- /* Restart DHCP Service */
- services_dhcpd_configure();
- header("Location: status_dhcp_leases.php?all={$_GET['all']}");
-}
-
-include("head.inc");
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<?php
-
-function leasecmp($a, $b) {
- return strcmp($a[$_GET['order']], $b[$_GET['order']]);
-}
-
-function adjust_gmt($dt) {
- $ts = strtotime($dt . " GMT");
- return strftime("%Y/%m/%d %H:%M:%S", $ts);
-}
-
-function remove_duplicate($array, $field)
-{
- foreach ($array as $sub)
- $cmp[] = $sub[$field];
- $unique = array_unique(array_reverse($cmp,true));
- foreach ($unique as $k => $rien)
- $new[] = $array[$k];
- return $new;
-}
-
-$awk = "/usr/bin/awk";
-/* this pattern sticks comments into a single array item */
-$cleanpattern = "'{ gsub(\"#.*\", \"\");} { gsub(\";\", \"\"); print;}'";
-/* We then split the leases file by } */
-$splitpattern = "'BEGIN { RS=\"}\";} {for (i=1; i<=NF; i++) printf \"%s \", \$i; printf \"}\\n\";}'";
-
-/* stuff the leases file in a proper format into a array by line */
-exec("/bin/cat {$leasesfile} | {$awk} {$cleanpattern} | {$awk} {$splitpattern}", $leases_content);
-$leases_count = count($leases_content);
-exec("/usr/sbin/arp -an", $rawdata);
-$arpdata = array();
-foreach ($rawdata as $line) {
- $elements = explode(' ',$line);
- if ($elements[3] != "(incomplete)") {
- $arpent = array();
- $arpent['ip'] = trim(str_replace(array('(',')'),'',$elements[1]));
- // $arpent['mac'] = trim($elements[3]);
- // $arpent['interface'] = trim($elements[5]);
- $arpdata[] = $arpent['ip'];
- }
-}
-
-$pools = array();
-$leases = array();
-$i = 0;
-$l = 0;
-$p = 0;
-
-// Put everything together again
-while($i < $leases_count) {
- /* split the line by space */
- $data = explode(" ", $leases_content[$i]);
- /* walk the fields */
- $f = 0;
- $fcount = count($data);
- /* with less then 20 fields there is nothing useful */
- if($fcount < 20) {
- $i++;
- continue;
- }
- while($f < $fcount) {
- switch($data[$f]) {
- case "failover":
- $pools[$p]['name'] = $data[$f+2];
- $pools[$p]['mystate'] = $data[$f+7];
- $pools[$p]['peerstate'] = $data[$f+14];
- $pools[$p]['mydate'] = $data[$f+10];
- $pools[$p]['mydate'] .= " " . $data[$f+11];
- $pools[$p]['peerdate'] = $data[$f+17];
- $pools[$p]['peerdate'] .= " " . $data[$f+18];
- $p++;
- $i++;
- continue 3;
- case "lease":
- $leases[$l]['ip'] = $data[$f+1];
- $leases[$l]['type'] = "dynamic";
- $f = $f+2;
- break;
- case "starts":
- $leases[$l]['start'] = $data[$f+2];
- $leases[$l]['start'] .= " " . $data[$f+3];
- $f = $f+3;
- break;
- case "ends":
- $leases[$l]['end'] = $data[$f+2];
- $leases[$l]['end'] .= " " . $data[$f+3];
- $f = $f+3;
- break;
- case "tstp":
- $f = $f+3;
- break;
- case "tsfp":
- $f = $f+3;
- break;
- case "atsfp":
- $f = $f+3;
- break;
- case "cltt":
- $f = $f+3;
- break;
- case "binding":
- switch($data[$f+2]) {
- case "active":
- $leases[$l]['act'] = "active";
- break;
- case "free":
- $leases[$l]['act'] = "expired";
- $leases[$l]['online'] = "offline";
- break;
- case "backup":
- $leases[$l]['act'] = "reserved";
- $leases[$l]['online'] = "offline";
- break;
- }
- $f = $f+1;
- break;
- case "next":
- /* skip the next binding statement */
- $f = $f+3;
- break;
- case "hardware":
- $leases[$l]['mac'] = $data[$f+2];
- /* check if it's online and the lease is active */
- if (in_array($leases[$l]['ip'], $arpdata)) {
- $leases[$l]['online'] = 'online';
- } else {
- $leases[$l]['online'] = 'offline';
- }
- $f = $f+2;
- break;
- case "client-hostname":
- if($data[$f+1] <> "") {
- $leases[$l]['hostname'] = preg_replace('/"/','',$data[$f+1]);
- } else {
- $hostname = gethostbyaddr($leases[$l]['ip']);
- if($hostname <> "") {
- $leases[$l]['hostname'] = $hostname;
- }
- }
- $f = $f+1;
- break;
- case "uid":
- $f = $f+1;
- break;
- }
- $f++;
- }
- $l++;
- $i++;
-}
-
-/* remove duplicate items by mac address */
-if(count($leases) > 0) {
- $leases = remove_duplicate($leases,"ip");
-}
-
-if(count($pools) > 0) {
- $pools = remove_duplicate($pools,"name");
- asort($pools);
-}
-
-foreach($config['interfaces'] as $ifname => $ifarr) {
- if (is_array($config['dhcpd'][$ifname]) &&
- is_array($config['dhcpd'][$ifname]['staticmap'])) {
- foreach($config['dhcpd'][$ifname]['staticmap'] as $static) {
- $slease = array();
- $slease['ip'] = $static['ipaddr'];
- $slease['type'] = "static";
- $slease['mac'] = $static['mac'];
- $slease['start'] = "";
- $slease['end'] = "";
- $slease['hostname'] = htmlentities($static['hostname']);
- $slease['act'] = "static";
- $online = exec("/usr/sbin/arp -an |/usr/bin/grep {$slease['mac']}| /usr/bin/wc -l|/usr/bin/awk '{print $1;}'");
- if ($online == 1) {
- $slease['online'] = 'online';
- } else {
- $slease['online'] = 'offline';
- }
- $leases[] = $slease;
- }
- }
-}
-
-if ($_GET['order'])
- usort($leases, "leasecmp");
-
-/* only print pool status when we have one */
-if(count($pools) > 0) {
-?>
-<table class="tabcont sortable" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="listhdrr"><?=gettext("Failover Group"); ?></a></td>
- <td class="listhdrr"><?=gettext("My State"); ?></a></td>
- <td class="listhdrr"><?=gettext("Since"); ?></a></td>
- <td class="listhdrr"><?=gettext("Peer State"); ?></a></td>
- <td class="listhdrr"><?=gettext("Since"); ?></a></td>
- </tr>
-<?php
-foreach ($pools as $data) {
- echo "<tr>\n";
- echo "<td class=\"listlr\">{$fspans}{$data['name']}{$fspane}&nbsp;</td>\n";
- echo "<td class=\"listr\">{$fspans}{$data['mystate']}{$fspane}&nbsp;</td>\n";
- echo "<td class=\"listr\">{$fspans}" . adjust_gmt($data['mydate']) . "{$fspane}&nbsp;</td>\n";
- echo "<td class=\"listr\">{$fspans}{$data['peerstate']}{$fspane}&nbsp;</td>\n";
- echo "<td class=\"listr\">{$fspans}" . adjust_gmt($data['peerdate']) . "{$fspane}&nbsp;</td>\n";
- echo "<td class=\"list\" valign=\"middle\" width=\"17\">&nbsp;</td>\n";
- echo "<td class=\"list\" valign=\"middle\" width=\"17\">&nbsp;</td>\n";
- echo "</tr>\n";
-}
-
-?>
-</table>
-
-<?php
-/* only print pool status when we have one */
-}
-?>
-
-<p>
-
-<table class="tabcont sortable" width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td class="listhdrr"><a href="#"><?=gettext("IP address"); ?></a></td>
- <td class="listhdrr"><a href="#"><?=gettext("MAC address"); ?></a></td>
- <td class="listhdrr"><a href="#"><?=gettext("Hostname"); ?></a></td>
- <td class="listhdrr"><a href="#"><?=gettext("Start"); ?></a></td>
- <td class="listhdrr"><a href="#"><?=gettext("End"); ?></a></td>
- <td class="listhdrr"><a href="#"><?=gettext("Online"); ?></a></td>
- <td class="listhdrr"><a href="#"><?=gettext("Lease Type"); ?></a></td>
- </tr>
-<?php
-// Load MAC-Manufacturer table
-$macs=file("/usr/local/pkg/mactovendor/mac-prefixes");
-if ($macs){
- foreach ($macs as $line){
- if (preg_match('/([0-9A-Fa-f]{6}) (.*)$/', $line, $matches)){
- /* store values like this $mac_man['000C29']='VMware' */
- $mac_man["$matches[1]"]=$matches[2];
- }
- }
-}
-
-foreach ($leases as $data) {
- if (($data['act'] == "active") || ($data['act'] == "static") || ($_GET['all'] == 1)) {
- if ($data['act'] != "active" && $data['act'] != "static") {
- $fspans = "<span class=\"gray\">";
- $fspane = "</span>";
- } else {
- $fspans = $fspane = "";
- }
- $lip = ip2ulong($data['ip']);
- if ($data['act'] == "static") {
- foreach ($config['dhcpd'] as $dhcpif => $dhcpifconf) {
- if(is_array($dhcpifconf['staticmap'])) {
- foreach ($dhcpifconf['staticmap'] as $staticent) {
- if ($data['ip'] == $staticent['ipaddr']) {
- $data['if'] = $dhcpif;
- break;
- }
- }
- }
- /* exit as soon as we have an interface */
- if ($data['if'] != "")
- break;
- }
- } else {
- foreach ($config['dhcpd'] as $dhcpif => $dhcpifconf) {
- if (($lip >= ip2ulong($dhcpifconf['range']['from'])) && ($lip <= ip2ulong($dhcpifconf['range']['to']))) {
- $data['if'] = $dhcpif;
- break;
- }
- }
- }
- echo "<tr>\n";
- echo "<td class=\"listlr\">{$fspans}{$data['ip']}{$fspane}&nbsp;</td>\n";
- $mac=$data['mac'];
- $mac_hi = strtoupper($mac[0] . $mac[1] . $mac[3] . $mac[4] . $mac[6] . $mac[7]);
- if ($data['online'] != "online") {
- if(isset($mac_man[$mac_hi])){ // Manufacturer for this MAC is defined
- $mac_man_ar = explode(' ', $mac_man[$mac_hi]);
- echo "<td class=\"listr\">{$fspans}<a href=\"services_wol.php?if={$data['if']}&mac=$mac\" title=\"" . gettext("$mac, {$mac_man[$mac_hi]} - send Wake on LAN packet to this MAC address") ."\">" . $mac_man_ar[0] . substr($mac, 8) . "</a>{$fspane}&nbsp;</td>\n";
- }else{
- echo "<td class=\"listr\">{$fspans}<a href=\"services_wol.php?if={$data['if']}&mac={$data['mac']}\" title=\"" . gettext("send Wake on LAN packet to this MAC address") ."\">{$data['mac']}</a>{$fspane}&nbsp;</td>\n";
- }
- } else {
- if(isset($mac_man[$mac_hi])){ // Manufacturer for this MAC is defined
- $mac_man_ar = explode(' ', $mac_man[$mac_hi]);
- echo "<td class=\"listr\">{$fspans}<span title=\"$mac, {$mac_man[$mac_hi]}\">" . $mac_man_ar[0] . substr($mac, 8) . "</span>{$fspane}&nbsp;</td>\n";
- }else{
- echo "<td class=\"listr\">{$fspans}{$data['mac']}{$fspane}&nbsp;</td>\n";
- }
- }
- echo "<td class=\"listr\">{$fspans}" . htmlentities($data['hostname']) . "{$fspane}&nbsp;</td>\n";
- if ($data['type'] != "static") {
- echo "<td class=\"listr\">{$fspans}" . adjust_gmt($data['start']) . "{$fspane}&nbsp;</td>\n";
- echo "<td class=\"listr\">{$fspans}" . adjust_gmt($data['end']) . "{$fspane}&nbsp;</td>\n";
- } else {
- echo "<td class=\"listr\">{$fspans} n/a {$fspane}&nbsp;</td>\n";
- echo "<td class=\"listr\">{$fspans} n/a {$fspane}&nbsp;</td>\n";
- }
- echo "<td class=\"listr\">{$fspans}{$data['online']}{$fspane}&nbsp;</td>\n";
- echo "<td class=\"listr\">{$fspans}{$data['act']}{$fspane}&nbsp;</td>\n";
-
- if ($data['type'] == "dynamic") {
- echo "<td valign=\"middle\"><a href=\"services_dhcp_edit.php?if={$data['if']}&mac={$data['mac']}&hostname={$data['hostname']}\">";
- echo "<img src=\"/themes/{$g['theme']}/images/icons/icon_plus.gif\" width=\"17\" height=\"17\" border=\"0\" title=\"" . gettext("add a static mapping for this MAC address") ."\"></a></td>\n";
- } else {
- echo "<td class=\"list\" valign=\"middle\">";
- echo "<img src=\"/themes/{$g['theme']}/images/icons/icon_plus_mo.gif\" width=\"17\" height=\"17\" border=\"0\"></td>\n";
- }
-
- echo "<td valign=\"middle\"><a href=\"services_wol_edit.php?if={$data['if']}&mac={$data['mac']}&descr={$data['hostname']}\">";
- echo "<img src=\"/themes/{$g['theme']}/images/icons/icon_wol_all.gif\" width=\"17\" height=\"17\" border=\"0\" title=\"" . gettext("add a Wake on LAN mapping for this MAC address") ."\"></a></td>\n";
-
- /* Only show the button for offline dynamic leases */
- if (($data['type'] == "dynamic") && ($data['online'] != "online")) {
- echo "<td class=\"list\" valign=\"middle\"><a href=\"status_dhcp_leases.php?deleteip={$data['ip']}&all=" . htmlspecialchars($_GET['all']) . "\">";
- echo "<img src=\"/themes/{$g['theme']}/images/icons/icon_x.gif\" width=\"17\" height=\"17\" border=\"0\" title=\"" . gettext("delete this DHCP lease") . "\"></a></td>\n";
- }
- echo "</tr>\n";
- }
-}
-
-?>
-</table>
-<p>
-<form action="status_dhcp_leases.php" method="GET">
-<input type="hidden" name="order" value="<?=htmlspecialchars($_GET['order']);?>">
-<?php if ($_GET['all']): ?>
-<input type="hidden" name="all" value="0">
-<input type="submit" class="formbtn" value="<?=gettext("Show active and static leases only"); ?>">
-<?php else: ?>
-<input type="hidden" name="all" value="1">
-<input type="submit" class="formbtn" value="<?=gettext("Show all configured leases"); ?>">
-<?php endif; ?>
-</form>
-<?php if($leases == 0): ?>
-<p><strong><?=gettext("No leases file found. Is the DHCP server active"); ?>?</strong></p>
-<?php endif; ?>
-
-<?php include("fend.inc"); ?>
-</body>
-</html>
+<?php
+/* $Id$ */
+/*
+ status_dhcp_leases.php
+ Copyright (C) 2004-2009 Scott Ullrich
+ All rights reserved.
+
+ originially 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: /usr/bin/awk /bin/cat /usr/sbin/arp /usr/bin/wc /usr/bin/grep
+ pfSense_MODULE: dhcpserver
+*/
+
+##|+PRIV
+##|*IDENT=page-status-dhcpleases
+##|*NAME=Status: DHCP leases page
+##|*DESCR=Allow access to the 'Status: DHCP leases' page.
+##|*MATCH=status_dhcp_leases.php*
+##|-PRIV
+
+require("guiconfig.inc");
+
+$pgtitle = array(gettext("Status"),gettext("DHCP leases"));
+
+$leasesfile = "{$g['dhcpd_chroot_path']}/var/db/dhcpd.leases";
+
+if (($_GET['deleteip']) && (is_ipaddr($_GET['deleteip']))) {
+ /* Stop DHCPD */
+ killbyname("dhcpd");
+
+ /* Read existing leases */
+ $leases_contents = explode("\n", file_get_contents($leasesfile));
+ $newleases_contents = array();
+ $i=0;
+ while ($i < count($leases_contents)) {
+ /* Find the lease(s) we want to delete */
+ if ($leases_contents[$i] == "lease {$_GET['deleteip']} {") {
+ /* Skip to the end of the lease declaration */
+ do {
+ $i++;
+ } while ($leases_contents[$i] != "}");
+ } else {
+ /* It's a line we want to keep, copy it over. */
+ $newleases_contents[] = $leases_contents[$i];
+ }
+ $i++;
+ }
+
+ /* Write out the new leases file */
+ $fd = fopen($leasesfile, 'w');
+ fwrite($fd, implode("\n", $newleases_contents));
+ fclose($fd);
+
+ /* Restart DHCP Service */
+ services_dhcpd_configure();
+ header("Location: status_dhcp_leases.php?all={$_GET['all']}");
+}
+
+include("head.inc");
+
+?>
+
+<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
+<?php include("fbegin.inc"); ?>
+<?php
+
+function leasecmp($a, $b) {
+ return strcmp($a[$_GET['order']], $b[$_GET['order']]);
+}
+
+function adjust_gmt($dt) {
+ $ts = strtotime($dt . " GMT");
+ return strftime("%Y/%m/%d %H:%M:%S", $ts);
+}
+
+function remove_duplicate($array, $field)
+{
+ foreach ($array as $sub)
+ $cmp[] = $sub[$field];
+ $unique = array_unique(array_reverse($cmp,true));
+ foreach ($unique as $k => $rien)
+ $new[] = $array[$k];
+ return $new;
+}
+
+$awk = "/usr/bin/awk";
+/* this pattern sticks comments into a single array item */
+$cleanpattern = "'{ gsub(\"#.*\", \"\");} { gsub(\";\", \"\"); print;}'";
+/* We then split the leases file by } */
+$splitpattern = "'BEGIN { RS=\"}\";} {for (i=1; i<=NF; i++) printf \"%s \", \$i; printf \"}\\n\";}'";
+
+/* stuff the leases file in a proper format into a array by line */
+exec("/bin/cat {$leasesfile} | {$awk} {$cleanpattern} | {$awk} {$splitpattern}", $leases_content);
+$leases_count = count($leases_content);
+exec("/usr/sbin/arp -an", $rawdata);
+$arpdata = array();
+foreach ($rawdata as $line) {
+ $elements = explode(' ',$line);
+ if ($elements[3] != "(incomplete)") {
+ $arpent = array();
+ $arpent['ip'] = trim(str_replace(array('(',')'),'',$elements[1]));
+ // $arpent['mac'] = trim($elements[3]);
+ // $arpent['interface'] = trim($elements[5]);
+ $arpdata[] = $arpent['ip'];
+ }
+}
+
+$pools = array();
+$leases = array();
+$i = 0;
+$l = 0;
+$p = 0;
+
+// Put everything together again
+while($i < $leases_count) {
+ /* split the line by space */
+ $data = explode(" ", $leases_content[$i]);
+ /* walk the fields */
+ $f = 0;
+ $fcount = count($data);
+ /* with less then 20 fields there is nothing useful */
+ if($fcount < 20) {
+ $i++;
+ continue;
+ }
+ while($f < $fcount) {
+ switch($data[$f]) {
+ case "failover":
+ $pools[$p]['name'] = $data[$f+2];
+ $pools[$p]['mystate'] = $data[$f+7];
+ $pools[$p]['peerstate'] = $data[$f+14];
+ $pools[$p]['mydate'] = $data[$f+10];
+ $pools[$p]['mydate'] .= " " . $data[$f+11];
+ $pools[$p]['peerdate'] = $data[$f+17];
+ $pools[$p]['peerdate'] .= " " . $data[$f+18];
+ $p++;
+ $i++;
+ continue 3;
+ case "lease":
+ $leases[$l]['ip'] = $data[$f+1];
+ $leases[$l]['type'] = "dynamic";
+ $f = $f+2;
+ break;
+ case "starts":
+ $leases[$l]['start'] = $data[$f+2];
+ $leases[$l]['start'] .= " " . $data[$f+3];
+ $f = $f+3;
+ break;
+ case "ends":
+ $leases[$l]['end'] = $data[$f+2];
+ $leases[$l]['end'] .= " " . $data[$f+3];
+ $f = $f+3;
+ break;
+ case "tstp":
+ $f = $f+3;
+ break;
+ case "tsfp":
+ $f = $f+3;
+ break;
+ case "atsfp":
+ $f = $f+3;
+ break;
+ case "cltt":
+ $f = $f+3;
+ break;
+ case "binding":
+ switch($data[$f+2]) {
+ case "active":
+ $leases[$l]['act'] = "active";
+ break;
+ case "free":
+ $leases[$l]['act'] = "expired";
+ $leases[$l]['online'] = "offline";
+ break;
+ case "backup":
+ $leases[$l]['act'] = "reserved";
+ $leases[$l]['online'] = "offline";
+ break;
+ }
+ $f = $f+1;
+ break;
+ case "next":
+ /* skip the next binding statement */
+ $f = $f+3;
+ break;
+ case "hardware":
+ $leases[$l]['mac'] = $data[$f+2];
+ /* check if it's online and the lease is active */
+ if (in_array($leases[$l]['ip'], $arpdata)) {
+ $leases[$l]['online'] = 'online';
+ } else {
+ $leases[$l]['online'] = 'offline';
+ }
+ $f = $f+2;
+ break;
+ case "client-hostname":
+ if($data[$f+1] <> "") {
+ $leases[$l]['hostname'] = preg_replace('/"/','',$data[$f+1]);
+ } else {
+ $hostname = gethostbyaddr($leases[$l]['ip']);
+ if($hostname <> "") {
+ $leases[$l]['hostname'] = $hostname;
+ }
+ }
+ $f = $f+1;
+ break;
+ case "uid":
+ $f = $f+1;
+ break;
+ }
+ $f++;
+ }
+ $l++;
+ $i++;
+}
+
+/* remove duplicate items by mac address */
+if(count($leases) > 0) {
+ $leases = remove_duplicate($leases,"ip");
+}
+
+if(count($pools) > 0) {
+ $pools = remove_duplicate($pools,"name");
+ asort($pools);
+}
+
+foreach($config['interfaces'] as $ifname => $ifarr) {
+ if (is_array($config['dhcpd'][$ifname]) &&
+ is_array($config['dhcpd'][$ifname]['staticmap'])) {
+ foreach($config['dhcpd'][$ifname]['staticmap'] as $static) {
+ $slease = array();
+ $slease['ip'] = $static['ipaddr'];
+ $slease['type'] = "static";
+ $slease['mac'] = $static['mac'];
+ $slease['start'] = "";
+ $slease['end'] = "";
+ $slease['hostname'] = htmlentities($static['hostname']);
+ $slease['act'] = "static";
+ $online = exec("/usr/sbin/arp -an |/usr/bin/grep {$slease['mac']}| /usr/bin/wc -l|/usr/bin/awk '{print $1;}'");
+ if ($online == 1) {
+ $slease['online'] = 'online';
+ } else {
+ $slease['online'] = 'offline';
+ }
+ $leases[] = $slease;
+ }
+ }
+}
+
+if ($_GET['order'])
+ usort($leases, "leasecmp");
+
+/* only print pool status when we have one */
+if(count($pools) > 0) {
+?>
+<table class="tabcont sortable" width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td class="listhdrr"><?=gettext("Failover Group"); ?></a></td>
+ <td class="listhdrr"><?=gettext("My State"); ?></a></td>
+ <td class="listhdrr"><?=gettext("Since"); ?></a></td>
+ <td class="listhdrr"><?=gettext("Peer State"); ?></a></td>
+ <td class="listhdrr"><?=gettext("Since"); ?></a></td>
+ </tr>
+<?php
+foreach ($pools as $data) {
+ echo "<tr>\n";
+ echo "<td class=\"listlr\">{$fspans}{$data['name']}{$fspane}&nbsp;</td>\n";
+ echo "<td class=\"listr\">{$fspans}{$data['mystate']}{$fspane}&nbsp;</td>\n";
+ echo "<td class=\"listr\">{$fspans}" . adjust_gmt($data['mydate']) . "{$fspane}&nbsp;</td>\n";
+ echo "<td class=\"listr\">{$fspans}{$data['peerstate']}{$fspane}&nbsp;</td>\n";
+ echo "<td class=\"listr\">{$fspans}" . adjust_gmt($data['peerdate']) . "{$fspane}&nbsp;</td>\n";
+ echo "<td class=\"list\" valign=\"middle\" width=\"17\">&nbsp;</td>\n";
+ echo "<td class=\"list\" valign=\"middle\" width=\"17\">&nbsp;</td>\n";
+ echo "</tr>\n";
+}
+
+?>
+</table>
+
+<?php
+/* only print pool status when we have one */
+}
+?>
+
+<p>
+
+<table class="tabcont sortable" width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td class="listhdrr"><a href="#"><?=gettext("IP address"); ?></a></td>
+ <td class="listhdrr"><a href="#"><?=gettext("MAC address"); ?></a></td>
+ <td class="listhdrr"><a href="#"><?=gettext("Hostname"); ?></a></td>
+ <td class="listhdrr"><a href="#"><?=gettext("Start"); ?></a></td>
+ <td class="listhdrr"><a href="#"><?=gettext("End"); ?></a></td>
+ <td class="listhdrr"><a href="#"><?=gettext("Online"); ?></a></td>
+ <td class="listhdrr"><a href="#"><?=gettext("Lease Type"); ?></a></td>
+ </tr>
+<?php
+// Load MAC-Manufacturer table
+$macs=file("/usr/local/pkg/mactovendor/mac-prefixes");
+if ($macs){
+ foreach ($macs as $line){
+ if (preg_match('/([0-9A-Fa-f]{6}) (.*)$/', $line, $matches)){
+ /* store values like this $mac_man['000C29']='VMware' */
+ $mac_man["$matches[1]"]=$matches[2];
+ }
+ }
+}
+
+foreach ($leases as $data) {
+ if (($data['act'] == "active") || ($data['act'] == "static") || ($_GET['all'] == 1)) {
+ if ($data['act'] != "active" && $data['act'] != "static") {
+ $fspans = "<span class=\"gray\">";
+ $fspane = "</span>";
+ } else {
+ $fspans = $fspane = "";
+ }
+ $lip = ip2ulong($data['ip']);
+ if ($data['act'] == "static") {
+ foreach ($config['dhcpd'] as $dhcpif => $dhcpifconf) {
+ if(is_array($dhcpifconf['staticmap'])) {
+ foreach ($dhcpifconf['staticmap'] as $staticent) {
+ if ($data['ip'] == $staticent['ipaddr']) {
+ $data['if'] = $dhcpif;
+ break;
+ }
+ }
+ }
+ /* exit as soon as we have an interface */
+ if ($data['if'] != "")
+ break;
+ }
+ } else {
+ foreach ($config['dhcpd'] as $dhcpif => $dhcpifconf) {
+ if (($lip >= ip2ulong($dhcpifconf['range']['from'])) && ($lip <= ip2ulong($dhcpifconf['range']['to']))) {
+ $data['if'] = $dhcpif;
+ break;
+ }
+ }
+ }
+ echo "<tr>\n";
+ echo "<td class=\"listlr\">{$fspans}{$data['ip']}{$fspane}&nbsp;</td>\n";
+ $mac=$data['mac'];
+ $mac_hi = strtoupper($mac[0] . $mac[1] . $mac[3] . $mac[4] . $mac[6] . $mac[7]);
+ if ($data['online'] != "online") {
+ if(isset($mac_man[$mac_hi])){ // Manufacturer for this MAC is defined
+ $mac_man_ar = explode(' ', $mac_man[$mac_hi]);
+ echo "<td class=\"listr\">{$fspans}<a href=\"services_wol.php?if={$data['if']}&mac=$mac\" title=\"" . gettext("$mac, {$mac_man[$mac_hi]} - send Wake on LAN packet to this MAC address") ."\">" . $mac_man_ar[0] . substr($mac, 8) . "</a>{$fspane}&nbsp;</td>\n";
+ }else{
+ echo "<td class=\"listr\">{$fspans}<a href=\"services_wol.php?if={$data['if']}&mac={$data['mac']}\" title=\"" . gettext("send Wake on LAN packet to this MAC address") ."\">{$data['mac']}</a>{$fspane}&nbsp;</td>\n";
+ }
+ } else {
+ if(isset($mac_man[$mac_hi])){ // Manufacturer for this MAC is defined
+ $mac_man_ar = explode(' ', $mac_man[$mac_hi]);
+ echo "<td class=\"listr\">{$fspans}<span title=\"$mac, {$mac_man[$mac_hi]}\">" . $mac_man_ar[0] . substr($mac, 8) . "</span>{$fspane}&nbsp;</td>\n";
+ }else{
+ echo "<td class=\"listr\">{$fspans}{$data['mac']}{$fspane}&nbsp;</td>\n";
+ }
+ }
+ echo "<td class=\"listr\">{$fspans}" . htmlentities($data['hostname']) . "{$fspane}&nbsp;</td>\n";
+ if ($data['type'] != "static") {
+ echo "<td class=\"listr\">{$fspans}" . adjust_gmt($data['start']) . "{$fspane}&nbsp;</td>\n";
+ echo "<td class=\"listr\">{$fspans}" . adjust_gmt($data['end']) . "{$fspane}&nbsp;</td>\n";
+ } else {
+ echo "<td class=\"listr\">{$fspans} n/a {$fspane}&nbsp;</td>\n";
+ echo "<td class=\"listr\">{$fspans} n/a {$fspane}&nbsp;</td>\n";
+ }
+ echo "<td class=\"listr\">{$fspans}{$data['online']}{$fspane}&nbsp;</td>\n";
+ echo "<td class=\"listr\">{$fspans}{$data['act']}{$fspane}&nbsp;</td>\n";
+
+ if ($data['type'] == "dynamic") {
+ echo "<td valign=\"middle\"><a href=\"services_dhcp_edit.php?if={$data['if']}&mac={$data['mac']}&hostname={$data['hostname']}\">";
+ echo "<img src=\"/themes/{$g['theme']}/images/icons/icon_plus.gif\" width=\"17\" height=\"17\" border=\"0\" title=\"" . gettext("add a static mapping for this MAC address") ."\"></a></td>\n";
+ } else {
+ echo "<td class=\"list\" valign=\"middle\">";
+ echo "<img src=\"/themes/{$g['theme']}/images/icons/icon_plus_mo.gif\" width=\"17\" height=\"17\" border=\"0\"></td>\n";
+ }
+
+ echo "<td valign=\"middle\"><a href=\"services_wol_edit.php?if={$data['if']}&mac={$data['mac']}&descr={$data['hostname']}\">";
+ echo "<img src=\"/themes/{$g['theme']}/images/icons/icon_wol_all.gif\" width=\"17\" height=\"17\" border=\"0\" title=\"" . gettext("add a Wake on LAN mapping for this MAC address") ."\"></a></td>\n";
+
+ /* Only show the button for offline dynamic leases */
+ if (($data['type'] == "dynamic") && ($data['online'] != "online")) {
+ echo "<td class=\"list\" valign=\"middle\"><a href=\"status_dhcp_leases.php?deleteip={$data['ip']}&all=" . htmlspecialchars($_GET['all']) . "\">";
+ echo "<img src=\"/themes/{$g['theme']}/images/icons/icon_x.gif\" width=\"17\" height=\"17\" border=\"0\" title=\"" . gettext("delete this DHCP lease") . "\"></a></td>\n";
+ }
+ echo "</tr>\n";
+ }
+}
+
+?>
+</table>
+<p>
+<form action="status_dhcp_leases.php" method="GET">
+<input type="hidden" name="order" value="<?=htmlspecialchars($_GET['order']);?>">
+<?php if ($_GET['all']): ?>
+<input type="hidden" name="all" value="0">
+<input type="submit" class="formbtn" value="<?=gettext("Show active and static leases only"); ?>">
+<?php else: ?>
+<input type="hidden" name="all" value="1">
+<input type="submit" class="formbtn" value="<?=gettext("Show all configured leases"); ?>">
+<?php endif; ?>
+</form>
+<?php if($leases == 0): ?>
+<p><strong><?=gettext("No leases file found. Is the DHCP server active"); ?>?</strong></p>
+<?php endif; ?>
+
+<?php include("fend.inc"); ?>
+</body>
+</html>
diff --git a/config/mactovendor/bin/status_interfaces.php_ b/config/mactovendor/bin/status_interfaces.php_
index 36c95a0c..1d8f8c9c 100644
--- a/config/mactovendor/bin/status_interfaces.php_
+++ b/config/mactovendor/bin/status_interfaces.php_
@@ -1,353 +1,353 @@
-<?php
-/* $Id$ */
-/*
- status_interfaces.php
- part of pfSense
- Copyright (C) 2009 Scott Ullrich <sullrich@gmail.com>.
- All rights reserved.
-
- originally part of m0n0wall (http://m0n0.ch/wall)
- Copyright (C) 2003-2005 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_MODULE: interfaces
-*/
-
-##|+PRIV
-##|*IDENT=page-status-interfaces
-##|*NAME=Status: Interfaces page
-##|*DESCR=Allow access to the 'Status: Interfaces' page.
-##|*MATCH=status_interfaces.php*
-##|-PRIV
-
-require_once("guiconfig.inc");
-
-if ($_GET['if']) {
- $interface = $_GET['if'];
- if ($_GET['action'] == "Disconnect" || $_GET['action'] == "Release") {
- interface_bring_down($interface);
- } else if ($_GET['action'] == "Connect" || $_GET['action'] == "Renew") {
- interface_configure($interface);
- }
- header("Location: status_interfaces.php");
- exit;
-}
-
-$pgtitle = array(gettext("Status"),gettext("Interfaces"));
-include("head.inc");
-
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
-<table width="100%" border="0" cellspacing="0" cellpadding="0">
-<?php
- $i = 0;
- $ifdescrs = get_configured_interface_with_descr(false, true);
- foreach ($ifdescrs as $ifdescr => $ifname):
- $ifinfo = get_interface_info($ifdescr);
- // Load MAC-Manufacturer table
- $macs=file("/usr/local/pkg/mactovendor/mac-prefixes");
- if ($macs){
- foreach ($macs as $line){
- if (preg_match('/([0-9A-Fa-f]{6}) (.*)$/', $line, $matches)){
- /* store values like this $mac_man['000C29']='VMware' */
- $mac_man["$matches[1]"]=$matches[2];
- }
- }
- }
-?>
-<?php if ($i): ?>
- <tr>
- <td colspan="8" class="list" height="12"></td>
- </tr>
-<?php endif; ?>
- <tr>
- <td colspan="2" class="listtopic">
- <?=htmlspecialchars($ifname);?> <?=gettext("interface"); ?> (<?=htmlspecialchars($ifinfo['hwif']);?>)
- </td>
- </tr>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("Status"); ?></td>
- <td width="78%" class="listr">
- <?=htmlspecialchars($ifinfo['status']);?>
- </td>
- </tr>
- <?php if ($ifinfo['dhcplink']): ?>
- <tr>
- <td width="22%" class="vncellt">
- DHCP
- </td>
- <td width="78%" class="listr">
- <?=htmlspecialchars($ifinfo['dhcplink']);?>&nbsp;&nbsp;
- <?php if ($ifinfo['dhcplink'] == "up"): ?>
- <a href="status_interfaces.php?action=Release&if=<?php echo $ifdescr; ?>">
- <input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Release");?>" class="formbtns">
- <?php else: ?>
- <a href="status_interfaces.php?action=Renew&if=<?php echo $ifdescr; ?>">
- <input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Renew");?>" class="formbtns">
- <?php endif; ?>
- </a>
- </td>
- </tr>
- <?php endif; if ($ifinfo['pppoelink']): ?>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("PPPoE"); ?></td>
- <td width="78%" class="listr">
- <?=htmlspecialchars($ifinfo['pppoelink']);?>&nbsp;&nbsp;
- <?php if ($ifinfo['pppoelink'] == "up"): ?>
- <a href="status_interfaces.php?action=Disconnect&if=<?php echo $ifdescr; ?>">
- <input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Disconnect");?>" class="formbtns">
- <?php else: ?>
- <a href="status_interfaces.php?action=Connect&if=<?php echo $ifdescr; ?>">
- <input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Connect");?>" class="formbtns">
- <?php endif; ?>
- </a>
- </td>
- </tr>
- <?php endif; if ($ifinfo['pptplink']): ?>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("PPTP"); ?></td>
- <td width="78%" class="listr">
- <?=htmlspecialchars($ifinfo['pptplink']);?>&nbsp;&nbsp;
- <?php if ($ifinfo['pptplink'] == "up"): ?>
- <a href="status_interfaces.php?action=Disconnect&if=<?php echo $ifdescr; ?>">
- <input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Disconnect");?>" class="formbtns">
- <?php else: ?>
- <a href="status_interfaces.php?action=Connect&if=<?php echo $ifdescr; ?>">
- <input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Connect");?>" class="formbtns">
- <?php endif; ?>
- </a>
- </td>
- </tr>
- <?php endif; if ($ifinfo['ppplink']): ?>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("PPP"); ?></td>
- <td width="78%" class="listr">
- <?=htmlspecialchars($ifinfo['pppinfo']);?>
- <?php if ($ifinfo['ppplink'] == "up"): ?>
- <a href="status_interfaces.php?action=Disconnect&if=<?php echo $ifdescr; ?>">
- <input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Disconnect");?>" class="formbtns">
- <?php else: ?>
- <?php if (!$ifinfo['nodevice']): ?>
- <a href="status_interfaces.php?action=Connect&if=<?php echo $ifdescr; ?>">
- <input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Connect");?>" class="formbtns">
- <?php endif; ?>
- <?php endif; ?>
- </a>
- </td>
- </tr>
- <?php endif; if ($ifinfo['ppp_uptime'] || $ifinfo['ppp_uptime_accumulated']): ?>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("Uptime ");?><?php if ($ifinfo['ppp_uptime_accumulated']) echo "(historical)"; ?></td>
- <td width="78%" class="listr">
- <?=htmlspecialchars($ifinfo['ppp_uptime']);?> <?=htmlspecialchars($ifinfo['ppp_uptime_accumulated']);?>
- </td>
- </tr>
- <?php endif; if ($ifinfo['macaddr']): ?>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("MAC address");?></td>
- <td width="78%" class="listr">
- <?php
- $mac=$ifinfo['macaddr'];
- $mac_hi = strtoupper($mac[0] . $mac[1] . $mac[3] . $mac[4] . $mac[6] . $mac[7]);
- if(isset($mac_man[$mac_hi])){
- $mac_man_ar = explode(' ', $mac_man[$mac_hi]);
- print "<span title=\"$mac, {$mac_man[$mac_hi]}\">" . $mac_man_ar[0] . substr($mac, 8) . "</span>"; }
- else {print htmlspecialchars($mac);}
- ?>
- </td>
- </tr>
- <?php endif; if ($ifinfo['status'] != "down"): ?>
- <?php if ($ifinfo['dhcplink'] != "down" && $ifinfo['pppoelink'] != "down" && $ifinfo['pptplink'] != "down"): ?>
- <?php if ($ifinfo['ipaddr']): ?>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("IP address");?></td>
- <td width="78%" class="listr">
- <?=htmlspecialchars($ifinfo['ipaddr']);?>
- &nbsp;
- </td>
- </tr>
- <?php endif; ?><?php if ($ifinfo['subnet']): ?>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("Subnet mask");?></td>
- <td width="78%" class="listr">
- <?=htmlspecialchars($ifinfo['subnet']);?>
- </td>
- </tr>
- <?php endif; ?><?php if ($ifinfo['gateway']): ?>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("Gateway");?></td>
- <td width="78%" class="listr">
- <?=htmlspecialchars($config['interfaces'][$ifdescr]['gateway']);?>
- <?=htmlspecialchars($ifinfo['gateway']);?>
- </td>
- </tr>
- <?php endif; if ($ifdescr == "wan" && file_exists("{$g['varetc_path']}/resolv.conf")): ?>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("ISP DNS servers");?></td>
- <td width="78%" class="listr">
- <?php
- $dns_servers = get_dns_servers();
- foreach($dns_servers as $dns) {
- echo "{$dns}<br>";
- }
- ?>
- </td>
- </tr>
- <?php endif; endif; if ($ifinfo['media']): ?>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("Media");?></td>
- <td width="78%" class="listr">
- <?=htmlspecialchars($ifinfo['media']);?>
- </td>
- </tr>
-<?php endif; ?><?php if ($ifinfo['channel']): ?>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("Channel");?></td>
- <td width="78%" class="listr">
- <?=htmlspecialchars($ifinfo['channel']);?>
- </td>
- </tr>
-<?php endif; ?><?php if ($ifinfo['ssid']): ?>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("SSID");?></td>
- <td width="78%" class="listr">
- <?=htmlspecialchars($ifinfo['ssid']);?>
- </td>
- </tr>
-<?php endif; ?><?php if ($ifinfo['bssid']): ?>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("BSSID");?></td>
- <td width="78%" class="listr">
- <?=htmlspecialchars($ifinfo['bssid']);?>
- </td>
- </tr>
-<?php endif; ?><?php if ($ifinfo['rate']): ?>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("Rate");?></td>
- <td width="78%" class="listr">
- <?=htmlspecialchars($ifinfo['rate']);?>
- </td>
- </tr>
-<?php endif; ?><?php if ($ifinfo['rssi']): ?>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("RSSI");?></td>
- <td width="78%" class="listr">
- <?=htmlspecialchars($ifinfo['rssi']);?>
- </td>
- </tr>
-<?php endif; ?>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("In/out packets");?></td>
- <td width="78%" class="listr">
- <?php
- echo htmlspecialchars($ifinfo['inpkts'] . "/" . $ifinfo['outpkts'] . " (");
- echo htmlspecialchars(format_bytes($ifinfo['inbytes']) . "/" . format_bytes($ifinfo['outbytes']) . ")");
- ?>
- </td>
- </tr>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("In/out packets (pass)");?></td>
- <td width="78%" class="listr">
- <?php
- echo htmlspecialchars($ifinfo['inpktspass'] . "/" . $ifinfo['outpktspass'] . " (");
- echo htmlspecialchars(format_bytes($ifinfo['inbytespass']) . "/" . format_bytes($ifinfo['outbytespass']) . ")");
- ?>
- </td>
- </tr>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("In/out packets (block)");?></td>
- <td width="78%" class="listr">
- <?php
- echo htmlspecialchars($ifinfo['inpktsblock'] . "/" . $ifinfo['outpktsblock'] . " (");
- echo htmlspecialchars(format_bytes($ifinfo['inbytesblock']) . "/" . format_bytes($ifinfo['outbytesblock']) . ")");
- ?>
- </td>
- </tr>
-<?php if (isset($ifinfo['inerrs'])): ?>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("In/out errors");?></td>
- <td width="78%" class="listr">
- <?=htmlspecialchars($ifinfo['inerrs'] . "/" . $ifinfo['outerrs']);?>
- </td>
- </tr>
-<?php endif; ?>
-<?php if (isset($ifinfo['collisions'])): ?>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("Collisions");?></td>
- <td width="78%" class="listr">
- <?=htmlspecialchars($ifinfo['collisions']);?>
- </td>
- </tr>
-<?php endif; ?>
-<?php endif; ?>
-<?php if ($ifinfo['bridge']): ?>
- <tr>
- <td width="22%" class="vncellt"><?php printf(gettext("Bridge (%s)"),$ifinfo['bridgeint']);?></td>
- <td width="78%" class="listr">
- <?=$ifinfo['bridge'];?>
- </td>
- </tr>
-<?php endif; ?>
-<?php if(file_exists("/usr/bin/vmstat")): ?>
-<?php
- $real_interface = "";
- $interrupt_total = "";
- $interrupt_sec = "";
- $real_interface = $ifinfo['hwif'];
- $interrupt_total = `vmstat -i | grep $real_interface | awk '{ print $3 }'`;
- $interrupt_sec = `vmstat -i | grep $real_interface | awk '{ print $4 }'`;
- if(strstr($interrupt_total, "hci")) {
- $interrupt_total = `vmstat -i | grep $real_interface | awk '{ print $4 }'`;
- $interrupt_sec = `vmstat -i | grep $real_interface | awk '{ print $5 }'`;
- }
- unset($interrupt_total); // XXX: FIX ME! Need a regex and parse correct data 100% of the time.
-?>
-<?php if($interrupt_total): ?>
- <tr>
- <td width="22%" class="vncellt"><?=gettext("Interrupts/Second");?></td>
- <td width="78%" class="listr">
- <?php
- echo $interrupt_total . " " . gettext("total");
- echo "<br/>";
- echo $interrupt_sec . " " . gettext("rate");
- ?>
- </td>
- </tr>
-<?php endif; ?>
-<?php endif; ?>
-<?php $i++; endforeach; ?>
-</table>
-
-<br/>
-
-</strong><?php printf(gettext("Using dial-on-demand will bring the connection up again if any packet ".
-"triggers it. To substantiate this point: disconnecting manually ".
-"will %snot%s prevent dial-on-demand from making connections ".
-"to the outside! Don't use dial-on-demand if you want to make sure that the line ".
-"is kept disconnected."),'<strong>','</strong>')?>
-
-<?php include("fend.inc"); ?>
+<?php
+/* $Id$ */
+/*
+ status_interfaces.php
+ part of pfSense
+ Copyright (C) 2009 Scott Ullrich <sullrich@gmail.com>.
+ All rights reserved.
+
+ originally part of m0n0wall (http://m0n0.ch/wall)
+ Copyright (C) 2003-2005 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_MODULE: interfaces
+*/
+
+##|+PRIV
+##|*IDENT=page-status-interfaces
+##|*NAME=Status: Interfaces page
+##|*DESCR=Allow access to the 'Status: Interfaces' page.
+##|*MATCH=status_interfaces.php*
+##|-PRIV
+
+require_once("guiconfig.inc");
+
+if ($_GET['if']) {
+ $interface = $_GET['if'];
+ if ($_GET['action'] == "Disconnect" || $_GET['action'] == "Release") {
+ interface_bring_down($interface);
+ } else if ($_GET['action'] == "Connect" || $_GET['action'] == "Renew") {
+ interface_configure($interface);
+ }
+ header("Location: status_interfaces.php");
+ exit;
+}
+
+$pgtitle = array(gettext("Status"),gettext("Interfaces"));
+include("head.inc");
+
+?>
+
+<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
+<?php include("fbegin.inc"); ?>
+<table width="100%" border="0" cellspacing="0" cellpadding="0">
+<?php
+ $i = 0;
+ $ifdescrs = get_configured_interface_with_descr(false, true);
+ foreach ($ifdescrs as $ifdescr => $ifname):
+ $ifinfo = get_interface_info($ifdescr);
+ // Load MAC-Manufacturer table
+ $macs=file("/usr/local/pkg/mactovendor/mac-prefixes");
+ if ($macs){
+ foreach ($macs as $line){
+ if (preg_match('/([0-9A-Fa-f]{6}) (.*)$/', $line, $matches)){
+ /* store values like this $mac_man['000C29']='VMware' */
+ $mac_man["$matches[1]"]=$matches[2];
+ }
+ }
+ }
+?>
+<?php if ($i): ?>
+ <tr>
+ <td colspan="8" class="list" height="12"></td>
+ </tr>
+<?php endif; ?>
+ <tr>
+ <td colspan="2" class="listtopic">
+ <?=htmlspecialchars($ifname);?> <?=gettext("interface"); ?> (<?=htmlspecialchars($ifinfo['hwif']);?>)
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" class="vncellt"><?=gettext("Status"); ?></td>
+ <td width="78%" class="listr">
+ <?=htmlspecialchars($ifinfo['status']);?>
+ </td>
+ </tr>
+ <?php if ($ifinfo['dhcplink']): ?>
+ <tr>
+ <td width="22%" class="vncellt">
+ DHCP
+ </td>
+ <td width="78%" class="listr">
+ <?=htmlspecialchars($ifinfo['dhcplink']);?>&nbsp;&nbsp;
+ <?php if ($ifinfo['dhcplink'] == "up"): ?>
+ <a href="status_interfaces.php?action=Release&if=<?php echo $ifdescr; ?>">
+ <input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Release");?>" class="formbtns">
+ <?php else: ?>
+ <a href="status_interfaces.php?action=Renew&if=<?php echo $ifdescr; ?>">
+ <input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Renew");?>" class="formbtns">
+ <?php endif; ?>
+ </a>
+ </td>
+ </tr>
+ <?php endif; if ($ifinfo['pppoelink']): ?>
+ <tr>
+ <td width="22%" class="vncellt"><?=gettext("PPPoE"); ?></td>
+ <td width="78%" class="listr">
+ <?=htmlspecialchars($ifinfo['pppoelink']);?>&nbsp;&nbsp;
+ <?php if ($ifinfo['pppoelink'] == "up"): ?>
+ <a href="status_interfaces.php?action=Disconnect&if=<?php echo $ifdescr; ?>">
+ <input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Disconnect");?>" class="formbtns">
+ <?php else: ?>
+ <a href="status_interfaces.php?action=Connect&if=<?php echo $ifdescr; ?>">
+ <input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Connect");?>" class="formbtns">
+ <?php endif; ?>
+ </a>
+ </td>
+ </tr>
+ <?php endif; if ($ifinfo['pptplink']): ?>
+ <tr>
+ <td width="22%" class="vncellt"><?=gettext("PPTP"); ?></td>
+ <td width="78%" class="listr">
+ <?=htmlspecialchars($ifinfo['pptplink']);?>&nbsp;&nbsp;
+ <?php if ($ifinfo['pptplink'] == "up"): ?>
+ <a href="status_interfaces.php?action=Disconnect&if=<?php echo $ifdescr; ?>">
+ <input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Disconnect");?>" class="formbtns">
+ <?php else: ?>
+ <a href="status_interfaces.php?action=Connect&if=<?php echo $ifdescr; ?>">
+ <input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Connect");?>" class="formbtns">
+ <?php endif; ?>
+ </a>
+ </td>
+ </tr>
+ <?php endif; if ($ifinfo['ppplink']): ?>
+ <tr>
+ <td width="22%" class="vncellt"><?=gettext("PPP"); ?></td>
+ <td width="78%" class="listr">
+ <?=htmlspecialchars($ifinfo['pppinfo']);?>
+ <?php if ($ifinfo['ppplink'] == "up"): ?>
+ <a href="status_interfaces.php?action=Disconnect&if=<?php echo $ifdescr; ?>">
+ <input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Disconnect");?>" class="formbtns">
+ <?php else: ?>
+ <?php if (!$ifinfo['nodevice']): ?>
+ <a href="status_interfaces.php?action=Connect&if=<?php echo $ifdescr; ?>">
+ <input type="button" name="<?php echo $ifdescr; ?>" value="<?=gettext("Connect");?>" class="formbtns">
+ <?php endif; ?>
+ <?php endif; ?>
+ </a>
+ </td>
+ </tr>
+ <?php endif; if ($ifinfo['ppp_uptime'] || $ifinfo['ppp_uptime_accumulated']): ?>
+ <tr>
+ <td width="22%" class="vncellt"><?=gettext("Uptime ");?><?php if ($ifinfo['ppp_uptime_accumulated']) echo "(historical)"; ?></td>
+ <td width="78%" class="listr">
+ <?=htmlspecialchars($ifinfo['ppp_uptime']);?> <?=htmlspecialchars($ifinfo['ppp_uptime_accumulated']);?>
+ </td>
+ </tr>
+ <?php endif; if ($ifinfo['macaddr']): ?>
+ <tr>
+ <td width="22%" class="vncellt"><?=gettext("MAC address");?></td>
+ <td width="78%" class="listr">
+ <?php
+ $mac=$ifinfo['macaddr'];
+ $mac_hi = strtoupper($mac[0] . $mac[1] . $mac[3] . $mac[4] . $mac[6] . $mac[7]);
+ if(isset($mac_man[$mac_hi])){
+ $mac_man_ar = explode(' ', $mac_man[$mac_hi]);
+ print "<span title=\"$mac, {$mac_man[$mac_hi]}\">" . $mac_man_ar[0] . substr($mac, 8) . "</span>"; }
+ else {print htmlspecialchars($mac);}
+ ?>
+ </td>
+ </tr>
+ <?php endif; if ($ifinfo['status'] != "down"): ?>
+ <?php if ($ifinfo['dhcplink'] != "down" && $ifinfo['pppoelink'] != "down" && $ifinfo['pptplink'] != "down"): ?>
+ <?php if ($ifinfo['ipaddr']): ?>
+ <tr>
+ <td width="22%" class="vncellt"><?=gettext("IP address");?></td>
+ <td width="78%" class="listr">
+ <?=htmlspecialchars($ifinfo['ipaddr']);?>
+ &nbsp;
+ </td>
+ </tr>
+ <?php endif; ?><?php if ($ifinfo['subnet']): ?>
+ <tr>
+ <td width="22%" class="vncellt"><?=gettext("Subnet mask");?></td>
+ <td width="78%" class="listr">
+ <?=htmlspecialchars($ifinfo['subnet']);?>
+ </td>
+ </tr>
+ <?php endif; ?><?php if ($ifinfo['gateway']): ?>
+ <tr>
+ <td width="22%" class="vncellt"><?=gettext("Gateway");?></td>
+ <td width="78%" class="listr">
+ <?=htmlspecialchars($config['interfaces'][$ifdescr]['gateway']);?>
+ <?=htmlspecialchars($ifinfo['gateway']);?>
+ </td>
+ </tr>
+ <?php endif; if ($ifdescr == "wan" && file_exists("{$g['varetc_path']}/resolv.conf")): ?>
+ <tr>
+ <td width="22%" class="vncellt"><?=gettext("ISP DNS servers");?></td>
+ <td width="78%" class="listr">
+ <?php
+ $dns_servers = get_dns_servers();
+ foreach($dns_servers as $dns) {
+ echo "{$dns}<br>";
+ }
+ ?>
+ </td>
+ </tr>
+ <?php endif; endif; if ($ifinfo['media']): ?>
+ <tr>
+ <td width="22%" class="vncellt"><?=gettext("Media");?></td>
+ <td width="78%" class="listr">
+ <?=htmlspecialchars($ifinfo['media']);?>
+ </td>
+ </tr>
+<?php endif; ?><?php if ($ifinfo['channel']): ?>
+ <tr>
+ <td width="22%" class="vncellt"><?=gettext("Channel");?></td>
+ <td width="78%" class="listr">
+ <?=htmlspecialchars($ifinfo['channel']);?>
+ </td>
+ </tr>
+<?php endif; ?><?php if ($ifinfo['ssid']): ?>
+ <tr>
+ <td width="22%" class="vncellt"><?=gettext("SSID");?></td>
+ <td width="78%" class="listr">
+ <?=htmlspecialchars($ifinfo['ssid']);?>
+ </td>
+ </tr>
+<?php endif; ?><?php if ($ifinfo['bssid']): ?>
+ <tr>
+ <td width="22%" class="vncellt"><?=gettext("BSSID");?></td>
+ <td width="78%" class="listr">
+ <?=htmlspecialchars($ifinfo['bssid']);?>
+ </td>
+ </tr>
+<?php endif; ?><?php if ($ifinfo['rate']): ?>
+ <tr>
+ <td width="22%" class="vncellt"><?=gettext("Rate");?></td>
+ <td width="78%" class="listr">
+ <?=htmlspecialchars($ifinfo['rate']);?>
+ </td>
+ </tr>
+<?php endif; ?><?php if ($ifinfo['rssi']): ?>
+ <tr>
+ <td width="22%" class="vncellt"><?=gettext("RSSI");?></td>
+ <td width="78%" class="listr">
+ <?=htmlspecialchars($ifinfo['rssi']);?>
+ </td>
+ </tr>
+<?php endif; ?>
+ <tr>
+ <td width="22%" class="vncellt"><?=gettext("In/out packets");?></td>
+ <td width="78%" class="listr">
+ <?php
+ echo htmlspecialchars($ifinfo['inpkts'] . "/" . $ifinfo['outpkts'] . " (");
+ echo htmlspecialchars(format_bytes($ifinfo['inbytes']) . "/" . format_bytes($ifinfo['outbytes']) . ")");
+ ?>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" class="vncellt"><?=gettext("In/out packets (pass)");?></td>
+ <td width="78%" class="listr">
+ <?php
+ echo htmlspecialchars($ifinfo['inpktspass'] . "/" . $ifinfo['outpktspass'] . " (");
+ echo htmlspecialchars(format_bytes($ifinfo['inbytespass']) . "/" . format_bytes($ifinfo['outbytespass']) . ")");
+ ?>
+ </td>
+ </tr>
+ <tr>
+ <td width="22%" class="vncellt"><?=gettext("In/out packets (block)");?></td>
+ <td width="78%" class="listr">
+ <?php
+ echo htmlspecialchars($ifinfo['inpktsblock'] . "/" . $ifinfo['outpktsblock'] . " (");
+ echo htmlspecialchars(format_bytes($ifinfo['inbytesblock']) . "/" . format_bytes($ifinfo['outbytesblock']) . ")");
+ ?>
+ </td>
+ </tr>
+<?php if (isset($ifinfo['inerrs'])): ?>
+ <tr>
+ <td width="22%" class="vncellt"><?=gettext("In/out errors");?></td>
+ <td width="78%" class="listr">
+ <?=htmlspecialchars($ifinfo['inerrs'] . "/" . $ifinfo['outerrs']);?>
+ </td>
+ </tr>
+<?php endif; ?>
+<?php if (isset($ifinfo['collisions'])): ?>
+ <tr>
+ <td width="22%" class="vncellt"><?=gettext("Collisions");?></td>
+ <td width="78%" class="listr">
+ <?=htmlspecialchars($ifinfo['collisions']);?>
+ </td>
+ </tr>
+<?php endif; ?>
+<?php endif; ?>
+<?php if ($ifinfo['bridge']): ?>
+ <tr>
+ <td width="22%" class="vncellt"><?php printf(gettext("Bridge (%s)"),$ifinfo['bridgeint']);?></td>
+ <td width="78%" class="listr">
+ <?=$ifinfo['bridge'];?>
+ </td>
+ </tr>
+<?php endif; ?>
+<?php if(file_exists("/usr/bin/vmstat")): ?>
+<?php
+ $real_interface = "";
+ $interrupt_total = "";
+ $interrupt_sec = "";
+ $real_interface = $ifinfo['hwif'];
+ $interrupt_total = `vmstat -i | grep $real_interface | awk '{ print $3 }'`;
+ $interrupt_sec = `vmstat -i | grep $real_interface | awk '{ print $4 }'`;
+ if(strstr($interrupt_total, "hci")) {
+ $interrupt_total = `vmstat -i | grep $real_interface | awk '{ print $4 }'`;
+ $interrupt_sec = `vmstat -i | grep $real_interface | awk '{ print $5 }'`;
+ }
+ unset($interrupt_total); // XXX: FIX ME! Need a regex and parse correct data 100% of the time.
+?>
+<?php if($interrupt_total): ?>
+ <tr>
+ <td width="22%" class="vncellt"><?=gettext("Interrupts/Second");?></td>
+ <td width="78%" class="listr">
+ <?php
+ echo $interrupt_total . " " . gettext("total");
+ echo "<br/>";
+ echo $interrupt_sec . " " . gettext("rate");
+ ?>
+ </td>
+ </tr>
+<?php endif; ?>
+<?php endif; ?>
+<?php $i++; endforeach; ?>
+</table>
+
+<br/>
+
+</strong><?php printf(gettext("Using dial-on-demand will bring the connection up again if any packet ".
+"triggers it. To substantiate this point: disconnecting manually ".
+"will %snot%s prevent dial-on-demand from making connections ".
+"to the outside! Don't use dial-on-demand if you want to make sure that the line ".
+"is kept disconnected."),'<strong>','</strong>')?>
+
+<?php include("fend.inc"); ?>
diff --git a/config/mactovendor/bin/status_wireless.php_ b/config/mactovendor/bin/status_wireless.php_
index fbc35538..8e54e06e 100644
--- a/config/mactovendor/bin/status_wireless.php_
+++ b/config/mactovendor/bin/status_wireless.php_
@@ -1,208 +1,208 @@
-<?php
-/*
- status_wireless.php
- Copyright (C) 2004 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.
-*/
-/*
- pfSense_MODULE: interfaces
-*/
-
-##|+PRIV
-##|*IDENT=page-diagnostics-wirelessstatus
-##|*NAME=Status: Wireless page
-##|*DESCR=Allow access to the 'Status: Wireless' page.
-##|*MATCH=status_wireless.php*
-##|-PRIV
-
-require_once("guiconfig.inc");
-
-$pgtitle = array(gettext("Status"),gettext("Wireless"));
-include("head.inc");
-
-$if = $_POST['if'];
-if($_GET['if'] <> "")
- $if = $_GET['if'];
-
-$ciflist = get_configured_interface_with_descr();
-if(empty($if)) {
- /* Find the first interface
- that is wireless */
- foreach($ciflist as $interface => $ifdescr) {
- if(is_interface_wireless(get_real_interface($interface))) {
- $if = $interface;
- break;
- }
- }
-}
-?>
-
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php
-include("fbegin.inc");
-?>
-<form action="status_wireless.php" method="post">
-<?php if ($savemsg) print_info_box($savemsg); ?>
-
-<table width="100%" border="0" cellpadding="0" cellspacing="0">
-<tr><td>
-<?php
-$tab_array = array();
-foreach($ciflist as $interface => $ifdescr) {
- if (is_interface_wireless(get_real_interface($interface))) {
- $enabled = false;
- if($if == $interface)
- $enabled = true;
- $tab_array[] = array(gettext("Status") . " ({$ifdescr})", $enabled, "status_wireless.php?if={$interface}");
- }
-}
-$rwlif = get_real_interface($if);
-if($_POST['rescanwifi'] <> "") {
- mwexec_bg("/sbin/ifconfig {$rwlif} scan 2>&1");
- $savemsg = gettext("Rescan has been initiated in the background. Refresh this page in 10 seconds to see the results.");
-}
-if ($savemsg) print_info_box($savemsg);
-display_top_tabs($tab_array);
-?>
-</td></tr>
-<tr><td>
-<div id="mainarea">
-<table class="tabcont" colspan="3" cellpadding="3" width="100%">
-<?php
-
- // Load MAC-Manufacturer table
- $macs=file("/usr/local/pkg/mactovendor/mac-prefixes");
- if ($macs){
- foreach ($macs as $line){
- if (preg_match('/([0-9A-Fa-f]{6}) (.*)$/', $line, $matches)){
- /* store values like this $mac_man['000C29']='VMware' */
- $mac_man["$matches[1]"]=$matches[2];
- }
- }
- }
-
- /* table header */
- print "<input type=\"hidden\" name=\"if\" id=\"if\" value=\"{$if}\">\n";
- print "<tr><td colspan=7><b><input type=\"submit\" name=\"rescanwifi\" id=\"rescanwifi\" value=\"Rescan\"><br/></td></tr>\n";
- print "<tr><td colspan=7><b>" . gettext("Nearby access points or ad-hoc peers") . ".<br/></td></tr>\n";
- print "\n<tr>";
- print "<tr bgcolor='#990000'>";
- print "<td><b><font color='#ffffff'>SSID</td>";
- print "<td><b><font color='#ffffff'>BSSID</td>";
- print "<td><b><font color='#ffffff'>CHAN</td>";
- print "<td><b><font color='#ffffff'>RATE</td>";
- print "<td><b><font color='#ffffff'>RSSI</td>";
- print "<td><b><font color='#ffffff'>INT</td>";
- print "<td><b><font color='#ffffff'>CAPS</td>";
- print "</tr>\n\n";
-
- exec("/sbin/ifconfig {$rwlif} list scan 2>&1", $states, $ret);
- /* Skip Header */
- array_shift($states);
-
- $counter=0;
- foreach($states as $state) {
- /* Split by Mac address for the SSID Field */
- $split = preg_split("/([0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f])/i", $state);
- preg_match("/([0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f])/i", $state, $bssid);
- $ssid = htmlspecialchars($split[0]);
- $bssid = $bssid[0];
- /* Split the rest by using spaces for this line using the 2nd part */
- $split = preg_split("/[ ]+/i", $split[1]);
- $channel = $split[1];
- $rate = $split[2];
- $rssi = $split[3];
- $int = $split[4];
- $caps = "$split[5] $split[6] $split[7] $split[8] $split[9] $split[10] $split[11] ";
-
- print "<tr>";
- print "<td>{$ssid}</td>";
- $mac_hi = strtoupper($bssid[0] . $bssid[1] . $bssid[3] . $bssid[4] . $bssid[6] . $bssid[7]);
- if(isset($mac_man[$mac_hi])){
- $mac_man_ar = explode(' ', $mac_man[$mac_hi]);
- print "<td><span title=\"$bssid, {$mac_man[$mac_hi]}\">" . $mac_man_ar[0] . substr($bssid, 8) . "</span></td>";
- }else
- print "<td>{$bssid}</td>";
- print "<td>{$channel}</td>";
- print "<td>{$rate}</td>";
- print "<td>{$rssi}</td>";
- print "<td>{$int}</td>";
- print "<td>{$caps}</td>";
- print "</tr>\n";
- }
-
- print "</table><table class=\"tabcont\" colspan=\"3\" cellpadding=\"3\" width=\"100%\">";
-
- /* table header */
- print "\n<tr>";
- print "<tr><td colspan=7><b>" . gettext("Associated or ad-hoc peers") . "<br/></td></tr>\n";
- print "<tr bgcolor='#990000'>";
- print "<td><b><font color='#ffffff'>ADDR</td>";
- print "<td><b><font color='#ffffff'>AID</td>";
- print "<td><b><font color='#ffffff'>CHAN</td>";
- print "<td><b><font color='#ffffff'>RATE</td>";
- print "<td><b><font color='#ffffff'>RSSI</td>";
- print "<td><b><font color='#ffffff'>IDLE</td>";
- print "<td><b><font color='#ffffff'>TXSEQ</td>";
- print "<td><b><font color='#ffffff'>RXSEQ</td>";
- print "<td><b><font color='#ffffff'>CAPS</td>";
- print "<td><b><font color='#ffffff'>ERP</td>";
- print "</tr>\n\n";
-
- $states = array();
- exec("/sbin/ifconfig {$rwlif} list sta 2>&1", $states, $ret);
- array_shift($states);
-
- $counter=0;
- foreach($states as $state) {
- $split = preg_split("/[ ]+/i", $state);
- /* Split the rest by using spaces for this line using the 2nd part */
- print "<tr>";
- print "<td>{$split[0]}</td>";
- print "<td>{$split[1]}</td>";
- print "<td>{$split[2]}</td>";
- print "<td>{$split[3]}</td>";
- print "<td>{$split[4]}</td>";
- print "<td>{$split[5]}</td>";
- print "<td>{$split[6]}</td>";
- print "<td>{$split[7]}</td>";
- print "<td>{$split[8]}</td>";
- print "<td>{$split[9]}</td>";
- print "</tr>\n";
- }
-
-/* XXX: what stats to we get for adhoc mode? */
-
-?>
-</table>
-</div><br>
- <b>Flags:</b> A = authorized, E = Extended Rate (802.11g), P = Power save mode<br>
- <b>Capabilities:</b> E = ESS (infrastructure mode), I = IBSS (ad-hoc mode), P = privacy (WEP/TKIP/AES),
- S = Short preamble, s = Short slot time
-</td></tr>
-</table>
-
-<?php include("fend.inc"); ?>
-</body>
-</html>
+<?php
+/*
+ status_wireless.php
+ Copyright (C) 2004 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.
+*/
+/*
+ pfSense_MODULE: interfaces
+*/
+
+##|+PRIV
+##|*IDENT=page-diagnostics-wirelessstatus
+##|*NAME=Status: Wireless page
+##|*DESCR=Allow access to the 'Status: Wireless' page.
+##|*MATCH=status_wireless.php*
+##|-PRIV
+
+require_once("guiconfig.inc");
+
+$pgtitle = array(gettext("Status"),gettext("Wireless"));
+include("head.inc");
+
+$if = $_POST['if'];
+if($_GET['if'] <> "")
+ $if = $_GET['if'];
+
+$ciflist = get_configured_interface_with_descr();
+if(empty($if)) {
+ /* Find the first interface
+ that is wireless */
+ foreach($ciflist as $interface => $ifdescr) {
+ if(is_interface_wireless(get_real_interface($interface))) {
+ $if = $interface;
+ break;
+ }
+ }
+}
+?>
+
+<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
+<?php
+include("fbegin.inc");
+?>
+<form action="status_wireless.php" method="post">
+<?php if ($savemsg) print_info_box($savemsg); ?>
+
+<table width="100%" border="0" cellpadding="0" cellspacing="0">
+<tr><td>
+<?php
+$tab_array = array();
+foreach($ciflist as $interface => $ifdescr) {
+ if (is_interface_wireless(get_real_interface($interface))) {
+ $enabled = false;
+ if($if == $interface)
+ $enabled = true;
+ $tab_array[] = array(gettext("Status") . " ({$ifdescr})", $enabled, "status_wireless.php?if={$interface}");
+ }
+}
+$rwlif = get_real_interface($if);
+if($_POST['rescanwifi'] <> "") {
+ mwexec_bg("/sbin/ifconfig {$rwlif} scan 2>&1");
+ $savemsg = gettext("Rescan has been initiated in the background. Refresh this page in 10 seconds to see the results.");
+}
+if ($savemsg) print_info_box($savemsg);
+display_top_tabs($tab_array);
+?>
+</td></tr>
+<tr><td>
+<div id="mainarea">
+<table class="tabcont" colspan="3" cellpadding="3" width="100%">
+<?php
+
+ // Load MAC-Manufacturer table
+ $macs=file("/usr/local/pkg/mactovendor/mac-prefixes");
+ if ($macs){
+ foreach ($macs as $line){
+ if (preg_match('/([0-9A-Fa-f]{6}) (.*)$/', $line, $matches)){
+ /* store values like this $mac_man['000C29']='VMware' */
+ $mac_man["$matches[1]"]=$matches[2];
+ }
+ }
+ }
+
+ /* table header */
+ print "<input type=\"hidden\" name=\"if\" id=\"if\" value=\"{$if}\">\n";
+ print "<tr><td colspan=7><b><input type=\"submit\" name=\"rescanwifi\" id=\"rescanwifi\" value=\"Rescan\"><br/></td></tr>\n";
+ print "<tr><td colspan=7><b>" . gettext("Nearby access points or ad-hoc peers") . ".<br/></td></tr>\n";
+ print "\n<tr>";
+ print "<tr bgcolor='#990000'>";
+ print "<td><b><font color='#ffffff'>SSID</td>";
+ print "<td><b><font color='#ffffff'>BSSID</td>";
+ print "<td><b><font color='#ffffff'>CHAN</td>";
+ print "<td><b><font color='#ffffff'>RATE</td>";
+ print "<td><b><font color='#ffffff'>RSSI</td>";
+ print "<td><b><font color='#ffffff'>INT</td>";
+ print "<td><b><font color='#ffffff'>CAPS</td>";
+ print "</tr>\n\n";
+
+ exec("/sbin/ifconfig {$rwlif} list scan 2>&1", $states, $ret);
+ /* Skip Header */
+ array_shift($states);
+
+ $counter=0;
+ foreach($states as $state) {
+ /* Split by Mac address for the SSID Field */
+ $split = preg_split("/([0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f])/i", $state);
+ preg_match("/([0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f])/i", $state, $bssid);
+ $ssid = htmlspecialchars($split[0]);
+ $bssid = $bssid[0];
+ /* Split the rest by using spaces for this line using the 2nd part */
+ $split = preg_split("/[ ]+/i", $split[1]);
+ $channel = $split[1];
+ $rate = $split[2];
+ $rssi = $split[3];
+ $int = $split[4];
+ $caps = "$split[5] $split[6] $split[7] $split[8] $split[9] $split[10] $split[11] ";
+
+ print "<tr>";
+ print "<td>{$ssid}</td>";
+ $mac_hi = strtoupper($bssid[0] . $bssid[1] . $bssid[3] . $bssid[4] . $bssid[6] . $bssid[7]);
+ if(isset($mac_man[$mac_hi])){
+ $mac_man_ar = explode(' ', $mac_man[$mac_hi]);
+ print "<td><span title=\"$bssid, {$mac_man[$mac_hi]}\">" . $mac_man_ar[0] . substr($bssid, 8) . "</span></td>";
+ }else
+ print "<td>{$bssid}</td>";
+ print "<td>{$channel}</td>";
+ print "<td>{$rate}</td>";
+ print "<td>{$rssi}</td>";
+ print "<td>{$int}</td>";
+ print "<td>{$caps}</td>";
+ print "</tr>\n";
+ }
+
+ print "</table><table class=\"tabcont\" colspan=\"3\" cellpadding=\"3\" width=\"100%\">";
+
+ /* table header */
+ print "\n<tr>";
+ print "<tr><td colspan=7><b>" . gettext("Associated or ad-hoc peers") . "<br/></td></tr>\n";
+ print "<tr bgcolor='#990000'>";
+ print "<td><b><font color='#ffffff'>ADDR</td>";
+ print "<td><b><font color='#ffffff'>AID</td>";
+ print "<td><b><font color='#ffffff'>CHAN</td>";
+ print "<td><b><font color='#ffffff'>RATE</td>";
+ print "<td><b><font color='#ffffff'>RSSI</td>";
+ print "<td><b><font color='#ffffff'>IDLE</td>";
+ print "<td><b><font color='#ffffff'>TXSEQ</td>";
+ print "<td><b><font color='#ffffff'>RXSEQ</td>";
+ print "<td><b><font color='#ffffff'>CAPS</td>";
+ print "<td><b><font color='#ffffff'>ERP</td>";
+ print "</tr>\n\n";
+
+ $states = array();
+ exec("/sbin/ifconfig {$rwlif} list sta 2>&1", $states, $ret);
+ array_shift($states);
+
+ $counter=0;
+ foreach($states as $state) {
+ $split = preg_split("/[ ]+/i", $state);
+ /* Split the rest by using spaces for this line using the 2nd part */
+ print "<tr>";
+ print "<td>{$split[0]}</td>";
+ print "<td>{$split[1]}</td>";
+ print "<td>{$split[2]}</td>";
+ print "<td>{$split[3]}</td>";
+ print "<td>{$split[4]}</td>";
+ print "<td>{$split[5]}</td>";
+ print "<td>{$split[6]}</td>";
+ print "<td>{$split[7]}</td>";
+ print "<td>{$split[8]}</td>";
+ print "<td>{$split[9]}</td>";
+ print "</tr>\n";
+ }
+
+/* XXX: what stats to we get for adhoc mode? */
+
+?>
+</table>
+</div><br>
+ <b>Flags:</b> A = authorized, E = Extended Rate (802.11g), P = Power save mode<br>
+ <b>Capabilities:</b> E = ESS (infrastructure mode), I = IBSS (ad-hoc mode), P = privacy (WEP/TKIP/AES),
+ S = Short preamble, s = Short slot time
+</td></tr>
+</table>
+
+<?php include("fend.inc"); ?>
+</body>
+</html>
diff --git a/config/openvpn-client-export/source/dotnet2.nsh b/config/openvpn-client-export/source/dotnet2.nsh
index 5ec356e3..272f1bb3 100644
--- a/config/openvpn-client-export/source/dotnet2.nsh
+++ b/config/openvpn-client-export/source/dotnet2.nsh
@@ -1,93 +1,93 @@
-; Plugin for installing .NET Framework v2.0
-; Written by Christopher St. John
-; for EncounterPRO Healthcare Resources, Inc.
-
-!ifndef DOTNET2_INCLUDED
-!define DOTNET2_INCLUDED
-
-; -----------------------------------------
-; Includes
- !include "WordFunc.nsh"
- !insertmacro VersionCompare
- !include LogicLib.nsh
-
-; -----------------------------------------
-; Defines
- ; Direct-download location of .NET 2.0 redist
- !define BASE_URL http://download.microsoft.com/download
- !define URL_DOTNET_1033 "${BASE_URL}/5/6/7/567758a3-759e-473e-bf8f-52154438565a/dotnetfx.exe"
-
-; -----------------------------------------
-; Variables
- Var DotNetVersion2
- Var InstallDotNet2
-
-; -----------------------------------------
-; Functions
-Function GetDotNETVersion2
- Push $0
- Push $1
-
- System::Call "mscoree::GetCORVersion(w .r0, i 1024, *i r2) i .r1"
- StrCmp $1 0 +2
- StrCpy $0 0
-
- Pop $1
- Exch $0
-FunctionEnd
-
-; -----------------------------------------
-; Macros
-!macro CheckForDotNET2
- ; Check .NET version
- StrCpy $InstallDotNET2 "No"
- Call GetDotNETVersion2
- Pop $0
- StrCpy $DotNetVersion2 $0
-
- ${If} $0 == "not found"
- StrCpy $InstallDotNET2 "Yes"
- MessageBox MB_OK|MB_ICONINFORMATION "Installer requires that the .NET Framework 2.0 is installed. The .NET Framework will be downloaded and installed automatically during installation."
- Return
- ${EndIf}
-
- StrCpy $0 $0 "" 1 # skip "v"
-
- ${VersionCompare} $0 "2.0" $1
- ${If} $1 == 2
- StrCpy $InstallDotNET2 "Yes"
- MessageBox MB_OK|MB_ICONINFORMATION "Installer requires that the .NET Framework 2.0 is installed. The .NET Framework will be downloaded and installed automatically during installation."
- Return
- ${EndIf}
-!macroend
-
-!macro InstallDotNET2
- ; Get .NET if required
- ${If} $InstallDotNET2 == "Yes"
- DetailPrint "Downloading .NET Framework v2.0..."
- ;SetDetailsView hide
- NSISdl::download /TIMEOUT=30000 "${URL_DOTNET_1033}" "$INSTDIR\dotnetfx.exe"
- Pop $1
-
- ${If} $1 != "success"
- DetailPrint "Download failed: $1"
- Delete "$INSTDIR\dotnetfx.exe"
- Abort "Installation Cancelled"
- ${EndIf}
-
- DetailPrint "Installing .NET Framework v2.0..."
- ExecWait '"$INSTDIR\dotnetfx.exe" /q:a /c:"install /passive"' $1
- ${If} $1 == 0
- DetailPrint ".NET Framework v2.0 successfully installed."
- ${ElseIf} $1 == 3010
- MessageBox MB_OK ".NET Framework v2.0 has been installed and requires a reboot. Please restart the computer and run this installer again."
- Abort ".NET Framework v2.0 requires reboot."
- ${Else}
- MessageBox MB_OK ".NET Framework v2.0 reports a failure during installation ($1). Please try to install .NET Framework v2.0 via Windows Update before running this installer again."
- Abort ".NET Framework v2.0 installation failed ($1)."
- ${EndIf}
- Delete "$INSTDIR\dotnetfx.exe"
- ${EndIf}
-!macroend
-
+; Plugin for installing .NET Framework v2.0
+; Written by Christopher St. John
+; for EncounterPRO Healthcare Resources, Inc.
+
+!ifndef DOTNET2_INCLUDED
+!define DOTNET2_INCLUDED
+
+; -----------------------------------------
+; Includes
+ !include "WordFunc.nsh"
+ !insertmacro VersionCompare
+ !include LogicLib.nsh
+
+; -----------------------------------------
+; Defines
+ ; Direct-download location of .NET 2.0 redist
+ !define BASE_URL http://download.microsoft.com/download
+ !define URL_DOTNET_1033 "${BASE_URL}/5/6/7/567758a3-759e-473e-bf8f-52154438565a/dotnetfx.exe"
+
+; -----------------------------------------
+; Variables
+ Var DotNetVersion2
+ Var InstallDotNet2
+
+; -----------------------------------------
+; Functions
+Function GetDotNETVersion2
+ Push $0
+ Push $1
+
+ System::Call "mscoree::GetCORVersion(w .r0, i 1024, *i r2) i .r1"
+ StrCmp $1 0 +2
+ StrCpy $0 0
+
+ Pop $1
+ Exch $0
+FunctionEnd
+
+; -----------------------------------------
+; Macros
+!macro CheckForDotNET2
+ ; Check .NET version
+ StrCpy $InstallDotNET2 "No"
+ Call GetDotNETVersion2
+ Pop $0
+ StrCpy $DotNetVersion2 $0
+
+ ${If} $0 == "not found"
+ StrCpy $InstallDotNET2 "Yes"
+ MessageBox MB_OK|MB_ICONINFORMATION "Installer requires that the .NET Framework 2.0 is installed. The .NET Framework will be downloaded and installed automatically during installation."
+ Return
+ ${EndIf}
+
+ StrCpy $0 $0 "" 1 # skip "v"
+
+ ${VersionCompare} $0 "2.0" $1
+ ${If} $1 == 2
+ StrCpy $InstallDotNET2 "Yes"
+ MessageBox MB_OK|MB_ICONINFORMATION "Installer requires that the .NET Framework 2.0 is installed. The .NET Framework will be downloaded and installed automatically during installation."
+ Return
+ ${EndIf}
+!macroend
+
+!macro InstallDotNET2
+ ; Get .NET if required
+ ${If} $InstallDotNET2 == "Yes"
+ DetailPrint "Downloading .NET Framework v2.0..."
+ ;SetDetailsView hide
+ NSISdl::download /TIMEOUT=30000 "${URL_DOTNET_1033}" "$INSTDIR\dotnetfx.exe"
+ Pop $1
+
+ ${If} $1 != "success"
+ DetailPrint "Download failed: $1"
+ Delete "$INSTDIR\dotnetfx.exe"
+ Abort "Installation Cancelled"
+ ${EndIf}
+
+ DetailPrint "Installing .NET Framework v2.0..."
+ ExecWait '"$INSTDIR\dotnetfx.exe" /q:a /c:"install /passive"' $1
+ ${If} $1 == 0
+ DetailPrint ".NET Framework v2.0 successfully installed."
+ ${ElseIf} $1 == 3010
+ MessageBox MB_OK ".NET Framework v2.0 has been installed and requires a reboot. Please restart the computer and run this installer again."
+ Abort ".NET Framework v2.0 requires reboot."
+ ${Else}
+ MessageBox MB_OK ".NET Framework v2.0 reports a failure during installation ($1). Please try to install .NET Framework v2.0 via Windows Update before running this installer again."
+ Abort ".NET Framework v2.0 installation failed ($1)."
+ ${EndIf}
+ Delete "$INSTDIR\dotnetfx.exe"
+ ${EndIf}
+!macroend
+
!endif \ No newline at end of file
diff --git a/config/postfix/postfix_recipients.php b/config/postfix/postfix_recipients.php
index 0deb2f79..8d7db416 100644
--- a/config/postfix/postfix_recipients.php
+++ b/config/postfix/postfix_recipients.php
@@ -1,4 +1,4 @@
-<?php
-require_once ('/usr/local/pkg/postfix.inc');
-sync_relay_recipients("cron");
+<?php
+require_once ('/usr/local/pkg/postfix.inc');
+sync_relay_recipients("cron");
?> \ No newline at end of file
diff --git a/config/squid-reverse/squid_reverse.inc b/config/squid-reverse/squid_reverse.inc
index 728a81b2..652931c8 100644
--- a/config/squid-reverse/squid_reverse.inc
+++ b/config/squid-reverse/squid_reverse.inc
@@ -1,187 +1,187 @@
-<?php
-/* $Id$ */
-/*
- squid_reverse.inc
- Copyright (C) 2012 Martin Fuchs
- Copyright (C) 2012 Marcello Coutinho
- 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 squid_resync_reverse() {
- global $config;
- //if(!is_array($valid_acls))
- // return;
-
- //CONFIG FILE
- if (is_array($config['installedpackages']['squidreversegeneral']))
- $settings = $config['installedpackages']['squidreversegeneral']['config'][0];
- if (is_array($config['installedpackages']['squidreversepeer']))
- $reverse_peers=$config['installedpackages']['squidreversepeer']['config'];
- if (is_array($config['installedpackages']['squidreverseuri']))
- $reverse_maps=$config['installedpackages']['squidreverseuri']['config'];
-
- $conf = "# Reverse Proxy settings\n";
-
- if(isset($settings["reverse_ssl_cert"]) && $settings["reverse_ssl_cert"] != "none") {
- $svr_cert = lookup_cert($settings["reverse_ssl_cert"]);
- if ($svr_cert != false) {
- if(base64_decode($svr_cert['crt'])) {
- file_put_contents(SQUID_CONFBASE . "/{$settings["reverse_ssl_cert"]}.crt",sq_text_area_decode($svr_cert['crt']));
- $reverse_crt = SQUID_CONFBASE . "/{$settings["reverse_ssl_cert"]}.crt";
- }
- if(base64_decode($svr_cert['prv'])) {
- file_put_contents(SQUID_CONFBASE . "/{$settings["reverse_ssl_cert"]}.key",sq_text_area_decode($svr_cert['prv']));
- $reverse_key = SQUID_CONFBASE . "/{$settings["reverse_ssl_cert"]}.key";
- }
- }
- }
-
- if (!empty($settings['reverse_int_ca']))
- file_put_contents(SQUID_CONFBASE . "/{$settings["reverse_ssl_cert"]}.crt","\n" . sq_text_area_decode($settings['reverse_int_ca']),FILE_APPEND | LOCK_EX);
-
- $ifaces = ($settings['reverse_interface'] ? $settings['reverse_interface'] : 'wan');
- $real_ifaces = array();
-
- #set HTTP port and defsite
- $http_port=(empty($settings['reverse_http_port'])?"80":$settings['reverse_http_port']);
- $http_defsite=(empty($settings['reverse_http_defsite'])?$settings['reverse_external_fqdn']:$settings['reverse_http_defsite']);
-
- #set HTTPS port and defsite
- $https_port=(empty($settings['reverse_https_port'])?"443":$settings['reverse_https_port']);
- $https_defsite=(empty($settings['reverse_https_defsite'])?$settings['reverse_external_fqdn']:$settings['reverse_https_defsite']);
-
- foreach (explode(",", $ifaces) as $i => $iface) {
- $real_ifaces[] = squid_get_real_interface_address($iface);
- if($real_ifaces[$i][0]) {
- //HTTP
- if (!empty($settings['reverse_http']))
- $conf .= "http_port {$real_ifaces[$i][0]}:{$http_port} accel defaultsite={$http_defsite} vhost\n";
- //HTTPS
- if (!empty($settings['reverse_https']))
- $conf .= "https_port {$real_ifaces[$i][0]}:{$https_port} accel cert={$reverse_crt} key={$reverse_key} defaultsite={$https_defsite} vhost\n";
- }
- }
-
- if(!empty($settings['reverse_ip'])) {
- $reverse_ip = explode(";", ($settings['reverse_ip']));
- foreach ($reverse_ip as $reip) {
- //HTTP
- if (!empty($settings['reverse_http']))
- $conf .= "http_port {$reip}:{$http_port} accel defaultsite={$http_defsite} vhost\n";
- //HTTPS
- if (!empty($settings['reverse_https']))
- $conf .= "https_port {$reip}:{$https_port} accel cert={$reverse_crt} key={$reverse_key} defaultsite={$https_defsite} vhost\n";
- }
- }
-
- //PEERS
- if (($settings['reverse_owa'] == 'on') && (!empty($settings['reverse_owa_ip'])))
- $conf .= "cache_peer {$settings['reverse_owa_ip']} parent 443 0 proxy-only no-query originserver login=PASS connection-auth=on ssl sslflags=DONT_VERIFY_PEER front-end-https=on name=OWA_HOST_pfs\n";
-
- $active_peers=array();
- if (is_array($reverse_peers))
- foreach ($reverse_peers as $rp){
- if ($rp['enable'] =="on" && $rp['name'] !="" && $rp['ip'] !="" && $rp['port'] !=""){
- $conf_peer = "#{$rp['description']}\n";
- $conf_peer .= "cache_peer {$rp['ip']} parent {$rp['port']} 0 proxy-only no-query no-digest originserver login=PASS ";
- if($rp['protocol'] == 'HTTPS')
- $conf_peer .= "ssl sslflags=DONT_VERIFY_PEER front-end-https=auto ";
- $conf_peer .= "name=rvp_{$rp['name']}\n\n";
-
- // add peer only if reverse proxy is enabled for http
- if($rp['protocol'] == 'HTTP' && $settings['reverse_http'] =="on"){
- $conf .= $conf_peer;
- array_push($active_peers,$rp['name']);
- }
- // add peer only if if reverse proxy is enabled for https
- if($rp['protocol'] == 'HTTPS' && $settings['reverse_https'] =="on"){
- if (!in_array($rp['name'],$active_peers)){
- $conf .= $conf_peer;
- array_push($active_peers,$rp['name']);
- }
- }
- }
- }
-
- //ACLS and MAPPINGS
-
- //create an empty owa_dirs to populate based on user selected options
- $owa_dirs=array();
- if (($settings['reverse_owa'] == 'on') && $settings['reverse_https'] =="on"){
- if(!empty($settings['reverse_owa_ip'])){
- array_push($owa_dirs,'owa','exchange','public','exchweb','ecp','OAB');
- if($settings['reverse_owa_activesync'])
- array_push($owa_dirs,'Microsoft-Server-ActiveSync');
- if($settings['reverse_owa_rpchttp'])
- array_push($owa_dirs,'rpc/rpcproxy.dll','rpcwithcert/rpcproxy.dll');
- if($settings['reverse_owa_autodiscover'])
- array_push($owa_dirs,'autodiscover');
- if($settings['reverse_owa_webservice']){
- array_push($owa_dirs,'EWS');
- $conf .= "ignore_expect_100 on\n";
- }
- }
- if (is_array($owa_dirs))
- foreach ($owa_dirs as $owa_dir)
- $conf .= "acl OWA_URI_pfs url_regex -i ^https://{$settings['reverse_external_fqdn']}/$owa_dir.*$\n";
- }
- //$conf .= "ssl_unclean_shutdown on";
- if (is_array($reverse_maps))
- foreach ($reverse_maps as $rm){
- if ($rm['enable'] == "on" && $rm['name']!="" && $rm['peers']!=""){
- if (is_array($rm['row']))
- foreach ($rm['row'] as $uri){
- $url_regex=($uri['uri'] == '' ? $settings['reverse_external_fqdn'] : $uri['uri'] );
- //$conf .= "acl rvm_{$rm['name']} url_regex -i {$uri['uri']}{$url_regex}.*$\n";
- $conf .= "acl rvm_{$rm['name']} url_regex -i {$url_regex}\n";
- if($rm['name'] != $last_rm_name){
- $cache_peer_never_direct_conf .= "never_direct allow rvm_{$rm['name']}\n";
- $http_access_conf .= "http_access allow rvm_{$rm['name']}\n";
- foreach (explode(',',$rm['peers']) as $map_peer)
- if (in_array($map_peer,$active_peers)){
- $cache_peer_allow_conf .= "cache_peer_access rvp_{$map_peer} allow rvm_{$rm['name']}\n";
- $cache_peer_deny_conf .= "cache_peer_access rvp_{$map_peer} deny allsrc\n";
- }
- $last_rm_name=$rm['name'];
- }
- }
- }
- }
-
- //ACCESS
- if ($settings['reverse_owa'] == 'on' && !empty($settings['reverse_owa_ip']) && $settings['reverse_https'] =="on") {
- $conf .= "cache_peer_access OWA_HOST_pfs allow OWA_URI_pfs\n";
- $conf .= "cache_peer_access OWA_HOST_pfs deny allsrc\n";
- $conf .= "never_direct allow OWA_URI_pfs\n";
- $conf .= "http_access allow OWA_URI_pfs\n";
- }
-
- $conf .= $cache_peer_allow_conf.$cache_peer_deny_conf.$cache_peer_never_direct_conf.$http_access_conf."\n";
-
- if (!empty($settings['deny_info_tcp_reset']))
- $conf .= "deny_info TCP_RESET allsrc\n";
-
- return $conf;
-}
-?>
+<?php
+/* $Id$ */
+/*
+ squid_reverse.inc
+ Copyright (C) 2012 Martin Fuchs
+ Copyright (C) 2012 Marcello Coutinho
+ 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 squid_resync_reverse() {
+ global $config;
+ //if(!is_array($valid_acls))
+ // return;
+
+ //CONFIG FILE
+ if (is_array($config['installedpackages']['squidreversegeneral']))
+ $settings = $config['installedpackages']['squidreversegeneral']['config'][0];
+ if (is_array($config['installedpackages']['squidreversepeer']))
+ $reverse_peers=$config['installedpackages']['squidreversepeer']['config'];
+ if (is_array($config['installedpackages']['squidreverseuri']))
+ $reverse_maps=$config['installedpackages']['squidreverseuri']['config'];
+
+ $conf = "# Reverse Proxy settings\n";
+
+ if(isset($settings["reverse_ssl_cert"]) && $settings["reverse_ssl_cert"] != "none") {
+ $svr_cert = lookup_cert($settings["reverse_ssl_cert"]);
+ if ($svr_cert != false) {
+ if(base64_decode($svr_cert['crt'])) {
+ file_put_contents(SQUID_CONFBASE . "/{$settings["reverse_ssl_cert"]}.crt",sq_text_area_decode($svr_cert['crt']));
+ $reverse_crt = SQUID_CONFBASE . "/{$settings["reverse_ssl_cert"]}.crt";
+ }
+ if(base64_decode($svr_cert['prv'])) {
+ file_put_contents(SQUID_CONFBASE . "/{$settings["reverse_ssl_cert"]}.key",sq_text_area_decode($svr_cert['prv']));
+ $reverse_key = SQUID_CONFBASE . "/{$settings["reverse_ssl_cert"]}.key";
+ }
+ }
+ }
+
+ if (!empty($settings['reverse_int_ca']))
+ file_put_contents(SQUID_CONFBASE . "/{$settings["reverse_ssl_cert"]}.crt","\n" . sq_text_area_decode($settings['reverse_int_ca']),FILE_APPEND | LOCK_EX);
+
+ $ifaces = ($settings['reverse_interface'] ? $settings['reverse_interface'] : 'wan');
+ $real_ifaces = array();
+
+ #set HTTP port and defsite
+ $http_port=(empty($settings['reverse_http_port'])?"80":$settings['reverse_http_port']);
+ $http_defsite=(empty($settings['reverse_http_defsite'])?$settings['reverse_external_fqdn']:$settings['reverse_http_defsite']);
+
+ #set HTTPS port and defsite
+ $https_port=(empty($settings['reverse_https_port'])?"443":$settings['reverse_https_port']);
+ $https_defsite=(empty($settings['reverse_https_defsite'])?$settings['reverse_external_fqdn']:$settings['reverse_https_defsite']);
+
+ foreach (explode(",", $ifaces) as $i => $iface) {
+ $real_ifaces[] = squid_get_real_interface_address($iface);
+ if($real_ifaces[$i][0]) {
+ //HTTP
+ if (!empty($settings['reverse_http']))
+ $conf .= "http_port {$real_ifaces[$i][0]}:{$http_port} accel defaultsite={$http_defsite} vhost\n";
+ //HTTPS
+ if (!empty($settings['reverse_https']))
+ $conf .= "https_port {$real_ifaces[$i][0]}:{$https_port} accel cert={$reverse_crt} key={$reverse_key} defaultsite={$https_defsite} vhost\n";
+ }
+ }
+
+ if(!empty($settings['reverse_ip'])) {
+ $reverse_ip = explode(";", ($settings['reverse_ip']));
+ foreach ($reverse_ip as $reip) {
+ //HTTP
+ if (!empty($settings['reverse_http']))
+ $conf .= "http_port {$reip}:{$http_port} accel defaultsite={$http_defsite} vhost\n";
+ //HTTPS
+ if (!empty($settings['reverse_https']))
+ $conf .= "https_port {$reip}:{$https_port} accel cert={$reverse_crt} key={$reverse_key} defaultsite={$https_defsite} vhost\n";
+ }
+ }
+
+ //PEERS
+ if (($settings['reverse_owa'] == 'on') && (!empty($settings['reverse_owa_ip'])))
+ $conf .= "cache_peer {$settings['reverse_owa_ip']} parent 443 0 proxy-only no-query originserver login=PASS connection-auth=on ssl sslflags=DONT_VERIFY_PEER front-end-https=on name=OWA_HOST_pfs\n";
+
+ $active_peers=array();
+ if (is_array($reverse_peers))
+ foreach ($reverse_peers as $rp){
+ if ($rp['enable'] =="on" && $rp['name'] !="" && $rp['ip'] !="" && $rp['port'] !=""){
+ $conf_peer = "#{$rp['description']}\n";
+ $conf_peer .= "cache_peer {$rp['ip']} parent {$rp['port']} 0 proxy-only no-query no-digest originserver login=PASS ";
+ if($rp['protocol'] == 'HTTPS')
+ $conf_peer .= "ssl sslflags=DONT_VERIFY_PEER front-end-https=auto ";
+ $conf_peer .= "name=rvp_{$rp['name']}\n\n";
+
+ // add peer only if reverse proxy is enabled for http
+ if($rp['protocol'] == 'HTTP' && $settings['reverse_http'] =="on"){
+ $conf .= $conf_peer;
+ array_push($active_peers,$rp['name']);
+ }
+ // add peer only if if reverse proxy is enabled for https
+ if($rp['protocol'] == 'HTTPS' && $settings['reverse_https'] =="on"){
+ if (!in_array($rp['name'],$active_peers)){
+ $conf .= $conf_peer;
+ array_push($active_peers,$rp['name']);
+ }
+ }
+ }
+ }
+
+ //ACLS and MAPPINGS
+
+ //create an empty owa_dirs to populate based on user selected options
+ $owa_dirs=array();
+ if (($settings['reverse_owa'] == 'on') && $settings['reverse_https'] =="on"){
+ if(!empty($settings['reverse_owa_ip'])){
+ array_push($owa_dirs,'owa','exchange','public','exchweb','ecp','OAB');
+ if($settings['reverse_owa_activesync'])
+ array_push($owa_dirs,'Microsoft-Server-ActiveSync');
+ if($settings['reverse_owa_rpchttp'])
+ array_push($owa_dirs,'rpc/rpcproxy.dll','rpcwithcert/rpcproxy.dll');
+ if($settings['reverse_owa_autodiscover'])
+ array_push($owa_dirs,'autodiscover');
+ if($settings['reverse_owa_webservice']){
+ array_push($owa_dirs,'EWS');
+ $conf .= "ignore_expect_100 on\n";
+ }
+ }
+ if (is_array($owa_dirs))
+ foreach ($owa_dirs as $owa_dir)
+ $conf .= "acl OWA_URI_pfs url_regex -i ^https://{$settings['reverse_external_fqdn']}/$owa_dir.*$\n";
+ }
+ //$conf .= "ssl_unclean_shutdown on";
+ if (is_array($reverse_maps))
+ foreach ($reverse_maps as $rm){
+ if ($rm['enable'] == "on" && $rm['name']!="" && $rm['peers']!=""){
+ if (is_array($rm['row']))
+ foreach ($rm['row'] as $uri){
+ $url_regex=($uri['uri'] == '' ? $settings['reverse_external_fqdn'] : $uri['uri'] );
+ //$conf .= "acl rvm_{$rm['name']} url_regex -i {$uri['uri']}{$url_regex}.*$\n";
+ $conf .= "acl rvm_{$rm['name']} url_regex -i {$url_regex}\n";
+ if($rm['name'] != $last_rm_name){
+ $cache_peer_never_direct_conf .= "never_direct allow rvm_{$rm['name']}\n";
+ $http_access_conf .= "http_access allow rvm_{$rm['name']}\n";
+ foreach (explode(',',$rm['peers']) as $map_peer)
+ if (in_array($map_peer,$active_peers)){
+ $cache_peer_allow_conf .= "cache_peer_access rvp_{$map_peer} allow rvm_{$rm['name']}\n";
+ $cache_peer_deny_conf .= "cache_peer_access rvp_{$map_peer} deny allsrc\n";
+ }
+ $last_rm_name=$rm['name'];
+ }
+ }
+ }
+ }
+
+ //ACCESS
+ if ($settings['reverse_owa'] == 'on' && !empty($settings['reverse_owa_ip']) && $settings['reverse_https'] =="on") {
+ $conf .= "cache_peer_access OWA_HOST_pfs allow OWA_URI_pfs\n";
+ $conf .= "cache_peer_access OWA_HOST_pfs deny allsrc\n";
+ $conf .= "never_direct allow OWA_URI_pfs\n";
+ $conf .= "http_access allow OWA_URI_pfs\n";
+ }
+
+ $conf .= $cache_peer_allow_conf.$cache_peer_deny_conf.$cache_peer_never_direct_conf.$http_access_conf."\n";
+
+ if (!empty($settings['deny_info_tcp_reset']))
+ $conf .= "deny_info TCP_RESET allsrc\n";
+
+ return $conf;
+}
+?>