mirror of https://github.com/MISP/MISP
new: [blacklisting] pass parameters via named parameters to filter the index
- /eventBlacklists/index/event_uuid:[my_event_uuid]pull/3725/head
parent
57c1712e44
commit
e61b7911b4
|
@ -10,8 +10,11 @@ class BlackListComponent extends Component
|
|||
public $defaultModel = '';
|
||||
|
||||
|
||||
public function index($rest = false)
|
||||
public function index($rest = false, $filters = array())
|
||||
{
|
||||
if (!empty($filters)) {
|
||||
$this->controller->paginate['conditions'] = $filters;
|
||||
}
|
||||
if ($this->controller->response->type() === 'application/json' || $this->controller->response->type() == 'application/xml' || $rest) {
|
||||
$blackList = $this->controller->paginate();
|
||||
$blacklist= array();
|
||||
|
|
|
@ -27,7 +27,14 @@ class EventBlacklistsController extends AppController
|
|||
|
||||
public function index()
|
||||
{
|
||||
$this->BlackList->index($this->_isRest());
|
||||
$params = array();
|
||||
$validParams = array('event_uuid', 'comment');
|
||||
foreach ($validParams as $validParam) {
|
||||
if (!empty($this->params['named'][$validParam])) {
|
||||
$params[$validParam] = $this->params['named'][$validParam];
|
||||
}
|
||||
}
|
||||
$this->BlackList->index($this->_isRest(), $params);
|
||||
}
|
||||
|
||||
public function add()
|
||||
|
|
Loading…
Reference in New Issue