mirror of https://github.com/MISP/MISP
commit
0ec3853b18
|
@ -19,24 +19,25 @@ class ObjectTemplatesController extends AppController
|
|||
'recursive' => -1
|
||||
);
|
||||
|
||||
public function objectMetaChoice($event_id) {
|
||||
public function objectMetaChoice($event_id)
|
||||
{
|
||||
$metas = $this->ObjectTemplate->find('list', array(
|
||||
'recursive' => -1,
|
||||
'conditions' => array('ObjectTemplate.active' => 1),
|
||||
'fields' => array('meta-category', 'meta-category'),
|
||||
'fields' => array('meta-category'),
|
||||
'group' => array('ObjectTemplate.meta-category'),
|
||||
'order' => array('ObjectTemplate.meta-category asc')
|
||||
));
|
||||
|
||||
$items = array();
|
||||
$items[] = array(
|
||||
$eventId = h($event_id);
|
||||
$items = [[
|
||||
'name' => __('All Objects'),
|
||||
'value' => $this->baseurl . "/ObjectTemplates/objectChoice/" . h($event_id) . "/" . "0"
|
||||
);
|
||||
'value' => $this->baseurl . "/ObjectTemplates/objectChoice/$eventId/0"
|
||||
]];
|
||||
foreach ($metas as $meta) {
|
||||
$items[] = array(
|
||||
'name' => $meta,
|
||||
'value' => $this->baseurl . "/ObjectTemplates/objectChoice/" . h($event_id) . "/" . h($meta)
|
||||
'value' => $this->baseurl . "/ObjectTemplates/objectChoice/$eventId/" . h($meta)
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div id="shortcutsListContainer" class="<?php echo $debugMode ? 'hidden': ''; ?>">
|
||||
<div id="triangle"></div>
|
||||
<div id="shortcutsList">
|
||||
<span> <?php echo __('Keyboard shortcuts for this page'); ?>:</span><br />
|
||||
<span> <?php echo __('Keyboard shortcuts for this page'); ?>:</span><br>
|
||||
<div id="shortcuts"><?php echo __('none'); ?></div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -12,18 +12,18 @@
|
|||
<?php
|
||||
$gpgpath = ROOT.DS.APP_DIR.DS.WEBROOT_DIR.DS.'gpg.asc';
|
||||
if (Configure::read("MISP.download_gpg_from_homedir")) { ?>
|
||||
<span>Download: <?= $this->Html->link(__('GnuPG key'), array('controller' => 'users', 'action' => 'getGpgPublicKey')) ?></span>
|
||||
<span>Download: <?= $this->Html->link(__('PGP public key'), array('controller' => 'users', 'action' => 'getGpgPublicKey')) ?></span>
|
||||
<?php } else if (file_exists($gpgpath) && (is_file($gpgpath) || is_link($gpgpath))) { ?>
|
||||
<span>Download: <?php echo $this->Html->link(__('GnuPG key'), $this->webroot.'gpg.asc');?></span>
|
||||
<span>Download: <?php echo $this->Html->link(__('PGP public key'), $this->webroot.'gpg.asc');?></span>
|
||||
<?php } else { ?>
|
||||
<span><?php echo __('Could not locate the GnuPG public key.');?></span>
|
||||
<span><?php echo __('Could not locate the PGP public key.');?></span>
|
||||
<?php }
|
||||
if (Configure::read('SMIME.enabled')):
|
||||
$smimepath = ROOT.DS.APP_DIR.DS.WEBROOT_DIR.DS.'public_certificate.pem';
|
||||
if (file_exists($smimepath) && (is_file($smimepath) || is_link($gpgpath))) { ?>
|
||||
<span>Download: <?php echo $this->Html->link('SMIME certificate', $this->webroot.'public_certificate.pem');?></span>
|
||||
<span>Download: <?php echo $this->Html->link(__('S/MIME certificate'), $this->webroot.'public_certificate.pem');?></span>
|
||||
<?php } else { ?>
|
||||
<span><?php echo __('Could not locate SMIME certificate.');?></span>
|
||||
<span><?php echo __('Could not locate S/MIME certificate.');?></span>
|
||||
<?php }
|
||||
endif;
|
||||
?>
|
||||
|
|
|
@ -113,11 +113,12 @@ function redrawChosenWithTemplate($select, $chosenContainer, eventType) {
|
|||
} else {
|
||||
$chosenContainer.find('.generic-picker-wrapper-warning-text').hide(0)
|
||||
var $matches;
|
||||
if (eventType == 'chosen:picked' || eventType == 'change') {
|
||||
if (eventType === 'chosen:picked' || eventType === 'change') {
|
||||
$matches = $chosenContainer.find('.chosen-single > span, .search-choice > span');
|
||||
} else {
|
||||
$matches = $chosenContainer.find('.chosen-results .active-result');
|
||||
}
|
||||
var templates = options_templates[$select.attr('id')];
|
||||
$matches.each(function() {
|
||||
var $item = $(this);
|
||||
var index = $item.data('option-array-index');
|
||||
|
@ -131,8 +132,7 @@ function redrawChosenWithTemplate($select, $chosenContainer, eventType) {
|
|||
return temp === text;
|
||||
});
|
||||
}
|
||||
var template = options_templates[$select.attr('id')][$option.val()];
|
||||
var res = "";
|
||||
var template = templates[$option.val()];
|
||||
if (template !== undefined && template !== '') {
|
||||
$item.html(template);
|
||||
}
|
||||
|
@ -228,7 +228,7 @@ function submitFunction(clicked, callback) {
|
|||
$flag_addPills = false;
|
||||
?>
|
||||
<?php if ($use_select): ?>
|
||||
<select id="<?php echo $select_id; ?>" style="height: 100px; margin-bottom: 0px;" <?php echo h($this->GenericPicker->add_select_params($defaults)); ?>>
|
||||
<select id="<?php echo $select_id; ?>" autofocus style="height: 100px; margin-bottom: 0px;" <?php echo h($this->GenericPicker->add_select_params($defaults)); ?>>
|
||||
<option></option>
|
||||
<?php
|
||||
foreach ($items as $k => $param) {
|
||||
|
@ -270,14 +270,15 @@ function submitFunction(clicked, callback) {
|
|||
<?php endif; ?>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$(function() {
|
||||
setupChosen("<?php echo $select_id; ?>", <?php echo ($defaults['flag_redraw_chosen'] === true ? 'true' : 'false') ?>);
|
||||
$('#<?= $select_id; ?>').chosen().filter('[autofocus]').trigger('chosen:activate');
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php elseif (count($items) > 0): ?>
|
||||
<ul class="nav nav-pills">
|
||||
<select id="<?php echo $select_id; ?>" style="display: none;" <?php echo h($this->GenericPicker->add_select_params($defaults)); ?>></select>
|
||||
<select id="<?php echo $select_id; ?>" autofocus style="display: none;" <?php echo h($this->GenericPicker->add_select_params($defaults)); ?>></select>
|
||||
<?php
|
||||
foreach ($items as $k => $param) {
|
||||
echo $this->GenericPicker->add_pill($param, $defaults);
|
||||
|
|
|
@ -36,9 +36,6 @@
|
|||
*
|
||||
*
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
echo $this->Html->script('attack_matrix');
|
||||
echo $this->Html->css('attack_matrix');
|
||||
?>
|
||||
|
@ -88,7 +85,7 @@ foreach($tabs as $tabName => $column):
|
|||
<span id="matrix-heatmap-maxval"><?php echo h($maxScore); ?></span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<label style="display: inline-block; margin-left: 30px;"><input type="checkbox" id="checkbox_attackMatrix_showAll" checked><span class="fa fa-filter"><?php echo __('Show all');?></span></label>
|
||||
<label style="display: inline-block; margin-left: 30px;"><input type="checkbox" id="checkbox_attackMatrix_showAll" checked><i class="fa fa-filter"></i><?= __('Show all') ?></label>
|
||||
</div>
|
||||
|
||||
<?php if (isset($eventId)): ?>
|
||||
|
@ -102,7 +99,6 @@ foreach($tabs as $tabName => $column):
|
|||
empty($local) ? '0' : '1'
|
||||
);
|
||||
|
||||
|
||||
echo $this->Form->create('Galaxy', array('url' => $url, 'style' => 'margin:0px;'));
|
||||
echo $this->Form->input('target_ids', array('type' => 'text'));
|
||||
echo $this->Form->end();
|
||||
|
|
|
@ -487,10 +487,10 @@
|
|||
<button class="btn btn-inverse toggle qet galaxy-toggle-button" id="eventtimeline_toggle" data-toggle-type="eventtimeline" onclick="enable_timeline();">
|
||||
<span class="icon-plus icon-white" title="<?php echo __('Toggle Event timeline');?>" role="button" tabindex="0" aria-label="<?php echo __('Toggle Event timeline');?>" style="vertical-align:top;"></span><?php echo __('Event timeline');?>
|
||||
</button>
|
||||
<button class="btn btn-inverse toggle qet galaxy-toggle-button" id="correlationgraph_toggle" data-toggle-type="correlationgraph" onclick="enable_correlation_graph();">
|
||||
<button class="btn btn-inverse toggle qet galaxy-toggle-button" id="correlationgraph_toggle" data-toggle-type="correlationgraph" data-load-url="<?= $baseurl ?>/events/viewGraph/<?= h($event['Event']['id']) ?>">
|
||||
<span class="icon-plus icon-white" title="<?php echo __('Toggle Correlation graph');?>" role="button" tabindex="0" aria-label="<?php echo __('Toggle Correlation graph');?>" style="vertical-align:top;"></span><?php echo __('Correlation graph');?>
|
||||
</button>
|
||||
<button class="btn btn-inverse toggle qet galaxy-toggle-button" id="attackmatrix_toggle" data-toggle-type="attackmatrix" onclick="enable_attack_matrix();">
|
||||
<button class="btn btn-inverse toggle qet galaxy-toggle-button" id="attackmatrix_toggle" data-toggle-type="attackmatrix" data-load-url="<?= $baseurl; ?>/events/viewGalaxyMatrix/<?= h($event['Event']['id']) ?>/mitre-attack/event/1">
|
||||
<span class="icon-plus icon-white" title="<?php echo __('Toggle ATT&CK matrix');?>" role="button" tabindex="0" aria-label="<?php echo __('Toggle ATT&CK matrix');?>" style="vertical-align:top;"></span><?php echo __('ATT&CK matrix');?>
|
||||
</button>
|
||||
<button class="btn btn-inverse toggle qet galaxy-toggle-button" id="eventreport_toggle" data-toggle-type="eventreport">
|
||||
|
@ -536,7 +536,7 @@
|
|||
</div>
|
||||
<script type="text/javascript">
|
||||
var showContext = false;
|
||||
$(document).ready(function () {
|
||||
$(function () {
|
||||
queryEventLock('<?php echo h($event['Event']['id']); ?>', '<?php echo h($me['org_id']); ?>');
|
||||
popoverStartup();
|
||||
|
||||
|
@ -557,18 +557,5 @@ $(document).ready(function () {
|
|||
}
|
||||
});
|
||||
});
|
||||
|
||||
function enable_correlation_graph() {
|
||||
$.get("<?= $baseurl ?>/events/viewGraph/<?php echo h($event['Event']['id']); ?>", function(data) {
|
||||
$("#correlationgraph_div").html(data);
|
||||
});
|
||||
}
|
||||
|
||||
function enable_attack_matrix() {
|
||||
$.get("<?= $baseurl; ?>/events/viewGalaxyMatrix/<?php echo h($event['Event']['id']); ?>/mitre-attack/event/1", function(data) {
|
||||
$("#attackmatrix_div").html(data);
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
<input type="hidden" value="/shortcuts/event_view.json" class="keyboardShortcutsConfig" />
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
echo $this->element('/genericElements/SideMenu/side_menu', array('menuList' => 'galaxies', 'menuItem' => 'view_cluster'));
|
||||
|
||||
$extendedFromHtml = '';
|
||||
$extendFromLinks = array();
|
||||
if (!empty($cluster['GalaxyCluster']['extended_from'])) {
|
||||
$element = $this->element('genericElements/IndexTable/Fields/links', array(
|
||||
'url' => $baseurl . '/galaxy_clusters/view/',
|
||||
|
@ -12,9 +11,8 @@
|
|||
'title' => sprintf(__('%s (version: %s)'), $cluster['GalaxyCluster']['extended_from']['GalaxyCluster']['value'], $cluster['GalaxyCluster']['extends_version'])
|
||||
),
|
||||
));
|
||||
$extendFromLinks[] = sprintf('<li>%s</li>', $element);
|
||||
$extendedFromHtml = sprintf('<ul><li>%s</li></ul>', $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'],
|
||||
|
@ -35,7 +33,10 @@
|
|||
));
|
||||
$extendByLinks[] = sprintf('<li>%s</li>', $element);
|
||||
}
|
||||
if (!empty($extendByLinks)) {
|
||||
$extendedByHtml = sprintf('<ul>%s</ul>', implode('', $extendByLinks));
|
||||
}
|
||||
|
||||
$table_data = array();
|
||||
$table_data[] = array('key' => __('Cluster ID'), 'value' => $cluster['GalaxyCluster']['id']);
|
||||
$table_data[] = array('key' => __('Name'), 'value' => $cluster['GalaxyCluster']['value']);
|
||||
|
@ -71,7 +72,7 @@
|
|||
sprintf('%s/events/index/searchtag:%s', $baseurl, h($cluster['GalaxyCluster']['tag_id'])),
|
||||
__n('%s event', '%s events', $cluster['GalaxyCluster']['tag_count'], h($cluster['GalaxyCluster']['tag_count']))
|
||||
):
|
||||
'0'
|
||||
'<span>0</span>'
|
||||
);
|
||||
if (!empty($extendedFromHtml)) {
|
||||
$table_data[] = array('key' => __('Forked From'), 'html' => $extendedFromHtml);
|
||||
|
@ -80,7 +81,6 @@
|
|||
$table_data[] = array('key' => __('Forked By'), 'html' => $extendedByHtml);
|
||||
}
|
||||
?>
|
||||
|
||||
<div class='view'>
|
||||
<div class="row-fluid">
|
||||
<div class="span8">
|
||||
|
@ -102,13 +102,13 @@
|
|||
</div>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$.get("<?php echo $baseurl; ?>/galaxy_elements/index/<?php echo $cluster['GalaxyCluster']['id']; ?>", function(data) {
|
||||
$.get("<?= $baseurl ?>/galaxy_elements/index/<?php echo $cluster['GalaxyCluster']['id']; ?>", function(data) {
|
||||
$("#elements_div").html(data);
|
||||
});
|
||||
$.get("<?php echo $baseurl; ?>/galaxy_clusters/viewGalaxyMatrix/<?php echo $cluster['GalaxyCluster']['id']; ?>", function(data) {
|
||||
$.get("<?= $baseurl ?>/galaxy_clusters/viewGalaxyMatrix/<?php echo $cluster['GalaxyCluster']['id']; ?>", function(data) {
|
||||
$("#matrix_container").html(data);
|
||||
});
|
||||
$.get("/galaxy_clusters/viewRelations/<?php echo $cluster['GalaxyCluster']['id']; ?>", function(data) {
|
||||
$.get("<?= $baseurl ?>/galaxy_clusters/viewRelations/<?php echo $cluster['GalaxyCluster']['id']; ?>", function(data) {
|
||||
$("#relations_container").html(data);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -1,42 +1,26 @@
|
|||
<div class="taxonomy view">
|
||||
<h2><?php echo h(strtoupper($taxonomy['namespace'])) . ' ' . __('Taxonomy Library');?></h2>
|
||||
<dl>
|
||||
<dt><?php echo __('Id');?></dt>
|
||||
<dd>
|
||||
<?php echo h($taxonomy['id']); ?>
|
||||
|
||||
</dd>
|
||||
<dt><?php echo __('Namespace');?></dt>
|
||||
<dd>
|
||||
<?php echo h($taxonomy['namespace']); ?>
|
||||
|
||||
</dd>
|
||||
<dt><?php echo __('Description');?></dt>
|
||||
<dd>
|
||||
<?php echo h($taxonomy['description']); ?>
|
||||
|
||||
</dd>
|
||||
<dt><?php echo __('Version');?></dt>
|
||||
<dd>
|
||||
<?php echo h($taxonomy['version']); ?>
|
||||
|
||||
</dd>
|
||||
<dt><?php echo __('Enabled');?></dt>
|
||||
<dd>
|
||||
<?php echo $taxonomy['enabled'] ? '<span class="green">'. __('Yes') . '</span> ' : '<span class="red">' . __('No') . '</span> ';
|
||||
<div class="row-fluid"><div class="span8" style="margin:0">
|
||||
<?php
|
||||
$enabled = $taxonomy['enabled'] ? '<span class="green">'. __('Yes') . '</span> ' : '<span class="red">' . __('No') . '</span> ';
|
||||
if ($isSiteAdmin) {
|
||||
if ($taxonomy['enabled']) {
|
||||
echo $this->Form->postLink(__('(disable)'), array('action' => 'disable', h($taxonomy['id'])), array('title' => __('Disable')), (__('Are you sure you want to disable this taxonomy library?')));
|
||||
$enabled .= $this->Form->postLink(__('(disable)'), array('action' => 'disable', h($taxonomy['id'])), array('title' => __('Disable')), (__('Are you sure you want to disable this taxonomy library?')));
|
||||
} else {
|
||||
echo $this->Form->postLink(__('(enable)'), array('action' => 'enable', h($taxonomy['id'])), array('title' => __('Enable')), (__('Are you sure you want to enable this taxonomy library?')));
|
||||
$enabled .= $this->Form->postLink(__('(enable)'), array('action' => 'enable', h($taxonomy['id'])), array('title' => __('Enable')), (__('Are you sure you want to enable this taxonomy library?')));
|
||||
}
|
||||
}
|
||||
$tableData = [
|
||||
['key' => __('ID'), 'value' => $taxonomy['id']],
|
||||
['key' => __('Namespace'), 'value' => $taxonomy['namespace']],
|
||||
['key' => __('Description'), 'value' => $taxonomy['description']],
|
||||
['key' => __('Version'), 'value' => $taxonomy['version']],
|
||||
['key' => __('Enabled'), 'html' => $enabled],
|
||||
];
|
||||
echo $this->element('genericElements/viewMetaTable', ['table_data' => $tableData]);
|
||||
?>
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
<br />
|
||||
</div></div>
|
||||
<br>
|
||||
<div class="pagination">
|
||||
<ul>
|
||||
<?php
|
||||
|
@ -102,7 +86,7 @@
|
|||
<?php if(isset($item['original_numerical_value'])): ?>
|
||||
<i
|
||||
class="<?= $this->FontAwesome->getClass('exclamation-triangle') ?> fa-exclamation-triangle"
|
||||
title="<?= __('Numerical value overriden by userSetting. Original numerical_value = %s', h($item['original_numerical_value'])) ?>"
|
||||
title="<?= __('Numerical value overridden by userSetting. Original numerical_value = %s', h($item['original_numerical_value'])) ?>"
|
||||
data-value-overriden="1"
|
||||
></i>
|
||||
<?php endif; ?>
|
||||
|
@ -143,7 +127,7 @@
|
|||
<a href="<?php echo $url;?>" class="<?php echo $isAclTagger ? 'tagFirstHalf' : 'tag' ?>" style="background-color:<?php echo h($item['existing_tag']['Tag']['colour']);?>;color:<?php echo $this->TextColour->getTextColour($item['existing_tag']['Tag']['colour']);?>"><?php echo h($item['existing_tag']['Tag']['name']); ?></a>
|
||||
<?php
|
||||
endif;
|
||||
echo ' ' . $this->Html->link('', array('controller' => 'tags', 'action' => 'viewGraph', $item['existing_tag']['Tag']['id']), array('class' => 'fa fa-share-alt black', 'title' => __('View graph'), 'aria-label' => __('View graph')));
|
||||
echo ' ' . $this->Html->link('', array('controller' => 'tags', 'action' => 'viewGraph', $item['existing_tag']['Tag']['id']), array('class' => 'fa fa-share-alt black', 'title' => __('View correlation graph'), 'aria-label' => __('View correlation graph')));
|
||||
endif;
|
||||
?>
|
||||
</td>
|
||||
|
@ -196,7 +180,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$(function(){
|
||||
$('input:checkbox').removeAttr('checked');
|
||||
$('.mass-select').hide();
|
||||
$('.select_taxonomy, .select_all').click(function(){
|
||||
|
@ -205,6 +189,4 @@
|
|||
$('[data-value-overriden="1"]').tooltip();
|
||||
});
|
||||
</script>
|
||||
<?php
|
||||
echo $this->element('/genericElements/SideMenu/side_menu', array('menuList' => 'taxonomies', 'menuItem' => 'view'));
|
||||
?>
|
||||
<?= $this->element('/genericElements/SideMenu/side_menu', array('menuList' => 'taxonomies', 'menuItem' => 'view'));
|
||||
|
|
|
@ -4365,18 +4365,25 @@ function selectAllInbetween(last, current) {
|
|||
|
||||
$('.galaxy-toggle-button').click(function() {
|
||||
var element = $(this).data('toggle-type');
|
||||
if ($(this).children('span').hasClass('icon-minus')) {
|
||||
$(this).children('span').addClass('icon-plus');
|
||||
$(this).children('span').removeClass('icon-minus');
|
||||
var $button = $(this).children('span');
|
||||
if ($button.hasClass('icon-minus')) {
|
||||
$button.addClass('icon-plus');
|
||||
$button.removeClass('icon-minus');
|
||||
$('#' + element + '_div').hide();
|
||||
} else {
|
||||
$(this).children('span').removeClass('icon-plus');
|
||||
$(this).children('span').addClass('icon-minus');
|
||||
$button.removeClass('icon-plus');
|
||||
$button.addClass('icon-minus');
|
||||
$('#' + element + '_div').show();
|
||||
|
||||
var loadUrl = $(this).data('load-url');
|
||||
if (loadUrl) {
|
||||
$.get(loadUrl, function(data) {
|
||||
$('#' + element + '_div').html(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function addGalaxyListener(id) {
|
||||
var target_type = $(id).data('target-type');
|
||||
var target_id = $(id).data('target-id');
|
||||
|
|
Loading…
Reference in New Issue