MISP/app/View/Events/view.ctp

152 lines
5.5 KiB
Plaintext
Raw Normal View History

2011-11-26 10:45:31 +01:00
<div class="events view">
<div class="actions" style="float:right;">
2012-03-25 16:25:16 +02:00
<?php if ( 0 == $event['Event']['alerted'] && ($isAdmin || $event['Event']['org'] == $me['org'])):
// only show button if alert has not been sent // LATER show the ALERT button in red-ish
2011-11-26 10:45:31 +01:00
?>
2012-03-25 16:25:16 +02:00
<ul><li><?php
2012-03-20 08:26:57 +01:00
echo $this->Form->postLink('Publish Event', array('action' => 'alert', $event['Event']['id']), null, 'Are you sure this event is complete and everyone should be alerted?');
?> </li></ul>
2011-11-26 10:45:31 +01:00
<?php elseif (0 == $event['Event']['alerted']): ?>
2012-03-21 11:01:37 +01:00
<ul><li>Not published</li></ul>
2011-11-26 10:45:31 +01:00
<?php else: ?>
<!-- ul><li>Alert already sent</li></ul -->
<?php endif; ?>
<ul><li><?php echo $this->Html->link(__('Contact reporter', true), array('action' => 'contact', $event['Event']['id'])); ?> </li></ul>
2011-11-26 10:45:31 +01:00
</div>
<h2>Event</h2>
<dl>
<dt>ID</dt>
<dd>
2012-01-05 11:03:51 +01:00
<?php echo Sanitize::html($event['Event']['id']); ?>
&nbsp;
</dd>
2012-03-06 07:45:02 +01:00
<?php if ('true' == Configure::read('CyDefSIG.showorg') || $isAdmin): ?>
<dt>Org</dt>
<dd>
2011-11-26 10:45:31 +01:00
<?php echo Sanitize::html($event['Event']['org']); ?>
&nbsp;
</dd>
<?php endif; ?>
<dt>Date</dt>
<dd>
2011-11-26 10:45:31 +01:00
<?php echo Sanitize::html($event['Event']['date']); ?>
&nbsp;
</dd>
<dt>Risk</dt>
<dd>
2011-11-26 10:45:31 +01:00
<?php echo $event['Event']['risk']; ?>
&nbsp;
</dd>
2012-03-20 13:40:58 +01:00
<!-- dt>UUID</dt>
<dd>
<?php echo $event['Event']['uuid']; ?>
&nbsp;
</dd -->
<dt>Info</dt>
<dd>
2011-11-26 10:45:31 +01:00
<?php echo nl2br(Sanitize::html($event['Event']['info'])); ?>
&nbsp;
</dd>
</dl>
2011-11-27 15:32:11 +01:00
<?php if (!empty($relatedEvents)):?>
<div class="related">
<h3>Related Events</h3>
<ul>
<?php foreach ($relatedEvents as $relatedEvent): ?>
2012-03-25 16:25:16 +02:00
<li><?php
$link_text = $relatedEvent['Event']['date'].' ('.$relatedEvent['Event']['id'].')';
echo $this->Html->link($link_text, array('controller' => 'events', 'action' => 'view', $relatedEvent['Event']['id']));
?></li>
<?php endforeach; ?>
2012-03-25 16:25:16 +02:00
</ul>
</div>
2011-11-27 15:32:11 +01:00
<?php endif; ?>
2012-03-25 16:25:16 +02:00
2011-11-26 10:45:31 +01:00
<div class="related">
2012-03-21 21:25:16 +01:00
<h3>Attributes</h3>
2012-03-26 19:56:44 +02:00
<?php if (!empty($event['Attribute'])):?>
2011-11-26 10:45:31 +01:00
<table cellpadding = "0" cellspacing = "0">
<tr>
<th>Category</th>
<th>Type</th>
<th>Value</th>
<th>Related Events</th>
2012-03-26 19:56:44 +02:00
<th>IDS Attribute</th>
2012-03-20 15:11:02 +01:00
<th class="actions">Actions</th>
2011-11-26 10:45:31 +01:00
</tr>
<?php
$category_prev = "";
2012-03-26 19:56:44 +02:00
foreach ($event['Attribute'] as $attribute):
2011-11-26 10:45:31 +01:00
?>
<tr>
<td class="short"><?php
2012-03-26 19:56:44 +02:00
if ($category_prev != $attribute['category']) {
$category_prev = $attribute['category'];
echo $attribute['category'];
} else {
echo '&nbsp;';
2012-03-25 16:25:16 +02:00
}
?></td>
2012-03-26 19:56:44 +02:00
<td class="short"><?php echo $attribute['type'];?></td>
2012-03-25 16:25:16 +02:00
<td><?php
2012-03-26 19:56:44 +02:00
$sig_display = nl2br(Sanitize::html($attribute['value']));
if('attachment' == $attribute['type'] ||
'malware-sample' == $attribute['type']) {
$filename_hash = explode('|', $attribute['value']);
echo $this->Html->link($filename_hash[0], array('controller' => 'attributes', 'action' => 'download', $attribute['id']));
if (isset($filename_hash[1])) echo ' | '.$filename_hash[1];
} else {
echo $sig_display;
}
?></td>
2012-03-20 15:11:02 +01:00
<td class="short" style="text-align: center;">
<?php
2012-03-26 19:56:44 +02:00
if (null != $relatedAttributes[$attribute['id']]) {
foreach ($relatedAttributes[$attribute['id']] as $relatedAttribute) {
echo $this->Html->link($relatedAttribute['Attribute']['event_id'], array('controller' => 'events', 'action' => 'view', $relatedAttribute['Attribute']['event_id']));
2012-03-25 16:25:16 +02:00
echo ' ';
}
}
?>
</td>
2012-03-26 19:56:44 +02:00
<td class="short" style="text-align: center;"><?php echo $attribute['to_ids'] ? 'Yes' : 'No';?></td>
2012-03-20 15:11:02 +01:00
<td class="actions">
2011-11-26 10:45:31 +01:00
<?php
2012-03-25 16:25:16 +02:00
if ($isAdmin || $event['Event']['org'] == $me['org']) {
2012-03-26 19:56:44 +02:00
echo $this->Html->link(__('Edit', true), array('controller' => 'attributes', 'action' => 'edit', $attribute['id']));
echo $this->Form->postLink(__('Delete'), array('controller' => 'attributes', 'action' => 'delete', $attribute['id']), null, __('Are you sure you want to delete this attribute?'));
2011-11-26 10:45:31 +01:00
} ?>
</td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
<?php if ($isAdmin || $event['Event']['org'] == $me['org']): ?>
<div class="actions">
<ul>
2012-03-26 19:56:44 +02:00
<li><?php echo $this->Html->link('Add Attribute', array('controller' => 'attributes', 'action' => 'add', $event['Event']['id']));?> </li>
<li><?php echo $this->Html->link('Add Attachment', array('controller' => 'attributes', 'action' => 'add_attachment', $event['Event']['id']));?> </li>
2011-11-26 10:45:31 +01:00
</ul>
</div>
<?php endif; ?>
</div>
</div>
<div class="actions">
<ul>
<?php if ($isAdmin || $event['Event']['org'] == $me['org']): ?>
2012-03-26 19:56:44 +02:00
<li><?php echo $this->Html->link(__('Add Attribute', true), array('controller' => 'attributes', 'action' => 'add', $event['Event']['id']));?> </li>
<li><?php echo $this->Html->link(__('Add Attachment', true), array('controller' => 'attributes', 'action' => 'add_attachment', $event['Event']['id']));?> </li>
2011-11-26 10:45:31 +01:00
<li><?php echo $this->Html->link(__('Edit Event', true), array('action' => 'edit', $event['Event']['id'])); ?> </li>
<li><?php echo $this->Form->postLink(__('Delete Event'), array('action' => 'delete', $event['Event']['id']), null, __('Are you sure you want to delete # %s?', $event['Event']['id'])); ?></li>
2011-11-26 10:45:31 +01:00
<li>&nbsp;</li>
<?php endif; ?>
<?php echo $this->element('actions_menu'); ?>
</ul>
</div>