mirror of https://github.com/MISP/MISP
parent
e5087be61f
commit
c4bcf1c077
|
@ -127,12 +127,19 @@ class EventsController extends AppController {
|
|||
* @throws NotFoundException
|
||||
*/
|
||||
public function view($id = null) {
|
||||
$this->Event->id = $id;
|
||||
// If the length of the id provided is 36 then it is most likely a Uuid - find the id of the event, change $id to it and proceed to read the event as if the ID was entered.
|
||||
if (strlen($id) == 36) {
|
||||
$this->Event->recursive = -1;
|
||||
$temp = $this->Event->findByUuid($id);
|
||||
if ($temp == null) throw new NotFoundException(__('Invalid event'));
|
||||
$id = $temp['Event']['id'];
|
||||
}
|
||||
$this->Event->recursive = 2;
|
||||
$this->Event->contain('Attribute', 'Attribute.ShadowAttribute', 'User.email');
|
||||
$this->Event->id = $id;
|
||||
if (!$this->Event->exists()) {
|
||||
throw new NotFoundException(__('Invalid event'));
|
||||
}
|
||||
$this->Event->contain('Attribute', 'Attribute.ShadowAttribute', 'User.email');
|
||||
$this->Event->read(null, $id);
|
||||
$userEmail = $this->Event->data['User']['email'];
|
||||
unset ($this->Event->data['User']);
|
||||
|
|
|
@ -42,6 +42,11 @@ endif; ?>
|
|||
<?php echo h($event['Event']['id']); ?>
|
||||
|
||||
</dd>
|
||||
<dt>Uuid</dt>
|
||||
<dd>
|
||||
<?php echo h($event['Event']['uuid']); ?>
|
||||
|
||||
</dd>
|
||||
<?php if ('true' == Configure::read('CyDefSIG.showorg') || $isAdmin): ?>
|
||||
<dt>Org</dt>
|
||||
<dd>
|
||||
|
|
Loading…
Reference in New Issue