From d63a91da4bb1b20b2cb0601bcb3a640ab8511151 Mon Sep 17 00:00:00 2001 From: Peter Keresztes Schmidt Date: Tue, 9 Jun 2020 23:02:07 +0200 Subject: [PATCH] WebUI: reword OTP info message displayed during PW reset The message displayed before is now limited to the OTP sync form, for which it was written originally. A new message is introduced for the PW reset form, which clarifies the usage of the OTP field. Fixes: https://pagure.io/freeipa/issue/5628 Reviewed-By: Alexander Bokovoy --- install/ui/src/freeipa/widgets/LoginScreen.js | 2 +- install/ui/src/freeipa/widgets/LoginScreenBase.js | 8 +++++++- install/ui/test/data/i18n_messages.json | 3 ++- ipaserver/plugins/internal.py | 10 +++++++++- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/install/ui/src/freeipa/widgets/LoginScreen.js b/install/ui/src/freeipa/widgets/LoginScreen.js index 51c1b4f9a..85a3421d6 100644 --- a/install/ui/src/freeipa/widgets/LoginScreen.js +++ b/install/ui/src/freeipa/widgets/LoginScreen.js @@ -546,7 +546,7 @@ define(['dojo/_base/declare', }, set_reset_aside_text: function() { - this.set('aside', "

"+this.otp_info_msg+"

"); + this.set('aside', "

"+this.otp_reset_info_msg+"

"); }, constructor: function(spec) { diff --git a/install/ui/src/freeipa/widgets/LoginScreenBase.js b/install/ui/src/freeipa/widgets/LoginScreenBase.js index 8d4488db2..e603beac4 100644 --- a/install/ui/src/freeipa/widgets/LoginScreenBase.js +++ b/install/ui/src/freeipa/widgets/LoginScreenBase.js @@ -59,9 +59,12 @@ define(['dojo/_base/declare', caps_warning_msg: "Warning: CAPS LOCK key is on", - otp_info_msg: " One-Time-Password(OTP): \ + otp_info_msg: " OTP (One-Time Password): \ Generate new OTP code for each OTP field.", + otp_reset_info_msg: " OTP (One-Time Password): \ + Leave blank if you are not using OTP tokens for authentication.", + /** * Details builder * @property {IPA.details_builder} @@ -347,6 +350,9 @@ define(['dojo/_base/declare', this.otp_info_msg = text.get(spec.otp_info_msg || '@i18n:password.otp_info', this.otp_info_msg); + + this.otp_reset_info_msg = text.get(spec.otp_reset_info_msg || '@i18n:password.otp_reset_info', + this.otp_reset_info_msg); } }); return LoginScreenBase; diff --git a/install/ui/test/data/i18n_messages.json b/install/ui/test/data/i18n_messages.json index 1f7ae4a35..1080ce36d 100644 --- a/install/ui/test/data/i18n_messages.json +++ b/install/ui/test/data/i18n_messages.json @@ -747,7 +747,8 @@ "new_password": "New Password", "new_password_required": "New password is required", "otp": "OTP", - "otp_info": " One-Time-Password(OTP): Generate new OTP code for each OTP field.", + "otp_info": " OTP (One-Time Password): Generate new OTP code for each OTP field.", + "otp_reset_info": " OTP (One-Time Password): Leave blank if you are not using OTP tokens for authentication.", "otp_long": "One-Time-Password", "otp_sync_fail": "Token synchronization failed", "otp_sync_invalid": "The username, password or token codes are not correct", diff --git a/ipaserver/plugins/internal.py b/ipaserver/plugins/internal.py index 7622e65dc..ce2d707a2 100644 --- a/ipaserver/plugins/internal.py +++ b/ipaserver/plugins/internal.py @@ -1678,7 +1678,15 @@ class i18n_messages(Command): "new_password": _("New Password"), "new_password_required": _("New password is required"), "otp": _("OTP"), - "otp_info": _(" One-Time-Password(OTP): Generate new OTP code for each OTP field."), + "otp_info": + _(" " + "OTP (One-Time-Password):" + "Generate new OTP code for each OTP field."), + "otp_reset_info": + _(" " + "OTP (One-Time-Password):" + "Leave blank if you are not using OTP tokens" + "for authentication."), "otp_long": _("One-Time-Password"), "otp_sync_fail": _("Token synchronization failed"), "otp_sync_invalid": _("The username, password or token codes are not correct"),