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