summaryrefslogtreecommitdiffstats
path: root/usr/local/www/status_wireless.php
diff options
context:
space:
mode:
authorSeth Mos <seth.mos@xs4all.nl>2009-11-21 01:21:19 +0100
committerSeth Mos <seth.mos@xs4all.nl>2009-11-21 01:23:31 +0100
commite2d90eacaa1d352dbf19d7b9c05b1bc0ee1dc942 (patch)
tree98d58cc5ea2831febb2c757fead37269c948a9e3 /usr/local/www/status_wireless.php
parentba3e5c6cc681fc0f51db3e339dae7be0643dd8c6 (diff)
downloadpfsense-e2d90eacaa1d352dbf19d7b9c05b1bc0ee1dc942.zip
pfsense-e2d90eacaa1d352dbf19d7b9c05b1bc0ee1dc942.tar.gz
Fix the status wireless page for 2.0 using the correct _wlan0 interface
name. Also bring over a fix for ssid values with spaces, there is a different fix in 1.2. This one splits on Mac address if they ever decide to list longer mac addresses instead of truncating to 16 characters. The IEEE says it can be upto 32 characters in length.
Diffstat (limited to 'usr/local/www/status_wireless.php')
-rwxr-xr-xusr/local/www/status_wireless.php50
1 files changed, 26 insertions, 24 deletions
diff --git a/usr/local/www/status_wireless.php b/usr/local/www/status_wireless.php
index 6ebac7f..f1f70f3 100755
--- a/usr/local/www/status_wireless.php
+++ b/usr/local/www/status_wireless.php
@@ -96,7 +96,7 @@ display_top_tabs($tab_array);
/* table header */
- print "\n<tr><!-- " . count($state_split) . " -->";
+ print "\n<tr>";
print "<tr bgcolor='#990000'>";
print "<td><b><font color='#ffffff'>SSID</td>";
print "<td><b><font color='#ffffff'>BSSID</td>";
@@ -107,38 +107,39 @@ display_top_tabs($tab_array);
print "<td><b><font color='#ffffff'>CAPS</td>";
print "</tr>\n\n";
- $states=split("\n",`/sbin/ifconfig {$if} list scan | grep -v "CHAN RATE"`);
+ exec("/sbin/ifconfig {$if}_wlan0 list scan 2>&1", $states, $ret);
+ /* Skip Header */
+ array_shift($states);
$counter=0;
foreach($states as $state) {
- $state_fixed = str_replace(" ", " ", $state);
- $state_fixed = str_replace(" ", " ", $state_fixed);
- $state_fixed = str_replace(" ", " ", $state_fixed);
- $state_fixed = str_replace(" ", " ", $state_fixed);
- $state_fixed = str_replace(" ", " ", $state_fixed);
- $state_fixed = str_replace(" ", " ", $state_fixed);
- $state_fixed = str_replace(" ", " ", $state_fixed);
- $state_split = split(" ", $state_fixed);
- print "<tr>";
- $state_split = split(" ", $state_fixed);
- $items = count($state_split);
- $starting_at = $items-8;
+ /* Split by Mac address for the SSID Field */
+ $split = preg_split("/[ ]+[0-9a-f][[0-9a-f]\:[0-9a-f][[0-9a-f]\:/i", $state);
+ $ssid = $split[0];
+ /* Split the rest by using spaces for this line using the 2nd part */
+ $split = preg_split("/[ ]+/i", $split[1]);
+ $bssid = $split[0];
+ $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>{$state_split[$starting_at]}</td>";
- print "<td>{$state_split[$starting_at+1]}</td>";
- print "<td>{$state_split[$starting_at+2]}</td>";
- print "<td>{$state_split[$starting_at+3]}</td>";
- print "<td>{$state_split[$starting_at+4]}</td>";
- print "<td>{$state_split[$starting_at+5]}</td>";
- print "<td>{$state_split[$starting_at+6]}</td>";
+ print "<td>{$ssid}</td>";
+ 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 "<!-- $state_fixed -->\n";
}
print "</table><table class=\"tabcont\" colspan=\"3\" cellpadding=\"3\" width=\"100%\">";
/* table header */
- print "\n<tr><!-- " . count($state_split) . " -->";
+ print "\n<tr>";
print "<tr bgcolor='#990000'>";
print "<td><b><font color='#ffffff'>ADDR</td>";
print "<td><b><font color='#ffffff'>AID</td>";
@@ -152,7 +153,8 @@ display_top_tabs($tab_array);
print "<td><b><font color='#ffffff'>ERP</td>";
print "</tr>\n\n";
- $states=split("\n",`/sbin/ifconfig {$if} list sta | grep -v "AID CHAN"`);
+ exec("/sbin/ifconfig {$if}_wlan0 list sta 2>&1", $states, $ret);
+ array_shift($states);
$counter=0;
foreach($states as $state) {
OpenPOWER on IntegriCloud