mirror of https://github.com/MISP/MISP
Merge branch 'develop' of github.com:MISP/MISP into develop
commit
25ceea7f4e
|
@ -3280,23 +3280,21 @@ class EventsController extends AppController
|
||||||
public function proposalEventIndex()
|
public function proposalEventIndex()
|
||||||
{
|
{
|
||||||
$this->loadModel('ShadowAttribute');
|
$this->loadModel('ShadowAttribute');
|
||||||
$this->ShadowAttribute->recursive = -1;
|
|
||||||
$conditions = array('ShadowAttribute.deleted' => 0);
|
$conditions = array('ShadowAttribute.deleted' => 0);
|
||||||
if (!$this->_isSiteAdmin()) {
|
if (!$this->_isSiteAdmin()) {
|
||||||
$conditions[] = array('ShadowAttribute.event_org_id' => $this->Auth->user('org_id'));
|
$conditions[] = array('ShadowAttribute.event_org_id' => $this->Auth->user('org_id'));
|
||||||
}
|
}
|
||||||
$result = $this->ShadowAttribute->find('all', array(
|
$result = $this->ShadowAttribute->find('column', [
|
||||||
'fields' => array('event_id'),
|
'fields' => ['event_id'],
|
||||||
'group' => array('event_id', 'id'),
|
'conditions' => $conditions,
|
||||||
'conditions' => $conditions
|
'unique' => true,
|
||||||
));
|
]);
|
||||||
$this->Event->recursive = -1;
|
$this->Event->recursive = -1;
|
||||||
$conditions = array();
|
|
||||||
foreach ($result as $eventId) {
|
|
||||||
$conditions['OR'][] = array('Event.id =' => $eventId['ShadowAttribute']['event_id']);
|
|
||||||
}
|
|
||||||
if (empty($result)) {
|
if (empty($result)) {
|
||||||
$conditions['OR'][] = array('Event.id =' => -1);
|
$conditions = array('Event.id' => -1);
|
||||||
|
} else {
|
||||||
|
$conditions = array('Event.id' => $result);
|
||||||
}
|
}
|
||||||
$this->paginate = array(
|
$this->paginate = array(
|
||||||
'fields' => array('Event.id', 'Event.org_id', 'Event.orgc_id', 'Event.publish_timestamp', 'Event.distribution', 'Event.info', 'Event.date', 'Event.published'),
|
'fields' => array('Event.id', 'Event.org_id', 'Event.orgc_id', 'Event.publish_timestamp', 'Event.distribution', 'Event.info', 'Event.date', 'Event.published'),
|
||||||
|
@ -3314,7 +3312,8 @@ class EventsController extends AppController
|
||||||
'ShadowAttribute.deleted' => 0
|
'ShadowAttribute.deleted' => 0
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
));
|
)
|
||||||
|
);
|
||||||
$events = $this->paginate();
|
$events = $this->paginate();
|
||||||
$orgIds = array();
|
$orgIds = array();
|
||||||
foreach ($events as $k => $event) {
|
foreach ($events as $k => $event) {
|
||||||
|
@ -5455,10 +5454,10 @@ class EventsController extends AppController
|
||||||
$editors = array_unique($editors);
|
$editors = array_unique($editors);
|
||||||
|
|
||||||
if ($event['Event']['timestamp'] > $timestamp && empty($editors)) {
|
if ($event['Event']['timestamp'] > $timestamp && empty($editors)) {
|
||||||
$message = __('<b>Warning<b>: This event view is outdated. Please reload page to see latest changes.');
|
$message = __('<b>Warning</b>: This event view is outdated. Please reload page to see latest changes.');
|
||||||
$this->set('class', 'alert');
|
$this->set('class', 'alert');
|
||||||
} else if ($event['Event']['timestamp'] > $timestamp) {
|
} else if ($event['Event']['timestamp'] > $timestamp) {
|
||||||
$message = __('<b>Warning<b>: This event view is outdated, because is currently being edited by: %s. Please reload page to see latest changes.', h(implode(', ', $editors)));
|
$message = __('<b>Warning</b>: This event view is outdated, because is currently being edited by: %s. Please reload page to see latest changes.', h(implode(', ', $editors)));
|
||||||
$this->set('class', 'alert');
|
$this->set('class', 'alert');
|
||||||
} else if (empty($editors)) {
|
} else if (empty($editors)) {
|
||||||
return new CakeResponse(['status' => 204]);
|
return new CakeResponse(['status' => 204]);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<div class="events index">
|
<div class="events index">
|
||||||
<h2><?php echo __('Event with proposals');?></h2>
|
<h2><?= __('Event with proposals');?></h2>
|
||||||
<div class="pagination">
|
<div class="pagination">
|
||||||
<ul>
|
<ul>
|
||||||
<?php
|
<?php
|
||||||
|
@ -14,7 +14,7 @@
|
||||||
<th class="filter">
|
<th class="filter">
|
||||||
<?php echo $this->Paginator->sort('published');?>
|
<?php echo $this->Paginator->sort('published');?>
|
||||||
</th>
|
</th>
|
||||||
<th><?php echo $this->Paginator->sort('id', 'Id', array('direction' => 'desc'));?></th>
|
<th><?php echo $this->Paginator->sort('id', 'ID', array('direction' => 'desc'));?></th>
|
||||||
<th><?php echo $this->Paginator->sort('attribute_count', __('Proposals'));?></th>
|
<th><?php echo $this->Paginator->sort('attribute_count', __('Proposals'));?></th>
|
||||||
<th><?php echo __('Contributors');?></th>
|
<th><?php echo __('Contributors');?></th>
|
||||||
<?php if ($isSiteAdmin): ?>
|
<?php if ($isSiteAdmin): ?>
|
||||||
|
@ -30,48 +30,38 @@
|
||||||
<?php echo $this->Paginator->sort('distribution');?>
|
<?php echo $this->Paginator->sort('distribution');?>
|
||||||
</th>
|
</th>
|
||||||
</tr>
|
</tr>
|
||||||
<?php foreach ($events as $event):?>
|
<?php foreach ($events as $event): ?>
|
||||||
<tr <?php if ($event['Event']['distribution'] == 0) echo 'class = "privateRed"'?>>
|
<tr<?php if ($event['Event']['distribution'] == 0) echo ' class="privateRed"'?>>
|
||||||
<td class="short" onclick="document.location.href ='<?php echo $baseurl."/events/view/".$event['Event']['id'];?>'">
|
<td class="short dblclickElement">
|
||||||
<?php
|
<a href="<?= $baseurl."/events/view/".$event['Event']['id'] ?>" title="<?= __('View') ?>" aria-label="<?= __('View') ?>"><i class="<?= $event['Event']['published'] ? 'black fa fa-check' : 'black fa fa-times' ?>"></i></a>
|
||||||
if ($event['Event']['published'] == 1) {
|
|
||||||
?>
|
|
||||||
<a href="<?php echo $baseurl."/events/view/".$event['Event']['id'] ?>" class = "icon-ok" title = "<?php echo __('View');?>" aria-label = "<?php echo __('View');?>"></a>
|
|
||||||
<?php
|
|
||||||
} else {
|
|
||||||
?>
|
|
||||||
<a href="<?php echo $baseurl."/events/view/".$event['Event']['id'] ?>" class = "icon-remove" title = "<?php echo __('View');?>" aria-label = "<?php echo __('View');?>"></a>
|
|
||||||
<?php
|
|
||||||
}?>
|
|
||||||
</td>
|
</td>
|
||||||
<td class="short">
|
<td class="short">
|
||||||
<a href="<?php echo $baseurl."/events/view/".$event['Event']['id'] ?>"><?php echo $event['Event']['id'];?></a>
|
<a href="<?= $baseurl."/events/view/".$event['Event']['id'] ?>" class="dblclickActionElement"><?= $event['Event']['id'] ?></a>
|
||||||
</td>
|
</td>
|
||||||
<td class="short" onclick="location.href ='<?php echo $baseurl."/events/view/".$event['Event']['id'];?>'" style="color:red;font-weight:bold;">
|
<td class="short">
|
||||||
<?php echo count($event['ShadowAttribute']); ?>
|
<a href="<?= $baseurl."/events/view/".$event['Event']['id'] . '/proposal:1' ?>" style="color:red;font-weight:bold;"><?= $event['Event']['proposal_count']; ?></a>
|
||||||
</td>
|
</td>
|
||||||
<td class="short">
|
<td class="short">
|
||||||
<?php
|
<?php
|
||||||
foreach ($event['orgArray'] as $k => $org) {
|
foreach ($event['orgArray'] as $k => $org) {
|
||||||
echo $this->OrgImg->getOrgImg(array('name' => $orgs[$org], 'id' => $org, 'size' => 24));
|
echo $this->OrgImg->getOrgImg(array('name' => $orgs[$org], 'id' => $org, 'size' => 24));
|
||||||
if ((1 + $k) < (count($event['orgArray']))) echo '<br />';
|
if ((1 + $k) < (count($event['orgArray']))) echo '<br>';
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<?php if ('true' == $isSiteAdmin): ?>
|
<?php if ($isSiteAdmin): ?>
|
||||||
<td class="short" onclick="location.href ='<?php echo $baseurl."/events/view/".$event['Event']['id'];?>'">
|
<td class="short dblclickElement">
|
||||||
<?php echo h($event['User']['email']); ?>
|
<?php echo h($event['User']['email']); ?>
|
||||||
</td>
|
</td>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<td class="short" onclick="location.href ='<?php echo $baseurl."/events/view/".$event['Event']['id'];?>'">
|
<td class="short dblclickElement">
|
||||||
<?php echo $event['Event']['date']; ?>
|
<?php echo $event['Event']['date']; ?>
|
||||||
</td>
|
</td>
|
||||||
<td onclick="location.href ='<?php echo $baseurl."/events/view/".$event['Event']['id'];?>'">
|
<td class="dblclickElement">
|
||||||
<?php echo nl2br(h($event['Event']['info'])); ?>
|
<?php echo nl2br(h($event['Event']['info'])); ?>
|
||||||
</td>
|
</td>
|
||||||
<td class="short <?php if ($event['Event']['distribution'] == 0) echo 'privateRedText';?>" onclick="location.href ='<?php echo $baseurl."/events/view/".$event['Event']['id'];?>'">
|
<td class="short dblclickElement <?php if ($event['Event']['distribution'] == 0) echo 'privateRedText';?>">
|
||||||
<?php echo $event['Event']['distribution'] != 3 ? $distributionLevels[$event['Event']['distribution']] : 'All';?>
|
<?= $event['Event']['distribution'] != 3 ? $distributionLevels[$event['Event']['distribution']] : __('All');?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
@ -93,5 +83,4 @@
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?= $this->element('/genericElements/SideMenu/side_menu', array('menuList' => 'event-collection', 'menuItem' => 'viewProposalIndex'));
|
||||||
echo $this->element('/genericElements/SideMenu/side_menu', array('menuList' => 'event-collection', 'menuItem' => 'viewProposalIndex'));
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
"Feed": {
|
"Feed": {
|
||||||
"name": "CIRCL OSINT Feed",
|
"name": "CIRCL OSINT Feed",
|
||||||
"provider": "CIRCL",
|
"provider": "CIRCL",
|
||||||
"url": "https://www.circl.lu/doc/misp/feed-osint",
|
"url": "https://www.circl.lu/doc/misp/feed-osint/",
|
||||||
"rules": "{\"tags\":{\"OR\":[],\"NOT\":[]},\"orgs\":{\"OR\":[],\"NOT\":[]}}",
|
"rules": "{\"tags\":{\"OR\":[],\"NOT\":[]},\"orgs\":{\"OR\":[],\"NOT\":[]}}",
|
||||||
"enabled": true,
|
"enabled": true,
|
||||||
"distribution": "3",
|
"distribution": "3",
|
||||||
|
|
Loading…
Reference in New Issue