Example #1
0
define("DATABASE_DPS_USER", $local_config["DB_USER"]);
@define("DATABASE_DPS_PASS", $local_config["DB_PASS"]);
session_start();
Errors::start();
if (!function_exists('http_response_code')) {
    function http_response_code($code = NULL)
    {
        header(':', true, $code);
    }
}
if (!Session::is_user() && (substr(LINK_FILE, 0, 4) == "ajax" && LINK_FILE != "ajax/login.php")) {
    http_response_code(403);
    exit(json_encode(array("error" => "Your session has timed out, or you have logged out in another tab. Please log in again.")));
}
if (substr(LINK_FILE, 0, 6) == "studio") {
    MainTemplate::set_barebones(true);
    if (isset($_REQUEST["key"])) {
        if (is_null(Locations::get_by_key($_REQUEST["key"]))) {
            exit("Sorry, you provided an invalid security key.");
        }
    } else {
        Output::require_user();
    }
}
if (LINK_FILE != "index.php" && LINK_FILE != "ajax/login.php" && substr(LINK_FILE, 0, 6) != "studio" && substr(LINK_FILE, 0, 5) != "audio") {
    Output::require_user();
}
if (Session::is_developer()) {
    ini_set("display_errors", "1");
    ini_set("display_startup_errors", "1");
    ini_set("html_errors", "1");