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