mirror of https://github.com/MISP/MISP
Views updated to include CSV in the menues
- CSV and also IOC downloads on events are now hidden if the event is not publishedpull/217/head
parent
5e9d19196d
commit
39e99554c9
|
@ -237,6 +237,7 @@ class AttributesController extends AppController {
|
|||
$this->set('attrDescriptions', $this->Attribute->fieldDescriptions);
|
||||
$this->set('typeDefinitions', $this->Attribute->typeDefinitions);
|
||||
$this->set('categoryDefinitions', $this->Attribute->categoryDefinitions);
|
||||
$this->set('published', $events['Event']['published']);
|
||||
}
|
||||
|
||||
public function download($id = null) {
|
||||
|
@ -439,6 +440,7 @@ class AttributesController extends AppController {
|
|||
$this->set('distributionLevels', $this->Event->distributionLevels);
|
||||
$events = $this->Event->findById($eventId);
|
||||
$this->set('currentDist', $events['Event']['distribution']);
|
||||
$this->set('published', $events['Event']['published']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -422,6 +422,10 @@ class EventsController extends AppController {
|
|||
|
||||
// set the id
|
||||
$this->set('id', $id);
|
||||
$this->Event->recursive = -1;
|
||||
$this->Event->read(null, $id);
|
||||
// set whether it is published or not
|
||||
$this->set('published', $this->Event->data['Event']['published']);
|
||||
|
||||
// tooltip for risk
|
||||
$this->set('riskDescriptions', $this->Event->riskDescriptions);
|
||||
|
|
|
@ -63,11 +63,11 @@ class LogsController extends AppController {
|
|||
// check if the user has access to this event...
|
||||
$mayModify = false;
|
||||
$mineOrAdmin = false;
|
||||
$this->loadModel('Event');
|
||||
$this->Event->recursive = -1;
|
||||
$this->Event->read(null, $id);
|
||||
// send unauthorised people away. Only site admins and users of the same org may see events that are "your org only". Everyone else can proceed for all other levels of distribution
|
||||
if ($this->Auth->user('org') != 'ADMIN') {
|
||||
$this->loadModel('Event');
|
||||
$this->Event->recursive = -1;
|
||||
$this->Event->read(null, $id);
|
||||
if ($this->Event->data['Event']['distribution'] == 0) {
|
||||
if ($this->Event->data['Event']['org'] != $this->Auth->user('org')) {
|
||||
$this->Session->setFlash(__('You don\'t have access to view this event.'));
|
||||
|
@ -79,6 +79,7 @@ class LogsController extends AppController {
|
|||
} else {
|
||||
$mineOrAdmin = true;
|
||||
}
|
||||
$this->set('published', $this->Event->data['Event']['published']);
|
||||
if ($mineOrAdmin && $this->checkAction('perm_modify')) $mayModify = true;
|
||||
// get a list of the attributes that belong to the event
|
||||
$this->loadModel('Attribute');
|
||||
|
|
|
@ -58,7 +58,10 @@ echo $this->Form->end();
|
|||
<li class="divider"></li>
|
||||
<li><a href="/events/contact/<?php echo $this->request->data['Attribute']['event_id']; ?>">Contact Reporter</a></li>
|
||||
<li><a href="/events/xml/download/<?php echo $this->request->data['Attribute']['event_id']; ?>">Download as XML</a></li>
|
||||
<li><a href="/events/downloadOpenIOCEvent/<?php echo $this->request->data['Attribute']['event_id']; ?>">Download as IOC</a></li>
|
||||
<?php if ($published): ?>
|
||||
<li><a href="/events/downloadOpenIOCEvent/<?php echo $this->request->data['Attribute']['event_id'];?>">Download as IOC</a></li>
|
||||
<li><a href="/events/csv/download/<?php echo $this->request->data['Attribute']['event_id'];?>">Download as CSV</a></li>
|
||||
<?php endif; ?>
|
||||
<li class="divider"></li>
|
||||
<li><a href="/events/index">List Events</a></li>
|
||||
<?php if ($isAclAdd): ?>
|
||||
|
|
|
@ -56,7 +56,10 @@ echo $this->Form->end();
|
|||
<li class="divider"></li>
|
||||
<li><a href="/events/contact/<?php echo $this->request->data['Attribute']['event_id']; ?>">Contact Reporter</a></li>
|
||||
<li><a href="/events/xml/download/<?php echo $this->request->data['Attribute']['event_id']; ?>">Download as XML</a></li>
|
||||
<li><a href="/events/downloadOpenIOCEvent/<?php echo $this->request->data['Attribute']['event_id']; ?>">Download as IOC</a></li>
|
||||
<?php if ($published): ?>
|
||||
<li><a href="/events/downloadOpenIOCEvent/<?php echo $this->request->data['Attribute']['event_id'];?>">Download as IOC</a></li>
|
||||
<li><a href="/events/csv/download/<?php echo $this->request->data['Attribute']['event_id'];?>">Download as CSV</a></li>
|
||||
<?php endif; ?>
|
||||
<li class="divider"></li>
|
||||
<li><a href="/events/index">List Events</a></li>
|
||||
<?php if ($isAclAdd): ?>
|
||||
|
|
|
@ -32,7 +32,10 @@ echo $this->Form->end();
|
|||
<li class="divider"></li>
|
||||
<li><a href="/events/contact/<?php echo $id;?>">Contact Reporter</a></li>
|
||||
<li><a href="/events/xml/download/<?php echo $id;?>">Download as XML</a></li>
|
||||
<?php if ($published): ?>
|
||||
<li><a href="/events/downloadOpenIOCEvent/<?php echo $id;?>">Download as IOC</a></li>
|
||||
<li><a href="/events/csv/download/<?php echo $id;?>">Download as CSV</a></li>
|
||||
<?php endif; ?>
|
||||
<li class="divider"></li>
|
||||
<li><a href="/events/index">List Events</a></li>
|
||||
<?php if ($isAclAdd): ?>
|
||||
|
|
|
@ -51,7 +51,10 @@ $mayPublish = ($isAclPublish && $this->request->data['Event']['orgc'] == $me['or
|
|||
<li class="divider"></li>
|
||||
<li class="active"><a href="/events/contact/<?php echo $this->data['Event']['id'];?>">Contact Reporter</a></li>
|
||||
<li><a href="/events/xml/download/<?php echo $this->data['Event']['id'];?>">Download as XML</a></li>
|
||||
<?php if ($this->data['Event']['published']): ?>
|
||||
<li><a href="/events/downloadOpenIOCEvent/<?php echo $this->data['Event']['id'];?>">Download as IOC</a></li>
|
||||
<li><a href="/events/csv/download/<?php echo $this->data['Event']['id'];?>">Download as CSV</a></li>
|
||||
<?php endif; ?>
|
||||
<li class="divider"></li>
|
||||
<li><a href="/events/index">List Events</a></li>
|
||||
<?php if ($isAclAdd): ?>
|
||||
|
|
|
@ -46,7 +46,10 @@ echo $this->Form->end();
|
|||
<li class="divider"></li>
|
||||
<li><a href="/events/contact/<?php echo $this->request->data['Event']['id'];?>">Contact Reporter</a></li>
|
||||
<li><a href="/events/xml/download/<?php echo $this->request->data['Event']['id'];?>">Download as XML</a></li>
|
||||
<?php if ($this->request->data['Event']['published']): ?>
|
||||
<li><a href="/events/downloadOpenIOCEvent/<?php echo $this->request->data['Event']['id'];?>">Download as IOC</a></li>
|
||||
<li><a href="/events/csv/download/<?php echo $this->request->data['Event']['id'];?>">Download as CSV</a></li>
|
||||
<?php endif; ?>
|
||||
<li class="divider"></li>
|
||||
<li><a href="/events/index">List Events</a></li>
|
||||
<?php if ($isAclAdd): ?>
|
||||
|
|
|
@ -26,7 +26,10 @@ $mayPublish = ($isAclPublish && $event['Event']['orgc'] == $me['org']);
|
|||
<?php endif; ?>
|
||||
<li><a href="/events/contact/<?php echo $event['Event']['id'];?>">Contact Reporter</a></li>
|
||||
<li><a href="/events/xml/download/<?php echo $event['Event']['id'];?>">Download as XML</a></li>
|
||||
<?php if ($event['Event']['published']): ?>
|
||||
<li><a href="/events/downloadOpenIOCEvent/<?php echo $event['Event']['id'];?>">Download as IOC</a></li>
|
||||
<li><a href="/events/csv/download/<?php echo $event['Event']['id'];?>">Download as CSV</a></li>
|
||||
<?php endif; ?>
|
||||
<li class="divider"></li>
|
||||
<li><a href="/events/index">List Events</a></li>
|
||||
<?php if ($isAclAdd): ?>
|
||||
|
|
|
@ -67,7 +67,10 @@
|
|||
<li class="divider"></li>
|
||||
<li><a href="/events/contact/<?php echo $eventId;?>">Contact reporter</a></li>
|
||||
<li><a href="/events/xml/download/<?php echo $eventId;?>">Download as XML</a></li>
|
||||
<?php if ($published): ?>
|
||||
<li><a href="/events/downloadOpenIOCEvent/<?php echo $eventId;?>">Download as IOC</a></li>
|
||||
<li><a href="/events/csv/download/<?php echo $eventId;?>">Download as CSV</a></li>
|
||||
<?php endif; ?>
|
||||
<li class="divider"></li>
|
||||
<li><a href="/events/index">List Events</a></li>
|
||||
<?php if ($isAclAdd): ?>
|
||||
|
|
Loading…
Reference in New Issue