Exemple #1
0
        $srvoptsImportExport = $_POST['srvoptsImportExport'];
    }
    // 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();