diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/widget-snort/snort_alerts.widget.php | 1 | ||||
-rw-r--r-- | config/widget-snort/widget-snort.inc | 28 | ||||
-rw-r--r-- | config/widget-snort/widget-snort.xml | 11 |
3 files changed, 38 insertions, 2 deletions
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 @@ +<?php + +require_once("guiconfig.inc"); +require_once("config.inc"); + +function widget_snort_uninstall() { + + global $config; + + /* Remove the Snort widget from the Dashboard display list */ + $widgets = $config['widgets']['sequence']; + if (!empty($widgets)) { + $widgetlist = explode(",", $widgets); + foreach ($widgetlist as $key => $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 @@ <requirements>Dashboard package and Snort</requirements> <faq>Currently there are no FAQ items provided.</faq> <name>widget-snort</name> - <version>1.0</version> + <version>0.3.3</version> <title>Widget - Snort</title> + <include_file>/usr/local/www/widgets/include/widget-snort.inc</include_file> <additional_files_needed> <prefix>/usr/local/www/widgets/javascript/</prefix> <chmod>0644</chmod> @@ -58,4 +59,12 @@ <chmod>0644</chmod> <item>http://www.pfsense.com/packages/config/widget-snort/snort_alerts.widget.php</item> </additional_files_needed> + <additional_files_needed> + <prefix>/usr/local/www/widgets/include/</prefix> + <chmod>0644</chmod> + <item>http://www.pfsense.com/packages/config/widget-snort/widget-snort.inc</item> + </additional_files_needed> + <custom_php_deinstall_command> + widget_snort_uninstall(); + </custom_php_deinstall_command> </packagegui> |