From c6e7e9284b8fa2c517769813524ac5fd22ad634c Mon Sep 17 00:00:00 2001 From: chrisr3d Date: Wed, 20 Mar 2019 11:28:32 +0100 Subject: [PATCH] fix: [enrichment] Set distributions & sgs for all the possible views --- app/Controller/EventsController.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/Controller/EventsController.php b/app/Controller/EventsController.php index bb5d592ea..40069faab 100644 --- a/app/Controller/EventsController.php +++ b/app/Controller/EventsController.php @@ -5052,6 +5052,13 @@ class EventsController extends AppController break; } } + $distributions = $this->Event->Attribute->distributionLevels; + $sgs = $this->Event->SharingGroup->fetchAllAuthorised($this->Auth->user(), 'name', 1); + if (empty($sgs)) { + unset($distributions[4]); + } + $this->set('distributions', $distributions); + $this->set('sgs', $sgs); if ($format == 'misp_standard') { $this->__queryEnrichment($attribute, $module, $options, $type); } else { @@ -5166,13 +5173,6 @@ class EventsController extends AppController $resultArray[$key]['data'] = basename($tempFile) . '|' . filesize($tempFile); } } - $distributions = $this->Event->Attribute->distributionLevels; - $sgs = $this->Event->SharingGroup->fetchAllAuthorised($this->Auth->user(), 'name', 1); - if (empty($sgs)) { - unset($distributions[4]); - } - $this->set('distributions', $distributions); - $this->set('sgs', $sgs); $this->set('type', $type); if (!$event){ $this->set('event', array('Event' => $attribute[0]['Event']));