Esempio n. 1
0
/**
 _  \_/ |\ | /¯¯\ \  / /\    |¯¯) |_¯ \  / /¯¯\ |  |   |´¯|¯` | /¯¯\ |\ |5
 ¯  /¯\ | \| \__/  \/ /--\   |¯¯\ |__  \/  \__/ |__ \_/   |   | \__/ | \|Core.
 * @author: Copyright (C) 2011 by Brayan Narvaez (Prinick) developer of xNova Revolution
 * @link: http://www.xnovarevolution.con.ar

 * @package 2Moons
 * @author Slaver <*****@*****.**>
 * @copyright 2009 Lucky <*****@*****.**> (XGProyecto)
 * @copyright 2011 Slaver <*****@*****.**> (Fork/2Moons)
 * @license http://www.gnu.org/licenses/gpl.html GNU GPLv3 License
 * @version 1.3 (2011-01-21)
 * @link http://code.google.com/p/2moons/

 * Please do not remove the credits
*/
function ShowTopKB()
{
    global $USER, $PLANET, $LNG, $UNI, $db, $LANG;
    $mode = request_var('mode', '');
    $template = new template();
    switch ($mode) {
        case "showkb":
            $template->isPopup(true);
            $LANG->includeLang(array('FLEET'));
            $ReportID = request_var('rid', '');
            if (file_exists(ROOT_PATH . 'raports/topkb_' . $ReportID . '.php')) {
                require_once ROOT_PATH . 'raports/topkb_' . $ReportID . '.php';
                $RaportRAW = $db->uniquequery("SELECT `angreifer`, `defender` FROM " . TOPKB . " WHERE `rid` = '" . $db->sql_escape($ReportID) . "';");
            }
            foreach ($LNG['tech_rc'] as $id => $s_name) {
                $ship[] = "[ship[" . $id . "]]";
                $shipname[] = $s_name;
            }
            $template->assign_vars(array('attacker' => $RaportRAW['angreifer'], 'defender' => $RaportRAW['defender'], 'report' => $raport));
            $template->show("topkb_report.tpl");
            break;
        default:
            $PlanetRess = new ResourceUpdate();
            $PlanetRess->CalcResource();
            $PlanetRess->SavePlanetToDB();
            $top = $db->query("SELECT * FROM " . TOPKB . " WHERE `universe` = '" . $UNI . "' ORDER BY gesamtunits DESC LIMIT 100;");
            while ($data = $db->fetch_array($top)) {
                $TopKBList[] = array('result' => $data['fleetresult'], 'time' => date(TDFORMAT, $data['time']), 'units' => pretty_number($data['gesamtunits']), 'rid' => $data['rid'], 'attacker' => $data['angreifer'], 'defender' => $data['defender'], 'result' => $data['fleetresult']);
            }
            $db->free_result($top);
            $template->assign_vars(array('tkb_units' => $LNG['tkb_units'], 'tkb_datum' => $LNG['tkb_datum'], 'tkb_owners' => $LNG['tkb_owners'], 'tkb_platz' => $LNG['tkb_platz'], 'tkb_top' => $LNG['tkb_top'], 'tkb_gratz' => $LNG['tkb_gratz'], 'tkb_legende' => $LNG['tkb_legende'], 'tkb_gewinner' => $LNG['tkb_gewinner'], 'tkb_verlierer' => $LNG['tkb_verlierer'], 'TopKBList' => $TopKBList));
            $template->show("topkb_overview.tpl");
            break;
    }
}
Esempio n. 2
0
function ShowFleetShortcuts()
{
    global $USER, $LNG, $db;
    $a = request_var('a', '');
    $mode = request_var('mode', '');
    $template = new template();
    $template->page_header();
    $template->page_footer();
    if ($mode == "add") {
        if ($_POST) {
            $name = request_var('n', $LNG['fl_anonymous']);
            $gala = request_var('g', 0);
            $sys = request_var('s', 0);
            $plan = request_var('p', 0);
            $type = request_var('t', 0);
            $USER['fleet_shortcut'] .= $name . ',' . $gala . ',' . $sys . ',' . $plan . ',' . $type . "\r\n";
            $db->query("UPDATE " . USERS . " SET `fleet_shortcut` = '" . $USER['fleet_shortcut'] . "' WHERE `id` = '" . $USER['id'] . "';");
            redirectTo("game." . PHP_EXT . "?page=shortcuts");
        }
        $template->assign_vars(array('fl_shortcut_add_title' => $LNG['fl_shortcut_add_title'], 'fl_clean' => $LNG['fl_clean'], 'fl_register_shorcut' => $LNG['fl_register_shorcut'], 'fl_back' => $LNG['fl_back'], 'typeselector' => array(1 => $LNG['fl_planet'], 2 => $LNG['fl_debris'], 3 => $LNG['fl_moon'])));
        $template->show("fleet_shortcuts_add.tpl");
    } elseif (is_numeric($a)) {
        $scarray = explode("\r\n", $USER['fleet_shortcut']);
        $r = explode(",", $scarray[$a]);
        if ($_POST) {
            if ($_POST['delete']) {
                unset($scarray[$a]);
            } else {
                $r[0] = request_var('n', '');
                $r[1] = request_var('g', 0);
                $r[2] = request_var('s', 0);
                $r[3] = request_var('p', 0);
                $r[4] = request_var('t', 0);
                $scarray[$a] = implode(",", $r);
            }
            $USER['fleet_shortcut'] = implode("\r\n", $scarray);
            $db->query("UPDATE " . USERS . " SET fleet_shortcut='" . $USER['fleet_shortcut'] . "' WHERE id=" . $USER['id'] . ";");
            exit(redirectTo("game." . PHP_EXT . "?page=shortcuts"));
        }
        if (empty($USER['fleet_shortcut'])) {
            redirectTo("game." . PHP_EXT . "?page=shortcuts");
        }
        $template->assign_vars(array('fl_back' => $LNG['fl_back'], 'fl_shortcut_edition' => $LNG['fl_shortcut_edition'], 'fl_reset_shortcut' => $LNG['fl_reset_shortcut'], 'fl_register_shorcut' => $LNG['fl_register_shorcut'], 'fl_dlte_shortcut' => $LNG['fl_dlte_shortcut'], 'typeselector' => array(1 => $LNG['fl_planet'], 2 => $LNG['fl_debris'], 3 => $LNG['fl_moon']), 'name' => $r[0], 'galaxy' => $r[1], 'system' => $r[2], 'planet' => $r[3], 'type' => $r[4], 'id' => $a));
        $template->show("fleet_shortcuts_edit.tpl");
    } else {
        $scarray = explode("\r\n", $USER['fleet_shortcut']);
        foreach ($scarray as $b) {
            if (empty($b)) {
                continue;
            }
            $c = explode(',', $b);
            $ShortCuts[] = array('name' => $c[0], 'galaxy' => $c[1], 'system' => $c[2], 'planet' => $c[3], 'type' => $c[4]);
        }
        $template->assign_vars(array('ShortCuts' => $ShortCuts, 'fl_back' => $LNG['fl_back'], 'fl_planet_shortcut' => $LNG['fl_planet_shortcut'], 'fl_moon_shortcut' => $LNG['fl_moon_shortcut'], 'fl_debris_shortcut' => $LNG['fl_debris_shortcut'], 'fl_no_shortcuts' => $LNG['fl_no_shortcuts'], 'fl_shortcuts' => $LNG['fl_shortcuts'], 'fl_shortcut_add' => $LNG['fl_shortcut_add']));
        $template->show("fleet_shortcuts.tpl");
    }
}
Esempio n. 3
0
function ShowVertify()
{
    global $CONF, $LNG;
    $EXT = explode("|", HTTP::_GP("ext", ""));
    $action = HTTP::_GP("action", "");
    $file = HTTP::_GP("file", "");
    $template = new template();
    switch ($action) {
        case 'check':
            $REV = explode(".", Config::get("VERSION"));
            $REV = $REV[2];
            $ch = curl_init();
            curl_setopt($ch, CURLOPT_AUTOREFERER, true);
            curl_setopt($ch, CURLOPT_URL, 'http://2moons.googlecode.com/svn-history/r' . $REV . '/trunk/' . $file);
            curl_setopt($ch, CURLOPT_HEADER, false);
            curl_setopt($ch, CURLOPT_USERAGENT, "2Moons Update API");
            curl_setopt($ch, CURLOPT_CRLF, true);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
            $FILE = curl_exec($ch);
            $SVNHASH = crc32(preg_replace(array("/(\r\n)|(\r)/", '/(\\/\\*[\\d\\D]*?\\*\\/)/', '/\\$I' . 'd[^\\$]+\\$/'), array("\n", '', ''), $FILE));
            if (curl_getinfo($ch, CURLINFO_HTTP_CODE) == 404) {
                echo 4;
                exit;
            }
            if (curl_errno($ch)) {
                echo 3;
                exit;
            }
            curl_close($ch);
            $FILE2 = file_get_contents(ROOT_PATH . $file);
            $LOCALHASH = crc32(preg_replace(array("/(\r\n)|(\r)/", '/(\\/\\*[\\d\\D]*?\\*\\/)/', '/\\$I' . 'd[^\\$]+\\$/'), array("\n", '', ''), $FILE2));
            if ($SVNHASH == $LOCALHASH) {
                echo 1;
                exit;
            } else {
                echo 2;
                exit;
            }
            exit;
            break;
        case 'vertify':
            $template->loadscript('vertify.js');
            $template->show("VertifyPageResult.tpl");
            exit;
            break;
        case 'getFileList':
            echo json_encode(array_merge(dir_tree('./', $EXT, false), dir_tree('chat/', $EXT), dir_tree('includes/', $EXT), dir_tree('includes/', $EXT), dir_tree('language/', $EXT), dir_tree('scripts/', $EXT), dir_tree('styles/', $EXT)));
            exit;
            break;
    }
    $template->show("VertifyPage.tpl");
}
Esempio n. 4
0
/**
 _  \_/ |\ | /¯¯\ \  / /\    |¯¯) |_¯ \  / /¯¯\ |  |   |´¯|¯` | /¯¯\ |\ |5
 ¯  /¯\ | \| \__/  \/ /--\   |¯¯\ |__  \/  \__/ |__ \_/   |   | \__/ | \|Core.
 * @author: Copyright (C) 2011 by Brayan Narvaez (Prinick) developer of xNova Revolution
 * @link: http://www.xnovarevolution.con.ar

 * @package 2Moons
 * @author Slaver <*****@*****.**>
 * @copyright 2009 Lucky <*****@*****.**> (XGProyecto)
 * @copyright 2011 Slaver <*****@*****.**> (Fork/2Moons)
 * @license http://www.gnu.org/licenses/gpl.html GNU GPLv3 License
 * @version 1.3 (2011-01-21)
 * @link http://code.google.com/p/2moons/

 * Please do not remove the credits
*/
function ShowMenuPage()
{
    global $USER, $LNG, $db;
    $template = new template();
    $template->assign_vars(array('mu_game_info' => $LNG['mu_game_info'], 'mu_settings' => $LNG['mu_settings'], 'mu_ts_options' => $LNG['mu_ts_options'], 'mu_fb_options' => $LNG['mu_fb_options'], 'mu_module' => $LNG['mu_module'], 'mu_user_logs' => $LNG['mu_user_logs'], 'mu_optimize_db' => $LNG['mu_optimize_db'], 'mu_stats_options' => $LNG['mu_stats_options'], 'mu_chat' => $LNG['mu_chat'], 'mu_update' => $LNG['mu_update'], 'mu_general' => $LNG['mu_general'], 'new_creator_title' => $LNG['new_creator_title'], 'mu_add_delete_resources' => $LNG['mu_add_delete_resources'], 'mu_ban_options' => $LNG['mu_ban_options'], 'mu_users_settings' => $LNG['mu_users_settings'], 'mu_tools' => $LNG['mu_tools'], 'mu_manual_points_update' => $LNG['mu_manual_points_update'], 'mu_global_message' => $LNG['mu_global_message'], 'mu_md5_encripter' => $LNG['mu_md5_encripter'], 'mu_mpu_confirmation' => $LNG['mu_mpu_confirmation'], 'mu_observation' => $LNG['mu_observation'], 'mu_connected' => $LNG['mu_connected'], 'mu_support' => $LNG['mu_support'], 'mu_vaild_users' => $LNG['mu_vaild_users'], 'mu_active_planets' => $LNG['mu_active_planets'], 'mu_flying_fleets' => $LNG['mu_flying_fleets'], 'mu_news' => $LNG['mu_news'], 'mu_user_list' => $LNG['mu_user_list'], 'mu_planet_list' => $LNG['mu_planet_list'], 'mu_moon_list' => $LNG['mu_moon_list'], 'mu_mess_list' => $LNG['mu_mess_list'], 'mu_info_account_page' => $LNG['mu_info_account_page'], 'mu_multiip_page' => $LNG['mu_multiip'], 'mu_search_page' => $LNG['mu_search_page'], 'mu_mod_update' => $LNG['mu_mod_update'], 'mu_clear_cache' => $LNG['mu_clear_cache'], 'supportticks' => $db->countquery("SELECT COUNT(*) FROM " . SUPP . " WHERE `universe` = '" . $_SESSION['adminuni'] . "' AND (`status` = '1' OR `status` = '3');")));
    $template->show('adm/ShowMenuPage.tpl');
}
Esempio n. 5
0
/**
 *  2Moons
 *  Copyright (C) 2012 Jan Kröpke
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (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.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @package 2Moons
 * @author Jan Kröpke <*****@*****.**>
 * @copyright 2012 Jan Kröpke <*****@*****.**>
 * @license http://www.gnu.org/licenses/gpl.html GNU GPLv3 License
 * @version 1.7.3 (2013-05-19)
 * @info $Id: ShowMenuPage.php 2632 2013-03-18 19:05:14Z slaver7 $
 * @link http://2moons.cc/
 */
