24 require
'../../main.inc.php';
25 require_once DOL_DOCUMENT_ROOT.
'/core/lib/memory.lib.php';
26 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
27 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
28 require_once DOL_DOCUMENT_ROOT.
'/core/lib/geturl.lib.php';
29 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
30 require_once DOL_DOCUMENT_ROOT.
'/core/lib/security2.lib.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/class/events.class.php';
34 $langs->loadLangs(array(
"install",
"other",
"admin",
"errors"));
40 if (
GETPOST(
'action',
'aZ09') ==
'donothing') {
55 print
'<span class="opacitymedium">'.$langs->trans(
"YouMayFindSecurityAdviceHere",
'hhttps://wiki.dolibarr.org/index.php/Security_information').
'</span>';
56 print
' ';
57 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'">';
58 print
img_picto($langs->trans(
"Reload"),
'refresh').
' ';
59 print $langs->trans(
"Reload");
68 print
"<strong>PHP</strong>: ".$langs->trans(
"Version").
": ".$phpversion;
69 if (function_exists(
'php_ini_loaded_file')) {
70 $inipath = php_ini_loaded_file();
71 print
" - <strong>INI</strong>: ".$inipath;
76 print
"<br><strong>Web server - ".$langs->trans(
"Version").
"</strong>: ".$_SERVER[
"SERVER_SOFTWARE"].
"<br>\n";
77 print
'<strong>'.$langs->trans(
"DataRootServer").
"</strong>: ".DOL_DATA_ROOT.
"<br>\n";
81 if ($labeluser && $labelgroup) {
82 print
'<strong>'.$langs->trans(
"WebUserGroup").
" (env vars)</strong> : ".$labeluser.
':'.$labelgroup;
83 if (function_exists(
'posix_geteuid') && function_exists(
'posix_getpwuid')) {
84 $arrayofinfoofuser = posix_getpwuid(posix_geteuid());
85 print
' <span class="opacitymedium">(POSIX '.$arrayofinfoofuser[
'name'].
':'.$arrayofinfoofuser[
'gecos'].
':'.$arrayofinfoofuser[
'dir'].
':'.$arrayofinfoofuser[
'shell'].
')</span><br>'.
"\n";
89 if (function_exists(
'exec')) {
90 $arrayout = array(); $varout = 0;
91 exec(
'id', $arrayout, $varout);
93 print
'<strong>'.$langs->trans(
"WebUserGroup").
" (real, 'id' command)</strong> : ".join(
',', $arrayout).
"<br>\n";
98 print
"<strong>PHP session.use_strict_mode</strong> = ".(ini_get(
'session.use_strict_mode') ?
'' :
img_warning().
' ').(ini_get(
'session.use_strict_mode') ? ini_get(
'session.use_strict_mode') :
yn(0)).
' <span class="opacitymedium">('.$langs->trans(
"RecommendedValueIs",
'1').
")</span><br>\n";
99 print
"<strong>PHP session.use_only_cookies</strong> = ".(ini_get(
'session.use_only_cookies') ?
'' :
img_warning().
' ').(ini_get(
'session.use_only_cookies') ? ini_get(
'session.use_only_cookies') :
yn(0)).
' <span class="opacitymedium">('.$langs->trans(
"RecommendedValueIs",
'1').
")</span><br>\n";
100 print
"<strong>PHP session.cookie_httponly</strong> = ".(ini_get(
'session.cookie_httponly') ?
'' :
img_warning().
' ').(ini_get(
'session.cookie_httponly') ? ini_get(
'session.cookie_httponly') :
'').
' <span class="opacitymedium">('.$langs->trans(
"RecommendedValueIs",
'1').
")</span><br>\n";
101 print
"<strong>PHP session.cookie_samesite</strong> = ".(ini_get(
'session.cookie_samesite') ? ini_get(
'session.cookie_samesite') :
'None');
102 if (!ini_get(
'session.cookie_samesite') || ini_get(
'session.cookie_samesite') ==
'Lax') {
103 print
' <span class="opacitymedium">('.$langs->trans(
"RecommendedValueIs",
'Lax').
")</span>";
104 } elseif (ini_get(
'session.cookie_samesite') ==
'Strict') {
105 print
' '.img_warning().
' <span class="opacitymedium">'.$langs->trans(
"WarningPaypalPaymentNotCompatibleWithStrict").
"</span>";
108 print
"<strong>PHP open_basedir</strong> = ".(ini_get(
'open_basedir') ? ini_get(
'open_basedir') :
yn(0).
' <span class="opacitymedium">('.$langs->trans(
"RecommendedValueIs", $langs->transnoentitiesnoconv(
"ARestrictedPath").
', '.$langs->transnoentitiesnoconv(
"Example").
': '.$_SERVER[
"DOCUMENT_ROOT"].
','.DOL_DATA_ROOT).
')</span>').
"<br>\n";
109 print
"<strong>PHP short_open_tag</strong> = ".((empty(ini_get(
'short_open_tag')) || ini_get(
'short_open_tag') ==
'Off') ?
yn(0) :
img_warning().
' '.
yn(0)).
' <span class="opacitymedium">('.$langs->trans(
"RecommendedValueIs", $langs->transnoentitiesnoconv(
"No")).
')</span>'.
"<br>\n";
110 print
"<strong>PHP allow_url_fopen</strong> = ".(ini_get(
'allow_url_fopen') ?
img_picto($langs->trans(
"YouShouldSetThisToOff"),
'warning').
' '.ini_get(
'allow_url_fopen') :
yn(0)).
' <span class="opacitymedium">('.$langs->trans(
"RecommendedValueIs", $langs->transnoentitiesnoconv(
"No")).
")</span><br>\n";
111 print
"<strong>PHP allow_url_include</strong> = ".(ini_get(
'allow_url_include') ?
img_picto($langs->trans(
"YouShouldSetThisToOff"),
'warning').
' '.ini_get(
'allow_url_include') :
yn(0)).
' <span class="opacitymedium">('.$langs->trans(
"RecommendedValueIs", $langs->transnoentitiesnoconv(
"No")).
")</span><br>\n";
113 print
"<strong>PHP disable_functions</strong> = ";
114 $arrayoffunctionsdisabled = explode(
',', ini_get(
'disable_functions'));
115 $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');
116 if ($execmethod == 1) {
117 $arrayoffunctionstodisable2 = explode(
',',
'passthru,shell_exec,system,proc_open,popen');
118 $functiontokeep =
'exec';
120 $arrayoffunctionstodisable2 = explode(
',',
'exec,passthru,shell_exec,system,proc_open');
121 $functiontokeep =
'popen';
124 foreach ($arrayoffunctionsdisabled as $functionkey) {
128 print
'<span class="opacitymedium">'.$functionkey.
'</span>';
134 foreach ($arrayoffunctionstodisable as $functiontodisable) {
135 if (! in_array($functiontodisable, $arrayoffunctionsdisabled)) {
137 $todisabletext .=
', ';
139 $todisabletext .=
img_picto($langs->trans(
"YouShouldSetThisToOff"),
'warning').
' <span class="opacitymedium">'.$functiontodisable.
'</span>';
143 if ($todisabletext) {
144 print $langs->trans(
"YouShouldDisablePHPFunctions").
': '.$todisabletext;
149 foreach ($arrayoffunctionstodisable2 as $functiontodisable) {
150 if (! in_array($functiontodisable, $arrayoffunctionsdisabled)) {
152 $todisabletext .=
', ';
154 $todisabletext .=
img_picto($langs->trans(
"YouShouldSetThisToOff"),
'warning').
' <span class="opacitymedium">'.$functiontodisable.
'</span>';
158 if ($todisabletext) {
159 print $langs->trans(
"IfCLINotRequiredYouShouldDisablePHPFunctions").
': '.$todisabletext;
163 print $langs->trans(
"PHPFunctionsRequiredForCLI").
': ';
164 if (in_array($functiontokeep, $arrayoffunctionsdisabled)) {
165 print
img_picto($langs->trans(
"PHPFunctionsRequiredForCLI"),
'warning');
167 print
'<span class="opacitymedium">'.$functiontokeep.
'</span>';
173 print
'<strong>'.$langs->trans(
"XDebug").
'</strong>: ';
174 $test = !function_exists(
'xdebug_is_enabled') && !extension_loaded(
'xdebug');
176 print
img_picto(
'',
'tick.png').
' '.$langs->trans(
"NotInstalled").
' - '.$langs->trans(
"NotRiskOfLeakWithThis");
178 print
img_picto(
'',
'warning').
' '.$langs->trans(
"ModuleActivatedMayExposeInformation", $langs->transnoentities(
"XDebug"));
179 print
' - '.$langs->trans(
"MoreInformation").
' <a href="'.DOL_URL_ROOT.
'/admin/system/xdebug.php">XDebug admin page</a>';
189 print
load_fiche_titre($langs->trans(
"OSSetup").
' - '.$langs->trans(
"PermissionsOnFiles"),
'',
'folder');
191 print
'<strong>'.$langs->trans(
"PermissionsOnFilesInWebRoot").
'</strong>: ';
192 $arrayoffilesinroot =
dol_dir_list(DOL_DOCUMENT_ROOT,
'all', 1,
'', array(
'\/custom'),
'name', SORT_ASC, 4, 1,
'', 1);
193 $fileswithwritepermission = array();
194 foreach ($arrayoffilesinroot as $fileinroot) {
196 if (isset($fileinroot[
'perm']) && ($fileinroot[
'perm'] & 0222)) {
197 $fileswithwritepermission[] = $fileinroot[
'relativename'];
200 if (empty($fileswithwritepermission)) {
201 print
img_picto(
'',
'tick').
' '.$langs->trans(
"NoWritableFilesFoundIntoRootDir");
203 print
img_warning().
' '.$langs->trans(
"SomeFilesOrDirInRootAreWritable");
204 print
'<br>'.$langs->trans(
"Example").
': ';
206 foreach ($fileswithwritepermission as $filewithwritepermission) {
210 print
'<span class="opacitymedium">'.$filewithwritepermission.
'</span>';
221 print
'<strong>'.$langs->trans(
"PermissionsOnFile", $conffile).
'</strong>: ';
222 $perms = fileperms($dolibarr_main_document_root.
'/'.$conffile);
224 if (($perms & 0x0004) || ($perms & 0x0002)) {
225 print
img_warning().
' '.$langs->trans(
"ConfFileIsReadableOrWritableByAnyUsers");
229 print
' '.$langs->trans(
"User").
': '.$labeluser.
':'.$labelgroup;
230 if (function_exists(
'posix_geteuid') && function_exists(
'posix_getpwuid')) {
231 $arrayofinfoofuser = posix_getpwuid(posix_geteuid());
232 print
' <span class="opacitymedium">(POSIX '.$arrayofinfoofuser[
'name'].
':'.$arrayofinfoofuser[
'gecos'].
':'.$arrayofinfoofuser[
'dir'].
':'.$arrayofinfoofuser[
'shell'].
')</span>';
238 print
img_warning().
' '.$langs->trans(
"FailedToReadFile", $conffile);
243 $installlock = DOL_DATA_ROOT.
'/install.lock';
244 print
'<strong>'.$langs->trans(
"DolibarrSetup").
'</strong>: ';
245 if (file_exists($installlock)) {
246 print
img_picto(
'',
'tick').
' '.$langs->trans(
"InstallAndUpgradeLockedBy", $installlock);
248 print
img_warning().
' '.$langs->trans(
"WarningLockFileDoesNotExists", DOL_DATA_ROOT);
258 print
load_fiche_titre($langs->trans(
"ConfigurationFile").
' ('.$conffile.
')',
'',
'folder');
260 print
'<strong>$dolibarr_main_prod</strong>: '.($dolibarr_main_prod ? $dolibarr_main_prod :
'0');
261 if (empty($dolibarr_main_prod)) {
262 print
' '.img_picto(
'',
'warning').
' '.$langs->trans(
"IfYouAreOnAProductionSetThis", 1);
266 print
'<strong>$dolibarr_nocsrfcheck</strong>: '.(empty($dolibarr_nocsrfcheck) ?
'0' : $dolibarr_nocsrfcheck);
267 if (!empty($dolibarr_nocsrfcheck)) {
268 print
' '.img_picto(
'',
'warning').
' '.$langs->trans(
"IfYouAreOnAProductionSetThis", 0);
270 print
' <span class="opacitymedium">('.$langs->trans(
"Recommended").
': 0)</span>';
274 print
'<strong>$dolibarr_main_restrict_ip</strong>: ';
275 if (empty($dolibarr_main_restrict_ip)) {
276 print $langs->trans(
"None");
279 print $dolibarr_main_restrict_ip;
283 print
'<strong>$dolibarr_main_restrict_os_commands</strong>: ';
284 if (empty($dolibarr_main_restrict_os_commands)) {
285 print $langs->trans(
"None");
287 print $dolibarr_main_restrict_os_commands;
289 print
' <span class="opacitymedium">('.$langs->trans(
"RecommendedValueIs",
'mysqldump, mysql, pg_dump, pgrestore').
')</span>';
292 if (empty($conf->global->SECURITY_DISABLE_TEST_ON_OBFUSCATED_CONF)) {
293 print
'<strong>$dolibarr_main_db_pass</strong>: ';
294 if (!empty($dolibarr_main_db_pass) && empty($dolibarr_main_db_encrypted_pass)) {
295 print
img_picto(
'',
'warning').
' '.$langs->trans(
"DatabasePasswordNotObfuscated").
' <span class="opacitymedium">('.$langs->trans(
"Recommended").
': '.$langs->trans(
"SetOptionTo", $langs->transnoentitiesnoconv(
"MainDbPasswordFileConfEncrypted"),
yn(1)).
')</span>';
298 print
img_picto(
'',
'tick').
' '.$langs->trans(
"DatabasePasswordObfuscated");
312 print
load_fiche_titre($langs->trans(
"Menu").
' '.$langs->trans(
"SecuritySetup"),
'',
'folder');
315 print
'<strong>'.$langs->trans(
"UseCaptchaCode").
'</strong>: ';
316 print empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA) ?
'' :
img_picto(
'',
'tick').
' ';
317 print
yn(empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA) ? 0 : 1);
322 $sessiontimeout = ini_get(
"session.gc_maxlifetime");
323 if (empty($conf->global->MAIN_SESSION_TIMEOUT)) {
324 $conf->global->MAIN_SESSION_TIMEOUT = $sessiontimeout;
326 print
'<strong>'.$langs->trans(
"SessionTimeOut").
'</strong>';
327 if (ini_get(
"session.gc_probability") == 0) {
328 print
$form->textwithpicto(
'', $langs->trans(
"SessionsPurgedByExternalSystem", ini_get(
"session.gc_maxlifetime")));
330 print
$form->textwithpicto(
'', $langs->trans(
"SessionExplanation", ini_get(
"session.gc_probability"), ini_get(
"session.gc_divisor"), ini_get(
"session.gc_maxlifetime")));
332 print
': '.getDolGlobalInt(
'MAIN_SESSION_TIMEOUT').
' '.strtolower($langs->trans(
"Seconds"));
335 print
'<strong>'.$langs->trans(
"MaxNumberOfImagesInGetPost").
'</strong>: ';
336 print
getDolGlobalInt(
'MAIN_SECURITY_MAX_IMG_IN_HTML_CONTENT').
' '.strtolower($langs->trans(
"Images"));
339 print
'<strong>'.$langs->trans(
"MaxNumberOfPostOnPublicPagesByIP").
'</strong>: ';
340 print
getDolGlobalInt(
'MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS', 200).
' '.strtolower($langs->trans(
"Posts"));
343 print
'<strong>'.$langs->trans(
"MaxNumberOfAttachementOnForms").
'</strong>: ';
344 print
getDolGlobalInt(
"MAIN_SECURITY_MAX_ATTACHMENT_ON_FORMS", 10).
' '.strtolower($langs->trans(
"Files"));
347 print
'<strong>'.$langs->trans(
"DoNotStoreClearPassword").
'</strong>: ';
348 print empty($conf->global->DATABASE_PWD_ENCRYPTED) ?
'' :
img_picto(
'',
'tick').
' ';
349 print
yn(empty($conf->global->DATABASE_PWD_ENCRYPTED) ? 0 : 1);
350 if (empty($conf->global->DATABASE_PWD_ENCRYPTED)) {
351 print
' <span class="opacitymedium">('.$langs->trans(
"Recommended").
' '.
yn(1).
')</span>';
388 print
'<strong>'.$langs->trans(
"AntivirusEnabledOnUpload").
'</strong>: ';
389 print empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ?
img_warning().
' ' :
img_picto(
'',
'tick').
' ';
390 print
yn(empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ? 0 : 1);
391 if (empty($conf->global->MAIN_ANTIVIRUS_COMMAND)) {
392 print
' - <span class="opacitymedium">'.$langs->trans(
"Recommended").
': '.$langs->trans(
"DefinedAPathForAntivirusCommandIntoSetup", $langs->transnoentitiesnoconv(
"Home").
" - ".$langs->transnoentitiesnoconv(
"Setup").
" - ".$langs->transnoentitiesnoconv(
"Security")).
'</span>';
394 print
' - '.$conf->global->MAIN_ANTIVIRUS_COMMAND;
395 if (defined(
'MAIN_ANTIVIRUS_COMMAND') && !defined(
'MAIN_ANTIVIRUS_BYPASS_COMMAND_AND_PARAM')) {
396 print
' - <span class="opacitymedium">'.$langs->trans(
"ValueIsForcedBySystem").
'</span>';
404 print
'<strong>'.$langs->trans(
"UMask").
'</strong>: ';
405 if (! in_array($umask, array(
'600',
'660',
'0600',
'0660'))) {
409 if (! in_array($umask, array(
'600',
'660',
'0600',
'0660'))) {
410 print
' <span class="opacitymedium">('.$langs->trans(
"Recommended").
': 0600 | 0660)</span>';
416 $securityevent =
new Events($db);
417 $eventstolog = $securityevent->eventstolog;
419 print
'<strong>'.$langs->trans(
"AuditedSecurityEvents").
'</strong>: ';
421 if (!empty($eventstolog) && is_array($eventstolog)) {
424 foreach ($eventstolog as $key => $arr) {
426 $key =
'MAIN_LOGEVENTS_'.$arr[
'id'];
427 $value = empty($conf->global->$key) ?
'' : $conf->global->$key;
432 $out .=
'<span class="opacitymedium">'.$key.
'</span>';
441 print
img_warning().
' '.$langs->trans(
"NoSecurityEventsAreAduited", $langs->transnoentities(
"Home").
' - '.$langs->transnoentities(
"Setup").
' - '.$langs->transnoentities(
"Security").
' - '.$langs->transnoentities(
"Audit")).
'<br>';
455 print
'<strong>'.$langs->trans(
"Syslog").
'</strong>: ';
456 $test = empty($conf->syslog->enabled);
458 print
img_picto(
'',
'tick.png').
' '.$langs->trans(
"NotInstalled").
' - '.$langs->trans(
"NotRiskOfLeakWithThis");
460 if ($conf->global->SYSLOG_LEVEL > LOG_NOTICE) {
461 print
img_picto(
'',
'warning').
' '.$langs->trans(
"ModuleActivatedWithTooHighLogLevel", $langs->transnoentities(
"Syslog"));
463 print
img_picto(
'',
'tick.png').
' '.$langs->trans(
"ModuleSyslogActivatedButLevelNotTooVerbose", $langs->transnoentities(
"Syslog"), $conf->global->SYSLOG_LEVEL);
470 print
'<strong>'.$langs->trans(
"DebugBar").
'</strong>: ';
471 $test = empty($conf->debugbar->enabled);
473 print
img_picto(
'',
'tick.png').
' '.$langs->trans(
"NotInstalled").
' - '.$langs->trans(
"NotRiskOfLeakWithThis");
475 print
img_picto(
'',
'error').
' '.$langs->trans(
"ModuleActivatedDoNotUseInProduction", $langs->transnoentities(
"DebugBar"));
488 if (empty($conf->api->enabled) && empty($conf->webservices->enabled)) {
489 print $langs->trans(
"APIsAreNotEnabled");
491 if (!empty($conf->webservices->enabled)) {
492 print $langs->trans(
'YouEnableDeprecatedWSAPIsUseRESTAPIsInstead').
"<br>\n";
495 if (!empty($conf->api->enabled)) {
496 print
'<strong>API_ENDPOINT_RULES</strong> = '.getDolGlobalString(
'API_ENDPOINT_RULES',
'<span class="opacitymedium">'.$langs->trans(
"Undefined").
' ('.$langs->trans(
"Example").
': login:0,users:0,setup:1,status:1,tickets:1,...)</span>').
"<br>\n";
510 print
'<strong>MAIN_ALLOW_SVG_FILES_AS_IMAGES</strong> = '.getDolGlobalString(
'MAIN_ALLOW_SVG_FILES_AS_IMAGES',
'0').
' <span class="opacitymedium">('.$langs->trans(
"Recommended").
': 0)</span><br>';
513 print
'<strong>MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE</strong> = '.getDolGlobalString(
'MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE',
'<span class="opacitymedium">'.$langs->trans(
"Undefined").
'</span>').
' <span class="opacitymedium">('.$langs->trans(
"Recommended").
': 1)</span><br>';
517 print
'<strong>MAIN_SECURITY_HASH_ALGO</strong> = '.getDolGlobalString(
'MAIN_SECURITY_HASH_ALGO',
'<span class="opacitymedium">'.$langs->trans(
"Undefined").
'</span>').
" ";
518 if (empty($conf->global->MAIN_SECURITY_HASH_ALGO)) {
519 print
'<span class="opacitymedium"> If unset: \'md5\'</span>';
521 if ($conf->global->MAIN_SECURITY_HASH_ALGO !=
'password_hash') {
522 print
'<br><strong>MAIN_SECURITY_SALT</strong> = '.getDolGlobalString(
'MAIN_SECURITY_SALT',
'<span class="opacitymedium">'.$langs->trans(
"Undefined").
'</span>').
'<br>';
524 print
'<span class="opacitymedium">('.$langs->trans(
"Recommended").
': password_hash)</span>';
527 if ($conf->global->MAIN_SECURITY_HASH_ALGO !=
'password_hash') {
528 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>';
529 print
'If you really want to switch, you must:<br>';
530 print
'- Go on home - setup - other and add constant MAIN_SECURITY_HASH_ALGO to value \'password_hash\'<br>';
531 print
'- In same session, WITHOUT LOGGING OUT, go into your admin user record and set a new password<br>';
532 print
'- You can now logout and login with this new password. You must now reset password of all other users.<br>';
537 print
'<strong>MAIN_SECURITY_ANTI_SSRF_SERVER_IP</strong> = '.getDolGlobalString(
'MAIN_SECURITY_ANTI_SSRF_SERVER_IP',
'<span class="opacitymedium">'.$langs->trans(
"Undefined").
'</span> <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>').
"<br>";
540 print
'<strong>MAIN_SECURITY_CSRF_WITH_TOKEN</strong> = '.getDolGlobalString(
'MAIN_SECURITY_CSRF_WITH_TOKEN',
'<span class="opacitymedium">'.$langs->trans(
"Undefined").
'</span>').
' <span class="opacitymedium">('.$langs->trans(
"Recommended").
': '.$langs->trans(
"Undefined").
' '.$langs->trans(
"or").
' 2)</span>'.
"<br>";
547 print
load_fiche_titre($langs->trans(
"OtherSetup").
' ('.$langs->trans(
"Experimental").
')',
'',
'folder');
549 print
'<strong>MAIN_EXEC_USE_POPEN</strong> = ';
550 if (empty($conf->global->MAIN_EXEC_USE_POPEN)) {
551 print
'<span class="opacitymedium">'.$langs->trans(
"Undefined").
'</span>';
553 print $conf->global->MAIN_EXEC_USE_POPEN;
555 if ($execmethod == 1) {
556 print
'<span class="opacitymedium">, "exec" PHP method will be used for shell commands';
557 print
' ('.$langs->trans(
"Recommended").
': '.$langs->trans(
"Undefined").
' '.$langs->trans(
"or").
' 1)';
560 if ($execmethod == 2) {
561 print
'<span class="opacitymedium">, "popen" PHP method will be used for shell commands';
562 print
' ('.$langs->trans(
"Recommended").
': '.$langs->trans(
"Undefined").
' '.$langs->trans(
"or").
' 1)';
568 print
'<strong>MAIN_RESTRICTHTML_ONLY_VALID_HTML</strong> = '.getDolGlobalString(
'MAIN_RESTRICTHTML_ONLY_VALID_HTML',
'<span class="opacitymedium">'.$langs->trans(
"Undefined").
' ('.$langs->trans(
"Recommended").
': 1)</span>').
"<br>";
571 print
'<strong>MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES</strong> = '.getDolGlobalString(
'MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES',
'<span class="opacitymedium">'.$langs->trans(
"Undefined").
' ('.$langs->trans(
"Recommended").
': 1)</span>').
"<br>";
574 print
'<strong>MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL</strong> = '.getDolGlobalString(
'MAIN_SECURITY_CSRF_TOKEN_RENEWAL_ON_EACH_CALL',
'<span class="opacitymedium">'.$langs->trans(
"Undefined").
' ('.$langs->trans(
"Recommended").
': '.$langs->trans(
"Undefined").
' '.$langs->trans(
"or").
' 0)</span>').
"<br>";
577 print
'<strong>MAIN_SECURITY_FORCECSP</strong> = '.getDolGlobalString(
'MAIN_SECURITY_FORCECSP',
'<span class="opacitymedium">'.$langs->trans(
"Undefined").
'</span>').
' <span class="opacitymedium">('.$langs->trans(
"Example").
": \"frame-ancestors 'self'; default-src 'self'; img-src *;\")</span><br>";
580 print
'<strong>MAIN_SECURITY_FORCERP</strong> = '.getDolGlobalString(
'MAIN_SECURITY_FORCERP',
'<span class="opacitymedium">'.$langs->trans(
"Undefined").
'</span>').
' <span class="opacitymedium">('.$langs->trans(
"Recommended").
': '.$langs->trans(
"Undefined").
' '.$langs->trans(
"or").
" \"same-origin\" so browser doesn't send any referrer when going into another web site domain)</span><br>";
583 print
'<strong>WEBSITE_MAIN_SECURITY_FORCECSP</strong> = '.getDolGlobalString(
'WEBSITE_MAIN_SECURITY_FORCECSP',
'<span class="opacitymedium">'.$langs->trans(
"Undefined").
'</span>');
584 print
' <span class="opacitymedium">('.$langs->trans(
"Example").
": \"frame-ancestors 'self'; default-src 'self'; style-src https://cdnjs.cloudflare.com https://fonts.googleapis.com; script-src https://cdn.transifex.com https://www.googletagmanager.com; object-src https://youtube.com; frame-src https://youtube.com; img-src *;\")</span><br>";
587 print
'<strong>WEBSITE_MAIN_SECURITY_FORCERP</strong> = '.getDolGlobalString(
'WEBSITE_MAIN_SECURITY_FORCERP',
'<span class="opacitymedium">'.$langs->trans(
"Undefined").
'</span>').
' <span class="opacitymedium">('.$langs->trans(
"Recommended").
': '.$langs->trans(
"Undefined").
' '.$langs->trans(
"or").
" \"strict-origin-when-cross-origin\")</span><br>";
590 print
'<strong>WEBSITE_MAIN_SECURITY_FORCESTS</strong> = '.getDolGlobalString(
'>WEBSITE_MAIN_SECURITY_FORCESTS',
'<span class="opacitymedium">'.$langs->trans(
"Undefined").
'</span>').
' <span class="opacitymedium">('.$langs->trans(
"Example").
": \"max-age=31536000; includeSubDomains\")</span><br>";
593 print
'<strong>WEBSITE_MAIN_SECURITY_FORCEPP</strong> = '.getDolGlobalString(
'WEBSITE_MAIN_SECURITY_FORCEPP',
'<span class="opacitymedium">'.$langs->trans(
"Undefined").
'</span>').
' <span class="opacitymedium">('.$langs->trans(
"Example").
": \"camera: 'none'; microphone: 'none';\")</span><br>";
601 print
'<span class="opacitymedium">';
602 print
'For a higher security, we also recommend to implement limits and mitigation on number of endpoints per minutes for the following URL'.
"<br>";
606 $urlexamplebase =
'https://github.com/Dolibarr/dolibarr/blob/develop/dev/setup/fail2ban/filter.d/';
607 print
'- Login process (see <a target="_blank" rel="noopener" href="'.$urlexamplebase.
'web-dolibarr-rulesbruteforce.conf">fail2ban example on GitHub</a>)<br>';
608 print
'- '.DOL_URL_ROOT.
'/passwordforgotten.php (see <a target="_blank" rel="noopener" href="'.$urlexamplebase.
'web-dolibarr-rulespassforgotten.conf">fail2ban example on GitHub</a>)<br>';
609 print
'- '.DOL_URL_ROOT.
'/public/* (see <a target="_blank" rel="noopener" href="'.$urlexamplebase.
'web-dolibarr-limitpublic.conf">fail2ban example on GitHub</a>)<br>';
611 $urlexamplebase =
'https://github.com/Dolibarr/dolibarr/blob/develop/dev/setup/apache/';
612 print
'- You can also protect the application using a HTTP Basic authentication layer (see <a target="_blank" rel="noopener" href="'.$urlexamplebase.
'virtualhost">apache2 virtualhost example on GitHub</a>)<br>';
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0, $nbsecondsold=0)
Scan a directory and return a list of files/directories.
version_php()
Return PHP version.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_getwebuser($mode)
Return user/group account of web server.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.