Exemplo n.º 1
0
<?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();
// DATA
$out = array();
if (AdminServ::initialize()) {
    $path = AdminServ::getMapsDirectoryPath();
    $out = Folder::getArborescence($path, AdminServConfig::$MAPS_HIDDEN_FOLDERS, substr_count($path, '/'));
}
// OUT
$client->Terminate();
echo json_encode($out);
Exemplo n.º 2
0
<?php

// LOCAL MODE
$localPages = array('maps-local', 'maps-upload', 'maps-matchset', 'maps-creatematchset');
$data['mapsDirectoryPath'] = AdminServ::getMapsDirectoryPath();
define('IS_LOCAL', file_exists($data['mapsDirectoryPath']));
// LECTURE
if (IS_LOCAL && in_array(USER_PAGE, $localPages)) {
    if (!Utils::isWinServer()) {
        $checkRightsList[$data['mapsDirectoryPath']] = 755;
        $checkRightsList[AdminServConfig::$PATH_RESOURCES . 'cache'] = 777;
        AdminServ::checkRights($checkRightsList);
    }
    // Read current directory
    $matchsettingsPages = in_array(USER_PAGE, array('maps-matchset', 'maps-creatematchset'));
    $hiddenFolders = $matchsettingsPages ? AdminServConfig::$MATCHSET_HIDDEN_FOLDERS : AdminServConfig::$MAPS_HIDDEN_FOLDERS;
    $hiddenFiles = $matchsettingsPages ? AdminServConfig::$MAP_EXTENSION : AdminServConfig::$MATCHSET_EXTENSION;
    $data['currentDir'] = Folder::read($data['mapsDirectoryPath'] . $args['directory'], $hiddenFolders, $hiddenFiles, intval(AdminServConfig::RECENT_STATUS_PERIOD * 3600));
} else {
    $notLocalPages = array('maps-local', 'maps-matchset', 'maps-creatematchset');
    if (in_array(USER_PAGE, $notLocalPages)) {
        Utils::redirection(false, '?p=maps-list');
    }
}
// ACTIONS
$data['hasDirectory'] = null;
if ($args['directory']) {
    $data['hasDirectory'] = '&d=' . $args['directory'];
}
// Nouveau dossier
if (isset($_POST['newFolderValid']) && $_POST['newFolderName'] != null || isset($_POST['newFolderName'])) {