mirror of https://github.com/MISP/MISP
chg: [event model] fetchEvent() now accepts page/limit/order as parameters
parent
ff828cbb30
commit
6112c0d406
|
@ -1325,7 +1325,7 @@ class Event extends AppModel
|
|||
if (!$eventReportSupportedByRemote) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
// Downgrade the object from connected communities to community only
|
||||
if (!$server['Server']['internal'] && $report['distribution'] == 2) {
|
||||
$report['distribution'] = 1;
|
||||
|
@ -1852,7 +1852,10 @@ class Event extends AppModel
|
|||
'includeServerCorrelations',
|
||||
'includeWarninglistHits',
|
||||
'noEventReports', // do not include event report in event data
|
||||
'noShadowAttributes', // do not fetch proposals
|
||||
'noShadowAttributes', // do not fetch proposals,
|
||||
'limit',
|
||||
'page',
|
||||
'order'
|
||||
);
|
||||
if (!isset($options['excludeLocalTags']) && !empty($user['Role']['perm_sync']) && empty($user['Role']['perm_site_admin'])) {
|
||||
$options['excludeLocalTags'] = 1;
|
||||
|
@ -2137,6 +2140,15 @@ class Event extends AppModel
|
|||
unset($params['contain']['Object']);
|
||||
unset($params['contain']['EventReport']);
|
||||
}
|
||||
if (!empty($options['limit'])) {
|
||||
$params['limit'] = $options['limit'];
|
||||
}
|
||||
if (!empty($options['page'])) {
|
||||
$params['page'] = $options['page'];
|
||||
}
|
||||
if (!empty($options['order'])) {
|
||||
$params['order'] = $options['order'];
|
||||
}
|
||||
$results = $this->find('all', $params);
|
||||
if (empty($results)) {
|
||||
return array();
|
||||
|
@ -7169,7 +7181,7 @@ class Event extends AppModel
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* extractAllTagNames Returns all tag names attached to any elements in an event
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue