From af8ae7cec90871da977f8a04bb8158ef08910994 Mon Sep 17 00:00:00 2001 From: jim-p Date: Sat, 4 Apr 2009 19:45:49 -0400 Subject: Filter log parsing update * Share filter log parsing code instead of using copy/paste/code duplication. * Reworked the JavaScript a little so it could also be shared * Fix a large number of bugs, especially in the AJAX-based dynamic log viewer. * Picks up some more detail from the logs, and more accurately determines the protocol of a given log entry. * Adds a CLI log parser (filterparser.php) * Removed some redundant/unused code * Code cleanup/style fixes * Added support for finding logged rdr rules from miniupnpd NOTE: Due to the dynamic nature of upnp rules, the rule may not be present when checked. --- usr/local/www/widgets/widgets/log.widget.php | 111 +++++++++++++++++++-------- 1 file changed, 81 insertions(+), 30 deletions(-) (limited to 'usr/local/www/widgets/widgets/log.widget.php') diff --git a/usr/local/www/widgets/widgets/log.widget.php b/usr/local/www/widgets/widgets/log.widget.php index 521cd05..4533548 100644 --- a/usr/local/www/widgets/widgets/log.widget.php +++ b/usr/local/www/widgets/widgets/log.widget.php @@ -34,9 +34,73 @@ require_once("guiconfig.inc"); require_once("pfsense-utils.inc"); require_once("functions.inc"); -require_once("/usr/local/www/widgets/include/log.inc"); + +/* In an effort to reduce duplicate code, many shared functions have been moved here. */ +require_once("filter_log.inc"); + +//set variable for custom title +$log_title = "Firewall Logs"; +$log_title_link = "diag_logs_filter.php"; + +if($_POST['filterlogentries']) { + $config['widgets']['filterlogentries'] = $_POST['filterlogentries']; + write_config("Saved Filter Log Entries via Dashboard"); + Header("Location: /"); +} + +$nentries = isset($config['widgets']['filterlogentries']) ? $config['widgets']['filterlogentries'] : 5; + +//set variables for log +$filter_logfile = "{$g['varlog_path']}/filter.log"; +$filterlog = conv_log_filter($filter_logfile, $nentries); + +/* AJAX related routines */ +handle_ajax($nentries, $nentries + 20); + ?> + + + + + +
Act IF @@ -45,36 +109,23 @@ require_once("/usr/local/www/widgets/include/log.inc"); Prot
- -
style="clear:both;"> +
style="clear:both;"> +  ', outputrule);"><?php echo $filterent['act'];?>  +   +   +   -    -   -   -   -   +  
- \ No newline at end of file + + + + -- cgit v1.1