diff options
author | Renato Botelho <garga@FreeBSD.org> | 2015-02-23 17:06:00 -0300 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2015-02-23 17:06:00 -0300 |
commit | fe029a6400adf6fe6efc3a302dde65138e674625 (patch) | |
tree | 8ff1dc55982060f53662495a73903cd20341afd7 /config/snort/snort_alerts.widget.php | |
parent | 0b6aacfc765bc202715838afd0665e2abe8a8b44 (diff) | |
parent | 93656e41097c250d9951000261effca93118e1bd (diff) | |
download | pfsense-packages-fe029a6400adf6fe6efc3a302dde65138e674625.tar.gz pfsense-packages-fe029a6400adf6fe6efc3a302dde65138e674625.tar.bz2 pfsense-packages-fe029a6400adf6fe6efc3a302dde65138e674625.zip |
Merge pull request #826 from phil-davis/patch-3
Diffstat (limited to 'config/snort/snort_alerts.widget.php')
-rw-r--r-- | config/snort/snort_alerts.widget.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/config/snort/snort_alerts.widget.php b/config/snort/snort_alerts.widget.php index 552dab61..96c70562 100644 --- a/config/snort/snort_alerts.widget.php +++ b/config/snort/snort_alerts.widget.php @@ -46,7 +46,7 @@ $alertColClass = "listMRr"; /* check if Snort widget alert display lines value is set */ $snort_nentries = $config['widgets']['widget_snort_display_lines']; -if (!isset($snort_nentries) || $snort_nentries < 0) +if (!isset($snort_nentries) || $snort_nentries <= 0) $snort_nentries = 5; /* array sorting of the alerts */ @@ -95,7 +95,11 @@ if (isset($_GET['getNewAlerts'])) { // See if saving new display line count value if(isset($_POST['widget_snort_display_lines'])) { - $config['widgets']['widget_snort_display_lines'] = $_POST['widget_snort_display_lines']; + if($_POST['widget_snort_display_lines'] == "") { + unset($config['widgets']['widget_snort_display_lines']); + } else { + $config['widgets']['widget_snort_display_lines'] = max(intval($_POST['widget_snort_display_lines']), 1); + } write_config("Saved Snort Alerts Widget Displayed Lines Parameter via Dashboard"); header("Location: ../../index.php"); } |