2016-03-26 23:42:50 +01:00
|
|
|
<?php
|
|
|
|
App::uses('AppController', 'Controller');
|
|
|
|
|
|
|
|
class OrgBlacklistsController extends AppController {
|
|
|
|
public $components = array('Session', 'RequestHandler', 'BlackList');
|
|
|
|
|
|
|
|
public function beforeFilter() {
|
|
|
|
parent::beforeFilter();
|
2016-06-04 15:45:39 +02:00
|
|
|
if (!$this->_isSiteAdmin()) $this->redirect('/');
|
2017-04-11 15:44:51 +02:00
|
|
|
if (Configure::check('MISP.enableOrgBlacklisting') && !Configure::read('MISP.enableOrgBlacklisting') !== false) {
|
2018-05-16 19:32:38 +02:00
|
|
|
$this->Flash->info(__('Organisation Blacklisting is not currently enabled on this instance.'));
|
2016-03-26 23:42:50 +01:00
|
|
|
$this->redirect('/');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public $paginate = array(
|
|
|
|
'limit' => 60,
|
|
|
|
'maxLimit' => 9999, // LATER we will bump here on a problem once we have more than 9999 events <- no we won't, this is the max a user van view/page.
|
|
|
|
'order' => array(
|
|
|
|
'OrgBlacklist.created' => 'DESC'
|
|
|
|
),
|
|
|
|
);
|
|
|
|
|
|
|
|
public function index() {
|
|
|
|
$this->BlackList->index($this->_isRest());
|
|
|
|
}
|
|
|
|
|
|
|
|
public function add() {
|
|
|
|
$this->BlackList->add($this->_isRest());
|
|
|
|
}
|
2016-06-04 01:08:16 +02:00
|
|
|
|
2016-03-26 23:42:50 +01:00
|
|
|
public function edit($id) {
|
|
|
|
$this->BlackList->edit($this->_isRest(), $id);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function delete($id) {
|
|
|
|
$this->BlackList->delete($this->_isRest(), $id);
|
|
|
|
}
|
|
|
|
}
|