summaryrefslogtreecommitdiffstats
path: root/usr/local/www/diag_pkglogs.php
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2015-04-19 18:00:00 +0545
committerPhil Davis <phil.davis@inf.org>2015-04-19 18:00:00 +0545
commit5f6010605ba8e3ab2fbc27080ec2db80dbd0e32e (patch)
treecd25c71caf551eb882f460ac6e1c32c8220fe58f /usr/local/www/diag_pkglogs.php
parent0608bd3c354ea76eb6df9ed9322e2ef8686f15e7 (diff)
downloadpfsense-5f6010605ba8e3ab2fbc27080ec2db80dbd0e32e.zip
pfsense-5f6010605ba8e3ab2fbc27080ec2db80dbd0e32e.tar.gz
Code style usr-local-www diag
Diffstat (limited to 'usr/local/www/diag_pkglogs.php')
-rwxr-xr-xusr/local/www/diag_pkglogs.php76
1 files changed, 41 insertions, 35 deletions
diff --git a/usr/local/www/diag_pkglogs.php b/usr/local/www/diag_pkglogs.php
index cd1b833..c88bb87 100755
--- a/usr/local/www/diag_pkglogs.php
+++ b/usr/local/www/diag_pkglogs.php
@@ -41,7 +41,7 @@
*/
/*
- pfSense_BUILDER_BINARIES: /usr/bin/netstat
+ pfSense_BUILDER_BINARIES: /usr/bin/netstat
pfSense_MODULE: pkgs
*/
@@ -55,18 +55,20 @@
require("guiconfig.inc");
require("pkg-utils.inc");
-if(!($nentries = $config['syslog']['nentries'])) $nentries = 50;
+if (!($nentries = $config['syslog']['nentries'])) {
+ $nentries = 50;
+}
-//if ($_POST['clear'])
+//if ($_POST['clear'])
// clear_log_file($logfile);
$i = 0;
$pkgwithlogging = false;
$apkg = $_GET['pkg'];
-if(!$apkg) { // If we aren't looking for a specific package, locate the first package that handles logging.
- if($config['installedpackages']['package'] <> "") {
- foreach($config['installedpackages']['package'] as $package) {
- if(is_array($package['logging'])) {
+if (!$apkg) { // If we aren't looking for a specific package, locate the first package that handles logging.
+ if ($config['installedpackages']['package'] <> "") {
+ foreach ($config['installedpackages']['package'] as $package) {
+ if (is_array($package['logging'])) {
$pkgwithlogging = true;
$apkg = $package['name'];
$apkgid = $i;
@@ -75,7 +77,7 @@ if(!$apkg) { // If we aren't looking for a specific package, locate the first pa
$i++;
}
}
-} elseif($apkg) {
+} elseif ($apkg) {
$apkgid = get_pkg_id($apkg);
if ($apkgid != -1) {
$pkgwithlogging = true;
@@ -90,51 +92,55 @@ include("head.inc");
<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
<?php include("fbegin.inc"); ?>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
- <tr>
- <td>
- <?php
- if($pkgwithlogging == false) {
+ <tr>
+ <td>
+ <?php
+ if ($pkgwithlogging == false) {
print_info_box(gettext("No packages with logging facilities are currently installed."));
echo '</ul></td></tr></table>';
include("fend.inc");
exit;
}
$tab_array = array();
- foreach($config['installedpackages']['package'] as $package) {
- if(is_array($package['logging'])) {
- if(!($logtab = $package['logging']['logtab'])) $logtab = $package['name'];
- if($apkg == $package['name']) {
+ foreach ($config['installedpackages']['package'] as $package) {
+ if (is_array($package['logging'])) {
+ if (!($logtab = $package['logging']['logtab'])) {
+ $logtab = $package['name'];
+ }
+ if ($apkg == $package['name']) {
$curtab = $logtab;
$tab_array[] = array(sprintf(gettext("%s"),$logtab), true, "diag_pkglogs.php?pkg=".$package['name']);
} else {
$tab_array[] = array(sprintf(gettext("%s"),$logtab), false, "diag_pkglogs.php?pkg=".$package['name']);
}
}
- }
+ }
display_top_tabs($tab_array);
- ?>
- </td></tr>
- <tr>
- <td>
- <div id="mainarea">
- <table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td colspan="2" class="listtopic">
- <?php printf(gettext('Last %1$s %2$s log entries'),$nentries,$curtab); ?></td>
- </tr>
- <?php
- $package =& $config['installedpackages']['package'][$apkgid];
- dump_clog($g['varlog_path'] . '/' . $package['logging']['logfilename'], $nentries);
- ?>
- </table>
+ ?>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <div id="mainarea">
+ <table class="tabcont" width="100%" border="0" cellspacing="0" cellpadding="0">
+ <tr>
+ <td colspan="2" class="listtopic">
+ <?php printf(gettext('Last %1$s %2$s log entries'),$nentries,$curtab); ?>
+ </td>
+ </tr>
+ <?php
+ $package =& $config['installedpackages']['package'][$apkgid];
+ dump_clog($g['varlog_path'] . '/' . $package['logging']['logfilename'], $nentries);
+ ?>
+ </table>
<!--
<form action="diag_pkglogs.php" method="post">
<input name="clear" type="submit" class="formbtn" value="Clear log">
</form>
-->
- </div>
- </td>
- </tr>
+ </div>
+ </td>
+ </tr>
</table>
<?php include("fend.inc"); ?>
</body>
OpenPOWER on IntegriCloud