From 9d01ba6cd01bdfca2bac0022ebab40fd360d346d Mon Sep 17 00:00:00 2001 From: bmeeks8 Date: Sat, 14 Dec 2013 21:00:00 -0500 Subject: Add config value for number of alerts to display. --- config/widget-snort/snort_alerts.widget.php | 30 ++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'config') diff --git a/config/widget-snort/snort_alerts.widget.php b/config/widget-snort/snort_alerts.widget.php index f4eaa140..691b03a3 100644 --- a/config/widget-snort/snort_alerts.widget.php +++ b/config/widget-snort/snort_alerts.widget.php @@ -26,6 +26,7 @@ POSSIBILITY OF SUCH DAMAGE. */ +require_once("guiconfig.inc"); require_once("/usr/local/www/widgets/include/widget-snort.inc"); global $config, $g; @@ -61,7 +62,14 @@ function sksort(&$array, $subkey="id", $sort_ascending=false) { }; /* check if firewall widget variable is set */ -if (!isset($nentries)) $nentries = 5; +$nentries = $config['widgets']['widget_snort_display_lines']; +if (!isset($nentries) || $nentries < 0) $nentries = 5; + +if(isset($_POST['widget_snort_display_lines'])) { + $config['widgets']['widget_snort_display_lines'] = $_POST['widget_snort_display_lines']; + write_config("Saved Snort Alerts Widget Displayed Lines Parameter via Dashboard"); + header("Location: ../../index.php"); +} /* check if Snort include file exists before we use it */ if (file_exists("/usr/local/pkg/snort/snort.inc")) { @@ -121,6 +129,16 @@ if (file_exists("/usr/local/pkg/snort/snort.inc")) { /* display the result */ ?> + + + + @@ -150,3 +168,13 @@ if (is_array($snort_alerts)) { ?>
+ + + + -- cgit v1.2.3