Example #1
0
 protected function check_csrf()
 {
     $key = ConnectorSecurity::checkCSRF($this->editing);
     if ($key !== "") {
         $this->add_top_attribute(ConnectorSecurity::$security_var, $key);
     }
 }
Example #2
0
 protected function parse_request()
 {
     //set default dyn. loading params, can be reset in child classes
     if ($this->dload) {
         $this->request->set_limit(0, $this->dload);
     } else {
         if ($this->limit) {
             $this->request->set_limit(0, $this->limit);
         }
     }
     if (isset($_GET["posStart"]) && isset($_GET["count"])) {
         $this->request->set_limit($_GET["posStart"], $_GET["count"]);
     }
     $this->parse_request_mode();
     if ($this->live_update && ($this->updating || $this->editing)) {
         $this->request->set_version($_GET["dhx_version"]);
         $this->request->set_user($_GET["dhx_user"]);
     }
     if (isset($_GET[Connector::$sort_var])) {
         foreach ($_GET[Connector::$sort_var] as $k => $v) {
             $k = $this->safe_field_name($k);
             $this->request->set_sort($this->resolve_parameter($k), $v);
         }
     }
     if (isset($_GET[Connector::$sort_var])) {
         foreach ($_GET[Connector::$filter_var] as $k => $v) {
             $k = $this->safe_field_name($k);
             $this->request->set_filter($this->resolve_parameter($k), $v);
         }
     }
     $key = ConnectorSecurity::checkCSRF($this->editing);
     if ($key !== "") {
         $this->add_top_attribute(ConnectorSecurity::$security_var, $key);
     }
 }
Example #3
0
 protected function parse_request()
 {
     if (isset($_GET['action'])) {
         $action = $_GET['action'];
         //simple request mode
         if ($action == "get") {
             //data request
             if (isset($_GET['id'])) {
                 //single entity data request
                 $this->request->set_filter($this->config->id["name"], $_GET['id'], "=");
             } else {
                 //loading collection of items
             }
         } else {
             //data saving
             $this->editing = true;
         }
     } else {
         if (isset($_GET["dhx_colls"])) {
             $this->fill_collections($_GET["dhx_colls"]);
         }
         if (isset($_GET['editing']) && isset($_POST['ids'])) {
             $this->editing = true;
         }
         parent::parse_request();
     }
     if (isset($_GET["start"]) && isset($_GET["count"])) {
         $this->request->set_limit($_GET["start"], $_GET["count"]);
     }
     $key = ConnectorSecurity::checkCSRF($this->editing);
     if ($key !== "") {
         $this->add_top_attribute("dhx_security", $key);
     }
 }