'; ?> deleteWMS isValidEmail($_POST["replyto"])) { $error_msg .= "The reply-to address is not valid! Please correct it."; } else { $toAddr = array(); $toName = array(); $namesAndAddresses = explode(":::" , $_POST["owners"]); for ($i=0; $isendEmail($_POST["replyto"], $_POST["from"], $toAddr[$i], $toName[$i], "[Mapbender] A user has suggested a WMS for deletion", $_POST["comment"], $error)) { if ($error) { $error_msg .= $error . " "; } } } if (!$error_msg) { echo ""; } } } // if deletion has been suggested, or there's an error in the form, display mail form (again) if ($_POST["suggest"] || $error_msg){ if ($error_msg) { echo ""; } $wms = $_POST["wms_name"]; if (!$_POST["from"]) $fromName = $_SESSION["mb_user_name"]; else $fromName = $_POST["from"]; if (!$_POST["replyto"]) $email = $admin->getEmailByUserId($_SESSION["mb_user_id"]); else $email = $_POST["replyto"]; if (!$_POST["comment"]) $text = "The WMS " . $wms . " has been suggested for deletion. If you agree, remove it from your GUIs. If not, you can contact the user who suggested the deletion and discuss it."; else $text = $_POST["comment"]; echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
Your name:
Reply-To:
Comment:
"; echo ""; echo "
"; } else { // delete WMS if($del){ $sql = "select * from gui_wms where fkey_wms_id = $1 "; $v = array($wmsList); $t = array('i'); $res = db_prep_query($sql,$v,$t); $cnt = 0; while($row = db_fetch_array($res)) { $sql = "UPDATE gui_wms set gui_wms_position = (gui_wms_position -1) "; $sql .= "WHERE fkey_gui_id = $1 "; $sql .= " AND gui_wms_position > $2 "; $v = array($row["fkey_gui_id"],$row["gui_wms_position"]); $t = array('s','i'); $res1 = db_prep_query($sql,$v,$t); $cnt++; } $sql = "DELETE FROM wms WHERE wms_id = $1"; $v = array($wmsList); $t = array('i'); $res = db_prep_query($sql,$v,$t); } // display WMS List $wms_id_own = $admin->getWmsByOwner($_SESSION["mb_user_id"],true); if (count($wms_id_own)>0){ $v = array(); $t = array(); $sql = "Select * from wms WHERE wms_id IN ("; for($i=0; $i0){ $sql .= ",";} $sql .= "$".($i+1); array_push($v,$wms_id_own[$i]); array_push($t,'i'); } $sql .= ") ORDER BY wms_title"; $res = db_prep_query($sql,$v,$t); $cnt = 0; echo "
"; echo "
"; // // // If WMS is selected, show more info // // if($wmsList) { echo "

"; // Show GUIs using chosen WMS $sql = "SELECT fkey_gui_id FROM gui_wms WHERE fkey_wms_id = $1"; $v = array($wmsList); $t = array('i'); $res = db_prep_query($sql,$v,$t); // show WMS-ID for better identifiability echo "WMS-ID " . $wmsList . " is used in the following applications:

"; $cnt = 0; while($row = db_fetch_array($res)) { echo "- " . $row["fkey_gui_id"]."
"; $cnt++; } if ($cnt == 0) { echo "- none -
"; } // Show GetCapabilities of chosen WMS $sql = "SELECT wms_getcapabilities FROM wms WHERE wms_id = $1"; $v = array($wmsList); $t = array('i'); $res = db_prep_query($sql,$v,$t); echo "

GetCapabilities

"; $cnt = 0; while($row = db_fetch_array($res)) { echo $row["wms_getcapabilities"]."
"; $cnt++; } // Show Abstract of Chosen WMS $sql = "SELECT wms_abstract FROM wms WHERE wms_id = $1"; $v = array($wmsList); $t = array('i'); $res = db_prep_query($sql,$v,$t); echo "

Abstract

"; $cnt = 0; while($row = db_fetch_array($res)) { echo $row["wms_abstract"]."
"; $cnt++; } echo "

Owner:

"; $owner = $admin->getOwnerByWms($wmsList); if ($owner && count($owner)>0) { for($i=0; $igetUserNameByUserId($owner[$i])."
"; } } else echo "- none -"; echo "

"; //previously, a WMS could only be deleted if it was owned by a single owner //if(count($owner)==1 && $owner[0] == $_SESSION["mb_user_name"]){ //now, any owner can delete, any non-owner can suggest deletions //if a wms has no owner, anyone can delete if($owner && in_array($_SESSION["mb_user_id"], $owner) && count($owner) == 1) { echo ""; } elseif ($owner && in_array($_SESSION["mb_user_id"], $owner) && count($owner) > 1) { // delete suggestion button only appears when mailing is enabled in mapbender.conf if ($use_php_mailing) { // prepare email-addresses and usernames of all owners $owner_ids = $owner; $owner_mail_addresses = array(); $email_str = ''; $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; $email_str .= $owner_mail_addresses[$j] . ";;;" . $owner[$i] . ":::"; $j++; } } print_r($owner_ids); print_r($owner_mail_addresses); echo ""; } else { echo ""; } } } }else{ echo "There are no wms available for this user.
"; } } ?> "; ?>