diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-09-13 16:55:04 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-09-13 16:55:04 +0000 |
commit | 6e52f644d73af180ffe35a7d693f8740b4b5d5ab (patch) | |
tree | 89b176f02a6b932d9426cd6cc8cb6c4ea3617373 /usr/local | |
parent | 71e0e7be2fd94298c41d47f545b5f60cb2e1597d (diff) | |
download | pfsense-6e52f644d73af180ffe35a7d693f8740b4b5d5ab.zip pfsense-6e52f644d73af180ffe35a7d693f8740b4b5d5ab.tar.gz |
* Handle inverse grep correctly
* Only show system logs on System tab (no racoon)
Diffstat (limited to 'usr/local')
-rwxr-xr-x | usr/local/www/diag_logs.php | 2 | ||||
-rwxr-xr-x | usr/local/www/guiconfig.inc | 21 |
2 files changed, 14 insertions, 9 deletions
diff --git a/usr/local/www/diag_logs.php b/usr/local/www/diag_logs.php index 183a11b..b1c17f1 100755 --- a/usr/local/www/diag_logs.php +++ b/usr/local/www/diag_logs.php @@ -78,7 +78,7 @@ include("head.inc"); <tr> <td colspan="2" class="listtopic">Last <?=$nentries;?> system log entries</td> </tr> - <?php dump_clog($system_logfile, $nentries, true, "", array("racoon")); ?> + <?php dump_clog($system_logfile, $nentries, true, array(" "), array("racoon")); ?> <tr> <td> <br> diff --git a/usr/local/www/guiconfig.inc b/usr/local/www/guiconfig.inc index 3b9e673..2c79557 100755 --- a/usr/local/www/guiconfig.inc +++ b/usr/local/www/guiconfig.inc @@ -497,18 +497,23 @@ function dump_clog($logfile, $tail, $withorig = true, $grepfor = "", $grepinvert global $g, $config; $sor = isset($config['syslog']['reverse']) ? "-r" : ""; exec("/usr/sbin/clog {$logfile} | /usr/bin/tail {$sor} -n {$tail}", $logarr); + /* handle grep for case */ if($grepfor <> "") { $i = 0; foreach($grepfor as $agrep) { - $regexp = "/" . $agrep . "/i"; - if($grepinvert[$i] == true) { - $logarr = preg_grep($regexp, $logarr, PREG_GREP_INVERT); - } else { - $logarr = preg_grep($regexp, $logarr); - } - $i++; - } + $regexp = "/" . $agrep . "/i"; + $logarr = preg_grep($regexp, $logarr); + $i++; + } } + /* handle grepinvert (inverse) case */ + if(is_array($grepinvert)) { + foreach($grepinvert as $invert) { + $regexp = "/" . $invert . "/i"; + $logarr = preg_grep($regexp, $logarr, PREG_GREP_INVERT); + } + } + /* assemble html table for logs */ foreach ($logarr as $logent) { $logent = preg_split("/\s+/", $logent, 6); echo "<tr valign=\"top\">\n"; |