dolibarr 25.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-2026 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("blockedlog", "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($action == 'getlastversion' ? '<br>' : ' &nbsp; &nbsp; - &nbsp; &nbsp; ');
142 if ($action == 'getlastversion') {
143 if ($sfurl) {
144 $currentversionarray = explode('.', DOL_VERSION);
145 $branchversion = ''; // Latest version of the branch currently running
146 $i = 0;
147 while (!empty($sfurl->channel[0]->item[$i]->title) && $i < 10000) {
148 $title = $sfurl->channel[0]->item[$i]->title;
149 $reg = array();
150 if (preg_match('/([0-9]+\.([0-9\.]+))/', $title, $reg)) {
151 $newversion = $reg[1];
152 $newversionarray = explode('.', $newversion);
153 $versionarray = explode('.', $version);
154 //var_dump($newversionarray);var_dump($versionarray);
155 if (versioncompare($newversionarray, $versionarray) > 0) {
156 $version = $newversion;
157 }
158 if (count($newversionarray) >= 2 && $newversionarray[0] == $currentversionarray[0] && $newversionarray[1] == $currentversionarray[1]
159 && ($branchversion == '' || versioncompare($newversionarray, explode('.', $branchversion)) > 0)) {
160 $branchversion = $newversion;
161 }
162 }
163 $i++;
164 }
165
166 // Show first the latest version of the running branch, when it is not the latest stable one
167 $currentbranch = $currentversionarray[0].'.'.(isset($currentversionarray[1]) ? $currentversionarray[1] : '');
168 $versionarray = explode('.', $version);
169 if (!preg_match('/[a-z]+/i', DOL_VERSION) && $currentbranch != $versionarray[0].'.'.(isset($versionarray[1]) ? $versionarray[1] : '')) {
170 print $langs->trans("LastVersionOfBranch", $currentbranch).' : <b>'.($branchversion != '' ? $branchversion : $langs->trans("Unknown")).'</b>';
171 if ($branchversion != '') {
172 print ' &nbsp; <a href="https://raw.githubusercontent.com/Dolibarr/dolibarr/'.$branchversion.'/ChangeLog" target="_blank" rel="noopener noreferrer external">'.img_picto('', 'url', 'class="paddingright"').$langs->trans("SeeChangeLog").'</a>';
173 }
174 print '<br>';
175 }
176
177 // Show version
178 print $langs->trans("LastStableVersion").' : <b>'.(($version != '0.0') ? $version : $langs->trans("Unknown")).'</b>';
179 if ($version != '0.0') {
180 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>';
181 }
182 } else {
183 print $langs->trans("LastStableVersion").' : <b>'.$langs->trans("UpdateServerOffline").'</b>';
184 }
185 } else {
186 print $langs->trans("LastStableVersion").' : <a href="'.$_SERVER["PHP_SELF"].'?action=getlastversion&token='.newToken().'" class="butAction smallpaddingimp">'.$langs->trans("Check").'</a>';
187 }
188}
189
190// Now show link to the changelog
191//print ' &nbsp; &nbsp; - &nbsp; &nbsp; ';
192
193$version = DOL_VERSION;
194if (preg_match('/[a-z]+/i', $version)) {
195 $version = 'develop'; // If version contains text, it is not an official tagged version, so we use the full change log.
196}
197
198print '</td></tr>'."\n";
199print '<tr class="oddeven"><td>'.$langs->trans("VersionLastUpgrade").'<br><span class="opacitymedium">('.$langs->trans("Database").')</span></td><td>';
200if (getDolGlobalString('MAIN_VERSION_LAST_UPGRADE')) {
201 print '<span class="badge-text badge-secondary">'.getDolGlobalString('MAIN_VERSION_LAST_UPGRADE').'</span>';
202}
203if (getDolGlobalString('MAIN_VERSION_LAST_INSTALL')) {
204 print ' &nbsp; <span class="opacitymedium">'.$langs->trans("VersionLastInstall").': <span class="">'.getDolGlobalString('MAIN_VERSION_LAST_INSTALL').'</span></span>';
205}
206print '</td></tr>'."\n";
207
208$showblockedlogversion = 0;
209if ($mysoc->country_code == 'FR') {
210 $showblockedlogversion = 1;
211}
213 $showblockedlogversion = 1;
214}
215if ($showblockedlogversion) {
216 print '<tr class="oddeven nohover">';
217 print '<td width="300">'.$langs->trans("VersionOfModule", $langs->transnoentitiesnoconv("BlockedLog")).'</td><td>';
218 print $versionbadge;
219
220 print ' &nbsp; <a href="'.DOL_URL_ROOT.'/blockedlog/admin/filecheck.php">'.img_picto('', 'url', 'class="pictofixedwidth"').$langs->trans("FileCheck").'</a>';
221
222 print '</td>';
223 print '</tr>';
224}
225
226print '</table>';
227print '</div>';
228
229// Add a complementary optional information
230$infotoshow = '';
231if ($mysoc->country_code == 'FR') {
232 $islne = isALNEQualifiedVersion(1, 1);
233 if ($islne) {
234 if (preg_match('/\-/', getBlockedLogVersionToShow())) {
235 // This is an alpha or beta version
236 $infotoshow = $langs->trans("LNECandidateVersionForCertificationFR", getBlockedLogVersionToShow());
237 } else {
238 $infotoshow = $langs->trans("LNECertifiedVersionFR", getBlockedLogVersionToShow());
239 }
240 } else {
241 $infotoshow = $langs->trans("NotCertifiedVersionFR", getBlockedLogVersionToShow());
242 }
243}
244if ($infotoshow) {
245 print info_admin($infotoshow, 0, 0, 'info', 'hideonsmartphone', '', '', 'CERTIF_LNE = '.(defined('CERTIF_LNE') ? (int) constant('CERTIF_LNE') : 0));
246}
247
248print '<br>';
249
250// Session
251print '<div class="div-table-responsive-no-min">';
252print '<table class="noborder centpercent">';
253print '<tr class="liste_titre"><td class="titlefieldcreate">'.$langs->trans("Session").'</td><td></td></tr>'."\n";
254print '<tr class="oddeven"><td>'.$langs->trans("SessionSavePath").'</td><td>'.session_save_path().'</td></tr>'."\n";
255print '<tr class="oddeven"><td>'.$langs->trans("SessionName").'</td><td>'.session_name().'</td></tr>'."\n";
256print '<tr class="oddeven"><td>'.$langs->trans("SessionId").'</td><td>'.session_id().'</td></tr>'."\n";
257print '<tr class="oddeven"><td>';
258print $langs->trans("CurrentSessionTimeOut");
259print '</td>';
260print '<td>';
261print ini_get('session.gc_maxlifetime').' '.$langs->trans("seconds");
262print '<!-- session.gc_maxlifetime = '.ini_get("session.gc_maxlifetime").' -->'."\n";
263print '<!-- session.gc_probability = '.ini_get("session.gc_probability").' -->'."\n";
264print '<!-- session.gc_divisor = '.ini_get("session.gc_divisor").' -->'."\n";
265print $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")));
266print "</td></tr>\n";
267print '<tr class="oddeven"><td>'.$langs->trans("CurrentTheme").'</td><td>'.$conf->theme.'</td></tr>'."\n";
268print '<tr class="oddeven"><td>'.$langs->trans("CurrentMenuHandler").'</td><td>';
269print $conf->standard_menu;
270print '</td></tr>'."\n";
271print '<tr class="oddeven"><td>'.$langs->trans("Screen").'</td><td>';
272print $_SESSION['dol_screenwidth'].' x '.$_SESSION['dol_screenheight'];
273print '</td></tr>'."\n";
274print '<tr class="oddeven"><td>'.$langs->trans("Session").'</td><td class="wordbreak">';
275$i = 0;
276foreach ($_SESSION as $key => $val) {
277 if ($i > 0) {
278 print ', ';
279 }
280 if (is_array($val)) {
281 print $key.' => array(...)';
282 } else {
283 print $key.' => '.dol_escape_htmltag($val);
284 }
285 $i++;
286}
287print '</td></tr>'."\n";
288print '</table>';
289print '</div>';
290print '<br>';
291
292
293// Shmop
294if (getDolGlobalInt('MAIN_OPTIMIZE_SPEED') & 0x02) {
295 $shmoparray = dol_listshmop();
296
297 print '<div class="div-table-responsive-no-min">';
298 print '<table class="noborder centpercent">';
299 print '<tr class="liste_titre">';
300 print '<td class="titlefieldcreate">'.$langs->trans("LanguageFilesCachedIntoShmopSharedMemory").'</td>';
301 print '<td>'.$langs->trans("NbOfEntries").'</td>';
302 print '<td class="right">'.$langs->trans("Address").'</td>';
303 print '</tr>'."\n";
304
305 foreach ($shmoparray as $key => $val) {
306 print '<tr class="oddeven"><td>'.$key.'</td>';
307 print '<td>'.count($val).'</td>';
308 print '<td class="right">'.dol_getshmopaddress($key).'</td>';
309 print '</tr>'."\n";
310 }
311
312 print '</table>';
313 print '</div>';
314 print '<br>';
315}
316
317
318// Localisation
319print '<div class="div-table-responsive-no-min">';
320print '<table class="noborder centpercent">';
321print '<tr class="liste_titre"><td class="titlefieldcreate">'.$langs->trans("LocalisationDolibarrParameters").'</td><td></td></tr>'."\n";
322print '<tr class="oddeven"><td>'.$langs->trans("LanguageBrowserParameter", "HTTP_ACCEPT_LANGUAGE").'</td><td>'.$_SERVER["HTTP_ACCEPT_LANGUAGE"].'</td></tr>'."\n";
323print '<tr class="oddeven"><td>'.$langs->trans("CurrentUserLanguage").'</td><td>'.$langs->getDefaultLang().'</td></tr>'."\n";
324// Thousands
325$thousand = $langs->transnoentitiesnoconv("SeparatorThousand");
326if ($thousand == 'SeparatorThousand') {
327 $thousand = ' '; // ' ' does not work on trans method
328}
329if ($thousand == 'None') {
330 $thousand = '';
331}
332print '<tr class="oddeven"><td>'.$langs->trans("CurrentValueSeparatorThousand").'</td><td>'.($thousand == ' ' ? $langs->transnoentitiesnoconv("Space") : $thousand).'</td></tr>'."\n";
333// Decimals
334$dec = $langs->transnoentitiesnoconv("SeparatorDecimal");
335print '<tr class="oddeven"><td>'.$langs->trans("CurrentValueSeparatorDecimal").'</td><td>'.$dec.'</td></tr>'."\n";
336// Show results of functions to see if everything works
337print '<tr class="oddeven"><td>&nbsp; => price2num(1233.56+1)</td><td>'.price2num(1233.56 + 1, 2).'</td></tr>'."\n";
338print '<tr class="oddeven"><td>&nbsp; => price2num('."'1".$thousand."234".$dec."56')</td><td>".price2num("1".$thousand."234".$dec."56", 2)."</td></tr>\n";
339if (($thousand != ',' && $thousand != '.') || ($thousand != ' ')) {
340 print '<tr class="oddeven"><td>&nbsp; => price2num('."'1 234.56')</td><td>".price2num("1 234.56", 2)."</td>";
341 print "</tr>\n";
342}
343print '<tr class="oddeven"><td>&nbsp; => price(1234.56)</td><td>'.price(1234.56).'</td></tr>'."\n";
344
345// Timezones
346
347// Database timezone
348if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli') {
349 print '<tr class="oddeven"><td>'.$langs->trans("MySQLTimeZone").' (database)</td><td>'; // Timezone server base
350 $sql = "SHOW VARIABLES where variable_name = 'system_time_zone'";
351 $resql = $db->query($sql);
352 if ($resql) {
353 $obj = $db->fetch_object($resql);
354 print $form->textwithtooltip($obj->Value, $langs->trans('TZHasNoEffect'), 2, 1, img_info(''));
355 }
356 print '</td></tr>'."\n";
357}
358$txt = $langs->trans("OSTZ").' (variable system TZ): '.(!empty($_ENV["TZ"]) ? $_ENV["TZ"] : $langs->trans("NotDefined")).'<br>'."\n";
359$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
360$txt .= $langs->trans("Dolibarr constant MAIN_SERVER_TZ").': '.getDolGlobalString('MAIN_SERVER_TZ', $langs->trans("NotDefined"));
361print '<tr class="oddeven"><td>'.$langs->trans("CurrentTimeZone").'</td><td>'; // Timezone server PHP
362$a = getServerTimeZoneInt('now');
363$b = getServerTimeZoneInt('winter');
364$c = getServerTimeZoneInt('summer');
365$daylight = round($c - $b);
366//print $a." ".$b." ".$c." ".$daylight;
367$val = ($a >= 0 ? '+' : '').$a;
368$val .= ' ('.($a == 'unknown' ? 'unknown' : ($a >= 0 ? '+' : '').($a * 3600)).')';
369$val .= ' &nbsp; &nbsp; &nbsp; '.getServerTimeZoneString();
370$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').')' : '')));
371print $form->textwithtooltip($val, $txt, 2, 1, img_info(''));
372print '</td></tr>'."\n"; // value defined in http://fr3.php.net/manual/en/timezones.europe.php
373print '<tr class="oddeven"><td>&nbsp; => '.$langs->trans("CurrentHour").'</td><td>'.dol_print_date(dol_now('gmt'), 'dayhour', 'tzserver').'</td></tr>'."\n";
374print '<tr class="oddeven"><td>&nbsp; => dol_print_date(0,"dayhourtext")</td><td>'.dol_print_date(0, "dayhourtext").'</td>';
375print '<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>';
376print '<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>';
377// Client
378$tz = (int) $_SESSION['dol_tz'] + (int) $_SESSION['dol_dst'];
379print '<tr class="oddeven"><td>'.$langs->trans("ClientTZ").'</td><td>'.($tz ? ($tz >= 0 ? '+' : '').$tz : '').' ('.($tz >= 0 ? '+' : '').($tz * 60 * 60).')';
380print ' &nbsp; &nbsp; &nbsp; '.$_SESSION['dol_tz_string'];
381print ' &nbsp; &nbsp; &nbsp; '.$langs->trans("DaylingSavingTime").': ';
382if ($_SESSION['dol_dst'] > 0) {
383 print yn(1);
384} else {
385 print yn(0);
386}
387if (!empty($_SESSION['dol_dst_first'])) {
388 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').')';
389}
390print '</td></tr>'."\n";
391print '</td></tr>'."\n";
392print '<tr class="oddeven"><td>&nbsp; => '.$langs->trans("ClientHour").'</td><td>'.dol_print_date(dol_now('gmt'), 'dayhour', 'tzuser').'</td></tr>'."\n";
393
394$filesystemencoding = ini_get("unicode.filesystem_encoding"); // Available with PHP 6.0
395print '<tr class="oddeven"><td>'.$langs->trans("File encoding").' (php.ini unicode.filesystem_encoding)</td><td>'.$filesystemencoding.'</td></tr>'."\n";
396
397$tmp = ini_get("unicode.filesystem_encoding"); // Available with PHP 6.0
398if (empty($tmp) && !empty($_SERVER["WINDIR"])) {
399 $tmp = 'iso-8859-1'; // By default for windows
400}
401if (empty($tmp)) {
402 $tmp = 'utf-8'; // By default for other
403}
404if (getDolGlobalString('MAIN_FILESYSTEM_ENCODING')) {
405 $tmp = getDolGlobalString('MAIN_FILESYSTEM_ENCODING');
406}
407print '<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
408
409print '</table>';
410print '</div>';
411print '<br>';
412
413
414
415// Parameters in conf.php file (when a parameter start with ?, it is shown only if defined)
416$configfileparameters = array(
417 'dolibarr_main_prod' => 'Production mode (Hide all error messages)',
418 'dolibarr_main_instance_unique_id' => $langs->trans("InstanceUniqueID"),
419 'separator0' => '',
420 'dolibarr_main_url_root' => $langs->trans("URLRoot"),
421 '?dolibarr_main_url_root_alt' => $langs->trans("URLRoot").' (alt)',
422 'dolibarr_main_document_root' => $langs->trans("DocumentRootServer"),
423 '?dolibarr_main_document_root_alt' => $langs->trans("DocumentRootServer").' (alt)',
424 'dolibarr_main_data_root' => $langs->trans("DataRootServer"),
425 'separator1' => '',
426 'dolibarr_main_db_host' => $langs->trans("DatabaseServer"),
427 'dolibarr_main_db_port' => $langs->trans("DatabasePort"),
428 'dolibarr_main_db_name' => $langs->trans("DatabaseName"),
429 'dolibarr_main_db_type' => $langs->trans("DriverType"),
430 'dolibarr_main_db_user' => $langs->trans("DatabaseUser"),
431 'dolibarr_main_db_pass' => $langs->trans("DatabasePassword"),
432 'dolibarr_main_db_character_set' => $langs->trans("DBStoringCharset"),
433 'dolibarr_main_db_collation' => $langs->trans("DBSortingCollation"),
434 '?dolibarr_main_db_prefix' => $langs->trans("DatabasePrefix"),
435 'dolibarr_main_db_readonly' => $langs->trans("ReadOnlyMode"),
436 'separator2' => '',
437 'dolibarr_main_authentication' => $langs->trans("AuthenticationMode"),
438 '?multicompany_transverse_mode' => $langs->trans("MultiCompanyMode"),
439 'separator' => '',
440 '?dolibarr_main_auth_ldap_login_attribute' => 'dolibarr_main_auth_ldap_login_attribute',
441 '?dolibarr_main_auth_ldap_host' => 'dolibarr_main_auth_ldap_host',
442 '?dolibarr_main_auth_ldap_port' => 'dolibarr_main_auth_ldap_port',
443 '?dolibarr_main_auth_ldap_version' => 'dolibarr_main_auth_ldap_version',
444 '?dolibarr_main_auth_ldap_dn' => 'dolibarr_main_auth_ldap_dn',
445 '?dolibarr_main_auth_ldap_admin_login' => 'dolibarr_main_auth_ldap_admin_login',
446 '?dolibarr_main_auth_ldap_admin_pass' => 'dolibarr_main_auth_ldap_admin_pass',
447 '?dolibarr_main_auth_ldap_debug' => 'dolibarr_main_auth_ldap_debug',
448 'separator3' => '',
449 '?dolibarr_lib_FPDF_PATH' => 'dolibarr_lib_FPDF_PATH',
450 '?dolibarr_lib_TCPDF_PATH' => 'dolibarr_lib_TCPDF_PATH',
451 '?dolibarr_lib_FPDI_PATH' => 'dolibarr_lib_FPDI_PATH',
452 '?dolibarr_lib_TCPDI_PATH' => 'dolibarr_lib_TCPDI_PATH',
453 '?dolibarr_lib_NUSOAP_PATH' => 'dolibarr_lib_NUSOAP_PATH',
454 '?dolibarr_lib_GEOIP_PATH' => 'dolibarr_lib_GEOIP_PATH',
455 '?dolibarr_lib_ODTPHP_PATH' => 'dolibarr_lib_ODTPHP_PATH',
456 '?dolibarr_lib_ODTPHP_PATHTOPCLZIP' => 'dolibarr_lib_ODTPHP_PATHTOPCLZIP',
457 '?dolibarr_js_CKEDITOR' => 'dolibarr_js_CKEDITOR',
458 '?dolibarr_js_JQUERY' => 'dolibarr_js_JQUERY',
459 '?dolibarr_js_JQUERY_UI' => 'dolibarr_js_JQUERY_UI',
460 '?dolibarr_font_DOL_DEFAULT_TTF' => 'dolibarr_font_DOL_DEFAULT_TTF',
461 '?dolibarr_font_DOL_DEFAULT_TTF_BOLD' => 'dolibarr_font_DOL_DEFAULT_TTF_BOLD',
462 'separator4' => '',
463 'dolibarr_main_restrict_os_commands' => 'Restrict CLI commands for backups',
464 'dolibarr_main_restrict_eval_methods' => 'Restrict php commands for dol_eval',
465 'dolibarr_main_restrict_ip' => 'Restrict access to some IPs only',
466 '?dolibarr_website_allow_custom_php' => 'Allow custom php code in website pages',
467 '?dolibarr_mailing_limit_sendbyweb' => 'Limit nb of email sent by page',
468 '?dolibarr_mailing_limit_sendbycli' => 'Limit nb of email sent by cli',
469 '?dolibarr_mailing_limit_sendbyday' => 'Limit nb of email sent per day',
470 '?dolibarr_mail_allow_unrestricted_smtp_target' => 'Allow unrestricted SMTP target for emails',
471 '?dolibarr_strict_mode' => 'Strict mode for php syntax is on/off',
472 '?dolibarr_nocsrfcheck' => 'Disable CSRF security checks'
473);
474
475print '<div class="div-table-responsive-no-min">';
476print '<table class="noborder centpercent">';
477print '<tr class="liste_titre">';
478print '<td class="titlefieldcreate">'.$langs->trans("Parameters").' ';
479print $langs->trans("ConfigurationFile").' ('.basename($conffile).')';
480print '</td>';
481print '<td>'.$langs->trans("Name").'</td>';
482print '<td></td>';
483print '</tr>'."\n";
484
485
486$lastkeyshown = null;
487
488foreach ($configfileparameters as $key => $value) {
489 $ignore = 0;
490
491 if (empty($ignore)) {
492 $newkey = preg_replace('/^\?/', '', $key);
493
494 if (preg_match('/^\?/', $key) && empty(${$newkey})) {
495 if ($newkey != 'multicompany_transverse_mode' || !isModEnabled('multicompany')) {
496 continue; // We discard parameters starting with ?
497 }
498 }
499 if (strpos($newkey, 'separator') !== false && $lastkeyshown == 'separator') {
500 continue;
501 }
502
503 print '<tr class="oddeven">';
504 if (strpos($newkey, 'separator') !== false) {
505 print '<td colspan="3">&nbsp;</td>';
506 } else {
507 // Label
508 print "<td>".$value.'</td>';
509 // Key
510 print '<td>'.$newkey.'</td>';
511 // Value
512 print "<td>";
513 if (in_array($newkey, array('dolibarr_main_db_pass', 'dolibarr_main_auth_ldap_admin_pass'))) {
514 if (empty($dolibarr_main_prod)) {
515 print '<!-- '.${$newkey}.' -->';
516 print showValueWithClipboardCPButton(${$newkey}, 0, '********');
517 } else {
518 print '**********';
519 }
520 } elseif ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/', ${$newkey})) {
521 print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT');
522 } elseif ($newkey == 'dolibarr_main_document_root_alt') {
523 $tmparray = explode(',', $dolibarr_main_document_root_alt);
524 $i = 0;
525 foreach ($tmparray as $value2) {
526 if ($i > 0) {
527 print ', ';
528 }
529 print $value2;
530 if (!is_readable($value2)) {
531 $langs->load("errors");
532 print ' '.img_warning($langs->trans("ErrorCantReadDir", $value2));
533 }
534 ++$i;
535 }
536 } elseif ($newkey == 'dolibarr_main_instance_unique_id') {
537 $valuetoshow = $conf->file->instance_unique_id;
538 // $conf->file->instance_unique_id is defined into master.inc.php with:
539 // empty($dolibarr_main_instance_unique_id) ? (empty($dolibarr_main_cookie_cryptkey) ? '' : $dolibarr_main_cookie_cryptkey) : $dolibarr_main_instance_unique_id
540
541 if (empty($dolibarr_main_prod)) {
542 print '<!-- '.$valuetoshow.' (this will not be visible if $dolibarr_main_prod = 1 -->';
543 print showValueWithClipboardCPButton($valuetoshow, 0, '********');
544 print ' &nbsp; &nbsp; <span class="opacitymedium">'.$langs->trans("ThisValueCanBeReadBecauseInstanceIsNotInProductionMode").'</span>';
545 } else {
546 print '**********';
547 print ' &nbsp; &nbsp; <span class="opacitymedium">'.$langs->trans("SeeConfFile").'</span>';
548 }
549 if (empty($valuetoshow)) {
550 print img_warning("EditConfigFileToAddEntry", 'dolibarr_main_instance_unique_id');
551 }
552 print '</td></tr>';
553
554 $algo = 'sha256';
555 $hash_unique_id = getHashUniqueIdOfRegistration($algo);
556
557 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";
558 } elseif ($newkey == 'dolibarr_main_prod') {
559 print ${$newkey};
560
561 $valuetoshow = ${$newkey};
562 if (empty($valuetoshow)) {
563 print img_warning($langs->trans('SwitchThisForABetterSecurity', 1));
564 }
565 } elseif ($newkey == 'dolibarr_nocsrfcheck') {
566 print ${$newkey};
567
568 $valuetoshow = ${$newkey};
569 if (!empty($valuetoshow)) {
570 print img_warning($langs->trans('SwitchThisForABetterSecurity', 0));
571 }
572 } elseif ($newkey == 'dolibarr_main_db_readonly') {
573 print ${$newkey};
574
575 $valuetoshow = ${$newkey};
576 if (!empty($valuetoshow)) {
577 print img_warning($langs->trans('ReadOnlyMode', 1));
578 }
579 } else {
580 print(empty(${$newkey}) ? '' : ${$newkey});
581 }
582 if ($newkey == 'dolibarr_main_url_root' && ${$newkey} != DOL_MAIN_URL_ROOT) {
583 print ' (currently overwritten by autodetected value: '.DOL_MAIN_URL_ROOT.')';
584 }
585 print "</td>";
586 }
587 print "</tr>\n";
588 $lastkeyshown = $newkey;
589 }
590}
591print '</table>';
592print '</div>';
593print '<br>';
594
595
596
597// Parameters in database
598print '<div class="div-table-responsive-no-min">';
599print '<table class="noborder">';
600print '<tr class="liste_titre">';
601print '<td class="titlefield">'.$langs->trans("Parameters").' '.$langs->trans("Database").'</td>';
602print '<td></td>';
603print '<td class="center width="120px"">'.$langs->trans("DateModificationShort").'</td>';
604if (!isModEnabled('multicompany') || !$user->entity) {
605 print '<td class="center width="80px"">'.$langs->trans("Entity").'</td>'; // If superadmin or multicompany disabled
606}
607print "</tr>\n";
608
609$sql = "SELECT";
610$sql .= " rowid";
611$sql .= ", ".$db->decrypt('name')." as name";
612$sql .= ", ".$db->decrypt('value')." as value";
613$sql .= ", type";
614$sql .= ", note";
615$sql .= ", tms";
616$sql .= ", entity";
617$sql .= " FROM ".MAIN_DB_PREFIX."const";
618if (!isModEnabled('multicompany')) {
619 // If no multicompany mode, admins can see global and their constantes
620 $sql .= " WHERE entity IN (0,".((int) $conf->entity).")";
621} else {
622 // If multicompany mode, superadmin (user->entity=0) can see everything, admin are limited to their entities.
623 if ($user->entity) {
624 $sql .= " WHERE entity IN (".$db->sanitize($user->entity.",".((int) $conf->entity)).")";
625 }
626}
627$sql .= " ORDER BY entity, name ASC";
628$resql = $db->query($sql);
629if ($resql) {
630 $num = $db->num_rows($resql);
631 $i = 0;
632
633 while ($i < $num) {
634 $obj = $db->fetch_object($resql);
635
636 print '<tr class="oddeven">';
637 print '<td class="tdoverflowmax600" title="'.dol_escape_htmltag($obj->name).'">'.dol_escape_htmltag($obj->name).'</td>'."\n";
638 print '<td class="tdoverflowmax300">';
639 if (isASecretKey($obj->name)) {
640 if (empty($dolibarr_main_prod)) {
641 print '<!-- '.$obj->value.' -->';
642 }
643 print '**********';
644 } else {
645 print dol_escape_htmltag($obj->value);
646 }
647 print '</td>'."\n";
648 print '<td class="nowraponall center">'.dol_print_date($db->jdate($obj->tms), 'dayhour').'</td>'."\n";
649 if (!isModEnabled('multicompany') || !$user->entity) {
650 print '<td class="center" width="80px">'.$obj->entity.'</td>'."\n"; // If superadmin or multicompany disabled
651 }
652 print "</tr>\n";
653
654 $i++;
655 }
656}
657
658print '</table>';
659print '</div>';
660
661// End of page
662llxFooter();
663$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:79
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:353
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($blockedlogusagealreadychecked=0, $blockedlogmoduleonalreadychecked=0)
Return if the application is executed with the LNE requirements on.
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
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:626
dol_stringtotime($string, $gm=1, $processnotimeasnoon=0)
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:452
$conffile
dol_now($mode='gmt')
Return date for now.
price2num($amount, $rounding='', $option=0, $currencycode='')
Function that return a number with universal decimal format (decimal separator is '.
isASecretKey($keyname)
Return if string has a name dedicated to store a secret.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=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).
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
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).
showValueWithClipboardCPButton($valuetocopy, $showonlyonhover=1, $texttoshow='')
Create a button to copy $valuetocopy in the clipboard (for copy and paste feature).
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='', $textonpictotooltip='', $cssfordropdown='info_admin')
Show information in HTML for admin users or standard users.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Definition html.lib.php:183
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.