// get upload URL
 $sql = "SELECT wms_upload_url, wms_owner FROM wms WHERE wms_id = \$1";
 $v = array($upd_wmsid);
 $t = array("i");
 $res = db_prep_query($sql, $v, $t);
 $row = db_fetch_array($res);
 $uploadUrl = $row["wms_upload_url"];
 $wmsOwner = $row["wms_owner"];
 if ($wmsOwner !== $user->id) {
     echo "<br>Skipped: " . $upd_wmsid . "<br>";
     continue;
 }
 // update WMS from upload URL
 $mywms = new wms();
 $mywms->createObjFromXML($uploadUrl);
 $mywms->optimizeWMS();
 echo "<br />";
 $mywms->updateObjInDB($upd_wmsid);
 echo "<br>Updated: " . $upd_wmsid . "<br>";
 /*
 		// start new monitoring for this WMS
 		$now = time();
 		$sql = "UPDATE mb_monitor SET status = '-2', status_comment = 'Monitoring is still in progress...', " . 
 			"timestamp_begin = $1, timestamp_end = $2 WHERE upload_id = $3 AND fkey_wms_id = $4";
 		$v = array($now, $now, $upload_id, $upd_wmsid);
 		$t = array('s', 's', 's', 'i');
 		$res = db_prep_query($sql,$v,$t);
 
 		$currentFilename = "wms_monitor_report_" . $upload_id . "_" . 
 			$upd_wmsid . "_" . $wmsOwner . ".xml";		
 		$exec = PHP_PATH . "php5 ../../tools/mod_monitorCapabilities_write.php " .