28 if (!defined(
'DOL_DOCUMENT_ROOT')) define(
'DOL_DOCUMENT_ROOT',
'..');
30 require_once DOL_DOCUMENT_ROOT.
'/core/class/translate.class.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions.lib.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
36 $conf =
new stdClass();
37 $conf->global =
new stdClass();
38 $conf->file =
new stdClass();
39 $conf->db =
new stdClass();
40 $conf->syslog =
new stdClass();
43 $_REQUEST[
"logtohtml"] = 1;
53 $includeconferror =
'';
56 $conffiletoshowshort =
"conf.php";
58 $conffile =
"../conf/conf.php";
59 $conffiletoshow =
"htdocs/conf/conf.php";
61 if (!file_exists($conffile))
63 $conffile =
"/etc/dolibarr/conf.php";
64 $conffiletoshow =
"/etc/dolibarr/conf.php";
69 if (!defined(
'DONOTLOADCONF') && file_exists($conffile) && filesize($conffile) > 8)
71 $result = include_once $conffile;
74 if (empty($dolibarr_main_db_type)) $dolibarr_main_db_type =
'mysql';
77 if ($dolibarr_main_db_type ==
'mysql') {
78 $dolibarr_main_db_type =
'mysqli';
81 if (empty($dolibarr_main_db_port) && ($dolibarr_main_db_type ==
'mysqli')) $dolibarr_main_db_port =
'3306';
84 $dolibarr_main_data_root = isset($dolibarr_main_data_root) ?trim($dolibarr_main_data_root) :
'';
85 $dolibarr_main_url_root = isset($dolibarr_main_url_root) ?trim($dolibarr_main_url_root) :
'';
86 $dolibarr_main_url_root_alt = isset($dolibarr_main_url_root_alt) ?trim($dolibarr_main_url_root_alt) :
'';
87 $dolibarr_main_document_root = isset($dolibarr_main_document_root) ?trim($dolibarr_main_document_root) :
'';
88 $dolibarr_main_document_root_alt = isset($dolibarr_main_document_root_alt) ?trim($dolibarr_main_document_root_alt) :
'';
91 if (!empty($dolibarr_main_document_root) && !preg_match(
'/^[\\/]+$/', $dolibarr_main_document_root)) $dolibarr_main_document_root = preg_replace(
'/[\\/]+$/',
'', $dolibarr_main_document_root);
92 if (!empty($dolibarr_main_url_root) && !preg_match(
'/^[\\/]+$/', $dolibarr_main_url_root)) $dolibarr_main_url_root = preg_replace(
'/[\\/]+$/',
'', $dolibarr_main_url_root);
93 if (!empty($dolibarr_main_data_root) && !preg_match(
'/^[\\/]+$/', $dolibarr_main_data_root)) $dolibarr_main_data_root = preg_replace(
'/[\\/]+$/',
'', $dolibarr_main_data_root);
94 if (!empty($dolibarr_main_document_root_alt) && !preg_match(
'/^[\\/]+$/', $dolibarr_main_document_root_alt)) $dolibarr_main_document_root_alt = preg_replace(
'/[\\/]+$/',
'', $dolibarr_main_document_root_alt);
95 if (!empty($dolibarr_main_url_root_alt) && !preg_match(
'/^[\\/]+$/', $dolibarr_main_url_root_alt)) $dolibarr_main_url_root_alt = preg_replace(
'/[\\/]+$/',
'', $dolibarr_main_url_root_alt);
98 if (!empty($dolibarr_main_document_root))
100 $result =
conf($dolibarr_main_document_root);
105 if (!empty($dolibarr_main_document_root) && !empty($dolibarr_main_db_type))
107 $result = include_once $dolibarr_main_document_root.
"/core/db/".$dolibarr_main_db_type.
'.class.php';
110 $includeconferror =
'ErrorBadValueForDolibarrMainDBType';
114 $includeconferror =
'ErrorBadValueForDolibarrMainDocumentRoot';
117 $includeconferror =
'ErrorBadFormatForConfFile';
120 $conf->global->MAIN_LOGTOHTML = 1;
123 if (!isset($dolibarr_main_db_prefix) || !$dolibarr_main_db_prefix) $dolibarr_main_db_prefix =
'llx_';
124 define(
'MAIN_DB_PREFIX', (isset($dolibarr_main_db_prefix) ? $dolibarr_main_db_prefix :
''));
126 define(
'DOL_CLASS_PATH',
'class/');
127 define(
'DOL_DATA_ROOT', (isset($dolibarr_main_data_root) ? $dolibarr_main_data_root :
''));
128 define(
'DOL_MAIN_URL_ROOT', (isset($dolibarr_main_url_root) ? $dolibarr_main_url_root :
''));
129 $uri = preg_replace(
'/^http(s?):\/\//i',
'', constant(
'DOL_MAIN_URL_ROOT'));
130 $suburi = strstr($uri,
'/');
131 if ($suburi ==
'/') $suburi =
'';
132 define(
'DOL_URL_ROOT', $suburi);
134 if (empty($character_set_client)) $character_set_client =
"UTF-8";
135 $conf->file->character_set_client = strtoupper($character_set_client);
136 if (empty($dolibarr_main_db_character_set)) $dolibarr_main_db_character_set = ($conf->db->type ==
'mysqli' ?
'utf8' :
'');
137 $conf->db->character_set = $dolibarr_main_db_character_set;
138 if (empty($dolibarr_main_db_collation)) $dolibarr_main_db_collation = ($conf->db->type ==
'mysqli' ?
'utf8_unicode_ci' :
'');
139 $conf->db->dolibarr_main_db_collation = $dolibarr_main_db_collation;
140 if (empty($dolibarr_main_db_encryption)) $dolibarr_main_db_encryption = 0;
141 $conf->db->dolibarr_main_db_encryption = $dolibarr_main_db_encryption;
142 if (empty($dolibarr_main_db_cryptkey)) $dolibarr_main_db_cryptkey =
'';
143 $conf->db->dolibarr_main_db_cryptkey = $dolibarr_main_db_cryptkey;
145 if (empty($conf->db->user)) $conf->db->user =
'';
150 if (
GETPOST(
'lang',
'aZ09')) $langs->setDefaultLang(
GETPOST(
'lang',
'aZ09'));
151 else $langs->setDefaultLang(
'auto');
153 $bc[
false] =
' class="bg1"';
154 $bc[
true] =
' class="bg2"';
163 function conf($dolibarr_main_document_root)
166 global $dolibarr_main_db_type;
167 global $dolibarr_main_db_host;
168 global $dolibarr_main_db_port;
169 global $dolibarr_main_db_name;
170 global $dolibarr_main_db_user;
171 global $dolibarr_main_db_pass;
172 global $character_set_client;
174 $return = include_once $dolibarr_main_document_root.
'/core/class/conf.class.php';
175 if (!$return)
return -1;
178 $conf->db->type = trim($dolibarr_main_db_type);
179 $conf->db->host = trim($dolibarr_main_db_host);
180 $conf->db->port = trim($dolibarr_main_db_port);
181 $conf->db->name = trim($dolibarr_main_db_name);
182 $conf->db->user = trim($dolibarr_main_db_user);
183 $conf->db->pass = trim($dolibarr_main_db_pass);
185 if (empty($conf->db->dolibarr_main_db_collation)) $conf->db->dolibarr_main_db_collation =
'utf8_unicode_ci';
199 function pHeader($soutitre, $next, $action =
'none')
203 $langs->load(
"main");
204 $langs->load(
"admin");
207 header(
"Content-type: text/html; charset=".$conf->file->character_set_client);
208 header(
"X-Content-Type-Options: nosniff");
210 print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">'.
"\n";
211 print '<html manifest="'.DOL_URL_ROOT.
'/cache.manifest">'.
"\n";
213 print '<meta http-equiv="content-type" content="text/html; charset='.$conf->file->character_set_client.
'">'.
"\n";
214 print '<meta name="robots" content="index,follow">'.
"\n";
215 print '<meta name="viewport" content="width=device-width, initial-scale=1.0">'.
"\n";
216 print '<meta name="keywords" content="help, center, dolibarr, doliwamp">'.
"\n";
217 print '<meta name="description" content="Dolibarr help center">'.
"\n";
218 print '<link rel="stylesheet" type="text/css" href="default.css">'.
"\n";
219 print '<title>'.$langs->trans(
"DolibarrHelpCenter").
'</title>'.
"\n";
220 print '</head>'.
"\n";
222 print '<body class="center">'.
"\n";
224 print '<div class="noborder centpercent center valignmiddle inline-block">';
225 print '<img src="helpcenter.png" alt="logohelpcenter" class="inline-block"><br><br>';
226 print '<span class="titre inline-block">'.$soutitre.
'</span>'.
"\n";
237 function pFooter($nonext = 0, $setuplang =
'')
240 $langs->load(
"main");
241 $langs->load(
"admin");
243 print '</body>'.
"\n";
244 print '</html>'.
"\n";
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
pHeader($subtitle, $next, $action= 'set', $param= '', $forcejqueryurl= '', $csstable= 'main-inside')
Show HTML header of install pages.
Class to stock current configuration.
conf($dolibarr_main_document_root)
Load conf file (file must exists)
Class to manage translations.
print $_SERVER["PHP_SELF"]
Edit parameters.
pFooter($nonext=0, $setuplang= '', $jscheckfunction= '', $withpleasewait=0)
Print HTML footer of install pages.
print
Draft customers invoices.