2016-10-04 13:33:42 +02:00
|
|
|
<table class="table table-striped table-hover table-condensed">
|
2018-07-20 09:29:50 +02:00
|
|
|
<tr>
|
|
|
|
<?php if ($isSiteAdmin): ?>
|
|
|
|
<th>
|
2022-03-27 22:07:36 +02:00
|
|
|
<input class="select_all select" type="checkbox" title="<?php echo __('Select all');?>" role="button" tabindex="0" aria-label="<?php echo __('Select all events on current page');?>" onClick="toggleAllCheckboxes();">
|
2018-07-20 09:29:50 +02:00
|
|
|
</th>
|
|
|
|
<?php else: ?>
|
2022-03-27 22:07:36 +02:00
|
|
|
<th style="padding-left:0;padding-right:0;"> </th>
|
2018-07-20 09:29:50 +02:00
|
|
|
<?php endif;?>
|
|
|
|
<th class="filter">
|
|
|
|
<?php echo $this->Paginator->sort('published');?>
|
|
|
|
</th>
|
|
|
|
<?php
|
|
|
|
if (Configure::read('MISP.showorgalternate') && Configure::read('MISP.showorg')):
|
|
|
|
?>
|
2021-12-06 14:27:29 +01:00
|
|
|
<th class="filter"><?php echo $this->Paginator->sort('Orgc.name', __('Source org')); ?></th>
|
|
|
|
<th class="filter"><?php echo $this->Paginator->sort('Orgc.name', __('Member org')); ?></th>
|
2018-07-20 09:29:50 +02:00
|
|
|
<?php
|
2021-03-20 11:40:41 +01:00
|
|
|
elseif (Configure::read('MISP.showorg') || $isAdmin):
|
2018-07-20 09:29:50 +02:00
|
|
|
?>
|
2021-12-06 14:27:29 +01:00
|
|
|
<th class="filter"><?php echo $this->Paginator->sort('Orgc.name', __('Creator org')); ?></th>
|
2018-07-20 09:29:50 +02:00
|
|
|
<?php
|
|
|
|
endif;
|
|
|
|
$date = time();
|
|
|
|
$day = 86400;
|
|
|
|
?>
|
2021-03-20 11:40:41 +01:00
|
|
|
|
2021-12-06 14:27:29 +01:00
|
|
|
<?php if (in_array('owner_org', $columns, true)): ?><th class="filter"><?= $this->Paginator->sort('Org.name', __('Owner org')) ?></th><?php endif; ?>
|
2021-03-20 11:40:41 +01:00
|
|
|
<th><?= $this->Paginator->sort('id', __('ID'), ['direction' => 'desc']) ?></th>
|
|
|
|
<?php if (in_array('clusters', $columns, true)): ?><th><?= __('Clusters') ?></th><?php endif; ?>
|
|
|
|
<?php if (in_array('tags', $columns, true)): ?><th><?= __('Tags') ?></th><?php endif; ?>
|
|
|
|
<?php if (in_array('attribute_count', $columns, true)): ?><th title="<?= __('Attribute Count') ?>"><?= $this->Paginator->sort('attribute_count', __('#Attr.')) ?></th><?php endif; ?>
|
|
|
|
<?php if (in_array('correlations', $columns, true)): ?><th title="<?= __('Correlation Count') ?>"><?= __('#Corr.') ?></th><?php endif; ?>
|
2021-05-07 14:09:34 +02:00
|
|
|
<?php if (in_array('report_count', $columns, true)): ?><th title="<?= __('Report Count') ?>"><?= $this->Paginator->sort('report_count', __('#Reports')) ?></th><?php endif; ?>
|
2021-03-20 11:40:41 +01:00
|
|
|
<?php if (in_array('sightings', $columns, true)): ?><th title="<?= __('Sighting Count')?>"><?= __('#Sightings') ?></th><?php endif; ?>
|
|
|
|
<?php if (in_array('proposals', $columns, true)): ?><th title="<?= __('Proposal Count') ?>"><?= __('#Prop') ?></th><?php endif; ?>
|
|
|
|
<?php if (in_array('discussion', $columns, true)): ?><th title="<?= __('Post Count') ?>"><?= __('#Posts') ?></th><?php endif; ?>
|
|
|
|
<?php if (in_array('creator_user', $columns, true)): ?><th><?= $this->Paginator->sort('user_id', __('Creator user')) ?></th><?php endif; ?>
|
|
|
|
<th class="filter"><?= $this->Paginator->sort('date', null, array('direction' => 'desc'));?></th>
|
2021-12-06 14:27:29 +01:00
|
|
|
<?php if (in_array('timestamp', $columns, true)): ?><th title="<?= __('Last modified at') ?>"><?= $this->Paginator->sort('timestamp', __('Last modified at')) ?></th><?php endif; ?>
|
|
|
|
<?php if (in_array('publish_timestamp', $columns, true)): ?><th title="<?= __('Last modified at') ?>"><?= $this->Paginator->sort('publish_timestamp', __('Published at')) ?></th><?php endif; ?>
|
2021-03-20 11:40:41 +01:00
|
|
|
<th class="filter"><?= $this->Paginator->sort('info');?></th>
|
|
|
|
<th title="<?= $eventDescriptions['distribution']['desc'];?>">
|
|
|
|
<?= $this->Paginator->sort('distribution');?>
|
2018-07-20 09:29:50 +02:00
|
|
|
</th>
|
2019-03-21 15:59:02 +01:00
|
|
|
<th class="actions"><?php echo __('Actions');?></th>
|
2018-07-20 09:29:50 +02:00
|
|
|
</tr>
|
2021-03-20 15:33:07 +01:00
|
|
|
<?php foreach ($events as $event): $eventId = (int)$event['Event']['id']; ?>
|
|
|
|
<tr id="event_<?= $eventId ?>">
|
|
|
|
<?php if ($isSiteAdmin || ($event['Event']['orgc_id'] == $me['org_id'])):?>
|
|
|
|
<td style="width:10px;">
|
2022-03-31 15:25:07 +02:00
|
|
|
<input class="select" type="checkbox" data-id="<?= $eventId ?>" data-uuid="<?= h($event['Event']['uuid']) ?>" />
|
2021-03-20 15:33:07 +01:00
|
|
|
</td>
|
|
|
|
<?php else: ?>
|
|
|
|
<td style="padding-left:0;padding-right:0;"></td>
|
|
|
|
<?php endif; ?>
|
|
|
|
<td class="short dblclickElement">
|
|
|
|
<a href="<?= "$baseurl/events/view/$eventId" ?>" title="<?= __('View') ?>" aria-label="<?= __('View') ?>">
|
2020-10-06 08:42:28 +02:00
|
|
|
<i class="black fa <?= $event['Event']['published'] == 1 ? 'fa-check' : 'fa-times' ?>"></i>
|
|
|
|
</a>
|
2018-07-20 09:29:50 +02:00
|
|
|
</td>
|
|
|
|
<?php if (Configure::read('MISP.showorg') || $isAdmin): ?>
|
2021-03-20 15:33:07 +01:00
|
|
|
<td class="short" ondblclick="document.location.href ='<?php echo $baseurl . "/events/index/searchorg:" . $event['Orgc']['id'];?>'">
|
|
|
|
<?= $this->OrgImg->getOrgLogo($event['Orgc'], 24) ?>
|
|
|
|
</td>
|
2018-07-20 09:29:50 +02:00
|
|
|
<?php endif;?>
|
2021-03-20 11:40:41 +01:00
|
|
|
<?php if (in_array('owner_org', $columns, true) || (Configure::read('MISP.showorgalternate') && Configure::read('MISP.showorg'))): ?>
|
2021-03-20 15:33:07 +01:00
|
|
|
<td class="short" ondblclick="document.location.href ='<?php echo $baseurl . "/events/index/searchorg:" . $event['Org']['id'];?>'">
|
|
|
|
<?= $this->OrgImg->getOrgLogo($event['Org'], 24) ?>
|
|
|
|
</td>
|
2018-07-20 09:29:50 +02:00
|
|
|
<?php endif; ?>
|
2022-03-17 00:43:27 +01:00
|
|
|
<td class="short">
|
2022-03-17 14:50:14 +01:00
|
|
|
<span><a href="<?= $baseurl."/events/view/".$eventId ?>" class="dblclickActionElement threat-level-<?= strtolower(h($event['ThreatLevel']['name'])) ?>" title="<?= __('Threat level: %s', h($event['ThreatLevel']['name'])) ?>"><?= $eventId ?></a> <?= !empty($event['Event']['protected']) ? sprintf('<i class="fas fa-lock" title="%s"></i>', __('Protected event')) : ''?></span>
|
2018-07-20 09:29:50 +02:00
|
|
|
</td>
|
2021-03-20 11:40:41 +01:00
|
|
|
<?php if (in_array('clusters', $columns, true)): ?>
|
2021-02-16 08:44:36 +01:00
|
|
|
<td class="short">
|
2018-07-20 09:29:50 +02:00
|
|
|
<?php
|
2019-07-08 16:26:12 +02:00
|
|
|
$galaxies = array();
|
|
|
|
if (!empty($event['GalaxyCluster'])) {
|
2021-03-20 11:40:41 +01:00
|
|
|
foreach ($event['GalaxyCluster'] as $galaxy_cluster) {
|
2019-07-08 16:26:12 +02:00
|
|
|
$galaxy_id = $galaxy_cluster['Galaxy']['id'];
|
|
|
|
if (!isset($galaxies[$galaxy_id])) {
|
|
|
|
$galaxies[$galaxy_id] = $galaxy_cluster['Galaxy'];
|
2018-07-20 09:29:50 +02:00
|
|
|
}
|
2019-07-08 16:26:12 +02:00
|
|
|
unset($galaxy_cluster['Galaxy']);
|
|
|
|
$galaxies[$galaxy_id]['GalaxyCluster'][] = $galaxy_cluster;
|
2018-07-20 09:29:50 +02:00
|
|
|
}
|
2021-02-23 19:28:08 +01:00
|
|
|
echo $this->element('galaxyQuickViewNew', array(
|
2019-07-08 16:26:12 +02:00
|
|
|
'mayModify' => false,
|
|
|
|
'isAclTagger' => false,
|
|
|
|
'data' => $galaxies,
|
2021-03-24 11:00:04 +01:00
|
|
|
'event' => $event,
|
2021-03-20 15:33:07 +01:00
|
|
|
'target_id' => $eventId,
|
2019-07-08 16:26:12 +02:00
|
|
|
'target_type' => 'event',
|
|
|
|
'static_tags_only' => 1
|
|
|
|
));
|
|
|
|
}
|
|
|
|
?>
|
2018-07-20 09:29:50 +02:00
|
|
|
</td>
|
2021-03-20 11:40:41 +01:00
|
|
|
<?php endif; ?>
|
|
|
|
<?php if (in_array('tags', $columns, true)): ?>
|
|
|
|
<td class="shortish">
|
|
|
|
<?= $this->element('ajaxTags', [
|
|
|
|
'event' => $event,
|
|
|
|
'tags' => $event['EventTag'],
|
|
|
|
'tagAccess' => false,
|
|
|
|
'localTagAccess' => false,
|
|
|
|
'missingTaxonomies' => false,
|
|
|
|
'columnised' => true,
|
|
|
|
'static_tags_only' => 1,
|
|
|
|
'tag_display_style' => Configure::check('MISP.full_tags_on_event_index') ? Configure::read('MISP.full_tags_on_event_index') : 1
|
|
|
|
]);
|
|
|
|
?>
|
|
|
|
</td>
|
|
|
|
<?php endif; ?>
|
|
|
|
<?php if (in_array('attribute_count', $columns, true)): ?>
|
2021-03-20 15:33:07 +01:00
|
|
|
<td class="dblclickElement" style="width:30px;">
|
2021-03-20 11:40:41 +01:00
|
|
|
<?= $event['Event']['attribute_count']; ?>
|
2018-07-20 09:29:50 +02:00
|
|
|
</td>
|
2021-03-20 11:40:41 +01:00
|
|
|
<?php endif; ?>
|
|
|
|
<?php if (in_array('correlations', $columns, true)): ?>
|
2021-03-20 15:33:07 +01:00
|
|
|
<td class="bold" style="width:30px;">
|
|
|
|
<?php if (!empty($event['Event']['correlation_count'])): ?>
|
|
|
|
<a href="<?php echo $baseurl."/events/view/" . $eventId . '/correlation:1';?>" title="<?= __n('%s correlation', '%s correlations', $event['Event']['correlation_count'], $event['Event']['correlation_count']), '. ' . __('Show filtered event with correlation only.');?>">
|
|
|
|
<?php echo h($event['Event']['correlation_count']); ?>
|
|
|
|
</a>
|
|
|
|
<?php endif; ?>
|
|
|
|
</td>
|
2018-07-20 09:29:50 +02:00
|
|
|
<?php endif; ?>
|
2021-05-07 14:09:34 +02:00
|
|
|
<?php if (in_array('report_count', $columns, true)): ?>
|
|
|
|
<td class="bold" style="width:30px;">
|
|
|
|
<?= $event['Event']['report_count']; ?>
|
|
|
|
</td>
|
|
|
|
<?php endif; ?>
|
2021-03-20 11:40:41 +01:00
|
|
|
<?php if (in_array('sightings', $columns, true)): ?>
|
2021-03-20 15:33:07 +01:00
|
|
|
<td class="bold" style="width:30px;">
|
|
|
|
<?php if (!empty($event['Event']['sightings_count'])): ?>
|
|
|
|
<a href="<?php echo $baseurl."/events/view/" . $eventId . '/sighting:1';?>" title="<?php echo (!empty($event['Event']['sightings_count']) ? h($event['Event']['sightings_count']) : '0') . ' sighting(s). Show filtered event with sighting(s) only.';?>">
|
|
|
|
<?php echo h($event['Event']['sightings_count']); ?>
|
|
|
|
</a>
|
|
|
|
<?php endif; ?>
|
|
|
|
</td>
|
2018-07-20 09:29:50 +02:00
|
|
|
<?php endif; ?>
|
2021-03-20 11:40:41 +01:00
|
|
|
<?php if (in_array('proposals', $columns, true)): ?>
|
2021-03-20 15:33:07 +01:00
|
|
|
<td class="bold dblclickElement" style="width:30px;" title="<?= __n('%s proposal', '%s proposals', $event['Event']['proposals_count'], $event['Event']['proposals_count']) ?>">
|
|
|
|
<?php echo !empty($event['Event']['proposals_count']) ? h($event['Event']['proposals_count']) : ''; ?>
|
|
|
|
</td>
|
2018-07-20 09:29:50 +02:00
|
|
|
<?php endif;?>
|
2021-03-20 11:40:41 +01:00
|
|
|
<?php if (in_array('discussion', $columns, true)): ?>
|
2021-03-20 15:33:07 +01:00
|
|
|
<td class="bold dblclickElement" style="width:30px;">
|
|
|
|
<?php
|
|
|
|
if (!empty($event['Event']['post_count'])) {
|
|
|
|
$post_count = h($event['Event']['post_count']);
|
|
|
|
if (($date - $event['Event']['last_post']) < $day) {
|
|
|
|
$post_count .= ' (<span class="red bold">' . __('NEW') . '</span>)';
|
2018-07-20 09:29:50 +02:00
|
|
|
}
|
2021-03-20 15:33:07 +01:00
|
|
|
} else {
|
|
|
|
$post_count = '';
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
<span style=" white-space: nowrap;"><?php echo $post_count?></span>
|
|
|
|
</td>
|
2018-07-20 09:29:50 +02:00
|
|
|
<?php endif;?>
|
2021-03-20 11:40:41 +01:00
|
|
|
<?php if (in_array('creator_user', $columns, true)): ?>
|
2021-03-20 15:33:07 +01:00
|
|
|
<td class="short dblclickElement">
|
|
|
|
<?php echo h($event['User']['email']); ?>
|
|
|
|
</td>
|
2018-07-20 09:29:50 +02:00
|
|
|
<?php endif; ?>
|
2021-03-20 15:33:07 +01:00
|
|
|
<td class="short dblclickElement">
|
|
|
|
<?= $event['Event']['date'] ?>
|
2018-07-20 09:29:50 +02:00
|
|
|
</td>
|
2021-12-06 14:27:29 +01:00
|
|
|
<?php if (in_array('timestamp', $columns, true)): ?>
|
|
|
|
<td class="short dblclickElement">
|
2022-03-27 22:07:36 +02:00
|
|
|
<?= $this->Time->time($event['Event']['timestamp']) ?>
|
2021-12-06 14:27:29 +01:00
|
|
|
</td>
|
|
|
|
<?php endif; ?>
|
|
|
|
<?php if (in_array('publish_timestamp', $columns, true)): ?>
|
|
|
|
<td class="short dblclickElement">
|
2022-03-27 22:07:36 +02:00
|
|
|
<?= $this->Time->time($event['Event']['publish_timestamp']) ?>
|
2021-12-06 14:27:29 +01:00
|
|
|
</td>
|
|
|
|
<?php endif; ?>
|
2021-03-20 15:33:07 +01:00
|
|
|
<td class="dblclickElement">
|
|
|
|
<?= nl2br(h($event['Event']['info']), false) ?>
|
2018-07-20 09:29:50 +02:00
|
|
|
</td>
|
2021-03-20 15:33:07 +01:00
|
|
|
<td class="short dblclickElement <?php if ($event['Event']['distribution'] == 0) echo 'privateRedText';?>" title="<?php echo $event['Event']['distribution'] != 3 ? $distributionLevels[$event['Event']['distribution']] : __('All');?>">
|
2018-07-20 09:29:50 +02:00
|
|
|
<?php if ($event['Event']['distribution'] == 4):?>
|
|
|
|
<a href="<?php echo $baseurl;?>/sharingGroups/view/<?php echo h($event['SharingGroup']['id']); ?>"><?php echo h($event['SharingGroup']['name']);?></a>
|
|
|
|
<?php else:
|
|
|
|
echo h($shortDist[$event['Event']['distribution']]);
|
|
|
|
endif;
|
|
|
|
?>
|
2019-03-12 08:15:27 +01:00
|
|
|
<?php
|
|
|
|
echo sprintf(
|
2019-03-12 10:46:46 +01:00
|
|
|
'<it type="button" title="%s" class="%s" aria-hidden="true" style="font-size: x-small;" data-event-distribution="%s" data-event-distribution-name="%s" data-scope-id="%s"></it>',
|
2021-03-20 15:33:07 +01:00
|
|
|
__('Toggle advanced sharing network viewer'),
|
2019-03-12 08:15:27 +01:00
|
|
|
'fa fa-share-alt useCursorPointer distributionNetworkToggle',
|
|
|
|
h($event['Event']['distribution']),
|
2019-03-12 10:46:46 +01:00
|
|
|
$event['Event']['distribution'] == 4 ? h($event['SharingGroup']['name']) : h($shortDist[$event['Event']['distribution']]),
|
2021-03-20 15:33:07 +01:00
|
|
|
$eventId
|
2019-03-12 08:15:27 +01:00
|
|
|
)
|
|
|
|
?>
|
2018-07-20 09:29:50 +02:00
|
|
|
</td>
|
|
|
|
<td class="short action-links">
|
|
|
|
<?php
|
2021-03-20 15:33:07 +01:00
|
|
|
if (0 == $event['Event']['published'] && ($isSiteAdmin || ($isAclPublish && $event['Event']['orgc_id'] == $me['org_id']))) {
|
2022-03-28 12:10:34 +02:00
|
|
|
echo sprintf('<a class="useCursorPointer fa fa-upload" title="%s" aria-label="%s" onclick="event.preventDefault();publishPopup(%s)"></a>', __('Publish Event'), __('Publish Event'), $eventId);
|
2021-03-20 15:33:07 +01:00
|
|
|
}
|
2016-12-14 17:18:09 +01:00
|
|
|
|
2018-07-20 09:29:50 +02:00
|
|
|
if ($isSiteAdmin || ($isAclModify && $event['Event']['user_id'] == $me['id']) || ($isAclModifyOrg && $event['Event']['orgc_id'] == $me['org_id'])):
|
|
|
|
?>
|
2021-03-20 15:33:07 +01:00
|
|
|
<a href="<?php echo $baseurl."/events/edit/".$eventId ?>" title="<?php echo __('Edit');?>" aria-label="<?php echo __('Edit');?>"><i class="black fa fa-edit"></i></a>
|
2018-07-20 09:29:50 +02:00
|
|
|
<?php
|
2022-03-28 12:05:45 +02:00
|
|
|
echo sprintf('<a class="useCursorPointer fa fa-trash" title="%s" aria-label="%s" onclick="event.preventDefault();deleteEventPopup(%s)"></a>', __('Delete'), __('Delete'), $eventId);
|
2018-07-20 09:29:50 +02:00
|
|
|
endif;
|
|
|
|
?>
|
2021-03-20 15:33:07 +01:00
|
|
|
<a href="<?php echo $baseurl."/events/view/".$eventId ?>" title="<?php echo __('View');?>" aria-label="<?php echo __('View');?>"><i class="fa black fa-eye"></i></a>
|
2018-07-20 09:29:50 +02:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<?php endforeach; ?>
|
2016-12-14 17:18:09 +01:00
|
|
|
</table>
|
2017-06-01 09:45:10 +02:00
|
|
|
<script type="text/javascript">
|
2019-08-23 14:24:45 +02:00
|
|
|
var lastSelected = false;
|
2020-10-05 17:38:03 +02:00
|
|
|
$(function() {
|
2018-07-20 09:29:50 +02:00
|
|
|
$('.select').on('change', function() {
|
|
|
|
listCheckboxesChecked();
|
2020-10-05 17:38:03 +02:00
|
|
|
}).click(function(e) {
|
2019-08-23 14:24:45 +02:00
|
|
|
if ($(this).is(':checked')) {
|
|
|
|
if (e.shiftKey) {
|
|
|
|
selectAllInbetween(lastSelected, this.id);
|
|
|
|
}
|
|
|
|
lastSelected = this.id;
|
|
|
|
}
|
|
|
|
attributeListAnyAttributeCheckBoxesChecked();
|
|
|
|
});
|
2019-03-12 08:15:27 +01:00
|
|
|
|
|
|
|
$('.distributionNetworkToggle').each(function() {
|
|
|
|
$(this).distributionNetwork({
|
|
|
|
distributionData: <?php echo json_encode($distributionData); ?>,
|
|
|
|
});
|
|
|
|
});
|
2018-07-20 09:29:50 +02:00
|
|
|
});
|
2017-06-01 09:45:10 +02:00
|
|
|
</script>
|