Beispiel #1
0
} elseif (mysql_select_db('kdevelop_db') == false) {
    $http_status_code = 503;
} else {
    // delete the login and password variables for safety reasons
    unset($k_login);
    unset($k_password);
    // Use the bad behavior mediawiki extension to protect the website (with DB support)
    //require_once('mediawiki/extensions/bad-behavior2/bad-behavior-kdevelop-with-db.php');
    // Count the hits of bad behaved robots
    // and forbid them to do many requests on a row
    $http_status_code = protect_against_bad_robots($http_status_code, $timeout_minutes, $bad_hits_treshold, $trapped_treshold);
    // Update the website statistics of the visited pages
    update_stats_pages($filename, $lang, $http_status_code);
}
// Send an error page if required
send_error_page($http_status_code);
// Set a language cookie if $set_lang was passed in the URI this will
// allow the server to remember which language the user choose for future visits.
// This should only be done after sending all the header() commands
if (!empty($set_lang)) {
    setCookie('lang', $set_lang, time() + 31536000, '/', '', 0);
}
// Set navmenu if $set_navmenu was passed in the URI
if (!empty($set_navmenu)) {
    // This has to be done this way to make sure that $navmenu can only be 'user' or 'developer'
    if ($set_navmenu == 'user') {
        $navmenu = 'user';
    } else {
        $navmenu = 'developer';
    }
}
Beispiel #2
0
    echo "<html><head><meta http-equiv=\"refresh\" content=\"0; url={$_SESSION["AUTHENTICATOR_REDIRECT"]}\" />\n\t</head><body></body></html>";
    unset($_SESSION["AUTHENTICATOR_REDIRECT"]);
    return;
}
if (isset($_GET["results-page"])) {
    if ($GLOBALS["DEBUG"]) {
        Debuglogs("-> results-page", __FUNCTION__, __LINE__);
    }
    send_result_page();
    exit;
}
if (isset($_GET["error-page"])) {
    if ($GLOBALS["DEBUG"]) {
        Debuglogs("-> error-page", __FUNCTION__, __LINE__);
    }
    send_error_page();
    exit;
}
if (isset($_GET["pageid"])) {
    if ($GLOBALS["DEBUG"]) {
        Debuglogs("-> send_pageid", __FUNCTION__, __LINE__);
    }
    send_pageid();
    exit;
}
$sesskey = $_GET["sesskey"];
$time = sessiontime();
if ($time < $_GET["cachetime"] + 1) {
    Debuglogs("{$_SESSION[$sesskey]["AUTHENTICATOR_UID"]} Cached {$time}mn < {$_GET["cachetime"]}Mn", __FUNCTION__, __LINE__);
    header("HTTP/1.0 200 OK");
    die;