Esempio n. 1
0
            if (!Utils::isWinServer()) {
                AdminServ::checkRights(array($srvConfigDirectory => 777));
            }
            if (!file_exists($srvoptsConfigDirectory)) {
                if (($result = Folder::create($srvoptsConfigDirectory)) !== true) {
                    AdminServ::error(Utils::t('Unable to create the folder') . ' : ' . $srvoptsConfigDirectory . ' (' . $result . ')');
                }
            }
            $data['srvoptsConfigFiles'] = Folder::read($srvoptsConfigDirectory, array(), array(), intval(AdminServConfig::RECENT_STATUS_PERIOD * 3600));
        }
    }
}
// ENREGISTREMENT
if (isset($_POST['savesrvopts'])) {
    // Récupération des données
    $struct = AdminServ::getServerOptionsStruct();
    $ChangeAuthPassword = null;
    if (isset($_POST['ChangeAuthPassword']) && $_POST['ChangeAuthPassword'] != null) {
        $ChangeAuthLevel = $_POST['ChangeAuthLevel'];
        $ChangeAuthPassword = trim($_POST['ChangeAuthPassword']);
    }
    $srvoptsImportExport = false;
    if (array_key_exists('srvoptsImportExport', $_POST)) {
        $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)));