コード例 #1
0
ファイル: pre.php プロジェクト: radiowarwick/digiplay
unset($root, $dir);
// Include config file
if (file_exists(FILE_ROOT . "digiplay.conf")) {
    $local_config = @parse_ini_file(FILE_ROOT . "digiplay.conf");
} elseif (file_exists("/etc/digiplay.conf")) {
    $local_config = @parse_ini_file("/etc/digiplay.conf");
} else {
    die("Fatal error: Could not open " . FILE_ROOT . "digiplay.conf or /etc/digiplay.conf.  Cannot continue.");
}
define("DATABASE_DPS_HOST", $local_config["DB_HOST"]);
define("DATABASE_DPS_PORT", $local_config["DB_PORT"]);
define("DATABASE_DPS_NAME", $local_config["DB_NAME"]);
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.");
コード例 #2
0
ファイル: Output.php プロジェクト: radiowarwick/digiplay
 public static function start()
 {
     Errors::start();
     ob_start(array('Output', 'stop'));
 }