mirror of https://github.com/MISP/MISP
wip: [enrichment] Handling module results and passing it to the view
- Work in progress on the view right nowpull/4338/head
parent
43f0010cab
commit
81a0cd2974
|
@ -5076,7 +5076,21 @@ class EventsController extends AppController
|
|||
}
|
||||
unset($result['results']['Object']);
|
||||
}
|
||||
// MORE MAGIC TO COME
|
||||
if (empty($attributes) && empty($objects)) {
|
||||
$this->__handleSimplifiedFormat($attribute, $module, $options, $result, $type);
|
||||
} else {
|
||||
$event = array('Event' => $attribute[0]['Event']);
|
||||
$event['Attribute'] = $attributes;
|
||||
$event['Object'] = $objects;
|
||||
$this->set('event', $event);
|
||||
if (!empty($result['results'])) {
|
||||
$this->__handleSimplifiedFormat($attribute, $module, $options, $result, $type, $render_name = 'resolved_misp_format');
|
||||
} else {
|
||||
$this->set('menuItem', 'enrichmentResults');
|
||||
$this->set('title', 'Enrichment Results');
|
||||
$this->render('resolved_misp_format');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function __queryOldEnrichment($attribute, $module, $options, $type)
|
||||
|
@ -5099,6 +5113,11 @@ class EventsController extends AppController
|
|||
if (!is_array($result)) {
|
||||
throw new Exception($result);
|
||||
}
|
||||
$this->__handleSimplifedFormat($attribute, $module, $options, $result, $type);
|
||||
}
|
||||
|
||||
private function __handleSimplififedFormat($attribute, $module, $options, $result, $type, $renderName = 'resolved_attributes')
|
||||
{
|
||||
$resultArray = $this->Event->handleModuleResult($result, $attribute[0]['Attribute']['event_id']);
|
||||
if (isset($result['comment']) && $result['comment'] != "") {
|
||||
$importComment = $result['comment'];
|
||||
|
@ -5142,7 +5161,7 @@ class EventsController extends AppController
|
|||
$this->set('typeCategoryMapping', $typeCategoryMapping);
|
||||
$this->set('title', 'Enrichment Results');
|
||||
$this->set('importComment', $importComment);
|
||||
$this->render('resolved_attributes');
|
||||
$this->render($renderName);
|
||||
}
|
||||
|
||||
public function importModule($module, $eventId)
|
||||
|
|
Loading…
Reference in New Issue