From 616629e9b5823859e242bbfaee2f84e5c2073ae8 Mon Sep 17 00:00:00 2001 From: Iglocska Date: Wed, 22 Jul 2015 19:27:56 +0200 Subject: [PATCH] Fixed an issue with the NIDS export not correctly working for single events --- VERSION.json | 2 +- app/Model/Attribute.php | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/VERSION.json b/VERSION.json index f8c6ad07f..2177bcf4c 100644 --- a/VERSION.json +++ b/VERSION.json @@ -1 +1 @@ -{"major":2, "minor":3, "hotfix":99} \ No newline at end of file +{"major":2, "minor":3, "hotfix":100} \ No newline at end of file diff --git a/app/Model/Attribute.php b/app/Model/Attribute.php index 8ecd9567c..d37251b7e 100755 --- a/app/Model/Attribute.php +++ b/app/Model/Attribute.php @@ -1220,7 +1220,7 @@ class Attribute extends AppModel { $tagArray = $tag->fetchEventTagIds($args[0], $args[1]); if ($id) { foreach ($eventIds as $k => $v) { - //if ($) + if ($v['Event']['id'] !== $id) unset($eventIds[$k]); } } if (!empty($tagArray[0])) { @@ -1235,6 +1235,9 @@ class Attribute extends AppModel { } } + if ($format == 'suricata') App::uses('NidsSuricataExport', 'Export'); + else App::uses('NidsSnortExport', 'Export'); + $rules = array(); foreach ($eventIds as $event) { $conditions['AND'] = array('Attribute.to_ids' => 1, "Event.published" => 1, 'Attribute.event_id' => $event['Event']['id']); @@ -1252,11 +1255,9 @@ class Attribute extends AppModel { // export depending of the requested type switch ($format) { case 'suricata': - - App::uses('NidsSuricataExport', 'Export'); $export = new NidsSuricataExport(); break; case 'snort': - App::uses('NidsSnortExport', 'Export'); $export = new NidsSnortExport(); break; }