Example #1
0
# *  (at your option) any later version.                                     #
# *	                                                                         #
# *  This program is distributed in the hope that it will be useful,         #
# *  but WITHOUT ANY WARRANTY; without even the implied warranty of          #
# *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           #
# *  GNU General Public License for more details.                            #
# *                                                                          #
##############################################################################
define('INSIDE', true);
define('INSTALL', false);
define('AJAX', true);
define('ROOT_PATH', str_replace('\\', '/', dirname(__FILE__)) . '/');
include_once ROOT_PATH . 'extension.inc';
include_once ROOT_PATH . 'common.' . PHP_EXT;
$SESSION = new Session();
if (!$SESSION->IsUserLogin() || $CONF['game_disable'] == 0 && $_SESSION['authlevel'] == 0) {
    exit(json_encode(array()));
}
includeLang('INGAME');
$action = request_var('action', '');
switch ($action) {
    case 'getfleets':
        includeLang('TECH');
        $OwnFleets = $db->query("SELECT DISTINCT * FROM " . FLEETS . " WHERE `fleet_owner` = '" . $_SESSION['id'] . "' OR `fleet_target_owner` = '" . $_SESSION['id'] . "';");
        $Record = 0;
        if ($db->num_rows($OwnFleets) > 0) {
            require_once ROOT_PATH . 'includes/classes/class.FlyingFleetsTable.' . PHP_EXT;
            $FlyingFleetsTable = new FlyingFleetsTable();
        }
        $ACSDone = array();
        $FleetData = array();
Example #2
0
$LANG = new Language();
unset($database);
// Say Browsers to Allow ThirdParty Cookies (Thanks to morktadela)
header('P3P:CP="IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT"');
$UNI = getUniverse();
if (UNIS_MULTIVARS) {
    require_once ROOT_PATH . 'includes/vars_uni' . $UNI . '.php';
} else {
    require_once ROOT_PATH . 'includes/vars.php';
}
$CONF = $db->uniquequery("SELECT HIGH_PRIORITY * FROM `" . CONFIG . "` WHERE `uni` = '" . $UNI . "';");
$CONF['moduls'] = explode(";", $CONF['moduls']);
$LANG->setDefault($CONF['lang']);
if (!defined('CLI') && !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) {
        message($CONF['close_reason']);
    }
    if (!CheckModule(10) && !defined('IN_ADMIN') && request_var('ajax', 0) == 0) {
        require ROOT_PATH . 'includes/FleetHandler.php';
    }
    $USER = $db->uniquequery("SELECT u.*, s.`total_points`, s.`total_rank` FROM " . USERS . " as u LEFT JOIN " . STATPOINTS . " as s ON s.`id_owner` = u.`id` AND s.`stat_type` = '1' WHERE u.`id` = '" . $_SESSION['id'] . "';");
    if (empty($USER)) {
        exit(header('Location: index.php'));
    } elseif (empty($USER['lang'])) {
        $USER['lang'] = $CONF['lang'];
        $db->query("UPDATE " . USERS . " SET `lang` = '" . $USER['lang'] . "' WHERE `id` = '" . $USER['id'] . "';");