fix: [enrichment] Set distributions & sgs for all the possible views

pull/4349/head
chrisr3d 2019-03-20 11:28:32 +01:00
parent 465e69f84b
commit c6e7e9284b
No known key found for this signature in database
GPG Key ID: 6BBED1B63A6D639F
1 changed files with 7 additions and 7 deletions

View File

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