dolibarr 21.0.0-beta
filefunc.inc.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2002-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2003 Xavier Dutoit <doli@sydesy.com>
4 * Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
5 * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
6 * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
7 * Copyright (C) 2005-2011 Regis Houssin <regis.houssin@inodbox.com>
8 * Copyright (C) 2005 Simon Tosser <simon@kornog-computing.com>
9 * Copyright (C) 2006 Andre Cianfarani <andre.cianfarani@acdeveloppement.net>
10 * Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
11 * Copyright (C) 2015 Bahfir Abbes <bafbes@gmail.com>
12 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
13 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
14 *
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with this program. If not, see <https://www.gnu.org/licenses/>.
27 */
28
35if (!defined('DOL_APPLICATION_TITLE')) {
36 define('DOL_APPLICATION_TITLE', 'Dolibarr');
37}
38if (!defined('DOL_VERSION')) {
39 define('DOL_VERSION', '21.0.0-beta'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c
40}
41
42if (!defined('EURO')) {
43 define('EURO', chr(128));
44}
45
46// Define syslog constants
47if (!defined('LOG_DEBUG')) {
48 if (!function_exists("syslog")) {
49 // For PHP versions without syslog (like running on Windows OS)
50 define('LOG_EMERG', 0);
51 define('LOG_ALERT', 1);
52 define('LOG_CRIT', 2);
53 define('LOG_ERR', 3);
54 define('LOG_WARNING', 4);
55 define('LOG_NOTICE', 5);
56 define('LOG_INFO', 6);
57 define('LOG_DEBUG', 7);
58 }
59}
60
61// End of common declaration part
62if (defined('DOL_INC_FOR_VERSION_ERROR')) {
63 return;
64}
65
66
73{
74 session_start();
75}
76
83{
84 return session_regenerate_id();
85}
86
94function dol_session_rotate($sessionname = '')
95{
96 $oldsessionid = session_id();
97
98 // Backup the current session
99 $session_backup = $_SESSION;
100
101 // Set current session to expire in 1 minute
102 $_SESSION['OBSOLETE'] = true;
103 $_SESSION['EXPIRES'] = time() + 60;
104
105 // Close the current session
106 session_write_close();
107
108 // Set a new session id and start the session
109 session_name($sessionname);
111
112 // Restore the previous session backup
113 $_SESSION = $session_backup;
114
115 // Clean up
116 unset($session_backup);
117 unset($_SESSION['OBSOLETE']);
118 unset($_SESSION['EXPIRES']);
119
120 $newsessionid = session_id();
121 //var_dump("oldsessionid=".$oldsessionid." - newsessionid=".$newsessionid);
122}
123
124
125
126// Define vars
127$conffiletoshowshort = "conf.php";
128// Define localization of conf file
129// --- Start of part replaced by Dolibarr packager makepack-dolibarr
130$conffile = "conf/conf.php";
131$conffiletoshow = "htdocs/conf/conf.php";
132// For debian/redhat like systems
133//$conffile = "/etc/dolibarr/conf.php";
134//$conffiletoshow = "/etc/dolibarr/conf.php";
135
136
137// Include configuration
138// --- End of part replaced by Dolibarr packager makepack-dolibarr
139
140// Include configuration
141// @phpstan-ignore-next-line
142$result = @include_once $conffile; // Keep @ because with some error reporting mode, this breaks the redirect done when file is not found
143
144// Disable some not used PHP stream
145$listofwrappers = stream_get_wrappers();
146// We need '.phar' for geoip2. TODO Replace phar in geoip with exploded files so we can disable phar by default.
147// phar stream does not auto unserialize content (possible code execution) since PHP 8.1
148// zip stream is necessary by excel import module
149$arrayofstreamtodisable = array('compress.zlib', 'compress.bzip2', 'ftp', 'ftps', 'glob', 'data', 'expect', 'ogg', 'rar', 'zlib');
150if (!empty($dolibarr_main_stream_to_disable) && is_array($dolibarr_main_stream_to_disable)) {
151 $arrayofstreamtodisable = $dolibarr_main_stream_to_disable;
152}
153foreach ($arrayofstreamtodisable as $streamtodisable) {
154 if (!empty($listofwrappers) && in_array($streamtodisable, $listofwrappers)) {
155 /*if (!empty($dolibarr_main_stream_do_not_disable) && is_array($dolibarr_main_stream_do_not_disable) && in_array($streamtodisable, $dolibarr_main_stream_do_not_disable)) {
156 continue; // We do not disable this stream
157 }*/
158 stream_wrapper_unregister($streamtodisable);
159 }
160}
161
162if (!$result && !empty($_SERVER["GATEWAY_INTERFACE"])) { // If install not done and we are in a web session
163 if (!empty($_SERVER["CONTEXT_PREFIX"])) { // CONTEXT_PREFIX and CONTEXT_DOCUMENT_ROOT are not defined on all apache versions
164 $path = $_SERVER["CONTEXT_PREFIX"]; // example '/dolibarr/' when using an apache alias.
165 if (!preg_match('/\/$/', $path)) {
166 $path .= '/';
167 }
168 } elseif (preg_match('/index\.php/', $_SERVER['PHP_SELF'])) {
169 // When we ask index.php, we MUST BE SURE that $path is '' at the end. This is required to make install process
170 // when using apache alias like '/dolibarr/' that point to htdocs.
171 // Note: If calling page was an index.php not into htdocs (ie comm/index.php, ...), then this redirect will fails,
172 // but we don't want to change this because when URL is correct, we must be sure the redirect to install/index.php will be correct.
173 $path = '';
174 } else {
175 // If what we look is not index.php, we can try to guess location of root. May not work all the time.
176 // There is no real solution, because the only way to know the apache url relative path is to have it into conf file.
177 // If it fails to find correct $path, then only solution is to ask user to enter the correct URL to index.php or install/index.php
178 $TDir = explode('/', $_SERVER['PHP_SELF']);
179 $path = '';
180 $i = count($TDir);
181 while ($i--) {
182 if (empty($TDir[$i]) || $TDir[$i] == 'htdocs') {
183 break;
184 }
185 if ($TDir[$i] == 'dolibarr') {
186 break;
187 }
188 if (substr($TDir[$i], -4, 4) == '.php') {
189 continue;
190 }
191
192 $path .= '../';
193 }
194 }
195
196 header("Location: ".$path."install/index.php");
197
198 /*
199 print '<br><center>';
200 print 'The conf/conf.php file was not found or is not readable by the web server. If this is your first access, <a href="'.$path.'install/index.php">click here to start the Dolibarr installation process</a> to create it...';
201 print '</center><br>';
202 */
203
204 exit;
205}
206
207// Force PHP error_reporting setup (Dolibarr may report warning without this)
208if (!empty($dolibarr_strict_mode)) {
209 error_reporting(E_ALL | E_STRICT);
210} else {
211 error_reporting(E_ALL & ~(E_STRICT | E_NOTICE | E_DEPRECATED));
212}
213
214// Disable php display errors
215if (!empty($dolibarr_main_prod)) {
216 ini_set('display_errors', 'Off');
217}
218
219// Clean parameters
220$dolibarr_main_data_root = (empty($dolibarr_main_data_root) ? '' : trim($dolibarr_main_data_root));
221$dolibarr_main_url_root = trim(preg_replace('/\/+$/', '', empty($dolibarr_main_url_root) ? '' : $dolibarr_main_url_root));
222$dolibarr_main_url_root_alt = (empty($dolibarr_main_url_root_alt) ? '' : trim($dolibarr_main_url_root_alt));
223$dolibarr_main_document_root = (empty($dolibarr_main_document_root) ? '' : trim($dolibarr_main_document_root));
224$dolibarr_main_document_root_alt = (empty($dolibarr_main_document_root_alt) ? '' : trim($dolibarr_main_document_root_alt));
225
226if (!isset($dolibarr_main_db_port)) {
227 $dolibarr_main_db_port = 3306; // For compatibility with old configs, if not defined, we take 'mysql' type
228}
229if (empty($dolibarr_main_db_type)) {
230 $dolibarr_main_db_type = 'mysqli'; // For compatibility with old configs, if not defined, we take 'mysql' type
231}
232
233// Mysql driver support has been removed in favor of mysqli
234if ($dolibarr_main_db_type == 'mysql') {
235 $dolibarr_main_db_type = 'mysqli';
236}
237if (empty($dolibarr_main_db_prefix)) {
238 $dolibarr_main_db_prefix = 'llx_';
239}
240if (empty($dolibarr_main_db_character_set)) {
241 $dolibarr_main_db_character_set = ($dolibarr_main_db_type == 'mysqli' ? 'utf8' : ''); // Old installation
242}
243if (empty($dolibarr_main_db_collation)) {
244 $dolibarr_main_db_collation = ($dolibarr_main_db_type == 'mysqli' ? 'utf8_unicode_ci' : ''); // Old installation
245}
246if (empty($dolibarr_main_db_encryption)) {
247 $dolibarr_main_db_encryption = 0;
248}
249if (empty($dolibarr_main_db_cryptkey)) {
250 $dolibarr_main_db_cryptkey = '';
251}
252if (empty($dolibarr_main_limit_users)) {
253 $dolibarr_main_limit_users = 0;
254}
255if (empty($dolibarr_mailing_limit_sendbyweb)) {
256 $dolibarr_mailing_limit_sendbyweb = 0;
257}
258if (empty($dolibarr_mailing_limit_sendbycli)) {
259 $dolibarr_mailing_limit_sendbycli = 0;
260}
261if (empty($dolibarr_mailing_limit_sendbyday)) {
262 $dolibarr_mailing_limit_sendbyday = 0;
263}
264if (empty($dolibarr_strict_mode)) {
265 $dolibarr_strict_mode = 0; // For debug in php strict mode
266}
267
268define('DOL_DOCUMENT_ROOT', $dolibarr_main_document_root); // Filesystem core php (htdocs)
269
270if (!file_exists(DOL_DOCUMENT_ROOT."/core/lib/functions.lib.php")) {
271 print "Error: Dolibarr config file content seems to be not correctly defined (file ".DOL_DOCUMENT_ROOT."/core/lib/functions.lib.php not found).<br>\n";
272 print "Please run dolibarr setup by calling page <b>/install</b>.<br>\n";
273 exit(1);
274}
275
276
277// Included by default (must be before the CSRF check so wa can use the dol_syslog)
278include_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
279include_once DOL_DOCUMENT_ROOT.'/core/lib/security.lib.php';
280//print memory_get_usage();
281
282
283// Security: CSRF protection
284// This test check if referrer ($_SERVER['HTTP_REFERER']) is same web site than Dolibarr ($_SERVER['HTTP_HOST'])
285// when we post forms (we allow GET and HEAD to accept direct link from a particular page).
286// Note about $_SERVER[HTTP_HOST/SERVER_NAME]: http://shiflett.org/blog/2006/mar/server-name-versus-http-host
287// See also CSRF protections done into main.inc.php
288if (!defined('NOCSRFCHECK') && isset($dolibarr_nocsrfcheck) && $dolibarr_nocsrfcheck == 1) { // If $dolibarr_nocsrfcheck is 0, there is a strict CSRF test with token in main
289 if (!empty($_SERVER['REQUEST_METHOD']) && !in_array($_SERVER['REQUEST_METHOD'], array('GET', 'HEAD')) && !empty($_SERVER['HTTP_HOST'])) {
290 $csrfattack = false;
291 if (empty($_SERVER['HTTP_REFERER'])) {
292 $csrfattack = true; // An evil browser was used
293 } else {
294 $tmpa = parse_url($_SERVER['HTTP_HOST']);
295 $tmpb = parse_url($_SERVER['HTTP_REFERER']);
296 if ((empty($tmpa['host']) ? $tmpa['path'] : $tmpa['host']) != (empty($tmpb['host']) ? $tmpb['path'] : $tmpb['host'])) {
297 $csrfattack = true;
298 }
299 }
300 if ($csrfattack) {
301 //print 'NOCSRFCHECK='.defined('NOCSRFCHECK').' REQUEST_METHOD='.$_SERVER['REQUEST_METHOD'].' HTTP_HOST='.$_SERVER['HTTP_HOST'].' HTTP_REFERER='.$_SERVER['HTTP_REFERER'];
302 // Note: We can't use dol_escape_htmltag here to escape output because lib functions.lib.ph is not yet loaded.
303 dol_syslog("--- Access to ".(empty($_SERVER["REQUEST_METHOD"]) ? '' : $_SERVER["REQUEST_METHOD"].' ').$_SERVER["PHP_SELF"]." refused by CSRF protection (Bad referrer).", LOG_WARNING);
304 print "Access refused by CSRF protection in main.inc.php. Referrer of form (".htmlentities(empty($_SERVER['HTTP_REFERER']) ? '' : $_SERVER['HTTP_REFERER'], ENT_COMPAT, 'UTF-8').") is outside the server that serve this page (with method = ".htmlentities($_SERVER['REQUEST_METHOD'], ENT_COMPAT, 'UTF-8').").\n";
305 print "If you access your server behind a proxy using url rewriting, you might check that all HTTP headers are propagated (or add the line \$dolibarr_nocsrfcheck=1 into your conf.php file to remove this security check).\n";
306 die;
307 }
308 }
309 // Another test is done later on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on.
310}
311if (empty($dolibarr_main_db_host) && !defined('NOREQUIREDB')) {
312 print '<div class="center">Dolibarr setup is not yet complete.<br><br>'."\n";
313 print '<a href="install/index.php">Click here to finish Dolibarr install process</a> ...</div>'."\n";
314 die;
315}
316if (empty($dolibarr_main_url_root) && !defined('NOREQUIREVIRTUALURL')) {
317 print 'Value for parameter \'dolibarr_main_url_root\' is not defined in your \'htdocs\conf\conf.php\' file.<br>'."\n";
318 print 'You must add this parameter with your full Dolibarr root Url (Example: http://myvirtualdomain/ or http://mydomain/mydolibarrurl/)'."\n";
319 die;
320}
321
322if (empty($dolibarr_main_document_root_alt)) {
323 $dolibarr_main_document_root_alt = $dolibarr_main_document_root.'/custom';
324}
325
326if (empty($dolibarr_main_data_root)) {
327 // If directory not defined, we use the default hardcoded value
328 $dolibarr_main_data_root = str_replace("/htdocs", "", $dolibarr_main_document_root);
329 $dolibarr_main_data_root .= "/documents";
330}
331
332// Define some constants
333define('DOL_CLASS_PATH', 'class/'); // Filesystem path to class dir (defined only for some code that want to be compatible with old versions without this parameter)
334define('DOL_DATA_ROOT', $dolibarr_main_data_root); // Filesystem data (documents)
335// Try to autodetect DOL_MAIN_URL_ROOT and DOL_URL_ROOT when root is not directly the main domain.
336// Note: autodetect works only in case 1, 2, 3 and 4 of phpunit test CoreTest.php. For case 5, 6, only setting value into conf.php will works.
337$tmp = '';
338$found = 0;
339$real_dolibarr_main_document_root = str_replace('\\', '/', realpath($dolibarr_main_document_root)); // A) Value found into config file, to say where are store htdocs files. Ex: C:/xxx/dolibarr, C:/xxx/dolibarr/htdocs
340if (!empty($_SERVER["DOCUMENT_ROOT"])) {
341 $pathroot = $_SERVER["DOCUMENT_ROOT"]; // B) Value reported by web server setup (not defined on CLI mode), to say where is root of web server instance. Ex: C:/xxx/dolibarr, C:/xxx/dolibarr/htdocs
342} else {
343 $pathroot = 'NOTDEFINED';
344}
345$paths = explode('/', str_replace('\\', '/', $_SERVER["SCRIPT_NAME"])); // C) Value reported by web server, to say full path on filesystem of a file. Ex: /dolibarr/htdocs/admin/system/phpinfo.php
346// Try to detect if $_SERVER["DOCUMENT_ROOT"]+start of $_SERVER["SCRIPT_NAME"] is $dolibarr_main_document_root. If yes, relative url to add before dol files is this start part.
347$concatpath = '';
348foreach ($paths as $tmppath) { // We check to find (B+start of C)=A
349 if (empty($tmppath)) {
350 continue;
351 }
352 $concatpath .= '/'.$tmppath;
353 //if ($tmppath) $concatpath.='/'.$tmppath;
354 //print $_SERVER["SCRIPT_NAME"].'-'.$pathroot.'-'.$concatpath.'-'.$real_dolibarr_main_document_root.'-'.realpath($pathroot.$concatpath).'<br>';
355 if ($real_dolibarr_main_document_root == @realpath($pathroot.$concatpath)) { // @ avoid warning when safe_mode is on.
356 //print "Found relative url = ".$concatpath;
357 $tmp3 = $concatpath;
358 $found = 1;
359 break;
360 }
361 //else print "Not found yet for concatpath=".$concatpath."<br>\n";
362}
363//print "found=".$found." dolibarr_main_url_root=".$dolibarr_main_url_root."\n";
364if (!$found) {
365 // There is no subdir that compose the main url root or autodetect fails (Ie: when using apache alias that point outside default DOCUMENT_ROOT).
366 $tmp = $dolibarr_main_url_root;
367} else {
368 $tmp = 'http'.((!isHTTPS() && (empty($_SERVER["SERVER_PORT"]) || $_SERVER["SERVER_PORT"] != 443)) ? '' : 's').'://'.$_SERVER["SERVER_NAME"].((empty($_SERVER["SERVER_PORT"]) || $_SERVER["SERVER_PORT"] == 80 || $_SERVER["SERVER_PORT"] == 443) ? '' : ':'.$_SERVER["SERVER_PORT"]).($tmp3 ? (preg_match('/^\//', $tmp3) ? '' : '/').$tmp3 : '');
369}
370
371//print "tmp1=".$tmp1." tmp2=".$tmp2." tmp3=".$tmp3." tmp=".$tmp."\n";
372if (!empty($dolibarr_main_force_https)) {
373 $tmp = preg_replace('/^http:/i', 'https:', $tmp);
374}
375define('DOL_MAIN_URL_ROOT', $tmp); // URL absolute root (https://sss/dolibarr, ...)
376$uri = preg_replace('/^http(s?):\/\//i', '', constant('DOL_MAIN_URL_ROOT')); // $uri contains url without http*
377$suburi = strstr($uri, '/'); // $suburi contains url without domain:port
378if (empty($suburi) || $suburi === '/') {
379 $suburi = ''; // If $suburi is null or /, it is now ''
380}
381if (!defined('DOL_URL_ROOT')) {
382 define('DOL_URL_ROOT', $suburi); // URL relative root ('', '/dolibarr', ...)
383}
384//print DOL_MAIN_URL_ROOT.'-'.DOL_URL_ROOT."\n";
385
386// Define prefix MAIN_DB_PREFIX
387define('MAIN_DB_PREFIX', $dolibarr_main_db_prefix);
388
389
390/*
391 * Define PATH to external libraries
392 * To use other version than embedded libraries, define here constant to path. Use '' to use include class path autodetect.
393 */
394// Path to root libraries
395if (!defined('TCPDF_PATH')) {
396 define('TCPDF_PATH', (empty($dolibarr_lib_TCPDF_PATH)) ? DOL_DOCUMENT_ROOT.'/includes/tecnickcom/tcpdf/' : $dolibarr_lib_TCPDF_PATH.'/');
397}
398if (!defined('TCPDI_PATH')) {
399 define('TCPDI_PATH', (empty($dolibarr_lib_TCPDI_PATH)) ? DOL_DOCUMENT_ROOT.'/includes/tcpdi/' : $dolibarr_lib_TCPDI_PATH.'/');
400}
401if (!defined('NUSOAP_PATH')) {
402 define('NUSOAP_PATH', (!isset($dolibarr_lib_NUSOAP_PATH)) ? DOL_DOCUMENT_ROOT.'/includes/nusoap/lib/' : (empty($dolibarr_lib_NUSOAP_PATH) ? '' : $dolibarr_lib_NUSOAP_PATH.'/'));
403}
404if (!defined('PHPEXCELNEW_PATH')) {
405 define('PHPEXCELNEW_PATH', (!isset($dolibarr_lib_PHPEXCELNEW_PATH)) ? DOL_DOCUMENT_ROOT.'/includes/phpoffice/phpspreadsheet/src/PhpSpreadsheet/' : (empty($dolibarr_lib_PHPEXCELNEW_PATH) ? '' : $dolibarr_lib_PHPEXCELNEW_PATH.'/'));
406}
407if (!defined('ODTPHP_PATH')) {
408 define('ODTPHP_PATH', (!isset($dolibarr_lib_ODTPHP_PATH)) ? DOL_DOCUMENT_ROOT.'/includes/odtphp/' : (empty($dolibarr_lib_ODTPHP_PATH) ? '' : $dolibarr_lib_ODTPHP_PATH.'/'));
409}
410if (!defined('ODTPHP_PATHTOPCLZIP')) {
411 define('ODTPHP_PATHTOPCLZIP', (!isset($dolibarr_lib_ODTPHP_PATHTOPCLZIP)) ? DOL_DOCUMENT_ROOT.'/includes/odtphp/zip/pclzip/' : (empty($dolibarr_lib_ODTPHP_PATHTOPCLZIP) ? '' : $dolibarr_lib_ODTPHP_PATHTOPCLZIP.'/'));
412}
413if (!defined('JS_CKEDITOR')) {
414 define('JS_CKEDITOR', (!isset($dolibarr_js_CKEDITOR)) ? '' : (empty($dolibarr_js_CKEDITOR) ? '' : $dolibarr_js_CKEDITOR.'/'));
415}
416if (!defined('JS_JQUERY')) {
417 define('JS_JQUERY', (!isset($dolibarr_js_JQUERY)) ? '' : (empty($dolibarr_js_JQUERY) ? '' : $dolibarr_js_JQUERY.'/'));
418}
419if (!defined('JS_JQUERY_UI')) {
420 define('JS_JQUERY_UI', (!isset($dolibarr_js_JQUERY_UI)) ? '' : (empty($dolibarr_js_JQUERY_UI) ? '' : $dolibarr_js_JQUERY_UI.'/'));
421}
422// Other required path
423if (!defined('DOL_DEFAULT_TTF')) {
424 define('DOL_DEFAULT_TTF', (!isset($dolibarr_font_DOL_DEFAULT_TTF)) ? DOL_DOCUMENT_ROOT.'/includes/fonts/Aerial.ttf' : (empty($dolibarr_font_DOL_DEFAULT_TTF) ? '' : $dolibarr_font_DOL_DEFAULT_TTF));
425}
426if (!defined('DOL_DEFAULT_TTF_BOLD')) {
427 define('DOL_DEFAULT_TTF_BOLD', (!isset($dolibarr_font_DOL_DEFAULT_TTF_BOLD)) ? DOL_DOCUMENT_ROOT.'/includes/fonts/AerialBd.ttf' : (empty($dolibarr_font_DOL_DEFAULT_TTF_BOLD) ? '' : $dolibarr_font_DOL_DEFAULT_TTF_BOLD));
428}
429
430
431/*
432 * Include functions
433 */
434
435// If password is encoded, we decode it. Note: When page is called for install, $dolibarr_main_db_pass may not be defined yet.
436if ((!empty($dolibarr_main_db_pass) && preg_match('/crypted:/i', $dolibarr_main_db_pass)) || !empty($dolibarr_main_db_encrypted_pass)) {
437 if (!empty($dolibarr_main_db_pass) && preg_match('/crypted:/i', $dolibarr_main_db_pass)) {
438 $dolibarr_main_db_pass = preg_replace('/crypted:/i', '', $dolibarr_main_db_pass);
439 $dolibarr_main_db_pass = dol_decode($dolibarr_main_db_pass);
440 $dolibarr_main_db_encrypted_pass = $dolibarr_main_db_pass; // We need to set this so we can use it later to know the password was initially encrypted
441 } else {
442 $dolibarr_main_db_pass = dol_decode($dolibarr_main_db_encrypted_pass);
443 }
444}
dol_session_regenerate_id()
Replace session_regenerate_id()
if(!defined( 'DOL_APPLICATION_TITLE')) if(!defined('DOL_VERSION')) if(!defined( 'EURO')) if(!defined('LOG_DEBUG')) if(defined( 'DOL_INC_FOR_VERSION_ERROR')) dol_session_start()
Replace session_start()
dol_session_rotate($sessionname='')
Destroy and recreate a new session without losing content.
isHTTPS()
Return if we are using a HTTPS connection Check HTTPS (no way to be modified by user but may be empty...
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_decode($chain, $key='1')
Decode a base 64 encoded + specific delta change.