diff options
author | Phil Davis <phil.davis@inf.org> | 2015-06-15 14:19:11 +0545 |
---|---|---|
committer | Phil Davis <phil.davis@inf.org> | 2015-06-15 14:19:11 +0545 |
commit | 6c07db487164262f9191ad02805523bd153e0ba6 (patch) | |
tree | 0c266356179ac730233a16c0e3767a0c22514c4d /usr/local/www/status.php | |
parent | 67d9685607eef7c679fda929ad4855be1b2f9dec (diff) | |
download | pfsense-6c07db487164262f9191ad02805523bd153e0ba6.zip pfsense-6c07db487164262f9191ad02805523bd153e0ba6.tar.gz |
Code spacing
and other random stuff I noticed.
I think this finishes messing with code style. The codebase should match
the developer style guide closely enough that 99.9% of changes will not
feel the need to also massage the formatting.
Diffstat (limited to 'usr/local/www/status.php')
-rwxr-xr-x | usr/local/www/status.php | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/usr/local/www/status.php b/usr/local/www/status.php index 5248659..b15edc3 100755 --- a/usr/local/www/status.php +++ b/usr/local/www/status.php @@ -67,7 +67,7 @@ function doCmdT($title, $command) { /* Fixup output directory */ $rubbish = array('|', '-', '/', '.', ' '); /* fixes the <a> tag to be W3C compliant */ - echo "\n<a name=\"" . str_replace($rubbish,'',$title) . "\" id=\"" . str_replace($rubbish,'',$title) . "\"></a>\n"; + echo "\n<a name=\"" . str_replace($rubbish, '', $title) . "\" id=\"" . str_replace($rubbish, '', $title) . "\"></a>\n"; echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" summary=\"" . $title . "\">\n"; echo "\t<tr><td class=\"listtopic\">" . $title . "</td></tr>\n"; echo "\t<tr>\n\t\t<td class=\"listlr\">\n\t\t\t<pre>"; /* no newline after pre */ @@ -95,7 +95,7 @@ function doCmdT($title, $command) { $line = preg_replace("/<crypto_password>.*?<\\/crypto_password>/", "<crypto_password>xxxxx</crypto_password>", $line); $line = preg_replace("/<crypto_password2>.*?<\\/crypto_password2>/", "<crypto_password2>xxxxx</crypto_password2>", $line); $line = str_replace("\t", " ", $line); - echo htmlspecialchars($line,ENT_NOQUOTES); + echo htmlspecialchars($line, ENT_NOQUOTES); fwrite($ofd, $line); } } @@ -110,7 +110,7 @@ function doCmdT($title, $command) { if ($i > 0) { echo "\n"; } - echo htmlspecialchars($execOutput[$i],ENT_NOQUOTES); + echo htmlspecialchars($execOutput[$i], ENT_NOQUOTES); fwrite($ofd, $execOutput[$i] . "\n"); } fclose($ofd); @@ -122,7 +122,7 @@ function doCmdT($title, $command) { /* Define a command, with a title, to be executed later. */ function defCmdT($title, $command) { global $commands; - $title = htmlspecialchars($title,ENT_NOQUOTES); + $title = htmlspecialchars($title, ENT_NOQUOTES); $commands[] = array($title, $command); } @@ -132,8 +132,8 @@ function listCmds() { $rubbish = array('|', '-', '/', '.', ' '); /* fixes the <a> tag to be W3C compliant */ echo "\n<p>" . gettext("This status page includes the following information") . ":\n"; echo "<ul>\n"; - for ($i = 0; isset($commands[$i]); $i++ ) { - echo "\t<li><strong><a href=\"#" . str_replace($rubbish,'',$commands[$i][0]) . "\">" . $commands[$i][0] . "</a></strong></li>\n"; + for ($i = 0; isset($commands[$i]); $i++) { + echo "\t<li><strong><a href=\"#" . str_replace($rubbish, '', $commands[$i][0]) . "\">" . $commands[$i][0] . "</a></strong></li>\n"; } echo "</ul>\n"; } @@ -141,7 +141,7 @@ function listCmds() { /* Execute all of the commands which were defined by a call to defCmd. */ function execCmds() { global $commands; - for ($i = 0; isset($commands[$i]); $i++ ) { + for ($i = 0; isset($commands[$i]); $i++) { doCmdT($commands[$i][0], $commands[$i][1]); } } @@ -151,35 +151,35 @@ 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("System uptime", "/usr/bin/uptime"); +defCmdT("Interfaces", "/sbin/ifconfig -a"); 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"); /* 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'])) { @@ -191,14 +191,14 @@ if (isset($config['captiveportal']) && is_array($config['captiveportal'])) { /* 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("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("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"); } @@ -217,24 +217,24 @@ if (file_exists("/var/etc/apinger.conf")) { 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 200 system log entries","/usr/sbin/fifolog_reader /var/log/system.log 2>&1 | tail -n 200"); - defCmdT("last 50 filter log entries","/usr/sbin/fifolog_reader /var/log/filter.log 2>&1 | tail -n 50"); +if (isset($config['system']['usefifolog'])) { + defCmdT("last 200 system log entries", "/usr/sbin/fifolog_reader /var/log/system.log 2>&1 | tail -n 200"); + defCmdT("last 50 filter log entries", "/usr/sbin/fifolog_reader /var/log/filter.log 2>&1 | tail -n 50"); } else { - defCmdT("last 200 system log entries","/usr/local/sbin/clog /var/log/system.log 2>&1 | tail -n 200"); - defCmdT("last 50 filter log entries","/usr/local/sbin/clog /var/log/filter.log 2>&1 | tail -n 50"); + defCmdT("last 200 system log entries", "/usr/local/sbin/clog /var/log/system.log 2>&1 | tail -n 200"); + defCmdT("last 50 filter log entries", "/usr/local/sbin/clog /var/log/filter.log 2>&1 | tail -n 50"); } 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]; -$pgtitle = array("{$g['product_name']}","status"); +$pgtitle = array("{$g['product_name']}", "status"); include("head.inc"); ?> @@ -267,7 +267,7 @@ pre { <?=gettext("Saving output to archive...");?> <?php if (is_dir($output_path)) { - mwexec("/usr/bin/tar czpf " . escapeshellarg($output_file) . " -C " . escapeshellarg(dirname($output_path)) . " " . escapeshellarg(basename($output_path))); + mwexec("/usr/bin/tar czpf " . escapeshellarg($output_file) . " -C " . escapeshellarg(dirname($output_path)) . " " . escapeshellarg(basename($output_path))); unlink_if_exists("{$output_path}/*"); @rmdir($output_path); } |