Merge branch '2.4' of github.com:MISP/MISP into 2.4

pull/3758/head
chrisr3d 2018-09-18 11:43:28 +02:00
commit c4a96013e2
2 changed files with 16 additions and 19 deletions

View File

@ -2690,8 +2690,8 @@ class EventsController extends AppController
'ordered_url_params' => compact($paramArray)
);
$exception = false;
$filters = $this->_harvestParameters($filterData, $exception);
if ($filters === false) {
$params = $this->_harvestParameters($filterData, $exception);
if ($params === false) {
return $exception;
}
$list = array();
@ -2702,7 +2702,7 @@ class EventsController extends AppController
// if it's a search, grab the attributeIDList from the session and get the IDs from it. Use those as the condition
// We don't need to look out for permissions since that's filtered by the search itself
// We just want all the attributes found by the search
if (!empty($filters['eventid']) && $filters['eventid'] === 'search') {
if (!empty($params['eventid']) && $params['eventid'] === 'search') {
$ioc = $this->Session->read('paginate_conditions_ioc');
$paginateConditions = $this->Session->read('paginate_conditions');
unset($paginateConditions['contain']['Event']['Orgc']);
@ -2726,8 +2726,6 @@ class EventsController extends AppController
);
$list[] = $attribute['Attribute']['id'];
}
} elseif (!empty($filters['eventid']) && $filters['eventid'] !== 'all') {
$events = $filters['eventid'];
}
$final = array();
$requested_attributes = array('uuid', 'event_id', 'category', 'type',
@ -2759,13 +2757,12 @@ class EventsController extends AppController
'enforceWarninglist', 'value', 'timestamp', 'tags',
'last', 'from', 'to'
);
$params = array();
if (!empty($events)) {
$filters['eventid'] = $events;
if (isset($params['eventid']) && $params['eventid'] == 'all') {
unset($params['eventid']);
}
foreach ($possibleParams as $possibleParam) {
if (isset($filters[$possibleParam])) {
$params[$possibleParam] = $filters[$possibleParam];
if (isset($params[$possibleParam])) {
$params[$possibleParam] = $params[$possibleParam];
}
}
$params['limit'] = 1000;
@ -2788,15 +2785,15 @@ class EventsController extends AppController
}
$export->footer();
$this->response->type('csv'); // set the content type
if (empty($filters['eventid'])) {
if (empty($params['eventid'])) {
$filename = "misp.filtered_attributes.csv";
} elseif ($filters['eventid'] === 'search') {
} elseif ($params['eventid'] === 'search') {
$filename = "misp.search_result.csv";
} else {
if (is_array($filters['eventid'])) {
$filters['eventid'] = 'list';
if (is_array($params['eventid'])) {
$params['eventid'] = 'list';
}
$filename = "misp.event_" . $filters['eventid'] . ".csv";
$filename = "misp.event_" . $params['eventid'] . ".csv";
}
return $this->RestResponse->viewData($final, 'csv', false, true, $filename);
}

View File

@ -1295,7 +1295,7 @@
"id": "64",
"name": "This list contains all domains - A list for administrators to prevent mining in networks",
"provider": "CoinBlockerLists",
"url": "https://raw.githubusercontent.com/ZeroDot1/CoinBlockerLists/master/list.txt",
"url": "https://gitlab.com/ZeroDot1/CoinBlockerLists/raw/master/list.txt?inline=false",
"rules": "{\"tags\":{\"OR\":[],\"NOT\":[]},\"orgs\":{\"OR\":[],\"NOT\":[]}}",
"enabled": true,
"distribution": "3",
@ -1320,7 +1320,7 @@
"id": "65",
"name": "This list contains all optional domains - An additional list for administrators",
"provider": "CoinBlockerLists",
"url": "https://raw.githubusercontent.com/ZeroDot1/CoinBlockerLists/master/list_optional.txt",
"url": "https://gitlab.com/ZeroDot1/CoinBlockerLists/raw/master/list_optional.txt?inline=false",
"rules": "",
"enabled": true,
"distribution": "3",
@ -1345,7 +1345,7 @@
"id": "66",
"name": "This list contains all browser mining domains - A list to prevent browser mining only",
"provider": "CoinBlockerLists",
"url": "https://raw.githubusercontent.com/ZeroDot1/CoinBlockerLists/master/list_browser.txt",
"url": "https://gitlab.com/ZeroDot1/CoinBlockerLists/raw/master/list_browser.txt?inline=false",
"rules": "",
"enabled": true,
"distribution": "3",
@ -1370,7 +1370,7 @@
"id": "68",
"name": "This list contains all IPs - A additional list for administrators to prevent mining in networks",
"provider": "CoinBlockerLists",
"url": "https://raw.githubusercontent.com/ZeroDot1/CoinBlockerLists/master/MiningServerIPList.txt",
"url": "https://gitlab.com/ZeroDot1/CoinBlockerLists/raw/master/MiningServerIPList.txt?inline=false",
"rules": "",
"enabled": true,
"distribution": "3",