$phpwcms["templates"] = clean_slweg($_POST["templates"]);
        $phpwcms["ftp_path"] = clean_slweg($_POST["ftp_path"]);
        $phpwcms["file_path"] = $phpwcms["file_path"] ? $phpwcms["file_path"] : "phpwcms_filestorage";
        $phpwcms["templates"] = $phpwcms["templates"] ? $phpwcms["templates"] : "phpwcms_template";
        $phpwcms["content_path"] = $phpwcms["content_path"] ? $phpwcms["content_path"] : "content";
        $phpwcms["cimage_path"] = $phpwcms["cimage_path"] ? $phpwcms["cimage_path"] : "images";
        $phpwcms["ftp_path"] = $phpwcms["ftp_path"] ? $phpwcms["ftp_path"] : "phpwcms_ftp";
        write_conf_file($phpwcms);
        header("Location: setup.php?step=4");
        exit;
    }
    if ($step == 4 && $do) {
        $phpwcms["file_maxsize"] = intval($_POST["file_maxsize"]);
        $phpwcms["content_width"] = intval($_POST["content_width"]);
        $phpwcms["img_list_width"] = intval($_POST["img_list_width"]);
        $phpwcms["img_list_height"] = intval($_POST["img_list_height"]);
        $phpwcms["img_prev_width"] = intval($_POST["img_prev_width"]);
        $phpwcms["img_prev_height"] = intval($_POST["img_prev_height"]);
        $phpwcms["max_time"] = intval($_POST["max_time"]);
        $phpwcms["file_maxsize"] = $phpwcms["file_maxsize"] ? $phpwcms["file_maxsize"] : 2097152;
        $phpwcms["content_width"] = $phpwcms["content_width"] ? $phpwcms["content_width"] : 538;
        $phpwcms["img_list_width"] = $phpwcms["img_list_width"] ? $phpwcms["img_list_width"] : 100;
        $phpwcms["img_list_height"] = $phpwcms["img_list_height"] ? $phpwcms["img_list_height"] : 75;
        $phpwcms["img_prev_width"] = $phpwcms["img_prev_width"] ? $phpwcms["img_prev_width"] : 538;
        $phpwcms["img_prev_height"] = $phpwcms["img_prev_height"] ? $phpwcms["img_prev_height"] : 400;
        $phpwcms["max_time"] = $phpwcms["max_time"] ? $phpwcms["max_time"] : 1800;
        write_conf_file($phpwcms);
        header("Location: setup.php?step=5");
        exit;
    }
}
Exemple #2
0
 // Force https
 $main_force_https = GETPOST("main_force_https") && (GETPOST("main_force_https") == "on" || GETPOST("main_force_https") == 1) ? '1' : '0';
 // Use alternative directory
 $main_use_alt_dir = GETPOST("main_use_alt_dir") && (GETPOST("main_use_alt_dir") == "on" || GETPOST("main_use_alt_dir") == 1) ? '' : '//';
 // Alternative root directory name
 $main_alt_dir_name = GETPOST("main_alt_dir_name") && GETPOST("main_alt_dir_name") != '' ? GETPOST("main_alt_dir_name") : 'custom';
 // Write conf file on disk
 if (!$error) {
     // Save old conf file on disk
     if (file_exists("{$conffile}")) {
         // We must ignore errors as an existing old file may already exists and not be replacable or
         // the installer (like for ubuntu) may not have permission to create another file than conf.php.
         // Also no other process must be able to read file or we expose the new file, so content with password.
         @dol_copy($conffile, $conffile . '.old', '0400');
     }
     $error += write_conf_file($conffile);
 }
 // Write main.inc.php and master.inc.php into documents/custom dir
 $error += write_main_file($main_data_dir . '/custom/main.inc.php', $main_dir);
 $error += write_master_file($main_data_dir . '/custom/master.inc.php', $main_dir);
 // Create database and admin user database
 if (!$error) {
     // We reload configuration file
     conf($dolibarr_main_document_root);
     print '<tr><td>';
     print $langs->trans("ConfFileReload");
     print '</td>';
     print '<td><img src="../theme/eldy/img/tick.png" alt="Ok"></td></tr>';
     $userroot = isset($_POST["db_user_root"]) ? $_POST["db_user_root"] : "";
     $passroot = isset($_POST["db_pass_root"]) ? $_POST["db_pass_root"] : "";
     // Si creation utilisateur admin demandee, on le cree
/**
 * Write modified config in the config file
 * @param Array array to write in file
 * @return string Error/Success message
 */
function setConfMulti($array)
{
    $configArray = parse_ini_file("reaver.conf");
    foreach ($array as $key => $value) {
        $configArray[$key] = $value;
    }
    $ok = write_conf_file($configArray, "reaver.conf");
    if ($ok) {
        return "Settings updated !";
    } else {
        return "Error while saving settings";
    }
}