]*>)(.*)()"; $replacement = "\\1\\2" . $element_name . "" . $user . "\\3"; $filter = mb_eregi_replace($pattern, $replacement, $filter); } else { $e = new mb_exception("mod_wfs_gazetteer_server: checkAccessConstraint: invalid value of variable containing user information!"); } } else { $e = new mb_exception("mod_wfs_gazetteer_server: checkAccessConstraint: var name is not valid! (" . $auth_varname . ")"); } } return $filter; } if ($command == "getWfsConf") { $wfsConfIdString = $_GET["wfsConfIdString"]; if ($wfsConfIdString != "") { //array_keys(array_flip()) produces an array with unique entries $wfsConfIdArray = array_keys(array_flip(mb_split(",", $wfsConfIdString))); } else { echo "please specify wfs conf id."; die(); } $obj = new WfsConf(); $obj->load($wfsConfIdArray); $json = new Mapbender_JSON(); $output = $json->encode($obj->confArray); echo $output; } else if ($command == "getSearchResults") { $wfs_conf_id = $_REQUEST["wfs_conf_id"]; $backlink = $_REQUEST["backlink"]; $frame = $_REQUEST["frame"]; $filter = $_REQUEST["filter"]; $url = $_REQUEST["url"]; $typename = $_REQUEST["typename"]; $wfsConf = WfsConfiguration::createFromDb($wfs_conf_id); if (is_null($wfsConf)) { sendErrorMessage("Invalid WFS conf: " . $wfs_conf_id); } $admin = new administration(); $filter = $admin->char_decode(stripslashes($filter)); $wfsId = $wfsConf->wfsId; $myWfsFactory = new UniversalWfsFactory(); $myWfs = $myWfsFactory->createFromDb($wfsId); $data = $myWfs->getFeature($typename, $filter); if ($data === null) die('{}'); // $geomColumn = WfsConf::getGeomColumnNameByConfId($wfs_conf_id); $gmlFactory = new UniversalGmlFactory(); $myGml = $gmlFactory->createFromXml($data, $wfsConf); $geoJson = $myGml->toGeoJSON(); header("Content-type:application/x-json; charset=utf-8"); echo $geoJson; } else { echo "please enter a valid command."; } ?>