mirror of https://github.com/MISP/MISP
Merge branch '2.4' of github.com:MISP/MISP into 2.4
commit
c9b70ae50c
2
PyMISP
2
PyMISP
|
@ -1 +1 @@
|
||||||
Subproject commit dc5d40a327233895792b8148a7c87d5a1c2ebfb1
|
Subproject commit 2c877f2aec11b7f5d2f23dfc5ce7398b2ce33b48
|
|
@ -46,9 +46,9 @@ class AppController extends Controller
|
||||||
|
|
||||||
public $helpers = array('Utility', 'OrgImg');
|
public $helpers = array('Utility', 'OrgImg');
|
||||||
|
|
||||||
private $__queryVersion = '54';
|
private $__queryVersion = '56';
|
||||||
public $pyMispVersion = '2.4.101';
|
public $pyMispVersion = '2.4.102';
|
||||||
public $phpmin = '5.6.5';
|
public $phpmin = '7.0.16';
|
||||||
public $phprec = '7.0.16';
|
public $phprec = '7.0.16';
|
||||||
|
|
||||||
public $baseurl = '';
|
public $baseurl = '';
|
||||||
|
|
|
@ -3088,9 +3088,12 @@ class EventsController extends AppController
|
||||||
if ($user === false) {
|
if ($user === false) {
|
||||||
return $exception;
|
return $exception;
|
||||||
}
|
}
|
||||||
if (!empty($filters['returnFormat'])) {
|
if (isset($filters['returnFormat'])) {
|
||||||
$returnFormat = $filters['returnFormat'];
|
$returnFormat = $filters['returnFormat'];
|
||||||
} else if (empty($filters['returnFormat']) || $filters['returnFormat'] === 'download'){
|
} else {
|
||||||
|
$returnFormat = 'json';
|
||||||
|
}
|
||||||
|
if ($returnFormat === 'download') {
|
||||||
$returnFormat = 'json';
|
$returnFormat = 'json';
|
||||||
}
|
}
|
||||||
$elementCounter = 0;
|
$elementCounter = 0;
|
||||||
|
|
|
@ -91,8 +91,8 @@ function setupChosen(id, redrawChosen) {
|
||||||
|
|
||||||
// hack to add template into the div
|
// hack to add template into the div
|
||||||
var $chosenContainer = $elem.parent().find('.chosen-container');
|
var $chosenContainer = $elem.parent().find('.chosen-container');
|
||||||
$elem.on('chosen:showing_dropdown chosen:searchdone chosen:picked keyup change', function() {
|
$elem.on('chosen:searchdone chosen:picked keyup change', function(e) {
|
||||||
redrawChosenWithTemplate($elem, $chosenContainer)
|
redrawChosenWithTemplate($elem, $chosenContainer, e.type)
|
||||||
});
|
});
|
||||||
|
|
||||||
if (redrawChosen) {
|
if (redrawChosen) {
|
||||||
|
@ -100,13 +100,19 @@ function setupChosen(id, redrawChosen) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function redrawChosenWithTemplate($select, $chosenContainer) {
|
function redrawChosenWithTemplate($select, $chosenContainer, eventType) {
|
||||||
var optionLength = $select.find('option').length;
|
var optionLength = $select.find('option').length;
|
||||||
if (optionLength > 1000) {
|
if (optionLength > 1000) {
|
||||||
$chosenContainer.parent().find('.generic-picker-wrapper-warning-text').show(0)
|
$chosenContainer.parent().find('.generic-picker-wrapper-warning-text').show(0)
|
||||||
} else {
|
} else {
|
||||||
|
console.log(eventType);
|
||||||
$chosenContainer.find('.generic-picker-wrapper-warning-text').hide(0)
|
$chosenContainer.find('.generic-picker-wrapper-warning-text').hide(0)
|
||||||
var $matches = $chosenContainer.find('.chosen-results .active-result, .chosen-single > span, .search-choice > span');
|
var $matches;
|
||||||
|
if (eventType == 'chosen:picked' || eventType == 'change') {
|
||||||
|
$matches = $chosenContainer.find('.chosen-single > span, .search-choice > span');
|
||||||
|
} else {
|
||||||
|
$matches = $chosenContainer.find('.chosen-results .active-result');
|
||||||
|
}
|
||||||
$matches.each(function() {
|
$matches.each(function() {
|
||||||
var $item = $(this);
|
var $item = $(this);
|
||||||
var index = $item.data('option-array-index');
|
var index = $item.data('option-array-index');
|
||||||
|
@ -115,7 +121,10 @@ function redrawChosenWithTemplate($select, $chosenContainer) {
|
||||||
$option = $select.find('option:eq(' + index + ')');
|
$option = $select.find('option:eq(' + index + ')');
|
||||||
} else { // if it is a `chosen-single span`, don't have index
|
} else { // if it is a `chosen-single span`, don't have index
|
||||||
var text = $item.text();
|
var text = $item.text();
|
||||||
$option = $select.find('option:contains(' + text + ')');
|
$option = $select.find('option').filter(function(index) {
|
||||||
|
var temp = $.trim($(this).text());
|
||||||
|
return temp === text;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
var template = options_templates[$select.attr('id')][$option.val()];
|
var template = options_templates[$select.attr('id')][$option.val()];
|
||||||
var res = "";
|
var res = "";
|
||||||
|
|
|
@ -20,7 +20,7 @@ App::uses('AppHelper', 'View/Helper');
|
||||||
<a href="/organisations/view/<?php echo empty($options['id']) ? h($options['name']) : h($options['id']); ?>">
|
<a href="/organisations/view/<?php echo empty($options['id']) ? h($options['name']) : h($options['id']); ?>">
|
||||||
<img
|
<img
|
||||||
src="/img/orgs/<?php echo $imgOption; ?>"
|
src="/img/orgs/<?php echo $imgOption; ?>"
|
||||||
title = "<?php echo isset($imgOptions['name']) ? h($imgOptions['name']) : h($imgOptions['id']); ?>"
|
title = "<?php echo isset($options['name']) ? h($options['name']) : h($options['id']); ?>"
|
||||||
style = "<?php echo 'width:' . h($size) . 'px; height:' . h($size) . 'px'; ?>"
|
style = "<?php echo 'width:' . h($size) . 'px; height:' . h($size) . 'px'; ?>"
|
||||||
/>
|
/>
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -3,71 +3,41 @@
|
||||||
<div class="span10"><h2><?php echo __('Organisation ') . h($org['Organisation']['name']);?></h2></div>
|
<div class="span10"><h2><?php echo __('Organisation ') . h($org['Organisation']['name']);?></h2></div>
|
||||||
<div class="span2"><div style="float:right;"><?php echo $this->OrgImg->getOrgImg(array('name' => $org['Organisation']['name'], 'id' => $org['Organisation']['id'], 'size' => 48)); ?></div></div>
|
<div class="span2"><div style="float:right;"><?php echo $this->OrgImg->getOrgImg(array('name' => $org['Organisation']['name'], 'id' => $org['Organisation']['id'], 'size' => 48)); ?></div></div>
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
<dl style="width:600px;">
|
<dl style="width:600px;">
|
||||||
<dt><?php echo __('Id'); ?></dt>
|
<dt><?php echo __('Id'); ?></dt>
|
||||||
<dd>
|
<dd><?php echo h($org['Organisation']['id']); ?> </dd>
|
||||||
<?php echo h($org['Organisation']['id']); ?>
|
|
||||||
|
|
||||||
</dd>
|
|
||||||
<dt><?php echo 'Organisation name'; ?></dt>
|
<dt><?php echo 'Organisation name'; ?></dt>
|
||||||
<dd>
|
<dd><?php echo h($org['Organisation']['name']); ?> </dd>
|
||||||
<?php echo h($org['Organisation']['name']); ?>
|
|
||||||
|
|
||||||
</dd>
|
|
||||||
<dt><?php echo __('Local or remote'); ?></dt>
|
<dt><?php echo __('Local or remote'); ?></dt>
|
||||||
<dd>
|
<?php
|
||||||
<?php
|
echo sprintf(
|
||||||
if ($org['Organisation']['local']):
|
'<dd><span class="%s bold">%s</span></dd>',
|
||||||
?>
|
$org['Organisation']['local'] ? 'green' : 'red',
|
||||||
<span class="green bold"><?php echo __('Local');?></span>
|
$org['Organisation']['local'] ? __('Local') : __('Remote')
|
||||||
<?php
|
);
|
||||||
else:
|
?>
|
||||||
?>
|
|
||||||
<span class="red bold"><?php echo __('Remote');?></span>
|
|
||||||
<?php
|
|
||||||
endif;
|
|
||||||
?>
|
|
||||||
|
|
||||||
</dd>
|
|
||||||
<dt><?php echo __('Description'); ?></dt>
|
<dt><?php echo __('Description'); ?></dt>
|
||||||
<dd>
|
<dd><?php echo h($org['Organisation']['description']); ?> </dd>
|
||||||
<?php echo h($org['Organisation']['description']); ?>
|
|
||||||
|
|
||||||
</dd>
|
|
||||||
<?php
|
<?php
|
||||||
if (!empty($org['Organisation']['restricted_to_domain'])):
|
if (!empty($org['Organisation']['restricted_to_domain'])) {
|
||||||
|
$domains = $org['Organisation']['restricted_to_domain'];
|
||||||
|
foreach ($domains as $k => $domain) {
|
||||||
|
$domains[$k] = h($domain);
|
||||||
|
}
|
||||||
|
$domains = implode("<br />", $domains);
|
||||||
|
echo sprintf(
|
||||||
|
'<dt>%s</dt><dd>%s</dd>',
|
||||||
|
__('E-mail domain restrictions'),
|
||||||
|
$domains
|
||||||
|
);
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
<dt><?php echo __('E-mail domain restrictions'); ?></dt>
|
<dt><?php echo __('UUID'); ?></dt>
|
||||||
<dd style="min-height:40px;">
|
<dd><?php echo !empty(trim($org['Organisation']['uuid'])) ? h($org['Organisation']['uuid']) : " "; ?></dd>
|
||||||
<?php
|
|
||||||
$domains = $org['Organisation']['restricted_to_domain'];
|
|
||||||
foreach ($domains as $k => $domain):
|
|
||||||
$domains[$k] = h($domain);
|
|
||||||
endforeach;
|
|
||||||
$domains = implode("<br />", $domains);
|
|
||||||
echo $domains;
|
|
||||||
?>
|
|
||||||
</dd>
|
|
||||||
<?php
|
|
||||||
endif;
|
|
||||||
?>
|
|
||||||
<dt><?php echo __('Uuid'); ?></dt>
|
|
||||||
<dd>
|
|
||||||
<?php echo h($org['Organisation']['uuid']); ?>
|
|
||||||
|
|
||||||
</dd>
|
|
||||||
<?php if ($isSiteAdmin): ?>
|
<?php if ($isSiteAdmin): ?>
|
||||||
<dt><?php echo __('Created by'); ?></dt>
|
<dt><?php echo __('Created by'); ?></dt>
|
||||||
<dd>
|
<dd><?php echo isset($org['Organisation']['created_by_email']) ? h($org['Organisation']['created_by_email']) : __("Unknown"); ?></dd>
|
||||||
<?php
|
|
||||||
if (isset($org['Organisation']['created_by_email'])) {
|
|
||||||
echo h($org['Organisation']['created_by_email']);
|
|
||||||
} else {
|
|
||||||
echo __("Unknown");
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
|
|
||||||
</dd>
|
|
||||||
<dt><?php echo __('Creation time'); ?></dt>
|
<dt><?php echo __('Creation time'); ?></dt>
|
||||||
<dd><?php echo h($org['Organisation']['date_created']); ?></dd>
|
<dd><?php echo h($org['Organisation']['date_created']); ?></dd>
|
||||||
<dt><?php echo __('Last modified'); ?></dt>
|
<dt><?php echo __('Last modified'); ?></dt>
|
||||||
|
@ -76,18 +46,16 @@
|
||||||
<?php
|
<?php
|
||||||
$optionalFields = array('sector' => 'Sector', 'nationality' => 'Nationality', 'type' => 'Organisation type', 'contacts' => 'Contact information');
|
$optionalFields = array('sector' => 'Sector', 'nationality' => 'Nationality', 'type' => 'Organisation type', 'contacts' => 'Contact information');
|
||||||
foreach ($optionalFields as $k => $field):
|
foreach ($optionalFields as $k => $field):
|
||||||
if (!empty($org['Organisation'][$k])):
|
if (!empty(trim($org['Organisation'][$k]))):
|
||||||
?>
|
?>
|
||||||
<dt><?php echo $field; ?></dt>
|
<dt><?php echo $field; ?></dt>
|
||||||
<dd>
|
<dd><?php echo trim(h($org['Organisation'][$k])); ?></dd>
|
||||||
<?php echo h($org['Organisation'][$k]); ?>
|
|
||||||
|
|
||||||
</dd>
|
|
||||||
<?php
|
<?php
|
||||||
endif;
|
endif;
|
||||||
endforeach;
|
endforeach;
|
||||||
?>
|
?>
|
||||||
</dl>
|
</dl>
|
||||||
|
</div>
|
||||||
<br />
|
<br />
|
||||||
<?php if ($local): ?>
|
<?php if ($local): ?>
|
||||||
<button id="button_description" class="btn btn-inverse toggle-left qet orgViewButton" onClick="organisationViewContent('description', '<?php echo $id;?>');"><?php echo __('Description');?></button>
|
<button id="button_description" class="btn btn-inverse toggle-left qet orgViewButton" onClick="organisationViewContent('description', '<?php echo $id;?>');"><?php echo __('Description');?></button>
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 36dc6efab3b01eb92790b57a552cfb32d919fb6f
|
Subproject commit 75ae30f44df997280255eec60b981b9f376c5ac4
|
|
@ -370,7 +370,7 @@ dt {
|
||||||
dd {
|
dd {
|
||||||
float:left;
|
float:left;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
width: calc(100% - 150px);
|
width: calc(100% - 151px);
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue