/**
  *
  * search remote blacklists
  * @return array
  */
 public function searchRemoteBlacklistsAction()
 {
     $this->sessionClose();
     // fetch query parameters
     $itemsPerPage = $this->request->getPost('rowCount', 'int', 9999);
     $currentPage = $this->request->getPost('current', 'int', 1);
     $sortBy = array("filename");
     $sortDescending = false;
     if ($this->request->hasPost('sort') && is_array($this->request->getPost("sort"))) {
         $sortBy = array_keys($this->request->getPost("sort"));
         if ($this->request->getPost("sort")[$sortBy[0]] == "desc") {
             $sortDescending = true;
         }
     }
     $searchPhrase = $this->request->getPost('searchPhrase', 'string', '');
     // create model and fetch query resuls
     $fields = array("enabled", "filename", "url", "description");
     $mdlProxy = new Proxy();
     $grid = new UIModelGrid($mdlProxy->forward->acl->remoteACLs->blacklists->blacklist);
     return $grid->fetch($fields, $itemsPerPage, $currentPage, $sortBy, $sortDescending, $searchPhrase);
 }
 /**
  *
  * search cron jobs
  * @return array
  */
 public function searchJobsAction()
 {
     if ($this->request->isPost()) {
         $this->sessionClose();
         // fetch query parameters
         $itemsPerPage = $this->request->getPost('rowCount', 'int', 9999);
         $currentPage = $this->request->getPost('current', 'int', 1);
         $sortBy = array("description");
         $sortDescending = false;
         if ($this->request->hasPost('sort') && is_array($this->request->getPost("sort"))) {
             $sortBy = array_keys($this->request->getPost("sort"));
             if ($this->request->getPost("sort")[$sortBy[0]] == "desc") {
                 $sortDescending = true;
             }
         }
         $searchPhrase = $this->request->getPost('searchPhrase', 'string', '');
         // create model and fetch query resuls
         $fields = array("enabled", "minutes", "hours", "days", "months", "weekdays", "description", "command", "origin", "cronPermissions");
         $mdlCron = new Cron();
         $grid = new UIModelGrid($mdlCron->jobs->job);
         return $grid->fetch($fields, $itemsPerPage, $currentPage, $sortBy, $sortDescending, $searchPhrase);
     } else {
         return array();
     }
 }
 /**
  * search captive portal zones
  * @return array
  */
 public function searchZonesAction()
 {
     if ($this->request->isPost()) {
         $this->sessionClose();
         // fetch query parameters
         $itemsPerPage = $this->request->getPost('rowCount', 'int', 9999);
         $currentPage = $this->request->getPost('current', 'int', 1);
         $sortBy = array("number");
         $sortDescending = false;
         if ($this->request->hasPost('sort') && is_array($this->request->getPost("sort"))) {
             $sortBy = array_keys($this->request->getPost("sort"));
             if ($this->request->getPost("sort")[$sortBy[0]] == "desc") {
                 $sortDescending = true;
             }
         }
         $searchPhrase = $this->request->getPost('searchPhrase', 'string', '');
         // create model and fetch query resuls
         $fields = array("enabled", "description", "zoneid");
         $mdlCP = new CaptivePortal();
         $grid = new UIModelGrid($mdlCP->zones->zone);
         return $grid->fetch($fields, $itemsPerPage, $currentPage, $sortBy, $sortDescending, $searchPhrase);
     } else {
         return array();
     }
 }
Exemple #4
0
 /**
  * search traffic shaper rules
  * @return array
  */
 public function searchRulesAction()
 {
     if ($this->request->isPost()) {
         $this->sessionClose();
         // fetch query parameters
         $itemsPerPage = $this->request->getPost('rowCount', 'int', 9999);
         $currentPage = $this->request->getPost('current', 'int', 1);
         $sortBy = array("sequence");
         $sortDescending = false;
         if ($this->request->hasPost('sort') && is_array($this->request->getPost("sort"))) {
             $sortBy = array_keys($this->request->getPost("sort"));
             if ($this->request->getPost("sort")[$sortBy[0]] == "desc") {
                 $sortDescending = true;
             }
         }
         $searchPhrase = $this->request->getPost('searchPhrase', 'string', '');
         // create model and fetch query resuls
         $fields = array("interface", "proto", "source", "destination", "description", "origin", "sequence", "target");
         $mdlShaper = new TrafficShaper();
         $grid = new UIModelGrid($mdlShaper->rules->rule);
         return $grid->fetch($fields, $itemsPerPage, $currentPage, $sortBy, $sortDescending, $searchPhrase);
     } else {
         return array();
     }
 }