dolibarr  13.0.2
dolibarr.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2005-2020 Laurent Destailleur <eldy@users.sourceforge.net>
3  * Copyright (C) 2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
4  * Copyright (C) 2007-2012 Regis Houssin <regis.houssin@inodbox.com>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <https://www.gnu.org/licenses/>.
18  */
19 
25 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 $sfurl = '';
41 $version = '0.0';
42 
43 
44 
45 /*
46  * Actions
47  */
48 
49 if ($action == 'getlastversion')
50 {
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']);
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 $title = $langs->trans("InfoDolibarr");
68 
69 llxHeader('', $title);
70 
71 print load_fiche_titre($title, '', 'title_setup');
72 
73 // Version
74 print '<div class="div-table-responsive-no-min">';
75 print '<table class="noborder centpercent">';
76 print '<tr class="liste_titre"><td class="titlefieldcreate">'.$langs->trans("Version").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
77 print '<tr class="oddeven"><td>'.$langs->trans("CurrentVersion").' ('.$langs->trans("Programs").')</td><td>'.DOL_VERSION;
78 // If current version differs from last upgrade
79 if (empty($conf->global->MAIN_VERSION_LAST_UPGRADE))
80 {
81  // Compare version with last install database version (upgrades never occured)
82  if (DOL_VERSION != $conf->global->MAIN_VERSION_LAST_INSTALL) print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired", DOL_VERSION, $conf->global->MAIN_VERSION_LAST_INSTALL));
83 } else {
84  // Compare version with last upgrade database version
85  if (DOL_VERSION != $conf->global->MAIN_VERSION_LAST_UPGRADE) print ' '.img_warning($langs->trans("RunningUpdateProcessMayBeRequired", DOL_VERSION, $conf->global->MAIN_VERSION_LAST_UPGRADE));
86 }
87 
88 $version = DOL_VERSION;
89 if (preg_match('/[a-z]+/i', $version)) $version = 'develop'; // If version contains text, it is not an official tagged version, so we use the full change log.
90 print ' &nbsp; <a href="https://raw.githubusercontent.com/Dolibarr/dolibarr/'.$version.'/ChangeLog" target="_blank">'.$langs->trans("SeeChangeLog").'</a>';
91 
92 $newversion = '';
93 if (function_exists('curl_init'))
94 {
95  $conf->global->MAIN_USE_RESPONSE_TIMEOUT = 10;
96  print ' &nbsp; &nbsp; - &nbsp; &nbsp; ';
97  if ($action == 'getlastversion') {
98  if ($sfurl) {
99  $i = 0;
100  while (!empty($sfurl->channel[0]->item[$i]->title) && $i < 10000) {
101  $title = $sfurl->channel[0]->item[$i]->title;
102  $reg = array();
103  if (preg_match('/([0-9]+\.([0-9\.]+))/', $title, $reg)) {
104  $newversion = $reg[1];
105  $newversionarray = explode('.', $newversion);
106  $versionarray = explode('.', $version);
107  //var_dump($newversionarray);var_dump($versionarray);
108  if (versioncompare($newversionarray, $versionarray) > 0) $version = $newversion;
109  }
110  $i++;
111  }
112 
113  // Show version
114  print $langs->trans("LastStableVersion").' : <b>'.(($version != '0.0') ? $version : $langs->trans("Unknown")).'</b>';
115  if ($version != '0.0') {
116  print ' &nbsp; <a href="https://raw.githubusercontent.com/Dolibarr/dolibarr/'.$version.'/ChangeLog" target="_blank">'.$langs->trans("SeeChangeLog").'</a>';
117  }
118  } else {
119  print $langs->trans("LastStableVersion").' : <b>'.$langs->trans("UpdateServerOffline").'</b>';
120  }
121  } else {
122  print $langs->trans("LastStableVersion").' : <a href="'.$_SERVER["PHP_SELF"].'?action=getlastversion" class="butAction">'.$langs->trans("Check").'</a>';
123  }
124 }
125 
126 // Now show link to the changelog
127 //print ' &nbsp; &nbsp; - &nbsp; &nbsp; ';
128 
129 $version = DOL_VERSION;
130 if (preg_match('/[a-z]+/i', $version)) $version = 'develop'; // If version contains text, it is not an official tagged version, so we use the full change log.
131 
132 print '</td></tr>'."\n";
133 print '<tr class="oddeven"><td>'.$langs->trans("VersionLastUpgrade").' ('.$langs->trans("Database").')</td><td>'.$conf->global->MAIN_VERSION_LAST_UPGRADE.'</td></tr>'."\n";
134 print '<tr class="oddeven"><td>'.$langs->trans("VersionLastInstall").'</td><td>'.$conf->global->MAIN_VERSION_LAST_INSTALL.'</td></tr>'."\n";
135 print '</table>';
136 print '</div>';
137 print '<br>';
138 
139 // Session
140 print '<div class="div-table-responsive-no-min">';
141 print '<table class="noborder centpercent">';
142 print '<tr class="liste_titre"><td class="titlefieldcreate">'.$langs->trans("Session").'</td><td colspan="2">'.$langs->trans("Value").'</td></tr>'."\n";
143 print '<tr class="oddeven"><td>'.$langs->trans("SessionSavePath").'</td><td colspan="2">'.session_save_path().'</td></tr>'."\n";
144 print '<tr class="oddeven"><td>'.$langs->trans("SessionName").'</td><td colspan="2">'.session_name().'</td></tr>'."\n";
145 print '<tr class="oddeven"><td>'.$langs->trans("SessionId").'</td><td colspan="2">'.session_id().'</td></tr>'."\n";
146 print '<tr class="oddeven"><td>'.$langs->trans("CurrentSessionTimeOut").' (session.gc_maxlifetime)</td><td>'.ini_get('session.gc_maxlifetime').' '.$langs->trans("seconds");
147 print '</td><td class="right">';
148 print '<!-- session.gc_maxlifetime = '.ini_get("session.gc_maxlifetime").' -->'."\n";
149 print '<!-- session.gc_probability = '.ini_get("session.gc_probability").' -->'."\n";
150 print '<!-- session.gc_divisor = '.ini_get("session.gc_divisor").' -->'."\n";
151 print $form->textwithpicto('', $langs->trans("SessionExplanation", ini_get("session.gc_probability"), ini_get("session.gc_divisor")));
152 print "</td></tr>\n";
153 print '<tr class="oddeven"><td>'.$langs->trans("CurrentTheme").'</td><td colspan="2">'.$conf->theme.'</td></tr>'."\n";
154 print '<tr class="oddeven"><td>'.$langs->trans("CurrentMenuHandler").'</td><td colspan="2">';
155 print $conf->standard_menu;
156 print '</td></tr>'."\n";
157 print '<tr class="oddeven"><td>'.$langs->trans("Screen").'</td><td colspan="2">';
158 print $_SESSION['dol_screenwidth'].' x '.$_SESSION['dol_screenheight'];
159 print '</td></tr>'."\n";
160 print '<tr class="oddeven"><td>'.$langs->trans("Session").'</td><td colspan="2">';
161 $i = 0;
162 foreach ($_SESSION as $key => $val)
163 {
164  if ($i > 0) print ', ';
165  if (is_array($val)) print $key.' => array(...)';
166  else print $key.' => '.dol_escape_htmltag($val);
167  $i++;
168 }
169 print '</td></tr>'."\n";
170 print '</table>';
171 print '</div>';
172 print '<br>';
173 
174 
175 // Shmop
176 if (isset($conf->global->MAIN_OPTIMIZE_SPEED) && ($conf->global->MAIN_OPTIMIZE_SPEED & 0x02))
177 {
178  $shmoparray = dol_listshmop();
179 
180  print '<div class="div-table-responsive-no-min">';
181  print '<table class="noborder centpercent">';
182  print '<tr class="liste_titre">';
183  print '<td class="titlefieldcreate">'.$langs->trans("LanguageFilesCachedIntoShmopSharedMemory").'</td>';
184  print '<td>'.$langs->trans("NbOfEntries").'</td>';
185  print '<td class="right">'.$langs->trans("Address").'</td>';
186  print '</tr>'."\n";
187 
188  foreach ($shmoparray as $key => $val)
189  {
190  print '<tr class="oddeven"><td>'.$key.'</td>';
191  print '<td>'.count($val).'</td>';
192  print '<td class="right">'.dol_getshmopaddress($key).'</td>';
193  print '</tr>'."\n";
194  }
195 
196  print '</table>';
197  print '</div>';
198  print '<br>';
199 }
200 
201 
202 // Localisation
203 print '<div class="div-table-responsive-no-min">';
204 print '<table class="noborder centpercent">';
205 print '<tr class="liste_titre"><td class="titlefieldcreate">'.$langs->trans("LocalisationDolibarrParameters").'</td><td>'.$langs->trans("Value").'</td></tr>'."\n";
206 print '<tr class="oddeven"><td>'.$langs->trans("LanguageBrowserParameter", "HTTP_ACCEPT_LANGUAGE").'</td><td>'.$_SERVER["HTTP_ACCEPT_LANGUAGE"].'</td></tr>'."\n";
207 print '<tr class="oddeven"><td>'.$langs->trans("CurrentUserLanguage").'</td><td>'.$langs->getDefaultLang().'</td></tr>'."\n";
208 // Thousands
209 $thousand = $langs->transnoentitiesnoconv("SeparatorThousand");
210 if ($thousand == 'SeparatorThousand') $thousand = ' '; // ' ' does not work on trans method
211 if ($thousand == 'None') $thousand = '';
212 print '<tr class="oddeven"><td>'.$langs->trans("CurrentValueSeparatorThousand").'</td><td>'.($thousand == ' ' ? $langs->transnoentitiesnoconv("Space") : $thousand).'</td></tr>'."\n";
213 // Decimals
214 $dec = $langs->transnoentitiesnoconv("SeparatorDecimal");
215 print '<tr class="oddeven"><td>'.$langs->trans("CurrentValueSeparatorDecimal").'</td><td>'.$dec.'</td></tr>'."\n";
216 // Show results of functions to see if everything works
217 print '<tr class="oddeven"><td>&nbsp; => price2num(1233.56+1)</td><td>'.price2num(1233.56 + 1, '2').'</td></tr>'."\n";
218 print '<tr class="oddeven"><td>&nbsp; => price2num('."'1".$thousand."234".$dec."56')</td><td>".price2num("1".$thousand."234".$dec."56", '2')."</td></tr>\n";
219 if (($thousand != ',' && $thousand != '.') || ($thousand != ' '))
220 {
221  print '<tr class="oddeven"><td>&nbsp; => price2num('."'1 234.56')</td><td>".price2num("1 234.56", '2')."</td>";
222  print "</tr>\n";
223 }
224 print '<tr class="oddeven"><td>&nbsp; => price(1234.56)</td><td>'.price(1234.56).'</td></tr>'."\n";
225 
226 // Timezones
227 
228 // Database timezone
229 if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli')
230 {
231  print '<tr class="oddeven"><td>'.$langs->trans("MySQLTimeZone").' (database)</td><td>'; // Timezone server base
232  $sql = "SHOW VARIABLES where variable_name = 'system_time_zone'";
233  $resql = $db->query($sql);
234  if ($resql)
235  {
236  $obj = $db->fetch_object($resql);
237  print $form->textwithtooltip($obj->Value, $langs->trans('TZHasNoEffect'), 2, 1, img_info(''));
238  }
239  print '</td></tr>'."\n";
240 }
241 $txt = $langs->trans("OSTZ").' (variable system TZ): '.(!empty($_ENV["TZ"]) ? $_ENV["TZ"] : $langs->trans("NotDefined")).'<br>'."\n";
242 $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
243 $txt .= $langs->trans("Dolibarr constant MAIN_SERVER_TZ").': '.(empty($conf->global->MAIN_SERVER_TZ) ? $langs->trans("NotDefined") : $conf->global->MAIN_SERVER_TZ);
244 print '<tr class="oddeven"><td>'.$langs->trans("CurrentTimeZone").'</td><td>'; // Timezone server PHP
245 $a = getServerTimeZoneInt('now');
246 $b = getServerTimeZoneInt('winter');
247 $c = getServerTimeZoneInt('summer');
248 $daylight = round($c - $b);
249 //print $a." ".$b." ".$c." ".$daylight;
250 $val = ($a >= 0 ? '+' : '').$a;
251 $val .= ' ('.($a == 'unknown' ? 'unknown' : ($a >= 0 ? '+' : '').($a * 3600)).')';
252 $val .= ' &nbsp; &nbsp; &nbsp; '.getServerTimeZoneString();
253 $val .= ' &nbsp; &nbsp; &nbsp; '.$langs->trans("DaylingSavingTime").': '.($daylight === 'unknown' ? 'unknown' : ($a == $c ?yn($daylight) : yn(0).($daylight ? ' &nbsp; &nbsp; ('.$langs->trans('YesInSummer').')' : '')));
254 print $form->textwithtooltip($val, $txt, 2, 1, img_info(''));
255 print '</td></tr>'."\n"; // value defined in http://fr3.php.net/manual/en/timezones.europe.php
256 print '<tr class="oddeven"><td>&nbsp; => '.$langs->trans("CurrentHour").'</td><td>'.dol_print_date(dol_now('gmt'), 'dayhour', 'tzserver').'</td></tr>'."\n";
257 print '<tr class="oddeven"><td>&nbsp; => dol_print_date(0,"dayhourtext")</td><td>'.dol_print_date(0, "dayhourtext").'</td>';
258 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>';
259 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>';
260 // Client
261 $tz = (int) $_SESSION['dol_tz'] + (int) $_SESSION['dol_dst'];
262 print '<tr class="oddeven"><td>'.$langs->trans("ClientTZ").'</td><td>'.($tz ? ($tz >= 0 ? '+' : '').$tz : '').' ('.($tz >= 0 ? '+' : '').($tz * 60 * 60).')';
263 print ' &nbsp; &nbsp; &nbsp; '.$_SESSION['dol_tz_string'];
264 print ' &nbsp; &nbsp; &nbsp; '.$langs->trans("DaylingSavingTime").': ';
265 if ($_SESSION['dol_dst'] > 0) print yn(1);
266 else print yn(0);
267 if (!empty($_SESSION['dol_dst_first'])) 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').')';
268 print '</td></tr>'."\n";
269 print '</td></tr>'."\n";
270 print '<tr class="oddeven"><td>&nbsp; => '.$langs->trans("ClientHour").'</td><td>'.dol_print_date(dol_now('gmt'), 'dayhour', 'tzuser').'</td></tr>'."\n";
271 
272 $filesystemencoding = ini_get("unicode.filesystem_encoding"); // Disponible avec PHP 6.0
273 print '<tr class="oddeven"><td>'.$langs->trans("File encoding").' (php.ini unicode.filesystem_encoding)</td><td>'.$filesystemencoding.'</td></tr>'."\n";
274 
275 $tmp = ini_get("unicode.filesystem_encoding"); // Disponible avec PHP 6.0
276 if (empty($tmp) && !empty($_SERVER["WINDIR"])) $tmp = 'iso-8859-1'; // By default for windows
277 if (empty($tmp)) $tmp = 'utf-8'; // By default for other
278 if (!empty($conf->global->MAIN_FILESYSTEM_ENCODING)) $tmp = $conf->global->MAIN_FILESYSTEM_ENCODING;
279 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
280 
281 print '</table>';
282 print '</div>';
283 print '<br>';
284 
285 
286 
287 // Parameters in conf.php file (when a parameter start with ?, it is shown only if defined)
288 $configfileparameters = array(
289  'dolibarr_main_url_root' => $langs->trans("URLRoot"),
290  '?dolibarr_main_url_root_alt' => $langs->trans("URLRoot").' (alt)',
291  'dolibarr_main_document_root'=> $langs->trans("DocumentRootServer"),
292  '?dolibarr_main_document_root_alt' => $langs->trans("DocumentRootServer").' (alt)',
293  'dolibarr_main_data_root' => $langs->trans("DataRootServer"),
294  'dolibarr_main_instance_unique_id' => $langs->trans("InstanceUniqueID"),
295  'separator1' => '',
296  'dolibarr_main_db_host' => $langs->trans("DatabaseServer"),
297  'dolibarr_main_db_port' => $langs->trans("DatabasePort"),
298  'dolibarr_main_db_name' => $langs->trans("DatabaseName"),
299  'dolibarr_main_db_type' => $langs->trans("DriverType"),
300  'dolibarr_main_db_user' => $langs->trans("DatabaseUser"),
301  'dolibarr_main_db_pass' => $langs->trans("DatabasePassword"),
302  'dolibarr_main_db_character_set' => $langs->trans("DBStoringCharset"),
303  'dolibarr_main_db_collation' => $langs->trans("DBSortingCollation"),
304  '?dolibarr_main_db_prefix' => $langs->trans("Prefix"),
305  'separator2' => '',
306  'dolibarr_main_authentication' => $langs->trans("AuthenticationMode"),
307  '?multicompany_transverse_mode'=> $langs->trans("MultiCompanyMode"),
308  'separator'=> '',
309  '?dolibarr_main_auth_ldap_login_attribute' => 'dolibarr_main_auth_ldap_login_attribute',
310  '?dolibarr_main_auth_ldap_host' => 'dolibarr_main_auth_ldap_host',
311  '?dolibarr_main_auth_ldap_port' => 'dolibarr_main_auth_ldap_port',
312  '?dolibarr_main_auth_ldap_version' => 'dolibarr_main_auth_ldap_version',
313  '?dolibarr_main_auth_ldap_dn' => 'dolibarr_main_auth_ldap_dn',
314  '?dolibarr_main_auth_ldap_admin_login' => 'dolibarr_main_auth_ldap_admin_login',
315  '?dolibarr_main_auth_ldap_admin_pass' => 'dolibarr_main_auth_ldap_admin_pass',
316  '?dolibarr_main_auth_ldap_debug' => 'dolibarr_main_auth_ldap_debug',
317  'separator3' => '',
318  '?dolibarr_lib_ADODB_PATH' => 'dolibarr_lib_ADODB_PATH',
319  '?dolibarr_lib_FPDF_PATH' => 'dolibarr_lib_FPDF_PATH',
320  '?dolibarr_lib_TCPDF_PATH' => 'dolibarr_lib_TCPDF_PATH',
321  '?dolibarr_lib_FPDI_PATH' => 'dolibarr_lib_FPDI_PATH',
322  '?dolibarr_lib_TCPDI_PATH' => 'dolibarr_lib_TCPDI_PATH',
323  '?dolibarr_lib_NUSOAP_PATH' => 'dolibarr_lib_NUSOAP_PATH',
324  '?dolibarr_lib_GEOIP_PATH' => 'dolibarr_lib_GEOIP_PATH',
325  '?dolibarr_lib_ODTPHP_PATH' => 'dolibarr_lib_ODTPHP_PATH',
326  '?dolibarr_lib_ODTPHP_PATHTOPCLZIP' => 'dolibarr_lib_ODTPHP_PATHTOPCLZIP',
327  '?dolibarr_js_CKEDITOR' => 'dolibarr_js_CKEDITOR',
328  '?dolibarr_js_JQUERY' => 'dolibarr_js_JQUERY',
329  '?dolibarr_js_JQUERY_UI' => 'dolibarr_js_JQUERY_UI',
330  '?dolibarr_font_DOL_DEFAULT_TTF' => 'dolibarr_font_DOL_DEFAULT_TTF',
331  '?dolibarr_font_DOL_DEFAULT_TTF_BOLD' => 'dolibarr_font_DOL_DEFAULT_TTF_BOLD',
332  'separator4' => '',
333  'dolibarr_main_prod' => 'Production mode (Hide all error messages)',
334  'dolibarr_main_restrict_os_commands' => 'Restrict CLI commands for backups',
335  'dolibarr_main_restrict_ip' => 'Restrict access to some IPs only',
336  '?dolibarr_mailing_limit_sendbyweb' => 'Limit nb of email sent by page',
337  '?dolibarr_mailing_limit_sendbycli' => 'Limit nb of email sent by cli',
338  '?dolibarr_strict_mode' => 'Strict mode is on/off',
339  '?dolibarr_nocsrfcheck' => 'Disable CSRF security checks'
340 );
341 
342 print '<div class="div-table-responsive-no-min">';
343 print '<table class="noborder centpercent">';
344 print '<tr class="liste_titre">';
345 print '<td class="titlefieldcreate">'.$langs->trans("Parameters").' ';
346 print $langs->trans("ConfigurationFile").' ('.$conffiletoshowshort.')';
347 print '</td>';
348 print '<td>'.$langs->trans("Parameter").'</td>';
349 print '<td>'.$langs->trans("Value").'</td>';
350 print '</tr>'."\n";
351 
352 foreach ($configfileparameters as $key => $value)
353 {
354  $ignore = 0;
355 
356  if (empty($ignore))
357  {
358  $newkey = preg_replace('/^\?/', '', $key);
359 
360  if (preg_match('/^\?/', $key) && empty(${$newkey}))
361  {
362  if ($newkey != 'multicompany_transverse_mode' || empty($conf->multicompany->enabled))
363  continue; // We discard parameters starting with ?
364  }
365  if (strpos($newkey, 'separator') !== false && $lastkeyshown == 'separator') continue;
366 
367  print '<tr class="oddeven">';
368  if (strpos($newkey, 'separator') !== false)
369  {
370  print '<td colspan="3">&nbsp;</td>';
371  } else {
372  // Label
373  print "<td>".$value.'</td>';
374  // Key
375  print '<td>'.$newkey.'</td>';
376  // Value
377  print "<td>";
378  if (in_array($newkey, array('dolibarr_main_db_pass', 'dolibarr_main_auth_ldap_admin_pass'))) {
379  if (empty($dolibarr_main_prod)) {
380  print '<!-- '.${$newkey}.' -->';
381  }
382  print '**********';
383  }
384  elseif ($newkey == 'dolibarr_main_url_root' && preg_match('/__auto__/', ${$newkey})) print ${$newkey}.' => '.constant('DOL_MAIN_URL_ROOT');
385  elseif ($newkey == 'dolibarr_main_document_root_alt') {
386  $tmparray = explode(',', ${$newkey});
387  $i = 0;
388  foreach ($tmparray as $value2)
389  {
390  if ($i > 0) print ', ';
391  print $value2;
392  if (!is_readable($value2))
393  {
394  $langs->load("errors");
395  print ' '.img_warning($langs->trans("ErrorCantReadDir", $value2));
396  }
397  ++$i;
398  }
399  } elseif ($newkey == 'dolibarr_main_instance_unique_id') {
400  //print $conf->file->instance_unique_id;
401  global $dolibarr_main_cookie_cryptkey;
402  $valuetoshow = ${$newkey} ? ${$newkey} : $dolibarr_main_cookie_cryptkey; // Use $dolibarr_main_instance_unique_id first then $dolibarr_main_cookie_cryptkey
403  print $valuetoshow;
404  if (empty($valuetoshow)) {
405  print img_warning("EditConfigFileToAddEntry", 'dolibarr_main_instance_unique_id');
406  }
407  print ' &nbsp; <span class="opacitymedium">('.$langs->trans("HashForPing").'='.md5('dolibarr'.$valuetoshow).')</span>';
408  } elseif ($newkey == 'dolibarr_main_prod') {
409  print ${$newkey};
410 
411  $valuetoshow = ${$newkey};
412  if (empty($valuetoshow)) {
413  print img_warning($langs->trans('SwitchThisForABetterSecurity', 1));
414  }
415  } elseif ($newkey == 'dolibarr_nocsrfcheck') {
416  print ${$newkey};
417 
418  $valuetoshow = ${$newkey};
419  if (!empty($valuetoshow)) {
420  print img_warning($langs->trans('SwitchThisForABetterSecurity', 0));
421  }
422  } else {
423  print ${$newkey};
424  }
425  if ($newkey == 'dolibarr_main_url_root' && ${$newkey} != DOL_MAIN_URL_ROOT) print ' (currently overwritten by autodetected value: '.DOL_MAIN_URL_ROOT.')';
426  print "</td>";
427  }
428  print "</tr>\n";
429  $lastkeyshown = $newkey;
430  }
431 }
432 print '</table>';
433 print '</div>';
434 print '<br>';
435 
436 
437 
438 // Parameters in database
439 print '<div class="div-table-responsive-no-min">';
440 print '<table class="noborder">';
441 print '<tr class="liste_titre">';
442 print '<td class="titlefield">'.$langs->trans("Parameters").' '.$langs->trans("Database").'</td>';
443 print '<td>'.$langs->trans("Value").'</td>';
444 if (empty($conf->multicompany->enabled) || !$user->entity) print '<td class="center width="80px"">'.$langs->trans("Entity").'</td>'; // If superadmin or multicompany disabled
445 print "</tr>\n";
446 
447 $sql = "SELECT";
448 $sql .= " rowid";
449 $sql .= ", ".$db->decrypt('name')." as name";
450 $sql .= ", ".$db->decrypt('value')." as value";
451 $sql .= ", type";
452 $sql .= ", note";
453 $sql .= ", entity";
454 $sql .= " FROM ".MAIN_DB_PREFIX."const";
455 if (empty($conf->multicompany->enabled))
456 {
457  // If no multicompany mode, admins can see global and their constantes
458  $sql .= " WHERE entity IN (0,".$conf->entity.")";
459 } else {
460  // If multicompany mode, superadmin (user->entity=0) can see everything, admin are limited to their entities.
461  if ($user->entity) $sql .= " WHERE entity IN (".$user->entity.",".$conf->entity.")";
462 }
463 $sql .= " ORDER BY entity, name ASC";
464 $resql = $db->query($sql);
465 if ($resql)
466 {
467  $num = $db->num_rows($resql);
468  $i = 0;
469 
470  while ($i < $num)
471  {
472  $obj = $db->fetch_object($resql);
473 
474  print '<tr class="oddeven">';
475  print '<td class="tdoverflowmax300">'.$obj->name.'</td>'."\n";
476  print '<td class="tdoverflowmax300">';
477  if (isASecretKey($obj->name)) {
478  if (empty($dolibarr_main_prod)) {
479  print '<!-- '.$obj->value.' -->';
480  }
481  print '**********';
482  } else {
483  print dol_escape_htmltag($obj->value);
484  }
485  print '</td>'."\n";
486  if (empty($conf->multicompany->enabled) || !$user->entity) print '<td class="center" width="80px">'.$obj->entity.'</td>'."\n"; // If superadmin or multicompany disabled
487  print "</tr>\n";
488 
489  $i++;
490  }
491 }
492 
493 print '</table>';
494 print '</div>';
495 
496 // End of page
497 llxFooter();
498 $db->close();
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
dol_now($mode= 'auto')
Return date for now.
isASecretKey($keyname)
Return if string has a name dedicated to store a secret.
dol_get_first_day($year, $month=1, $gm=false)
Return GMT time for first day of a month or year.
Definition: date.lib.php:481
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:319
getServerTimeZoneString()
Return server timezone string.
Definition: date.lib.php:72
getURLContent($url, $postorget= 'GET', $param= '', $followlocation=1, $addheaders=array(), $allowedschemes=array('http', 'https'), $localurl=0)
Function to get a content from an URL (use proxy if proxy defined).
Definition: geturl.lib.php:38
img_warning($titlealt= 'default', $moreatt= '', $morecss= 'pictowarning')
Show warning logo.
llxHeader()
Empty header.
Definition: wrapper.php:45
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
Class to manage generation of HTML components Only common components must be here.
getServerTimeZoneInt($refgmtdate= 'now')
Return server timezone int.
Definition: date.lib.php:83
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
price2num($amount, $rounding= '', $option=0)
Function that return a number with universal decimal format (decimal separator is &#39;...
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 ...
versioncompare($versionarray1, $versionarray2)
Compare 2 versions (stored into 2 arrays).
Definition: admin.lib.php:66
dol_listshmop()
Return list of contents of all memory area shared.
Definition: memory.lib.php:185
print $_SERVER["PHP_SELF"]
Edit parameters.
print
Draft customers invoices.
Definition: index.php:89
dol_print_date($time, $format= '', $tzoutput= 'auto', $outputlangs= '', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
Definition: index.php:1232
img_info($titlealt= 'default')
Show info logo.
llxFooter()
Empty footer.
Definition: wrapper.php:59
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $keepmoretags= '', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields...