<?php

// INCLUDES
session_start();
$configPath = '../../' . $_SESSION['adminserv']['path'] . 'config/';
require_once $configPath . 'adminlevel.cfg.php';
require_once $configPath . 'adminserv.cfg.php';
require_once $configPath . 'servers.cfg.php';
require_once '../core/adminserv.php';
AdminServConfig::$PATH_RESOURCES = '../';
AdminServ::getClass();
// ISSET
if (isset($_GET['srv'])) {
    $serverName = $_GET['srv'];
} else {
    $serverName = null;
}
$out = array();
if ($serverName != null) {
    $out = AdminServAdminLevel::getServerList($serverName);
}
echo json_encode($out);
示例#2
0
    }
    // Enregistrement
    if ($ChangeAuthPassword) {
        if (USER_ADMINLEVEL === $ChangeAuthLevel) {
            $_SESSION['adminserv']['password'] = $ChangeAuthPassword;
        }
        AdminServ::info(Utils::t('You changed the password "!authLevel", remember it at the next connection!', array('!authLevel' => $ChangeAuthLevel)));
        AdminServLogs::add('action', 'Change authentication password for ' . $ChangeAuthLevel . ' level');
    } elseif ($srvoptsImportExport) {
        // Import
        if ($srvoptsImportExport == 'Import') {
            $srvoptsImportName = $_POST['srvoptsImportName'];
            if ($srvoptsImportName != 'none') {
                $struct = AdminServ::importServerOptions($srvoptsConfigDirectory . $srvoptsImportName);
                if (AdminServ::setServerOptions($struct)) {
                    AdminServLogs::add('action', 'Import server options from ' . $srvoptsConfigDirectory . $srvoptsImportName);
                }
            }
        } elseif ($srvoptsImportExport == 'Export') {
            $srvoptsExportName = Str::replaceChars($_POST['srvoptsExportName']);
            AdminServ::exportServerOptions($srvoptsConfigDirectory . $srvoptsExportName . '.txt', $struct);
        }
    } elseif (AdminServ::setServerOptions($struct)) {
        AdminServLogs::add('action', 'Save server options');
    }
    Utils::redirection(false, '?p=' . USER_PAGE);
}
// LECTURE
$data['srvOpt'] = AdminServ::getServerOptions();
$data['adminLevels'] = AdminServAdminLevel::getServerList();