define('USER_THEME', AdminServUI::theme($args['theme'])); // LANG define('USER_LANG', AdminServUI::lang($args['lang'])); // VÉRIFICATION DES DROITS $checkRightsList = array('./config/adminserv.cfg.php' => 666, './config/servers.cfg.php' => 666, './config/adminlevel.cfg.php' => 666); if (in_array(true, AdminServConfig::$LOGS)) { if (!Utils::isWinServer()) { $checkRightsList['./logs/'] = 777; } } AdminServ::checkRights($checkRightsList); // LOGOUT AdminServEvent::logout(); // LOGS AdminServLogs::initialize(); // PLUGINS define('USER_PLUGIN', AdminServPlugin::getCurrent()); // INDEX unset($args['theme'], $args['lang']); if (AdminServEvent::isLoggedIn()) { // SWITCH SERVER AdminServEvent::switchServer(); // SERVER CONNECTION if (AdminServ::initialize()) { // PAGES BACKOFFICE AdminServUI::initBackPage(); } } else { // PAGES FRONTOFFICE AdminServUI::initFrontPage(); }
<section class="maps hasMenu hasFolders"> <section class="cadre left menu"> <?php echo AdminServUI::getMapsMenuList(); ?> </section> <section class="cadre middle folders"> <?php echo AdminServUI::getMapsDirectoryList($data['currentDir'], $args['directory']); ?> </section> <section class="cadre right matchset"> <h1><?php echo Utils::t('MatchSettings'); ?> </h1> <div class="title-detail"> <ul> <li class="path"><?php echo $data['mapsDirectoryPath'] . $args['directory']; ?> </li> <li class="last"><input type="checkbox" name="checkAll" id="checkAll" value="" /></li> </ul> </div> <form method="post" action="?p=<?php echo USER_PAGE; if ($args['directory']) {
<?php // LECTURE $data['serverLines'] = AdminServ::getChatServerLines(); $lastNicknameUsed = Utils::readCookieData('adminserv_user', 2); $data['nickname'] = $lastNicknameUsed != null ? $lastNicknameUsed : Utils::t('Nickname'); $colorList = array('$ff0' => Utils::t('Color'), '$000' => Utils::t('Black'), '$f00' => Utils::t('Red'), '$0f0' => Utils::t('Green'), '$00f' => Utils::t('Blue'), '$f80' => Utils::t('Orange'), '$f0f' => Utils::t('Pink'), '$888' => Utils::t('Grey'), '$fff' => Utils::t('White')); $data['colorOptions'] = null; $lastColorUsed = Utils::readCookieData('adminserv_user', 3); foreach ($colorList as $colorCode => $colorName) { $selected = $colorCode == $lastColorUsed ? ' selected="selected"' : null; $data['colorOptions'] .= '<option value="' . $colorCode . '"' . $selected . '>' . $colorName . '</option>'; } $lastDestination = null; $lastDestinationTitle = Utils::t('server'); if (isset($_SESSION['adminserv']['chat_dst'])) { $lastDestination = $lastDestinationTitle = $_SESSION['adminserv']['chat_dst']; } $data['destination']['list'] = AdminServUI::getPlayerList($lastDestination); $data['destination']['title'] = Utils::t('Message destination') . ' : ' . $lastDestinationTitle;
<section class="maps hasMenu"> <section class="cadre left menu"> <?php echo AdminServUI::getMapsMenuList(); ?> </section> <section class="cadre right order"> <h1><?php echo Utils::t('Order'); ?> </h1> <form method="post" action="?p=<?php echo USER_PAGE; ?> "> <h2><?php echo Utils::t('Automatic sort'); ?> </h2> <div class="autoSortMode options-radio-inline"> <ul> <li class="ui-state-default"> <input class="text" type="radio" name="sortMode" id="sortModeName" value="name" /> <div class="name"><?php echo Utils::t('Name'); ?> </div> <div class="icon"> <span class="ui-icon ui-icon-arrowthick-1-n"></span> <span class="ui-icon ui-icon-arrowthick-1-s"></span>
/** * Récupère les lignes du chat serveur * * @param bool $hideServerLines -> Masquer les lignes provenant d'un gestionnaire de serveur * @return string */ public static function getChatServerLines($hideServerLines = false) { global $client; $out = null; if (!$client->query('GetChatLines')) { $out = '[' . $client->getErrorCode() . '] ' . $client->getErrorMessage(); } else { $langCode = AdminServUI::lang(); $chatLines = $client->getResponse(); foreach ($chatLines as $line) { if (self::isServerLine($line)) { if ($hideServerLines) { unset($line); } else { $tradLines = array('$99FThis round is a draw.', '$99FThe $<$00FBlue team$> wins this round.', '$99FThe $<$F00Red team$> wins this round.'); if (in_array($line, $tradLines)) { foreach ($tradLines as $tradLine) { if ($line == $tradLine) { if ($langCode == 'en') { $line = '$999' . TmNick::toText(TmNick::stripNadeoCode($tradLine, array('$<', '$>'))); } else { $line = '$999' . TmNick::toText(Utils::t($tradLine)); } break; } } } else { if (strstr($line, '$fffAdmin:')) { $pattern = '$ff0]$z'; $lineEx = explode($pattern, $line); $nickname = $lineEx[0] . $pattern; $message = TmNick::toText(trim($lineEx[1])); $line = $nickname . ' $666' . $message; } else { $line = '$999' . TmNick::toText($line); } } } } else { $lineEx = explode('$>', $line); $nickname = TmNick::stripNadeoCode($lineEx[0], array('$s', '[$<')); $message = TmNick::toText(substr($lineEx[1], 2)); $line = '$s$ff0[' . $nickname . '$g$ff0]$z $666' . $message; } if (isset($line)) { $out .= TmNick::toHtml($line, 10); } } } return $out; }
} Utils::redirection(false, '?p=' . USER_PAGE); } } } } } } } } // LECTURE $client->addCall('GetBanList', array(AdminServConfig::LIMIT_PLAYERS_LIST, 0)); $client->addCall('GetBlackList', array(AdminServConfig::LIMIT_PLAYERS_LIST, 0)); $client->addCall('GetGuestList', array(AdminServConfig::LIMIT_PLAYERS_LIST, 0)); $client->addCall('GetIgnoreList', array(AdminServConfig::LIMIT_PLAYERS_LIST, 0)); if (!$client->multiquery()) { AdminServ::error(); } else { $queriesData = $client->getMultiqueryResponse(); $data['banlist']['list'] = $queriesData['GetBanList']; $data['blacklist']['list'] = $queriesData['GetBlackList']; $data['guestlist']['list'] = $queriesData['GetGuestList']; $data['ignorelist']['list'] = $queriesData['GetIgnoreList']; $data['banlist']['count'] = count($data['banlist']['list']); $data['blacklist']['count'] = count($data['blacklist']['list']); $data['guestlist']['count'] = count($data['guestlist']['list']); $data['ignorelist']['count'] = count($data['ignorelist']['list']); } // Liste des joueurs présent sur le serveur $data['players']['listOptions'] = AdminServUI::getPlayerList(); $data['players']['count'] = AdminServ::getNbPlayers();
<?php // INCLUDES session_start(); if (!isset($_SESSION['adminserv']['sid'])) { exit; } $configPath = '../../' . $_SESSION['adminserv']['path'] . 'config/'; require_once $configPath . 'adminlevel.cfg.php'; require_once $configPath . 'adminserv.cfg.php'; require_once $configPath . 'extension.cfg.php'; require_once $configPath . 'servers.cfg.php'; require_once '../core/adminserv.php'; AdminServConfig::$PATH_RESOURCES = '../'; AdminServ::getClass(); AdminServUI::lang(); // ISSET if (isset($_GET['mode'])) { $mode = addslashes($_GET['mode']); } else { $mode = null; } if (isset($_GET['sort'])) { $sort = addslashes($_GET['sort']); } else { $sort = null; } if ($mode) { $_SESSION['adminserv']['mode']['general'] = $mode; } // DATA
echo ' checked="checked"'; } ?> value="" /> </td> <td class="preview"></td> </tr> <tr> <td class="key"><label for="filterDefaultGameMode"><?php echo Utils::t('Default game mode'); ?> </label></td> <td class="value"> <select class="width2" name="filterDefaultGameMode" id="filterDefaultGameMode"> <?php echo AdminServUI::getGameModeList($data['matchSettings']['filter']['ForceDefaultGameMode']); ?> </select> </td> <td class="preview"></td> </tr> </table> </fieldset> </div> <div class="fright save"> <input class="button light" type="submit" name="savematchsetting" id="savematchsetting" data-nomap="<?php echo Utils::t('No map selected for the MatchSettings.'); ?> " value="<?php echo Utils::t('Save');
echo AdminServUI::getGameInfosField($data['gameInfos'], 'Number of laps', 'LapsNbLaps'); ?> <?php echo AdminServUI::getGameInfosField($data['gameInfos'], Utils::t('Time limit') . ' <span>(' . Utils::t('sec') . ')</span>', 'LapsTimeLimit'); ?> </table> </fieldset> <fieldset id="gameMode-cup" class="gameinfos_cup" hidden="hidden"> <legend><img src="<?php echo AdminServConfig::$PATH_RESOURCES; ?> images/16/rt_cup.png" alt="" /><?php echo AdminServ::getGameModeName(5); ?> </legend> <table class="game_infos"> <?php echo AdminServUI::getGameInfosField($data['gameInfos'], 'Points limit', 'CupPointsLimit'); ?> <?php echo AdminServUI::getGameInfosField($data['gameInfos'], 'Rounds per map', 'CupRoundsPerMap'); ?> <?php echo AdminServUI::getGameInfosField($data['gameInfos'], 'Number of winners', 'CupNbWinners'); ?> <?php echo AdminServUI::getGameInfosField($data['gameInfos'], 'All WarmUp duration', 'CupWarmUpDuration'); ?> </table> </fieldset>
/** * Inclue les fichiers pour le rendu d'un plugin * * @param string $pluginName -> Le nom du dossier plugin * @return html */ public static function renderPlugin($pluginName = null) { global $client, $translate, $args; if ($pluginName === null) { $pluginName = USER_PLUGIN; } // Tente de récupérer les plugins d'une autre config self::setPluginsList(); // Création du rendu du plugin $pluginPath = AdminServConfig::$PATH_PLUGINS . $pluginName . '/'; $scriptFile = $pluginPath . 'script.php'; $viewFile = $pluginPath . 'view.php'; if (file_exists($scriptFile) && file_exists($viewFile)) { // Process require_once $scriptFile; // Terminate client if (isset($client) && $client->socket != null) { $client->Terminate(); } // Header AdminServUI::getHeader(); // Content echo '<section class="plugins hasMenu">' . '<section class="cadre left menu">' . self::getMenuList() . '</section>' . '<section class="cadre right">' . '<h1>' . self::getConfig($pluginName, 'name') . '</h1>'; require_once $viewFile; echo '</section>' . '</section>'; // Footer AdminServUI::getFooter(); AdminServLogs::add('access', 'Plugin: ' . $pluginName); } else { AdminServ::error(Utils::t('Plugin error: script.php or view.php file is missing.')); AdminServUI::getHeader(); AdminServUI::getFooter(); } }
?> <li><a class="button light<?php if (USER_PAGE == 'config-addserver') { echo ' active'; } ?> " href="?p=config-addserver<?php if (defined('IS_SERVER_EDITION')) { echo '&id=' . $args['id']; } ?> "><?php echo defined('IS_SERVER_EDITION') ? Utils::t('Edit server') : Utils::t('Add server'); ?> </a></li> <?php $hasServer = AdminServServerConfig::hasServer(); ?> <?php if (OnlineConfig::ADD_ONLY !== true && $hasServer) { ?> <li><a class="button light<?php if (USER_PAGE == 'config-serversorder') { echo ' active'; } ?> " href="?p=config-serversorder"><?php echo Utils::t('Servers order'); ?> </a></li> <?php
} else { $_SESSION['adminserv']['transfer_billid'] = $client->getResponse(); AdminServLogs::add('action', 'Transfer ' . $playerToServerAmount . ' planets from to ' . $playerToServerLogin . ' player login'); } } } Utils::redirection(false, '?p=' . USER_PAGE); } /* GET */ $client->addCall('GetServerPlanets'); if (isset($_SESSION['adminserv']['transfer_billid']) && $_SESSION['adminserv']['transfer_billid'] != null) { $client->addCall('GetBillState', array($_SESSION['adminserv']['transfer_billid'])); } if (!$client->multiquery()) { AdminServ::error(); } else { $queriesData = $client->getMultiqueryResponse(); // Planets number $nbPlanets = $queriesData['GetServerPlanets']; // Transfer status if (isset($queriesData['GetBillState'])) { $billState = $queriesData['GetBillState']; $transferState = Utils::t('Transaction') . ' #' . $billState['TransactionId'] . ' : ' . $billState['StateName']; } else { $transferState = '<i>' . Utils::t('No transfer made.') . '</i>'; } } // Players $playerCount = AdminServ::getNbPlayers(); $getPlayerListUI = AdminServUI::getPlayerList(); $client->Terminate();
// Affichage de DisplayServ ?> <section class="displayserv"> <?php if (AdminServConfig::USE_DISPLAYSERV) { ?> <link rel="stylesheet" href="<?php echo AdminServConfig::$PATH_RESOURCES; ?> css/displayserv.css" /> <script src="<?php echo AdminServConfig::$PATH_RESOURCES; ?> js/displayserv.js"></script> <script> $(document).ready(function(){ $('#displayserv').displayServ({ color: '<?php echo AdminServUI::getThemeColor(); ?> ' }); }); </script> <div id="displayserv"></div> <?php } ?> </section> <?php }
?> " /> </td> <td class="preview"></td> </tr> </table> </fieldset> <?php } ?> <?php if (AdminServAdminLevel::hasPermission('gameinfos_gamemode_options')) { ?> <?php echo AdminServUI::getTemplate('gameinfos-gamemode'); ?> <?php } ?> </div> <?php if (SERVER_MATCHSET && AdminServAdminLevel::hasPermission('maps_matchsettings_save')) { ?> <div class="fleft options-checkbox"> <input class="text inline" type="checkbox" name="SaveCurrentMatchSettings" id="SaveCurrentMatchSettings"<?php if (AdminServConfig::AUTOSAVE_MATCHSETTINGS === true) { echo ' checked="checked"'; } ?>