* Copyright (C) 2004 Eric Seigne * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2004 Sebastien DiCintio * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2016 Raphaƫl Doursenaud * Copyright (C) 2024 MDW * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ /** * \file htdocs/install/fileconf.php * \ingroup install * \brief Ask all information required to build Dolibarr htdocs/conf/conf.php file (will be written to disk on next page step1) */ include_once 'inc.php'; global $langs; $err = 0; $setuplang = GETPOST("selectlang", 'alpha', 3) ? GETPOST("selectlang", 'alpha', 3) : (GETPOST('lang', 'alpha', 1) ? GETPOST('lang', 'alpha', 1) : 'auto'); $langs->setDefaultLang($setuplang); $langs->loadLangs(array("install", "errors")); dolibarr_install_syslog("- fileconf: entering fileconf.php page"); // You can force preselected values of the config step of Dolibarr by adding a file // install.forced.php into directory htdocs/install (This is the case with some wizard // installer like DoliWamp, DoliMamp or DoliBuntu). // We first init "forced values" to nothing. if (!isset($force_install_noedit)) { $force_install_noedit = ''; // 1=To block vars specific to distrib, 2 to block all technical parameters } if (!isset($force_install_type)) { $force_install_type = ''; } if (!isset($force_install_dbserver)) { $force_install_dbserver = ''; } if (!isset($force_install_port)) { $force_install_port = ''; } if (!isset($force_install_database)) { $force_install_database = ''; } if (!isset($force_install_prefix)) { $force_install_prefix = ''; } if (!isset($force_install_createdatabase)) { $force_install_createdatabase = ''; } if (!isset($force_install_databaselogin)) { $force_install_databaselogin = ''; } if (!isset($force_install_databasepass)) { $force_install_databasepass = ''; } if (!isset($force_install_databaserootlogin)) { $force_install_databaserootlogin = ''; } if (!isset($force_install_databaserootpass)) { $force_install_databaserootpass = ''; } // Now we load forced values from install.forced.php file. $useforcedwizard = false; $forcedfile = "./install.forced.php"; if ($conffile == "/etc/dolibarr/conf.php") { $forcedfile = "/etc/dolibarr/install.forced.php"; // Must be after inc.php } if (@file_exists($forcedfile)) { $useforcedwizard = true; include_once $forcedfile; } /* * View */ session_start(); // To be able to keep info into session (used for not losing pass during navigation. pass must not transit through parameters) pHeader($langs->trans("ConfigurationFile"), "step1", "set", "", (empty($force_dolibarr_js_JQUERY) ? '' : $force_dolibarr_js_JQUERY.'/'), 'main-inside-bis'); // Test if we can run a first install process if (!is_writable($conffile)) { print $langs->trans("ConfFileIsNotWritable", $conffiletoshow); dolibarr_install_syslog("fileconf: config file is not writable", LOG_WARNING); dolibarr_install_syslog("- fileconf: end"); pFooter(1, $setuplang, 'jscheckparam'); exit; } if (!empty($force_install_message)) { print '

'.$langs->trans($force_install_message).'
'; /*print ''; print '
'.$langs->trans("ShowEditTechnicalParameters").'
'; */ } ?>

webserver trans("WebServer"); ?>

> '.$langs->trans("WithNoSlashAtTheEnd")."
"; print $langs->trans("Examples").":
"; ?>
  • /var/www/dolibarr/htdocs
  • C:/wwwroot/dolibarr/htdocs
> '.$langs->trans("WithNoSlashAtTheEnd")."
"; print $langs->trans("DirectoryRecommendation")."
"; print $langs->trans("Examples").":
"; ?>
  • /var/lib/dolibarr/documents
  • C:/My Documents/dolibarr/documents
> trans("Examples").":
"; ?>
  • http://localhost/
  • http://www.myserver.com:8180/dolibarr
  • https://www.myvirtualfordolibarr.com/
> trans("CheckToForceHttps"); ?>

webserver trans("DolibarrDatabase"); ?>

> trans("DatabaseName"); ?>
= '.$class::VERSIONMIN.')'; // Switch to mysql if mysqli is not present if ($defaultype == 'mysqli' && !function_exists('mysqli_connect')) { $defaultype = 'mysql'; } // Show line into list if ($type == 'mysql') { $testfunction = 'mysql_connect'; $testclass = ''; } if ($type == 'mysqli') { $testfunction = 'mysqli_connect'; $testclass = ''; } if ($type == 'pgsql') { $testfunction = 'pg_connect'; $testclass = ''; } if ($type == 'mssql') { $testfunction = 'mssql_connect'; $testclass = ''; } if ($type == 'sqlite') { $testfunction = ''; $testclass = 'PDO'; } if ($type == 'sqlite3') { $testfunction = ''; $testclass = 'SQLite3'; } $option .= ''; } } } ?> trans("DatabaseType"); ?>
> trans("ServerAddressDescription"); ?>
> trans("ServerPortDescription"); ?>
> trans("DatabasePrefixDescription"); ?>
> trans("CheckToCreateDatabase"); ?>
> trans("AdminLogin"); ?>
> trans("AdminPassword"); ?>
> trans("CheckToCreateUser"); ?>

webserver trans("DatabaseSuperUserAccess"); ?>

0 && !empty($force_install_databaserootlogin)) { print ' disabled'; } ?> > trans("DatabaseRootLoginDescription"); ?>
" 0 && !empty($force_install_databaserootpass)) { print ' disabled'; /* May be removed by javascript*/ } ?> > trans("KeepEmptyIfNoPassword"); ?>
close(); Not database connection yet dolibarr_install_syslog("- fileconf: end"); pFooter($err, $setuplang, 'jscheckparam');