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