protected function getPageData() { global $USER, $CONF, $LNG, $UNI; $dateTimeServer = new DateTime("now"); $dateTimeUser = $dateTimeServer; $universeSelect = array(); $uniAllConfig = Config::getAll('universe'); foreach ($uniAllConfig as $uniID => $uniConfig) { $universeSelect[$uniID] = $uniConfig['uni_name'] . ($uniConfig['game_disable'] == 0 ? t('uni_closed') : ''); } $this->tplObj->assign_vars(array('recaptchaEnable' => Config::get('capaktiv'), 'recaptchaPublicKey' => Config::get('cappublic'), 'gameName' => Config::get('game_name'), 'facebookEnable' => Config::get('fb_on'), 'fb_key' => Config::get('fb_apikey'), 'mailEnable' => Config::get('mail_active'), 'reg_close' => Config::get('reg_closed'), 'referralEnable' => Config::get('ref_active'), 'analyticsEnable' => Config::get('ga_active'), 'analyticsUID' => Config::get('ga_key'), 'lang' => $LNG->getLanguage(), 'UNI' => $UNI, 'VERSION' => Config::get('VERSION'), 'REV' => substr(Config::get('VERSION'), -4), 'languages' => Language::getAllowedLangs(false), 'universeSelect' => $universeSelect, 'copyright' => t($LNG['footer_copy'], Config::get('game_name')))); }
function initCustomConfig() { $this->setConfig('dbConnection', 'link', $GLOBALS['DATABASE']); $this->setConfig('chatBotName', false, Config::get('chat_botname')); $this->setConfig('allowUserMessageDelete', false, (bool) Config::get('chat_allowdelmes')); $this->setConfig('allowNickChange', false, (bool) Config::get('chat_nickchange')); $this->setConfig('chatClosed', false, (bool) Config::get('chat_closed')); $this->setConfig('allowPrivateChannels', false, (bool) Config::get('chat_allowchan')); $this->setConfig('allowPrivateMessages', false, (bool) Config::get('chat_allowmes')); $this->setConfig('defaultChannelName', false, Config::get('chat_channelname')); $this->setConfig('showChannelMessages', false, (bool) Config::get('chat_logmessage')); $this->setConfig('langAvailable', false, Language::getAllowedLangs()); $this->setConfig('langNames', false, Language::getAllowedLangs(false)); $this->setConfig('forceAutoLogin', false, true); $this->setConfig('contentType', false, 'text/html'); }
public function login_main() { global $USER, $CONF, $LNG, $LANG, $UNI; $this->assign_vars(array('cappublic' => $CONF['cappublic'], 'servername' => $CONF['game_name'], 'forum_url' => $CONF['forum_url'], 'fb_active' => $CONF['fb_on'], 'fb_key' => $CONF['fb_apikey'], 'forum' => $LNG['forum'], 'register_closed' => $LNG['register_closed'], 'fb_perm' => sprintf($LNG['fb_perm'], $CONF['game_name']), 'menu_index' => $LNG['menu_index'], 'menu_news' => $LNG['menu_news'], 'menu_rules' => $LNG['menu_rules'], 'menu_agb' => $LNG['menu_agb'], 'menu_pranger' => $LNG['menu_pranger'], 'menu_top100' => $LNG['menu_top100'], 'menu_disclamer' => $LNG['menu_disclamer'], 'music_off' => $LNG['music_off'], 'music_on' => $LNG['music_on'], 'game_captcha' => $CONF['capaktiv'], 'reg_close' => $CONF['reg_closed'], 'ga_active' => $CONF['ga_active'], 'ga_key' => $CONF['ga_key'], 'bgm_active' => $CONF['bgm_active'], 'bgm_file' => $CONF['bgm_file'], 'mail_active' => $CONF['mail_active'], 'getajax' => request_var('getajax', 0), 'lang' => $LANG->getUser(), 'UNI' => $UNI, 'langs' => Language::getAllowedLangs())); }
function initCustomConfig() { define('MODE', 'CHAT'); define('ROOT_PATH', str_replace('\\', '/', dirname(dirname(__FILE__))) . '/'); set_include_path(ROOT_PATH); $database = array(); require 'includes/config.php'; $this->setConfig('dbConnection', 'type', 'mysqli'); $this->setConfig('dbConnection', 'host', $database['host']); $this->setConfig('dbConnection', 'user', $database['user']); $this->setConfig('dbConnection', 'pass', $database['userpw']); $this->setConfig('dbConnection', 'name', $database['databasename']); $dbTableNames = Database::get()->getDbTableNames(); $dbTableNames = array_combine($dbTableNames['keys'], $dbTableNames['names']); $this->setConfig('dbTableNames', 'online', $dbTableNames['%%CHAT_ON%%']); $this->setConfig('dbTableNames', 'messages', $dbTableNames['%%CHAT_MES%%']); $this->setConfig('dbTableNames', 'bans', $dbTableNames['%%CHAT_BAN%%']); $this->setConfig('dbTableNames', 'invitations', $dbTableNames['%%CHAT_INV%%']); $config = Config::get(); $this->setConfig('chatBotName', false, $config->chat_botname); $this->setConfig('allowUserMessageDelete', false, (bool) $config->chat_allowdelmes); $this->setConfig('allowNickChange', false, (bool) $config->chat_nickchange); $this->setConfig('chatClosed', false, (bool) $config->chat_closed); $this->setConfig('allowPrivateChannels', false, (bool) $config->chat_allowchan); $this->setConfig('allowPrivateMessages', false, (bool) $config->chat_allowmes); $this->setConfig('defaultChannelName', false, $config->chat_channelname); $this->setConfig('showChannelMessages', false, (bool) $config->chat_logmessage); $this->setConfig('langAvailable', false, Language::getAllowedLangs()); $this->setConfig('langNames', false, Language::getAllowedLangs(false)); $this->setConfig('forceAutoLogin', false, true); $this->setConfig('contentType', false, 'text/html'); }
protected function getPageData() { global $USER, $CONF, $LNG, $UNI; $time = microtime(); $time = explode(' ', $time); $time = $time[1] + $time[0]; $start = $time; $dateTimeServer = new DateTime("now"); $dateTimeUser = $dateTimeServer; $uniResult = $GLOBALS['DATABASE']->query("SELECT users_amount, COUNT(DISTINCT inac.id) as inactive, COUNT(planet.id) as planet\n\tFROM " . CONFIG . " conf\n\tLEFT JOIN " . USERS . " as inac ON uni = inac.universe AND inac.onlinetime < " . (TIMESTAMP - INACTIVE) . "\n\tLEFT JOIN " . PLANETS . " as planet ON uni = planet.universe\n\tGROUP BY conf.uni, inac.universe, planet.universe\n\tORDER BY uni ASC;"); while ($uniRow = $GLOBALS['DATABASE']->fetch_array($uniResult)) { $users_amount = $uniRow['users_amount']; $active = $uniRow['users_amount'] - $uniRow['inactive']; } $onLine = $GLOBALS['DATABASE']->getFirstCell("SELECT COUNT(*) FROM " . USERS . " WHERE onlinetime > '" . (TIMESTAMP - 15 * 60) . "';"); $time = microtime(); $time = explode(' ', $time); $time = $time[1] + $time[0]; $finish = $time; $total_time = round($finish - $start, 4); $this->tplObj->assign_vars(array('total_time' => $total_time, 'users_amount' => $users_amount, 'onLine' => $onLine, 'recaptchaEnable' => Config::get('capaktiv'), 'recaptchaPublicKey' => Config::get('cappublic'), 'gameName' => Config::get('game_name'), 'facebookEnable' => Config::get('fb_on'), 'fb_key' => Config::get('fb_apikey'), 'mailEnable' => Config::get('mail_active'), 'reg_close' => Config::get('reg_closed'), 'referralEnable' => Config::get('ref_active'), 'analyticsEnable' => Config::get('ga_active'), 'analyticsUID' => Config::get('ga_key'), 'lang' => $LNG->getLanguage(), 'UNI' => $UNI, 'VERSION' => Config::get('VERSION'), 'REV' => substr(Config::get('VERSION'), -4), 'languages' => Language::getAllowedLangs(false))); }
protected function getPageData() { global $LNG; $config = Config::get(); $this->tplObj->assign_vars(array('recaptchaEnable' => $config->capaktiv, 'recaptchaPublicKey' => $config->cappublic, 'gameName' => $config->game_name, 'facebookEnable' => $config->fb_on, 'fb_key' => $config->fb_apikey, 'mailEnable' => $config->mail_active, 'reg_close' => $config->reg_closed, 'referralEnable' => $config->ref_active, 'analyticsEnable' => $config->ga_active, 'analyticsUID' => $config->ga_key, 'lang' => $LNG->getLanguage(), 'UNI' => Universe::current(), 'VERSION' => $config->VERSION, 'REV' => substr($config->VERSION, -4), 'languages' => Language::getAllowedLangs(false), 'loginInfo' => '', 'universeSelect' => $this->getUniverseSelector(), 'lastUni' => Universe::getLastUni(), 'metaTitle' => $LNG['metaTitle'], 'metaDescription' => $LNG['metaDescription'], 'metaKeywords' => $LNG['metaKeywords'])); }
* @license http://www.gnu.org/licenses/gpl.html GNU GPLv3 License * @version 1.5 (2011-07-31) * @info $Id$ * @link http://2moons.cc/ */ define('MODE', 'INSTALL'); define('ROOT_PATH', str_replace('\\', '/', dirname(dirname(__FILE__))) . '/'); set_include_path(ROOT_PATH); chdir(ROOT_PATH); require 'includes/common.php'; $THEME->setUserTheme('gow'); $LNG = new Language(); $LNG->getUserAgentLanguage(); $LNG->includeData(array('L18N', 'INGAME', 'INSTALL', 'CUSTOM')); $template = new template(); $template->assign(array('lang' => $LNG->getLanguage(), 'Selector' => $LNG->getAllowedLangs(false), 'title' => $LNG['title_install'] . ' • Antarium', 'header' => $LNG['menu_install'], 'canUpgrade' => file_exists('includes/config.php') && filesize('includes/config.php') !== 0)); $enableInstallToolFile = 'includes/ENABLE_INSTALL_TOOL'; $quickStartFile = 'includes/FIRST_INSTALL'; // If include/FIRST_INSTALL is present and can be deleted, automatically create include/ENABLE_INSTALL_TOOL if (is_file($quickStartFile) && is_writeable($quickStartFile) && unlink($quickStartFile)) { @touch($enableInstallToolFile); } // Only allow Install Tool access if the file "include/ENABLE_INSTALL_TOOL" is found if (is_file($enableInstallToolFile) && time() - filemtime($enableInstallToolFile) > 3600) { $content = file_get_contents($enableInstallToolFile); $verifyString = 'KEEP_FILE'; if (trim($content) !== $verifyString) { // Delete the file if it is older than 3600s (1 hour) unlink($enableInstallToolFile); } }
protected function getPageData() { global $USER, $THEME; $time = microtime(); $time = explode(' ', $time); $time = $time[1] + $time[0]; $start = $time; if ($this->getWindow() === 'full') { $this->getNavigationData(); $this->getCronjobsTodo(); $this->GetOnlineData(); $this->GetPlanetData(); $this->GetPlanetDataBis(); } $dateTimeServer = new DateTime("now"); if (isset($USER['timezone'])) { try { $dateTimeUser = new DateTime("now", new DateTimeZone($USER['timezone'])); } catch (Exception $e) { $dateTimeUser = $dateTimeServer; } } else { $dateTimeUser = $dateTimeServer; } $time = microtime(); $time = explode(' ', $time); $time = $time[1] + $time[0]; $finish = $time; $total_time = round($finish - $start, 4); $langen = 0; if ($USER['lang'] == 'en') { $langen = 1; } elseif ($USER['lang'] == 'fr') { $langen = 2; } elseif ($USER['lang'] == 'de') { $langen = 3; } $this->tplObj->assign_vars(array('langen' => $langen, 'TIMESTM' => TIMESTAMP, 'total_time' => $total_time, 'vmode' => $USER['urlaubs_modus'], 'authlevel' => $USER['authlevel'], 'userID' => $USER['id'], 'bodyclass' => $this->getWindow(), 'game_name' => Config::get('game_name'), 'uni_name' => Config::get('uni_name'), 'ga_active' => Config::get('ga_active'), 'ga_key' => Config::get('ga_key'), 'debug' => Config::get('debug'), 'VERSION' => Config::get('VERSION'), 'date' => explode("|", date('Y\\|n\\|j\\|G\\|i\\|s\\|Z', TIMESTAMP)), 'REV' => substr(Config::get('VERSION'), -4), 'Offset' => $dateTimeUser->getOffset() - $dateTimeServer->getOffset(), 'queryString' => $this->getQueryString(), 'themeSettings' => $THEME->getStyleSettings(), 'languages' => Language::getAllowedLangs(false))); }
$THEME->setUserTheme('gow'); $LANG = new Language(); $LANG->GetLangFromBrowser(); $LANG->includeLang(array('INGAME', 'INSTALL')); $Mode = request_var('mode', 'intro'); $Page = request_var('page', 1); $phpself = $_SERVER['PHP_SELF']; $nextpage = $Page + 1; $template = new template(); $template->assign_vars(array('lang' => $LANG->GetUser(), 'title' => 'Instalador • xNova Revolution', 'intro_instal' => $LNG['intro_instal'], 'menu_intro' => $LNG['menu_intro'], 'menu_install' => $LNG['menu_install'], 'menu_license' => $LNG['menu_license'], 'menu_convert' => $LNG['menu_convert'])); switch ($Mode) { case 'license': $template->show('install/ins_license.tpl'); break; case 'intro': $template->assign_vars(array('Selector' => $LANG->getAllowedLangs(false), 'intro_text' => $LNG['intro_text'], 'intro_welcome' => $LNG['intro_welcome'], 'intro_install' => $LNG['intro_install'], 'intro_lang' => $LNG['intro_lang'])); $template->show('install/ins_intro.tpl'); break; case 'req': $error = 0; $ftp = 0; if (version_compare(PHP_VERSION, "5.2.5", ">=")) { $PHP = "<span class=\"yes\">" . $LNG['reg_yes'] . ", " . PHP_VERSION . "</span>"; } else { $PHP = "<span class=\"no\">" . $LNG['reg_no'] . ", " . PHP_VERSION . "</span>"; $error++; } if (class_exists('mysqli')) { $mysqli = "<span class=\"yes\">" . $LNG['reg_yes'] . "</span>"; } else { $mysqli = "<span class=\"no\">" . $LNG['reg_no'] . "</span>";
* @link http://2moons.cc/ */ if (!function_exists('spl_autoload_register')) { exit("PHP is missing <a href=\"http://php.net/spl\">Standard PHP Library (SPL)</a> support"); } $UNI = 1; define('MODE', 'INSTALL'); define('ROOT_PATH', str_replace('\\', '/', dirname(dirname(__FILE__))) . '/'); chdir(ROOT_PATH); require 'includes/common.php'; $THEME->setUserTheme('gow'); $LNG = new Language(); $LNG->getUserAgentLanguage(); $LNG->includeData(array('L18N', 'INGAME', 'INSTALL')); $template = new template(); $template->assign(array('lang' => $LNG->getLanguage(), 'Selector' => $LNG->getAllowedLangs(false), 'title' => $LNG['title_install'] . ' • 2Moons', 'header' => $LNG['menu_install'])); $enableInstallToolFile = 'includes/ENABLE_INSTALL_TOOL'; $quickstartFile = 'includes/FIRST_INSTALL'; // If include/FIRST_INSTALL is present and can be deleted, automatically create include/ENABLE_INSTALL_TOOL if (is_file($quickstartFile) && is_writeable($quickstartFile) && unlink($quickstartFile)) { @touch($enableInstallToolFile); } // Only allow Install Tool access if the file "include/ENABLE_INSTALL_TOOL" is found if (is_file($enableInstallToolFile) && time() - filemtime($enableInstallToolFile) > 3600) { $content = file_get_contents($enableInstallToolFile); $verifyString = 'KEEP_FILE'; if (trim($content) !== $verifyString) { // Delete the file if it is older than 3600s (1 hour) unlink($enableInstallToolFile); } }