mirror of https://github.com/MISP/MISP
fix: [API] Feed index shouldn't adhere to pagination defaults of the UI, fixes MISP/misp-book#149
parent
a7761e2b7d
commit
a10e175f83
|
@ -50,7 +50,19 @@ class FeedsController extends AppController
|
|||
);
|
||||
}
|
||||
}
|
||||
$data = $this->paginate();
|
||||
if ($this->_isRest()) {
|
||||
$keepFields = array('conditions', 'contain', 'recursive', 'sort');
|
||||
$searchParams = array();
|
||||
foreach ($keepFields as $field) {
|
||||
if (!empty($this->paginate[$field])) {
|
||||
$searchParams[$field] = $this->paginate[$field];
|
||||
}
|
||||
}
|
||||
|
||||
$data = $this->Feed->find('all', $searchParams);
|
||||
} else {
|
||||
$data = $this->paginate();
|
||||
}
|
||||
$this->loadModel('Event');
|
||||
foreach ($data as $key => $value) {
|
||||
if ($value['Feed']['event_id'] != 0 && $value['Feed']['fixed_event']) {
|
||||
|
@ -101,7 +113,7 @@ class FeedsController extends AppController
|
|||
$this->set('other_feeds', $feeds);
|
||||
$this->set('feed', $feed);
|
||||
}
|
||||
|
||||
|
||||
public function feedCoverage($feedId)
|
||||
{
|
||||
if (!$this->_isSiteAdmin() && !$this->Auth->user('org_id') == Configure::read('MISP.host_org_id')) {
|
||||
|
|
Loading…
Reference in New Issue