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']));