diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index 14975f8c68a..de404916fb4 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -216,6 +216,8 @@ print ''.$langs->trans("Example").''; print ''.$langs->trans("Activated").''; print ''; +$tabConf = explode(";", getDolGlobalString('USER_PASSWORD_PATTERN')); + foreach ($arrayhandler as $key => $module) { // Show modules according to features level if (!empty($module->version) && $module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) { @@ -226,15 +228,16 @@ foreach ($arrayhandler as $key => $module) { } if ($module->isEnabled()) { - print ''; + print ''; + print img_picto('', $module->picto, 'class="width25 size15x opacitymedium"').' '; print ucfirst($key); print "\n"; print $module->getDescription().'
'; - print $langs->trans("MinLength").': '.$module->length; + print $langs->trans("MinLength").': '.$module->length.''; print ''; // Show example of numbering module - print ''; + print ''; $tmp = $module->getExample(); if (preg_match('/^Error/', $tmp)) { $langs->load("errors"); @@ -246,7 +249,7 @@ foreach ($arrayhandler as $key => $module) { } print ''."\n"; - print ''; + print ''; if ($conf->global->USER_PASSWORD_GENERATED == $key) { //print img_picto('', 'tick'); print img_picto($langs->trans("Enabled"), 'switch_on'); @@ -267,7 +270,6 @@ print ''; //if($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK == 1) // Patter for Password Perso if ($conf->global->USER_PASSWORD_GENERATED == "Perso") { - $tabConf = explode(";", $conf->global->USER_PASSWORD_PATTERN); print '
'; print '
'; @@ -346,7 +348,7 @@ if ($conf->global->USER_PASSWORD_GENERATED == "Perso") { print ' }'; print ' function generatelink(){'; - print ' return "security.php?action=updatepattern&pattern="+getStringArg();'; + print ' return "security.php?action=updatepattern&token='.newToken().'&pattern="+getStringArg();'; print ' }'; print ' function valuePatternChange(){'; @@ -470,7 +472,9 @@ print ''; print ''; + print ''; + print '
'; if (GETPOST('info', 'int') > 0) { diff --git a/htdocs/admin/security_file.php b/htdocs/admin/security_file.php index b20287ce19b..ff0d5780ad4 100644 --- a/htdocs/admin/security_file.php +++ b/htdocs/admin/security_file.php @@ -113,7 +113,7 @@ print '
'; // Upload options print '
'; -print ''; +print '
'; print ''; print ''; print ''; diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index 4ba5bec5b11..7ee7c93a97d 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2013-2022 Laurent Destailleur * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -312,11 +312,48 @@ print yn(empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA) ? 0 : 1); print '
'; print '
'; +print ''.$langs->trans("DoNotStoreClearPassword").': '; +print empty($conf->global->DATABASE_PWD_ENCRYPTED) ? '' : img_picto('', 'tick').' '; +print yn(empty($conf->global->DATABASE_PWD_ENCRYPTED) ? 0 : 1); +if (empty($conf->global->DATABASE_PWD_ENCRYPTED)) { + print ' ('.$langs->trans("Recommended").' '.yn(1).')'; +} +print '
'; +print '
'; + +/* Already into section conf file */ +/* +$usepassinconfencrypted = 0; +global $dolibarr_main_db_pass, $dolibarr_main_db_encrypted_pass; +if (preg_match('/crypted:/i', $dolibarr_main_db_pass) || !empty($dolibarr_main_db_encrypted_pass)) { + $usepassinconfencrypted = 1; +} +print ''.$langs->trans("MainDbPasswordFileConfEncrypted").': '; +print $usepassinconfencrypted ? img_picto('', 'tick').' ' : img_warning().' '; +print yn($usepassinconfencrypted); +if (empty($usepassinconfencrypted)) { + print ' ('.$langs->trans("Recommended").' '.yn(1).')'; +} +print '
'; +print '
'; +*/ + +print ''.$langs->trans("PasswordLength").': '; +print empty($conf->global->DATABASE_PWD_ENCRYPTED) ? '' : img_picto('', 'tick').' '; +print yn(empty($conf->global->DATABASE_PWD_ENCRYPTED) ? 0 : 1); +if (empty($conf->global->DATABASE_PWD_ENCRYPTED)) { + print ' ('.$langs->trans("Recommended").' '.yn(1).')'; +} +print '
'; +print '
'; + print ''.$langs->trans("AntivirusEnabledOnUpload").': '; -print empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ? '' : img_picto('', 'tick').' '; +print empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ? img_warning().' ' : img_picto('', 'tick').' '; print yn(empty($conf->global->MAIN_ANTIVIRUS_COMMAND) ? 0 : 1); -if (!empty($conf->global->MAIN_ANTIVIRUS_COMMAND)) { +if (empty($conf->global->MAIN_ANTIVIRUS_COMMAND)) { + print ' - '.$langs->trans("Recommended").': '.$langs->trans("DefinedAPathForAntivirusCommandIntoSetup", $langs->transnoentitiesnoconv("Home")." - ".$langs->transcountrynoentities("Setup")." - ".$langs->transnoentitiesnoconv("Security")).''; +} else { print '   - '.$conf->global->MAIN_ANTIVIRUS_COMMAND; if (defined('MAIN_ANTIVIRUS_COMMAND') && !defined('MAIN_ANTIVIRUS_BYPASS_COMMAND_AND_PARAM')) { print ' - '.$langs->trans("ValueIsForcedBySystem").''; @@ -325,6 +362,7 @@ if (!empty($conf->global->MAIN_ANTIVIRUS_COMMAND)) { print '
'; print '
'; + $securityevent = new Events($db); $eventstolog = $securityevent->eventstolog; diff --git a/htdocs/core/modules/security/generate/modGeneratePassNone.class.php b/htdocs/core/modules/security/generate/modGeneratePassNone.class.php index c6cfb733f73..3ec764c6ab2 100644 --- a/htdocs/core/modules/security/generate/modGeneratePassNone.class.php +++ b/htdocs/core/modules/security/generate/modGeneratePassNone.class.php @@ -35,6 +35,8 @@ class modGeneratePassNone extends ModeleGenPassword */ public $id; + public $picto = 'fa-keyboard'; + /** * Minimum length (text visible by end user) * diff --git a/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php b/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php index 02b970ee2aa..e0dd2046020 100644 --- a/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php +++ b/htdocs/core/modules/security/generate/modGeneratePassPerso.class.php @@ -37,6 +37,8 @@ class modGeneratePassPerso extends ModeleGenPassword */ public $id; + public $picto = 'fa-shield-alt'; + /** * Minimum length (text visible by end user) * diff --git a/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php b/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php index f0e6fcf2a7f..b2d0b260ccb 100644 --- a/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php +++ b/htdocs/core/modules/security/generate/modGeneratePassStandard.class.php @@ -35,6 +35,8 @@ class modGeneratePassStandard extends ModeleGenPassword */ public $id; + public $picto = 'fa-shield-alt'; + /** * Minimum length (text visible by end user) * diff --git a/htdocs/core/modules/security/generate/modules_genpassword.php b/htdocs/core/modules/security/generate/modules_genpassword.php index 4d397605240..bb1e02774c6 100644 --- a/htdocs/core/modules/security/generate/modules_genpassword.php +++ b/htdocs/core/modules/security/generate/modules_genpassword.php @@ -29,6 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php'; */ abstract class ModeleGenPassword { + public $picto = 'generic'; + /** * Flag to 1 if we must clean ambiguous charaters for the autogeneration of password (List of ambiguous char is in $this->Ambi) * diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index a24dd69cc71..d3b2f251a6c 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2309,4 +2309,5 @@ UseOauth=Use a OAUTH token Images=Images MaxNumberOfImagesInGetPost=Max number of images allowed in a HTML field submitted in a form ScriptIsEmpty=The script is empty -ShowHideTheNRequests=Show/hide the %s SQL request(s) \ No newline at end of file +ShowHideTheNRequests=Show/hide the %s SQL request(s) +DefinedAPathForAntivirusCommandIntoSetup=Define a path for an antivirus program into %s \ No newline at end of file
'.$langs->trans("Parameters").''.$langs->trans("Value").'