xxb/module/restriction/control.php
2023-10-23 15:51:36 +08:00

21 lines
575 B
PHP

<?php
class restriction extends control
{
public function index($type = 'view')
{
if(!empty($_POST))
{
$result = $this->restriction->setConfiguration($_POST);
$this->send($result);
}
$restriction = $this->restriction->getConfiguration();
$this->view->type = $type;
$this->view->enabled = isset($restriction->enabled) ? $restriction->enabled : false;
$this->view->cidrs = isset($restriction->cidrs) ? explode(',', $restriction->cidrs) : array();
$this->display();
}
}