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 timestamp
pull/1651/head
Iglocska 2016-11-03 16:01:35 +01:00
parent 77fdb4a854
commit b5718aef1c
1 changed files with 9 additions and 1 deletions

View File

@ -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;