Exemplo n.º 1
0
require_once get_path('incRepositorySys') . '/lib/configHtml.class.php';
require_once get_path('incRepositorySys') . '/lib/user.lib.php';
/* ************************************************************************** */
/* Process
/* ************************************************************************** */
$form = '';
if (!isset($_REQUEST['config_code'])) {
    $dialogBox->error(get_lang('Wrong parameters'));
} else {
    // get config_code
    $config_code = trim($_REQUEST['config_code']);
    $newPropertyList = isset($_REQUEST['property']) ? $_REQUEST['property'] : array();
    // new config object
    $config = new ConfigHtml($config_code, 'config_list.php');
    // load configuration
    if ($config->load()) {
        $section = isset($_REQUEST['section']) ? $_REQUEST['section'] : null;
        // display section menu
        $form .= $config->display_section_menu($section);
        // init config name
        $config_name = $config->get_conf_name();
        if (isset($_REQUEST['cmd']) && !empty($newPropertyList)) {
            if ('save' == $_REQUEST['cmd']) {
                // validate config
                if ($config->validate($newPropertyList)) {
                    // save config file
                    if ($config->save()) {
                        $dialogBox->success(get_lang('Properties for %config_name, (%config_code) are now effective on server.', array('%config_name' => get_lang($config_name), '%config_code' => $config_code)));
                    } else {
                        $error = true;
                        $dialogBox->error($config->backlog->output());