26require
'../../main.inc.php';
27require_once DOL_DOCUMENT_ROOT.
'/core/lib/memory.lib.php';
28require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
30require_once DOL_DOCUMENT_ROOT.
'/core/lib/geturl.lib.php';
31require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/lib/security2.lib.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/class/events.class.php';
49$langs->loadLangs(array(
"install",
"other",
"admin",
"errors"));
55if (
GETPOST(
'action',
'aZ09') ==
'donothing') {
68llxHeader(
'',
'',
'',
'', 0, 0,
'',
'',
'',
'mod-admin page-system_security');
72print
'<span class="opacitymedium">'.$langs->trans(
"YouMayFindSecurityAdviceHere",
'hhttps://wiki.dolibarr.org/index.php/Security_information').
'</span>';
73print
' ';
74print
'<a href="'.$_SERVER[
"PHP_SELF"].
'">';
75print
img_picto($langs->trans(
"Reload"),
'refresh').
' ';
76print $langs->trans(
"Reload");
88print
'<div class="divsection wordbreak">';
92print
"<strong>PHP</strong>: ".$langs->trans(
"Version").
": ".$phpversion;
93if (function_exists(
'php_ini_loaded_file')) {
94 $inipath = php_ini_loaded_file();
95 print
" - <strong>INI</strong>: ".$inipath;
100print
"<br><strong>Web server - ".$langs->trans(
"Version").
"</strong>: ".$_SERVER[
"SERVER_SOFTWARE"].
"<br>\n";
101print
'<strong>'.$langs->trans(
"DataRootServer").
"</strong>: ".DOL_DATA_ROOT.
"<br>\n";
105if ($labeluser && $labelgroup) {
106 print
'<strong>'.$langs->trans(
"WebUserGroup").
" (env vars)</strong> : ".$labeluser.
':'.$labelgroup;
107 if (function_exists(
'posix_geteuid') && function_exists(
'posix_getpwuid')) {
108 $arrayofinfoofuser = posix_getpwuid(posix_geteuid());
109 print
' <span class="opacitymedium">(POSIX '.$arrayofinfoofuser[
'name'].
':'.$arrayofinfoofuser[
'gecos'].
':'.$arrayofinfoofuser[
'dir'].
':'.$arrayofinfoofuser[
'shell'].
')</span><br>'.
"\n";
113if (function_exists(
'exec')) {
116 exec(
'id', $arrayout, $varout);
117 if (empty($varout)) {
118 print
'<strong>'.$langs->trans(
"WebUserGroup").
" (real, 'id' command)</strong> : ".implode(
',', $arrayout).
"<br>\n";
123print (ini_get(
'session.use_strict_mode') ?
img_picto(
'',
'tick',
'class="pictofixedwidth"') :
img_warning(
'',
'',
'pictofixedwidth nopaddingleft')).
"<strong>PHP session.use_strict_mode</strong> = ".(ini_get(
'session.use_strict_mode') ? ini_get(
'session.use_strict_mode') :
yn(0)).
' <span class="opacitymedium">('.$langs->trans(
"RecommendedValueIs",
'1').
")</span><br>\n";
124print (ini_get(
'session.use_only_cookies') ?
img_picto(
'',
'tick',
'class="pictofixedwidth"') :
img_warning(
'',
'',
'pictofixedwidth nopaddingleft')).
"<strong>PHP session.use_only_cookies</strong> = ".(ini_get(
'session.use_only_cookies') ? ini_get(
'session.use_only_cookies') :
yn(0)).
' <span class="opacitymedium">('.$langs->trans(
"RecommendedValueIs",
'1').
")</span><br>\n";
125print (ini_get(
'session.cookie_httponly') ?
img_picto(
'',
'tick',
'class="pictofixedwidth"') :
img_warning(
'',
'',
'pictofixedwidth nopaddingleft')).
"<strong>PHP session.cookie_httponly</strong> = ".(ini_get(
'session.cookie_httponly') ? ini_get(
'session.cookie_httponly') :
'').
' <span class="opacitymedium">('.$langs->trans(
"RecommendedValueIs",
'1').
")</span><br>\n";
126print (ini_get(
'session.cookie_samesite') ?
img_picto(
'',
'tick',
'class="pictofixedwidth"') :
img_warning(
'',
'',
'pictofixedwidth nopaddingleft')).
"<strong>PHP session.cookie_samesite</strong> = ".(ini_get(
'session.cookie_samesite') ? ini_get(
'session.cookie_samesite') :
'None');
127if (!ini_get(
'session.cookie_samesite') || ini_get(
'session.cookie_samesite') ==
'Lax') {
128 print
' <span class="opacitymedium">('.$langs->trans(
"RecommendedValueIs",
'Lax').
")</span>";
129} elseif (ini_get(
'session.cookie_samesite') ==
'Strict') {
130 print
' '.img_warning().
' <span class="opacitymedium">'.$langs->trans(
"WarningPaypalPaymentNotCompatibleWithStrict").
"</span>";
134print (ini_get(
'open_basedir') ?
img_picto(
'',
'tick',
'class="pictofixedwidth"') :
img_warning(
'',
'',
'pictofixedwidth nopaddingleft')).
"<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";
136print ((empty(ini_get(
'short_open_tag')) || ini_get(
'short_open_tag') ==
'Off') ?
img_picto(
'',
'tick',
'class="pictofixedwidth"') :
img_warning(
'',
'',
'pictofixedwidth nopaddingleft')).
"<strong>PHP short_open_tag</strong> = ".((empty(ini_get(
'short_open_tag')) || ini_get(
'short_open_tag') ==
'Off') ?
yn(0) :
yn(1)).
' <span class="opacitymedium">('.$langs->trans(
"RecommendedValueIs", $langs->transnoentitiesnoconv(
"No")).
')</span>'.
"<br>\n";
138print (ini_get(
'allow_url_fopen') ?
img_picto($langs->trans(
"YouShouldSetThisToOff"),
'warning',
'class="pictofixedwidth nopaddingleft"') :
img_picto(
'',
'tick',
'class="pictofixedwidth"')).
"<strong>PHP allow_url_fopen</strong> = ".(ini_get(
'allow_url_fopen') ? ini_get(
'allow_url_fopen') :
yn(0)).
' <span class="opacitymedium">('.$langs->trans(
"RecommendedValueIs", $langs->transnoentitiesnoconv(
"No")).
", except if Yes is required by some external modules)</span><br>\n";
140print (ini_get(
'allow_url_include') ?
img_picto($langs->trans(
"YouShouldSetThisToOff"),
'warning',
'class="pictofixedwidth nopaddingleft"') :
img_picto(
'',
'tick',
'class="pictofixedwidth"')).
"<strong>PHP allow_url_include</strong> = ".(ini_get(
'allow_url_include') ? ini_get(
'allow_url_include') :
yn(0)).
' <span class="opacitymedium">('.$langs->trans(
"RecommendedValueIs", $langs->transnoentitiesnoconv(
"No")).
")</span><br>\n";
144 print
"<strong>PHP auto_prepend_file</strong> = ".(ini_get(
'auto_prepend_file') ? ini_get(
'auto_prepend_file') :
'').
"</span><br>\n";
146 print
"<strong>PHP sendmail_path</strong> = ".(ini_get(
'sendmail_path') ? ini_get(
'sendmail_path') :
'').
"</span><br>\n";
150print
"<strong>PHP disable_functions</strong>: ";
151$arrayoffunctionsdisabled = explode(
',', ini_get(
'disable_functions'));
152$arrayoffunctionstodisable = explode(
',',
'dl,apache_note,apache_setenv,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,show_source,virtual');
155if ($execmethod == 1) {
156 $arrayoffunctionstodisable2 = explode(
',',
'passthru,shell_exec,system,proc_open,popen');
157 $functiontokeep =
'exec';
159 $arrayoffunctionstodisable2 = explode(
',',
'exec,passthru,shell_exec,system,proc_open');
160 $functiontokeep =
'popen';
163foreach ($arrayoffunctionsdisabled as $functionkey) {
167 print
'<span class="opacitymedium">'.$functionkey.
'</span>';
173foreach ($arrayoffunctionstodisable as $functiontodisable) {
174 if (\function_exists($functiontodisable)) {
176 $todisabletext .=
', ';
178 $todisabletext .=
' <span class="opacitymedium">'.$functiontodisable.
'</span>';
183 print
img_picto(
'',
'warning',
'class="pictofixedwidth nopaddingleft"').$langs->trans(
"YouShouldDisablePHPFunctions").
': '.$todisabletext;
188foreach ($arrayoffunctionstodisable2 as $functiontodisable) {
189 if (\function_exists($functiontodisable)) {
191 $todisabletext .=
', ';
193 $todisabletext .=
' <span class="opacitymedium">'.$functiontodisable.
'</span>';
198 print
img_picto(
'',
'warning',
'class="pictofixedwidth nopaddingleft"').$langs->trans(
"IfCLINotRequiredYouShouldDisablePHPFunctions").
': '.$todisabletext;
201if (!\function_exists($functiontokeep)) {
202 print
img_picto($langs->trans(
"PHPFunctionsRequiredForCLI"),
'warning',
'class="pictofixedwidth"');
204 print
img_picto(
'',
'tick',
'class="pictofixedwidth"');
206print $langs->trans(
"PHPFunctionsRequiredForCLI").
': ';
207print
'<span class="opacitymedium">'.$functiontokeep.
'</span>';
213$loadedExtensions = array_map(
'strtolower', get_loaded_extensions(
false));
214$test = !in_array(
'json', $loadedExtensions);
215if ($test || function_exists(
'dol_json_decode')) {
216 print
img_picto(
'',
'error',
'class="pictofixedwidth nopaddingleft"');
218 print
img_picto(
'',
'tick',
'class="pictofixedwidth"');
220print
'<strong>JSON</strong>: ';
221if ($test || function_exists(
'dol_json_decode')) {
222 print $langs->trans(
"NotInstalled").
' - '.$langs->trans(
"VulnerableToRCEAttack");
224 print $langs->trans(
"Available").
' <span class="opacitymedium">(PHP native so not emulated, safe)</span>';
229$test = !function_exists(
'xdebug_is_enabled') && !extension_loaded(
'xdebug');
231 print
img_picto(
'',
'tick',
'class="pictofixedwidth"');
233 print
img_picto(
'',
'warning',
'class="pictofixedwidth nopaddingleft"');
235print
'<strong>XDebug</strong>: ';
237 print $langs->trans(
"NotInstalled").
' - '.$langs->trans(
"NotRiskOfLeakWithThis");
239 print $langs->trans(
"ModuleActivatedMayExposeInformation", $langs->transnoentities(
"XDebug"));
240 print
' - '.$langs->trans(
"MoreInformation").
' <a href="'.DOL_URL_ROOT.
'/admin/system/xdebug.php">XDebug admin page</a>';
251print
load_fiche_titre($langs->trans(
"OSSetup").
' - '.$langs->trans(
"PermissionsOnFiles"),
'',
'folder');
253print
'<div class="divsection wordbreak">';
255print
'<strong>'.$langs->trans(
"PermissionsOnFilesInWebRoot").
'</strong>: ';
256$arrayoffilesinroot =
dol_dir_list(DOL_DOCUMENT_ROOT,
'all', 1,
'', array(
'\/custom'),
'name', SORT_ASC, 4, 1,
'', 1);
257$fileswithwritepermission = array();
258foreach ($arrayoffilesinroot as $fileinroot) {
260 if (isset($fileinroot[
'perm']) && ($fileinroot[
'perm'] & 0222)) {
261 $fileswithwritepermission[] = $fileinroot[
'relativename'];
264if (empty($fileswithwritepermission)) {
265 print
img_picto(
'',
'tick').
' '.$langs->trans(
"NoWritableFilesFoundIntoRootDir");
267 print
img_warning().
' '.$langs->trans(
"SomeFilesOrDirInRootAreWritable");
268 print
' - <span class="classlink cursorpointer" onclick="javascript: console.log(\'Toggle examples\'); jQuery(\'#examplewritablefiles\').toggle();">'.$langs->trans(
"Examples").
'</span>';
269 print
'<span id="examplewritablefiles" class="hideobject"><br>'.$langs->trans(
"Example").
': ';
271 foreach ($fileswithwritepermission as $filewithwritepermission) {
275 print
'<span class="opacitymedium">'.$filewithwritepermission.
'</span>';
287print
'<strong>'.$langs->trans(
"PermissionsOnFile", $conffile).
'</strong>: ';
288$perms = fileperms($dolibarr_main_document_root.
'/'.$conffile);
290 if (($perms & 0x0004) || ($perms & 0x0002)) {
291 print
img_warning().
' '.$langs->trans(
"ConfFileIsReadableOrWritableByAnyUsers");
295 print
' '.$langs->trans(
"User").
': '.$labeluser.
':'.$labelgroup;
296 if (function_exists(
'posix_geteuid') && function_exists(
'posix_getpwuid')) {
297 $arrayofinfoofuser = posix_getpwuid(posix_geteuid());
298 print
' <span class="opacitymedium">(POSIX '.$arrayofinfoofuser[
'name'].
':'.$arrayofinfoofuser[
'gecos'].
':'.$arrayofinfoofuser[
'dir'].
':'.$arrayofinfoofuser[
'shell'].
')</span>';
304 print
img_warning().
' '.$langs->trans(
"FailedToReadFile", $conffile);
309$installlock = DOL_DATA_ROOT.
'/install.lock';
310$upgradeunlock = DOL_DATA_ROOT.
'/upgrade.unlock';
311$installmoduleslock = DOL_DATA_ROOT.
'/installmodules.lock';
314$test = file_exists($installlock);
315print
'<strong>'.$langs->trans(
"DolibarrSetup").
'</strong>: ';
317 if (file_exists($upgradeunlock)) {
318 print
img_picto(
'',
'tick').
' '.$langs->trans(
"InstallLockedBy", $installlock);
320 print
img_picto(
'',
'tick').
' '.$langs->trans(
"InstallAndUpgradeLockedBy", $installlock);
323 print
img_warning().
' '.$langs->trans(
"WarningLockFileDoesNotExists", DOL_DATA_ROOT);
330if (file_exists($installlock)) {
331 if (file_exists($upgradeunlock)) {
332 print
'<strong>'.$langs->trans(
"DolibarrUpgrade").
'</strong>: ';
333 print
img_warning().
' '.$langs->trans(
"WarningUpgradeHasBeenUnlocked", $upgradeunlock);
340$test = file_exists($installmoduleslock);
341print
'<strong>'.$langs->trans(
"DolibarrAddonInstall").
'</strong>: ';
343 print
img_picto(
'',
'tick').
' '.$langs->trans(
"InstallAndUpgradeLockedBy", $installmoduleslock);
345 print $langs->trans(
"InstallOfAddonIsNotBlocked", DOL_DATA_ROOT);
356print
load_fiche_titre($langs->trans(
"ConfigurationFile").
' ('.$conffile.
')',
'',
'folder');
358print
'<div class="divsection wordbreak">';
359print
'<strong>$dolibarr_main_prod</strong>: '.($dolibarr_main_prod ? $dolibarr_main_prod :
'0');
360if (empty($dolibarr_main_prod)) {
361 print
' '.img_picto(
'',
'warning').
' '.$langs->trans(
"IfYouAreOnAProductionSetThis", 1);
365print
'<strong>$dolibarr_nocsrfcheck</strong>: '.(empty($dolibarr_nocsrfcheck) ?
'0' : $dolibarr_nocsrfcheck);
366if (!empty($dolibarr_nocsrfcheck)) {
367 print
' '.img_picto(
'',
'error').
' '.$langs->trans(
"IfYouAreOnAProductionSetThis", 0);
369 print
' <span class="opacitymedium">('.$langs->trans(
"Recommended").
': 0)</span>';
373print
'<strong>$dolibarr_main_restrict_ip</strong>: ';
374if (empty($dolibarr_main_restrict_ip)) {
375 print $langs->trans(
"None");
376 print
' <span class="opacitymedium">('.$langs->trans(
"RecommendedValueIs", $langs->transnoentitiesnoconv(
"StaticIPsOfUsers")).
')</span>';
378 print $dolibarr_main_restrict_ip;
382print
'<strong>$dolibarr_main_restrict_os_commands</strong>: ';
383if (empty($dolibarr_main_restrict_os_commands)) {
384 print $langs->trans(
"None");
386 print $dolibarr_main_restrict_os_commands;
388print
' <span class="opacitymedium">('.$langs->trans(
"RecommendedValueIs",
'mysqldump, mysql, pg_dump, pg_restore, mariadb, mariadb-dump, clamdscan').
')</span>';
392 print
'<strong>$dolibarr_main_db_pass</strong>: ';
393 if (!empty($dolibarr_main_db_pass) && empty($dolibarr_main_db_encrypted_pass)) {
394 print
img_picto(
'',
'warning').
' '.$langs->trans(
"DatabasePasswordNotObfuscated").
' <span class="opacitymedium">('.$langs->trans(
"Recommended").
': '.$langs->trans(
"SetOptionTo", $langs->transnoentitiesnoconv(
"MainDbPasswordFileConfEncrypted"),
yn(1)).
')</span>';
397 print
img_picto(
'',
'tick').
' '.$langs->trans(
"DatabasePasswordObfuscated");
403print
'<strong>$dolibarr_main_stream_to_disable</strong>: ';
405'@phan-var-force string[] $arrayofstreamtodisable';
406if (empty($dolibarr_main_stream_to_disable)) {
407 print
'<span class="opacitymedium">'.$langs->trans(
"Undefined").
' = '.implode(
', ', $arrayofstreamtodisable).
'</span>';
409 print implode(
', ', $dolibarr_main_stream_to_disable);
411print
'<span class="bold"> -> Current PHP streams allowed = </span>';
412$arrayofstreams = stream_get_wrappers();
413if (!empty($arrayofstreams)) {
414 sort($arrayofstreams);
415 print
'<span class="wordbreak">'.implode(
',', $arrayofstreams).
'</span>';
416 print
' <span class="opacitymedium">('.$langs->trans(
"Recommended").
': '.$langs->trans(
"TryToKeepOnly",
'file,http,https,php,zip').
')</span>'.
"\n";
445print
load_fiche_titre($langs->trans(
"Menu").
' '.$langs->trans(
"SecuritySetup"),
'',
'folder');
447print
'<div class="divsection wordbreak">';
449print
'<strong>'.$langs->trans(
"UseCaptchaCode").
' - Login</strong>: ';
455print
'<strong>'.$langs->trans(
"UseCaptchaCode").
' - Ticket</strong>: ';
461print
'<strong>'.$langs->trans(
"UseCaptchaCode").
' - Thirdparty public contact form</strong>: ';
467print
'<strong>'.$langs->trans(
"UseCaptchaCode").
' - Membership subscription</strong>: ';
473$sessiontimeout = ini_get(
"session.gc_maxlifetime");
475 $conf->global->MAIN_SESSION_TIMEOUT = $sessiontimeout;
477print
'<strong>'.$langs->trans(
"SessionTimeOut").
'</strong>';
478if (!ini_get(
"session.gc_probability")) {
479 print $form->textwithpicto(
'', $langs->trans(
"SessionsPurgedByExternalSystem", ini_get(
"session.gc_maxlifetime")));
481 print $form->textwithpicto(
'', $langs->trans(
"SessionExplanation", ini_get(
"session.gc_probability"), ini_get(
"session.gc_divisor"), ini_get(
"session.gc_maxlifetime")));
483print
': '.getDolGlobalInt(
'MAIN_SESSION_TIMEOUT').
' '.strtolower($langs->trans(
"Seconds"));
486print
'<strong>'.$langs->trans(
"MaxNumberOfImagesInGetPost").
'</strong>: ';
487print(
getDolGlobalInt(
'MAIN_SECURITY_MAX_IMG_IN_HTML_CONTENT') ?
img_picto(
'',
'tick').
' ' :
'').
getDolGlobalInt(
'MAIN_SECURITY_MAX_IMG_IN_HTML_CONTENT').
' '.strtolower($langs->trans(
"Images"));
490print
'<strong>'.$langs->trans(
"MaxNumberOfPostOnPublicPagesByIP").
'</strong>: ';
491print(
getDolGlobalInt(
'MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS', 200) ?
img_picto(
'',
'tick').
' ' :
'').
getDolGlobalInt(
'MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS', 200).
' '.strtolower($langs->trans(
"Posts"));
494print
'<strong>'.$langs->trans(
"MaxNumberOfAttachementOnForms").
'</strong>: ';
495print(
getDolGlobalInt(
'MAIN_SECURITY_MAX_ATTACHMENT_ON_FORMS', 10) ?
img_picto(
'',
'tick').
' ' :
'').
getDolGlobalInt(
"MAIN_SECURITY_MAX_ATTACHMENT_ON_FORMS", 10).
' '.strtolower($langs->trans(
"Files"));
501print
'<strong>'.$langs->trans(
"DoNotStoreClearPassword").
'</strong>: ';
505 print
' <span class="opacitymedium">('.$langs->trans(
"Recommended").
' '.
yn(1).
')</span>';
514print
'<strong>'.$langs->trans(
"UMask").
'</strong>: ';
515if (! in_array($umask, array(
'600',
'660',
'0600',
'0660'))) {
519if (! in_array($umask, array(
'600',
'660',
'0600',
'0660'))) {
520 print
' <span class="opacitymedium">('.$langs->trans(
"Recommended").
': 0600 | 0660)</span>';
558print
'<strong>'.$langs->trans(
"AntivirusEnabledOnUpload").
'</strong>: ';
562 print
' - <span class="opacitymedium">'.$langs->trans(
"Recommended").
': '.$langs->trans(
"DefinedAPathForAntivirusCommandIntoSetup", $langs->transnoentitiesnoconv(
"Home").
" - ".$langs->transnoentitiesnoconv(
"Setup").
" - ".$langs->transnoentitiesnoconv(
"Security")).
'</span>';
565 if (defined(
'MAIN_ANTIVIRUS_COMMAND') && !defined(
'MAIN_ANTIVIRUS_BYPASS_COMMAND_AND_PARAM')) {
566 print
' - <span class="opacitymedium">'.$langs->trans(
"ValueIsForcedBySystem").
'</span>';
574print
'<strong>'.$langs->trans(
"UploadExtensionRestriction").
'</strong>: ';
575print implode(
', ', explode(
',',
getDolGlobalString(
'MAIN_FILE_EXTENSION_UPLOAD_RESTRICTION')));
576print
' <span class="opacitymedium">('.$langs->trans(
"Recommended").
': '.implode(
', ',
getExecutableContent()).
')</span>';
581print
'<strong>'.$langs->trans(
"MAIN_SECURITY_MAXFILESIZE_DOWNLOADED").
'</strong> = '.
getDolGlobalString(
'MAIN_SECURITY_MAXFILESIZE_DOWNLOADED',
'<span class="opacitymedium">'.$langs->trans(
"Undefined").
' ('.$langs->trans(
"Recommended").
': < 100000)</span>').
"<br>";
586$securityevent =
new Events($db);
587$eventstolog = $securityevent->eventstolog;
589print
'<strong>'.$langs->trans(
"AuditedSecurityEvents").
'</strong>: ';
591if (!empty($eventstolog) && is_array($eventstolog)) {
594 foreach ($eventstolog as $key => $arr) {
596 $key =
'MAIN_LOGEVENTS_'.$arr[
'id'];
602 $out .=
'<span class="opacitymedium">'.$key.
'</span>';
611 print
img_warning().
' '.$langs->trans(
"NoSecurityEventsAreAduited", $langs->transnoentities(
"Home").
' - '.$langs->transnoentities(
"Setup").
' - '.$langs->transnoentities(
"Security").
' - '.$langs->transnoentities(
"Audit")).
'<br>';
613 $s = $langs->trans(
"SeeSetupPage",
' {s1}'.$langs->transnoentities(
"Home").
' - '.$langs->transnoentities(
"Setup").
' - '.$langs->transnoentities(
"Security").
' - '.$langs->transnoentities(
"Audit").
'{s2}');
614 print
' - '.str_replace(
'{s2}',
'</a>', str_replace(
'{s1}',
'<a href="'.DOL_URL_ROOT.
'/admin/events.php" target="_blank">'.
img_picto(
'',
'url',
'class="pictofixedwidth"'), $s));
628print
'<div class="divsection wordbreak">';
631print
'<strong>'.$langs->trans(
"Syslog").
'</strong>: ';
632$test = isModEnabled(
'syslog');
634 print
img_picto(
'',
'tick').
' '.$langs->trans(
"NotInstalled").
' - '.$langs->trans(
"NotRiskOfLeakWithThis");
637 print
img_picto(
'',
'warning').
' '.$langs->trans(
"ModuleActivatedWithTooHighLogLevel", $langs->transnoentities(
"Syslog"));
639 print
img_picto(
'',
'tick').
' '.$langs->trans(
"ModuleSyslogActivatedButLevelNotTooVerbose", $langs->transnoentities(
"Syslog"),
getDolGlobalInt(
'SYSLOG_LEVEL'));
648print
'<strong>'.$langs->trans(
"DebugBar").
'</strong>: ';
649$test = isModEnabled(
'debugbar');
651 print
img_picto(
'',
'tick').
' '.$langs->trans(
"NotInstalled").
' - '.$langs->trans(
"NotRiskOfLeakWithThis");
653 print
img_picto(
'',
'error').
' '.$langs->trans(
"ModuleActivatedDoNotUseInProduction", $langs->transnoentities(
"DebugBar"));
659$test = isModEnabled(
'stripe');
663 print
'<strong>'.$langs->trans(
"Stripe").
'</strong>: ';
665 print
img_picto(
'',
'error').
' '.$langs->trans(
"OptionXShouldBeEnabledInModuleY", $langs->transnoentities(
"SecurityTokenIsUnique"), $langs->transnoentities(
"Stripe"));
667 print
img_picto(
'',
'tick').
' '.$langs->trans(
"OptionXIsCorrectlyEnabledInModuleY", $langs->transnoentities(
"SecurityTokenIsUnique"), $langs->transnoentities(
"Stripe"));
671 $test = isModEnabled(
'paypal');
675 print
'<strong>'.$langs->trans(
"Paypal").
'</strong>: ';
677 print
img_picto(
'',
'error').
' '.$langs->trans(
"OptionXShouldBeEnabledInModuleY", $langs->transnoentities(
"SecurityTokenIsUnique"), $langs->transnoentities(
"Paypal"));
679 print
img_picto(
'',
'tick').
' '.$langs->trans(
"OptionXIsCorrectlyEnabledInModuleY", $langs->transnoentities(
"SecurityTokenIsUnique"), $langs->transnoentities(
"Paypal"));
694print
'<div class="divsection wordbreak">';
696if (!isModEnabled(
'api') && !isModEnabled(
'webservices')) {
697 print $langs->trans(
"APIsAreNotEnabled");
699 if (isModEnabled(
'webservices')) {
700 print
img_picto(
'',
'warning').
' '.$langs->trans(
'YouEnableDeprecatedWSAPIsUseRESTAPIsInstead').
"<br>\n";
703 if (isModEnabled(
'api')) {
704 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";
708 print
'<strong>API_DISABLE_LOGIN_API</strong> = '.getDolGlobalString(
'API_DISABLE_LOGIN_API',
'0').
' <span class="opacitymedium">('.$langs->trans(
"Recommended").
': 1)</span><br>';
724print
'<div class="divsection wordbreak">';
726print
'<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>';
729print
'<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>';
732print
'<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>";
735print
'<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>";
748print
'<div class="divsection wordbreak">';
751print
'<strong>'.$langs->trans(
"AlgorithmFor", $langs->transnoentitiesnoconv(
"Passwords"));
752print $form->textwithpicto(
'',
'non reversible encryption, defined into MAIN_SECURITY_HASH_ALGO');
753print
'</strong> = '.getDolGlobalString(
'MAIN_SECURITY_HASH_ALGO',
'<span class="opacitymedium">'.$langs->trans(
"Undefined").
'</span>').
" ";
755 print
'<span class="opacitymedium"> (If unset: \'md5\')</span>';
758 print
'<br><strong>MAIN_SECURITY_SALT</strong> = '.getDolGlobalString(
'MAIN_SECURITY_SALT',
'<span class="opacitymedium">'.$langs->trans(
"Undefined").
'</span>').
'<br>';
760 print
'<span class="opacitymedium">('.$langs->trans(
"Recommended").
': password_hash)</span>';
764 print
'<div class="info">The recommended 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>';
765 print
'If you really want to switch, you must:<br>';
766 print
'- Go on home - setup - other and add constant MAIN_SECURITY_HASH_ALGO to value \'password_hash\'<br>';
767 print
'- In same session, WITHOUT LOGGING OUT, go into your admin user record and set a new password<br>';
768 print
'- You can now logout and login with this new password. You must now reset password of all other users.<br>';
774$exampletodecrypt =
GETPOST(
'exampletodecrypt',
'password');
776print
'<strong>'.$langs->trans(
"AlgorithmFor", $langs->transnoentitiesnoconv(
"SensitiveData"));
777print $form->textwithpicto(
'',
'reversible encryption done with dolEncrypt/dolDecrypt');
778print
'</strong> = '.constant(
'MAIN_SECURITY_REVERSIBLE_ALGO').
' with key defined into conf.php file in $dolibarr_main_dolcrypt_key (or $dolibarr_main_instance_unique_id)<br>';
779print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
780print
'<input type="hidden" name="action" value="doldecrypt">';
781print
'<input type="hidden" name="token" value="'.newToken().
'">';
782print
'<input type="hidden" name="page_y" value="">';
783print $langs->trans(
"ToolToDecryptAString").
': ';
784print
'<input type="text" class="minwidth300" name="exampletodecrypt" placeholder="dolcrypt:ALGOXXXX:ABCDFEF1234" value="'.$exampletodecrypt.
'">';
785print
'<input type="submit" class="reposition button small smallpaddingimp" name="submit" value="'.$langs->transnoentitiesnoconv(
"Decrypt").
'">';
786if ($action ==
'doldecrypt' && $user->admin && $exampletodecrypt) {
801if (isModEnabled(
'website')) {
803 print
'<div class="divsection wordbreak">';
805 $sql =
"SELECT w.rowid as id, w.ref";
806 $sql .=
" FROM ".MAIN_DB_PREFIX.
"website as w";
807 $sql .=
" WHERE w.entity = ".((int)
$conf->entity);
808 $sql .=
" AND w.status = 1";
810 $resql = $db->query($sql);
812 $num_rows = $db->num_rows($resql);
815 while ($obj = $db->fetch_object($resql)) {
816 print
"<strong>".$langs->trans(
"RefWebsite").
": ".$obj->ref.
"</strong>";
818 print
'<strong>WEBSITE_'.$obj->id.
'_SECURITY_FORCERP</strong> = '.
getDolGlobalString(
'WEBSITE_'.$obj->id.
'_SECURITY_FORCERP',
'<span class="opacitymedium">'.$langs->trans(
"Undefined").
'</span>');
819 print
' <span class="opacitymedium">('.$langs->trans(
"Example").
': "';
820 $examplecsprule =
"default-src 'self' 'unsafe-inline' matomo.".getDomainFromURL($_SERVER[
"SERVER_NAME"], 1).
" *.transifex.net *.transifex.com *.cloudflare.com *.cloudflareinsights.com *.google-analytics.com *.googletagmanager.com *.google.com *.gstatic.com *.googleapis.com *.googleadservices.com *.ads-twitter.com *.doubleclick.net; frame-ancestors 'self'; object-src *.youtube.com; frame-src 'self' *.twitter.com *.facebook.com *.youtube.com; img-src * data:;";
821 print $examplecsprule;
822 print
'")</span><br>';
824 print
'<strong>WEBSITE_'.$obj->id.
'_SECURITY_FORCECSP</strong> = '.
getDolGlobalString(
'WEBSITE_'.$obj->id.
'_SECURITY_FORCECSP',
'<span class="opacitymedium">'.$langs->trans(
"Undefined").
'</span>');
825 print
' <span class="opacitymedium">('.$langs->trans(
"Example").
': "';
826 $examplecsprule =
"default-src 'self' 'unsafe-inline' matomo.".getDomainFromURL($_SERVER[
"SERVER_NAME"], 1).
" *.transifex.net *.transifex.com *.cloudflare.com *.cloudflareinsights.com *.google-analytics.com *.googletagmanager.com *.google.com *.gstatic.com *.googleapis.com *.googleadservices.com *.ads-twitter.com *.doubleclick.net; frame-ancestors 'self'; object-src *.youtube.com; frame-src 'self' *.twitter.com *.facebook.com *.youtube.com; img-src * data:;";
827 print $examplecsprule;
828 print
'")</span><br>';
830 print
'<strong>WEBSITE_'.$obj->id.
'_SECURITY_FORCERP</strong> = '.
getDolGlobalString(
'WEBSITE_'.$obj->id.
'_SECURITY_FORCERP',
'<span class="opacitymedium">'.$langs->trans(
"Undefined").
'</span>').
' <span class="opacitymedium">('.$langs->trans(
"Recommended").
': '.$langs->trans(
"Undefined").
'="strict-origin-when-cross-origin" '.$langs->trans(
"or").
' "same-origin"=more secured)</span><br>';
832 print
'<strong>WEBSITE_'.$obj->id.
'_SECURITY_FORCESTS</strong> = '.
getDolGlobalString(
'WEBSITE_'.$obj->id.
'_SECURITY_FORCESTS',
'<span class="opacitymedium">'.$langs->trans(
"Undefined").
'</span>').
' <span class="opacitymedium">('.$langs->trans(
"Example").
": \"max-age=31536000; includeSubDomains\")</span><br>";
834 print
'<strong>WEBSITE_'.$obj->id.
'_SECURITY_FORCEPP</strong> = '.
getDolGlobalString(
'WEBSITE_'.$obj->id.
'_SECURITY_FORCEPP',
'<span class="opacitymedium">'.$langs->trans(
"Undefined").
'</span>').
' <span class="opacitymedium">('.$langs->trans(
"Example").
": \"camera=(), microphone=(), geolocation=*\")</span><br>";
836 if ($i != $num_rows) {
841 print
'<span class="opacity">'.$langs->trans(
"NoWebsite").
'</span>';
855print
load_fiche_titre($langs->trans(
"OtherSetup").
' ('.$langs->trans(
"Experimental").
')',
'',
'folder');
857print
'<div class="divsection wordbreak">';
858print
'<strong>MAIN_EXEC_USE_POPEN</strong> = ';
860 print
'<span class="opacitymedium">'.$langs->trans(
"Undefined").
'</span>';
864if ($execmethod == 1) {
865 print
'<span class="opacitymedium"> "exec" PHP method will be used for shell commands';
866 print
' ('.$langs->trans(
"Recommended").
': '.$langs->trans(
"Undefined").
' '.$langs->trans(
"or").
' 1)';
869if ($execmethod == 2) {
870 print
'<span class="opacitymedium"> "popen" PHP method will be used for shell commands';
871 print
' ('.$langs->trans(
"Recommended").
': '.$langs->trans(
"Undefined").
' '.$langs->trans(
"or").
' 1)';
877print
'<strong>MAIN_RESTRICTHTML_ONLY_VALID_HTML</strong> = '.(getDolGlobalString(
'MAIN_RESTRICTHTML_ONLY_VALID_HTML') ?
'1' :
'<span class="opacitymedium">'.$langs->trans(
"Undefined").
'</span>');
878print
' <span class="opacitymedium">('.$langs->trans(
"Recommended").
": 1 - does not work on HTML5 with some old libxml libs)</span>";
881$savMAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES =
getDolGlobalString(
'MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES');
882$savMAIN_RESTRICTHTML_ONLY_VALID_HTML =
getDolGlobalString(
'MAIN_RESTRICTHTML_ONLY_VALID_HTML');
883$savMAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY =
getDolGlobalString(
'MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY');
884$conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = 0;
885$conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML = 1;
886$conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY = 0;
887$result =
dol_htmlwithnojs(
'<img onerror<=alert(document.domain)> src=>0xbeefed');
888$conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = $savMAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES;
889$conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML = $savMAIN_RESTRICTHTML_ONLY_VALID_HTML;
890$conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY = $savMAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY;
892if ($result ==
'InvalidHTMLStringCantBeCleaned') {
893 print
' - '.img_warning().
' Your libxml seems to old to work correctly with this option. Disable it !';
895 print
' - Test of compatibility with this option seems ok';
901print
'<strong>MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY</strong> = '.(getDolGlobalString(
'MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY') ?
'1' :
'<span class="opacitymedium">'.$langs->trans(
"Undefined").
'</span>');
902print
' <span class="opacitymedium">('.$langs->trans(
"Recommended").
': 1)</span> - Module "php-tidy" must be enabled (currently: '.((extension_loaded(
'tidy') && class_exists(
"tidy")) ?
'Enabled' :
img_picto(
'',
'warning').
' Not available').
")";
903if (extension_loaded(
'tidy') && class_exists(
"tidy")) {
905 $savMAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES =
getDolGlobalString(
'MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES');
906 $savMAIN_RESTRICTHTML_ONLY_VALID_HTML =
getDolGlobalString(
'MAIN_RESTRICTHTML_ONLY_VALID_HTML');
907 $savMAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY =
getDolGlobalString(
'MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY');
908 $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = 0;
909 $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML = 0;
910 $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY = 1;
911 $result =
dol_htmlwithnojs(
'<img onerror<=alert(document.domain)> src=>0xbeefed');
912 $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = $savMAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES;
913 $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML = $savMAIN_RESTRICTHTML_ONLY_VALID_HTML;
914 $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY = $savMAIN_RESTRICTHTML_ONLY_VALID_HTML_TIDY;
916 if ($result ==
'InvalidHTMLStringCantBeCleaned') {
917 print
' - '.img_warning().
' Your libxml seems to old to work correctly with this option. Disable it !';
919 print
' - Test of compatibility with this option seems ok';
926print
'<strong>MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES</strong> = '.(getDolGlobalString(
'MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES') ?
'1' :
'<span class="opacitymedium">'.$langs->trans(
"Undefined").
'</span>');
927print
' <span class="opacitymedium">('.$langs->trans(
"Recommended").
": 1 - does not work on HTML5 with some old libxml libs)</span><br>";
932print
'<strong>MAIN_DISALLOW_URL_INTO_DESCRIPTIONS</strong> = '.getDolGlobalString(
'MAIN_DISALLOW_URL_INTO_DESCRIPTIONS',
'<span class="opacitymedium">'.$langs->trans(
"Undefined").
' ('.$langs->trans(
"Recommended").
': 1=only local links allowed or 2=no links at all)</span>').
"<br>";
935print
'<strong>MAIN_ALLOW_SVG_FILES_AS_EXTERNAL_LINKS</strong> = '.getDolGlobalString(
'MAIN_ALLOW_SVG_FILES_AS_EXTERNAL_LINKS',
'<span class="opacitymedium">'.$langs->trans(
"Undefined").
' ('.$langs->trans(
"Recommended").
': '.$langs->trans(
"Undefined").
' '.$langs->trans(
"or").
' 0)</span>').
"<br>";
938print
'<strong>MAIN_DISALLOW_STRING_OBFUSCATION_IN_DOL_EVAL</strong> = '.(getDolGlobalString(
'MAIN_DISALLOW_STRING_OBFUSCATION_IN_DOL_EVAL') ?
'1' :
'<span class="opacitymedium">'.$langs->trans(
"Undefined").
'</span>');
939print
' <span class="opacitymedium">('.$langs->trans(
"Recommended").
": 1 - may break use of concatenation function like . or dol_concatdesc into extra fields conditions or formula)</span><br>";
942print
'<strong>MAIN_DISALLOW_UNSECURED_SELECT_INTO_EXTRAFIELDS_FILTER</strong> = '.getDolGlobalString(
'MAIN_DISALLOW_UNSECURED_SELECT_INTO_EXTRAFIELDS_FILTER',
'<span class="opacitymedium">'.$langs->trans(
"Undefined").
'</span>');
943print
' <span class="opacitymedium">('.$langs->trans(
"Recommended").
": 1 - The value 0 allows the use of subrequests into extrafields conditions. It remains not possible in API filters to avoid bind SQL injections whatever is this value)</span><br>";
949print
'<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>";
952print
'<strong>MAIN_DOCUMENT_IS_OUTSIDE_WEBROOT_SO_NOEXE_NOT_REQUIRED</strong> = '.getDolGlobalString(
'MAIN_DOCUMENT_IS_OUTSIDE_WEBROOT_SO_NOEXE_NOT_REQUIRED',
'<span class="opacitymedium">'.$langs->trans(
"Undefined").
' ('.$langs->trans(
"Recommended").
': '.$langs->trans(
"Undefined").
' '.$langs->trans(
"or").
' 0)</span>').
"<br>";
955$examplecsprule =
"frame-ancestors 'self'; img-src * data:; font-src *; default-src 'self' 'unsafe-inline' 'unsafe-eval' *.paypal.com *.stripe.com *.google.com *.googleapis.com *.google-analytics.com *.googletagmanager.com *.dolistore.com *.githubusercontent.com";
956print
'<strong>MAIN_SECURITY_FORCECSPRO</strong> = '.getDolGlobalString(
'MAIN_SECURITY_FORCECSPRO',
'<span class="opacitymedium">'.$langs->trans(
"Undefined").
'</span>').
' <span class="opacitymedium">('.$langs->trans(
"Example").
': "'.$examplecsprule.
'")</span><br>';
959$examplecsprule =
"frame-ancestors 'self'; img-src * data:; font-src *; default-src 'self' 'unsafe-inline' 'unsafe-eval' *.paypal.com *.stripe.com *.google.com *.googleapis.com *.google-analytics.com *.googletagmanager.com *.dolistore.com *.githubusercontent.com";
960print
'<strong>MAIN_SECURITY_FORCECSP</strong> = '.getDolGlobalString(
'MAIN_SECURITY_FORCECSP',
'<span class="opacitymedium">'.$langs->trans(
"Undefined").
'</span>').
' <span class="opacitymedium">('.$langs->trans(
"Example").
': "'.$examplecsprule.
'")</span><br>';
963print
'<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").
" \"strict-origin-when-cross-origin\" so browser doesn't send any referrer when going into another web site domain)</span><br>";
966print
'<strong>MAIN_SECURITY_FORCE_ACCESS_CONTROL_ALLOW_ORIGIN</strong> = '.getDolGlobalString(
'MAIN_SECURITY_FORCE_ACCESS_CONTROL_ALLOW_ORIGIN',
'<span class="opacitymedium">'.$langs->trans(
"Undefined").
'</span>').
' <span class="opacitymedium">('.$langs->trans(
"Recommended").
": 1)</span><br>";
1004print
'<div class="divsection wordbreak">';
1006print
'<span class="opacitymedium">';
1007print $langs->trans(
"RecommendMitigationOnURL").
'<br>';
1011$urlexamplebase =
'https://github.com/Dolibarr/dolibarr/blob/develop/dev/setup/fail2ban/filter.d/';
1012print
'<span class="fas fa-shield-alt"></span> Login or API authentication (see <a target="_blank" rel="noopener" href="'.$urlexamplebase.
'web-dolibarr-rulesbruteforce.conf">fail2ban example on GitHub</a>)<br>';
1013print
'<span class="fas fa-shield-alt"></span> '.DOL_URL_ROOT.
'/passwordforgotten.php (see <a target="_blank" rel="noopener" href="'.$urlexamplebase.
'web-dolibarr-rulespassforgotten.conf">fail2ban example on GitHub</a>)<br>';
1014print
'<span class="fas fa-shield-alt"></span> '.DOL_URL_ROOT.
'/public/* (see <a target="_blank" rel="noopener" href="'.$urlexamplebase.
'web-dolibarr-limitpublic.conf">fail2ban example on GitHub</a>)<br>';
1016$urlexamplebase =
'https://github.com/Dolibarr/dolibarr/blob/develop/dev/setup/apache/';
1017print
'<span class="fas fa-shield-alt"></span> 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>';
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
dol_dir_list($utf8_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.
getExecutableContent()
Return array of extension for executable files of text files that can contains executable code.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
img_warning($titlealt='default', $moreatt='', $morecss='pictowarning')
Show warning logo.
dolPrintHTMLForTextArea($s, $allowiframe=0)
Return a string ready to be output on input textarea.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
yn($yesno, $format=1, $color=0)
Return yes or no in current language.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_htmlwithnojs($stringtoencode, $nouseofiframesandbox=0, $check='restricthtml')
Sanitize a HTML to remove js, dangerous content and external links.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
dol_getwebuser($mode)
Return user/group account of web server.
dolDecrypt($chain, $key='')
Decode a string with a symmetric encryption.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.