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');
|
||||
|
||||
private $__queryVersion = '54';
|
||||
public $pyMispVersion = '2.4.101';
|
||||
public $phpmin = '5.6.5';
|
||||
private $__queryVersion = '56';
|
||||
public $pyMispVersion = '2.4.102';
|
||||
public $phpmin = '7.0.16';
|
||||
public $phprec = '7.0.16';
|
||||
|
||||
public $baseurl = '';
|
||||
|
|
|
@ -3088,9 +3088,12 @@ class EventsController extends AppController
|
|||
if ($user === false) {
|
||||
return $exception;
|
||||
}
|
||||
if (!empty($filters['returnFormat'])) {
|
||||
if (isset($filters['returnFormat'])) {
|
||||
$returnFormat = $filters['returnFormat'];
|
||||
} else if (empty($filters['returnFormat']) || $filters['returnFormat'] === 'download'){
|
||||
} else {
|
||||
$returnFormat = 'json';
|
||||
}
|
||||
if ($returnFormat === 'download') {
|
||||
$returnFormat = 'json';
|
||||
}
|
||||
$elementCounter = 0;
|
||||
|
|
|
@ -91,8 +91,8 @@ function setupChosen(id, redrawChosen) {
|
|||
|
||||
// hack to add template into the div
|
||||
var $chosenContainer = $elem.parent().find('.chosen-container');
|
||||
$elem.on('chosen:showing_dropdown chosen:searchdone chosen:picked keyup change', function() {
|
||||
redrawChosenWithTemplate($elem, $chosenContainer)
|
||||
$elem.on('chosen:searchdone chosen:picked keyup change', function(e) {
|
||||
redrawChosenWithTemplate($elem, $chosenContainer, e.type)
|
||||
});
|
||||
|
||||
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;
|
||||
if (optionLength > 1000) {
|
||||
$chosenContainer.parent().find('.generic-picker-wrapper-warning-text').show(0)
|
||||
} else {
|
||||
console.log(eventType);
|
||||
$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() {
|
||||
var $item = $(this);
|
||||
var index = $item.data('option-array-index');
|
||||
|
@ -115,7 +121,10 @@ function redrawChosenWithTemplate($select, $chosenContainer) {
|
|||
$option = $select.find('option:eq(' + index + ')');
|
||||
} else { // if it is a `chosen-single span`, don't have index
|
||||
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 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']); ?>">
|
||||
<img
|
||||
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'; ?>"
|
||||
/>
|
||||
</a>
|
||||
|
|
|
@ -3,71 +3,41 @@
|
|||
<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>
|
||||
<div>
|
||||
<dl style="width:600px;">
|
||||
<dt><?php echo __('Id'); ?></dt>
|
||||
<dd>
|
||||
<?php echo h($org['Organisation']['id']); ?>
|
||||
|
||||
</dd>
|
||||
<dd><?php echo h($org['Organisation']['id']); ?> </dd>
|
||||
<dt><?php echo 'Organisation name'; ?></dt>
|
||||
<dd>
|
||||
<?php echo h($org['Organisation']['name']); ?>
|
||||
|
||||
</dd>
|
||||
<dd><?php echo h($org['Organisation']['name']); ?> </dd>
|
||||
<dt><?php echo __('Local or remote'); ?></dt>
|
||||
<dd>
|
||||
<?php
|
||||
if ($org['Organisation']['local']):
|
||||
?>
|
||||
<span class="green bold"><?php echo __('Local');?></span>
|
||||
<?php
|
||||
else:
|
||||
?>
|
||||
<span class="red bold"><?php echo __('Remote');?></span>
|
||||
<?php
|
||||
endif;
|
||||
?>
|
||||
|
||||
</dd>
|
||||
<?php
|
||||
echo sprintf(
|
||||
'<dd><span class="%s bold">%s</span></dd>',
|
||||
$org['Organisation']['local'] ? 'green' : 'red',
|
||||
$org['Organisation']['local'] ? __('Local') : __('Remote')
|
||||
);
|
||||
?>
|
||||
<dt><?php echo __('Description'); ?></dt>
|
||||
<dd>
|
||||
<?php echo h($org['Organisation']['description']); ?>
|
||||
|
||||
</dd>
|
||||
<dd><?php echo h($org['Organisation']['description']); ?> </dd>
|
||||
<?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>
|
||||
<dd style="min-height:40px;">
|
||||
<?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>
|
||||
<dt><?php echo __('UUID'); ?></dt>
|
||||
<dd><?php echo !empty(trim($org['Organisation']['uuid'])) ? h($org['Organisation']['uuid']) : " "; ?></dd>
|
||||
<?php if ($isSiteAdmin): ?>
|
||||
<dt><?php echo __('Created by'); ?></dt>
|
||||
<dd>
|
||||
<?php
|
||||
if (isset($org['Organisation']['created_by_email'])) {
|
||||
echo h($org['Organisation']['created_by_email']);
|
||||
} else {
|
||||
echo __("Unknown");
|
||||
}
|
||||
?>
|
||||
|
||||
</dd>
|
||||
<dd><?php echo isset($org['Organisation']['created_by_email']) ? h($org['Organisation']['created_by_email']) : __("Unknown"); ?></dd>
|
||||
<dt><?php echo __('Creation time'); ?></dt>
|
||||
<dd><?php echo h($org['Organisation']['date_created']); ?></dd>
|
||||
<dt><?php echo __('Last modified'); ?></dt>
|
||||
|
@ -76,18 +46,16 @@
|
|||
<?php
|
||||
$optionalFields = array('sector' => 'Sector', 'nationality' => 'Nationality', 'type' => 'Organisation type', 'contacts' => 'Contact information');
|
||||
foreach ($optionalFields as $k => $field):
|
||||
if (!empty($org['Organisation'][$k])):
|
||||
if (!empty(trim($org['Organisation'][$k]))):
|
||||
?>
|
||||
<dt><?php echo $field; ?></dt>
|
||||
<dd>
|
||||
<?php echo h($org['Organisation'][$k]); ?>
|
||||
|
||||
</dd>
|
||||
<dd><?php echo trim(h($org['Organisation'][$k])); ?></dd>
|
||||
<?php
|
||||
endif;
|
||||
endforeach;
|
||||
?>
|
||||
</dl>
|
||||
</div>
|
||||
<br />
|
||||
<?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>
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 36dc6efab3b01eb92790b57a552cfb32d919fb6f
|
||||
Subproject commit 75ae30f44df997280255eec60b981b9f376c5ac4
|
|
@ -370,7 +370,7 @@ dt {
|
|||
dd {
|
||||
float:left;
|
||||
vertical-align: top;
|
||||
width: calc(100% - 150px);
|
||||
width: calc(100% - 151px);
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue