// find orphaned WMS
$invalidIdsArray = $wmcGetApi->getInvalidWms();
$invalidIdsTitles = array();
foreach ($invalidIdsArray as $i) {
    $invalidIdsTitles[] = array("id" => $i["id"], "index" => $i["index"], "title" => $i["title"]);
}
$resultObj["invalidId"]["wms"] = array_merge($resultObj["invalidId"]["wms"], $invalidIdsTitles);
// find potentially unavailable WMS
$unavailableIdsArray = $wmcGetApi->getUnavailableWms($currentUser);
$unavailableIdsTitles = array();
foreach ($unavailableIdsArray as $i) {
    $unavailableIdsTitles[] = array("id" => $i["id"], "index" => $i["index"], "title" => $i["title"]);
}
$resultObj["unavailable"]["wms"] = array_merge($resultObj["unavailable"]["wms"], $unavailableIdsTitles);
//get terms of use from wms objects which are in the remaining wmc and are not already accepted for this session
$validWMS = $wmcGetApi->getValidWms();
$translation['wms'] = _mb("MapService");
$resourceSymbol = "<img src='../img/osgeo_graphics/geosilk/server_map.png' alt='" . $translation['wms'] . " - picture' title='" . $translation['wms'] . "'>";
$languageCode = 'de';
$hostName = $_SERVER['HTTP_HOST'];
$tou = "";
$classTou = new tou();
foreach ($validWMS as $WMS) {
    //check if tou has already been read - if not show them in the message
    $resultOfCheck = $classTou->check('wms', $WMS['id']);
    if ($resultOfCheck['accepted'] == 0) {
        $touHeader = $resourceSymbol . " <a href='../php/mod_showMetadata.php?resource=wms&layout=tabs&id=" . $WMS['id'] . "&languageCode=" . $languageCode . "' target='_blank'>" . $WMS['title'] . "</a><br>";
        if (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") {
            $mapbenderProtocol = "https://";
            $mapbenderBaseUrl = "https://" . $hostName;
        } else {