From 02b50f05c58c17b8fff6b9b47e04cda0cb64dbfc Mon Sep 17 00:00:00 2001 From: bmeeks8 Date: Tue, 23 Apr 2013 22:03:25 -0400 Subject: Add uninstall function to Snort Dashboard Widget and bump version. --- config/widget-snort/snort_alerts.widget.php | 1 - config/widget-snort/widget-snort.inc | 28 ++++++++++++++++++++++++++++ config/widget-snort/widget-snort.xml | 11 ++++++++++- 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 config/widget-snort/widget-snort.inc (limited to 'config/widget-snort') diff --git a/config/widget-snort/snort_alerts.widget.php b/config/widget-snort/snort_alerts.widget.php index 3c41dd54..e488bc49 100644 --- a/config/widget-snort/snort_alerts.widget.php +++ b/config/widget-snort/snort_alerts.widget.php @@ -90,7 +90,6 @@ if (file_exists("/usr/local/pkg/snort/snort.inc")) { $snort_alerts[$counter]['instanceid'] = $a_instance[$instanceid]['interface']; $snort_alerts[$counter]['timestamp'] = $fields[0]; - /* Look for the dash separating date and time so we can handle entries with year in them */ $snort_alerts[$counter]['timeonly'] = substr($fields[0], strpos($fields[0], '-')+1, -8); $snort_alerts[$counter]['dateonly'] = substr($fields[0], 0, strpos($fields[0], '-')); $snort_alerts[$counter]['src'] = $fields[6]; diff --git a/config/widget-snort/widget-snort.inc b/config/widget-snort/widget-snort.inc new file mode 100644 index 00000000..b33059e4 --- /dev/null +++ b/config/widget-snort/widget-snort.inc @@ -0,0 +1,28 @@ + $widget) { + if (strstr($widget, "snort_alerts-container")) + unset($widgetlist[$key]); + } + $config['widgets']['sequence'] = implode(",", $widgetlist); + write_config(); + } + + /* Remove our associated file */ + unlink("/usr/local/www/widgets/include/widget-snort.inc"); + unlink("/usr/local/www/widgets/widgets/snort_alerts.widget.php"); + unlink("/usr/local/www/widgets/javascript/snort_alerts.js"); +} + +?> diff --git a/config/widget-snort/widget-snort.xml b/config/widget-snort/widget-snort.xml index f677eee4..ef89c1bb 100644 --- a/config/widget-snort/widget-snort.xml +++ b/config/widget-snort/widget-snort.xml @@ -46,8 +46,9 @@ Dashboard package and Snort Currently there are no FAQ items provided. widget-snort - 1.0 + 0.3.3 Widget - Snort + /usr/local/www/widgets/include/widget-snort.inc /usr/local/www/widgets/javascript/ 0644 @@ -58,4 +59,12 @@ 0644 http://www.pfsense.com/packages/config/widget-snort/snort_alerts.widget.php + + /usr/local/www/widgets/include/ + 0644 + http://www.pfsense.com/packages/config/widget-snort/widget-snort.inc + + + widget_snort_uninstall(); + -- cgit v1.2.3