1<?php
2/* Copyright (C) 2013-2019	Laurent Destailleur		<eldy@users.sourceforge.net>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 */
17
18/**
19 *  \file       htdocs/admin/system/security.php
20 *  \brief      Page to show Security information
21 */
22
23require '../../main.inc.php';
24require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
25require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
26require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
27require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
28require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
29require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
30require_once DOL_DOCUMENT_ROOT.'/core/class/events.class.php';
31
32// Load translation files required by the page
33$langs->loadLangs(array("install", "other", "admin", "errors"));
34
35if (!$user->admin) {
36	accessforbidden();
37}
38
39if (GETPOST('action', 'aZ09') == 'donothing') {
40	exit;
41}
42
43$execmethod = empty($conf->global->MAIN_EXEC_USE_POPEN) ? 1 : $conf->global->MAIN_EXEC_USE_POPEN;
44
45
46/*
47 * View
48 */
49
50llxHeader();
51
52print load_fiche_titre($langs->trans("Security"), '', 'title_setup');
53
54print '<span class="opacitymedium">'.$langs->trans("YouMayFindSecurityAdviceHere", 'hhttps://wiki.dolibarr.org/index.php/Security_information').'</span> (<a href="'.$_SERVER["PHP_SELF"].'">'.$langs->trans("Reload").'</a>)<br>';
55print '<br>';
56
57print load_fiche_titre($langs->trans("PHPSetup"), '', 'folder');
58
59// Get version of PHP
60$phpversion = version_php();
61print "<strong>PHP</strong>: ".$langs->trans("Version").": ".$phpversion;
62if (function_exists('php_ini_loaded_file')) {
63	$inipath = php_ini_loaded_file();
64	print " - <strong>INI</strong>: ".$inipath;
65}
66print "<br>\n";
67
68// Get version of web server
69print "<br><strong>Web server - ".$langs->trans("Version")."</strong>: ".$_SERVER["SERVER_SOFTWARE"]."<br>\n";
70print '<strong>'.$langs->trans("DataRootServer")."</strong>: ".DOL_DATA_ROOT."<br>\n";
71// Web user group by default
72$labeluser = dol_getwebuser('user');
73$labelgroup = dol_getwebuser('group');
74if ($labeluser && $labelgroup) {
75	print '<strong>'.$langs->trans("WebUserGroup")." (env vars)</strong> : ".$labeluser.':'.$labelgroup;
76	if (function_exists('posix_geteuid') && function_exists('posix_getpwuid')) {
77		$arrayofinfoofuser = posix_getpwuid(posix_geteuid());
78		print ' <span class="opacitymedium">(POSIX '.$arrayofinfoofuser['name'].':'.$arrayofinfoofuser['gecos'].':'.$arrayofinfoofuser['dir'].':'.$arrayofinfoofuser['shell'].')</span><br>'."\n";
79	}
80}
81// Web user group real (detected by 'id' external command)
82if (function_exists('exec')) {
83	$arrayout = array(); $varout = 0;
84	exec('id', $arrayout, $varout);
85	if (empty($varout)) {	// Test command is ok. Work only on Linux OS.
86		print '<strong>'.$langs->trans("WebUserGroup")." (real, 'id' command)</strong> : ".join(',', $arrayout)."<br>\n";
87	}
88}
89print '<br>';
90
91print "<strong>PHP session.use_strict_mode</strong> = ".(ini_get('session.use_strict_mode') ? ini_get('session.use_strict_mode') : yn(0)).' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", '1').")</span><br>\n";
92print "<strong>PHP session.use_only_cookies</strong> = ".(ini_get('session.use_only_cookies') ? ini_get('session.use_only_cookies') : yn(0)).' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", '1').")</span><br>\n";
93print "<strong>PHP session.cookie_httponly</strong> = ".(ini_get('session.cookie_httponly') ? ini_get('session.cookie_httponly') : '').' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", '1').")</span><br>\n";
94print "<strong>PHP session.cookie_samesite</strong> = ".(ini_get('session.cookie_samesite') ? ini_get('session.cookie_samesite') : 'None');
95if (!ini_get('session.cookie_samesite') || ini_get('session.cookie_samesite') == 'Lax') {
96	print ' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", 'Lax').")</span>";
97} elseif (ini_get('session.cookie_samesite') == 'Strict') {
98	print ' &nbsp; '.img_warning().' <span class="opacitymedium">'.$langs->trans("WarningPaypalPaymentNotCompatibleWithStrict")."</span>";
99}
100print "<br>\n";
101print "<strong>PHP open_basedir</strong> = ".(ini_get('open_basedir') ? ini_get('open_basedir') : yn(0).' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("ARestrictedPath").', '.$langs->transnoentitiesnoconv("Example").' '.$_SERVER["DOCUMENT_ROOT"]).')</span>')."<br>\n";
102print "<strong>PHP allow_url_fopen</strong> = ".(ini_get('allow_url_fopen') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_fopen') : yn(0)).' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("No")).")</span><br>\n";
103print "<strong>PHP allow_url_include</strong> = ".(ini_get('allow_url_include') ? img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' '.ini_get('allow_url_include') : yn(0)).' &nbsp; <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("No")).")</span><br>\n";
104//print "<strong>PHP safe_mode</strong> = ".(ini_get('safe_mode') ? ini_get('safe_mode') : yn(0)).' &nbsp; <span class="opacitymedium">'.$langs->trans("Deprecated")." (removed in PHP 5.4)</span><br>\n";
105print "<strong>PHP disable_functions</strong> = ";
106$arrayoffunctionsdisabled = explode(',', ini_get('disable_functions'));
107$arrayoffunctionstodisable = explode(',', 'pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals');
108if ($execmethod == 1) {
109	$arrayoffunctionstodisable2 = explode(',', 'passthru,shell_exec,system,proc_open,popen');
110	$functiontokeep = 'exec';
111} else {
112	$arrayoffunctionstodisable2 = explode(',', 'exec,passthru,shell_exec,system,proc_open');
113	$functiontokeep = 'popen';
114}
115$i = 0;
116foreach ($arrayoffunctionsdisabled as $functionkey) {
117	if ($i > 0) {
118		print ', ';
119	}
120	print '<span class="opacitymedium">'.$functionkey.'</span>';
121	$i++;
122}
123print "<br>\n";
124$todisabletext = '';
125$i = 0;
126foreach ($arrayoffunctionstodisable as $functiontodisable) {
127	if (! in_array($functiontodisable, $arrayoffunctionsdisabled)) {
128		if ($i > 0) {
129			$todisabletext .= ', ';
130		}
131		$todisabletext .= img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' <span class="opacitymedium">'.$functiontodisable.'</span>';
132		$i++;
133	}
134}
135if ($todisabletext) {
136	print $langs->trans("YouShouldDisablePHPFunctions").': '.$todisabletext;
137	print '<br>';
138}
139$todisabletext = '';
140$i = 0;
141foreach ($arrayoffunctionstodisable2 as $functiontodisable) {
142	if (! in_array($functiontodisable, $arrayoffunctionsdisabled)) {
143		if ($i > 0) {
144			$todisabletext .= ', ';
145		}
146		$todisabletext .= img_picto($langs->trans("YouShouldSetThisToOff"), 'warning').' <span class="opacitymedium">'.$functiontodisable.'</span>';
147		$i++;
148	}
149}
150if ($todisabletext) {
151	print $langs->trans("IfCLINotRequiredYouShouldDisablePHPFunctions").': '.$todisabletext;
152	print '<br>';
153}
154
155print $langs->trans("PHPFunctionsRequiredForCLI").': ';
156if (in_array($functiontokeep, $arrayoffunctionsdisabled)) {
157	print img_picto($langs->trans("PHPFunctionsRequiredForCLI"), 'warning');
158}
159print '<span class="opacitymedium">'.$functiontokeep.'</span>';
160print '<br>';
161
162print '<br>';
163
164// XDebug
165print '<strong>'.$langs->trans("XDebug").'</strong>: ';
166$test = !function_exists('xdebug_is_enabled');
167if ($test) {
168	print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' - '.$langs->trans("NotRiskOfLeakWithThis");
169} else {
170	print img_picto('', 'warning').' '.$langs->trans("ModuleActivatedMayExposeInformation", $langs->transnoentities("XDebug"));
171	print ' - '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xdebug.php">XDebug admin page</a>';
172}
173print '<br>';
174
175
176// OS Permissions
177
178print '<br>';
179print '<br>';
180print '<br>';
181print load_fiche_titre($langs->trans("OSSetup").' - '.$langs->trans("PermissionsOnFiles"), '', 'folder');
182
183print '<strong>'.$langs->trans("PermissionsOnFilesInWebRoot").'</strong>: ';
184$arrayoffilesinroot = dol_dir_list(DOL_DOCUMENT_ROOT, 'all', 1, '', array('\/custom'), 'name', SORT_ASC, 4, 1, '', 1);
185$fileswithwritepermission = array();
186foreach ($arrayoffilesinroot as $fileinroot) {
187	// Test if there is at least one write permission file. If yes, add the entry into array $fileswithwritepermission
188	if (isset($fileinroot['perm']) && ($fileinroot['perm'] & 0222)) {
189		$fileswithwritepermission[] = $fileinroot['relativename'];
190	}
191}
192if (empty($fileswithwritepermission)) {
193	print img_picto('', 'tick').' '.$langs->trans("NoWritableFilesFoundIntoRootDir");
194} else {
195	print img_warning().' '.$langs->trans("SomeFilesOrDirInRootAreWritable");
196	print '<br>'.$langs->trans("Example").': ';
197	$i = 0;
198	foreach ($fileswithwritepermission as $filewithwritepermission) {
199		if ($i > 0) {
200			print ', ';
201		}
202		print '<span class="opacitymedium">'.$filewithwritepermission.'</span>';
203		if ($i > 20) {
204			print ' ...';
205			break;
206		}
207		$i++;
208	}
209}
210print '<br>';
211print '<br>';
212
213print '<strong>'.$langs->trans("PermissionsOnFile", $conffile).'</strong>: ';		// $conffile is defined into filefunc.inc.php
214$perms = fileperms($dolibarr_main_document_root.'/'.$conffile);
215if ($perms) {
216	if (($perms & 0x0004) || ($perms & 0x0002)) {
217		print img_warning().' '.$langs->trans("ConfFileIsReadableOrWritableByAnyUsers");
218		// Web user group by default
219		$labeluser = dol_getwebuser('user');
220		$labelgroup = dol_getwebuser('group');
221		print ' '.$langs->trans("User").': '.$labeluser.':'.$labelgroup;
222		if (function_exists('posix_geteuid') && function_exists('posix_getpwuid')) {
223			$arrayofinfoofuser = posix_getpwuid(posix_geteuid());
224			print ' <span class="opacitymedium">(POSIX '.$arrayofinfoofuser['name'].':'.$arrayofinfoofuser['gecos'].':'.$arrayofinfoofuser['dir'].':'.$arrayofinfoofuser['shell'].')</span>';
225		}
226	} else {
227		print img_picto('', 'tick');
228	}
229} else {
230	print img_warning().' '.$langs->trans("FailedToReadFile", $conffile);
231}
232print '<br>';
233print '<br>';
234
235$installlock = DOL_DATA_ROOT.'/install.lock';
236print '<strong>'.$langs->trans("DolibarrSetup").'</strong>: ';
237if (file_exists($installlock)) {
238	print img_picto('', 'tick').' '.$langs->trans("InstallAndUpgradeLockedBy", $installlock);
239} else {
240	print img_warning().' '.$langs->trans("WarningLockFileDoesNotExists", DOL_DATA_ROOT);
241}
242print '<br>';
243
244
245// File conf.php
246
247print '<br>';
248print '<br>';
249print '<br>';
250print load_fiche_titre($langs->trans("ConfigurationFile").' ('.$conffile.')', '', 'folder');
251
252print '<strong>$dolibarr_main_prod</strong>: '.($dolibarr_main_prod ? $dolibarr_main_prod : '0');
253if (empty($dolibarr_main_prod)) {
254	print ' &nbsp; '.img_picto('', 'warning').' '.$langs->trans("IfYouAreOnAProductionSetThis", 1);
255}
256print '<br>';
257
258print '<strong>$dolibarr_nocsrfcheck</strong>: '.(empty($dolibarr_nocsrfcheck) ? '0' : $dolibarr_nocsrfcheck);
259if (!empty($dolibarr_nocsrfcheck)) {
260	print ' &nbsp; '.img_picto('', 'warning').' '.$langs->trans("IfYouAreOnAProductionSetThis", 0);
261}
262print '<br>';
263
264print '<strong>$dolibarr_main_restrict_ip</strong>: ';
265if (empty($dolibarr_main_restrict_ip)) {
266	print '<span class="opacitymedium">'.$langs->trans("None").'</span>';
267	//print ' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("IPsOfUsers")).')</span>';
268}
269
270print '<br>';
271
272if (empty($conf->global->SECURITY_DISABLE_TEST_ON_OBFUSCATED_CONF)) {
273	print '<strong>$dolibarr_main_db_pass</strong>: ';
274	if (!empty($dolibarr_main_db_pass) && empty($dolibarr_main_db_encrypted_pass)) {
275		print img_picto('', 'warning').' '.$langs->trans("DatabasePasswordNotObfuscated").' &nbsp; <span class="opacitymedium">('.$langs->trans("Recommended").': '.$langs->trans("SetOptionTo", $langs->transnoentitiesnoconv("MainDbPasswordFileConfEncrypted"), yn(1)).')</span>';
276		//print ' <span class="opacitymedium">('.$langs->trans("RecommendedValueIs", $langs->transnoentitiesnoconv("IPsOfUsers")).')</span>';
277	} else {
278		print img_picto('', 'tick').' '.$langs->trans("DatabasePasswordObfuscated");
279	}
280
281	print '<br>';
282}
283
284
285
286// Menu security
287
288print '<br>';
289print '<br>';
290print '<br>';
291
292print load_fiche_titre($langs->trans("Menu").' '.$langs->trans("SecuritySetup"), '', 'folder');
293
294
295print '<strong>'.$langs->trans("UseCaptchaCode").'</strong>: ';
296print empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA) ? '' : img_picto('', 'tick').' ';
297print yn(empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA) ? 0 : 1);
298print '<br>';
299print '<br>';
300
301
302print '<strong>'.$langs->trans("AntivirusEnabledOnUpload").'</strong>: ';
303print empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ? '' : img_picto('', 'tick').' ';
304print yn(empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ? 0 : 1);
305if (!empty($conf->global->MAIN_ANTIVIRUS_COMMAND)) {
306	print ' &nbsp; - '.$conf->global->MAIN_ANTIVIRUS_COMMAND;
307	if (defined('MAIN_ANTIVIRUS_COMMAND')) {
308		print ' - <span class="opacitymedium">'.$langs->trans("ValueIsForcedBySystem").'</span>';
309	}
310}
311print '<br>';
312print '<br>';
313
314$securityevent = new Events($db);
315$eventstolog = $securityevent->eventstolog;
316
317print '<strong>'.$langs->trans("AuditedSecurityEvents").'</strong>: ';
318$out = '';
319if (!empty($eventstolog) && is_array($eventstolog)) {
320	// Loop on each event type
321	$i = 0;
322	foreach ($eventstolog as $key => $arr) {
323		if ($arr['id']) {
324			$key = 'MAIN_LOGEVENTS_'.$arr['id'];
325			$value = empty($conf->global->$key) ? '' : $conf->global->$key;
326			if ($value) {
327				if ($i > 0) {
328					$out .= ', ';
329				}
330				$out .= '<span class="opacitymedium">'.$key.'</span>';
331				$i++;
332			}
333		}
334	}
335	print $out;
336}
337
338if (empty($out)) {
339	print img_warning().' '.$langs->trans("NoSecurityEventsAreAduited", $langs->transnoentities("Home").' - '.$langs->transnoentities("Setup").' - '.$langs->transnoentities("Security").' - '.$langs->transnoentities("Audit")).'<br>';
340}
341
342print '<br>';
343print '<br>';
344print '<br>';
345print '<br>';
346
347
348print load_fiche_titre($langs->trans("OtherSetup").' ('.$langs->trans("Experimental").')', '', 'folder');
349
350
351//print '<strong>'.$langs->trans("PasswordEncryption").'</strong>: ';
352print '<strong>MAIN_SECURITY_HASH_ALGO</strong> = '.(empty($conf->global->MAIN_SECURITY_HASH_ALGO) ? '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>' : $conf->global->MAIN_SECURITY_HASH_ALGO)." &nbsp; ";
353if (empty($conf->global->MAIN_SECURITY_HASH_ALGO)) {
354	print '<span class="opacitymedium"> &nbsp; &nbsp; If unset: \'md5\'</span>';
355}
356if ($conf->global->MAIN_SECURITY_HASH_ALGO != 'password_hash') {
357	print '<br><strong>MAIN_SECURITY_SALT</strong> = '.(empty($conf->global->MAIN_SECURITY_SALT) ? '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>' : $conf->global->MAIN_SECURITY_SALT).'<br>';
358} else {
359	print '<span class="opacitymedium">('.$langs->trans("Recommended").': password_hash)</span>';
360	print '<br>';
361}
362if ($conf->global->MAIN_SECURITY_HASH_ALGO != 'password_hash') {
363	print '<div class="info">The recommanded value for MAIN_SECURITY_HASH_ALGO is now \'password_hash\' but setting it now will make ALL existing passwords of all users not valid, so update is not possible.<br>';
364	print 'If you really want to switch, you must:<br>';
365	print '- Go on home - setup - other and add constant MAIN_SECURITY_HASH_ALGO to value \'password_hash\'<br>';
366	print '- In same session, WITHOUT LOGGING OUT, go into your admin user record and set a new password<br>';
367	print '- You can now logout and login with this new password. You must now reset password of all other users.<br>';
368	print '</div><br>';
369}
370print '<br>';
371
372print '<strong>MAIN_SECURITY_ANTI_SSRF_SERVER_IP</strong> = '.(empty($conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP) ? '<span class="opacitymedium">'.$langs->trans("Undefined").'</span> &nbsp; <span class="opacitymedium">('.$langs->trans("Recommended").': List of static IPs of server separated with coma - '.$langs->trans("Note").': common loopback ip like 127.*.*.*, [::1] are already added)</span>' : $conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP)."<br>";
373print '<br>';
374
375print '<strong>MAIN_ALLOW_SVG_FILES_AS_IMAGES</strong> = '.(empty($conf->global->MAIN_ALLOW_SVG_FILES_AS_IMAGES) ? '0' : $conf->global->MAIN_ALLOW_SVG_FILES_AS_IMAGES).' &nbsp; <span class="opacitymedium">('.$langs->trans("Recommended").': 0)</span><br>';
376print '<br>';
377
378print '<strong>MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE</strong> = '.(empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE) ? '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>' : $conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE).' &nbsp; <span class="opacitymedium">('.$langs->trans("Recommended").': 1)</span><br>';
379print '<br>';
380
381print '<strong>MAIN_RESTRICTHTML_ONLY_VALID_HTML</strong> = '.(empty($conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML) ? '<span class="opacitymedium">'.$langs->trans("Undefined").' &nbsp; ('.$langs->trans("Recommended").': 1)</span>' : $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML)."<br>";
382print '<br>';
383
384print '<strong>MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES</strong> = '.(empty($conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES) ? '<span class="opacitymedium">'.$langs->trans("Undefined").' &nbsp; ('.$langs->trans("Recommended").': 1)</span>' : $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES)."<br>";
385print '<br>';
386
387print '<strong>MAIN_EXEC_USE_POPEN</strong> = ';
388if (empty($conf->global->MAIN_EXEC_USE_POPEN)) {
389	print '<span class="opacitymedium">'.$langs->trans("Undefined").'</span>';
390} else {
391	print $conf->global->MAIN_EXEC_USE_POPEN;
392}
393if ($execmethod == 1) {
394	print '<span class="opacitymedium">, "exec" PHP method will be used for shell commands';
395	print ' &nbsp; ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 1)';
396	print '</span>';
397}
398if ($execmethod == 2) {
399	print '<span class="opacitymedium">, "popen" PHP method will be used for shell commands';
400	print ' &nbsp; ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 1)';
401	print '</span>';
402}
403print "<br>";
404print '<br>';
405
406
407
408// Modules/Applications
409
410print '<br>';
411print '<br>';
412print '<br>';
413print load_fiche_titre($langs->trans("Modules"), '', 'folder');
414
415// Module log
416print '<strong>'.$langs->trans("Syslog").'</strong>: ';
417$test = empty($conf->syslog->enabled);
418if ($test) {
419	print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' - '.$langs->trans("NotRiskOfLeakWithThis");
420} else {
421	if ($conf->global->SYSLOG_LEVEL > LOG_NOTICE) {
422		print img_picto('', 'warning').' '.$langs->trans("ModuleActivatedWithTooHighLogLevel", $langs->transnoentities("Syslog"));
423	} else {
424		print img_picto('', 'tick.png').' '.$langs->trans("ModuleSyslogActivatedButLevelNotTooVerbose", $langs->transnoentities("Syslog"), $conf->global->SYSLOG_LEVEL);
425	}
426	//print ' '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xdebug.php'.'">XDebug admin page</a>';
427}
428print '<br>';
429
430// Module debugbar
431print '<strong>'.$langs->trans("DebugBar").'</strong>: ';
432$test = empty($conf->debugbar->enabled);
433if ($test) {
434	print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' - '.$langs->trans("NotRiskOfLeakWithThis");
435} else {
436	print img_picto('', 'error').' '.$langs->trans("ModuleActivatedDoNotUseInProduction", $langs->transnoentities("DebugBar"));
437	//print ' '.$langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/system/xdebug.php'.'">XDebug admin page</a>';
438}
439print '<br>';
440
441
442// APIs
443
444print '<br>';
445print '<br>';
446print '<br>';
447print load_fiche_titre($langs->trans("API"), '', 'folder');
448
449if (empty($conf->api->enabled) && empty($conf->webservices->enabled)) {
450	print $langs->trans("APIsAreNotEnabled");
451} else {
452	if (!empty($conf->webservices->enabled)) {
453		print $langs->trans('YouEnableDeprecatedWSAPIsUseRESTAPIsInstead')."<br>\n";
454		print '<br>';
455	}
456	if (!empty($conf->api->enabled)) {
457		print '<strong>API_ENDPOINT_RULES</strong> = '.(empty($conf->global->API_ENDPOINT_RULES) ? '<span class="opacitymedium">'.$langs->trans("Undefined").' &nbsp; ('.$langs->trans("Example").': endpoint1:1,endpoint2:1,...)</span>' : $conf->global->API_ENDPOINT_RULES)."<br>\n";
458		print '<br>';
459	}
460}
461
462
463print '<br><br>';
464
465// End of page
466llxFooter();
467$db->close();
468