Fixed the index view to include the new objects in json view

pull/762/head
iglocska 2015-10-18 21:11:34 +02:00
parent 479a3bfde4
commit 96c6ac8487
1 changed files with 5 additions and 2 deletions

View File

@ -1,16 +1,19 @@
<?php
foreach ($events as $key => &$event) {
// rearrange things to be compatible with the Xml::fromArray()
$events[$key]['Event']['Org'] = $events[$key]['Org'];
$events[$key]['Event']['Orgc'] = $events[$key]['Orgc'];
$events[$key]['Event']['EventTag'] = $events[$key]['EventTag'];
$events[$key]['Event']['SharingGroup'] = $events[$key]['SharingGroup'];
$events[$key] = $events[$key]['Event'];
unset($events[$key]['Event']);
// cleanup the array from things we do not want to expose
unset($events[$key]['user_id']);
// hide the org field is we are not in showorg mode
if (!Configure::read('MISP.showorg') && !$isAdmin) {
if (!Configure::read('MISP.showorg')) {
unset($events[$key]['Org']);
unset($events[$key]['Orgc']);
unset($events[$key]['from']);
}
}