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 '</tr>';
|
||||
|
||||
$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 '<tr class="oddeven"><td width="100">';
|
||||
print '<tr class="oddeven"><td>';
|
||||
print img_picto('', $module->picto, 'class="width25 size15x opacitymedium"').' ';
|
||||
print ucfirst($key);
|
||||
print "</td><td>\n";
|
||||
print $module->getDescription().'<br>';
|
||||
print $langs->trans("MinLength").': '.$module->length;
|
||||
print $langs->trans("MinLength").': <span class="opacitymedium">'.$module->length.'</span>';
|
||||
print '</td>';
|
||||
|
||||
// Show example of numbering module
|
||||
print '<td class="nowrap">';
|
||||
print '<td class="nowraponall">';
|
||||
$tmp = $module->getExample();
|
||||
if (preg_match('/^Error/', $tmp)) {
|
||||
$langs->load("errors");
|
||||
@@ -246,7 +249,7 @@ foreach ($arrayhandler as $key => $module) {
|
||||
}
|
||||
print '</td>'."\n";
|
||||
|
||||
print '<td width="100" align="center">';
|
||||
print '<td class="center">';
|
||||
if ($conf->global->USER_PASSWORD_GENERATED == $key) {
|
||||
//print img_picto('', 'tick');
|
||||
print img_picto($langs->trans("Enabled"), 'switch_on');
|
||||
@@ -267,7 +270,6 @@ print '</form>';
|
||||
//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 '<br>';
|
||||
|
||||
print '<div class="div-table-responsive-no-min">';
|
||||
@@ -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 '</tr>';
|
||||
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</form>';
|
||||
|
||||
print '<br>';
|
||||
|
||||
if (GETPOST('info', 'int') > 0) {
|
||||
|
||||
@@ -113,7 +113,7 @@ print '<br>';
|
||||
// Upload options
|
||||
|
||||
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 '<td colspan="2">'.$langs->trans("Parameters").'</td>';
|
||||
print '<td>'.$langs->trans("Value").'</td>';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?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
|
||||
* 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 '<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 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 ' - <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;
|
||||
if (defined('MAIN_ANTIVIRUS_COMMAND') && !defined('MAIN_ANTIVIRUS_BYPASS_COMMAND_AND_PARAM')) {
|
||||
print ' - <span class="opacitymedium">'.$langs->trans("ValueIsForcedBySystem").'</span>';
|
||||
@@ -325,6 +362,7 @@ if (!empty($conf->global->MAIN_ANTIVIRUS_COMMAND)) {
|
||||
print '<br>';
|
||||
print '<br>';
|
||||
|
||||
|
||||
$securityevent = new Events($db);
|
||||
$eventstolog = $securityevent->eventstolog;
|
||||
|
||||
|
||||
@@ -35,6 +35,8 @@ class modGeneratePassNone extends ModeleGenPassword
|
||||
*/
|
||||
public $id;
|
||||
|
||||
public $picto = 'fa-keyboard';
|
||||
|
||||
/**
|
||||
* Minimum length (text visible by end user)
|
||||
*
|
||||
|
||||
@@ -37,6 +37,8 @@ class modGeneratePassPerso extends ModeleGenPassword
|
||||
*/
|
||||
public $id;
|
||||
|
||||
public $picto = 'fa-shield-alt';
|
||||
|
||||
/**
|
||||
* Minimum length (text visible by end user)
|
||||
*
|
||||
|
||||
@@ -35,6 +35,8 @@ class modGeneratePassStandard extends ModeleGenPassword
|
||||
*/
|
||||
public $id;
|
||||
|
||||
public $picto = 'fa-shield-alt';
|
||||
|
||||
/**
|
||||
* Minimum length (text visible by end user)
|
||||
*
|
||||
|
||||
@@ -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)
|
||||
*
|
||||
|
||||
@@ -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)
|
||||
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