forked from Wavyzz/dolibarr
NEW Add picto property on sub-module for paswword generation
This commit is contained in:
@@ -216,6 +216,8 @@ print '<td>'.$langs->trans("Example").'</td>';
|
|||||||
print '<td class="center">'.$langs->trans("Activated").'</td>';
|
print '<td class="center">'.$langs->trans("Activated").'</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
$tabConf = explode(";", getDolGlobalString('USER_PASSWORD_PATTERN'));
|
||||||
|
|
||||||
foreach ($arrayhandler as $key => $module) {
|
foreach ($arrayhandler as $key => $module) {
|
||||||
// Show modules according to features level
|
// Show modules according to features level
|
||||||
if (!empty($module->version) && $module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
|
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()) {
|
if ($module->isEnabled()) {
|
||||||
print '<tr class="oddeven"><td width="100">';
|
print '<tr class="oddeven"><td>';
|
||||||
|
print img_picto('', $module->picto, 'class="width25 size15x opacitymedium"').' ';
|
||||||
print ucfirst($key);
|
print ucfirst($key);
|
||||||
print "</td><td>\n";
|
print "</td><td>\n";
|
||||||
print $module->getDescription().'<br>';
|
print $module->getDescription().'<br>';
|
||||||
print $langs->trans("MinLength").': '.$module->length;
|
print $langs->trans("MinLength").': <span class="opacitymedium">'.$module->length.'</span>';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
|
|
||||||
// Show example of numbering module
|
// Show example of numbering module
|
||||||
print '<td class="nowrap">';
|
print '<td class="nowraponall">';
|
||||||
$tmp = $module->getExample();
|
$tmp = $module->getExample();
|
||||||
if (preg_match('/^Error/', $tmp)) {
|
if (preg_match('/^Error/', $tmp)) {
|
||||||
$langs->load("errors");
|
$langs->load("errors");
|
||||||
@@ -246,7 +249,7 @@ foreach ($arrayhandler as $key => $module) {
|
|||||||
}
|
}
|
||||||
print '</td>'."\n";
|
print '</td>'."\n";
|
||||||
|
|
||||||
print '<td width="100" align="center">';
|
print '<td class="center">';
|
||||||
if ($conf->global->USER_PASSWORD_GENERATED == $key) {
|
if ($conf->global->USER_PASSWORD_GENERATED == $key) {
|
||||||
//print img_picto('', 'tick');
|
//print img_picto('', 'tick');
|
||||||
print img_picto($langs->trans("Enabled"), 'switch_on');
|
print img_picto($langs->trans("Enabled"), 'switch_on');
|
||||||
@@ -267,7 +270,6 @@ print '</form>';
|
|||||||
//if($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK == 1)
|
//if($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK == 1)
|
||||||
// Patter for Password Perso
|
// Patter for Password Perso
|
||||||
if ($conf->global->USER_PASSWORD_GENERATED == "Perso") {
|
if ($conf->global->USER_PASSWORD_GENERATED == "Perso") {
|
||||||
$tabConf = explode(";", $conf->global->USER_PASSWORD_PATTERN);
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
@@ -346,7 +348,7 @@ if ($conf->global->USER_PASSWORD_GENERATED == "Perso") {
|
|||||||
print ' }';
|
print ' }';
|
||||||
|
|
||||||
print ' function generatelink(){';
|
print ' function generatelink(){';
|
||||||
print ' return "security.php?action=updatepattern&pattern="+getStringArg();';
|
print ' return "security.php?action=updatepattern&token='.newToken().'&pattern="+getStringArg();';
|
||||||
print ' }';
|
print ' }';
|
||||||
|
|
||||||
print ' function valuePatternChange(){';
|
print ' function valuePatternChange(){';
|
||||||
@@ -470,7 +472,9 @@ print '</tr>';
|
|||||||
|
|
||||||
|
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
if (GETPOST('info', 'int') > 0) {
|
if (GETPOST('info', 'int') > 0) {
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ print '<br>';
|
|||||||
// Upload options
|
// Upload options
|
||||||
|
|
||||||
print '<div class="div-table-responsive-no-min">';
|
print '<div class="div-table-responsive-no-min">';
|
||||||
print '<table class="noborder centpercent">';
|
print '<table class="noborder centpercent nomarginbottom">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print '<td colspan="2">'.$langs->trans("Parameters").'</td>';
|
print '<td colspan="2">'.$langs->trans("Parameters").'</td>';
|
||||||
print '<td>'.$langs->trans("Value").'</td>';
|
print '<td>'.$langs->trans("Value").'</td>';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2013-2019 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2013-2022 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* 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 '<br>';
|
print '<br>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
print '<strong>'.$langs->trans("DoNotStoreClearPassword").'</strong>: ';
|
||||||
|
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 ' <span class="opacitymedium">('.$langs->trans("Recommended").' '.yn(1).')</span>';
|
||||||
|
}
|
||||||
|
print '<br>';
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
|
/* 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 '<strong>'.$langs->trans("MainDbPasswordFileConfEncrypted").'</strong>: ';
|
||||||
|
print $usepassinconfencrypted ? img_picto('', 'tick').' ' : img_warning().' ';
|
||||||
|
print yn($usepassinconfencrypted);
|
||||||
|
if (empty($usepassinconfencrypted)) {
|
||||||
|
print ' <span class="opacitymedium">('.$langs->trans("Recommended").' '.yn(1).')</span>';
|
||||||
|
}
|
||||||
|
print '<br>';
|
||||||
|
print '<br>';
|
||||||
|
*/
|
||||||
|
|
||||||
|
print '<strong>'.$langs->trans("PasswordLength").'</strong>: ';
|
||||||
|
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 ' <span class="opacitymedium">('.$langs->trans("Recommended").' '.yn(1).')</span>';
|
||||||
|
}
|
||||||
|
print '<br>';
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
print '<strong>'.$langs->trans("AntivirusEnabledOnUpload").'</strong>: ';
|
print '<strong>'.$langs->trans("AntivirusEnabledOnUpload").'</strong>: ';
|
||||||
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);
|
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 ' - <span class="opacitymedium">'.$langs->trans("Recommended").': '.$langs->trans("DefinedAPathForAntivirusCommandIntoSetup", $langs->transnoentitiesnoconv("Home")." - ".$langs->transcountrynoentities("Setup")." - ".$langs->transnoentitiesnoconv("Security")).'</span>';
|
||||||
|
} else {
|
||||||
print ' - '.$conf->global->MAIN_ANTIVIRUS_COMMAND;
|
print ' - '.$conf->global->MAIN_ANTIVIRUS_COMMAND;
|
||||||
if (defined('MAIN_ANTIVIRUS_COMMAND') && !defined('MAIN_ANTIVIRUS_BYPASS_COMMAND_AND_PARAM')) {
|
if (defined('MAIN_ANTIVIRUS_COMMAND') && !defined('MAIN_ANTIVIRUS_BYPASS_COMMAND_AND_PARAM')) {
|
||||||
print ' - <span class="opacitymedium">'.$langs->trans("ValueIsForcedBySystem").'</span>';
|
print ' - <span class="opacitymedium">'.$langs->trans("ValueIsForcedBySystem").'</span>';
|
||||||
@@ -325,6 +362,7 @@ if (!empty($conf->global->MAIN_ANTIVIRUS_COMMAND)) {
|
|||||||
print '<br>';
|
print '<br>';
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
$securityevent = new Events($db);
|
$securityevent = new Events($db);
|
||||||
$eventstolog = $securityevent->eventstolog;
|
$eventstolog = $securityevent->eventstolog;
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,8 @@ class modGeneratePassNone extends ModeleGenPassword
|
|||||||
*/
|
*/
|
||||||
public $id;
|
public $id;
|
||||||
|
|
||||||
|
public $picto = 'fa-keyboard';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Minimum length (text visible by end user)
|
* Minimum length (text visible by end user)
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -37,6 +37,8 @@ class modGeneratePassPerso extends ModeleGenPassword
|
|||||||
*/
|
*/
|
||||||
public $id;
|
public $id;
|
||||||
|
|
||||||
|
public $picto = 'fa-shield-alt';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Minimum length (text visible by end user)
|
* Minimum length (text visible by end user)
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -35,6 +35,8 @@ class modGeneratePassStandard extends ModeleGenPassword
|
|||||||
*/
|
*/
|
||||||
public $id;
|
public $id;
|
||||||
|
|
||||||
|
public $picto = 'fa-shield-alt';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Minimum length (text visible by end user)
|
* Minimum length (text visible by end user)
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/functions.lib.php';
|
|||||||
*/
|
*/
|
||||||
abstract class ModeleGenPassword
|
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)
|
* Flag to 1 if we must clean ambiguous charaters for the autogeneration of password (List of ambiguous char is in $this->Ambi)
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -2310,3 +2310,4 @@ Images=Images
|
|||||||
MaxNumberOfImagesInGetPost=Max number of images allowed in a HTML field submitted in a form
|
MaxNumberOfImagesInGetPost=Max number of images allowed in a HTML field submitted in a form
|
||||||
ScriptIsEmpty=The script is empty
|
ScriptIsEmpty=The script is empty
|
||||||
ShowHideTheNRequests=Show/hide the %s SQL request(s)
|
ShowHideTheNRequests=Show/hide the %s SQL request(s)
|
||||||
|
DefinedAPathForAntivirusCommandIntoSetup=Define a path for an antivirus program into <b>%s</b>
|
||||||
Reference in New Issue
Block a user