<?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); }
function get_wireless_channel_info($interface) { $wireless_channels = array(); $cloned_interface = get_real_interface($interface); if ($cloned_interface && is_interface_wireless($cloned_interface)) { $chan_list = "/sbin/ifconfig {$cloned_interface} list txpower"; $stack_list = "/usr/bin/awk -F\"Channel \" '{ gsub(/\\*/, \" \"); print \$2 \"\\\n\" \$3 }'"; $format_list = "/usr/bin/awk '{print \$1 \",\" \$3 \" \" \$4 \",\" \$5 \",\" \$7}'"; $interface_channels = ""; exec("{$chan_list} | {$stack_list} | sort -u | {$format_list} 2>&1", $interface_channels); foreach ($interface_channels as $channel_line) { $channel_line = explode(",", $channel_line); if (!isset($wireless_channels[$channel_line[0]])) { $wireless_channels[$channel_line[0]] = $channel_line; } } } return $wireless_channels; }
$ifdescrs = get_configured_interface_with_descr(); ?> <table class="table table-striped table-hover"> <?php foreach ($ifdescrs as $ifdescr => $ifname) { $ifinfo = get_interface_info($ifdescr); if ($ifinfo['pppoelink'] || $ifinfo['pptplink'] || $ifinfo['l2tplink']) { /* PPP link (non-cell) - looks like a modem */ $typeicon = 'hdd-o'; } else { if ($ifinfo['ppplink']) { /* PPP Link (usually cellular) */ $typeicon = 'signal'; } else { if (is_interface_wireless($ifdescr)) { /* Wi-Fi interface (hostap/client/etc) */ $typeicon = 'wifi'; } else { /* Wired/other interface. */ $typeicon = 'sitemap'; } } } $known_status = true; // Choose an icon by interface status if ($ifinfo['status'] == "up" || $ifinfo['status'] == "associated") { $icon = 'arrow-up'; } elseif ($ifinfo['status'] == "no carrier") { $icon = 'times-circle'; } elseif ($ifinfo['status'] == "down") {
POSSIBILITY OF SUCH DAMAGE. */ $nocsrf = true; require_once "guiconfig.inc"; require_once "pfsense-utils.inc"; require_once "functions.inc"; require_once "widgets/include/interfaces.inc"; $i = 0; $ifdescrs = get_configured_interface_with_descr(); ?> <table class="table table-striped"> <?php foreach ($ifdescrs as $ifdescr => $ifname) { $ifinfo = get_interface_info($ifdescr); $iswireless = is_interface_wireless($ifdescr); ?> <tr> <td class="vncellt" > <?php if ($ifinfo['ppplink']) { ?> <span alt="3g" class="glyphicon glyphicon-phone text-success"></span> <?php } elseif ($iswireless) { if ($ifinfo['status'] == "associated") { ?> <span alt="wlan" class="glyphicon glyphicon-signal text-success"></span> <?php } else { ?> <span alt="wlan_d" class="glyphicon glyphicon-signal text-danger"></span>