From abe98adb911f9ff76af12034646a4c64e26d6390 Mon Sep 17 00:00:00 2001 From: Phil Davis Date: Tue, 15 Dec 2015 10:38:12 +0545 Subject: Code style status* --- src/usr/local/www/status.php | 145 +++++++++++---------- src/usr/local/www/status_captiveportal.php | 12 +- src/usr/local/www/status_captiveportal_expire.php | 5 +- .../www/status_captiveportal_voucher_rolls.php | 4 +- src/usr/local/www/status_carp.php | 13 +- src/usr/local/www/status_dhcp_leases.php | 17 ++- src/usr/local/www/status_dhcpv6_leases.php | 41 +++--- src/usr/local/www/status_gateway_groups.php | 19 +-- src/usr/local/www/status_gateways.php | 30 +++-- src/usr/local/www/status_graph.php | 19 +-- src/usr/local/www/status_interfaces.php | 34 ++--- src/usr/local/www/status_ipsec.php | 24 ++-- src/usr/local/www/status_ipsec_leases.php | 7 +- src/usr/local/www/status_ipsec_sad.php | 4 +- src/usr/local/www/status_ipsec_spd.php | 8 +- src/usr/local/www/status_lb_pool.php | 15 ++- src/usr/local/www/status_lb_vs.php | 7 +- src/usr/local/www/status_logs.php | 49 +++---- src/usr/local/www/status_logs_filter.php | 89 +++++++------ src/usr/local/www/status_logs_filter_dynamic.php | 51 +++++--- src/usr/local/www/status_logs_filter_summary.php | 6 +- src/usr/local/www/status_logs_settings.php | 13 +- src/usr/local/www/status_logs_vpn.php | 23 ++-- src/usr/local/www/status_openvpn.php | 6 +- src/usr/local/www/status_pkglogs.php | 3 +- src/usr/local/www/status_rrd_graph.php | 117 +++++++++-------- src/usr/local/www/status_rrd_graph_img.php | 2 +- src/usr/local/www/status_rrd_graph_settings.php | 20 +-- src/usr/local/www/status_services.php | 5 +- src/usr/local/www/status_upnp.php | 10 +- src/usr/local/www/status_wireless.php | 20 +-- 31 files changed, 449 insertions(+), 369 deletions(-) (limited to 'src/usr') diff --git a/src/usr/local/www/status.php b/src/usr/local/www/status.php index b4bbd44..c4a5ac0 100755 --- a/src/usr/local/www/status.php +++ b/src/usr/local/www/status.php @@ -100,9 +100,9 @@ function doCmdT($title, $command) { echo "\n\n"; print('
'); - print( '
' . $title . '
'); - print( '
'); - print( '
');
+	print('
' . $title . '
'); + print('
'); + print('
');
 
 	if ($command == "dumpconfigxml") {
 		$ofd = @fopen("{$output_path}/config-sanitized.xml", "w");
@@ -148,8 +148,8 @@ function doCmdT($title, $command) {
 		fclose($ofd);
 	}
 
-	print(		  '
'); - print( '
'); + print('
'); + print('
'); print('
'); } @@ -168,13 +168,13 @@ function listCmds() { $rubbish = array('|', '-', '/', '.', ' '); /* fixes the tag to be W3C compliant */ print('
'); - print( '
' . gettext("System status on ") . $currentDate . '
'); - print( '
'); - print( '
'); + print('
' . gettext("System status on ") . $currentDate . '
'); + print('
'); + print('
'); print("\n

" . gettext("This status page includes the following information") . ":\n"); print("

\n"); @@ -196,56 +196,57 @@ global $g, $config; /* Set up all of the commands we want to execute. */ /* System stats/info */ -defCmdT("System uptime","/usr/bin/uptime"); -defCmdT("Interfaces","/sbin/ifconfig -a"); -defCmdT("Interface Statistics","/usr/bin/netstat -nWi"); +defCmdT("System uptime", "/usr/bin/uptime"); +defCmdT("Interfaces", "/sbin/ifconfig -a"); +defCmdT("Interface Statistics", "/usr/bin/netstat -nWi"); defCmdT("Top Process Info", "/usr/bin/top | /usr/bin/head -n5"); -defCmdT("Processes","/bin/ps xauww"); +defCmdT("Processes", "/bin/ps xauww"); defCmdT("Mounted Filesystems", "/sbin/mount"); -defCmdT("Free Disk Space","/bin/df -hi"); -defCmdT("Routing tables","/usr/bin/netstat -nWr"); -defCmdT("Mbuf Usage","/usr/bin/netstat -mb"); +defCmdT("Free Disk Space", "/bin/df -hi"); +defCmdT("Routing tables", "/usr/bin/netstat -nWr"); +defCmdT("Mbuf Usage", "/usr/bin/netstat -mb"); defCmdT("VMStat", "/usr/bin/vmstat -afimsz"); defCmdT("Sockets", "/usr/bin/sockstat"); /* Firewall rules and info */ -defCmdT("Generated Ruleset","/bin/cat {$g['tmp_path']}/rules.debug"); -defCmdT("Generated Ruleset Limiters","/bin/cat {$g['tmp_path']}/rules.limiter"); -defCmdT("Generated Ruleset Limits","/bin/cat {$g['tmp_path']}/rules.limits"); +defCmdT("Generated Ruleset", "/bin/cat {$g['tmp_path']}/rules.debug"); +defCmdT("Generated Ruleset Limiters", "/bin/cat {$g['tmp_path']}/rules.limiter"); +defCmdT("Generated Ruleset Limits", "/bin/cat {$g['tmp_path']}/rules.limits"); defCmdT("pf NAT Rules", "/sbin/pfctl -vvsn"); defCmdT("pf Firewall Rules", "/sbin/pfctl -vvsr"); -defCmdT("pf Tables","/sbin/pfctl -vs Tables"); +defCmdT("pf Tables", "/sbin/pfctl -vs Tables"); defCmdT("pf State Table Contents", "/sbin/pfctl -ss"); defCmdT("pf Info", "/sbin/pfctl -si"); defCmdT("pf Show All", "/sbin/pfctl -sa"); -defCmdT("pf Queues","/sbin/pfctl -s queue -v"); -defCmdT("pf OSFP","/sbin/pfctl -s osfp"); -defCmdT("pfsync stats","/usr/bin/netstat -s -ppfsync"); -defCmdT("pftop Default","/usr/local/sbin/pftop -a -b"); -defCmdT("pftop Long","/usr/local/sbin/pftop -w 150 -a -b -v long"); -defCmdT("pftop Queue","/usr/local/sbin/pftop -w 150 -a -b -v queue"); -defCmdT("pftop Rules","/usr/local/sbin/pftop -w 150 -a -b -v rules"); -defCmdT("pftop Size","/usr/local/sbin/pftop -w 150 -a -b -v size"); -defCmdT("pftop Speed","/usr/local/sbin/pftop -w 150 -a -b -v speed"); +defCmdT("pf Queues", "/sbin/pfctl -s queue -v"); +defCmdT("pf OSFP", "/sbin/pfctl -s osfp"); +defCmdT("pfsync stats", "/usr/bin/netstat -s -ppfsync"); +defCmdT("pftop Default", "/usr/local/sbin/pftop -a -b"); +defCmdT("pftop Long", "/usr/local/sbin/pftop -w 150 -a -b -v long"); +defCmdT("pftop Queue", "/usr/local/sbin/pftop -w 150 -a -b -v queue"); +defCmdT("pftop Rules", "/usr/local/sbin/pftop -w 150 -a -b -v rules"); +defCmdT("pftop Size", "/usr/local/sbin/pftop -w 150 -a -b -v size"); +defCmdT("pftop Speed", "/usr/local/sbin/pftop -w 150 -a -b -v speed"); if (isset($config['captiveportal']) && is_array($config['captiveportal'])) { foreach ($config['captiveportal'] as $cpZone => $cpdata) { - if (isset($cpdata['enable'])) + if (isset($cpdata['enable'])) { defCmdT("IPFW rules for {$cpdata['zone']}", "/sbin/ipfw -x " . escapeshellarg($cpdata['zoneid']) . " show"); + } } } /* Configuration Files */ defCmdT("Contents of var run", "/bin/ls /var/run"); defCmdT("Contents of conf", "/bin/ls /conf"); -defCmdT("config.xml","dumpconfigxml"); -defCmdT("resolv.conf","/bin/cat /etc/resolv.conf"); -defCmdT("DHCP Configuration","/bin/cat /var/dhcpd/etc/dhcpd.conf"); -defCmdT("DHCPv6 Configuration","/bin/cat /var/dhcpd/etc/dhcpdv6.conf"); -defCmdT("strongSwan config","/bin/cat /var/etc/ipsec/strongswan.conf"); -defCmdT("IPsec config","/bin/cat /var/etc/ipsec/ipsec.conf"); -defCmdT("IPsec Status","/usr/local/sbin/ipsec statusall"); -defCmdT("SPD","/sbin/setkey -DP"); -defCmdT("SAD","/sbin/setkey -D"); +defCmdT("config.xml", "dumpconfigxml"); +defCmdT("resolv.conf", "/bin/cat /etc/resolv.conf"); +defCmdT("DHCP Configuration", "/bin/cat /var/dhcpd/etc/dhcpd.conf"); +defCmdT("DHCPv6 Configuration", "/bin/cat /var/dhcpd/etc/dhcpdv6.conf"); +defCmdT("strongSwan config", "/bin/cat /var/etc/ipsec/strongswan.conf"); +defCmdT("IPsec config", "/bin/cat /var/etc/ipsec/ipsec.conf"); +defCmdT("IPsec Status", "/usr/local/sbin/ipsec statusall"); +defCmdT("SPD", "/sbin/setkey -DP"); +defCmdT("SAD", "/sbin/setkey -D"); if (file_exists("/cf/conf/upgrade_log.txt")) { defCmdT("Upgrade Log", "/bin/cat /cf/conf/upgrade_log.txt"); } @@ -258,43 +259,43 @@ if (file_exists("/boot/loader.conf.local")) { if (file_exists("/var/etc/filterdns.conf")) { defCmdT("Filter DNS Daemon Config", "/bin/cat /var/etc/filterdns.conf"); } -if(isset($config['system']['usefifolog'])) { - defCmdT("last 1000 system log entries","/usr/sbin/fifolog_reader /var/log/system.log 2>&1 | tail -n 1000"); - defCmdT("last 1000 DHCP log entries","/usr/sbin/fifolog_reader /var/log/dhcpd.log 2>&1 | tail -n 1000"); - defCmdT("last 500 filter log entries","/usr/sbin/fifolog_reader /var/log/filter.log 2>&1 | tail -n 500"); - defCmdT("last 1000 gateways log entries","/usr/sbin/fifolog_reader /var/log/gateways.log 2>&1 | tail -n 1000"); - defCmdT("last 1000 IPsec log entries","/usr/sbin/fifolog_reader /var/log/ipsec.log 2>&1 | tail -n 1000"); - defCmdT("last 1000 L2TP log entries","/usr/sbin/fifolog_reader /var/log/l2tps.log 2>&1 | tail -n 1000"); - defCmdT("last 1000 NTP log entries","/usr/sbin/fifolog_reader /var/log/ntpd.log 2>&1 | tail -n 1000"); - defCmdT("last 1000 OpenVPN log entries","/usr/sbin/fifolog_reader /var/log/openvpn.log 2>&1 | tail -n 1000"); - defCmdT("last 1000 Captive Portal auth log entries","/usr/sbin/fifolog_reader /var/log/portalauth.log 2>&1 | tail -n 1000"); - defCmdT("last 1000 PPP log entries","/usr/sbin/fifolog_reader /var/log/poes.log 2>&1 | tail -n 1000"); - defCmdT("last 1000 relayd log entries","/usr/sbin/fifolog_reader /var/log/relayd.log 2>&1 | tail -n 1000"); - defCmdT("last 1000 resolver log entries","/usr/sbin/fifolog_reader /var/log/resolver.log 2>&1 | tail -n 1000"); - defCmdT("last 1000 routing log entries","/usr/sbin/fifolog_reader /var/log/routing.log 2>&1 | tail -n 1000"); - defCmdT("last 1000 wireless log entries","/usr/sbin/fifolog_reader /var/log/wireless.log 2>&1 | tail -n 1000"); +if (isset($config['system']['usefifolog'])) { + defCmdT("last 1000 system log entries", "/usr/sbin/fifolog_reader /var/log/system.log 2>&1 | tail -n 1000"); + defCmdT("last 1000 DHCP log entries", "/usr/sbin/fifolog_reader /var/log/dhcpd.log 2>&1 | tail -n 1000"); + defCmdT("last 500 filter log entries", "/usr/sbin/fifolog_reader /var/log/filter.log 2>&1 | tail -n 500"); + defCmdT("last 1000 gateways log entries", "/usr/sbin/fifolog_reader /var/log/gateways.log 2>&1 | tail -n 1000"); + defCmdT("last 1000 IPsec log entries", "/usr/sbin/fifolog_reader /var/log/ipsec.log 2>&1 | tail -n 1000"); + defCmdT("last 1000 L2TP log entries", "/usr/sbin/fifolog_reader /var/log/l2tps.log 2>&1 | tail -n 1000"); + defCmdT("last 1000 NTP log entries", "/usr/sbin/fifolog_reader /var/log/ntpd.log 2>&1 | tail -n 1000"); + defCmdT("last 1000 OpenVPN log entries", "/usr/sbin/fifolog_reader /var/log/openvpn.log 2>&1 | tail -n 1000"); + defCmdT("last 1000 Captive Portal auth log entries", "/usr/sbin/fifolog_reader /var/log/portalauth.log 2>&1 | tail -n 1000"); + defCmdT("last 1000 PPP log entries", "/usr/sbin/fifolog_reader /var/log/poes.log 2>&1 | tail -n 1000"); + defCmdT("last 1000 relayd log entries", "/usr/sbin/fifolog_reader /var/log/relayd.log 2>&1 | tail -n 1000"); + defCmdT("last 1000 resolver log entries", "/usr/sbin/fifolog_reader /var/log/resolver.log 2>&1 | tail -n 1000"); + defCmdT("last 1000 routing log entries", "/usr/sbin/fifolog_reader /var/log/routing.log 2>&1 | tail -n 1000"); + defCmdT("last 1000 wireless log entries", "/usr/sbin/fifolog_reader /var/log/wireless.log 2>&1 | tail -n 1000"); } else { - defCmdT("last 1000 system log entries","/usr/local/sbin/clog /var/log/system.log 2>&1 | tail -n 1000"); - defCmdT("last 1000 DHCP log entries","/usr/local/sbin/clog /var/log/dhcpd.log 2>&1 | tail -n 1000"); - defCmdT("last 500 filter log entries","/usr/local/sbin/clog /var/log/filter.log 2>&1 | tail -n 500"); - defCmdT("last 1000 gateways log entries","/usr/local/sbin/clog /var/log/gateways.log 2>&1 | tail -n 1000"); - defCmdT("last 1000 IPsec log entries","/usr/local/sbin/clog /var/log/ipsec.log 2>&1 | tail -n 1000"); - defCmdT("last 1000 L2TP log entries","/usr/local/sbin/clog /var/log/l2tps.log 2>&1 | tail -n 1000"); - defCmdT("last 1000 NTP log entries","/usr/local/sbin/clog /var/log/ntpd.log 2>&1 | tail -n 1000"); - defCmdT("last 1000 OpenVPN log entries","/usr/local/sbin/clog /var/log/openvpn.log 2>&1 | tail -n 1000"); - defCmdT("last 1000 Captive Portal auth log entries","/usr/local/sbin/clog /var/log/portalauth.log 2>&1 | tail -n 1000"); - defCmdT("last 1000 PPP log entries","/usr/local/sbin/clog /var/log/poes.log 2>&1 | tail -n 1000"); - defCmdT("last 1000 relayd log entries","/usr/local/sbin/clog /var/log/relayd.log 2>&1 | tail -n 1000"); - defCmdT("last 1000 resolver log entries","/usr/local/sbin/clog /var/log/resolver.log 2>&1 | tail -n 1000"); - defCmdT("last 1000 routing log entries","/usr/local/sbin/clog /var/log/routing.log 2>&1 | tail -n 1000"); - defCmdT("last 1000 wireless log entries","/usr/local/sbin/clog /var/log/wireless.log 2>&1 | tail -n 1000"); + defCmdT("last 1000 system log entries", "/usr/local/sbin/clog /var/log/system.log 2>&1 | tail -n 1000"); + defCmdT("last 1000 DHCP log entries", "/usr/local/sbin/clog /var/log/dhcpd.log 2>&1 | tail -n 1000"); + defCmdT("last 500 filter log entries", "/usr/local/sbin/clog /var/log/filter.log 2>&1 | tail -n 500"); + defCmdT("last 1000 gateways log entries", "/usr/local/sbin/clog /var/log/gateways.log 2>&1 | tail -n 1000"); + defCmdT("last 1000 IPsec log entries", "/usr/local/sbin/clog /var/log/ipsec.log 2>&1 | tail -n 1000"); + defCmdT("last 1000 L2TP log entries", "/usr/local/sbin/clog /var/log/l2tps.log 2>&1 | tail -n 1000"); + defCmdT("last 1000 NTP log entries", "/usr/local/sbin/clog /var/log/ntpd.log 2>&1 | tail -n 1000"); + defCmdT("last 1000 OpenVPN log entries", "/usr/local/sbin/clog /var/log/openvpn.log 2>&1 | tail -n 1000"); + defCmdT("last 1000 Captive Portal auth log entries", "/usr/local/sbin/clog /var/log/portalauth.log 2>&1 | tail -n 1000"); + defCmdT("last 1000 PPP log entries", "/usr/local/sbin/clog /var/log/poes.log 2>&1 | tail -n 1000"); + defCmdT("last 1000 relayd log entries", "/usr/local/sbin/clog /var/log/relayd.log 2>&1 | tail -n 1000"); + defCmdT("last 1000 resolver log entries", "/usr/local/sbin/clog /var/log/resolver.log 2>&1 | tail -n 1000"); + defCmdT("last 1000 routing log entries", "/usr/local/sbin/clog /var/log/routing.log 2>&1 | tail -n 1000"); + defCmdT("last 1000 wireless log entries", "/usr/local/sbin/clog /var/log/wireless.log 2>&1 | tail -n 1000"); } if (file_exists("/tmp/PHP_errors.log")) { defCmdT("PHP Error Log", "/bin/cat /tmp/PHP_errors.log"); } -defCmdT("System Message Buffer","/sbin/dmesg -a"); -defCmdT("System Message Buffer (Boot)","/bin/cat /var/log/dmesg.boot"); -defCmdT("sysctl values","/sbin/sysctl -a"); +defCmdT("System Message Buffer", "/sbin/dmesg -a"); +defCmdT("System Message Buffer (Boot)", "/bin/cat /var/log/dmesg.boot"); +defCmdT("sysctl values", "/sbin/sysctl -a"); exec("/bin/date", $dateOutput, $dateStatus); $currentDate = $dateOutput[0]; diff --git a/src/usr/local/www/status_captiveportal.php b/src/usr/local/www/status_captiveportal.php index a310847..fc7ee73 100644 --- a/src/usr/local/www/status_captiveportal.php +++ b/src/usr/local/www/status_captiveportal.php @@ -151,8 +151,9 @@ if (count($a_cp) > 1) { $zonelist = array("" => 'None'); - foreach ($a_cp as $cpkey => $cp) + foreach ($a_cp as $cpkey => $cp) { $zonelist[$cpkey] = $cp['zone']; + } $section->addInput(new Form_Select( 'zone', @@ -211,7 +212,7 @@ if (!empty($cpzone)): ?> if (!empty($mac)) { $mac_hi = strtoupper($mac[0] . $mac[1] . $mac[3] . $mac[4] . $mac[6] . $mac[7]); print htmlentities($mac); - if(isset($mac_man[$mac_hi])) { + if (isset($mac_man[$mac_hi])) { print "
{$mac_man[$mac_hi]}"; } } @@ -228,8 +229,11 @@ if (!empty($cpzone)): ?> + if ($last_act != 0) { + echo htmlspecialchars(date("m/d/Y H:i:s", $last_act)); + } +?> + ' . gettext("You can configure high availability sync settings here") . ''); -} else -{ +} else { ?>
0) + if ($status > 0) { $carp_enabled = true; - else + } else { $carp_enabled = false; + } // Sadly this needs to be here so that it is inside the form if ($carp_detected_problems > 0) { @@ -231,7 +232,7 @@ if ($carpcount == 0) { $vhid = $carp['vhid']; $status = get_carp_interface_status("_vip{$carp['uniqid']}"); - if($carp_enabled == false) { + if ($carp_enabled == false) { $icon = 'times-circle'; $status = "DISABLED"; } else { diff --git a/src/usr/local/www/status_dhcp_leases.php b/src/usr/local/www/status_dhcp_leases.php index adbdae9..22aef12 100644 --- a/src/usr/local/www/status_dhcp_leases.php +++ b/src/usr/local/www/status_dhcp_leases.php @@ -305,7 +305,7 @@ if (count($pools) > 0) { foreach ($config['interfaces'] as $ifname => $ifarr) { if (is_array($config['dhcpd'][$ifname]) && - is_array($config['dhcpd'][$ifname]['staticmap'])) { + is_array($config['dhcpd'][$ifname]['staticmap'])) { $staticmap_array_index = 0; foreach ($config['dhcpd'][$ifname]['staticmap'] as $static) { $slease = array(); @@ -385,23 +385,26 @@ $dhcp_leases_subnet_counter = array(); //array to sum up # of leases / subnet $iflist = get_configured_interface_with_descr(); //get interface descr for # of leases foreach ($leases as $data): - if ($data['act'] != "active" && $data['act'] != "static" && $_GET['all'] != 1) + if ($data['act'] != "active" && $data['act'] != "static" && $_GET['all'] != 1) { continue; + } - if ($data['act'] == 'active') + if ($data['act'] == 'active') { $icon = 'fa-check-circle-o'; - elseif ($data['act'] == 'expired') + } elseif ($data['act'] == 'expired') { $icon = 'fa-ban'; - else + } else { $icon = 'fa-times-circle-o'; + } $lip = ip2ulong($data['ip']); if ($data['act'] != "static") { $dlsc=0; foreach ($config['dhcpd'] as $dhcpif => $dhcpifconf) { - if (!is_array($dhcpifconf['range'])) + if (!is_array($dhcpifconf['range'])) { continue; + } if (($lip >= ip2ulong($dhcpifconf['range']['from'])) && ($lip <= ip2ulong($dhcpifconf['range']['to']))) { $data['if'] = $dhcpif; $dhcp_leases_subnet_counter[$dlsc]['dhcpif'] = $dhcpif; @@ -424,7 +427,7 @@ foreach ($leases as $data): - + () diff --git a/src/usr/local/www/status_dhcpv6_leases.php b/src/usr/local/www/status_dhcpv6_leases.php index 9620679..cb7a2ea 100644 --- a/src/usr/local/www/status_dhcpv6_leases.php +++ b/src/usr/local/www/status_dhcpv6_leases.php @@ -332,11 +332,11 @@ while ($i < $leases_count) { $f = $f+2; break; case "client-hostname": - if($data[$f+1] != "") { - $entry['hostname'] = preg_replace('/"/','',$data[$f+1]); + if ($data[$f+1] != "") { + $entry['hostname'] = preg_replace('/"/', '', $data[$f+1]); } else { $hostname = gethostbyaddr($entry['ip']); - if($hostname != "") { + if ($hostname != "") { $entry['hostname'] = $hostname; } } @@ -433,8 +433,9 @@ if (count($pools) > 0) { /* only print pool status when we have one */ } -if (empty($leases)) +if (empty($leases)) { print ''; +} ?>
@@ -458,19 +459,21 @@ if (empty($leases)) $dhcpifconf) { - if(is_array($dhcpifconf['staticmap'])) { + if (is_array($dhcpifconf['staticmap'])) { foreach ($dhcpifconf['staticmap'] as $staticent) { if ($data['ip'] == $staticent['ipaddr']) { $data['if'] = $dhcpif; @@ -479,8 +482,9 @@ foreach ($leases as $data): } } /* exit as soon as we have an interface */ - if ($data['if'] != "") + if ($data['if'] != "") { break; + } } } else { $data['if'] = convert_real_interface_to_friendly_interface_name(guess_interface_from_ip($data['ip'])); @@ -497,7 +501,7 @@ foreach ($leases as $data): - + () @@ -544,19 +548,21 @@ foreach ($leases as $data): $dhcpifconf) { - if(is_array($dhcpifconf['staticmap'])) { + if (is_array($dhcpifconf['staticmap'])) { foreach ($dhcpifconf['staticmap'] as $staticent) { if ($data['ip'] == $staticent['ipaddr']) { $data['if'] = $dhcpif; @@ -565,8 +571,9 @@ foreach ($prefixes as $data): } } /* exit as soon as we have an interface */ - if ($data['if'] != "") + if ($data['if'] != "") { break; + } } } else { $data['if'] = convert_real_interface_to_friendly_interface_name(guess_interface_from_ip($data['ip'])); diff --git a/src/usr/local/www/status_gateway_groups.php b/src/usr/local/www/status_gateway_groups.php index 68c29cc..acbce69 100755 --- a/src/usr/local/www/status_gateway_groups.php +++ b/src/usr/local/www/status_gateway_groups.php @@ -116,7 +116,7 @@ display_top_tabs($tab_array); $tier) { + foreach ($priorities as $number => $tier) { echo "" . sprintf(gettext("Tier %s"), $number) . ""; } ?> @@ -137,23 +137,23 @@ display_top_tabs($tab_array); $tier) { + foreach ($priority_arr as $number => $tier) { /* for each priority process the gateways */ - foreach($tier as $member) { + foreach ($tier as $member) { /* we always have $priority_count fields */ ?> - ,
+ ,
- - - - + if (!empty($lastchange)) { ?>
Last checked diff --git a/src/usr/local/www/status_graph.php b/src/usr/local/www/status_graph.php index afe0933..a685adf 100644 --- a/src/usr/local/www/status_graph.php +++ b/src/usr/local/www/status_graph.php @@ -86,8 +86,10 @@ if ($_POST['height']) { // Get configured interface list $ifdescrs = get_configured_interface_with_descr(); -if (ipsec_enabled()) +if (ipsec_enabled()) { $ifdescrs['enc0'] = "IPsec"; +} + foreach (array('server', 'client') as $mode) { if (is_array($config['openvpn']["openvpn-{$mode}"])) { foreach ($config['openvpn']["openvpn-{$mode}"] as $id => $setting) { @@ -148,7 +150,7 @@ function iflist() { return($iflist); } -$pgtitle = array(gettext("Status"),gettext("Traffic Graph")); +$pgtitle = array(gettext("Status"), gettext("Traffic Graph")); include("head.inc"); @@ -207,7 +209,7 @@ print $form;