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 "
";
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
";
echo "HTTP Authentication:
";
echo " None
";
echo " Digest
";
echo " Basic
";
echo " Keep old values
";
echo "";
echo "";
echo "";
echo "";
echo "
";
echo "";
echo "Username :
";
echo "Password :
";
echo "
";
echo "Link to new WMS Capabilities URL:
";
echo""._mb('Harvest/update dataset metadata by following existing MetadataURL tags in the capabilities')."
";
if (defined("TWITTER_NEWS") && TWITTER_NEWS == true) {
echo"Publish via Twitter
";
}
if (defined("GEO_RSS_FILE") && GEO_RSS_FILE != "") {
echo"Publish via RSS
";
}
if (!MD_OVERWRITE) {
echo"Overwrite edited metadata - all changes wich are made via metadata editor will be lost!
";
} else {
echo"Overwrite edited metadata - all changes wich are made via metadata editor will be lost!
";
}
echo"Overwrite layer categories with categories from service (maybe avaiable from wms 1.3.0+)
";
echo"
";
echo " ";
echo " ";
echo "
";
if(isset($myURL) && $myURL != ''){
$mywms = new wms();
if (in_array($imrHttpAuth, array('basic','digest'))) {
$auth = array();
$auth['username'] = $imrAuthName;
$auth['password'] = $imrAuthPassword;
$auth['auth_type'] = $imrHttpAuth;
$result = $mywms->createObjFromXML($myURL, $auth);
} elseif ($imrHttpAuth == 'keep') {
$auth = array();
$auth['username'] = $imrOldAuthName;
$auth['password'] = $imrOldAuthPasswword;
$auth['auth_type'] = $imrOldAuthType;
$result = $mywms->createObjFromXML($myURL, $auth);
} else {
$result = $mywms->createObjFromXML($myURL);
}
if (!$result['success']) {
echo $result['message'];
die();
}
$mywms->optimizeWMS();
echo "
";
//if (!MD_OVERWRITE) {
if(empty($_POST['overwrite_md'])) {
$mywms->overwrite=false;
} else {
$mywms->overwrite=true;
}
if(empty($_POST['harvest_dataset_metadata'])) {
$mywms->harvestCoupledDatasetMetadata = false;
}
//possibility to see update information in georss and/or twitter channel
if(empty($_POST['twitter_news'])) {
$mywms->twitterNews = false;
}
if(empty($_POST['rss_news'])) {
$mywms->setGeoRss = false;
}
if(empty($_POST['overwrite_categories'])) {
$mywms->overwriteCategories = false; //- is default for class_wms.php
} else {
$mywms->overwriteCategories = true;
}
//set values for default variables -> 4 parameters for authenticated services 3 for services without authentication - no metadataUpdate = false, changedLayers = null
if ($imrHttpAuth != 'none') {
$mywms->updateObjInDB($myWMS,false,null,$auth);
} else {
$mywms->updateObjInDB($myWMS);
}
echo "";
$mywms->displayWMS();
echo "
";
// start (owners and subscribers of the updated wms will be notified by email)
if (defined("NOTIFY_ON_UPDATE") && NOTIFY_ON_UPDATE == true) {
//collect change information
$layerChangeInformation = "";
for ($j=0; $jgetOwnerByWms($myWMS);
//get information for subscribers
$subscribers_ids = $admin->getSubscribersByWms($myWMS);
//if some person exists which is interested in changing of wms information ;-)
if (($owner_ids && count($owner_ids)>0) || ($subscribers_ids && count($subscribers_ids)>0)) {
$notification_mail_addresses = array();
$j=0;
for ($i=0; $igetEmailByUserId($owner_ids[$i]);
if (!in_array($adr_tmp, $notification_mail_addresses) && $adr_tmp) {
$notification_mail_addresses[$j] = $adr_tmp;
$j++;
}
}
for ($i=0; $igetEmailByUserId($subscribers_ids[$i]);
if (!in_array($adr_tmp, $notification_mail_addresses) && $adr_tmp) {
$notification_mail_addresses[$j] = $adr_tmp;
$j++;
}
}
$replyto = $admin->getEmailByUserId(Mapbender::session()->get("mb_user_id"));
$from = $replyto;
$rootLayerId = getRootLayerId($myWMS);
//$e = new mb_exception(MAPBENDER_PATH);
if (defined("MAPBENDER_PATH") && MAPBENDER_PATH != '') {
$metadataUrl = MAPBENDER_PATH."/php/mod_showMetadata.php?resource=layer&id=".$rootLayerId;
} else {
$metadataUrl = preg_replace(
"/(.*)frames\/login.php/",
"$1php/mod_showMetadata.php?resource=layer&id=".$rootLayerId,
LOGIN
);
}
$path = $pathArray[0];
//Build mailbody
$body = _mb("WMS")." '" . $admin->getWmsTitleByWmsId($myWMS) . "' "._mb("has been updated").".\n\n".$metadataUrl. "\n\n"._mb("You may want to check the changes as you are an owner or subscriber of this WMS. If you have integrated the service into a gis client, you have to reconfigure the client!")."\n"._mb("Note: This e-mail has been sent automatically because you subscribed " . "to this service. You can unsubscribe by logging in and clicking the " . "unsubscribe button in the Mapbender metadata dialogue by following the given link.");
if (isset($layerChangeInformation) && $layerChangeInformation != "") {
$body .= "\n\n"._mb("Attention - following layers have been renamed").":\n".$layerChangeInformation;
}
$error_msg = "";
$e = new mb_exception("replyto: ". $replyto. " - from: ".$from);
for ($i=0; $isendEmail($replyto, $from, $notification_mail_addresses[$i], $notification_mail_addresses[$i], _mb("Update of an observed WMS"), utf8_decode($body), $error)) {
if ($error){
$error_msg .= $error . " ";
}
}
}
if (!$error_msg) {
echo "";
}
else {
echo "";
}
}
}
// end (owners and subscribers of the updated wms will be notified by email)
}
echo "