Beispiel #1
0
}
require_once ROOT_PATH . 'includes/classes/class.MySQLi.' . PHP_EXT;
require_once ROOT_PATH . 'includes/classes/class.Session.' . PHP_EXT;
require_once ROOT_PATH . 'includes/GeneralFunctions.' . PHP_EXT;
require_once ROOT_PATH . 'includes/vars.' . PHP_EXT;
set_error_handler('msg_handler', E_ALL);
set_exception_handler('exception_handler');
if ($database) {
    $db = new DB_MySQLi();
} elseif (INSTALL != true) {
    redirectTo("install/");
}
unset($database);
if (INSTALL != true) {
    $cfgresult = $db->query("SELECT HIGH_PRIORITY * FROM `" . CONFIG . "`;");
    while ($row = $db->fetch_array($cfgresult)) {
        $CONF[$row['config_name']] = $row['config_value'];
    }
    $db->free_result($cfgresult);
    $CONF['moduls'] = explode(";", $CONF['moduls']);
    define('VERSION', $CONF['VERSION']);
    if (!defined('LOGIN') && !defined('IN_CRON') && !defined('AJAX')) {
        $SESSION = new Session();
        if (!$SESSION->IsUserLogin()) {
            redirectTo('index.php?code=3');
        }
        $SESSION->UpdateSession();
        if ($CONF['game_disable'] == 0 && $_SESSION['authlevel'] == 0) {
            trigger_error($CONF['close_reason'], E_USER_NOTICE);
        }
        if (request_var('ajax', 0) == 0 && !defined('IN_ADMIN')) {