<?php
header("HTTP/1.0 404 Not Found");
exit;
// boot application
define("RelativePath", "../../../..");
define("PathToCurrentPage", "/core.sym/fe/custom/stap");
define("FileName", "wandelwaaier.php");
include(RelativePath . "/Common.php");

// Controle IP adres
$heeftToegang = DsLabel::controleerIpBezoeker();
if (!$heeftToegang) {
    die('U heeft geen toegang tot deze pagina.');
}

// Controle wachtwoord
DsLabel::controleerBeveligdLabelSessieMetRedirect();

//the domain name on which the landingpage runs, without www.
$domainNameFull = DsLabel::getActiveLabelDomain(false);
$domainArray = explode(".", $domainNameFull);
if (array_key_exists(0, $domainArray)) {
    unset($domainArray[0]);
}
$domainName = implode(".", $domainArray);

$toururl = array_key_exists('url', $_GET) ? $_GET['url'] : null;

header("X-Robots-Tag: noindex, nofollow", true);

if (is_null($toururl)) {
    header('Location: ' . rtrim(PageGlobals::getProtocol() . $domainNameFull, '/') . '/', true, 302);
    exit;
}

CCSetCookie('wawa', 1, time() + 60*60*24*100, false, $domainName);
header('Location: ' . ltrim($toururl, '/'), true, 302);