recover from upstream version missing bits

pull/5974/head
Vito Piserchia 2020-08-17 17:57:30 +02:00
parent 8486ecb8b4
commit 850034ecc0
7 changed files with 14 additions and 15 deletions

View File

@ -5,6 +5,7 @@ require_once 'AppShell.php';
class EventShell extends AppShell
{
public $uses = array('Event', 'Post', 'Attribute', 'Job', 'User', 'Task', 'Whitelist', 'Server', 'Organisation');
public $tasks = array('ConfigLoad');
public function doPublish()
{
@ -299,9 +300,9 @@ class EventShell extends AppShell
$user = $this->User->getAuthUser($userId);
if (empty($user)) die('Invalid user.');
$eventId = $this->args[1];
$modules = $this->args[2];
$modulesRaw = $this->args[2];
try {
$modules = json_decode($modules);
$modules = json_decode($modulesRaw, true);
} catch (Exception $e) {
die('Invalid module JSON');
}
@ -312,7 +313,7 @@ class EventShell extends AppShell
$data = array(
'worker' => 'default',
'job_type' => 'enrichment',
'job_input' => 'Event: ' . $eventId . ' modules: ' . $modules,
'job_input' => 'Event: ' . $eventId . ' modules: ' . $modulesRaw,
'status' => 0,
'retries' => 0,
'org' => $user['Organisation']['name'],
@ -335,6 +336,7 @@ class EventShell extends AppShell
} else {
$job['Job']['message'] = 'Enrichment finished, but no attributes added.';
}
echo $job['Job']['message'] . PHP_EOL;
$this->Job->save($job);
$log = ClassRegistry::init('Log');
$log->create();

View File

@ -5878,7 +5878,7 @@ class Event extends AppModel
$option_fields = array('user', 'event_id', 'modules');
foreach ($option_fields as $option_field) {
if (empty($params[$option_field])) {
throw new MethodNotAllowedException(__('%s not set', $params[$option_field]));
throw new MethodNotAllowedException(__('%s not set', $option_field));
}
}
$event = $this->fetchEvent($params['user'], array('eventid' => $params['event_id'], 'includeAttachments' => 1, 'flatten' => 1));

View File

@ -35,6 +35,7 @@ class Log extends AppModel
'edit',
'email',
'enable',
'enrichment',
'error',
'export',
'fetchEvent',

View File

@ -46,8 +46,8 @@
<th><?php echo __('Similar Attributes');?></th>
<th><?php echo __('Category');?></th>
<th><?php echo __('Type');?></th>
<th><?php echo __('IDS');?><input type="checkbox" id="checkAllIDS" style="margin-top:23px;margin-left:3px"></th>
<th style="text-align:center;"><?php echo __('Disable Correlation');?><input type="checkbox" id="checkAllDC" style="margini:3px"></th>
<th><?php echo __('IDS');?><input type="checkbox" id="checkAllIDS" style="margin-top:0;margin-left:.3em"></th>
<th style="text-align:center;"><?php echo __('Disable Correlation');?><input type="checkbox" id="checkAllDC" style="margin-top:0;margin-left:.3em"></th>
<th><?php echo __('Distribution');?></th>
<th><?php echo __('Comment');?></th>
<th><?php echo __('Tags');?></th>

View File

@ -183,12 +183,6 @@
$options['isSiteAdmin']
);
}
array(
'requirement' => count($passedArgsArray) > 0,
'url' => $baseurl . '/admin/users/index',
'title' => __('Remove filters'),
'fa-icon' => 'times'
)
)
),
array(

View File

@ -420,9 +420,11 @@ function drawBarChart(data) {
}
$(document).ready(function() {
var rightBtn = '<div style="float:right;"><span type="button" id="reloadDistributionGraph" title="Reload Distribution Graph" class="fas fa-sync useCursorPointer" aria-hidden="true" style="margin-left: 5px;" onclick="fetchDistributionData(function(data) { construct_piechart(data); });"></span></div>';
var rightBtns = '<div style="float:right;">';
rightBtns += '<span type="button" id="reloadDistributionGraph" title="Reload Distribution Graph" class="fas fa-sync useCursorPointer" aria-hidden="true" style="margin-left: 5px;" onclick="fetchDistributionData(function(data) { construct_piechart(data); });"></span>';
rightBtns += '<button type="button" class="close" style="margin-left: 5px;" onclick="$(\'.distribution_graph\').popover(\'hide\');">×</button>';
var pop = $('.distribution_graph').popover({
title: "<b>Distribution graph</b> [atomic event]" + rightBtn,
title: "<b>Distribution graph</b> [atomic event]" + rightBtns,
html: true,
content: function() { return $('#distribution_graph_container').html(); },
template : '<div class="popover" role="tooltip" style="z-index: 1;"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content" style="padding-left: '+spanOffset_orig+'px; padding-right: '+spanOffset_orig*2+'px;"></div></div>'

View File

@ -2558,7 +2558,7 @@ function updateOrgCreateImageField(string) {
},
success:
function(){
$('#logoDiv').html('<img src="' + baseurl + "/img/orgs/' + string + '.png" + '" style="width:24px;height:24px;"></img>');
$('#logoDiv').html('<img src="' + baseurl + '/img/orgs/' + string + '.png" style="width:24px;height:24px;"></img>');
}
});
}