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
|
|
|
|
2020-09-01 15:59:38 +02:00
|
|
|
class AllowedlistsController extends AppController
|
2018-07-19 11:48:22 +02:00
|
|
|
{
|
|
|
|
public $components = array(
|
|
|
|
'Security',
|
|
|
|
'AdminCrud'
|
|
|
|
);
|
|
|
|
|
|
|
|
public $paginate = array(
|
|
|
|
'limit' => 60,
|
|
|
|
'order' => array(
|
2020-09-01 15:59:38 +02:00
|
|
|
'Allowedlist.name' => 'ASC'
|
2018-07-19 11:48:22 +02:00
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
public function admin_add()
|
|
|
|
{
|
|
|
|
if (!$this->userRole['perm_regexp_access']) {
|
|
|
|
$this->redirect(array('controller' => 'regexp', 'action' => 'index', 'admin' => false));
|
|
|
|
}
|
2021-04-29 15:42:05 +02:00
|
|
|
$this->set('action', 'add');
|
2018-07-19 11:48:22 +02:00
|
|
|
$this->AdminCrud->adminAdd();
|
|
|
|
}
|
|
|
|
|
|
|
|
public function admin_index()
|
|
|
|
{
|
|
|
|
if (!$this->userRole['perm_regexp_access']) {
|
2020-09-01 15:59:38 +02:00
|
|
|
$this->redirect(array('controller' => 'allowedlists', 'action' => 'index', 'admin' => false));
|
2018-07-19 11:48:22 +02:00
|
|
|
}
|
|
|
|
$this->AdminCrud->adminIndex();
|
2021-04-29 15:42:05 +02:00
|
|
|
$this->render('index');
|
2018-07-19 11:48:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function admin_edit($id = null)
|
|
|
|
{
|
|
|
|
if (!$this->userRole['perm_regexp_access']) {
|
2020-09-01 15:59:38 +02:00
|
|
|
$this->redirect(array('controller' => 'allowedlists', 'action' => 'index', 'admin' => false));
|
2018-07-19 11:48:22 +02:00
|
|
|
}
|
|
|
|
$this->AdminCrud->adminEdit($id);
|
2021-04-29 15:42:05 +02:00
|
|
|
$this->set('action', 'edit');
|
|
|
|
$this->set('id', $id);
|
|
|
|
$this->render('admin_add');
|
2018-07-19 11:48:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public function admin_delete($id = null)
|
|
|
|
{
|
|
|
|
if (!$this->userRole['perm_regexp_access']) {
|
2020-09-01 15:59:38 +02:00
|
|
|
$this->redirect(array('controller' => 'allowedlists', 'action' => 'index', 'admin' => false));
|
2018-07-19 11:48:22 +02:00
|
|
|
}
|
|
|
|
$this->AdminCrud->adminDelete($id);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function index()
|
|
|
|
{
|
|
|
|
$this->recursive = 0;
|
|
|
|
$this->set('list', $this->paginate());
|
|
|
|
}
|
2016-06-06 10:09:55 +02:00
|
|
|
}
|