dolibarr 21.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 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';
29require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
30require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
31require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
32require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
33require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
34
35'
36@phan-var-force string $dolibarr_main_document_root_alt
37';
48// Load translation files required by the page
49$langs->loadLangs(array("install", "other", "admin"));
50
51$action = GETPOST('action', 'aZ09');
52
53if (!$user->admin) {
55}
56
57$sfurl = '';
58$version = '0.0';
59
60
61/*
62 * Actions
63 */
64
65if ($action == 'getlastversion') {
66 $result = getURLContent('https://sourceforge.net/projects/dolibarr/rss');
67 //var_dump($result['content']);
68 if (function_exists('simplexml_load_string')) {
69 if (LIBXML_VERSION < 20900) {
70 // Avoid load of external entities (security problem).
71 // Required only if LIBXML_VERSION < 20900
72 // @phan-suppress-next-line PhanDeprecatedFunctionInternal
73 libxml_disable_entity_loader(true);
74 }
75
76 $sfurl = simplexml_load_string($result['content'], 'SimpleXMLElement', LIBXML_NOCDATA | LIBXML_NONET);
77 } else {
78 setEventMessages($langs->trans("ErrorPHPDoesNotSupport", "xml"), null, 'errors');
79 }
80}
81
82
83/*
84 * View
85 */
86
87$form = new Form($db);
88
89$help_url = '';
90$title = $langs->trans("InfoDolibarr");
91
92llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'mod-admin page-system_dolibarr');
93
94print load_fiche_titre($title, '', 'title_setup');
95
96// Version
97print '<div class="div-table-responsive-no-min">';
98print '<table class="noborder centpercent">';
99print '<tr class="liste_titre"><td class="titlefieldcreate">'.$langs->trans("Version").'</td><td></td></tr>'."\n";
100print '<tr class="oddeven"><td>'.$langs->trans("CurrentVersion").'<br><span class="opacitymedium">('.$langs->trans("Programs").')</span></td><td>'.DOL_VERSION;
101// If current version differs from last upgrade
102if (!getDolGlobalString('MAIN_VERSION_LAST_UPGRADE')) {
103 // Compare version with last install database version (upgrades never occurred)
104 if (DOL_VERSION != $conf->global->MAIN_VERSION_LAST_INSTALL) {
105 print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired", DOL_VERSION, getDolGlobalString('MAIN_VERSION_LAST_INSTALL')));
106 }
107} else {
108 // Compare version with last upgrade database version
109 if (DOL_VERSION != $conf->global->MAIN_VERSION_LAST_UPGRADE) {
110 print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired", DOL_VERSION, getDolGlobalString('MAIN_VERSION_LAST_UPGRADE')));
111 }
112}
113
114$version = DOL_VERSION;
115if (preg_match('/[a-z]+/i', $version)) {
116 $version = 'develop'; // If version contains text, it is not an official tagged version, so we use the full change log.
117}
118print ' &nbsp; <a href="https://raw.githubusercontent.com/Dolibarr/dolibarr/'.$version.'/ChangeLog" target="_blank" rel="noopener noreferrer external">'.$langs->trans("SeeChangeLog").'</a>';
119
120$newversion = '';
121if (function_exists('curl_init')) {
122 $conf->global->MAIN_USE_RESPONSE_TIMEOUT = 10;
123 print ' &nbsp; &nbsp; - &nbsp; &nbsp; ';
124 if ($action == 'getlastversion') {
125 if ($sfurl) {
126 $i = 0;
127 while (!empty($sfurl->channel[0]->item[$i]->title) && $i < 10000) {
128 $title = $sfurl->channel[0]->item[$i]->title;
129 $reg = array();
130 if (preg_match('/([0-9]+\.([0-9\.]+))/', $title, $reg)) {
131 $newversion = $reg[1];
132 $newversionarray = explode('.', $newversion);
133 $versionarray = explode('.', $version);
134 //var_dump($newversionarray);var_dump($versionarray);
135 if (versioncompare($newversionarray, $versionarray) > 0) {
136 $version = $newversion;
137 }
138 }
139 $i++;
140 }
141
142 // Show version
143 print $langs->trans("LastStableVersion").' : <b>'.(($version != '0.0') ? $version : $langs->trans("Unknown")).'</b>';
144 if ($version != '0.0') {
145 print ' &nbsp; <a href="https://raw.githubusercontent.com/Dolibarr/dolibarr/'.$version.'/ChangeLog" target="_blank" rel="noopener noreferrer external">'.$langs->trans("SeeChangeLog").'</a>';
146 }
147 } else {
148 print $langs->trans("LastStableVersion").' : <b>'.$langs->trans("UpdateServerOffline").'</b>';
149 }
150 } else {
151 print $langs->trans("LastStableVersion").' : <a href="'.$_SERVER["PHP_SELF"].'?action=getlastversion" class="butAction smallpaddingimp">'.$langs->trans("Check").'</a>';
152 }
153}
154
155// Now show link to the changelog
156//print ' &nbsp; &nbsp; - &nbsp; &nbsp; ';
157
158$version = DOL_VERSION;
159if (preg_match('/[a-z]+/i', $version)) {
160 $version = 'develop'; // If version contains text, it is not an official tagged version, so we use the full change log.
161}
162
163print '</td></tr>'."\n";
164print '<tr class="oddeven"><td>'.$langs->trans("VersionLastUpgrade").'<br><span class="opacitymedium">('.$langs->trans("Database").')</span></td><td>'.getDolGlobalString('MAIN_VERSION_LAST_UPGRADE').'</td></tr>'."\n";
165print '<tr class="oddeven"><td>'.$langs->trans("VersionLastInstall").'<br><span class="opacitymedium">('.$langs->trans("Database").')</span></td><td>'.getDolGlobalString('MAIN_VERSION_LAST_INSTALL').'</td></tr>'."\n";
166print '</table>';
167print '</div>';
168print '<br>';
169
170// Session
171print '<div class="div-table-responsive-no-min">';
172print '<table class="noborder centpercent">';
173print '<tr class="liste_titre"><td class="titlefieldcreate">'.$langs->trans("Session").'</td><td></td></tr>'."\n";
174print '<tr class="oddeven"><td>'.$langs->trans("SessionSavePath").'</td><td>'.session_save_path().'</td></tr>'."\n";
175print '<tr class="oddeven"><td>'.$langs->trans("SessionName").'</td><td>'.session_name().'</td></tr>'."\n";
176print '<tr class="oddeven"><td>'.$langs->trans("SessionId").'</td><td>'.session_id().'</td></tr>'."\n";
177print '<tr class="oddeven"><td>';
178print $langs->trans("CurrentSessionTimeOut");
179print '</td>';
180print '<td>';
181print ini_get('session.gc_maxlifetime').' '.$langs->trans("seconds");
182print '<!-- session.gc_maxlifetime = '.ini_get("session.gc_maxlifetime").' -->'."\n";
183print '<!-- session.gc_probability = '.ini_get("session.gc_probability").' -->'."\n";
184print '<!-- session.gc_divisor = '.ini_get("session.gc_divisor").' -->'."\n";
185print $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")));
186print "</td></tr>\n";
187print '<tr class="oddeven"><td>'.$langs->trans("CurrentTheme").'</td><td>'.$conf->theme.'</td></tr>'."\n";
188print '<tr class="oddeven"><td>'.$langs->trans("CurrentMenuHandler").'</td><td>';
189print $conf->standard_menu;
190print '</td></tr>'."\n";
191print '<tr class="oddeven"><td>'.$langs->trans("Screen").'</td><td>';
192print $_SESSION['dol_screenwidth'].' x '.$_SESSION['dol_screenheight'];
193print '</td></tr>'."\n";
194print '<tr class="oddeven"><td>'.$langs->trans("Session").'</td><td class="wordbreak">';
195$i = 0;
196foreach ($_SESSION as $key => $val) {
197 if ($i > 0) {
198 print ', ';
199 }
200 if (is_array($val)) {
201 print $key.' => array(...)';
202 } else {
203 print $key.' => '.dol_escape_htmltag($val);
204 }
205 $i++;
206}
207print '</td></tr>'."\n";
208print '</table>';
209print '</div>';
210print '<br>';
211
212
213// Shmop
214if (getDolGlobalInt('MAIN_OPTIMIZE_SPEED') & 0x02) {
215 $shmoparray = dol_listshmop();
216
217 print '<div class="div-table-responsive-no-min">';
218 print '<table class="noborder centpercent">';
219 print '<tr class="liste_titre">';
220 print '<td class="titlefieldcreate">'.$langs->trans("LanguageFilesCachedIntoShmopSharedMemory").'</td>';
221 print '<td>'.$langs->trans("NbOfEntries").'</td>';
222 print '<td class="right">'.$langs->trans("Address").'</td>';
223 print '</tr>'."\n";
224
225 foreach ($shmoparray as $key => $val) {
226 print '<tr class="oddeven"><td>'.$key.'</td>';
227 print '<td>'.count($val).'</td>';
228 print '<td class="right">'.dol_getshmopaddress($key).'</td>';
229 print '</tr>'."\n";
230 }
231
232 print '</table>';
233 print '</div>';
234 print '<br>';
235}
236
237
238// Localisation
239print '<div class="div-table-responsive-no-min">';
240print '<table class="noborder centpercent">';
241print '<tr class="liste_titre"><td class="titlefieldcreate">'.$langs->trans("LocalisationDolibarrParameters").'</td><td></td></tr>'."\n";
242print '<tr class="oddeven"><td>'.$langs->trans("LanguageBrowserParameter", "HTTP_ACCEPT_LANGUAGE").'</td><td>'.$_SERVER["HTTP_ACCEPT_LANGUAGE"].'</td></tr>'."\n";
243print '<tr class="oddeven"><td>'.$langs->trans("CurrentUserLanguage").'</td><td>'.$langs->getDefaultLang().'</td></tr>'."\n";
244// Thousands
245$thousand = $langs->transnoentitiesnoconv("SeparatorThousand");
246if ($thousand == 'SeparatorThousand') {
247 $thousand = ' '; // ' ' does not work on trans method
248}
249if ($thousand == 'None') {
250 $thousand = '';
251}
252print '<tr class="oddeven"><td>'.$langs->trans("CurrentValueSeparatorThousand").'</td><td>'.($thousand == ' ' ? $langs->transnoentitiesnoconv("Space") : $thousand).'</td></tr>'."\n";
253// Decimals
254$dec = $langs->transnoentitiesnoconv("SeparatorDecimal");
255print '<tr class="oddeven"><td>'.$langs->trans("CurrentValueSeparatorDecimal").'</td><td>'.$dec.'</td></tr>'."\n";
256// Show results of functions to see if everything works
257print '<tr class="oddeven"><td>&nbsp; => price2num(1233.56+1)</td><td>'.price2num(1233.56 + 1, 2).'</td></tr>'."\n";
258print '<tr class="oddeven"><td>&nbsp; => price2num('."'1".$thousand."234".$dec."56')</td><td>".price2num("1".$thousand."234".$dec."56", 2)."</td></tr>\n";
259if (($thousand != ',' && $thousand != '.') || ($thousand != ' ')) {
260 print '<tr class="oddeven"><td>&nbsp; => price2num('."'1 234.56')</td><td>".price2num("1 234.56", 2)."</td>";
261 print "</tr>\n";
262}
263print '<tr class="oddeven"><td>&nbsp; => price(1234.56)</td><td>'.price(1234.56).'</td></tr>'."\n";
264
265// Timezones
266
267// Database timezone
268if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli') {
269 print '<tr class="oddeven"><td>'.$langs->trans("MySQLTimeZone").' (database)</td><td>'; // Timezone server base
270 $sql = "SHOW VARIABLES where variable_name = 'system_time_zone'";
271 $resql = $db->query($sql);
272 if ($resql) {
273 $obj = $db->fetch_object($resql);
274 print $form->textwithtooltip($obj->Value, $langs->trans('TZHasNoEffect'), 2, 1, img_info(''));
275 }
276 print '</td></tr>'."\n";
277}
278$txt = $langs->trans("OSTZ").' (variable system TZ): '.(!empty($_ENV["TZ"]) ? $_ENV["TZ"] : $langs->trans("NotDefined")).'<br>'."\n";
279$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
280$txt .= $langs->trans("Dolibarr constant MAIN_SERVER_TZ").': '.getDolGlobalString('MAIN_SERVER_TZ', $langs->trans("NotDefined"));
281print '<tr class="oddeven"><td>'.$langs->trans("CurrentTimeZone").'</td><td>'; // Timezone server PHP
282$a = getServerTimeZoneInt('now');
283$b = getServerTimeZoneInt('winter');
284$c = getServerTimeZoneInt('summer');
285$daylight = round($c - $b);
286//print $a." ".$b." ".$c." ".$daylight;
287$val = ($a >= 0 ? '+' : '').$a;
288$val .= ' ('.($a == 'unknown' ? 'unknown' : ($a >= 0 ? '+' : '').($a * 3600)).')';
289$val .= ' &nbsp; &nbsp; &nbsp; '.getServerTimeZoneString();
290$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').')' : '')));
291print $form->textwithtooltip($val, $txt, 2, 1, img_info(''));
292print '</td></tr>'."\n"; // value defined in http://fr3.php.net/manual/en/timezones.europe.php
293print '<tr class="oddeven"><td>&nbsp; => '.$langs->trans("CurrentHour").'</td><td>'.dol_print_date(dol_now('gmt'), 'dayhour', 'tzserver').'</td></tr>'."\n";
294print '<tr class="oddeven"><td>&nbsp; => dol_print_date(0,"dayhourtext")</td><td>'.dol_print_date(0, "dayhourtext").'</td>';
295print '<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>';
296print '<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>';
297// Client
298$tz = (int) $_SESSION['dol_tz'] + (int) $_SESSION['dol_dst'];
299print '<tr class="oddeven"><td>'.$langs->trans("ClientTZ").'</td><td>'.($tz ? ($tz >= 0 ? '+' : '').$tz : '').' ('.($tz >= 0 ? '+' : '').($tz * 60 * 60).')';
300print ' &nbsp; &nbsp; &nbsp; '.$_SESSION['dol_tz_string'];
301print ' &nbsp; &nbsp; &nbsp; '.$langs->trans("DaylingSavingTime").': ';
302if ($_SESSION['dol_dst'] > 0) {
303 print yn(1);
304} else {
305 print yn(0);
306}
307if (!empty($_SESSION['dol_dst_first'])) {
308 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').')';
309}
310print '</td></tr>'."\n";
311print '</td></tr>'."\n";
312print '<tr class="oddeven"><td>&nbsp; => '.$langs->trans("ClientHour").'</td><td>'.dol_print_date(dol_now('gmt'), 'dayhour', 'tzuser').'</td></tr>'."\n";
313
314$filesystemencoding = ini_get("unicode.filesystem_encoding"); // Disponible avec PHP 6.0
315print '<tr class="oddeven"><td>'.$langs->trans("File encoding").' (php.ini unicode.filesystem_encoding)</td><td>'.$filesystemencoding.'</td></tr>'."\n";
316
317$tmp = ini_get("unicode.filesystem_encoding"); // Disponible avec PHP 6.0
318if (empty($tmp) && !empty($_SERVER["WINDIR"])) {
319 $tmp = 'iso-8859-1'; // By default for windows
320}
321if (empty($tmp)) {
322 $tmp = 'utf-8'; // By default for other
323}
324if (getDolGlobalString('MAIN_FILESYSTEM_ENCODING')) {
325 $tmp = getDolGlobalString('MAIN_FILESYSTEM_ENCODING');
326}
327print '<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
328
329print '</table>';
330print '</div>';
331print '<br>';
332
333
334
335// Parameters in conf.php file (when a parameter start with ?, it is shown only if defined)
336$configfileparameters = array(
337 'dolibarr_main_prod' => 'Production mode (Hide all error messages)',
338 'dolibarr_main_instance_unique_id' => $langs->trans("InstanceUniqueID"),
339 'separator0' => '',
340 'dolibarr_main_url_root' => $langs->trans("URLRoot"),
341 '?dolibarr_main_url_root_alt' => $langs->trans("URLRoot").' (alt)',
342 'dolibarr_main_document_root' => $langs->trans("DocumentRootServer"),
343 '?dolibarr_main_document_root_alt' => $langs->trans("DocumentRootServer").' (alt)',
344 'dolibarr_main_data_root' => $langs->trans("DataRootServer"),
345 'separator1' => '',
346 'dolibarr_main_db_host' => $langs->trans("DatabaseServer"),
347 'dolibarr_main_db_port' => $langs->trans("DatabasePort"),
348 'dolibarr_main_db_name' => $langs->trans("DatabaseName"),
349 'dolibarr_main_db_type' => $langs->trans("DriverType"),
350 'dolibarr_main_db_user' => $langs->trans("DatabaseUser"),
351 'dolibarr_main_db_pass' => $langs->trans("DatabasePassword"),
352 'dolibarr_main_db_character_set' => $langs->trans("DBStoringCharset"),
353 'dolibarr_main_db_collation' => $langs->trans("DBSortingCollation"),
354 '?dolibarr_main_db_prefix' => $langs->trans("DatabasePrefix"),
355 'dolibarr_main_db_readonly' => $langs->trans("ReadOnlyMode"),
356 'separator2' => '',
357 'dolibarr_main_authentication' => $langs->trans("AuthenticationMode"),
358 '?multicompany_transverse_mode' => $langs->trans("MultiCompanyMode"),
359 'separator' => '',
360 '?dolibarr_main_auth_ldap_login_attribute' => 'dolibarr_main_auth_ldap_login_attribute',
361 '?dolibarr_main_auth_ldap_host' => 'dolibarr_main_auth_ldap_host',
362 '?dolibarr_main_auth_ldap_port' => 'dolibarr_main_auth_ldap_port',
363 '?dolibarr_main_auth_ldap_version' => 'dolibarr_main_auth_ldap_version',
364 '?dolibarr_main_auth_ldap_dn' => 'dolibarr_main_auth_ldap_dn',
365 '?dolibarr_main_auth_ldap_admin_login' => 'dolibarr_main_auth_ldap_admin_login',
366 '?dolibarr_main_auth_ldap_admin_pass' => 'dolibarr_main_auth_ldap_admin_pass',
367 '?dolibarr_main_auth_ldap_debug' => 'dolibarr_main_auth_ldap_debug',
368 'separator3' => '',
369 '?dolibarr_lib_FPDF_PATH' => 'dolibarr_lib_FPDF_PATH',
370 '?dolibarr_lib_TCPDF_PATH' => 'dolibarr_lib_TCPDF_PATH',
371 '?dolibarr_lib_FPDI_PATH' => 'dolibarr_lib_FPDI_PATH',
372 '?dolibarr_lib_TCPDI_PATH' => 'dolibarr_lib_TCPDI_PATH',
373 '?dolibarr_lib_NUSOAP_PATH' => 'dolibarr_lib_NUSOAP_PATH',
374 '?dolibarr_lib_GEOIP_PATH' => 'dolibarr_lib_GEOIP_PATH',
375 '?dolibarr_lib_ODTPHP_PATH' => 'dolibarr_lib_ODTPHP_PATH',
376 '?dolibarr_lib_ODTPHP_PATHTOPCLZIP' => 'dolibarr_lib_ODTPHP_PATHTOPCLZIP',
377 '?dolibarr_js_CKEDITOR' => 'dolibarr_js_CKEDITOR',
378 '?dolibarr_js_JQUERY' => 'dolibarr_js_JQUERY',
379 '?dolibarr_js_JQUERY_UI' => 'dolibarr_js_JQUERY_UI',
380 '?dolibarr_font_DOL_DEFAULT_TTF' => 'dolibarr_font_DOL_DEFAULT_TTF',
381 '?dolibarr_font_DOL_DEFAULT_TTF_BOLD' => 'dolibarr_font_DOL_DEFAULT_TTF_BOLD',
382 'separator4' => '',
383 'dolibarr_main_restrict_os_commands' => 'Restrict CLI commands for backups',
384 'dolibarr_main_restrict_ip' => 'Restrict access to some IPs only',
385 '?dolibarr_mailing_limit_sendbyweb' => 'Limit nb of email sent by page',
386 '?dolibarr_mailing_limit_sendbycli' => 'Limit nb of email sent by cli',
387 '?dolibarr_mailing_limit_sendbyday' => 'Limit nb of email sent per day',
388 '?dolibarr_strict_mode' => 'Strict mode is on/off',
389 '?dolibarr_nocsrfcheck' => 'Disable CSRF security checks'
390);
391
392print '<div class="div-table-responsive-no-min">';
393print '<table class="noborder centpercent">';
394print '<tr class="liste_titre">';
395print '<td class="titlefieldcreate">'.$langs->trans("Parameters").' ';
396print $langs->trans("ConfigurationFile").' ('.$conffiletoshowshort.')';
397print '</td>';
398print '<td>'.$langs->trans("Name").'</td>';
399print '<td></td>';
400print '</tr>'."\n";
401
402
403$lastkeyshown = null;
404
405foreach ($configfileparameters as $key => $value) {
406 $ignore = 0;
407
408 if (empty($ignore)) {
409 $newkey = preg_replace('/^\?/', '', $key);
410
411 if (preg_match('/^\?/', $key) && empty(${$newkey})) {
412 if ($newkey != 'multicompany_transverse_mode' || !isModEnabled('multicompany')) {
413 continue; // We discard parameters starting with ?
414 }
415 }
416 if (strpos($newkey, 'separator') !== false && $lastkeyshown == 'separator') {
417 continue;
418 }
419
420 print '<tr class="oddeven">';
421 if (strpos($newkey, 'separator') !== false) {
422 print '<td colspan="3">&nbsp;</td>';
423 } else {
424 // Label
425 print "<td>".$value.'</td>';
426 // Key
427 print '<td>'.$newkey.'</td>';
428 // Value
429 print "<td>";
430 if (in_array($newkey, array('dolibarr_main_db_pass', 'dolibarr_main_auth_ldap_admin_pass'))) {
431 if (empty($dolibarr_main_prod)) {
432 print '<!-- '.${$newkey}.' -->';
433 print showValueWithClipboardCPButton(${$newkey}, 0, '********');
434 } else {
435 print '**********';
436 }
437 } elseif ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/', ${$newkey})) {
438 print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT');
439 } elseif ($newkey == 'dolibarr_main_document_root_alt') {
440 $tmparray = explode(',', $dolibarr_main_document_root_alt);
441 $i = 0;
442 foreach ($tmparray as $value2) {
443 if ($i > 0) {
444 print ', ';
445 }
446 print $value2;
447 if (!is_readable($value2)) {
448 $langs->load("errors");
449 print ' '.img_warning($langs->trans("ErrorCantReadDir", $value2));
450 }
451 ++$i;
452 }
453 } elseif ($newkey == 'dolibarr_main_instance_unique_id') {
454 //print $conf->file->instance_unique_id;
455 global $dolibarr_main_cookie_cryptkey, $dolibarr_main_instance_unique_id;
456 $valuetoshow = $dolibarr_main_instance_unique_id ? $dolibarr_main_instance_unique_id : $dolibarr_main_cookie_cryptkey; // Use $dolibarr_main_instance_unique_id first then $dolibarr_main_cookie_cryptkey
457 if (empty($dolibarr_main_prod)) {
458 print '<!-- '.$dolibarr_main_instance_unique_id.' (this will not be visible if $dolibarr_main_prod = 1 -->';
459 print showValueWithClipboardCPButton($valuetoshow, 0, '********');
460 print ' &nbsp; &nbsp; <span class="opacitymedium">'.$langs->trans("ThisValueCanBeReadBecauseInstanceIsNotInProductionMode").'</span>';
461 } else {
462 print '**********';
463 print ' &nbsp; &nbsp; <span class="opacitymedium">'.$langs->trans("SeeConfFile").'</span>';
464 }
465 if (empty($valuetoshow)) {
466 print img_warning("EditConfigFileToAddEntry", 'dolibarr_main_instance_unique_id');
467 }
468 print '</td></tr>';
469 print '<tr class="oddeven"><td></td><td>&nbsp; => '.$langs->trans("HashForPing").'</td><td>'.md5('dolibarr'.$valuetoshow).'</td></tr>'."\n";
470 } elseif ($newkey == 'dolibarr_main_prod') {
471 print ${$newkey};
472
473 $valuetoshow = ${$newkey};
474 if (empty($valuetoshow)) {
475 print img_warning($langs->trans('SwitchThisForABetterSecurity', 1));
476 }
477 } elseif ($newkey == 'dolibarr_nocsrfcheck') {
478 print ${$newkey};
479
480 $valuetoshow = ${$newkey};
481 if (!empty($valuetoshow)) {
482 print img_warning($langs->trans('SwitchThisForABetterSecurity', 0));
483 }
484 } elseif ($newkey == 'dolibarr_main_db_readonly') {
485 print ${$newkey};
486
487 $valuetoshow = ${$newkey};
488 if (!empty($valuetoshow)) {
489 print img_warning($langs->trans('ReadOnlyMode', 1));
490 }
491 } else {
492 print(empty(${$newkey}) ? '' : ${$newkey});
493 }
494 if ($newkey == 'dolibarr_main_url_root' && ${$newkey} != DOL_MAIN_URL_ROOT) {
495 print ' (currently overwritten by autodetected value: '.DOL_MAIN_URL_ROOT.')';
496 }
497 print "</td>";
498 }
499 print "</tr>\n";
500 $lastkeyshown = $newkey;
501 }
502}
503print '</table>';
504print '</div>';
505print '<br>';
506
507
508
509// Parameters in database
510print '<div class="div-table-responsive-no-min">';
511print '<table class="noborder">';
512print '<tr class="liste_titre">';
513print '<td class="titlefield">'.$langs->trans("Parameters").' '.$langs->trans("Database").'</td>';
514print '<td></td>';
515if (!isModEnabled('multicompany') || !$user->entity) {
516 print '<td class="center width="80px"">'.$langs->trans("Entity").'</td>'; // If superadmin or multicompany disabled
517}
518print "</tr>\n";
519
520$sql = "SELECT";
521$sql .= " rowid";
522$sql .= ", ".$db->decrypt('name')." as name";
523$sql .= ", ".$db->decrypt('value')." as value";
524$sql .= ", type";
525$sql .= ", note";
526$sql .= ", entity";
527$sql .= " FROM ".MAIN_DB_PREFIX."const";
528if (!isModEnabled('multicompany')) {
529 // If no multicompany mode, admins can see global and their constantes
530 $sql .= " WHERE entity IN (0,".$conf->entity.")";
531} else {
532 // If multicompany mode, superadmin (user->entity=0) can see everything, admin are limited to their entities.
533 if ($user->entity) {
534 $sql .= " WHERE entity IN (".$db->sanitize($user->entity.",".$conf->entity).")";
535 }
536}
537$sql .= " ORDER BY entity, name ASC";
538$resql = $db->query($sql);
539if ($resql) {
540 $num = $db->num_rows($resql);
541 $i = 0;
542
543 while ($i < $num) {
544 $obj = $db->fetch_object($resql);
545
546 print '<tr class="oddeven">';
547 print '<td class="tdoverflowmax600" title="'.dol_escape_htmltag($obj->name).'">'.dol_escape_htmltag($obj->name).'</td>'."\n";
548 print '<td class="tdoverflowmax300">';
549 if (isASecretKey($obj->name)) {
550 if (empty($dolibarr_main_prod)) {
551 print '<!-- '.$obj->value.' -->';
552 }
553 print '**********';
554 } else {
555 print dol_escape_htmltag($obj->value);
556 }
557 print '</td>'."\n";
558 if (!isModEnabled('multicompany') || !$user->entity) {
559 print '<td class="center" width="80px">'.$obj->entity.'</td>'."\n"; // If superadmin or multicompany disabled
560 }
561 print "</tr>\n";
562
563 $i++;
564 }
565}
566
567print '</table>';
568print '</div>';
569
570// End of page
571llxFooter();
572$db->close();
versioncompare($versionarray1, $versionarray2)
Compare 2 versions (stored into 2 arrays).
Definition admin.lib.php:69
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:71
Class to manage generation of HTML components Only common components must be here.
getServerTimeZoneString()
Return server timezone string.
Definition date.lib.php:75
getServerTimeZoneInt($refgmtdate='now')
Return server timezone int.
Definition date.lib.php:86
dol_get_first_day($year, $month=1, $gm=false)
Return GMT time for first day of a month or year.
Definition date.lib.php:600
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:431
llxFooter()
Footer empty.
Definition document.php:107
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
showValueWithClipboardCPButton($valuetocopy, $showonlyonhover=1, $texttoshow='')
Create a button to copy $valuetocopy in the clipboard (for copy and paste feature).
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
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 '.
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
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.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
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)
Function to get a content from an URL (use proxy if proxy defined).
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
Definition member.php:79
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.