diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index bc3f4609d1f..4229a6def80 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -173,7 +173,7 @@ print '
'; print ''.$langs->trans("XDebug").': '; $test = !function_exists('xdebug_is_enabled') && !extension_loaded('xdebug'); if ($test) { - print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' - '.$langs->trans("NotRiskOfLeakWithThis"); + print img_picto('', 'tick').' '.$langs->trans("NotInstalled").' - '.$langs->trans("NotRiskOfLeakWithThis"); } else { print img_picto('', 'warning').' '.$langs->trans("ModuleActivatedMayExposeInformation", $langs->transnoentities("XDebug")); print ' - '.$langs->trans("MoreInformation").' XDebug admin page'; @@ -480,30 +480,57 @@ print load_fiche_titre($langs->trans("Modules"), '', 'folder'); // Module log print ''.$langs->trans("Syslog").': '; -$test = !isModEnabled('syslog'); -if ($test) { - print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' - '.$langs->trans("NotRiskOfLeakWithThis"); +$test = isModEnabled('syslog'); +if (!$test) { + print img_picto('', 'tick').' '.$langs->trans("NotInstalled").' - '.$langs->trans("NotRiskOfLeakWithThis"); } else { if (getDolGlobalInt('SYSLOG_LEVEL') > LOG_NOTICE) { print img_picto('', 'warning').' '.$langs->trans("ModuleActivatedWithTooHighLogLevel", $langs->transnoentities("Syslog")); } else { - print img_picto('', 'tick.png').' '.$langs->trans("ModuleSyslogActivatedButLevelNotTooVerbose", $langs->transnoentities("Syslog"), getDolGlobalInt('SYSLOG_LEVEL')); + print img_picto('', 'tick').' '.$langs->trans("ModuleSyslogActivatedButLevelNotTooVerbose", $langs->transnoentities("Syslog"), getDolGlobalInt('SYSLOG_LEVEL')); } //print ' '.$langs->trans("MoreInformation").' XDebug admin page'; } print '
'; +print '
'; + // Module debugbar print ''.$langs->trans("DebugBar").': '; -$test = empty($conf->debugbar->enabled); -if ($test) { - print img_picto('', 'tick.png').' '.$langs->trans("NotInstalled").' - '.$langs->trans("NotRiskOfLeakWithThis"); +$test = isModEnabled('debugbar'); +if (!$test) { + print img_picto('', 'tick').' '.$langs->trans("NotInstalled").' - '.$langs->trans("NotRiskOfLeakWithThis"); } else { print img_picto('', 'error').' '.$langs->trans("ModuleActivatedDoNotUseInProduction", $langs->transnoentities("DebugBar")); //print ' '.$langs->trans("MoreInformation").' XDebug admin page'; } print '
'; +print '
'; + +// Modules for Payments +$test = isModEnabled('stripe'); +if ($test) { + print ''.$langs->trans("Stripe").': '; + if (!getDolGlobalString('PAYMENT_SECURITY_TOKEN_UNIQUE')) { + print img_picto('', 'error').' '.$langs->trans("OptionXShouldBeEnabledInModuleY", $langs->transnoentities("SecurityTokenIsUnique"), $langs->transnoentities("Stripe")); + } else { + print img_picto('', 'tick').' '.$langs->trans("OptionXIsCorrectlyEnabledInModuleY", $langs->transnoentities("SecurityTokenIsUnique"), $langs->transnoentities("Stripe")); + } + print '
'; +} else { + $test = isModEnabled('paypal'); + if ($test) { + print ''.$langs->trans("Paypal").': '; + if (!getDolGlobalString('PAYMENT_SECURITY_TOKEN_UNIQUE')) { + print img_picto('', 'error').' '.$langs->trans("OptionXShouldBeEnabledInModuleY", $langs->transnoentities("SecurityTokenIsUnique"), $langs->transnoentities("Paypal")); + } else { + print img_picto('', 'tick').' '.$langs->trans("OptionXIsCorrectlyEnabledInModuleY", $langs->transnoentities("SecurityTokenIsUnique"), $langs->transnoentities("Paypal")); + } + print '
'; + } +} + // APIs diff --git a/htdocs/core/lib/security2.lib.php b/htdocs/core/lib/security2.lib.php index b60054b9701..f6d354d9431 100644 --- a/htdocs/core/lib/security2.lib.php +++ b/htdocs/core/lib/security2.lib.php @@ -572,19 +572,20 @@ function dolJSToSetRandomPassword($htmlname, $htmlnameofbutton = 'generate_token if (!empty($conf->use_javascript_ajax)) { print "\n".''; print '