mirror of https://github.com/MISP/MISP
commit
072dcfdc1d
|
@ -115,7 +115,7 @@ class AttributesController extends AppController
|
|||
if (!$this->userRole['perm_add']) {
|
||||
throw new MethodNotAllowedException(__('You do not have permissions to create attributes'));
|
||||
}
|
||||
$event = $this->Attribute->Event->fetchSimpleEvent($this->Auth->user(), $eventId);
|
||||
$event = $this->Attribute->Event->fetchSimpleEvent($this->Auth->user(), $eventId, ['contain' => ['Orgc']]);
|
||||
if (!$event) {
|
||||
throw new NotFoundException(__('Invalid event'));
|
||||
}
|
||||
|
@ -355,7 +355,7 @@ class AttributesController extends AppController
|
|||
|
||||
public function add_attachment($eventId = null)
|
||||
{
|
||||
$event = $this->Attribute->Event->fetchSimpleEvent($this->Auth->user(), $eventId);
|
||||
$event = $this->Attribute->Event->fetchSimpleEvent($this->Auth->user(), $eventId, ['contain' => ['Orgc']]);
|
||||
if (empty($event)) {
|
||||
throw new NotFoundException(__('Invalid Event.'));
|
||||
}
|
||||
|
|
|
@ -2143,11 +2143,11 @@ class EventsController extends AppController
|
|||
$this->Flash->error(__('Could not import STIX document: ' . $result));
|
||||
}
|
||||
} else {
|
||||
$max_size = intval(ini_get('post_max_size'));
|
||||
if (intval(ini_get('upload_max_filesize')) < $max_size) {
|
||||
$max_size = intval(ini_get('upload_max_filesize'));
|
||||
$maxUploadSize = intval(ini_get('post_max_size'));
|
||||
if (intval(ini_get('upload_max_filesize')) < $maxUploadSize) {
|
||||
$maxUploadSize = intval(ini_get('upload_max_filesize'));
|
||||
}
|
||||
$this->Flash->error(__('File upload failed. Make sure that you select a stix file to be uploaded and that the file doesn\'t exceed the maximum file size of ' . $max_size . '.'));
|
||||
$this->Flash->error(__('File upload failed. Make sure that you select a STIX file to be uploaded and that the file doesn\'t exceed the maximum file size of %s MB.', $maxUploadSize));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2179,7 +2179,7 @@ class EventsController extends AppController
|
|||
}
|
||||
}
|
||||
}
|
||||
$target_event = $this->Event->fetchSimpleEvent($this->Auth->user(), $target_id);
|
||||
$target_event = $this->Event->fetchSimpleEvent($this->Auth->user(), $target_id, ['contain' => ['Orgc']]);
|
||||
if (empty($target_event)) {
|
||||
throw new NotFoundException(__('Invalid target event.'));
|
||||
}
|
||||
|
@ -2271,7 +2271,7 @@ class EventsController extends AppController
|
|||
if ($this->request->is('get') && $this->_isRest()) {
|
||||
return $this->RestResponse->describe('Events', 'edit', false, $this->response->type());
|
||||
}
|
||||
$event = $this->Event->fetchSimpleEvent($this->Auth->user(), $id);
|
||||
$event = $this->Event->fetchSimpleEvent($this->Auth->user(), $id, ['contain' => ['Orgc']]);
|
||||
if (!$event) {
|
||||
throw new NotFoundException(__('Invalid event'));
|
||||
}
|
||||
|
@ -2735,8 +2735,8 @@ class EventsController extends AppController
|
|||
// Users with a GnuPG key will get the mail encrypted, other users will get the mail unencrypted
|
||||
public function contact($id = null)
|
||||
{
|
||||
$events = $this->Event->fetchEvent($this->Auth->user(), array('eventid' => $id));
|
||||
if (empty($events)) {
|
||||
$event = $this->Event->fetchSimpleEvent($this->Auth->user(), $id, ['contain' => ['Orgc']]);
|
||||
if (empty($event)) {
|
||||
throw new NotFoundException(__('Invalid event'));
|
||||
}
|
||||
// User has filled in his contact form, send out the email.
|
||||
|
@ -2751,7 +2751,7 @@ class EventsController extends AppController
|
|||
throw new MethodNotAllowedException($error);
|
||||
} else {
|
||||
$this->Flash->error($error);
|
||||
$this->redirect(array('action' => 'contact', $id));
|
||||
$this->redirect(array('action' => 'contact', $event['Event']['id']));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2762,31 +2762,29 @@ class EventsController extends AppController
|
|||
$user = $this->Auth->user();
|
||||
$user = $this->Event->User->fillKeysToUser($user);
|
||||
|
||||
$success = $this->Event->sendContactEmailRouter($id, $message, $creator_only, $user);
|
||||
$success = $this->Event->sendContactEmailRouter($event['Event']['id'], $message, $creator_only, $user);
|
||||
if ($success) {
|
||||
$return_message = __('Email sent to the reporter.');
|
||||
if ($this->_isRest()) {
|
||||
return $this->RestResponse->saveSuccessResponse('Events', 'contact', $id, $this->response->type(), $return_message);
|
||||
return $this->RestResponse->saveSuccessResponse('Events', 'contact', $event['Event']['id'], $this->response->type(), $return_message);
|
||||
} else {
|
||||
$this->Flash->success($return_message);
|
||||
// redirect to the view event page
|
||||
$this->redirect(array('action' => 'view', $id));
|
||||
$this->redirect(array('action' => 'view', $event['Event']['id']));
|
||||
}
|
||||
} else {
|
||||
$return_message = __('Sending of email failed.');
|
||||
if ($this->_isRest()) {
|
||||
return $this->RestResponse->saveFailResponse('Events', 'contact', $id, $return_message, $this->response->type());
|
||||
return $this->RestResponse->saveFailResponse('Events', 'contact', $event['Event']['id'], $return_message, $this->response->type());
|
||||
} else {
|
||||
$this->Flash->error($return_message, 'default', array(), 'error');
|
||||
// redirect to the view event page
|
||||
$this->redirect(array('action' => 'view', $id));
|
||||
$this->redirect(array('action' => 'view', $event['Event']['id']));
|
||||
}
|
||||
}
|
||||
}
|
||||
// User didn't see the contact form yet. Present it to him.
|
||||
if (empty($this->data)) {
|
||||
$this->data = $events[0];
|
||||
}
|
||||
$this->set('event', $event);
|
||||
$this->set('mayModify', $this->__canModifyEvent($event));
|
||||
}
|
||||
|
||||
public function automation($legacy = false)
|
||||
|
@ -5115,6 +5113,7 @@ class EventsController extends AppController
|
|||
$this->set('module', $module);
|
||||
$this->set('eventId', $eventId);
|
||||
$this->set('event', $event);
|
||||
$this->set('mayModify', $this->__canModifyEvent($event));
|
||||
}
|
||||
|
||||
public function exportModule($module, $id, $standard = false)
|
||||
|
|
|
@ -19,11 +19,7 @@ class GalaxiesController extends AppController
|
|||
public function index()
|
||||
{
|
||||
$aclConditions = array();
|
||||
$filters = $this->IndexFilter->harvestParameters(array('context', 'value'));
|
||||
$contextConditions = array();
|
||||
if (empty($filters['context'])) {
|
||||
$filters['context'] = 'all';
|
||||
}
|
||||
$filters = $this->IndexFilter->harvestParameters(array('value'));
|
||||
$searchConditions = array();
|
||||
if (empty($filters['value'])) {
|
||||
$filters['value'] = '';
|
||||
|
@ -45,18 +41,16 @@ class GalaxiesController extends AppController
|
|||
array(
|
||||
'recursive' => -1,
|
||||
'conditions' => array(
|
||||
'AND' => array($contextConditions, $searchConditions, $aclConditions)
|
||||
'AND' => array($searchConditions, $aclConditions)
|
||||
)
|
||||
)
|
||||
);
|
||||
return $this->RestResponse->viewData($galaxies, $this->response->type());
|
||||
} else {
|
||||
$this->paginate['conditions']['AND'][] = $contextConditions;
|
||||
$this->paginate['conditions']['AND'][] = $searchConditions;
|
||||
$this->paginate['conditions']['AND'][] = $aclConditions;
|
||||
$galaxies = $this->paginate();
|
||||
$this->set('galaxyList', $galaxies);
|
||||
$this->set('context', $filters['context']);
|
||||
$this->set('searchall', $filters['value']);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ class ObjectsController extends AppController
|
|||
'ObjectTemplateElement'
|
||||
)
|
||||
));
|
||||
$event = $this->MispObject->Event->fetchSimpleEvent($this->Auth->user(), $event_id);
|
||||
$event = $this->MispObject->Event->fetchSimpleEvent($this->Auth->user(), $event_id, ['contain' => ['Orgc']]);
|
||||
if (empty($event)) {
|
||||
throw new NotFoundException(__('Invalid event.'));
|
||||
}
|
||||
|
@ -169,7 +169,7 @@ class ObjectsController extends AppController
|
|||
}
|
||||
}
|
||||
// Find the event that is to be updated
|
||||
$event = $this->MispObject->Event->fetchSimpleEvent($this->Auth->user(), $eventId);
|
||||
$event = $this->MispObject->Event->fetchSimpleEvent($this->Auth->user(), $eventId, ['contain' => ['Orgc']]);
|
||||
if (empty($event)) {
|
||||
throw new NotFoundException(__('Invalid event.'));
|
||||
}
|
||||
|
|
|
@ -360,18 +360,20 @@ class SharingGroupsController extends AppController
|
|||
}
|
||||
if ($sg['SharingGroup']['sync_user_id']) {
|
||||
$this->loadModel('User');
|
||||
$sync_user = $this->User->find('first', array(
|
||||
'conditions' => array('User.id' => $sg['SharingGroup']['sync_user_id']),
|
||||
'recursive' => -1,
|
||||
'fields' => array('User.id', 'User.org_id'),
|
||||
'contain' => array('Organisation' => array(
|
||||
'fields' => array('Organisation.name')
|
||||
))
|
||||
$syncUser = $this->User->find('first', array(
|
||||
'conditions' => array('User.id' => $sg['SharingGroup']['sync_user_id']),
|
||||
'recursive' => -1,
|
||||
'fields' => array('User.id'),
|
||||
'contain' => array('Organisation' => array(
|
||||
'fields' => array('Organisation.id', 'Organisation.name', 'Organisation.uuid'),
|
||||
))
|
||||
));
|
||||
if (empty($sync_user)) {
|
||||
if (empty($syncUser)) {
|
||||
$sg['SharingGroup']['sync_org_name'] = 'N/A';
|
||||
} else {
|
||||
$sg['SharingGroup']['sync_org_name'] = $syncUser['Organisation']['name'];
|
||||
$sg['SharingGroup']['sync_org'] = $syncUser['Organisation'];
|
||||
}
|
||||
$sg['SharingGroup']['sync_org_name'] = $sync_user['Organisation']['name'];
|
||||
}
|
||||
if ($this->_isRest()) {
|
||||
return $this->RestResponse->viewData($sg, $this->response->type());
|
||||
|
|
|
@ -4,10 +4,12 @@
|
|||
<th><?php echo $this->Paginator->sort('org_ci', __('Org'));?></th>
|
||||
<th><?php echo $this->Paginator->sort('role_id', __('Role'));?></th>
|
||||
<th><?php echo $this->Paginator->sort('email');?></th>
|
||||
<?php if (empty(Configure::read('Security.advanced_authkeys'))): ?>
|
||||
<th><?php echo $this->Paginator->sort('authkey');?></th>
|
||||
<th><?php echo $this->Paginator->sort('autoalert');?></th>
|
||||
<th><?php echo $this->Paginator->sort('contactalert');?></th>
|
||||
<th><?php echo $this->Paginator->sort('gpgkey', __('PGP key'));?></th>
|
||||
<?php endif; ?>
|
||||
<th><?php echo $this->Paginator->sort('autoalert', __('Event alert'));?></th>
|
||||
<th><?php echo $this->Paginator->sort('contactalert', __('Contact alert'));?></th>
|
||||
<th><?php echo $this->Paginator->sort('gpgkey', __('PGP Key'));?></th>
|
||||
<?php if (Configure::read('SMIME.enabled')): ?>
|
||||
<th><?php echo $this->Paginator->sort('certif_public', 'S/MIME');?></th>
|
||||
<?php endif; ?>
|
||||
|
@ -40,9 +42,11 @@
|
|||
<td ondblclick="document.location ='<?php echo $this->Html->url(array('admin' => true, 'action' => 'view', $user['User']['id']), true);?>';">
|
||||
<?php echo h($user['User']['email']); ?>
|
||||
</td>
|
||||
<?php if (empty(Configure::read('Security.advanced_authkeys'))): ?>
|
||||
<td class="bold<?= $user['Role']['perm_auth'] ? '' : ' grey'; ?>">
|
||||
<span class="privacy-value quickSelect" data-hidden-value="<?= h($user['User']['authkey']) ?>">****************************************</span> <i class="privacy-toggle fas fa-eye useCursorPointer" title="<?= __('Reveal hidden value') ?>"></i>
|
||||
</td>
|
||||
<?php endif; ?>
|
||||
<td class="short" ondblclick="document.location ='<?php echo $this->Html->url(array('admin' => true, 'action' => 'view', $user['User']['id']), true);?>';">
|
||||
<?php echo $user['User']['autoalert']? __('Yes') : __('No'); ?>
|
||||
</td>
|
||||
|
@ -85,7 +89,7 @@
|
|||
<?php
|
||||
if (($isAclAdmin && (($user['User']['org_id'] == $me['org_id'])) || ('1' == $me['id'])) || ($isSiteAdmin)):
|
||||
?>
|
||||
<span role="button" tabindex="0" class="fa fa-sync useCursorPointer" onClick="initiatePasswordReset('<?php echo $user['User']['id']; ?>');" title="<?php echo __('Create new credentials and inform user');?>" role="button" tabindex="0" aria-label="<?php echo __('Create new credentials and inform user');?>"></span>
|
||||
<span role="button" tabindex="0" class="fa fa-sync useCursorPointer" onClick="initiatePasswordReset('<?php echo $user['User']['id']; ?>');" title="<?php echo __('Create new credentials and inform user');?>" aria-label="<?php echo __('Create new credentials and inform user');?>"></span>
|
||||
<?php
|
||||
echo $this->Html->link('', array('admin' => true, 'action' => 'edit', $user['User']['id']), array('class' => 'fa fa-edit', 'title' => __('Edit'), 'aria-label' => __('Edit')));
|
||||
echo $this->Form->postLink('', array('admin' => true, 'action' => 'delete', $user['User']['id']), array('class' => 'fa fa-trash', 'title' => __('Delete'), 'aria-label' => __('Delete')), __('Are you sure you want to delete # %s? It is highly recommended to never delete users but to disable them instead.', $user['User']['id']));
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
<?php
|
||||
}
|
||||
if ($post['date_created'] != $post['date_modified']) {
|
||||
echo '<span style="font-style:italic">' . __('Message edited at ') . h($post['date_modified']) . '<span>';
|
||||
echo '<span style="font-style:italic">' . __('Message edited at %s', h($post['date_modified'])) . '<span>';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
|
@ -86,14 +86,14 @@
|
|||
echo $this->Form->postLink('', array('controller' => 'posts', 'action' => 'delete', h($post['id']), h($context)), array('class' => 'fa fa-trash', 'title' => __('Delete'), 'aria-label' => __('Delete')), __('Are you sure you want to delete this post?'));
|
||||
} else {
|
||||
?>
|
||||
<a href="<?php echo $baseurl.'/posts/add/post/'.h($post['id']); ?>" class="icon-comment" title="<?php echo __('Reply');?>" aria-label="<?php echo __('Reply');?>"></a>
|
||||
<a href="<?php echo $baseurl.'/posts/add/post/'.h($post['id']); ?>" class="fas fa-comment" title="<?php echo __('Reply');?>" aria-label="<?php echo __('Reply');?>"></a>
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
echo $this->Html->link('', array('controller' => 'posts', 'action' => 'edit', h($post['id']), h($context)), array('class' => 'fa fa-edit', 'title' => __('Edit'), 'aria-label' => __('Edit')));
|
||||
echo $this->Form->postLink('', array('controller' => 'posts', 'action' => 'delete', h($post['id']), h($context)), array('class' => 'fa fa-trash', 'title' => __('Delete'), 'aria-label' => __('Delete')), __('Are you sure you want to delete this post?'));
|
||||
?>
|
||||
<a href="<?php echo $baseurl.'/posts/add/post/'.h($post['id']); ?>" class="icon-comment" title="<?php echo __('Reply');?>" aria-label="<?php echo __('Reply');?>"></a>
|
||||
<a href="<?php echo $baseurl.'/posts/add/post/'.h($post['id']); ?>" class="fas fa-comment" title="<?php echo __('Reply');?>" aria-label="<?php echo __('Reply');?>"></a>
|
||||
<?php
|
||||
|
||||
}
|
||||
|
|
|
@ -62,21 +62,20 @@ $divider = $this->element('/genericElements/SideMenu/side_menu_divider');
|
|||
$mayModify = true;
|
||||
if ($isAclPublish) $mayPublish = true;
|
||||
}
|
||||
if (($menuItem === 'template_populate_results')) {
|
||||
|
||||
if ($menuItem === 'template_populate_results') {
|
||||
echo $this->element('/genericElements/SideMenu/side_menu_link', array(
|
||||
'element_id' => 'template_populate_results',
|
||||
'url' => $baseurl . '/templates/index',
|
||||
'text' => __('Populate From Template')
|
||||
));
|
||||
}
|
||||
if ($menuItem === 'enrichmentResults') {
|
||||
} else if ($menuItem === 'enrichmentResults') {
|
||||
echo $this->element('/genericElements/SideMenu/side_menu_link', array(
|
||||
'element_id' => 'enrichmentResults',
|
||||
'text' => __('Enrichment Module Result')
|
||||
));
|
||||
echo $divider;
|
||||
}
|
||||
if ($menuItem === 'freetextResults') {
|
||||
} else if ($menuItem === 'freetextResults') {
|
||||
echo $this->element('/genericElements/SideMenu/side_menu_link', array(
|
||||
'element_id' => 'freetextResults',
|
||||
'text' => __('Freetext Import Result')
|
||||
|
@ -330,6 +329,7 @@ $divider = $this->element('/genericElements/SideMenu/side_menu_divider');
|
|||
'text' => __('Add Event')
|
||||
));
|
||||
echo $this->element('/genericElements/SideMenu/side_menu_link', array(
|
||||
'element_id' => 'import_from',
|
||||
'onClick' => array(
|
||||
'function' => 'getPopup',
|
||||
'params' => array('0', 'events', 'importChoice/event-collection')
|
||||
|
@ -1094,13 +1094,13 @@ $divider = $this->element('/genericElements/SideMenu/side_menu_divider');
|
|||
'element_id' => 'delete',
|
||||
'onClick' => array(
|
||||
'function' => 'deleteObject',
|
||||
'params' => array('taxonomies', 'delete', h($id), h($id))
|
||||
'params' => array('taxonomies', 'delete', h($id))
|
||||
),
|
||||
'text' => __('Delete Taxonomy')
|
||||
));
|
||||
}
|
||||
}
|
||||
if ($isSiteAdmin) {
|
||||
if ($canAccess('taxonomies', 'update')) {
|
||||
echo $this->element('/genericElements/SideMenu/side_menu_post_link', array(
|
||||
'event_id' => 'update',
|
||||
'url' => $baseurl . '/taxonomies/update',
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
if (empty($elementId)) {
|
||||
$elementId = 'accordion-' . bin2hex(openssl_random_pseudo_bytes(8));
|
||||
$elementId = 'accordion-' . dechex(mt_rand());
|
||||
}
|
||||
$elements = [];
|
||||
$url = $baseurl . $url;
|
||||
|
@ -15,7 +15,7 @@
|
|||
h($elementId) . '-collapse',
|
||||
h($title),
|
||||
!empty($allowFullscreen) ? '' : sprintf(
|
||||
'<span class="fas fa-external-link-alt" title="View %s full screen" onClick="window.location.href=\'%s\';"></span>',
|
||||
'<span class="fas fa-external-link-alt" title="View %s full screen" onclick="event.stopPropagation(); window.location.href=\'%s\';"></span>',
|
||||
h($title),
|
||||
h($url)
|
||||
)
|
||||
|
@ -29,21 +29,23 @@
|
|||
);
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$(function() {
|
||||
var elementId = '#<?= h($elementId) ?>';
|
||||
$(elementId).on('shown', function() {
|
||||
$.ajax({
|
||||
type:"get",
|
||||
url: $(elementId + '-collapse-inner').data('url'),
|
||||
beforeSend: function (XMLHttpRequest) {
|
||||
beforeSend: function() {
|
||||
$(".loading").show();
|
||||
},
|
||||
success:function (data) {
|
||||
success: function(data) {
|
||||
$(elementId + '-collapse-inner').html(data);
|
||||
$(".loading").hide();
|
||||
},
|
||||
error:function() {
|
||||
error: function() {
|
||||
showMessage('fail', 'Something went wrong - could not fetch content.');
|
||||
},
|
||||
complete: function() {
|
||||
$(".loading").hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
echo $this->element('genericElements/Form/genericForm', array(
|
||||
'form' => $this->Form,
|
||||
'data' => array(
|
||||
'title' => $action == 'add' ? __('Add Event Report (event %s)', h($event_id)) : __('Edit Event Report %s (event %s)', h($id), h($event_id)),
|
||||
'title' => $action == 'add' ? __('Add Event Report for Event #%s', h($event_id)) : __('Edit Event Report %s (event #%s)', h($id), h($event_id)),
|
||||
'model' => 'EventReport',
|
||||
'fields' => array(
|
||||
array(
|
||||
|
@ -41,7 +41,6 @@
|
|||
)
|
||||
));
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
if (empty($ajax)) {
|
||||
echo $this->element('/genericElements/SideMenu/side_menu', array('menuList' => 'eventReports', 'menuItem' => $this->request->params['action']));
|
||||
|
@ -49,7 +48,7 @@
|
|||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$(function() {
|
||||
$('#EventReportDistribution').change(function() {
|
||||
checkSharingGroup('EventReport');
|
||||
});
|
||||
|
|
|
@ -29,5 +29,5 @@
|
|||
?>
|
||||
</div>
|
||||
<?php
|
||||
echo $this->element('/genericElements/SideMenu/side_menu', array('menuList' => 'event-collection', 'menuItem' => 'addMISPExport'));
|
||||
echo $this->element('/genericElements/SideMenu/side_menu', array('menuList' => 'event-collection', 'menuItem' => 'import_from'));
|
||||
?>
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
<?php
|
||||
$mayModify = (($isAclModify && $this->request->data['Event']['user_id'] == $me['id']) || ($isAclModifyOrg && $this->request->data['Event']['orgc_id'] == $me['org_id']));
|
||||
$mayPublish = ($isAclPublish && $this->request->data['Event']['orgc_id'] == $me['org_id']);
|
||||
?>
|
||||
<div class="events form">
|
||||
<?php echo $this->Form->create('Event');?>
|
||||
<fieldset>
|
||||
|
@ -32,7 +28,4 @@ $mayPublish = ($isAclPublish && $this->request->data['Event']['orgc_id'] == $me[
|
|||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<?php
|
||||
$event = $this->data;
|
||||
echo $this->element('/genericElements/SideMenu/side_menu', array('menuList' => 'event', 'menuItem' => 'contact', 'event' => $event));
|
||||
?>
|
||||
<?= $this->element('/genericElements/SideMenu/side_menu', array('menuList' => 'event', 'menuItem' => 'contact', 'event' => $event));
|
||||
|
|
|
@ -31,5 +31,5 @@
|
|||
?>
|
||||
</div>
|
||||
<?php
|
||||
echo $this->element('/genericElements/SideMenu/side_menu', array('menuList' => 'event-collection', 'menuItem' => 'addSTIX'));
|
||||
echo $this->element('/genericElements/SideMenu/side_menu', array('menuList' => 'event-collection', 'menuItem' => 'import_from'));
|
||||
?>
|
||||
|
|
|
@ -211,8 +211,8 @@
|
|||
),
|
||||
'title' => __('Feeds'),
|
||||
'description' => __('Generate feed lookup caches or fetch feed data (enabled feeds only)'),
|
||||
'html' => sprintf(
|
||||
'<div class="toggleButtons">%s%s%s%s%s</div><br />',
|
||||
'html' => $isSiteAdmin ? sprintf(
|
||||
'<div class="toggleButtons">%s%s%s%s%s</div><br>',
|
||||
$this->Form->postButton(
|
||||
__('Load default feed metadata'),
|
||||
array('controller' => 'feeds', 'action' => 'loadDefaultFeeds'),
|
||||
|
@ -247,7 +247,7 @@
|
|||
'margin-left:20px;',
|
||||
__('Fetch and store all feed data')
|
||||
)
|
||||
),
|
||||
) : '',
|
||||
'actions' => array(
|
||||
array(
|
||||
'url' => $baseurl . '/feeds/previewIndex',
|
||||
|
|
|
@ -5,23 +5,16 @@
|
|||
'data' => $galaxyList,
|
||||
'top_bar' => array(
|
||||
'children' => array(
|
||||
array(
|
||||
'type' => 'simple',
|
||||
'children' => array(
|
||||
array(
|
||||
'active' => $context === 'all',
|
||||
'url' => $baseurl . '/galaxies/index/context:all',
|
||||
'text' => __('All'),
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'type' => 'search',
|
||||
'button' => __('Filter'),
|
||||
'placeholder' => __('Enter value to search'),
|
||||
'data' => '',
|
||||
'searchKey' => 'value',
|
||||
'value' => $searchall
|
||||
'cancel' => array(
|
||||
'fa-icon' => 'times',
|
||||
'title' => __('Remove filters'),
|
||||
'onClick' => 'cancelSearch',
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
|
@ -78,7 +71,8 @@
|
|||
),
|
||||
'postLink' => true,
|
||||
'postLinkConfirm' => __('Are you sure you want to delete the Galaxy?'),
|
||||
'icon' => 'trash'
|
||||
'icon' => 'trash',
|
||||
'requirement' => $isSiteAdmin,
|
||||
),
|
||||
)
|
||||
)
|
||||
|
@ -88,12 +82,9 @@
|
|||
?>
|
||||
<script type="text/javascript">
|
||||
var passedArgsArray = <?php echo $passedArgs; ?>;
|
||||
if (passedArgsArray['context'] === undefined) {
|
||||
passedArgsArray['context'] = 'pending';
|
||||
}
|
||||
$(document).ready(function() {
|
||||
$(function() {
|
||||
$('#quickFilterButton').click(function() {
|
||||
runIndexQuickFilter('/context:' + passedArgsArray['context']);
|
||||
runIndexQuickFilter();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -15,12 +15,12 @@
|
|||
$extendFromLinks[] = sprintf('<li>%s</li>', $element);
|
||||
}
|
||||
$extendedFromHtml = sprintf('<ul>%s</ul>', implode('', $extendFromLinks));
|
||||
if ($newVersionAvailable) {
|
||||
$extendedFromHtml .= sprintf('<div class="alert alert-warning">%s</div>', sprintf(__('New version available! <a href="%s">Update cluster to version <b>%s</b></a>'),
|
||||
'/galaxy_clusters/updateCluster/' . $cluster['GalaxyCluster']['id'],
|
||||
h($cluster['GalaxyCluster']['extended_from']['GalaxyCluster']['version'])
|
||||
));
|
||||
}
|
||||
if ($newVersionAvailable) {
|
||||
$extendedFromHtml .= sprintf('<div class="alert alert-warning">%s</div>', sprintf(__('New version available! <a href="%s">Update cluster to version <b>%s</b></a>'),
|
||||
'/galaxy_clusters/updateCluster/' . $cluster['GalaxyCluster']['id'],
|
||||
h($cluster['GalaxyCluster']['extended_from']['GalaxyCluster']['version'])
|
||||
));
|
||||
}
|
||||
|
||||
$extendedByHtml = '';
|
||||
$extendByLinks = array();
|
||||
|
@ -44,9 +44,14 @@
|
|||
$table_data[] = array('key' => __('Published'), 'boolean' => $cluster['GalaxyCluster']['published'], 'class' => (!$cluster['GalaxyCluster']['published'] ? 'background-red bold': ''));
|
||||
$table_data[] = array('key' => __('Default'), 'boolean' => $cluster['GalaxyCluster']['default'], 'class' => (!$cluster['GalaxyCluster']['published'] ? 'black': 'black'));
|
||||
$table_data[] = array('key' => __('Version'), 'value' => $cluster['GalaxyCluster']['version']);
|
||||
$table_data[] = array('key' => __('UUID'), 'value' => $cluster['GalaxyCluster']['uuid']);
|
||||
$table_data[] = array('key' => __('Collection UUID'), 'value' => $cluster['GalaxyCluster']['collection_uuid']);
|
||||
$table_data[] = array('key' => __('Source'), 'value' => $cluster['GalaxyCluster']['source']);
|
||||
$table_data[] = array('key' => __('UUID'), 'value' => $cluster['GalaxyCluster']['uuid'], 'value_class' => 'quickSelect');
|
||||
$table_data[] = array('key' => __('Collection UUID'), 'value' => $cluster['GalaxyCluster']['collection_uuid'], 'value_class' => 'quickSelect');
|
||||
$table_data[] = array(
|
||||
'key' => __('Source'),
|
||||
'html' => filter_var($cluster['GalaxyCluster']['source'], FILTER_VALIDATE_URL) ?
|
||||
'<a href="' . $cluster['GalaxyCluster']['source'] . '" rel="noreferrer noopener">' . h($cluster['GalaxyCluster']['source']) :
|
||||
h($cluster['GalaxyCluster']['source']),
|
||||
);
|
||||
$table_data[] = array('key' => __('Authors'), 'value' => !empty($cluster['GalaxyCluster']['authors']) ? implode(', ', $cluster['GalaxyCluster']['authors']) : __('N/A'));
|
||||
$table_data[] = array('key' => __('Distribution'), 'element' => 'genericElements/IndexTable/Fields/distribution_levels', 'element_params' => array(
|
||||
'row' => $cluster['GalaxyCluster'],
|
||||
|
@ -62,15 +67,18 @@
|
|||
);
|
||||
$table_data[] = array('key' => __('Connector tag'), 'value' => $cluster['GalaxyCluster']['tag_name']);
|
||||
$table_data[] = array('key' => __('Events'), 'html' => isset($cluster['GalaxyCluster']['tag_count']) ?
|
||||
sprintf('<a href="%s">%s %s</a>',
|
||||
sprintf('<a href="%s">%s</a>',
|
||||
sprintf('%s/events/index/searchtag:%s', $baseurl, h($cluster['GalaxyCluster']['tag_id'])),
|
||||
h($cluster['GalaxyCluster']['tag_count']),
|
||||
__('event(s)')
|
||||
__n('%s event', '%s events', $cluster['GalaxyCluster']['tag_count'], h($cluster['GalaxyCluster']['tag_count']))
|
||||
):
|
||||
'<span>0</span>'
|
||||
'0'
|
||||
);
|
||||
$table_data[] = array('key' => __('Forked From'), 'html' => $extendedFromHtml);
|
||||
$table_data[] = array('key' => __('Forked By'), 'html' => $extendedByHtml);
|
||||
if (!empty($extendedFromHtml)) {
|
||||
$table_data[] = array('key' => __('Forked From'), 'html' => $extendedFromHtml);
|
||||
}
|
||||
if (!empty($extendedByHtml)) {
|
||||
$table_data[] = array('key' => __('Forked By'), 'html' => $extendedByHtml);
|
||||
}
|
||||
?>
|
||||
|
||||
<div class='view'>
|
||||
|
@ -93,7 +101,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function () {
|
||||
$(function () {
|
||||
$.get("<?php echo $baseurl; ?>/galaxy_elements/index/<?php echo $cluster['GalaxyCluster']['id']; ?>", function(data) {
|
||||
$("#elements_div").html(data);
|
||||
});
|
||||
|
|
|
@ -3,6 +3,11 @@
|
|||
<?php
|
||||
$table_data = array();
|
||||
$table_data[] = array('key' => __('ID'), 'value' => $org['Organisation']['id']);
|
||||
$table_data[] = array(
|
||||
'key' => __('UUID'),
|
||||
'value_class' => 'quickSelect',
|
||||
'value' => isset($org['Organisation']['uuid']) ? $org['Organisation']['uuid'] : '',
|
||||
);
|
||||
$table_data[] = array('key' => __('Organisation name'), 'value' => $org['Organisation']['name']);
|
||||
$table_data[] = array(
|
||||
'key' => __('Local or remote'),
|
||||
|
@ -18,13 +23,9 @@
|
|||
foreach ($domains as $k => $domain) {
|
||||
$domains[$k] = h($domain);
|
||||
}
|
||||
$domains = implode("<br />", $domains);
|
||||
$domains = implode("<br>", $domains);
|
||||
$table_data[] = array('key' => __('Domain restrictions'), 'html' => $domains);
|
||||
}
|
||||
$table_data[] = array(
|
||||
'key' => __('UUID'),
|
||||
'html' => !empty(trim($org['Organisation']['uuid'])) ? '<span class="quickSelect">' . $org['Organisation']['uuid'] . '</span>' : '',
|
||||
);
|
||||
if ($isSiteAdmin) {
|
||||
$table_data[] = array('key' => __('Created by'), 'value' => isset($org['Organisation']['created_by_email']) ? $org['Organisation']['created_by_email'] : __("Unknown"));
|
||||
$table_data[] = array('key' => __('Creation time'), 'value' => $org['Organisation']['date_created']);
|
||||
|
|
|
@ -30,9 +30,9 @@
|
|||
?>
|
||||
<div class="input clear">
|
||||
<button type="button" title="<?php echo __('Insert a quote - just paste your quote between the [quote][/quote] tags.');?>" class="toggle-left btn btn-inverse qet" id = "quote" onclick="insertQuote()"><?php echo __('Quote');?></button>
|
||||
<button type="button" title="Insert a l<?php echo __('');?>ink to an event - just enter the event ID between the [event][/event] tags." class="toggle btn btn-inverse qet" id = "event" onclick="insertEvent()"><?php echo __('Event');?></button>
|
||||
<button type="button" title="<?php echo __('Insert a link to a discussion thread - enter the thread\'s ID between the [thread][/thread] tags.');?>" class="toggle-right btn btn-inverse qet" id = "thread" onclick="insertThread()"><?php echo __('Thread');?></button>
|
||||
<button type="button" title="<?php echo __('Insert a link [link][/link] tags.');?>" class="toggle-right btn btn-inverse qet" id="link" onclick="insertLink()"><?php echo __('Link');?></button>
|
||||
<button type="button" title="<?php echo __('Insert a link to an event - just enter the event ID between the [event][/event] tags.');?>" class="toggle btn btn-inverse qet" id = "event" onclick="insertEvent()"><?php echo __('Event');?></button>
|
||||
<button type="button" title="<?php echo __('Insert a link to a discussion thread - enter the thread\'s ID between the [thread][/thread] tags.');?>" class="toggle btn btn-inverse qet" id = "thread" onclick="insertThread()"><?php echo __('Thread');?></button>
|
||||
<button type="button" title="<?php echo __('Insert a link [link][/link] tags.');?>" class="toggle btn btn-inverse qet" id="link" onclick="insertLink()"><?php echo __('Link');?></button>
|
||||
<button type="button" title="<?php echo __('Insert a code [code][/code] tags.');?>" class="toggle-right btn btn-inverse qet" id="code" onclick="insertCode()"><?php echo __('Code');?></button>
|
||||
</div>
|
||||
<?php
|
||||
|
|
|
@ -26,6 +26,11 @@ echo $this->element('/genericElements/IndexTable/index_table', array(
|
|||
'button' => __('Filter'),
|
||||
'placeholder' => __('Enter value to search'),
|
||||
'searchKey' => 'value',
|
||||
'cancel' => array(
|
||||
'fa-icon' => 'times',
|
||||
'title' => __('Remove filters'),
|
||||
'onClick' => 'cancelSearch',
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
|
|
|
@ -9,19 +9,22 @@ $tableData = [
|
|||
['key' => __('Releasability'), 'value' => $sg['SharingGroup']['releasability']],
|
||||
['key' => __('Description'), 'value' => $sg['SharingGroup']['description']],
|
||||
['key' => __('Selectable'), 'boolean' => $sg['SharingGroup']['active']],
|
||||
['key' => __('Created by'), 'html' => $this->OrgImg->getNameWithImg($sg)],
|
||||
[
|
||||
'key' => __('Created by'),
|
||||
'html' => isset($sg['Organisation']['id']) ? $this->OrgImg->getNameWithImg($sg) : __('Unknown'),
|
||||
],
|
||||
];
|
||||
if ($sg['SharingGroup']['sync_user_id']) {
|
||||
$tableData[] = [
|
||||
'key' => __('Synced by'),
|
||||
'html' => isset($sg['SharingGroup']['sync_org']) ? $this->OrgImg->getNameWithImg($sg['SharingGroup']['sync_org']) : __('Unknown'),
|
||||
];
|
||||
}
|
||||
$eventsLink = $baseurl . '/events/index/searchsharinggroup:' . $sg['SharingGroup']['id'];
|
||||
$tableData[] = [
|
||||
'key' => __('Events'),
|
||||
'html' => '<a href="' . $eventsLink . '">' . __n('%s event', '%s events', $sg['SharingGroup']['event_count'], $sg['SharingGroup']['event_count']) . '</a>',
|
||||
];
|
||||
if ($sg['SharingGroup']['sync_user_id']) {
|
||||
$tableData[] = [
|
||||
'key' => __('Synced by'),
|
||||
'html' => $this->OrgImg->getNameWithImg($sg),
|
||||
];
|
||||
}
|
||||
echo $this->element('genericElements/viewMetaTable', ['table_data' => $tableData]);
|
||||
?>
|
||||
</div></div>
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
],
|
||||
'fields' => [
|
||||
[
|
||||
'name' => __('Id'),
|
||||
'name' => __('ID'),
|
||||
'sort' => 'Tag.id',
|
||||
'class' => 'short',
|
||||
'data_path' => 'Tag.id',
|
||||
|
@ -132,7 +132,8 @@
|
|||
'Tag.id'
|
||||
],
|
||||
'icon' => 'edit',
|
||||
'title' => __('Edit')
|
||||
'title' => __('Edit'),
|
||||
'requirement' => $isSiteAdmin,
|
||||
],
|
||||
[
|
||||
'url' => $baseurl . '/tags/delete',
|
||||
|
@ -142,7 +143,8 @@
|
|||
'postLink' => '',
|
||||
'postLinkConfirm' => __('Are you sure you want to delete the Tag?'),
|
||||
'icon' => 'trash',
|
||||
'title' => __('View graph')
|
||||
'title' => __('Delete tag'),
|
||||
'requirement' => $isSiteAdmin,
|
||||
],
|
||||
]
|
||||
]
|
||||
|
@ -163,7 +165,7 @@
|
|||
?>
|
||||
<script type="text/javascript">
|
||||
var passedArgsArray = <?php echo $passedArgs; ?>;
|
||||
$(document).ready(function() {
|
||||
$(function() {
|
||||
$('#quickFilterButton').click(function() {
|
||||
runIndexQuickFilter();
|
||||
});
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
</div>
|
||||
<table class="table table-striped table-hover table-condensed">
|
||||
<tr>
|
||||
<th><?php echo $this->Paginator->sort('id');?></th>
|
||||
<th><?php echo $this->Paginator->sort('id', __('ID'));?></th>
|
||||
<th><?php echo $this->Paginator->sort('namespace');?></th>
|
||||
<th><?php echo $this->Paginator->sort('description');?></th>
|
||||
<th><?php echo $this->Paginator->sort('version');?></th>
|
||||
|
@ -34,7 +34,7 @@ foreach ($taxonomies as $item): ?>
|
|||
<td ondblclick="document.location.href ='<?php echo $baseurl."/taxonomies/view/".h($item['Taxonomy']['id']);?>'"><?php echo h($item['Taxonomy']['description']); ?> </td>
|
||||
<td class="short" ondblclick="document.location.href ='<?php echo $baseurl."/taxonomies/view/".h($item['Taxonomy']['id']);?>'"><?php echo h($item['Taxonomy']['version']); ?> </td>
|
||||
<td class="short" ondblclick="document.location.href ='<?php echo $baseurl."/taxonomies/view/".h($item['Taxonomy']['id']);?>'"><?php echo $item['Taxonomy']['enabled'] ? '<span class="green">Yes</span>' : '<span class="red">No</span>'; ?> </td>
|
||||
<td class="short"><input type="checkbox" data-taxonomy-id="<?php echo h($item['Taxonomy']['id']); ?>" class="required-toggle" <?php echo $item['Taxonomy']['required'] ? 'checked' : '';?> id="TaxonomyRequired"></td>
|
||||
<td class="short"><input type="checkbox" data-taxonomy-id="<?php echo h($item['Taxonomy']['id']); ?>" class="required-toggle" <?php echo $item['Taxonomy']['required'] ? 'checked' : '';?> id="TaxonomyRequired"<?= $isSiteAdmin ? '' : ' disabled' ?>></td>
|
||||
<td class="shortish"><span><span class="bold"><?php echo h($item['current_count']);?></span> / <?php echo h($item['total_count']);?> <?php if ($item['current_count'] != $item['total_count'] && $isSiteAdmin && $item['Taxonomy']['enabled']) echo '(' . $this->Form->postLink(__('enable all'), array('action' => 'addTag', h($item['Taxonomy']['id'])), array('title' => __('Enable all tags')), (__('Are you sure you want to enable every tag associated to this taxonomy?'))) . ')'; ?></span></td>
|
||||
<td class="short action-links">
|
||||
<?php
|
||||
|
@ -47,7 +47,9 @@ foreach ($taxonomies as $item): ?>
|
|||
}
|
||||
?>
|
||||
<a href='<?php echo $baseurl."/taxonomies/view/". h($item['Taxonomy']['id']);?>' class = "fa fa-eye" title = "<?php echo __('View');?>" aria-label = "<?php echo __('View');?>"></a>
|
||||
<?php if ($isSiteAdmin): ?>
|
||||
<span class="fa fa-trash useCursorPointer" title="<?php echo __('Delete taxonomy');?>" role="button" tabindex="0" aria-label="<?php echo __('Delete taxonomy');?>" onClick="deleteObject('taxonomies', 'delete', '<?php echo h($item['Taxonomy']['id']); ?>', '<?php echo h($item['Taxonomy']['id']); ?>');"></span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
</tr><?php
|
||||
endforeach; ?>
|
||||
|
|
|
@ -92,14 +92,14 @@
|
|||
'requirement' => empty(Configure::read('Security.advanced_authkeys'))
|
||||
),
|
||||
array(
|
||||
'name' => __('Autoalert'),
|
||||
'name' => __('Event alert'),
|
||||
'element' => 'boolean',
|
||||
'sort' => 'User.autoalert',
|
||||
'class' => 'short',
|
||||
'data_path' => 'User.autoalert'
|
||||
),
|
||||
array(
|
||||
'name' => __('Contactalert'),
|
||||
'name' => __('Contact alert'),
|
||||
'element' => 'boolean',
|
||||
'sort' => 'User.contactalert',
|
||||
'class' => 'short',
|
||||
|
@ -166,10 +166,7 @@
|
|||
'sort' => 'User.disabled',
|
||||
'class' => 'short',
|
||||
'data_path' => 'User.monitored',
|
||||
'requirement' => (
|
||||
Configure::read('Security.user_monitoring_enabled') &&
|
||||
$isSiteAdmin
|
||||
)
|
||||
'requirement' => $isSiteAdmin && Configure::read('Security.user_monitoring_enabled')
|
||||
),
|
||||
array(
|
||||
'name' => __('Disabled'),
|
||||
|
|
|
@ -3,13 +3,12 @@
|
|||
$table_data[] = array('key' => __('ID'), 'value' => $user['User']['id']);
|
||||
$table_data[] = array(
|
||||
'key' => __('Email'),
|
||||
'html' => sprintf(
|
||||
'%s <a class="fas fa-envelope" style="color: #333" href="%s/admin/users/quickEmail/%s" title="%s"></a>',
|
||||
h($user['User']['email']),
|
||||
'html' => h($user['User']['email']) . ($admin_view ? sprintf(
|
||||
' <a class="fas fa-envelope" style="color: #333" href="%s/admin/users/quickEmail/%s" title="%s"></a>',
|
||||
$baseurl,
|
||||
h($user['User']['id']),
|
||||
__('Send email to user')
|
||||
)
|
||||
) : ''),
|
||||
);
|
||||
$table_data[] = array(
|
||||
'key' => __('Organisation'),
|
||||
|
|
|
@ -2206,6 +2206,11 @@ function runIndexFilter(element) {
|
|||
window.location.href = url;
|
||||
}
|
||||
|
||||
function cancelSearch() {
|
||||
$('#quickFilterField').val('');
|
||||
$('#quickFilterButton').click();
|
||||
}
|
||||
|
||||
function runIndexQuickFilter(preserveParams, url, target) {
|
||||
if (typeof passedArgsArray === "undefined") {
|
||||
var passedArgsArray = [];
|
||||
|
|
Loading…
Reference in New Issue