function ShowMenuPage()
{
    global $USER;
    $template = new template();
    $template->assign_vars(array('supportticks' => $GLOBALS['DATABASE']->getFirstCell("SELECT COUNT(*) FROM " . TICKETS . " WHERE universe = " . $_SESSION['adminuni'] . " AND status = 0;")));
    $template->show('ShowMenuPage.tpl');
}
Esempio n. 6
0
function ShowChatConfigPage()
{
    global $LNG, $USER;
    $CONF = Config::getAll(NULL, 1);
    if (!empty($_POST)) {
        $config_before = array('chat_closed' => $CONF['chat_closed'], 'chat_allowchan' => $CONF['chat_allowchan'], 'chat_allowmes' => $CONF['chat_allowmes'], 'chat_allowdelmes' => $CONF['chat_allowdelmes'], 'chat_logmessage' => $CONF['chat_logmessage'], 'chat_nickchange' => $CONF['chat_nickchange'], 'chat_botname' => $CONF['chat_botname'], 'chat_channelname' => $CONF['chat_channelname']);
        $chat_allowchan = isset($_POST['chat_allowchan']) && $_POST['chat_allowchan'] == 'on' ? 1 : 0;
        $chat_allowmes = isset($_POST['chat_allowmes']) && $_POST['chat_allowmes'] == 'on' ? 1 : 0;
        $chat_allowdelmes = isset($_POST['chat_allowdelmes']) && $_POST['chat_allowdelmes'] == 'on' ? 1 : 0;
        $chat_logmessage = isset($_POST['chat_logmessage']) && $_POST['chat_logmessage'] == 'on' ? 1 : 0;
        $chat_nickchange = isset($_POST['chat_nickchange']) && $_POST['chat_nickchange'] == 'on' ? 1 : 0;
        $chat_closed = isset($_POST['chat_closed']) && $_POST['chat_closed'] == 'on' ? 1 : 0;
        $chat_channelname = HTTP::_GP('chat_channelname', '', true);
        $chat_botname = HTTP::_GP('chat_botname', '', true);
        $config_after = array('chat_closed' => $chat_closed, 'chat_allowchan' => $chat_allowchan, 'chat_allowmes' => $chat_allowmes, 'chat_allowdelmes' => $chat_allowdelmes, 'chat_logmessage' => $chat_logmessage, 'chat_nickchange' => $chat_nickchange, 'chat_botname' => $chat_botname, 'chat_channelname' => $chat_channelname);
        Config::update($config_after);
        $CONF = Config::getAll(NULL, 1);
        $LOG = new Log(3);
        $LOG->target = 3;
        $LOG->old = $config_before;
        $LOG->new = $config_after;
        $LOG->save();
    }
    $template = new template();
    $template->assign_vars(array('chat_closed' => $CONF['chat_closed'], 'chat_allowchan' => $CONF['chat_allowchan'], 'chat_allowmes' => $CONF['chat_allowmes'], 'chat_logmessage' => $CONF['chat_logmessage'], 'chat_nickchange' => $CONF['chat_nickchange'], 'chat_botname' => $CONF['chat_botname'], 'chat_channelname' => $CONF['chat_channelname'], 'se_server_parameters' => $LNG['se_server_parameters'], 'se_save_parameters' => $LNG['se_save_parameters'], 'ch_closed' => $LNG['ch_closed'], 'ch_allowchan' => $LNG['ch_allowchan'], 'ch_allowmes' => $LNG['ch_allowmes'], 'ch_allowdelmes' => $LNG['ch_allowdelmes'], 'ch_logmessage' => $LNG['ch_logmessage'], 'ch_nickchange' => $LNG['ch_nickchange'], 'ch_botname' => $LNG['ch_botname'], 'ch_channelname' => $LNG['ch_channelname']));
    $template->show('ChatConfigBody.tpl');
}
Esempio n. 7
0
function ShowTeamspeakPage()
{
    global $CONF, $LNG;
    if ($_POST) {
        if (isset($_POST['ts_on']) && $_POST['ts_on'] == 'on') {
            $CONF['ts_modon'] = 1;
        } else {
            $CONF['ts_modon'] = 0;
        }
        $CONF['ts_server'] = request_var('ts_ip', '');
        $CONF['ts_tcpport'] = request_var('ts_tcp', 0);
        $CONF['ts_udpport'] = request_var('ts_udp', 0);
        $CONF['ts_timeout'] = request_var('ts_to', 0);
        $CONF['ts_version'] = request_var('ts_v', 0);
        update_config('ts_timeout', $CONF['ts_timeout']);
        update_config('ts_modon', $CONF['ts_modon']);
        update_config('ts_server', $CONF['ts_server']);
        update_config('ts_tcpport', $CONF['ts_tcpport']);
        update_config('ts_udpport', $CONF['ts_udpport']);
        update_config('ts_version', $CONF['ts_version']);
    }
    $template = new template();
    $template->page_header();
    $template->assign_vars(array('se_save_parameters' => $LNG['se_save_parameters'], 'ts_tcpport' => $LNG['ts_tcpport'], 'ts_serverip' => $LNG['ts_serverip'], 'ts_version' => $LNG['ts_version'], 'ts_active' => $LNG['ts_active'], 'ts_settings' => $LNG['ts_settings'], 'ts_udpport' => $LNG['ts_udpport'], 'ts_timeout' => $LNG['ts_timeout'], 'ts_server_query' => $LNG['ts_server_query'], 'ts_server_id' => $LNG['ts_server_id'], 'ts_to' => $CONF['ts_timeout'], 'ts_on' => $CONF['ts_modon'], 'ts_ip' => $CONF['ts_server'], 'ts_tcp' => $CONF['ts_tcpport'], 'ts_udp' => $CONF['ts_udpport'], 'ts_v' => $CONF['ts_version']));
    $template->show('adm/TeamspeakPage.tpl');
}
Esempio n. 8
0
function ShowChatConfigPage()
{
    global $LNG;
    $config = Config::get(Universe::getEmulated());
    if (!empty($_POST)) {
        $config_before = array('chat_closed' => $config->chat_closed, 'chat_allowchan' => $config->chat_allowchan, 'chat_allowmes' => $config->chat_allowmes, 'chat_allowdelmes' => $config->chat_allowdelmes, 'chat_logmessage' => $config->chat_logmessage, 'chat_nickchange' => $config->chat_nickchange, 'chat_botname' => $config->chat_botname, 'chat_channelname' => $config->chat_channelname);
        $chat_allowchan = isset($_POST['chat_allowchan']) && $_POST['chat_allowchan'] == 'on' ? 1 : 0;
        $chat_allowmes = isset($_POST['chat_allowmes']) && $_POST['chat_allowmes'] == 'on' ? 1 : 0;
        $chat_allowdelmes = isset($_POST['chat_allowdelmes']) && $_POST['chat_allowdelmes'] == 'on' ? 1 : 0;
        $chat_logmessage = isset($_POST['chat_logmessage']) && $_POST['chat_logmessage'] == 'on' ? 1 : 0;
        $chat_nickchange = isset($_POST['chat_nickchange']) && $_POST['chat_nickchange'] == 'on' ? 1 : 0;
        $chat_closed = isset($_POST['chat_closed']) && $_POST['chat_closed'] == 'on' ? 1 : 0;
        $chat_channelname = HTTP::_GP('chat_channelname', '', true);
        $chat_botname = HTTP::_GP('chat_botname', '', true);
        $config_after = array('chat_closed' => $chat_closed, 'chat_allowchan' => $chat_allowchan, 'chat_allowmes' => $chat_allowmes, 'chat_allowdelmes' => $chat_allowdelmes, 'chat_logmessage' => $chat_logmessage, 'chat_nickchange' => $chat_nickchange, 'chat_botname' => $chat_botname, 'chat_channelname' => $chat_channelname);
        foreach ($config_after as $key => $value) {
            $config->{$key} = $value;
        }
        $config->save();
        $LOG = new Log(3);
        $LOG->target = 3;
        $LOG->old = $config_before;
        $LOG->new = $config_after;
        $LOG->save();
    }
    $template = new template();
    $template->assign_vars(array('chat_closed' => $config->chat_closed, 'chat_allowchan' => $config->chat_allowchan, 'chat_allowmes' => $config->chat_allowmes, 'chat_logmessage' => $config->chat_logmessage, 'chat_nickchange' => $config->chat_nickchange, 'chat_botname' => $config->chat_botname, 'chat_channelname' => $config->chat_channelname, 'se_server_parameters' => $LNG['se_server_parameters'], 'se_save_parameters' => $LNG['se_save_parameters'], 'ch_closed' => $LNG['ch_closed'], 'ch_allowchan' => $LNG['ch_allowchan'], 'ch_allowmes' => $LNG['ch_allowmes'], 'ch_allowdelmes' => $LNG['ch_allowdelmes'], 'ch_logmessage' => $LNG['ch_logmessage'], 'ch_nickchange' => $LNG['ch_nickchange'], 'ch_botname' => $LNG['ch_botname'], 'ch_channelname' => $LNG['ch_channelname']));
    $template->show('ChatConfigBody.tpl');
}
Esempio n. 9
0
/**
 *  2Moons
 *  Copyright (C) 2012 Jan Kröpke
 *
 * For the full copyright and license information, please view the LICENSE
 *
 * @package 2Moons
 * @author Jan Kröpke <*****@*****.**>
 * @copyright 2012 Jan Kröpke <*****@*****.**>
 * @licence MIT
 * @version 1.7.2 (2013-03-18)
 * @info $Id$
 * @link http://2moons.cc/
 */
