if (isset($_GET['op'])) {
    $operation = addslashes($_GET['op']);
} else {
    $operation = null;
}
if (isset($_GET['select'])) {
    $selection = $_GET['select'];
} else {
    $selection = null;
}
// DATA
$out = null;
if (AdminServ::initialize() && $path != null) {
    // Maps
    if ($path == 'currentServerSelection') {
        $mapsImport = AdminServ::getMapList();
    } else {
        $currentDir = Folder::read($path, AdminServConfig::$MATCHSET_HIDDEN_FOLDERS, AdminServConfig::$MATCHSET_EXTENSION, intval(AdminServConfig::RECENT_STATUS_PERIOD * 3600));
        $mapsImport = AdminServ::getLocalMapList($currentDir, $directory);
    }
    // Faire une sélection
    if ($operation == 'setSelection') {
        // On supprime les maps non sélectionnées
        if ($selection != null && count($selection) > 0) {
            foreach ($mapsImport['lst'] as $id => $values) {
                if (!in_array($id, $selection)) {
                    unset($mapsImport['lst'][$id]);
                }
            }
        } else {
            foreach ($mapsImport['lst'] as $id => $values) {
Esempio n. 2
0
<?php

// GAME VERSION
if (SERVER_VERSION_NAME == 'TmForever') {
    $queries = array('chooseNextMap' => 'ChooseNextChallengeList');
} else {
    $queries = array('chooseNextMap' => 'ChooseNextMapList');
}
// ACTIONS
if (isset($_POST['save']) && isset($_POST['list']) && $_POST['list'] != null) {
    $list = explode(',', $_POST['list']);
    if (!$client->query($queries['chooseNextMap'], $list)) {
        AdminServ::error();
    } else {
        AdminServLogs::add('action', 'Order map list');
        Utils::redirection(false, '?p=' . USER_PAGE);
    }
}
// MAPLIST
$data['maps'] = AdminServ::getMapList();
unset($data['maps']['lst'][$data['maps']['cid']]);
Esempio n. 3
0
}
$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']['maps'] = $mode;
}
// DATA
if (AdminServ::initialize()) {
    $out = AdminServ::getMapList($sort);
}
// OUT
$client->Terminate();
echo json_encode($out);