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