function ShowOverviewPage()
{
    global $LNG, $USER;
    $Message = array();
    if ($USER['authlevel'] >= AUTH_ADM) {
        if (file_exists(ROOT_PATH . 'update.php')) {
            $Message[] = sprintf($LNG['ow_file_detected'], 'update.php');
        }
        if (file_exists(ROOT_PATH . 'webinstall.php')) {
            $Message[] = sprintf($LNG['ow_file_detected'], 'webinstall.php');
        }
        if (file_exists('includes/ENABLE_INSTALL_TOOL')) {
            $Message[] = sprintf($LNG['ow_file_detected'], 'includes/ENABLE_INSTALL_TOOL');
        }
        if (!is_writable(ROOT_PATH . 'cache')) {
            $Message[] = sprintf($LNG['ow_dir_not_writable'], 'cache');
        }
        if (!is_writable('includes')) {
            $Message[] = sprintf($LNG['ow_dir_not_writable'], 'includes');
        }
    }
    $template = new template();
    $template->assign_vars(array('ow_none' => $LNG['ow_none'], 'ow_overview' => $LNG['ow_overview'], 'ow_welcome_text' => $LNG['ow_welcome_text'], 'ow_credits' => $LNG['ow_credits'], 'ow_special_thanks' => $LNG['ow_special_thanks'], 'ow_translator' => $LNG['ow_translator'], 'ow_proyect_leader' => $LNG['ow_proyect_leader'], 'ow_support' => $LNG['ow_support'], 'ow_title' => $LNG['ow_title'], 'ow_forum' => $LNG['ow_forum'], 'ow_donate' => $LNG['ow_donate'], 'Messages' => $Message, 'date' => date('m\\_Y', TIMESTAMP)));
    $template->show('OverviewBody.tpl');
}
Esempio n. 10
0
function ShowRecordsPage()
{
    global $USER, $PLANET, $LNG, $resource, $db, $CONF, $UNI;
    $PlanetRess = new ResourceUpdate();
    $PlanetRess->CalcResource();
    $PlanetRess->SavePlanetToDB();
    $template = new template();
    $Records = new records();
    $RecordsArray = $Records->GetRecords($UNI);
    foreach ($RecordsArray as $ElementID => $ElementIDArray) {
        if ($ElementID >= 1 && $ElementID <= 39 || $ElementID == 44) {
            $Builds[$LNG['tech'][$ElementID]] = array('winner' => $ElementIDArray['maxlvl'] != 0 ? $ElementIDArray['username'] : $LNG['rec_rien'], 'count' => $ElementIDArray['maxlvl'] != 0 ? pretty_number($ElementIDArray['maxlvl']) : $LNG['rec_rien']);
        } elseif ($ElementID >= 41 && $ElementID <= 99 && $ElementID != 44) {
            $MoonsBuilds[$LNG['tech'][$ElementID]] = array('winner' => $ElementIDArray['maxlvl'] != 0 ? $ElementIDArray['username'] : $LNG['rec_rien'], 'count' => $ElementIDArray['maxlvl'] != 0 ? pretty_number($ElementIDArray['maxlvl']) : $LNG['rec_rien']);
        } elseif ($ElementID >= 101 && $ElementID <= 199) {
            $Techno[$LNG['tech'][$ElementID]] = array('winner' => $ElementIDArray['maxlvl'] != 0 ? $ElementIDArray['username'] : $LNG['rec_rien'], 'count' => $ElementIDArray['maxlvl'] != 0 ? pretty_number($ElementIDArray['maxlvl']) : $LNG['rec_rien']);
        } elseif ($ElementID >= 201 && $ElementID <= 399) {
            $Fleet[$LNG['tech'][$ElementID]] = array('winner' => $ElementIDArray['maxlvl'] != 0 ? $ElementIDArray['username'] : $LNG['rec_rien'], 'count' => $ElementIDArray['maxlvl'] != 0 ? pretty_number($ElementIDArray['maxlvl']) : $LNG['rec_rien']);
        } elseif ($ElementID >= 401 && $ElementID <= 599) {
            $Defense[$LNG['tech'][$ElementID]] = array('winner' => $ElementIDArray['maxlvl'] != 0 ? $ElementIDArray['username'] : $LNG['rec_rien'], 'count' => $ElementIDArray['maxlvl'] != 0 ? pretty_number($ElementIDArray['maxlvl']) : $LNG['rec_rien']);
        }
    }
    $Records = array($LNG['rec_build'] => $Builds, $LNG['rec_specb'] => $MoonsBuilds, $LNG['rec_techn'] => $Techno, $LNG['rec_fleet'] => $Fleet, $LNG['rec_defes'] => $Defense);
    $template->assign_vars(array('Records' => $Records, 'update' => sprintf($LNG['rec_last_update_on'], date(TDFORMAT, $CONF['stat_last_update'])), 'level' => $LNG['rec_level'], 'player' => $LNG['rec_playe']));
    $template->show("records_overview.tpl");
}
Esempio n. 11
0
function ShowInformationPage()
{
    global $db, $LNG, $CONF;
    $template = new template();
    $template->assign_vars(array('info_information' => $LNG['info_information'], 'info' => $_SERVER['SERVER_SOFTWARE'], 'vPHP' => PHP_VERSION, 'vAPI' => PHP_SAPI, 'vGame' => $CONF['VERSION'], 'vMySQLc' => $db->getVersion(), 'vMySQLs' => $db->getServerVersion(), 'root' => $_SERVER['SERVER_NAME'], 'gameroot' => $_SERVER['SERVER_NAME'] . str_replace('/admin.php', '', $_SERVER['PHP_SELF']), 'json' => function_exists('json_encode') ? 'Si' : 'No', 'bcmath' => extension_loaded('bcmath') ? 'Si' : 'No', 'curl' => extension_loaded('curl') ? 'Si' : 'No', 'browser' => $_SERVER['HTTP_USER_AGENT'], 'safemode' => ini_get('safe_mode') ? 'Si' : 'No', 'memory' => ini_get('memory_limit')));
    $template->show('adm/ShowInformationPage.tpl');
}
Esempio n. 12
0
function ShowDisclamerPage()
{
    global $LNG, $USER;
    $CONF = Config::getAll(NULL, $_SESSION['adminuni']);
    if (!empty($_POST)) {
        $config_before = array('disclamerAddress' => $CONF['disclamerAddress'], 'disclamerPhone' => $CONF['disclamerPhone'], 'disclamerMail' => $CONF['disclamerMail'], 'disclamerNotice' => $CONF['disclamerNotice']);
        $disclamerAddress = HTTP::_GP('disclamerAddress', '', true);
        $disclamerPhone = HTTP::_GP('disclamerPhone', '', true);
        $disclamerMail = HTTP::_GP('disclamerMail', '', true);
        $disclamerNotice = HTTP::_GP('disclamerNotice', '', true);
        $config_after = array('disclamerAddress' => $disclamerAddress, 'disclamerPhone' => $disclamerPhone, 'disclamerMail' => $disclamerMail, 'disclamerNotice' => $disclamerNotice);
        Config::update($config_after);
        $CONF = Config::getAll(NULL, $_SESSION['adminuni']);
        $LOG = new Log(3);
        $LOG->target = 5;
        $LOG->old = $config_before;
        $LOG->new = $config_after;
        $LOG->save();
    }
    $template = new template();
    $template->loadscript('../base/jquery.autosize-min.js');
    $template->execscript('$(\'textarea\').autosize();');
    $template->assign_vars(array('disclamerAddress' => $CONF['disclamerAddress'], 'disclamerPhone' => $CONF['disclamerPhone'], 'disclamerMail' => $CONF['disclamerMail'], 'disclamerNotice' => $CONF['disclamerNotice'], 'se_server_parameters' => $LNG['mu_disclamer'], 'se_save_parameters' => $LNG['se_save_parameters'], 'se_disclamerAddress' => $LNG['se_disclamerAddress'], 'se_disclamerPhone' => $LNG['se_disclamerPhone'], 'se_disclamerMail' => $LNG['se_disclamerMail'], 'se_disclamerNotice' => $LNG['se_disclamerNotice']));
    $template->show('DisclamerConfigBody.tpl');
}
Esempio n. 13
0
/**
 _  \_/ |\ | /¯¯\ \  / /\    |¯¯) |_¯ \  / /¯¯\ |  |   |´¯|¯` | /¯¯\ |\ |5
 ¯  /¯\ | \| \__/  \/ /--\   |¯¯\ |__  \/  \__/ |__ \_/   |   | \__/ | \|Core.
 * @author: Copyright (C) 2011 by Brayan Narvaez (Prinick) developer of xNova Revolution
 * @link: http://www.xnovarevolution.con.ar

 * @package 2Moons
 * @author Slaver <*****@*****.**>
 * @copyright 2009 Lucky <*****@*****.**> (XGProyecto)
 * @copyright 2011 Slaver <*****@*****.**> (Fork/2Moons)
 * @license http://www.gnu.org/licenses/gpl.html GNU GPLv3 License
 * @version 1.3 (2011-01-21)
 * @link http://code.google.com/p/2moons/

 * Please do not remove the credits
*/
function ShowFleetTraderPage()
{
    global $USER, $PLANET, $LNG, $CONF, $pricelist, $resource;
    $PlanetRess = new ResourceUpdate();
    $PlanetRess->CalcResource();
    $CONF['trade_allowed_ships'] = explode(',', $CONF['trade_allowed_ships']);
    $ID = request_var('id', 0);
    if (!empty($ID) && in_array($ID, $CONF['trade_allowed_ships'])) {
        $Count = max(min(request_var('count', '0'), $PLANET[$resource[$ID]]), 0);
        $PLANET['metal'] = bcadd($PLANET['metal'], bcmul($Count, bcmul($pricelist[$ID]['metal'], (double) (1 - $CONF['trade_charge']))));
        $PLANET['crystal'] = bcadd($PLANET['crystal'], bcmul($Count, bcmul($pricelist[$ID]['crystal'], (double) (1 - $CONF['trade_charge']))));
        $PLANET['deuterium'] = bcadd($PLANET['deuterium'], bcmul($Count, bcmul($pricelist[$ID]['deuterium'], (double) (1 - $CONF['trade_charge']))));
        $PLANET['norio'] = bcadd($PLANET['norio'], bcmul($Count, bcmul($pricelist[$ID]['norio'], (double) (1 - $CONF['trade_charge']))));
        $USER['darkmatter'] = bcadd($USER['darkmatter'], bcmul($Count, bcmul($pricelist[$ID]['darkmatter'], (double) (1 - $CONF['trade_charge']))));
        $PlanetRess->Builded[$ID] = bcadd(bcmul('-1', $Count), $PlanetRess->Builded[$ID]);
    }
    $PlanetRess->SavePlanetToDB();
    $template = new template();
    $template->loadscript('fleettrader.js');
    $template->execscript('updateVars();');
    $Cost = array();
    foreach ($CONF['trade_allowed_ships'] as $ID) {
        $Cost[$ID] = array($PLANET[$resource[$ID]], $pricelist[$ID]['metal'], $pricelist[$ID]['crystal'], $pricelist[$ID]['deuterium'], $pricelist[$ID]['darkmatter'], $pricelist[$ID]['norio']);
    }
    $template->assign_vars(array('tech' => $LNG['tech'], 'ft_head' => $LNG['ft_head'], 'ft_count' => $LNG['ft_count'], 'ft_max' => $LNG['ft_max'], 'ft_total' => $LNG['ft_total'], 'ft_charge' => $LNG['ft_charge'], 'ft_absenden' => $LNG['ft_absenden'], 'trade_allowed_ships' => $CONF['trade_allowed_ships'], 'CostInfos' => json_encode($Cost), 'Charge' => $CONF['trade_charge']));
    $template->show("fleettrader_overview.tpl");
}
Esempio n. 14
0
function ShowFleetsConfPage()
{
    global $LNG;
    $CONF = Config::getAll(NULL, 1);
    if (!empty($_POST)) {
        $pay_before = array('fleetconf' => $CONF['fleetconf']);
        $fleetconf = TIMESTAMP + $_POST['days'] * 24 * 60 * 60;
        $pay_after = array('fleetconf' => $fleetconf);
        Config::update($pay_after, 1);
        $CONF = Config::getAll(NULL, 1);
        $LOG = new Log(3);
        $LOG->target = 1;
        $LOG->old = $pay_before;
        $LOG->new = $pay_after;
        $LOG->save();
        require_once 'includes/functions/BBCode.php';
        $Time = TIMESTAMP;
        $Message = '<span class="admin">All promotional fleets and defence have been unlocked until ' . date("d.m.Y - H:i:s", $CONF['fleetconf']) . '. - <a href="?page=shipyard&mode=fleet">Fleet</a> - <a href="?page=shipyard&mode=defence">Defence</a>';
        $From = '<span class="admin">"Antimatter"</span>';
        $pmSubject = '<span class="admin">"Purchase Bonus"</span>';
        $pmMessage = '<span class="admin">' . bbcode($Message) . '</span>';
        $USERS = $GLOBALS['DATABASE']->query("SELECT `id`, `username` FROM " . USERS . " WHERE `universe` = '1';");
        while ($UserData = $GLOBALS['DATABASE']->fetch_array($USERS)) {
            $sendMessage = str_replace('{USERNAME}', $UserData['username'], $pmMessage);
            SendSimpleMessage($UserData['id'], $USER['id'], TIMESTAMP, 50, $From, $pmSubject, $sendMessage);
        }
    }
    $template = new template();
    $template->assign_vars(array('fleetconf' => $CONF['fleetconf'], 'bonus_next_active' => $CONF['fleetconf'] > TIMESTAMP ? $CONF['fleetconf'] - TIMESTAMP : 0, 'bonus_next_active_timer' => $CONF['fleetconf'] > TIMESTAMP ? date("d.m.Y H:i:s", $CONF['fleetconf']) : 0));
    $template->show('fleetconf.tpl');
}
Esempio n. 15
0
function ShowDisclamerPage()
{
    global $LNG;
    $config = Config::get(Universe::getEmulated());
    if (!empty($_POST)) {
        $config_before = array('disclamerAddress' => $config->disclamerAddress, 'disclamerPhone' => $config->disclamerPhone, 'disclamerMail' => $config->disclamerMail, 'disclamerNotice' => $config->disclamerNotice);
        $disclaimerAddress = HTTP::_GP('disclaimerAddress', '', true);
        $disclaimerPhone = HTTP::_GP('disclaimerPhone', '', true);
        $disclaimerMail = HTTP::_GP('disclaimerMail', '', true);
        $disclaimerNotice = HTTP::_GP('disclaimerNotice', '', true);
        $config_after = array('disclamerAddress' => $disclaimerAddress, 'disclamerPhone' => $disclaimerPhone, 'disclamerMail' => $disclaimerMail, 'disclamerNotice' => $disclaimerNotice);
        foreach ($config_after as $key => $value) {
            $config->{$key} = $value;
        }
        $config->save();
        $LOG = new Log(3);
        $LOG->target = 5;
        $LOG->old = $config_before;
        $LOG->new = $config_after;
        $LOG->save();
    }
    $template = new template();
    $template->loadscript('../base/jquery.autosize-min.js');
    $template->execscript('$(\'textarea\').autosize();');
    $template->assign_vars(array('disclaimerAddress' => $config->disclamerAddress, 'disclaimerPhone' => $config->disclamerPhone, 'disclaimerMail' => $config->disclamerMail, 'disclaimerNotice' => $config->disclamerNotice, 'se_server_parameters' => $LNG['mu_disclaimer'], 'se_save_parameters' => $LNG['se_save_parameters'], 'se_disclaimerAddress' => $LNG['se_disclaimerAddress'], 'se_disclaimerPhone' => $LNG['se_disclaimerPhone'], 'se_disclaimerMail' => $LNG['se_disclaimerMail'], 'se_disclaimerNotice' => $LNG['se_disclaimerNotice']));
    $template->show('DisclamerConfigBody.tpl');
}
Esempio n. 16
0
function ShowModVersionPage()
{
    global $LNG, $USER;
    $MVC = array();
    $Files = scandir(ROOT_PATH . 'includes/functions/mvc/');
    foreach ($Files as $File) {
        if (substr($File, 0, 4) == 'mvc_') {
            require ROOT_PATH . 'includes/functions/mvc/' . $File;
        }
    }
    foreach ($MVC as &$Mod) {
        $Mod['description'] = $Mod['description'][$USER['lang']];
        $Update = @simplexml_load_file($Mod['update']);
        $Update = $Update->{$Mod}['tag'];
        if (version_compare($Mod['version'], $Update->version, '<')) {
            $Mod['update'] = colorRed($LNG['mvc_update_yes']);
            $Mod['udetails'] = array('version' => $Update->version, 'date' => $Update->date, 'download' => $Update->download, 'announcement' => $Update->announcement);
        } else {
            $Mod['update'] = colorGreen($LNG['mvc_update_no']);
            $Mod['udetails'] = false;
        }
    }
    $template = new template();
    $template->assign_vars(array('MVC' => $MVC, 'mvc_title' => $LNG['mvc_title'], 'mvc_author' => $LNG['mvc_author'], 'mvc_version' => $LNG['mvc_version'], 'mvc_link' => $LNG['mvc_link'], 'mvc_update_version' => $LNG['mvc_update_version'], 'mvc_update_date' => $LNG['mvc_update_date'], 'mvc_announcement' => $LNG['mvc_announcement'], 'mvc_download' => $LNG['mvc_download'], 'mvc_desc' => $LNG['mvc_desc']));
    $template->show('adm/ModVersionPage.tpl');
}
Esempio n. 17
0
function ShowFlyingFleetPage()
{
    global $LNG;
    $id = HTTP::_GP('id', 0);
    if (!empty($id)) {
        $lock = HTTP::_GP('lock', 0);
        $GLOBALS['DATABASE']->query("UPDATE " . FLEETS . " SET `fleet_busy` = '" . $lock . "' WHERE `fleet_id` = '" . $id . "' AND `fleet_universe` = '" . Universe::getEmulated() . "';");
        $SQL = $lock == 0 ? "NULL" : "'ADM_LOCK'";
        $GLOBALS['DATABASE']->query("UPDATE " . FLEETS_EVENT . " SET `lock` = " . $SQL . " WHERE `fleetID` = " . $id . ";");
    }
    $orderBy = "fleet_id";
    $fleetResult = $GLOBALS['DATABASE']->query("SELECT \n\tfleet.*,\n\tevent.`lock`,\n\tCOUNT(event.fleetID) as error,\n\tpstart.name as startPlanetName,\n\tptarget.name as targetPlanetName,\n\tustart.username as startUserName,\n\tutarget.username as targetUserName,\n\tacs.name as acsName\n\tFROM " . FLEETS . " fleet\n\tLEFT JOIN " . FLEETS_EVENT . " event ON fleetID = fleet_id\n\tLEFT JOIN " . PLANETS . " pstart ON pstart.id = fleet_start_id\n\tLEFT JOIN " . PLANETS . " ptarget ON ptarget.id = fleet_end_id\n\tLEFT JOIN " . USERS . " ustart ON ustart.id = fleet_owner\n\tLEFT JOIN " . USERS . " utarget ON utarget.id = fleet_target_owner\n\tLEFT JOIN " . AKS . " acs ON acs.id = fleet_group\n\tWHERE fleet_universe = " . Universe::getEmulated() . "\n\tGROUP BY event.fleetID\n\tORDER BY " . $orderBy . ";");
    $FleetList = array();
    while ($fleetRow = $GLOBALS['DATABASE']->fetch_array($fleetResult)) {
        $shipList = array();
        $shipArray = array_filter(explode(';', $fleetRow['fleet_array']));
        foreach ($shipArray as $ship) {
            $shipDetail = explode(',', $ship);
            $shipList[$shipDetail[0]] = $shipDetail[1];
        }
        $FleetList[] = array('fleetID' => $fleetRow['fleet_id'], 'lock' => !empty($fleetRow['lock']), 'count' => $fleetRow['fleet_amount'], 'error' => !$fleetRow['error'], 'ships' => $shipList, 'state' => $fleetRow['fleet_mess'], 'starttime' => _date($LNG['php_tdformat'], $fleetRow['start_time'], $USER['timezone']), 'arrivaltime' => _date($LNG['php_tdformat'], $fleetRow['fleet_start_time'], $USER['timezone']), 'stayhour' => round(($fleetRow['fleet_end_stay'] - $fleetRow['fleet_start_time']) / 3600), 'staytime' => $fleetRow['fleet_start_time'] !== $fleetRow['fleet_end_stay'] ? _date($LNG['php_tdformat'], $fleetRow['fleet_end_stay'], $USER['timezone']) : 0, 'endtime' => _date($LNG['php_tdformat'], $fleetRow['fleet_end_time'], $USER['timezone']), 'missionID' => $fleetRow['fleet_mission'], 'acsID' => $fleetRow['fleet_group'], 'acsName' => $fleetRow['acsName'], 'startUserID' => $fleetRow['fleet_owner'], 'startUserName' => $fleetRow['startUserName'], 'startPlanetID' => $fleetRow['fleet_start_id'], 'startPlanetName' => $fleetRow['startPlanetName'], 'startPlanetGalaxy' => $fleetRow['fleet_start_galaxy'], 'startPlanetSystem' => $fleetRow['fleet_start_system'], 'startPlanetPlanet' => $fleetRow['fleet_start_planet'], 'startPlanetType' => $fleetRow['fleet_start_type'], 'targetUserID' => $fleetRow['fleet_target_owner'], 'targetUserName' => $fleetRow['targetUserName'], 'targetPlanetID' => $fleetRow['fleet_end_id'], 'targetPlanetName' => $fleetRow['targetPlanetName'], 'targetPlanetGalaxy' => $fleetRow['fleet_end_galaxy'], 'targetPlanetSystem' => $fleetRow['fleet_end_system'], 'targetPlanetPlanet' => $fleetRow['fleet_end_planet'], 'targetPlanetType' => $fleetRow['fleet_end_type'], 'resource' => array(901 => $fleetRow['fleet_resource_metal'], 902 => $fleetRow['fleet_resource_crystal'], 903 => $fleetRow['fleet_resource_deuterium'], 921 => $fleetRow['fleet_resource_darkmatter']));
    }
    $GLOBALS['DATABASE']->free_result($fleetResult);
    $template = new template();
    $template->assign_vars(array('FleetList' => $FleetList));
    $template->show('FlyingFleetPage.tpl');
}
Esempio n. 18
0
function ShowInformationPage()
{
    global $LNG, $CONF, $USER;
    if (file_exists(ini_get('error_log'))) {
        $Lines = count(file(ini_get('error_log')));
    } else {
        $Lines = 0;
    }
    try {
        $dateTimeZoneServer = new DateTimeZone(Config::get('timezone'));
    } catch (Exception $e) {
        $dateTimeZoneServer = new DateTimeZone(date_default_timezone_get());
    }
    try {
        $dateTimeZoneUser = new DateTimeZone($USER['timezone']);
    } catch (Exception $e) {
        $dateTimeZoneUser = new DateTimeZone(date_default_timezone_get());
    }
    try {
        $dateTimeZonePHP = new DateTimeZone(ini_get('date.timezone'));
    } catch (Exception $e) {
        $dateTimeZonePHP = new DateTimeZone(date_default_timezone_get());
    }
    $dateTimeServer = new DateTime("now", $dateTimeZoneServer);
    $dateTimeUser = new DateTime("now", $dateTimeZoneUser);
    $dateTimePHP = new DateTime("now", $dateTimeZonePHP);
    $template = new template();
    $template->assign_vars(array('info_information' => sprintf($LNG['info_information'], 'http://tracker.2moons.cc/'), 'info' => $_SERVER['SERVER_SOFTWARE'], 'vPHP' => PHP_VERSION, 'vAPI' => PHP_SAPI, 'vGame' => Config::get('VERSION'), 'vMySQLc' => $GLOBALS['DATABASE']->getVersion(), 'vMySQLs' => $GLOBALS['DATABASE']->getServerVersion(), 'root' => $_SERVER['SERVER_NAME'], 'gameroot' => $_SERVER['SERVER_NAME'] . str_replace('/admin.php', '', $_SERVER['PHP_SELF']), 'json' => function_exists('json_encode') ? 'Ja' : 'Nein', 'bcmath' => extension_loaded('bcmath') ? 'Ja' : 'Nein', 'curl' => extension_loaded('curl') ? 'Ja' : 'Nein', 'browser' => $_SERVER['HTTP_USER_AGENT'], 'safemode' => ini_get('safe_mode') ? 'Ja' : 'Nein', 'memory' => ini_get('memory_limit'), 'suhosin' => ini_get('suhosin.request.max_value_length') ? 'Ja' : 'Nein', 'log_errors' => ini_get('log_errors') ? 'Aktiv' : 'Inaktiv', 'errorlog' => ini_get('error_log'), 'errorloglines' => $Lines, 'php_tz' => $dateTimePHP->getOffset() / 3600, 'conf_tz' => $dateTimeServer->getOffset() / 3600, 'user_tz' => $dateTimeUser->getOffset() / 3600));
    $template->show('ShowInformationPage.tpl');
}
Esempio n. 19
0
function ShowClearCachePage()
{
    global $LNG;
    ClearCache();
    $template = new template();
    $template->show('clearcache.tpl');
}
Esempio n. 20
0
function ShowPaybonusPage()
{
    global $LNG;
    $CONF = Config::getAll(NULL, 1);
    if (!empty($_POST)) {
        $pay_before = array('bonus_button' => $CONF['bonus_button'], 'academy_bonus' => $CONF['academy_bonus'], 'premium' => $CONF['premium'], 'stardust_bonus' => $CONF['stardust_bonus'], 'purchase_bonus' => $CONF['purchase_bonus'], 'purchase_bonus_timer' => $CONF['purchase_bonus_timer'], 'cosmonaute' => $CONF['cosmonaute'], 'fleetconf' => $CONF['fleetconf'], 'new_year' => $CONF['new_year']);
        $purchase_bonus = $_POST['percent'];
        $academy_bonus = $_POST['academy_bonus'];
        $bonus_button = $_POST['bonus_button'];
        $premium = $_POST['premium'];
        $stardust_bonus = $_POST['stardust_bonus'];
        $stardust_bonus = $_POST['stardust_bonus'];
        $fleetconf = isset($_POST['fleetconf']) && $_POST['fleetconf'] == 'on' ? 1 : 0;
        $cosmonaute = isset($_POST['cosmonaute']) && $_POST['cosmonaute'] == 'on' ? 1 : 0;
        $new_year = isset($_POST['new_year']) && $_POST['new_year'] == 'on' ? 1 : 0;
        $purchase_bonus_timer = TIMESTAMP + $_POST['days'] * 24 * 60 * 60;
        $pay_after = array('bonus_button' => $bonus_button, 'academy_bonus' => $academy_bonus, 'premium' => $premium, 'stardust_bonus' => $stardust_bonus, 'purchase_bonus' => $purchase_bonus, 'purchase_bonus_timer' => $purchase_bonus_timer, 'fleetconf' => $fleetconf, 'cosmonaute' => $cosmonaute, 'new_year' => $new_year);
        Config::update($pay_after, 1);
        $CONF = Config::getAll(NULL, 1);
        $LOG = new Log(3);
        $LOG->target = 1;
        $LOG->old = $pay_before;
        $LOG->new = $pay_after;
        $LOG->save();
    }
    $template = new template();
    $template->assign_vars(array('academy_bonus' => $CONF['academy_bonus'], 'cosmonaute' => $CONF['cosmonaute'], 'new_year' => $CONF['new_year'], 'bonus_button' => $CONF['bonus_button'], 'fleetconf' => $CONF['fleetconf'], 'premium' => $CONF['premium'], 'stardust_bonus' => $CONF['stardust_bonus'], 'purchase_bonus' => $CONF['purchase_bonus'], 'purchase_bonus_timer' => $CONF['purchase_bonus_timer'], 'bonus_next_active' => $CONF['purchase_bonus_timer'] > TIMESTAMP ? $CONF['purchase_bonus_timer'] - TIMESTAMP : 0, 'bonus_next_active_timer' => $CONF['purchase_bonus_timer'] > TIMESTAMP ? date("d.m.Y H:i:s", $CONF['purchase_bonus_timer']) : 0));
    $template->show('paybonus.tpl');
}
Esempio n. 21
0
function ShowTeamspeakPage()
{
    global $LNG;
    $config = Config::get(Universe::getEmulated());
    if ($_POST) {
        $config_before = array('ts_timeout' => $config->ts_timeout, 'ts_modon' => $config->ts_modon, 'ts_server' => $config->ts_server, 'ts_tcpport' => $config->ts_tcpport, 'ts_udpport' => $config->ts_udpport, 'ts_version' => $config->ts_version, 'ts_login' => $config->ts_login, 'ts_password' => $config->ts_password, 'ts_cron_interval' => $config->ts_cron_interval);
        $ts_modon = isset($_POST['ts_on']) && $_POST['ts_on'] == 'on' ? 1 : 0;
        $ts_server = HTTP::_GP('ts_ip', '');
        $ts_tcpport = HTTP::_GP('ts_tcp', 0);
        $ts_udpport = HTTP::_GP('ts_udp', 0);
        $ts_timeout = HTTP::_GP('ts_to', 0);
        $ts_version = HTTP::_GP('ts_v', 0);
        $ts_login = HTTP::_GP('ts_login', '');
        $ts_password = HTTP::_GP('ts_password', '', true);
        $ts_cron_interval = HTTP::_GP('ts_cron', 0);
        $config_after = array('ts_timeout' => $ts_timeout, 'ts_modon' => $ts_modon, 'ts_server' => $ts_server, 'ts_tcpport' => $ts_tcpport, 'ts_udpport' => $ts_udpport, 'ts_version' => $ts_version, 'ts_login' => $ts_login, 'ts_password' => $ts_password, 'ts_cron_interval' => $ts_cron_interval);
        foreach ($config_after as $key => $value) {
            $config->{$key} = $value;
        }
        $config->save();
        $sql = "UPDATE %%CRONJOBS%%\n\t\tSET isActive = :isActive, `lock` = NULL, nextTime = 0\n\t\tWHERE name = 'teamspeak';";
        Database::get()->update($sql, array(':isActive' => $ts_modon));
        $LOG = new Log(3);
        $LOG->target = 4;
        $LOG->old = $config_before;
        $LOG->new = $config_after;
        $LOG->save();
    }
    $template = new template();
    $template->assign_vars(array('se_save_parameters' => $LNG['se_save_parameters'], 'ts_tcpport' => $LNG['ts_tcpport'], 'ts_serverip' => $LNG['ts_serverip'], 'ts_version' => $LNG['ts_version'], 'ts_active' => $LNG['ts_active'], 'ts_settings' => $LNG['ts_settings'], 'ts_udpport' => $LNG['ts_udpport'], 'ts_timeout' => $LNG['ts_timeout'], 'ts_server_query' => $LNG['ts_server_query'], 'ts_sq_login' => $LNG['ts_login'], 'ts_sq_pass' => $LNG['ts_pass'], 'ts_lng_cron' => $LNG['ts_cron'], 'ts_to' => $config->ts_timeout, 'ts_on' => $config->ts_modon, 'ts_ip' => $config->ts_server, 'ts_tcp' => $config->ts_tcpport, 'ts_udp' => $config->ts_udpport, 'ts_v' => $config->ts_version, 'ts_login' => $config->ts_login, 'ts_password' => $config->ts_password, 'ts_cron' => $config->ts_cron_interval));
    $template->show('TeamspeakPage.tpl');
}
Esempio n. 22
0
function ShowSendMessagesPage()
{
    global $USER, $LNG, $db;
    if ($_GET['mode'] == 'send') {
        switch ($USER['authlevel']) {
            case AUTH_MOD:
                $color = 'yellow';
                break;
            case AUTH_OPS:
                $color = 'skyblue';
                break;
            case AUTH_ADM:
                $color = 'red';
                break;
        }
        $Subject = makebr(request_var('subject', '', true));
        $Message = makebr(request_var('text', '', true));
        if (!empty($Message) && !empty($Subject)) {
            require_once ROOT_PATH . 'includes/functions/BBCode.php';
            $Time = TIMESTAMP;
            $From = '<span style="color:' . $color . ';">' . $LNG['user_level'][$USER['authlevel']] . ' ' . $USER['username'] . '</span>';
            $Subject = '<span style="color:' . $color . ';">' . $Subject . '</span>';
            $Message = '<span style="color:' . $color . ';font-weight:bold;">' . bbcode($Message) . '</span>';
            SendSimpleMessage(0, $USER['id'], TIMESTAMP, 50, $From, $Subject, $Message, 0, $_SESSION['adminuni']);
            $db->query("UPDATE " . USERS . " SET `new_gmessage` = `new_gmessage` + '1', `new_message` = `new_message` + '1' WHERE `universe` = '" . $_SESSION['adminuni'] . "';");
            exit($LNG['ma_message_sended']);
        } else {
            exit($LNG['ma_subject_needed']);
        }
    }
    $template = new template();
    $template->assign_vars(array('mg_empty_text' => $LNG['mg_empty_text'], 'ma_subject' => $LNG['ma_subject'], 'ma_none' => $LNG['ma_none'], 'ma_message' => $LNG['ma_message'], 'ma_send_global_message' => $LNG['ma_send_global_message'], 'ma_characters' => $LNG['ma_characters'], 'button_submit' => $LNG['button_submit']));
    $template->show('adm/SendMessagesPage.tpl');
}
Esempio n. 23
0
function ShowNewsPage()
{
    global $LNG, $USER;
    if ($_GET['action'] == 'send') {
        $edit_id = HTTP::_GP('id', 0);
        $title = $GLOBALS['DATABASE']->sql_escape(HTTP::_GP('title', '', true));
        $text = $GLOBALS['DATABASE']->sql_escape(HTTP::_GP('text', '', true));
        $query = $_GET['mode'] == 2 ? "INSERT INTO " . NEWS . " (`id` ,`user` ,`date` ,`title` ,`text`) VALUES ( NULL , '" . $USER['username'] . "', '" . TIMESTAMP . "', '" . $title . "', '" . $text . "');" : "UPDATE " . NEWS . " SET `title` = '" . $title . "', `text` = '" . $text . "', `date` = '" . TIMESTAMP . "' WHERE `id` = '" . $edit_id . "' LIMIT 1;";
        $GLOBALS['DATABASE']->query($query);
    } elseif ($_GET['action'] == 'delete' && isset($_GET['id'])) {
        $GLOBALS['DATABASE']->query("DELETE FROM " . NEWS . " WHERE `id` = '" . HTTP::_GP('id', 0) . "';");
    }
    $query = $GLOBALS['DATABASE']->query("SELECT * FROM " . NEWS . " ORDER BY id ASC");
    while ($u = $GLOBALS['DATABASE']->fetch_array($query)) {
        $NewsList[] = array('id' => $u['id'], 'title' => $u['title'], 'date' => _date($LNG['php_tdformat'], $u['date'], $USER['timezone']), 'user' => $u['user'], 'confirm' => sprintf($LNG['nws_confirm'], $u['title']));
    }
    $template = new template();
    if ($_GET['action'] == 'edit' && isset($_GET['id'])) {
        $News = $GLOBALS['DATABASE']->getFirstRow("SELECT id, title, text FROM " . NEWS . " WHERE id = '" . $GLOBALS['DATABASE']->sql_escape($_GET['id']) . "';");
        $template->assign_vars(array('mode' => 1, 'nws_head' => sprintf($LNG['nws_head_edit'], $News['title']), 'news_id' => $News['id'], 'news_title' => $News['title'], 'news_text' => $News['text']));
    } elseif ($_GET['action'] == 'create') {
        $template->assign_vars(array('mode' => 2, 'nws_head' => $LNG['nws_head_create']));
    }
    $template->assign_vars(array('NewsList' => $NewsList, 'button_submit' => $LNG['button_submit'], 'nws_total' => sprintf($LNG['nws_total'], count($NewsList)), 'nws_news' => $LNG['nws_news'], 'nws_id' => $LNG['nws_id'], 'nws_title' => $LNG['nws_title'], 'nws_date' => $LNG['nws_date'], 'nws_from' => $LNG['nws_from'], 'nws_del' => $LNG['nws_del'], 'nws_create' => $LNG['nws_create'], 'nws_content' => $LNG['nws_content']));
    $template->show('NewsPage.tpl');
}
Esempio n. 24
0
function ShowMultiIPPage()
{
    global $LNG;
    switch ($_GET['action']) {
        case 'known':
            $GLOBALS['DATABASE']->query("INSERT INTO " . MULTI . " SET userID = " . (int) $_GET['id'] . ";");
            HTTP::redirectTo("admin.php?page=multiips");
            break;
        case 'unknown':
            $GLOBALS['DATABASE']->query("DELETE FROM " . MULTI . " WHERE userID = " . (int) $_GET['id'] . ";");
            HTTP::redirectTo("admin.php?page=multiips");
            break;
    }
    $Query = $GLOBALS['DATABASE']->query("SELECT id, username, email, register_time, onlinetime, user_lastip, IFNULL(multiID, 0) as isKnown FROM " . USERS . " LEFT JOIN " . MULTI . " ON userID = id WHERE `universe` = '" . Universe::getEmulated() . "' AND user_lastip IN (SELECT user_lastip FROM " . USERS . " WHERE `universe` = '" . Universe::getEmulated() . "' GROUP BY user_lastip HAVING COUNT(*)>1) ORDER BY user_lastip, id ASC;");
    $IPs = array();
    while ($Data = $GLOBALS['DATABASE']->fetch_array($Query)) {
        if (!isset($IPs[$Data['user_lastip']])) {
            $IPs[$Data['user_lastip']] = array();
        }
        $Data['register_time'] = _date($LNG['php_tdformat'], $Data['register_time']);
        $Data['onlinetime'] = _date($LNG['php_tdformat'], $Data['onlinetime']);
        $IPs[$Data['user_lastip']][$Data['id']] = $Data;
    }
    $template = new template();
    $template->assign_vars(array('multiGroups' => $IPs));
    $template->show('MultiIPs.tpl');
}
Esempio n. 25
0
/**
 _  \_/ |\ | /¯¯\ \  / /\    |¯¯) |_¯ \  / /¯¯\ |  |   |´¯|¯` | /¯¯\ |\ |5
 ¯  /¯\ | \| \__/  \/ /--\   |¯¯\ |__  \/  \__/ |__ \_/   |   | \__/ | \|Core.
 * @author: Copyright (C) 2011 by Brayan Narvaez (Prinick) developer of xNova Revolution
 * @link: http://www.xnovarevolution.con.ar

 * @package 2Moons
 * @author Slaver <*****@*****.**>
 * @copyright 2009 Lucky <*****@*****.**> (XGProyecto)
 * @copyright 2011 Slaver <*****@*****.**> (Fork/2Moons)
 * @license http://www.gnu.org/licenses/gpl.html GNU GPLv3 License
 * @version 1.3 (2011-01-21)
 * @link http://code.google.com/p/2moons/

 * Please do not remove the credits
*/
function ShowTechTreePage()
{
    global $resource, $requeriments, $LNG, $reslist, $USER, $PLANET;
    $PlanetRess = new ResourceUpdate();
    $PlanetRess->CalcResource();
    $PlanetRess->SavePlanetToDB();
    $template = new template();
    $RequeriList = array();
    foreach ($LNG['tech'] as $Element => $ElementName) {
        if (in_array($Element, $reslist['dmfunc'])) {
            continue;
        }
        if (!isset($resource[$Element])) {
            $TechTreeList[] = $ElementName;
        } else {
            $RequeriList = array();
            if (isset($requeriments[$Element])) {
                foreach ($requeriments[$Element] as $RegID => $RedCount) {
                    $RequeriList[$Element][] = array('id' => $RegID, 'count' => $RedCount, 'own' => isset($PLANET[$resource[$RegID]]) ? $PLANET[$resource[$RegID]] : $USER[$resource[$RegID]]);
                }
            }
            $TechTreeList[] = array('id' => $Element, 'name' => $ElementName, 'need' => $RequeriList);
        }
    }
    $template->assign_vars(array('TechTreeList' => $TechTreeList, 'tt_requirements' => $LNG['tt_requirements'], 'LNG' => $LNG['tech'], 'tt_lvl' => $LNG['tt_lvl']));
    $template->show("techtree_overview.tpl");
}
Esempio n. 26
0
function ShowTeamspeakPage()
{
    global $LNG, $USER;
    $CONF = Config::getAll(NULL, $_SESSION['adminuni']);
    if ($_POST) {
        $config_before = array('ts_timeout' => $CONF['ts_timeout'], 'ts_modon' => $CONF['ts_modon'], 'ts_server' => $CONF['ts_server'], 'ts_tcpport' => $CONF['ts_tcpport'], 'ts_udpport' => $CONF['ts_udpport'], 'ts_version' => $CONF['ts_version'], 'ts_login' => $CONF['ts_login'], 'ts_password' => $CONF['ts_password'], 'ts_cron_interval' => $CONF['ts_cron_interval']);
        $ts_modon = isset($_POST['ts_on']) && $_POST['ts_on'] == 'on' ? 1 : 0;
        $ts_server = HTTP::_GP('ts_ip', '');
        $ts_tcpport = HTTP::_GP('ts_tcp', 0);
        $ts_udpport = HTTP::_GP('ts_udp', 0);
        $ts_timeout = HTTP::_GP('ts_to', 0);
        $ts_version = HTTP::_GP('ts_v', 0);
        $ts_login = HTTP::_GP('ts_login', '');
        $ts_password = HTTP::_GP('ts_password', '', true);
        $ts_cron_interval = HTTP::_GP('ts_cron', 0);
        $config_after = array('ts_timeout' => $ts_timeout, 'ts_modon' => $ts_modon, 'ts_server' => $ts_server, 'ts_tcpport' => $ts_tcpport, 'ts_udpport' => $ts_udpport, 'ts_version' => $ts_version, 'ts_login' => $ts_login, 'ts_password' => $ts_password, 'ts_cron_interval' => $ts_cron_interval);
        Config::update($config_after);
        $GLOBALS['DATABASE']->query("UPDATE " . CRONJOBS . " SET isActive = " . $ts_modon . ", `lock` = NULL, nextTime = 0 WHERE name = 'teamspeak';");
        $CONF = Config::getAll(NULL, $_SESSION['adminuni']);
        $LOG = new Log(3);
        $LOG->target = 4;
        $LOG->old = $config_before;
        $LOG->new = $config_after;
        $LOG->save();
    }
    $template = new template();
    $template->assign_vars(array('se_save_parameters' => $LNG['se_save_parameters'], 'ts_tcpport' => $LNG['ts_tcpport'], 'ts_serverip' => $LNG['ts_serverip'], 'ts_version' => $LNG['ts_version'], 'ts_active' => $LNG['ts_active'], 'ts_settings' => $LNG['ts_settings'], 'ts_udpport' => $LNG['ts_udpport'], 'ts_timeout' => $LNG['ts_timeout'], 'ts_server_query' => $LNG['ts_server_query'], 'ts_sq_login' => $LNG['ts_login'], 'ts_sq_pass' => $LNG['ts_pass'], 'ts_lng_cron' => $LNG['ts_cron'], 'ts_to' => $CONF['ts_timeout'], 'ts_on' => $CONF['ts_modon'], 'ts_ip' => $CONF['ts_server'], 'ts_tcp' => $CONF['ts_tcpport'], 'ts_udp' => $CONF['ts_udpport'], 'ts_v' => $CONF['ts_version'], 'ts_login' => $CONF['ts_login'], 'ts_password' => $CONF['ts_password'], 'ts_cron' => $CONF['ts_cron_interval']));
    $template->show('TeamspeakPage.tpl');
}
Esempio n. 27
0
function ShowVoucherPage()
{
    global $LNG, $USER;
    $template = new template();
    if ($_GET['mode'] == 'delete' && !empty($_GET['i'])) {
        //delete an entry
        $GLOBALS['DATABASE']->query("DELETE from `uni1_reward` where `rewardId` = " . $GLOBALS['DATABASE']->sql_escape($_GET['i']) . " ;");
        $template->message("Voucher Code deleted");
        die;
    }
    if ($_POST) {
        $SQL = "";
        foreach ($_POST as $key => $value) {
            $SQL .= "'" . $value . "',";
        }
        $SQL = substr($SQL, 0, -1);
        $GLOBALS['DATABASE']->query("INSERT INTO `uni1_reward` VALUES (NULL," . $SQL . ");");
        $template->message("Voucher Added");
        die;
    }
    $AllVouchers = array();
    $GetAll = $GLOBALS['DATABASE']->query("SELECT * FROM `uni1_reward` ;");
    if ($GLOBALS['DATABASE']->numRows($GetAll) > 0) {
        while ($x = $GLOBALS['DATABASE']->fetch_array($GetAll)) {
            $AllVouchers[] = $x;
        }
    }
    $template->assign_vars(array('AllVouchers' => $AllVouchers));
    $template->show('VoucherEditor.tpl');
}
 function index($params)
 {
     $tpl = new template("includes/v");
     $tpl->load("filters.html", true, true);
     $tpl->setv("formtitle", "Работа с почтовыми фильтрами");
     $tpl->show();
 }
