From 39de27fa2d52c0896387514a433cdfc46befb80d Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Thu, 31 Jul 2025 14:16:12 -0300 Subject: [PATCH] Bug 30724: (follow-up) Improve user interface text and messaging This enhances the user experience with clearer, more contextual messaging throughout the two-factor authentication management interface. Template improvements: * Add contextual page titles showing patron name when managing others * Replace generic status messages with personalized, descriptive text * Provide clear explanation of why 2FA setup is restricted for admins * Add actionable guidance for superlibrarians on available options * Use appropriate alert styling (success/info/warning) for different states * Include patron names in messages for better context The new messaging explains the security rationale behind restrictions and provides clear guidance on what actions are available to different user types. To test: 1. As superlibrarian, manage 2FA for another patron => SUCCESS: Page title shows "Two-factor authentication for [Name]" => SUCCESS: Status messages are personalized with patron name => SUCCESS: Clear explanation of setup restrictions with actionable guidance 2. Manage your own 2FA => SUCCESS: Messages use "Your account" language appropriately 3. Sign off :-D --- .../en/modules/members/two_factor_auth.tt | 42 +++++++++++++++++-- 1 file changed, 38 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/two_factor_auth.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/two_factor_auth.tt index bbdcde441b1..a93144a46b1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/two_factor_auth.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/two_factor_auth.tt @@ -6,7 +6,13 @@ [% INCLUDE 'doc-head-open.inc' %] [% FILTER collapse %] - [% t("Two-factor authentication") | html %] + [% IF another_user %] + [% t("Two-factor authentication for") | html %] + [% patron.firstname | html %] + [% patron.surname | html %] + [% ELSE %] + [% t("Two-factor authentication") | html %] + [% END %] › [% t("Patrons") | html %] › [% t("Koha") | html %] [% END %] @@ -47,7 +53,17 @@
-
Status: Enabled
+ [% IF another_user %] +
+ Two-factor authentication: Enabled +

[% patron.firstname | html %] [% patron.surname | html %] has two-factor authentication enabled for enhanced account security.

+
+ [% ELSE %] +
+ Two-factor authentication: Enabled +

Your account is protected with two-factor authentication.

+
+ [% END %]
[% INCLUDE 'csrf-token.inc' %] @@ -57,9 +73,27 @@
-
Status: Disabled
[% IF another_user %] -
You cannot enable two-factor authentication for a user. They need to do it themselves.
+
+ Two-factor authentication: Disabled +

[% patron.firstname | html %] [% patron.surname | html %] does not have two-factor authentication enabled.

+
+ [% ELSE %] +
+ Two-factor authentication: Disabled +

Your account is not protected with two-factor authentication.

+
+ [% END %] + [% IF another_user %] +
+ Two-factor authentication setup restricted +

Two-factor authentication can only be enabled by [% patron.firstname | html %] [% patron.surname | html %] themselves, as it requires their personal authenticator device.

+

As a superlibrarian, you can:

+
    +
  • Disable their 2FA if they lose access to their device
  • +
  • Instruct them to visit Your account → Two-factor authentication to set it up
  • +
+
[% ELSE %] [% IF Koha.Preference('TwoFactorAuthentication') == 'enforced' %]
Two-factor authentication is mandatory to login. If you do not enable now it will be asked at your next login.
-- 2.50.1