From 079f39ab4b3c0953e2627b3c025b54f4f3d44322 Mon Sep 17 00:00:00 2001 From: Benjamin Renard Date: Sat, 13 Jun 2020 10:14:16 +0200 Subject: [PATCH] LSformElement::password: Add confirmChangeQuestion parameter --- .../LSattr_html/LSattr_html_password.docbook | 11 +++++++++++ src/conf/LSobjects/config.LSobjects.LSpeople.php | 4 +++- src/includes/class/class.LSformElement_password.php | 2 +- src/includes/class/class.LSlang.php | 1 + src/lang/fr_FR.UTF8/lang.php | 4 ++++ 5 files changed, 20 insertions(+), 2 deletions(-) diff --git a/doc/conf/LSattribute/LSattr_html/LSattr_html_password.docbook b/doc/conf/LSattribute/LSattr_html/LSattr_html_password.docbook index 0a6d41de..34111b92 100644 --- a/doc/conf/LSattribute/LSattr_html/LSattr_html_password.docbook +++ b/doc/conf/LSattribute/LSattr_html/LSattr_html_password.docbook @@ -25,6 +25,7 @@ 'verify' => [booléen], // Activation de l'outil de vérification du mot de passe 'viewHash' => [booléen], // Activation de l'outil de visualisation du mot de passe haché 'confirmChange' => [booléen], // Activation de la confirmation en cas de changement du mot de passe + 'confirmChangeQuestion' => "[LSformat]", // LSformat de la question de confirmation du changement du mot de passe 'mail' => array( // Configuration de l'envoi du mot de passe par mail 'subject' => "[LSformat du sujet du mail]", 'msg' => "[LSformat du message du mail]", @@ -140,6 +141,16 @@ + + confirmChangeQuestion + + &LSformat; de la question posée à l'utilisateur en cas de changement + du mot de passe et si la fonctionnalité est activée. Il sera composé à l'aide + du label de l'attribut. Paramètre facultatif. + + + + clearView diff --git a/src/conf/LSobjects/config.LSobjects.LSpeople.php b/src/conf/LSobjects/config.LSobjects.LSpeople.php index 2b0bb9e2..fb68f6bf 100644 --- a/src/conf/LSobjects/config.LSobjects.LSpeople.php +++ b/src/conf/LSobjects/config.LSobjects.LSpeople.php @@ -571,7 +571,9 @@ $GLOBALS['LSobjects']['LSpeople'] = array ( 'subject' => "LSexample : Your new credentials.", 'msg' => "Your password has been changed.\nLogin : %{uid}\nNew password : %{password}", 'mail_attr' => 'mail' - ) + ), + 'confirmChange' => True, + 'confirmChangeQuestion' => "Do you confirm change of this user's password?", ), 'check_data' => array( 'password' => array( diff --git a/src/includes/class/class.LSformElement_password.php b/src/includes/class/class.LSformElement_password.php index 796d25f9..69175256 100644 --- a/src/includes/class/class.LSformElement_password.php +++ b/src/includes/class/class.LSformElement_password.php @@ -158,7 +158,7 @@ class LSformElement_password extends LSformElement { ); if ($params['confirmChange']) { - $params['confirmChangeQuestion'] = getFData(_('%{label}: Do you confirm the password change?'), $this -> label); + $params['confirmChangeQuestion'] = getFData(__($this -> getParam('html_options.confirmChangeQuestion', '%{label}: Do you confirm the password change?')), $this -> label); } if ($this -> getParam('html_options.mail')) { diff --git a/src/includes/class/class.LSlang.php b/src/includes/class/class.LSlang.php index 4c70f22e..83502682 100644 --- a/src/includes/class/class.LSlang.php +++ b/src/includes/class/class.LSlang.php @@ -570,6 +570,7 @@ function cli_generate_lang_file($command_args) { case 'password': addFromLSconfig("LSobjects.$obj.attrs.$attr.html_options.mail.subject"); addFromLSconfig("LSobjects.$obj.attrs.$attr.html_options.mail.msg"); + addFromLSconfig("LSobjects.$obj.attrs.$attr.html_options.confirmChangeQuestion"); break; case 'select_list': case 'select_box': diff --git a/src/lang/fr_FR.UTF8/lang.php b/src/lang/fr_FR.UTF8/lang.php index d700ff2d..5bbe7b04 100644 --- a/src/lang/fr_FR.UTF8/lang.php +++ b/src/lang/fr_FR.UTF8/lang.php @@ -45,6 +45,10 @@ $GLOBALS['LSlang'] = array ( "Description" => "Description", +# LSobjects.LSpeople.attrs.userPassword.html_options.confirmChangeQuestion +"Do you confirm change of this user's password?" => + "Confirmez-vous le changement du mot de passe de cet utilisateur ?", + # LSobjects.LSpeople.LSrelation.groups.emptyText # LSobjects.LSsysaccount.LSrelation.groups.emptyText "Doesn't belong to any group." =>