Beispiel #1
0
<?php

require_once '../classes/domains/Users.php';
require_once '../classes/domains/Challenge.php';
$cookieHash = isset($_COOKIE['eggmatters_com']) ? $_COOKIE['eggmatters_com'] : null;
$userName = "";
Challenge::getAuthenticationToken();
if (!is_null($cookieHash)) {
    $userObj = Users::getUserByCookie($cookieHash);
    if (!is_a($userObj, 'ErrorObject')) {
        $userName = $userObj[0]->userName;
    }
}
if (!isset($userName) || $userName != "eggmatters") {
    $host = $_SERVER['HTTP_HOST'];
    $uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
    $extra = 'index.php';
    header("Location: http://{$host}{$uri}/{$extra}");
}
header('Cache-Control: private, no-cache, max-age=0, must-revalidate');
header('Expires: ' . date('r'));
?>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Eggmatters.com</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">