Esempio n. 29
0
/**
 _  \_/ |\ | /¯¯\ \  / /\    |¯¯) |_¯ \  / /¯¯\ |  |   |´¯|¯` | /¯¯\ |\ |5
 ¯  /¯\ | \| \__/  \/ /--\   |¯¯\ |__  \/  \__/ |__ \_/   |   | \__/ | \|Core.
 * @author: Copyright (C) 2011 by Brayan Narvaez (Prinick) developer of xNova Revolution
 * @link: http://www.xnovarevolution.con.ar

 * @package 2Moons
 * @author Slaver <*****@*****.**>
 * @copyright 2009 Lucky <*****@*****.**> (XGProyecto)
 * @copyright 2011 Slaver <*****@*****.**> (Fork/2Moons)
 * @license http://www.gnu.org/licenses/gpl.html GNU GPLv3 License
 * @version 1.3 (2011-01-21)
 * @link http://code.google.com/p/2moons/

 * Please do not remove the credits
*/
function ShowOverviewPage()
{
    global $LNG, $USER, $CONF;
    $Message = array();
    if ($USER['authlevel'] >= AUTH_ADM) {
        if (file_exists(ROOT_PATH . 'install.php')) {
            $Message[] = sprintf($LNG['ow_file_detected'], 'install.php');
        }
        if (file_exists(ROOT_PATH . 'install.sql')) {
            $Message[] = sprintf($LNG['ow_file_detected'], 'install.sql');
        }
        if (is_writable(ROOT_PATH . 'includes/config.php')) {
            $Message[] = $LNG['ow_config_file_writable'];
        }
        if (!is_writable(ROOT_PATH . 'includes')) {
            $Message[] = sprintf($LNG['ow_dir_not_writable'], 'includes');
        }
        if (!is_writable(ROOT_PATH . 'raports')) {
            $Message[] = sprintf($LNG['ow_dir_not_writable'], 'raports');
        }
        if ($CONF['user_valid'] == 1 && (empty($CONF['smtp_host']) || empty($CONF['smtp_port']) || empty($CONF['smtp_user']) || empty($CONF['smtp_pass']))) {
            $Message[] = $LNG['ow_smtp_errors'];
        }
    }
    $template = new template();
    $template->assign_vars(array('ow_none' => $LNG['ow_none'], 'ow_overview' => $LNG['ow_overview'], 'ow_welcome_text' => $LNG['ow_welcome_text'], 'ow_credits' => $LNG['ow_credits'], 'ow_special_thanks' => $LNG['ow_special_thanks'], 'ow_translator' => $LNG['ow_translator'], 'ow_proyect_leader' => $LNG['ow_proyect_leader'], 'ow_support' => $LNG['ow_support'], 'ow_title' => $LNG['ow_title'], 'ow_forum' => $LNG['ow_forum'], 'ow_donate' => $LNG['ow_donate'], 'Messages' => $Message, 'date' => date('m\\_Y', TIMESTAMP)));
    $template->show('adm/OverviewBody.tpl');
}
Esempio n. 30
0
function ShowConfigPage()
{
    global $CONF, $LNG, $USER, $LANG;
    if (!empty($_POST)) {
        $CONF['game_disable'] = isset($_POST['closed']) && $_POST['closed'] == 'on' ? 1 : 0;
        $CONF['noobprotection'] = isset($_POST['noobprotection']) && $_POST['noobprotection'] == 'on' ? 1 : 0;
        $CONF['debug'] = isset($_POST['debug']) && $_POST['debug'] == 'on' ? 1 : 0;
        $CONF['adm_attack'] = isset($_POST['adm_attack']) && $_POST['adm_attack'] == 'on' ? 1 : 0;
        $CONF['OverviewNewsFrame'] = isset($_POST['newsframe']) && $_POST['newsframe'] == 'on' ? 1 : 0;
        $CONF['capaktiv'] = isset($_POST['capaktiv']) && $_POST['capaktiv'] == 'on' ? 1 : 0;
        $CONF['reg_closed'] = isset($_POST['reg_closed']) && $_POST['reg_closed'] == 'on' ? 1 : 0;
        $CONF['user_valid'] = isset($_POST['user_valid']) && $_POST['user_valid'] == 'on' ? 1 : 0;
        $CONF['ga_active'] = isset($_POST['ga_active']) && $_POST['ga_active'] == 'on' ? 1 : 0;
        $CONF['bgm_active'] = isset($_POST['bgm_active']) && $_POST['bgm_active'] == 'on' ? 1 : 0;
        $CONF['mail_active'] = isset($_POST['mail_active']) && $_POST['mail_active'] == 'on' ? 1 : 0;
        $CONF['OverviewNewsText'] = $_POST['NewsText'];
        $CONF['close_reason'] = request_var('close_reason', '', true);
        $CONF['game_name'] = request_var('game_name', '', true);
        $CONF['forum_url'] = request_var('forum_url', '', true);
        $CONF['game_speed'] = 2500 * request_var('game_speed', 0.0);
        $CONF['fleet_speed'] = 2500 * request_var('fleet_speed', 0.0);
        $CONF['resource_multiplier'] = request_var('resource_multiplier', 0.0);
        $CONF['halt_speed'] = request_var('halt_speed', 0.0);
        $CONF['initial_fields'] = request_var('initial_fields', 0);
        $CONF['metal_basic_income'] = request_var('metal_basic_income', 0);
        $CONF['crystal_basic_income'] = request_var('crystal_basic_income', 0);
        $CONF['deuterium_basic_income'] = request_var('deuterium_basic_income', 0);
        $CONF['norio_basic_income'] = request_var('norio_basic_income', 0);
        $CONF['lang'] = request_var('lang', '');
        $CONF['Defs_Cdr'] = request_var('Defs_Cdr', 0);
        $CONF['Fleet_Cdr'] = request_var('Fleet_Cdr', 0);
        $CONF['noobprotectiontime'] = request_var('noobprotectiontime', 0);
        $CONF['noobprotectionmulti'] = request_var('noobprotectionmulti', 0);
        $CONF['capprivate'] = request_var('capprivate', '');
        $CONF['cappublic'] = request_var('cappublic', '');
        $CONF['min_build_time'] = request_var('min_build_time', 0);
        $CONF['ga_key'] = request_var('ga_key', '', true);
        $CONF['bgm_file'] = request_var('bgm_file', '', true);
        $CONF['mail_use'] = request_var('mail_use', 0);
        $CONF['smail_path'] = request_var('smail_path', '');
        $CONF['smtp_host'] = request_var('smtp_host', '', true);
        $CONF['smtp_port'] = request_var('smtp_port', 0);
        $CONF['smtp_user'] = request_var('smtp_user', '', true);
        $CONF['smtp_sendmail'] = request_var('smtp_sendmail', '', true);
        $CONF['smtp_pass'] = request_var('smtp_pass', '', true);
        $CONF['smtp_ssl'] = request_var('smtp_ssl', '');
        $CONF['ftp_server'] = request_var('ftp_server', '', true);
        $CONF['ftp_user_name'] = request_var('ftp_user_name', '', true);
        $CONF['ftp_root_path'] = request_var('ftp_root_path', '', true);
        $CONF['trade_allowed_ships'] = request_var('trade_allowed_ships', '');
        $CONF['trade_charge'] = request_var('trade_charge', 0.0);
        $CONF['ftp_root_path'] = request_var('ftp_root_path', '', true);
        update_config(array('noobprotectiontime' => $CONF['noobprotectiontime'], 'noobprotectionmulti' => $CONF['noobprotectionmulti'], 'noobprotection' => $CONF['noobprotection'], 'Defs_Cdr' => $CONF['Defs_Cdr'], 'Fleet_Cdr' => $CONF['Fleet_Cdr'], 'game_disable' => $CONF['game_disable'], 'close_reason' => $CONF['close_reason'], 'OverviewNewsFrame' => $CONF['OverviewNewsFrame'], 'reg_closed' => $CONF['reg_closed'], 'OverviewNewsText' => $CONF['OverviewNewsText'], 'game_name' => $CONF['game_name'], 'forum_url' => $CONF['forum_url'], 'game_speed' => $CONF['game_speed'], 'fleet_speed' => $CONF['fleet_speed'], 'resource_multiplier' => $CONF['resource_multiplier'], 'halt_speed' => $CONF['halt_speed'], 'initial_fields' => $CONF['initial_fields'], 'metal_basic_income' => $CONF['metal_basic_income'], 'crystal_basic_income' => $CONF['crystal_basic_income'], 'deuterium_basic_income' => $CONF['deuterium_basic_income'], 'norio_basic_income' => $CONF['norio_basic_income'], 'debug' => $CONF['debug'], 'adm_attack' => $CONF['adm_attack'], 'lang' => $CONF['lang'], 'min_build_time' => $CONF['min_build_time'], 'user_valid' => $CONF['user_valid'], 'trade_charge' => $CONF['trade_charge'], 'trade_allowed_ships' => $CONF['trade_allowed_ships']), false, $_SESSION['adminuni']);
        update_config(array('mail_active' => $CONF['mail_active'], 'mail_use' => $CONF['mail_use'], 'smail_path' => $CONF['smail_path'], 'smtp_host' => $CONF['smtp_host'], 'smtp_port' => $CONF['smtp_port'], 'smtp_user' => $CONF['smtp_user'], 'smtp_pass' => $CONF['smtp_pass'], 'smtp_ssl' => $CONF['smtp_ssl'], 'smtp_sendmail' => $CONF['smtp_sendmail'], 'ftp_server' => $CONF['ftp_server'], 'ftp_user_name' => $CONF['ftp_user_name'], 'ftp_root_path' => $CONF['ftp_root_path'], 'ga_active' => $CONF['ga_active'], 'ga_key' => $CONF['ga_key'], 'bgm_active' => $CONF['bgm_active'], 'bgm_file' => $CONF['bgm_file'], 'capaktiv' => $CONF['capaktiv'], 'capprivate' => $CONF['capprivate'], 'cappublic' => $CONF['cappublic'], 'min_js' => $CONF['min_js']), true);
    }
    $template = new template();
    $template->assign_vars(array('se_server_parameters' => $LNG['se_server_parameters'], 'se_name' => $LNG['se_name'], 'se_cookie_advert' => $LNG['se_cookie_advert'], 'se_lang' => $LNG['se_lang'], 'se_general_speed' => $LNG['se_general_speed'], 'se_fleet_speed' => $LNG['se_fleet_speed'], 'se_halt_speed' => $LNG['se_halt_speed'], 'se_normal_speed' => $LNG['se_normal_speed'], 'se_normal_speed_fleet' => $LNG['se_normal_speed_fleet'], 'se_resources_producion_speed' => $LNG['se_resources_producion_speed'], 'se_normal_speed_resoruces' => $LNG['se_normal_speed_resoruces'], 'se_normal_speed_halt' => $LNG['se_normal_speed_halt'], 'se_forum_link' => $LNG['se_forum_link'], 'se_server_op_close' => $LNG['se_server_op_close'], 'se_server_status_message' => $LNG['se_server_status_message'], 'se_server_planet_parameters' => $LNG['se_server_planet_parameters'], 'se_initial_fields' => $LNG['se_initial_fields'], 'se_metal_production' => $LNG['se_metal_production'], 'se_admin_protection' => $LNG['se_admin_protection'], 'se_crystal_production' => $LNG['se_crystal_production'], 'se_deuterium_production' => $LNG['se_deuterium_production'], 'se_norio_production' => $LNG['se_norio_production'], 'se_several_parameters' => $LNG['se_several_parameters'], 'se_min_build_time' => $LNG['se_min_build_time'], 'se_reg_closed' => $LNG['se_reg_closed'], 'se_verfiy_mail' => $LNG['se_verfiy_mail'], 'se_min_build_time_info' => $LNG['se_min_build_time_info'], 'se_verfiy_mail_info' => $LNG['se_verfiy_mail_info'], 'se_fields' => $LNG['se_fields'], 'se_per_hour' => $LNG['se_per_hour'], 'se_debug_mode' => $LNG['se_debug_mode'], 'se_title_admins_protection' => $LNG['se_title_admins_protection'], 'se_debug_message' => $LNG['se_debug_message'], 'se_ships_cdr_message' => $LNG['se_ships_cdr_message'], 'se_def_cdr_message' => $LNG['se_def_cdr_message'], 'se_ships_cdr' => $LNG['se_ships_cdr'], 'se_def_cdr' => $LNG['se_def_cdr'], 'se_noob_protect' => $LNG['se_noob_protect'], 'se_noob_protect3' => $LNG['se_noob_protect3'], 'se_noob_protect2' => $LNG['se_noob_protect2'], 'se_noob_protect_e2' => $LNG['se_noob_protect_e2'], 'se_noob_protect_e3' => $LNG['se_noob_protect_e3'], 'se_trader_head' => $LNG['se_trader_head'], 'se_trader_ships' => $LNG['se_trader_ships'], 'se_trader_charge' => $LNG['se_trader_charge'], 'se_news_head' => $LNG['se_news_head'], 'se_news_active' => $LNG['se_news_active'], 'se_news_info' => $LNG['se_news_info'], 'se_news' => $LNG['se_news'], 'se_news_limit' => $LNG['se_news_limit'], 'se_recaptcha_head' => $LNG['se_recaptcha_head'], 'se_recaptcha_active' => $LNG['se_recaptcha_active'], 'se_recaptcha_desc' => $LNG['se_recaptcha_desc'], 'se_recaptcha_public' => $LNG['se_recaptcha_public'], 'se_recaptcha_private' => $LNG['se_recaptcha_private'], 'se_smtp' => $LNG['se_smtp'], 'se_mail_active' => $LNG['se_mail_active'], 'se_mail_use' => $LNG['se_mail_use'], 'se_smail_path' => $LNG['se_smail_path'], 'se_smtp_info' => $LNG['se_smtp_info'], 'se_smtp_host' => $LNG['se_smtp_host'], 'se_smtp_host_info' => $LNG['se_smtp_host_info'], 'se_smtp_ssl' => $LNG['se_smtp_ssl'], 'se_smtp_ssl_info' => $LNG['se_smtp_ssl_info'], 'se_smtp_port' => $LNG['se_smtp_port'], 'se_smtp_port_info' => $LNG['se_smtp_port_info'], 'se_smtp_user' => $LNG['se_smtp_user'], 'se_smtp_pass' => $LNG['se_smtp_pass'], 'se_smtp_sendmail' => $LNG['se_smtp_sendmail'], 'se_smtp_sendmail_info' => $LNG['se_smtp_sendmail_info'], 'se_ftp' => $LNG['se_ftp'], 'se_ftp_info' => $LNG['se_ftp_info'], 'se_ftp_host' => $LNG['se_ftp_host'], 'se_ftp_user' => $LNG['se_ftp_user'], 'se_ftp_dir' => $LNG['se_ftp_dir'], 'se_ftp_dir_info' => $LNG['se_ftp_dir_info'], 'se_google' => $LNG['se_google'], 'se_google_active' => $LNG['se_google_active'], 'se_google_info' => $LNG['se_google_info'], 'se_google_key' => $LNG['se_google_key'], 'se_google_key_info' => $LNG['se_google_key_info'], 'se_bgm_login' => $LNG['se_bgm_login'], 'se_bgm_active' => $LNG['se_bgm_active'], 'se_bgm_info' => $LNG['se_bgm_info'], 'se_bgm_file' => $LNG['se_bgm_file'], 'se_bgm_file_info' => $LNG['se_bgm_file_info'], 'se_google_key_info' => $LNG['se_google_key_info'], 'se_save_parameters' => $LNG['se_save_parameters'], 'game_name' => $CONF['game_name'], 'game_speed' => $CONF['game_speed'] / 2500, 'fleet_speed' => $CONF['fleet_speed'] / 2500, 'resource_multiplier' => $CONF['resource_multiplier'], 'halt_speed' => $CONF['halt_speed'], 'forum_url' => $CONF['forum_url'], 'initial_fields' => $CONF['initial_fields'], 'metal_basic_income' => $CONF['metal_basic_income'], 'crystal_basic_income' => $CONF['crystal_basic_income'], 'deuterium_basic_income' => $CONF['deuterium_basic_income'], 'norio_basic_income' => $CONF['norio_basic_income'], 'game_disable' => $CONF['game_disable'], 'close_reason' => $CONF['close_reason'], 'debug' => $CONF['debug'], 'adm_attack' => $CONF['adm_attack'], 'defenses' => $CONF['Defs_Cdr'], 'shiips' => $CONF['Fleet_Cdr'], 'noobprot' => $CONF['noobprotection'], 'noobprot2' => $CONF['noobprotectiontime'], 'noobprot3' => $CONF['noobprotectionmulti'], 'mail_active' => $CONF['mail_active'], 'mail_use' => $CONF['mail_use'], 'smail_path' => $CONF['smail_path'], 'smtp_host' => $CONF['smtp_host'], 'smtp_port' => $CONF['smtp_port'], 'smtp_user' => $CONF['smtp_user'], 'smtp_pass' => $CONF['smtp_pass'], 'smtp_sendmail' => $CONF['smtp_sendmail'], 'smtp_ssl' => $CONF['smtp_ssl'], 'user_valid' => $CONF['user_valid'], 'newsframe' => $CONF['OverviewNewsFrame'], 'reg_closed' => $CONF['reg_closed'], 'NewsTextVal' => $CONF['OverviewNewsText'], 'capprivate' => $CONF['capprivate'], 'cappublic' => $CONF['cappublic'], 'capaktiv' => $CONF['capaktiv'], 'min_build_time' => $CONF['min_build_time'], 'ftp_server' => $CONF['ftp_server'], 'ftp_user_name' => $CONF['ftp_user_name'], 'ftp_user_pass' => str_pad('', strlen($CONF['ftp_user_pass']), 'x'), 'ftp_root_path' => $CONF['ftp_root_path'], 'ga_active' => $CONF['ga_active'], 'ga_key' => $CONF['ga_key'], 'bgm_active' => $CONF['bgm_active'], 'bgm_file' => $CONF['bgm_file'], 'trade_allowed_ships' => $CONF['trade_allowed_ships'], 'trade_charge' => $CONF['trade_charge'], 'Selector' => array('langs' => $LANG->getAllowedLangs(false), 'mail' => $LNG['se_mail_sel'], 'encry' => array('' => $LNG['se_smtp_ssl_1'], 'ssl' => $LNG['se_smtp_ssl_2'], 'tls' => $LNG['se_smtp_ssl_3'])), 'lang' => $CONF['lang']));
    $template->show('adm/ConfigBody.tpl');
}