getWmsByWmsOwner($_SESSION["mb_user_id"]); #need admin functions: getWmsLogTag, getWmsPrice, setWmsLogTag, setWmsPrice #can set log only when proxy on, can set price only when log on #read out the request function array2str($array, $pre = '', $pad = '', $sep = ', ') { $str = ''; if(is_array($array)) { if(count($array)) { foreach($array as $v) { $str .= $pre.$v.$pad.$sep; } $str = substr($str, 0, -strlen($sep)); } } else { $str .= $pre.$array.$pad; } return $str; } function validateint($inData) { $intRetVal = 0; $IntValue = intval($inData); $StrValue = strval($IntValue); if($StrValue == $inData) { $intRetVal = $IntValue; } return $intRetVal; } if(isset($_REQUEST["save"])){ #if(isset($_REQUEST["wms_id"]) && isset($_REQUEST["status"])){ #$admin->setWMSOWSstring(intval($_REQUEST["wms_id"]),$_REQUEST["status"]); #print_r($_POST); #TODO deactivate proxy, logs and prices for all owned wms #TODO #$wms_list=array2str($ownwms); #print $wms_list; //$admin->unsetWmsProxy($wms_list);#TODO not delete owsproxy urls but update each entry! -> this would not delete log or usage of proxy!!! #serialize ownwms - to list and do sql #for the definitions in the form set the params #sequentialy read out the post variables if(isset($_POST["save"])) { } foreach ($_POST as $var => $value) { //select those which are relevant (hidden fields for proxy and log) //identify them $parts=explode("_",$var); //echo "All vars:
"; //echo $var." = ".$value."
"; $value=validateint($value); //test exchanging urls conf if ($parts[0] == 'status' && $parts[2] == 'exchange') { $admin->setWmsExchangeUrlTag(intval($parts[1]), $value); } //changing price information if ($parts[0] != 'status' && $parts[2]=='price'){ //for the pricing in the textfield if($parts[0] == "wms") { $admin->setWmsPrice(intval($value),intval($parts[1])); } else if($parts[0] == "wmsfi") { $admin->setWmsfiPrice(intval($value),intval($parts[1])); } } //check the hidden fields if some log should be set if (($parts[2]=='log' || $parts[2]=='logfi') && $parts[0]=='status'){ //set the log value to 1 or 0 if($parts[2]=='log') { $admin->setWmsLogTag(intval($parts[1]),$value); } else if($parts[2]=='logfi'){ $admin->setWmsfiLogTag(intval($parts[1]),$value); } //if value is 0 then set the price to 0 to. there would be is no sense to have a price set - maybe change this behavior if ($value==0) { if($parts[2]=='log'){ $admin->setWmsPrice(intval($value),intval($parts[1])); } else if($parts[2]=='logfi'){ $admin->setWmsfiPrice(intval($value),intval($parts[1])); } } //echo "log: $var = $value
"; } //check proxy fields if ($parts[0]=='status' && $parts[2]=='proxy'){ //echo ("proxy settings identified: WMS_ID: ".intval($parts[1])." Value: ".$value."
"); //echo ("Is active?: "); //if ($admin->getWMSOWSstring(intval($parts[1]))=="") {echo " no";} else {echo " yes";} //echo ("
"); //check if proxy should be activated and is not set if ($value==1 && $admin->getWMSOWSstring(intval($parts[1])) == "") { //activate it! $admin->setWMSOWSstring(intval($parts[1]),$value); //echo "Activate Proxy for ".intval($parts[1])."
"; } //check if active proxy should be deactivated if ($value==0 && $admin->getWMSOWSstring(intval($parts[1])) !== "") { //deactivate it $admin->setWMSOWSstring(intval($parts[1]),$value); //echo "Deactivate Proxy for ".intval($parts[1])."
"; } } } } ?> '; ?> OWS Security Proxy Warning: Toggle proxy changes the url of the secured services!
"; //read out infos from database for($i=0; $igetWMSOWSstring($ownwms[$i]) == false){ $status_proxy = 0 ;} else {$status_proxy = 1;}; //check for exchange urls conf if($admin->getWmsExchangeUrlTag($ownwms[$i]) == false){ $status_exchange_urls = 0 ;} else {$status_exchange_urls = 1;}; if($admin->getWmsLogTag($ownwms[$i]) == 1){$status_log=1;} else {$status_log=0;}; if ($admin->getWmsPrice($ownwms[$i]) != 0 ){$status_price=$admin->getWmsPrice($ownwms[$i]);} else {$status_price=0;}; if($admin->getWmsfiLogTag($ownwms[$i]) == 1){$status_logfi=1;} else {$status_logfi=0;}; if ($admin->getWmsfiPrice($ownwms[$i]) != 0 ){$status_price_fi=$admin->getWmsfiPrice($ownwms[$i]);} else {$status_price_fi=0;}; $auth=$admin->getAuthInfoOfWMS($ownwms[$i]); if($auth['auth_type'] == ''){$status_auth = 0;} else {$status_auth = 1;}; echo ""; echo ""; echo "".$admin->getWmsTitleByWmsId($ownwms[$i]).""; //for owsproxy activation************************************************************************************************ echo ""; //for exchange urls************************************************************************************************ echo ""; #for logging************************************************************************************************ echo ""; #for pricing************************************************************************************************ echo ""; #for wmsfi logging************************************************************************************************ echo ""; #for fi pricing************************************************************************************************ echo ""; if($status_log == 1 || $status_logfi == 1){ echo ""; } echo ""; } echo "
WMS ID WMS Title Proxy Exchange URLs GetMap Log GetMap Price(cent/Mpixel) GetFeatureInfo Log GetFeatureInfo Price(cent/Aufruf) Show detailed Usage
".$ownwms[$i].""; echo ""; #initialize hidden field for status proxy: echo ""; echo ""; //initialize hidden field for status exchange urls echo ""; echo " to activate echo ">"; #initialize hidden field for status log: echo ""; echo "getWmsPrice($ownwms[$i]) != 0){ echo "disabled"; } echo ">"; #initialize hidden field for status price: echo ""; echo " to activate echo ">"; #initialize hidden field for status log: echo ""; echo "getWmsPrice($ownwms[$i]) != 0){ echo "disabled"; } echo ">"; #initialize hidden field for status price: echo ""; echo "
"; echo "
"; echo "
Service with authentication information
"; echo ""; ?>