2012-08-06 10:42:46 +02:00
|
|
|
<?php
|
2013-01-04 15:49:52 +01:00
|
|
|
|
2012-08-06 10:42:46 +02:00
|
|
|
App::uses('AppController', 'Controller');
|
2013-01-04 15:49:52 +01:00
|
|
|
|
2012-08-06 10:42:46 +02:00
|
|
|
/**
|
|
|
|
* Whitelists Controller
|
|
|
|
*
|
|
|
|
* @property Whitelist $Whitelist
|
|
|
|
*/
|
|
|
|
class WhitelistsController extends AppController {
|
|
|
|
|
2013-01-04 15:49:52 +01:00
|
|
|
public $XXXcomponents = array('Security', 'RequestHandler');
|
2013-01-28 09:32:01 +01:00
|
|
|
|
2012-10-30 15:01:59 +01:00
|
|
|
public $components = array(
|
2012-11-14 17:16:36 +01:00
|
|
|
'Security',
|
2013-01-04 15:49:52 +01:00
|
|
|
'AdminCrud'
|
2012-11-14 17:16:36 +01:00
|
|
|
);
|
2012-10-30 15:01:59 +01:00
|
|
|
|
2012-11-14 17:16:36 +01:00
|
|
|
public $paginate = array(
|
|
|
|
'limit' => 60,
|
|
|
|
'order' => array(
|
|
|
|
'Whitelist.name' => 'ASC'
|
|
|
|
)
|
|
|
|
);
|
2012-10-30 15:01:59 +01:00
|
|
|
|
2013-01-04 15:49:52 +01:00
|
|
|
public function beforeFilter() { // TODO REMOVE
|
|
|
|
parent::beforeFilter();
|
|
|
|
}
|
|
|
|
|
2012-08-06 10:42:46 +02:00
|
|
|
/**
|
2013-01-04 15:49:52 +01:00
|
|
|
* admin_add method
|
2012-08-06 10:42:46 +02:00
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2013-01-04 15:49:52 +01:00
|
|
|
public function admin_add() {
|
2013-10-03 11:45:27 +02:00
|
|
|
if(!$this->userRole['perm_regexp_access']) $this->redirect(array('controller' => 'regexp', 'action' => 'index', 'admin' => false));
|
2013-01-04 15:49:52 +01:00
|
|
|
$this->AdminCrud->adminAdd();
|
2012-08-06 10:42:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2013-01-04 15:49:52 +01:00
|
|
|
* admin_index method
|
2012-08-06 10:42:46 +02:00
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2013-01-04 15:49:52 +01:00
|
|
|
public function admin_index() {
|
2013-10-03 11:45:27 +02:00
|
|
|
if(!$this->userRole['perm_regexp_access']) $this->redirect(array('controller' => 'whitelists', 'action' => 'index', 'admin' => false));
|
2013-01-04 15:49:52 +01:00
|
|
|
$this->AdminCrud->adminIndex();
|
2012-08-06 10:42:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2013-01-04 15:49:52 +01:00
|
|
|
* admin_edit method
|
2012-08-06 10:42:46 +02:00
|
|
|
*
|
|
|
|
* @param string $id
|
|
|
|
* @return void
|
2012-09-18 15:30:32 +02:00
|
|
|
* @throws NotFoundException
|
2012-08-06 10:42:46 +02:00
|
|
|
*/
|
|
|
|
public function admin_edit($id = null) {
|
2013-10-03 11:45:27 +02:00
|
|
|
if(!$this->userRole['perm_regexp_access']) $this->redirect(array('controller' => 'whitelists', 'action' => 'index', 'admin' => false));
|
2013-01-04 15:49:52 +01:00
|
|
|
$this->AdminCrud->adminEdit($id);
|
2012-08-06 10:42:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2013-01-04 15:49:52 +01:00
|
|
|
* admin_delete method
|
2012-08-06 10:42:46 +02:00
|
|
|
*
|
|
|
|
* @param string $id
|
|
|
|
* @return void
|
2012-09-18 15:30:32 +02:00
|
|
|
* @throws MethodNotAllowedException
|
|
|
|
* @throws NotFoundException
|
2012-08-06 10:42:46 +02:00
|
|
|
*/
|
|
|
|
public function admin_delete($id = null) {
|
2013-10-03 11:45:27 +02:00
|
|
|
if(!$this->userRole['perm_regexp_access']) $this->redirect(array('controller' => 'whitelists', 'action' => 'index', 'admin' => false));
|
2013-01-04 15:49:52 +01:00
|
|
|
$this->AdminCrud->adminDelete($id);
|
2012-08-06 10:42:46 +02:00
|
|
|
}
|
2013-01-28 12:05:23 +01:00
|
|
|
|
2013-01-28 11:44:09 +01:00
|
|
|
/**
|
|
|
|
* index method
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2013-01-28 12:05:23 +01:00
|
|
|
public function index() {
|
|
|
|
$this->recursive = 0;
|
2013-04-22 16:45:32 +02:00
|
|
|
$this->set('list', $this->paginate());
|
2013-01-28 11:44:09 +01:00
|
|
|
}
|
2013-01-04 15:49:52 +01:00
|
|
|
}
|