0){ $sql .= ",";}
$sql .= "$".$c;
array_push($v,$wms_id_own[$i]);
array_push($t,'i');
$c++;
}
}
//$sql .= ")";
//select has been adopted for showing metadata
$sql .= ") AND wms.wms_id=layer.fkey_wms_id and layer.layer_pos=0";
$sql .= " ORDER BY wms_title";
$res = db_prep_query($sql,$v,$t);
$cnt = 0;
echo "
";
?>
view wms metadata: no WMS selected
";
echo "Link to the last uploaded Online Resource URL:
";
//new for HTTP Authentication
echo "
";
echo "Add the following REQUEST to the Online Resource URL to obtain the Capabilities document:
";
echo "(Triple click to select and copy)
";
echo "REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.1
";
echo "REQUEST=GetCapabilities&SERVICE=WMS&VERSION=1.1.0
";
echo "REQUEST=capabilities&WMTVER=1.0.0
";
//new for HTTP Authentication
//echo "Link to new WMS Capabilities URL:
";
echo "HTTP Authentication:
";
echo " None
";
echo " Digest
";
echo " Basic
";
echo " Keep old values
";
echo "";
echo "";
echo "";
echo "
";
echo "";
echo "Username :
";
echo "Password :
";
echo "
";
echo "Link to new WMS Capabilities URL:
";
//new for HTTP Authentication
echo " ";
//new for HTTP Authentication
//echo "
";
echo " ";
echo "
";
//new for HTTP Authentication
if(isset($myURL) && $myURL != ''){
//new for HTTP Authentication
//$mywms = new wms();
//$mywms->createObjFromXML($myURL);
/*$imrAuthName = !empty($_POST['imrAuthName']) ? $_POST['imrAuthName'] : '';
$imrAuthPassword = !empty($_POST['imrAuthPassword']) ? $_POST['imrAuthPassword'] : '';
$imrHttpAuth = !empty($_POST['imrHttpAuth']) ? $_POST['imrHttpAuth'] : '';*/
$mywms = new wms();
if (in_array($imrHttpAuth, array('basic','digest'))) {
$auth = array();
$auth['username'] = $imrAuthName;
$auth['password'] = $imrAuthPassword;
$auth['auth_type'] = $imrHttpAuth;
$mywms->createObjFromXML($myURL, $auth);
} elseif ($imrHttpAuth == 'keep') {
$auth = array();
$auth['username'] = $imrOldAuthName;
$auth['password'] = $imrOldAuthPasswword;
$auth['auth_type'] = $imrOldAuthType;
$mywms->createObjFromXML($myURL, $auth);
} else {
$mywms->createObjFromXML($myURL);
}
//new for HTTP Authentication
$mywms->optimizeWMS();
echo "
";
if (!MD_OVERWRITE) {
$mywms->overwrite=false;
//new for HTTP Authentication
//}
//$mywms->updateObjInDB($myWMS);
}
if ($imrHttpAuth != 'none') {
$mywms->updateObjInDB($myWMS, $auth);
} else {
$mywms->updateObjInDB($myWMS);
}
//new for HTTP Authentication
$mywms->displayWMS();
//if changes are made here for wms, unlink the application cache file in cache directory
$sql = "SELECT fkey_gui_id FROM gui_wms WHERE fkey_wms_id = $1";
$v = array($myWMS);
$t = array('i');
$res = db_prep_query($sql,$v,$t);
while($row = db_fetch_array($res)){
$admin->clearJsCacheFile($row["fkey_gui_id"]);
}
// start (owners of the updated wms will be notified by email)
if ($use_php_mailing) {
$owner_ids = $admin->getOwnerByWms($myWMS);
if ($owner_ids && count($owner_ids)>0) {
$owner_mail_addresses = array();
$j=0;
for ($i=0; $igetEmailByUserId($owner_ids[$i]);
if (!in_array($adr_tmp, $owner_mail_addresses) && $adr_tmp) {
$owner_mail_addresses[$j] = $adr_tmp;
$j++;
}
}
$replyto = $admin->getEmailByUserId(Mapbender::session()->get("mb_user_id"));
$from = $replyto;
$pathArray = explode("http/php/", $_SERVER["PATH_TRANSLATED"]);
$path = $pathArray[0];
$body = "WMS '" . $admin->getWmsTitleByWmsId($myWMS) . "' has been updated. \n\nServer name: " . $_SERVER["SERVER_NAME"] . "\nInstallation Path: " . $path . "\n\nYou may want to check the changes as you are an owner of this WMS.";
$error_msg = "";
for ($i=0; $isendEmail($replyto, $from, $owner_mail_addresses[$i], $owner_mail_addresses[$i], "[Mapbender] A user has updated one of your WMS", $body, $error)) {
if ($error){
$error_msg .= $error . " ";
}
}
}
if (!$error_msg) {
echo "";
}
else {
echo "";
}
}
}
// end (owners of the updated wms will be notified by email)
}
echo "