logClientUsage($_SERVER['HTTP_REFERER'], $wmcid, 2);
}
}
//Parameter zur Deaktivierung der Höhenabfrage
if (isset($_REQUEST["withHeight"]) & $_REQUEST["withHeight"] != "") {
//validate true
$testMatch = $_REQUEST["withHeight"];
if (!($testMatch == '1' or $testMatch == '0')){
echo 'Parameter withHeight is not valid (1,0).
';
die();
}
if ($testMatch == '0') {
$withHeight = 'false';
} else {
$withHeight = 'true';
}
$testMatch = NULL;
}
//LayerId Anfrage Mapbendermodul
if (isset($_GET['layerid'])) {
$layerid = htmlspecialchars($_GET["layerid"]);
}
//Validate parameters for zooming to special extent for WMC
if(isset($_REQUEST["mb_myBBOX"]) && $_REQUEST["mb_myBBOX"] != ""){
//Check for numerical values for BBOX
$array_bbox = explode(',',$_REQUEST["mb_myBBOX"]);
if ((is_numeric($array_bbox[0])) and (is_numeric($array_bbox[1])) and (is_numeric($array_bbox[2])) and (is_numeric($array_bbox[3])) ) {
$mb_myBBOX = $_REQUEST["mb_myBBOX"];
if(isset($_REQUEST["mb_myBBOXEpsg"])){
//Check epsg
$targetEpsg=intval($_REQUEST["mb_myBBOXEpsg"]);
if (($targetEpsg >= 1) and ($targetEpsg <= 50001)) {
#echo "is in the codespace of the epsg registry\n";
$mb_myBBOXEpsg = $targetEpsg;
} else {
#echo "is outside\n";
echo 'The REQUEST parameter mb_myBBOXEpsg is not in the epsg realm - please define another EPSG Code.';
die();
}
}
} else {
echo "The REQUEST parameters for mb_myBBOX are not numeric - please give numeric values!";
die();
}
}
//SP: Content data from url TODO - exchange with mapbender class!
function get_data($url)
{
$connector = new connector($url);
return $connector->file;
}
//SP: Feature Url Validierung
function feature_valid($feature_url)
{
$myhtml = get_data($feature_url);
// get body von featureinfo
$DOM = new DOMDocument;
@$DOM->loadHTML($myhtml);
$items = $DOM->getElementsByTagName('body');
$controlstring = "false";
for ($i = 0; $i < $items->length; $i++)
{
$controlstring = $items->item($i)->nodeValue;
}
$controlstring = trim($controlstring);
$controlstring = str_replace("\t", '', $controlstring);
if (strpos($myhtml, 'Mb2OWSPROXY') !== false) {
exit("Mb2OWSPROXY\n");
}
if (strlen($controlstring) > 80)
{
exit("true\n");
}
exit("false\n");
}
//SP: JS Interface
if (isset($_POST['feature_url']))
{
feature_valid($_POST['feature_url']);
}
?>