mirror of https://github.com/MISP/MISP
new: Added two additional api filters to the event index (timestamp, publishtimestamp)
- Currently these are not exposed to the filter UI - Easy way to get metadata newer than timestamp/publish timestamppull/1651/head
parent
77fdb4a854
commit
b5718aef1c
|
@ -256,7 +256,7 @@ class EventsController extends AppController {
|
|||
// list the events
|
||||
$passedArgsArray = array();
|
||||
$urlparams = "";
|
||||
$overrideAbleParams = array('all', 'attribute', 'published', 'eventid', 'Datefrom', 'Dateuntil', 'org', 'eventinfo', 'tag', 'distribution', 'analysis', 'threatlevel', 'email', 'hasproposal');
|
||||
$overrideAbleParams = array('all', 'attribute', 'published', 'eventid', 'Datefrom', 'Dateuntil', 'org', 'eventinfo', 'tag', 'distribution', 'analysis', 'threatlevel', 'email', 'hasproposal', 'timestamp', 'publishtimestamp');
|
||||
$passedArgs = $this->passedArgs;
|
||||
if (isset($this->request->data)) {
|
||||
if (isset($this->request->data['request'])) $this->request->data = $this->request->data['request'];
|
||||
|
@ -321,6 +321,14 @@ class EventsController extends AppController {
|
|||
if ($v == "") continue 2;
|
||||
$this->paginate['conditions']['AND'][] = array('Event.date <=' => $v);
|
||||
break;
|
||||
case 'timestamp':
|
||||
if ($v == "") continue 2;
|
||||
$this->paginate['conditions']['AND'][] = array('Event.timestamp >=' => $v);
|
||||
break;
|
||||
case 'publishtimestamp':
|
||||
if ($v == "") continue 2;
|
||||
$this->paginate['conditions']['AND'][] = array('Event.publish_timestamp <=' => $v);
|
||||
break;
|
||||
case 'org' :
|
||||
if ($v == "") continue 2;
|
||||
if (!Configure::read('MISP.showorg')) continue 2;
|
||||
|
|
Loading…
Reference in New Issue