Exemple #1
0
if (defined('IN_ADMIN') && IN_ADMIN) {
    $UserSkin = $user['dpath'];
    $local = stristr($UserSkin, "http:");
    if ($local === false) {
        if (!$user['dpath']) {
            $dpath = "../" . DEFAULT_SKINPATH;
        } else {
            $dpath = "../" . $user["dpath"];
        }
    } else {
        $dpath = $UserSkin;
    }
    lng_include('admin');
} elseif ($sys_user_logged_in) {
    $dpath = $user["dpath"] ? $user["dpath"] : DEFAULT_SKINPATH;
    flt_flying_fleet_handler($config, $skip_fleet_update);
    $planet_id = SetSelectedPlanet($user);
    doquery('START TRANSACTION;');
    $global_data = sys_o_get_updated($user, $planet_id, $time_now);
    if (!$global_data['planet']) {
        doquery("UPDATE {{users}} SET `current_planet` = '{$user['id_planet']}' WHERE `id` = '{$user['id']}' LIMIT 1;");
        $global_data = sys_o_get_updated($user, $user['id_planet'], $time_now);
    }
    doquery('COMMIT;');
    if (!$global_data) {
        $debug->error("User ID {$user['id']} has no current planet and no homeworld", 'User record error', 502);
    }
    $planetrow = $global_data['planet'];
    if (!($planetrow && isset($planetrow['id']) && $planetrow['id'])) {
        header('Location: login.php');
        ob_end_flush();
Exemple #2
0
    sn_user_birthday_celebrate();
}
if (!$config->var_online_user_count || $config->var_online_user_time + 30 < SN_TIME_NOW) {
    $config->db_saveItem('var_online_user_count', db_user_count(true));
    $config->db_saveItem('var_online_user_time', SN_TIME_NOW);
    if ($config->server_log_online) {
        doquery("INSERT IGNORE INTO {{log_users_online}} SET online_count = {$config->var_online_user_count};");
    }
}
// pdump($skip_fleet_update, '$skip_fleet_update');
// pdump($supernova->options['fleet_update_skip'], '$supernova->options[fleet_update_skip]');
global $skip_fleet_update;
$skip_fleet_update = $skip_fleet_update || $supernova->options['fleet_update_skip'] || defined('IN_ADMIN');
if (!$skip_fleet_update && SN_TIME_NOW - strtotime($config->fleet_update_last) > $config->fleet_update_interval) {
    require_once SN_ROOT_PHYSICAL . "includes/includes/flt_flying_fleet_handler2" . DOT_PHP_EX;
    flt_flying_fleet_handler($skip_fleet_update);
}
sec_login($result);
$user = $result[F_LOGIN_USER];
unset($result[F_LOGIN_USER]);
$template_result += $result;
unset($result);
// В этой точке пользователь либо авторизирован - и есть его запись - либо пользователя гарантированно нет в базе
// Если сообщение пустое - заполняем его по коду
$template_result[F_LOGIN_MESSAGE] = isset($template_result[F_LOGIN_MESSAGE]) && $template_result[F_LOGIN_MESSAGE] ? $template_result[F_LOGIN_MESSAGE] : $lang['sys_login_messages'][$template_result[F_LOGIN_STATUS]];
// Это уже переключаемся на пользовательский язык с откатом до языка в параметрах запроса
$lang->lng_switch(sys_get_param_str('lang'));
global $dpath;
$dpath = $user["dpath"] ? $user["dpath"] : DEFAULT_SKINPATH;
$config->db_loadItem('game_disable') == GAME_DISABLE_INSTALL ? define('INSTALL_MODE', GAME_DISABLE_INSTALL) : false;
if ($template_result[F_GAME_DISABLE] = $config->game_disable) {