mirror of https://github.com/MISP/MISP
Merge branch 'develop' of github.com:MISP/MISP into feature-workflows-2
commit
3a65f22ada
|
@ -1470,7 +1470,7 @@ class AttributesController extends AppController
|
|||
return new CakeResponse(array('body'=> json_encode(array('saved' => true)), 'status' => 200, 'type' => 'json'));
|
||||
}
|
||||
|
||||
private function __getSearchFilters()
|
||||
private function __getSearchFilters(&$exception)
|
||||
{
|
||||
if (isset($this->request->data['Attribute'])) {
|
||||
$this->request->data = $this->request->data['Attribute'];
|
||||
|
@ -1524,7 +1524,8 @@ class AttributesController extends AppController
|
|||
|
||||
public function search($continue = false)
|
||||
{
|
||||
$filters = $this->__getSearchFilters();
|
||||
$exception = null;
|
||||
$filters = $this->__getSearchFilters($exception);
|
||||
if ($this->request->is('post') || !empty($this->request->params['named']['tags'])) {
|
||||
if ($filters === false) {
|
||||
return $exception;
|
||||
|
@ -1552,7 +1553,7 @@ class AttributesController extends AppController
|
|||
|
||||
$this->Session->write('search_attributes_filters', null);
|
||||
}
|
||||
if (isset($filters)) {
|
||||
if (!empty($filters)) {
|
||||
$filters['includeCorrelations'] = 1;
|
||||
$params = $this->Attribute->restSearch($this->Auth->user(), 'json', $filters, true);
|
||||
if (!isset($params['conditions']['Attribute.deleted'])) {
|
||||
|
|
|
@ -98,6 +98,7 @@ class ACLComponent extends Component
|
|||
],
|
||||
'correlations' => [
|
||||
'generateTopCorrelations' => [],
|
||||
'overCorrelations' => [],
|
||||
'top' => []
|
||||
],
|
||||
'cryptographicKeys' => [
|
||||
|
|
|
@ -102,6 +102,7 @@ class CorrelationsController extends AppController
|
|||
if ($this->_isRest()) {
|
||||
return $this->RestResponse->viewData($data, 'json');
|
||||
} else {
|
||||
$this->__setPagingParams($query['page'], $query['limit'], count($data), 'named');
|
||||
$this->set('data', $data);
|
||||
$this->set('title_for_layout', __('Index of over correlating values'));
|
||||
$this->set('menuData', [
|
||||
|
|
|
@ -363,7 +363,18 @@ class DefaultCorrelationBehavior extends ModelBehavior
|
|||
if (!empty($includeEventData)) {
|
||||
$contain['Event'] = [
|
||||
'fields' => [
|
||||
'Event.id', 'Event.uuid', 'Event.info', 'Event.distribution', 'Event.sharing_group_id', 'Event.date', 'Event.orgc_id', 'Event.org_id'
|
||||
'Event.id',
|
||||
'Event.uuid',
|
||||
'Event.threat_level_id',
|
||||
'Event.analysis',
|
||||
'Event.info',
|
||||
'Event.extends_uuid',
|
||||
'Event.distribution',
|
||||
'Event.sharing_group_id',
|
||||
'Event.published',
|
||||
'Event.date',
|
||||
'Event.orgc_id',
|
||||
'Event.org_id'
|
||||
]
|
||||
];
|
||||
}
|
||||
|
@ -379,10 +390,7 @@ class DefaultCorrelationBehavior extends ModelBehavior
|
|||
$results = [];
|
||||
foreach ($relatedAttributes as $k => $attribute) {
|
||||
$temp = $attribute['Attribute'];
|
||||
$temp['info'] = $attribute['Event']['info'];
|
||||
$temp['org_id'] = $attribute['Event']['org_id'];
|
||||
$temp['id'] = $attribute['Event']['id'];
|
||||
$temp['date'] = $attribute['Event']['date'];
|
||||
$temp['Event'] = $attribute['Event'];
|
||||
$results[] = $temp;
|
||||
}
|
||||
return $results;
|
||||
|
@ -455,8 +463,10 @@ class DefaultCorrelationBehavior extends ModelBehavior
|
|||
|
||||
private function checkCorrelationACL($user, $correlation, $sgids, $prefix)
|
||||
{
|
||||
|
||||
// check if user can see the event
|
||||
if (isset($correlation['Correlation'])) {
|
||||
$correlation = $correlation['Correlation'];
|
||||
}
|
||||
if (
|
||||
$correlation[$prefix . 'org_id'] != $user['org_id'] &&
|
||||
(
|
||||
|
|
|
@ -268,7 +268,18 @@ class NoAclCorrelationBehavior extends ModelBehavior
|
|||
if (!empty($includeEventData)) {
|
||||
$contain['Event'] = [
|
||||
'fields' => [
|
||||
'Event.id', 'Event.uuid', 'Event.info', 'Event.distribution', 'Event.sharing_group_id', 'Event.date', 'Event.orgc_id', 'Event.org_id'
|
||||
'Event.id',
|
||||
'Event.uuid',
|
||||
'Event.threat_level_id',
|
||||
'Event.analysis',
|
||||
'Event.info',
|
||||
'Event.extends_uuid',
|
||||
'Event.distribution',
|
||||
'Event.sharing_group_id',
|
||||
'Event.published',
|
||||
'Event.date',
|
||||
'Event.orgc_id',
|
||||
'Event.org_id'
|
||||
]
|
||||
];
|
||||
}
|
||||
|
@ -284,10 +295,7 @@ class NoAclCorrelationBehavior extends ModelBehavior
|
|||
$results = [];
|
||||
foreach ($relatedAttributes as $k => $attribute) {
|
||||
$temp = $attribute['Attribute'];
|
||||
$temp['info'] = $attribute['Event']['info'];
|
||||
$temp['org_id'] = $attribute['Event']['org_id'];
|
||||
$temp['id'] = $attribute['Event']['id'];
|
||||
$temp['date'] = $attribute['Event']['date'];
|
||||
$temp['Event'] = $attribute['Event'];
|
||||
$results[] = $temp;
|
||||
}
|
||||
return $results;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
echo sprintf('<div%s>', empty($ajax) ? ' class="index"' : '');
|
||||
echo $this->element('genericElements/IndexTable/index_table', [
|
||||
'data' => [
|
||||
'stupid_pagination' => 1,
|
||||
'light_paginator' => 1,
|
||||
'data' => $data,
|
||||
'top_bar' => [
|
||||
'children' => [
|
||||
|
|
Loading…
Reference in New Issue