diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index 9a3e22826ad..e851d93b926 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -133,6 +133,22 @@ else if ($_GET["action"] == 'disable_pdfsecurity') exit; } +if ($_GET["action"] == 'activate_MAIN_SECURITY_DISABLEFORGETPASSLINK') +{ + dolibarr_set_const($db, "MAIN_SECURITY_DISABLEFORGETPASSLINK", '1'); + Header("Location: security.php"); + exit; +} +else if ($_GET["action"] == 'disable_MAIN_SECURITY_DISABLEFORGETPASSLINK') +{ + dolibarr_del_const($db, "MAIN_SECURITY_DISABLEFORGETPASSLINK"); + Header("Location: security.php"); + exit; +} + + + + /* * Affichage onglet */ @@ -246,11 +262,12 @@ print ""; print ''; print ''; -print ''; +print ''; print ''; print ''; print ''; +// Disable clear password in database $var=!$var; print ""; print ''; @@ -260,14 +277,12 @@ if($conf->global->DATABASE_PWD_ENCRYPTED == 1) print img_tick(); } print ''; - if ($conf->global->DATABASE_PWD_ENCRYPTED == 0) { print '"; } - if($conf->global->DATABASE_PWD_ENCRYPTED == 1) { print '"; } +print ""; +print ''; + +// Disable link "Forget password" on logon +$var=!$var; +print ""; +print ''; +print ''; +if ($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK == 0) +{ + print '"; +} +if($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK == 1) +{ + print '"; +} print ""; print ''; @@ -321,7 +361,7 @@ $var=!$var; print ""; print ''; print '
'.$langs->trans("Encryption").''.$langs->trans("Parameters").''.$langs->trans("Activated").''.$langs->trans("Action").'
'.$langs->trans("DoNotStoreClearPassword").''; print ''.$langs->trans("Activate").''; print "'; @@ -283,7 +298,32 @@ if($conf->global->DATABASE_PWD_ENCRYPTED == 1) } print "
'.$langs->trans("DisableForgetPasswordLinkOnLogonPage").''; +if($conf->global->MAIN_SECURITY_DISABLEFORGETPASSLINK == 1) +{ + print img_tick(); +} +print ''; + print ''.$langs->trans("Activate").''; + print "'; + print ''.$langs->trans("Disable").''; + print "
'; $text = $langs->trans("ProtectAndEncryptPdfFiles"); -$desc = $html->textwithwarning($text,$langs->transnoentities("ProtectAndEncryptPdfFilesDesc"),1); +$desc = $html->textwithhelp($text,$langs->transnoentities("ProtectAndEncryptPdfFilesDesc"),1); print $desc; print ''; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 69034c8ad4d..fb5c3f6d519 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -448,7 +448,8 @@ UserGroupSetup=Users and groups module setup GeneratePassword=Suggest a generated password RuleForGeneratedPasswords=Rule to generate suggested passwords DoNotSuggest=Do not suggest any password -EncryptedPasswordInDatabase=To allow the encryption of the passwords in the database +EncryptedPasswordInDatabase=To allow the encryption of the passwords in the database +DisableForgetPasswordLinkOnLogonPage=Do not show the link "Forget password" on login page ##### Company setup ##### CompanySetup=Companies module setup CompanyCodeChecker=Module for third parties code checking (customer or supplier) diff --git a/htdocs/langs/en_US/other.lang b/htdocs/langs/en_US/other.lang index 8ece0ebfa6b..7784b73618c 100644 --- a/htdocs/langs/en_US/other.lang +++ b/htdocs/langs/en_US/other.lang @@ -11,6 +11,9 @@ ErrorFailedToFindEntity=Failed to read entity '%s' ErrorBadLoginPassword=Bad value for login or password ErrorLoginDisabled=Your account has been disabled ErrorFailedToRunExternalCommand=Failed to run external command. Check it is available and runnable by your PHP server. If PHP Safe Mode is enabled, check that command is inside a directory defined by parameter safe_mode_exec_dir. +ErrorFailedToChangePassword=Failed to change password +ErrorLoginDoesNotExists=User with login %s could not be found. +ErrorLoginHasNoEmail=This user has no email address. Process aborted. Calendar=Calendar AddTrip=Add trip Tools=Tools @@ -70,6 +73,9 @@ VolumeUnitm3=m3 VolumeUnitcm3=cm3 VolumeUnitmm3=mm3 BugTracker=Bug tracker +SendNewPasswordDesc=This form allows you to request a new passord. It will be send to your email address. Check your email reader software. +BackToLoginPage=Back to login page +AuthenticationDoesNotAllowSendNewPassword=Authentication mode is %s. In this mode, Dolibarr can't know nor change your password. Contact your system administrator if you want to change your password. ##### Webcal ##### LoginWebcal=Login for Webcalendar AddCalendarEntry=Add entry in calendar diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 2a175916c55..9141063b489 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -456,6 +456,7 @@ GeneratePassword=Proposer un mot de passe g RuleForGeneratedPasswords=Règle pour la génération des mots de passe proposés DoNotSuggest=Ne pas proposer EncryptedPasswordInDatabase=Permettre l'encryption des mots de passe dans la base de données +DisableForgetPasswordLinkOnLogonPage=Ne pas afficher le lien "Mot de passe oublié" sur la page de connexion ##### Company setup ##### CompanySetup=Configuration du module Sociétés CompanyCodeChecker=Module de contrôle des codes tiers (clients/fournisseurs) diff --git a/htdocs/langs/fr_FR/other.lang b/htdocs/langs/fr_FR/other.lang index b3fd7b3b82d..1e1205be2ed 100644 --- a/htdocs/langs/fr_FR/other.lang +++ b/htdocs/langs/fr_FR/other.lang @@ -11,6 +11,9 @@ ErrorFailedToFindEntity=Echec de lecture de l'entit ErrorBadLoginPassword=Identifiants login ou mot de passe incorrects ErrorLoginDisabled=Votre compte est désactivé ErrorFailedToRunExternalCommand=Echec de l'exécution de la commande externe. Vérifiez qu'elle est disponible et exécutable par votre serveur PHP. Si le Safe Mode PHP est actif, vérifiez que la commande se trouve dans un répertoire définie dans le paramètre safe_mode_exec_dir. +ErrorFailedToChangePassword=Echec de modification du mot de passe +ErrorLoginDoesNotExists=Le compte utilisateur de login %s n'a pu être trouvé. +ErrorLoginHasNoEmail=Cet utilisateur n'a pas d'email. Impossible de continuer. Calendar=Calendrier AddTrip=Créer déplacement Tools=Outils @@ -70,6 +73,9 @@ VolumeUnitm3=m3 VolumeUnitcm3=cm3 VolumeUnitmm3=mm3 BugTracker=Bug tracker +SendNewPasswordDesc=Ce formulaire permet d'envoyer un nouveau mot de passe. Il sera envoyé à l'adresse email de votre user. Surveillez votre messagerie. +BackToLoginPage=Retour page de connexion +AuthenticationDoesNotAllowSendNewPassword=Le mode d'authentification de Dolibarr est configuré à "%s". Dans ce mode, Dolibarr n'a pas la possibilité de connaitre ni modifier votre mot de passe. Contacter votre administrateur pour connaitre les modalités de changement. ##### Webcal ##### LoginWebcal=Login Webcalendar AddCalendarEntry=Ajouter entrée dans le calendrier diff --git a/htdocs/lib/functions.inc.php b/htdocs/lib/functions.inc.php index d625ebba802..8b8c7e22190 100644 --- a/htdocs/lib/functions.inc.php +++ b/htdocs/lib/functions.inc.php @@ -1121,9 +1121,9 @@ function dol_loginfunction($notused,$pearstatus) // Ce DTD est KO car inhibe document.body.scrollTop //print ''; // Ce DTD est OK - print ''; + print ''."\n"; - print "\n"; + // En tete html print "\n"; print "\n"; print ''."\n"; // Evite indexation par robots @@ -1131,8 +1131,6 @@ function dol_loginfunction($notused,$pearstatus) print ''."\n"; - - print ''."\n"; +print ''."\n"; +print ''."\n"; + +// Body +print ''; + +// Form +print '
'; +print ''; + +// Table 1 +print ''; +if (file_exists(DOL_DOCUMENT_ROOT.'/logo.png')) +{ + print ''; +} +else +{ + print ''; +} +print '
'; + print '
Dolibarr '.DOL_VERSION.'
'; +print '
'; + +// Table 2 +print ''; + +print ''; + +print ''; +$disabled='disabled'; +if ($mode == 'dolibarr') $disabled=''; + +print ''; + +// Affiche logo du theme si existe, sinon logo commun +if (file_exists(DOL_DOCUMENT_ROOT.'/theme/'.$conf->theme.'/img/login_logo.png')) +{ + print ''; +} +else +{ + print ''; +} + +print ''; + + +print "".''; +print "
 
  '.$langs->trans("Login").'  
