dolibarr 24.0.0-beta
dolibarr.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2005-2020 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
4 * Copyright (C) 2007-2012 Regis Houssin <regis.houssin@inodbox.com>
5 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
6 * Copyright (C) 2024-2026 Frédéric France <frederic.france@free.fr>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 */
21
27// Load Dolibarr environment
28require '../../main.inc.php';
41'
42@phan-var-force string $dolibarr_main_document_root_alt
43';
44require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
45require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
46require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
47require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
48require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
49require_once DOL_DOCUMENT_ROOT.'/blockedlog/lib/blockedlog.lib.php';
50
51// Load translation files required by the page
52$langs->loadLangs(array("install", "other", "admin"));
53
54$action = GETPOST('action', 'aZ09');
55
56if (!$user->admin) {
58}
59
60$sfurl = '';
61$version = '0.0';
62
63// Version blockedlog
64$versionbadge = '<span class="badge-text badge-secondary">'.getBlockedLogVersionToShow();
65if ($mysoc->country_code == 'FR') {
66 $islne = isALNEQualifiedVersion(1, 1);
67 if (!$islne) {
68 $versionbadge .= ' - '.$langs->trans("NotCertified");
69 }
70}
71$versionbadge .= '</span>';
72
73
74/*
75 * Actions
76 */
77
78if ($action == 'getlastversion') {
79 $result = getURLContent('https://sourceforge.net/projects/dolibarr/rss');
80 if (function_exists('simplexml_load_string')) {
81 if (LIBXML_VERSION < 20900) {
82 // Avoid load of external entities (security problem).
83 // Required only if LIBXML_VERSION < 20900
84 // @phan-suppress-next-line PhanDeprecatedFunctionInternal
85 libxml_disable_entity_loader(true);
86 }
87
88 $sfurl = simplexml_load_string($result['content'], 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NONET);
89 } else {
90 setEventMessages($langs->trans("ErrorPHPDoesNotSupport", "xml"), null, 'errors');
91 }
92}
93
94
95/*
96 * View
97 */
98
99$form = new Form($db);
100
101$help_url = '';
102$title = $langs->trans("InfoDolibarr");
103
104llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-admin page-system_dolibarr');
105
106print load_fiche_titre($title, '', 'title_setup');
107
108// Version
109print '<div class="div-table-responsive-no-min">';
110print '<table class="noborder centpercent">';
111print '<tr class="liste_titre"><td class="titlefieldcreate">'.$langs->trans("Version").'</td><td></td></tr>'."\n";
112print '<tr class="oddeven"><td>'.$langs->trans("CurrentVersion").'<br><span class="opacitymedium">('.$langs->trans("Programs").')</span></td><td>';
113print '<span class="badge-text badge-secondary">'.DOL_VERSION.'</span>';
114// If current version differs from last upgrade
115if (!getDolGlobalString('MAIN_VERSION_LAST_UPGRADE')) {
116 // Compare version with last install database version (upgrades never occurred)
117 if (DOL_VERSION != getDolGlobalString('MAIN_VERSION_LAST_INSTALL')) {
118 print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired", DOL_VERSION, getDolGlobalString('MAIN_VERSION_LAST_INSTALL')));
119 }
120} else {
121 // Compare version with last upgrade database version
122 if (DOL_VERSION != getDolGlobalString('MAIN_VERSION_LAST_UPGRADE')) {
123 print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired", DOL_VERSION, getDolGlobalString('MAIN_VERSION_LAST_UPGRADE')));
124 }
125}
126
127$version = DOL_VERSION;
128if (preg_match('/[a-z]+/i', $version)) {
129 $version = 'develop'; // If version contains text, it is not an official tagged version, so we use the full change log.
130}
131
132$urlofchangelog = 'https://raw.githubusercontent.com/Dolibarr/dolibarr/'.$version.'/ChangeLog';
133
134print ' &nbsp; ';
135//print dolButtonToOpenUrlInDialogPopup('changelogpopup', $langs->trans("SeeChangeLog"), $langs->trans("SeeChangeLog"), $urlofchangelog);
136print '<a href="'.$urlofchangelog.'" target="_blank" rel="noopener noreferrer external">'.img_picto('', 'url', 'class="paddingright"').$langs->trans("SeeChangeLog").'</a>';
137
138$newversion = '';
139if (function_exists('curl_init')) {
140 $conf->global->MAIN_USE_RESPONSE_TIMEOUT = 10;
141 print ' &nbsp; &nbsp; - &nbsp; &nbsp; ';
142 if ($action == 'getlastversion') {
143 if ($sfurl) {
144 $i = 0;
145 while (!empty($sfurl->channel[0]->item[$i]->title) && $i < 10000) {
146 $title = $sfurl->channel[0]->item[$i]->title;
147 $reg = array();
148 if (preg_match('/([0-9]+\.([0-9\.]+))/', $title, $reg)) {
149 $newversion = $reg[1];
150 $newversionarray = explode('.', $newversion);
151 $versionarray = explode('.', $version);
152 //var_dump($newversionarray);var_dump($versionarray);
153 if (versioncompare($newversionarray, $versionarray) > 0) {
154 $version = $newversion;
155 }
156 }
157 $i++;
158 }
159
160 // Show version
161 print $langs->trans("LastStableVersion").' : <b>'.(($version != '0.0') ? $version : $langs->trans("Unknown")).'</b>';
162 if ($version != '0.0') {
163 print ' &nbsp; <a href="https://raw.githubusercontent.com/Dolibarr/dolibarr/'.$version.'/ChangeLog" target="_blank" rel="noopener noreferrer external">'.img_picto('', 'url', 'class="paddingright"').$langs->trans("SeeChangeLog").'</a>';
164 }
165 } else {
166 print $langs->trans("LastStableVersion").' : <b>'.$langs->trans("UpdateServerOffline").'</b>';
167 }
168 } else {
169 print $langs->trans("LastStableVersion").' : <a href="'.$_SERVER["PHP_SELF"].'?action=getlastversion&token='.newToken().'" class="butAction smallpaddingimp">'.$langs->trans("Check").'</a>';
170 }
171}
172
173// Now show link to the changelog
174//print ' &nbsp; &nbsp; - &nbsp; &nbsp; ';
175
176$version = DOL_VERSION;
177if (preg_match('/[a-z]+/i', $version)) {
178 $version = 'develop'; // If version contains text, it is not an official tagged version, so we use the full change log.
179}
180
181print '</td></tr>'."\n";
182print '<tr class="oddeven"><td>'.$langs->trans("VersionLastUpgrade").'<br><span class="opacitymedium">('.$langs->trans("Database").')</span></td><td>';
183if (getDolGlobalString('MAIN_VERSION_LAST_UPGRADE')) {
184 print '<span class="badge-text badge-secondary">'.getDolGlobalString('MAIN_VERSION_LAST_UPGRADE').'</span>';
185}
186if (getDolGlobalString('MAIN_VERSION_LAST_INSTALL')) {
187 print ' &nbsp; <span class="opacitymedium">'.$langs->trans("VersionLastInstall").': <span class="">'.getDolGlobalString('MAIN_VERSION_LAST_INSTALL').'</span></span>';
188}
189print '</td></tr>'."\n";
190
191$showblockedlogversion = 0;
192if ($mysoc->country_code == 'FR') {
193 $showblockedlogversion = 1;
194}
196 $showblockedlogversion = 1;
197}
198if ($showblockedlogversion) {
199 print '<tr class="oddeven nohover">';
200 print '<td width="300">'.$langs->trans("VersionOfModule", $langs->transnoentitiesnoconv("BlockedLog")).'</td><td>';
201 print $versionbadge;
202
203 print ' &nbsp; <a href="'.DOL_URL_ROOT.'/blockedlog/admin/filecheck.php">'.img_picto('', 'url', 'class="pictofixedwidth"').$langs->trans("FileCheck").'</a>';
204
205 print '</td>';
206 print '</tr>';
207}
208
209print '</table>';
210print '</div>';
211
212// Add a complementary optional information
213$infotoshow = '';
214if ($mysoc->country_code == 'FR') {
215 $islne = isALNEQualifiedVersion(1, 1);
216 if ($islne) {
217 if (preg_match('/\-/', getBlockedLogVersionToShow())) {
218 // This is an alpha or beta version
219 $infotoshow = $langs->trans("LNECandidateVersionForCertificationFR", getBlockedLogVersionToShow());
220 } else {
221 $infotoshow = $langs->trans("LNECertifiedVersionFR", getBlockedLogVersionToShow());
222 }
223 } else {
224 $infotoshow = $langs->trans("NotCertifiedVersionFR", getBlockedLogVersionToShow());
225 }
226}
227if ($infotoshow) {
228 print info_admin($infotoshow, 0, 0, 'info', 'hideonsmartphone', '', '', 'CERTIF_LNE = '.(defined('CERTIF_LNE') ? (int) constant('CERTIF_LNE') : 0));
229}
230
231print '<br>';
232
233// Session
234print '<div class="div-table-responsive-no-min">';
235print '<table class="noborder centpercent">';
236print '<tr class="liste_titre"><td class="titlefieldcreate">'.$langs->trans("Session").'</td><td></td></tr>'."\n";
237print '<tr class="oddeven"><td>'.$langs->trans("SessionSavePath").'</td><td>'.session_save_path().'</td></tr>'."\n";
238print '<tr class="oddeven"><td>'.$langs->trans("SessionName").'</td><td>'.session_name().'</td></tr>'."\n";
239print '<tr class="oddeven"><td>'.$langs->trans("SessionId").'</td><td>'.session_id().'</td></tr>'."\n";
240print '<tr class="oddeven"><td>';
241print $langs->trans("CurrentSessionTimeOut");
242print '</td>';
243print '<td>';
244print ini_get('session.gc_maxlifetime').' '.$langs->trans("seconds");
245print '<!-- session.gc_maxlifetime = '.ini_get("session.gc_maxlifetime").' -->'."\n";
246print '<!-- session.gc_probability = '.ini_get("session.gc_probability").' -->'."\n";
247print '<!-- session.gc_divisor = '.ini_get("session.gc_divisor").' -->'."\n";
248print $form->textwithpicto('', $langs->trans("Parameter").' <b>php.ini</b>: <b>session.gc_maxlifetime</b><br>'.$langs->trans("SessionExplanation", ini_get("session.gc_probability"), ini_get("session.gc_divisor")));
249print "</td></tr>\n";
250print '<tr class="oddeven"><td>'.$langs->trans("CurrentTheme").'</td><td>'.$conf->theme.'</td></tr>'."\n";
251print '<tr class="oddeven"><td>'.$langs->trans("CurrentMenuHandler").'</td><td>';
252print $conf->standard_menu;
253print '</td></tr>'."\n";
254print '<tr class="oddeven"><td>'.$langs->trans("Screen").'</td><td>';
255print $_SESSION['dol_screenwidth'].' x '.$_SESSION['dol_screenheight'];
256print '</td></tr>'."\n";
257print '<tr class="oddeven"><td>'.$langs->trans("Session").'</td><td class="wordbreak">';
258$i = 0;
259foreach ($_SESSION as $key => $val) {
260 if ($i > 0) {
261 print ', ';
262 }
263 if (is_array($val)) {
264 print $key.' => array(...)';
265 } else {
266 print $key.' => '.dol_escape_htmltag($val);
267 }
268 $i++;
269}
270print '</td></tr>'."\n";
271print '</table>';
272print '</div>';
273print '<br>';
274
275
276// Shmop
277if (getDolGlobalInt('MAIN_OPTIMIZE_SPEED') & 0x02) {
278 $shmoparray = dol_listshmop();
279
280 print '<div class="div-table-responsive-no-min">';
281 print '<table class="noborder centpercent">';
282 print '<tr class="liste_titre">';
283 print '<td class="titlefieldcreate">'.$langs->trans("LanguageFilesCachedIntoShmopSharedMemory").'</td>';
284 print '<td>'.$langs->trans("NbOfEntries").'</td>';
285 print '<td class="right">'.$langs->trans("Address").'</td>';
286 print '</tr>'."\n";
287
288 foreach ($shmoparray as $key => $val) {
289 print '<tr class="oddeven"><td>'.$key.'</td>';
290 print '<td>'.count($val).'</td>';
291 print '<td class="right">'.dol_getshmopaddress($key).'</td>';
292 print '</tr>'."\n";
293 }
294
295 print '</table>';
296 print '</div>';
297 print '<br>';
298}
299
300
301// Localisation
302print '<div class="div-table-responsive-no-min">';
303print '<table class="noborder centpercent">';
304print '<tr class="liste_titre"><td class="titlefieldcreate">'.$langs->trans("LocalisationDolibarrParameters").'</td><td></td></tr>'."\n";
305print '<tr class="oddeven"><td>'.$langs->trans("LanguageBrowserParameter", "HTTP_ACCEPT_LANGUAGE").'</td><td>'.$_SERVER["HTTP_ACCEPT_LANGUAGE"].'</td></tr>'."\n";
306print '<tr class="oddeven"><td>'.$langs->trans("CurrentUserLanguage").'</td><td>'.$langs->getDefaultLang().'</td></tr>'."\n";
307// Thousands
308$thousand = $langs->transnoentitiesnoconv("SeparatorThousand");
309if ($thousand == 'SeparatorThousand') {
310 $thousand = ' '; // ' ' does not work on trans method
311}
312if ($thousand == 'None') {
313 $thousand = '';
314}
315print '<tr class="oddeven"><td>'.$langs->trans("CurrentValueSeparatorThousand").'</td><td>'.($thousand == ' ' ? $langs->transnoentitiesnoconv("Space") : $thousand).'</td></tr>'."\n";
316// Decimals
317$dec = $langs->transnoentitiesnoconv("SeparatorDecimal");
318print '<tr class="oddeven"><td>'.$langs->trans("CurrentValueSeparatorDecimal").'</td><td>'.$dec.'</td></tr>'."\n";
319// Show results of functions to see if everything works
320print '<tr class="oddeven"><td>&nbsp; => price2num(1233.56+1)</td><td>'.price2num(1233.56 + 1, 2).'</td></tr>'."\n";
321print '<tr class="oddeven"><td>&nbsp; => price2num('."'1".$thousand."234".$dec."56')</td><td>".price2num("1".$thousand."234".$dec."56", 2)."</td></tr>\n";
322if (($thousand != ',' && $thousand != '.') || ($thousand != ' ')) {
323 print '<tr class="oddeven"><td>&nbsp; => price2num('."'1 234.56')</td><td>".price2num("1 234.56", 2)."</td>";
324 print "</tr>\n";
325}
326print '<tr class="oddeven"><td>&nbsp; => price(1234.56)</td><td>'.price(1234.56).'</td></tr>'."\n";
327
328// Timezones
329
330// Database timezone
331if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli') {
332 print '<tr class="oddeven"><td>'.$langs->trans("MySQLTimeZone").' (database)</td><td>'; // Timezone server base
333 $sql = "SHOW VARIABLES where variable_name = 'system_time_zone'";
334 $resql = $db->query($sql);
335 if ($resql) {
336 $obj = $db->fetch_object($resql);
337 print $form->textwithtooltip($obj->Value, $langs->trans('TZHasNoEffect'), 2, 1, img_info(''));
338 }
339 print '</td></tr>'."\n";
340}
341$txt = $langs->trans("OSTZ").' (variable system TZ): '.(!empty($_ENV["TZ"]) ? $_ENV["TZ"] : $langs->trans("NotDefined")).'<br>'."\n";
342$txt .= $langs->trans("PHPTZ").' (date_default_timezone_get() / php.ini date.timezone): '.(getServerTimeZoneString()." / ".(ini_get("date.timezone") ? ini_get("date.timezone") : $langs->trans("NotDefined")))."<br>\n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php
343$txt .= $langs->trans("Dolibarr constant MAIN_SERVER_TZ").': '.getDolGlobalString('MAIN_SERVER_TZ', $langs->trans("NotDefined"));
344print '<tr class="oddeven"><td>'.$langs->trans("CurrentTimeZone").'</td><td>'; // Timezone server PHP
345$a = getServerTimeZoneInt('now');
346$b = getServerTimeZoneInt('winter');
347$c = getServerTimeZoneInt('summer');
348$daylight = round($c - $b);
349//print $a." ".$b." ".$c." ".$daylight;
350$val = ($a >= 0 ? '+' : '').$a;
351$val .= ' ('.($a == 'unknown' ? 'unknown' : ($a >= 0 ? '+' : '').($a * 3600)).')';
352$val .= ' &nbsp; &nbsp; &nbsp; '.getServerTimeZoneString();
353$val .= ' &nbsp; &nbsp; &nbsp; '.$langs->trans("DaylingSavingTime").': '.((is_null($b) || is_null($c)) ? 'unknown' : ($a == $c ? yn((int) $daylight) : yn(0).($daylight ? ' &nbsp; &nbsp; ('.$langs->trans('YesInSummer').')' : '')));
354print $form->textwithtooltip($val, $txt, 2, 1, img_info(''));
355print '</td></tr>'."\n"; // value defined in http://fr3.php.net/manual/en/timezones.europe.php
356print '<tr class="oddeven"><td>&nbsp; => '.$langs->trans("CurrentHour").'</td><td>'.dol_print_date(dol_now('gmt'), 'dayhour', 'tzserver').'</td></tr>'."\n";
357print '<tr class="oddeven"><td>&nbsp; => dol_print_date(0,"dayhourtext")</td><td>'.dol_print_date(0, "dayhourtext").'</td>';
358print '<tr class="oddeven"><td>&nbsp; => dol_get_first_day(1970,1,false)</td><td>'.dol_get_first_day(1970, 1, false).' &nbsp; &nbsp; (=> dol_print_date() or idate() of this value = '.dol_print_date(dol_get_first_day(1970, 1, false), 'dayhour').')</td>';
359print '<tr class="oddeven"><td>&nbsp; => dol_get_first_day(1970,1,true)</td><td>'.dol_get_first_day(1970, 1, true).' &nbsp; &nbsp; (=> dol_print_date() or idate() of this value = '.dol_print_date(dol_get_first_day(1970, 1, true), 'dayhour').')</td>';
360// Client
361$tz = (int) $_SESSION['dol_tz'] + (int) $_SESSION['dol_dst'];
362print '<tr class="oddeven"><td>'.$langs->trans("ClientTZ").'</td><td>'.($tz ? ($tz >= 0 ? '+' : '').$tz : '').' ('.($tz >= 0 ? '+' : '').($tz * 60 * 60).')';
363print ' &nbsp; &nbsp; &nbsp; '.$_SESSION['dol_tz_string'];
364print ' &nbsp; &nbsp; &nbsp; '.$langs->trans("DaylingSavingTime").': ';
365if ($_SESSION['dol_dst'] > 0) {
366 print yn(1);
367} else {
368 print yn(0);
369}
370if (!empty($_SESSION['dol_dst_first'])) {
371 print ' &nbsp; &nbsp; ('.dol_print_date(dol_stringtotime($_SESSION['dol_dst_first']), 'dayhour', 'gmt').' - '.dol_print_date(dol_stringtotime($_SESSION['dol_dst_second']), 'dayhour', 'gmt').')';
372}
373print '</td></tr>'."\n";
374print '</td></tr>'."\n";
375print '<tr class="oddeven"><td>&nbsp; => '.$langs->trans("ClientHour").'</td><td>'.dol_print_date(dol_now('gmt'), 'dayhour', 'tzuser').'</td></tr>'."\n";
376
377$filesystemencoding = ini_get("unicode.filesystem_encoding"); // Available with PHP 6.0
378print '<tr class="oddeven"><td>'.$langs->trans("File encoding").' (php.ini unicode.filesystem_encoding)</td><td>'.$filesystemencoding.'</td></tr>'."\n";
379
380$tmp = ini_get("unicode.filesystem_encoding"); // Available with PHP 6.0
381if (empty($tmp) && !empty($_SERVER["WINDIR"])) {
382 $tmp = 'iso-8859-1'; // By default for windows
383}
384if (empty($tmp)) {
385 $tmp = 'utf-8'; // By default for other
386}
387if (getDolGlobalString('MAIN_FILESYSTEM_ENCODING')) {
388 $tmp = getDolGlobalString('MAIN_FILESYSTEM_ENCODING');
389}
390print '<tr class="oddeven"><td>&nbsp; => '.$langs->trans("File encoding").'</td><td>'.$tmp.'</td></tr>'."\n"; // date.timezone must be in valued defined in http://fr3.php.net/manual/en/timezones.europe.php
391
392print '</table>';
393print '</div>';
394print '<br>';
395
396
397
398// Parameters in conf.php file (when a parameter start with ?, it is shown only if defined)
399$configfileparameters = array(
400 'dolibarr_main_prod' => 'Production mode (Hide all error messages)',
401 'dolibarr_main_instance_unique_id' => $langs->trans("InstanceUniqueID"),
402 'separator0' => '',
403 'dolibarr_main_url_root' => $langs->trans("URLRoot"),
404 '?dolibarr_main_url_root_alt' => $langs->trans("URLRoot").' (alt)',
405 'dolibarr_main_document_root' => $langs->trans("DocumentRootServer"),
406 '?dolibarr_main_document_root_alt' => $langs->trans("DocumentRootServer").' (alt)',
407 'dolibarr_main_data_root' => $langs->trans("DataRootServer"),
408 'separator1' => '',
409 'dolibarr_main_db_host' => $langs->trans("DatabaseServer"),
410 'dolibarr_main_db_port' => $langs->trans("DatabasePort"),
411 'dolibarr_main_db_name' => $langs->trans("DatabaseName"),
412 'dolibarr_main_db_type' => $langs->trans("DriverType"),
413 'dolibarr_main_db_user' => $langs->trans("DatabaseUser"),
414 'dolibarr_main_db_pass' => $langs->trans("DatabasePassword"),
415 'dolibarr_main_db_character_set' => $langs->trans("DBStoringCharset"),
416 'dolibarr_main_db_collation' => $langs->trans("DBSortingCollation"),
417 '?dolibarr_main_db_prefix' => $langs->trans("DatabasePrefix"),
418 'dolibarr_main_db_readonly' => $langs->trans("ReadOnlyMode"),
419 'separator2' => '',
420 'dolibarr_main_authentication' => $langs->trans("AuthenticationMode"),
421 '?multicompany_transverse_mode' => $langs->trans("MultiCompanyMode"),
422 'separator' => '',
423 '?dolibarr_main_auth_ldap_login_attribute' => 'dolibarr_main_auth_ldap_login_attribute',
424 '?dolibarr_main_auth_ldap_host' => 'dolibarr_main_auth_ldap_host',
425 '?dolibarr_main_auth_ldap_port' => 'dolibarr_main_auth_ldap_port',
426 '?dolibarr_main_auth_ldap_version' => 'dolibarr_main_auth_ldap_version',
427 '?dolibarr_main_auth_ldap_dn' => 'dolibarr_main_auth_ldap_dn',
428 '?dolibarr_main_auth_ldap_admin_login' => 'dolibarr_main_auth_ldap_admin_login',
429 '?dolibarr_main_auth_ldap_admin_pass' => 'dolibarr_main_auth_ldap_admin_pass',
430 '?dolibarr_main_auth_ldap_debug' => 'dolibarr_main_auth_ldap_debug',
431 'separator3' => '',
432 '?dolibarr_lib_FPDF_PATH' => 'dolibarr_lib_FPDF_PATH',
433 '?dolibarr_lib_TCPDF_PATH' => 'dolibarr_lib_TCPDF_PATH',
434 '?dolibarr_lib_FPDI_PATH' => 'dolibarr_lib_FPDI_PATH',
435 '?dolibarr_lib_TCPDI_PATH' => 'dolibarr_lib_TCPDI_PATH',
436 '?dolibarr_lib_NUSOAP_PATH' => 'dolibarr_lib_NUSOAP_PATH',
437 '?dolibarr_lib_GEOIP_PATH' => 'dolibarr_lib_GEOIP_PATH',
438 '?dolibarr_lib_ODTPHP_PATH' => 'dolibarr_lib_ODTPHP_PATH',
439 '?dolibarr_lib_ODTPHP_PATHTOPCLZIP' => 'dolibarr_lib_ODTPHP_PATHTOPCLZIP',
440 '?dolibarr_js_CKEDITOR' => 'dolibarr_js_CKEDITOR',
441 '?dolibarr_js_JQUERY' => 'dolibarr_js_JQUERY',
442 '?dolibarr_js_JQUERY_UI' => 'dolibarr_js_JQUERY_UI',
443 '?dolibarr_font_DOL_DEFAULT_TTF' => 'dolibarr_font_DOL_DEFAULT_TTF',
444 '?dolibarr_font_DOL_DEFAULT_TTF_BOLD' => 'dolibarr_font_DOL_DEFAULT_TTF_BOLD',
445 'separator4' => '',
446 'dolibarr_main_restrict_os_commands' => 'Restrict CLI commands for backups',
447 'dolibarr_main_restrict_ip' => 'Restrict access to some IPs only',
448 '?dolibarr_mailing_limit_sendbyweb' => 'Limit nb of email sent by page',
449 '?dolibarr_mailing_limit_sendbycli' => 'Limit nb of email sent by cli',
450 '?dolibarr_mailing_limit_sendbyday' => 'Limit nb of email sent per day',
451 '?dolibarr_strict_mode' => 'Strict mode is on/off',
452 '?dolibarr_nocsrfcheck' => 'Disable CSRF security checks'
453);
454
455print '<div class="div-table-responsive-no-min">';
456print '<table class="noborder centpercent">';
457print '<tr class="liste_titre">';
458print '<td class="titlefieldcreate">'.$langs->trans("Parameters").' ';
459print $langs->trans("ConfigurationFile").' ('.basename($conffile).')';
460print '</td>';
461print '<td>'.$langs->trans("Name").'</td>';
462print '<td></td>';
463print '</tr>'."\n";
464
465
466$lastkeyshown = null;
467
468foreach ($configfileparameters as $key => $value) {
469 $ignore = 0;
470
471 if (empty($ignore)) {
472 $newkey = preg_replace('/^\?/', '', $key);
473
474 if (preg_match('/^\?/', $key) && empty(${$newkey})) {
475 if ($newkey != 'multicompany_transverse_mode' || !isModEnabled('multicompany')) {
476 continue; // We discard parameters starting with ?
477 }
478 }
479 if (strpos($newkey, 'separator') !== false && $lastkeyshown == 'separator') {
480 continue;
481 }
482
483 print '<tr class="oddeven">';
484 if (strpos($newkey, 'separator') !== false) {
485 print '<td colspan="3">&nbsp;</td>';
486 } else {
487 // Label
488 print "<td>".$value.'</td>';
489 // Key
490 print '<td>'.$newkey.'</td>';
491 // Value
492 print "<td>";
493 if (in_array($newkey, array('dolibarr_main_db_pass', 'dolibarr_main_auth_ldap_admin_pass'))) {
494 if (empty($dolibarr_main_prod)) {
495 print '<!-- '.${$newkey}.' -->';
496 print showValueWithClipboardCPButton(${$newkey}, 0, '********');
497 } else {
498 print '**********';
499 }
500 } elseif ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/', ${$newkey})) {
501 print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT');
502 } elseif ($newkey == 'dolibarr_main_document_root_alt') {
503 $tmparray = explode(',', $dolibarr_main_document_root_alt);
504 $i = 0;
505 foreach ($tmparray as $value2) {
506 if ($i > 0) {
507 print ', ';
508 }
509 print $value2;
510 if (!is_readable($value2)) {
511 $langs->load("errors");
512 print ' '.img_warning($langs->trans("ErrorCantReadDir", $value2));
513 }
514 ++$i;
515 }
516 } elseif ($newkey == 'dolibarr_main_instance_unique_id') {
517 $valuetoshow = $conf->file->instance_unique_id;
518 // $conf->file->instance_unique_id is defined into master.inc.php with:
519 // empty($dolibarr_main_instance_unique_id) ? (empty($dolibarr_main_cookie_cryptkey) ? '' : $dolibarr_main_cookie_cryptkey) : $dolibarr_main_instance_unique_id
520
521 if (empty($dolibarr_main_prod)) {
522 print '<!-- '.$valuetoshow.' (this will not be visible if $dolibarr_main_prod = 1 -->';
523 print showValueWithClipboardCPButton($valuetoshow, 0, '********');
524 print ' &nbsp; &nbsp; <span class="opacitymedium">'.$langs->trans("ThisValueCanBeReadBecauseInstanceIsNotInProductionMode").'</span>';
525 } else {
526 print '**********';
527 print ' &nbsp; &nbsp; <span class="opacitymedium">'.$langs->trans("SeeConfFile").'</span>';
528 }
529 if (empty($valuetoshow)) {
530 print img_warning("EditConfigFileToAddEntry", 'dolibarr_main_instance_unique_id');
531 }
532 print '</td></tr>';
533
534 $algo = 'sha256';
535 $hash_unique_id = getHashUniqueIdOfRegistration($algo);
536
537 print '<tr class="oddeven"><td></td><td>&nbsp;<span title="Hash calculated with dol_hash(dolibarr.$dolibarr_main_instance_unique_id[.entity], sha256)"> => '.$langs->trans("HashForPing").'</span></td><td>'.$hash_unique_id.'</td></tr>'."\n";
538 } elseif ($newkey == 'dolibarr_main_prod') {
539 print ${$newkey};
540
541 $valuetoshow = ${$newkey};
542 if (empty($valuetoshow)) {
543 print img_warning($langs->trans('SwitchThisForABetterSecurity', 1));
544 }
545 } elseif ($newkey == 'dolibarr_nocsrfcheck') {
546 print ${$newkey};
547
548 $valuetoshow = ${$newkey};
549 if (!empty($valuetoshow)) {
550 print img_warning($langs->trans('SwitchThisForABetterSecurity', 0));
551 }
552 } elseif ($newkey == 'dolibarr_main_db_readonly') {
553 print ${$newkey};
554
555 $valuetoshow = ${$newkey};
556 if (!empty($valuetoshow)) {
557 print img_warning($langs->trans('ReadOnlyMode', 1));
558 }
559 } else {
560 print(empty(${$newkey}) ? '' : ${$newkey});
561 }
562 if ($newkey == 'dolibarr_main_url_root' && ${$newkey} != DOL_MAIN_URL_ROOT) {
563 print ' (currently overwritten by autodetected value: '.DOL_MAIN_URL_ROOT.')';
564 }
565 print "</td>";
566 }
567 print "</tr>\n";
568 $lastkeyshown = $newkey;
569 }
570}
571print '</table>';
572print '</div>';
573print '<br>';
574
575
576
577// Parameters in database
578print '<div class="div-table-responsive-no-min">';
579print '<table class="noborder">';
580print '<tr class="liste_titre">';
581print '<td class="titlefield">'.$langs->trans("Parameters").' '.$langs->trans("Database").'</td>';
582print '<td></td>';
583if (!isModEnabled('multicompany') || !$user->entity) {
584 print '<td class="center width="80px"">'.$langs->trans("Entity").'</td>'; // If superadmin or multicompany disabled
585}
586print "</tr>\n";
587
588$sql = "SELECT";
589$sql .= " rowid";
590$sql .= ", ".$db->decrypt('name')." as name";
591$sql .= ", ".$db->decrypt('value')." as value";
592$sql .= ", type";
593$sql .= ", note";
594$sql .= ", entity";
595$sql .= " FROM ".MAIN_DB_PREFIX."const";
596if (!isModEnabled('multicompany')) {
597 // If no multicompany mode, admins can see global and their constantes
598 $sql .= " WHERE entity IN (0,".$conf->entity.")";
599} else {
600 // If multicompany mode, superadmin (user->entity=0) can see everything, admin are limited to their entities.
601 if ($user->entity) {
602 $sql .= " WHERE entity IN (".$db->sanitize($user->entity.",".$conf->entity).")";
603 }
604}
605$sql .= " ORDER BY entity, name ASC";
606$resql = $db->query($sql);
607if ($resql) {
608 $num = $db->num_rows($resql);
609 $i = 0;
610
611 while ($i < $num) {
612 $obj = $db->fetch_object($resql);
613
614 print '<tr class="oddeven">';
615 print '<td class="tdoverflowmax600" title="'.dol_escape_htmltag($obj->name).'">'.dol_escape_htmltag($obj->name).'</td>'."\n";
616 print '<td class="tdoverflowmax300">';
617 if (isASecretKey($obj->name)) {
618 if (empty($dolibarr_main_prod)) {
619 print '<!-- '.$obj->value.' -->';
620 }
621 print '**********';
622 } else {
623 print dol_escape_htmltag($obj->value);
624 }
625 print '</td>'."\n";
626 if (!isModEnabled('multicompany') || !$user->entity) {
627 print '<td class="center" width="80px">'.$obj->entity.'</td>'."\n"; // If superadmin or multicompany disabled
628 }
629 print "</tr>\n";
630
631 $i++;
632 }
633}
634
635print '</table>';
636print '</div>';
637
638// End of page
639llxFooter();
640$db->close();
versioncompare($versionarray1, $versionarray2)
Compare 2 versions (stored into 2 arrays), to know if a version (a,b,c) is lower than (x,...
Definition admin.lib.php:72
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
Definition wrapper.php:91
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Definition wrapper.php:73
$c
Definition line.php:334
getBlockedLogVersionToShow()
Define head array for tabs of blockedlog tools setup pages.
isALNEQualifiedVersion($ignoredev=0, $ignoremodule=0)
Return if the version is a candidate version to get the LNE certification and if the prerequisites ar...
getHashUniqueIdOfRegistration($algo='sha256')
Return a hash unique identifier of the registration (used to identify the registration of instance wi...
isALNERunningVersion($blockedlogtestalreadydone=0, $blockedlogmodulealreadydone=0)
Return if the application is executed with the LNE requirements on.
Class to manage generation of HTML components Only common components must be here.
global $mysoc
getServerTimeZoneString()
Return server timezone string.
Definition date.lib.php:76
getServerTimeZoneInt($refgmtdate='now')
Return server timezone int.
Definition date.lib.php:87
dol_get_first_day($year, $month=1, $gm=false)
Return GMT time for first day of a month or year.
Definition date.lib.php:604
dol_stringtotime($string, $gm=1)
Convert a string date into a GM Timestamps date Warning: YYYY-MM-DDTHH:MM:SS+02:00 (RFC3339) is not s...
Definition date.lib.php:435
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $db
API class for accounts.
$conffile
dol_now($mode='gmt')
Return date for now.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='', $textonpictotooltip='')
Show information in HTML for admin users or standard users.
isASecretKey($keyname)
Return if string has a name dedicated to store a secret.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
yn($yesno, $format=1, $color=0)
Return yes or no in current language.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
img_info($titlealt='default')
Show info logo.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
getURLContent($url, $postorget='GET', $param='', $followlocation=1, $addheaders=array(), $allowedschemes=array('http', 'https'), $localurl=0, $ssl_verifypeer=-1, $timeoutconnect=0, $timeoutresponse=0, $otherCurlOptions=array(), $morelogsuffix='')
Function to get a content from an URL (use proxy if proxy defined).
dol_listshmop()
Return list of contents of all memory area shared.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.