diff options
Diffstat (limited to 'config/widget-snort')
-rw-r--r-- | config/widget-snort/snort_alerts.js | 2 | ||||
-rw-r--r-- | config/widget-snort/snort_alerts.widget.php | 30 | ||||
-rw-r--r-- | config/widget-snort/widget-snort.xml | 2 |
3 files changed, 31 insertions, 3 deletions
diff --git a/config/widget-snort/snort_alerts.js b/config/widget-snort/snort_alerts.js index 0c2d9ca6..c5c743df 100644 --- a/config/widget-snort/snort_alerts.js +++ b/config/widget-snort/snort_alerts.js @@ -1,7 +1,7 @@ var snortlines = Array(); var snorttimer; -var snortupdateDelay = 25500; +var snortupdateDelay = 22000; var snortisBusy = false; var snortisPaused = false; 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 */ ?> + +<input type="hidden" id="snort_alerts-config" name="snort_alerts-config" value="" /> +<div id="snort_alerts-settings" class="widgetconfigdiv" style="display:none;"> + <form action="/widgets/widgets/snort_alerts.widget.php" method="post" name="iformd"> + Enter number of recent alerts to display (default is 5)<br/> + <input type="text" size="5" name="widget_snort_display_lines" class="formfld unknown" id="widget_snort_display_lines" value="<?= $config['widgets']['widget_snort_display_lines'] ?>" /> + <input id="submitd" name="submitd" type="submit" class="formbtn" value="Save" /> + </form> +</div> + <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tbody> <tr class="snort-alert-header"> @@ -150,3 +168,13 @@ if (is_array($snort_alerts)) { ?> </tbody> </table> + +<!-- needed to display the widget settings menu --> +<script type="text/javascript"> +//<![CDATA[ + selectIntLink = "snort_alerts-configure"; + textlink = document.getElementById(selectIntLink); + textlink.style.display = "inline"; +//]]> +</script> + diff --git a/config/widget-snort/widget-snort.xml b/config/widget-snort/widget-snort.xml index 29edcc3f..1a371ca5 100644 --- a/config/widget-snort/widget-snort.xml +++ b/config/widget-snort/widget-snort.xml @@ -46,7 +46,7 @@ <requirements>Dashboard package and Snort</requirements> <faq>Currently there are no FAQ items provided.</faq> <name>widget-snort</name> - <version>0.3.5</version> + <version>0.3.6</version> <title>Widget - Snort</title> <include_file>/usr/local/www/widgets/include/widget-snort.inc</include_file> <additional_files_needed> |