\n"; + +print "
"; + +print '
'; +if ($mode == 'dolibarr') +{ + print $langs->trans("SendNewPasswordDesc").'
'; +} +else +{ + print '
'.$langs->trans("AuthenticationDoesNotAllowSendNewPassword",$mode).'
'; +} +print '
'; +if ($message) { print $message.'
'; } +print ''.$langs->trans("BackToLoginPage").''; +print '
'; + +print "
"; +print "
"; + + +// Fin entete html +print "\n\n"; +?> \ No newline at end of file diff --git a/mysql/migration/2.1.0-2.2.0.sql b/mysql/migration/2.1.0-2.2.0.sql index 450afe09d74..769ecd70300 100644 --- a/mysql/migration/2.1.0-2.2.0.sql +++ b/mysql/migration/2.1.0-2.2.0.sql @@ -546,6 +546,7 @@ ALTER TABLE `llx_socpeople` CHANGE `fk_user_create` `fk_user_creat` INT(11) NULL -- V4 ALTER TABLE llx_socpeople ADD INDEX idx_fk_user_creat (fk_user_creat); -- V4 ALTER TABLE llx_socpeople ADD CONSTRAINT fk_socpeople_user_creat_user_rowid FOREIGN KEY (fk_user_creat) REFERENCES llx_user (rowid); +ALTER TABLE llx_user add pass_temp VARCHAR(32) NULL after pass_crypted; drop table if exists llx_soc_events; drop table if exists llx_todocomm; diff --git a/mysql/tables/llx_user.sql b/mysql/tables/llx_user.sql index 98e705796cc..78bb548f732 100644 --- a/mysql/tables/llx_user.sql +++ b/mysql/tables/llx_user.sql @@ -30,6 +30,7 @@ create table llx_user login varchar(24) NOT NULL, pass varchar(32), pass_crypted varchar(128), + pass_temp varchar(32), -- temporary password when asked for forget password name varchar(50), firstname varchar(50), office_phone varchar(20),