Bugzilla – Attachment 182187 Details for
Bug 39494
Announce status messaging on login page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39494: Announce status messaging on login page
Bug-39494-Announce-status-messaging-on-login-page.patch (text/plain), 7.18 KB, created by
Martin Renvoize (ashimema)
on 2025-05-09 14:36:51 UTC
(
hide
)
Description:
Bug 39494: Announce status messaging on login page
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-05-09 14:36:51 UTC
Size:
7.18 KB
patch
obsolete
>From 8d6615927ffb4f1c0df48585c04256fcb58c2693 Mon Sep 17 00:00:00 2001 >From: Chloe Zermatten <chloe.zermatten@openfifth.co.uk> >Date: Tue, 8 Apr 2025 14:36:32 +0000 >Subject: [PATCH] Bug 39494: Announce status messaging on login page > >So that screen readers announce errors, add a role attribute set to "alert" and a aria-live attribute set to "assertive". > >Since the page reloads on each login attempt, the page will effectively be loaded with both attributes set (if there is an error) and so screens readers should be able to detect and announce the message. > >Test plan: > >1) On the Koha OPAC, navigate to Home > Log in to your account >2) Attempt to login, entering an incorrect password >3) Inspect the HTML, and notice that the relevant element now has a role attribute set to "alert" and an aria-live attribute set to "assertive". > >Repeat steps 2-3, but instead of an incorrect password error, trigger: >A) a timeout error >B) a different IP address error >C) a too many login attempts error >D) an authorisation error (where we are authenticating with a third party) >E) a shibboleth authentication error >F) a CAS login error >G) an invalid username/password error for an anonymous patron >H) an anonymous patron error >I) a password expired error > >Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> >Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> >--- > .../bootstrap/en/modules/opac-auth.tt | 18 +++++++++--------- > 1 file changed, 9 insertions(+), 9 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt >index dc820f017c6..06bc78aa0bf 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-auth.tt >@@ -61,21 +61,21 @@ > [% IF ( timed_out ) %] > <!-- This is what is displayed if login has timed out --> > <div class="alert alert-info"> >- <p>Sorry, your session has timed out. Please log in again.</p> >+ <p aria-live="assertive" role="alert">Sorry, your session has timed out. Please log in again.</p> > </div> > [% END %] > > [% IF ( different_ip ) %] > <!-- This is what is displayed if user doesn't have permission --> > <div class="alert alert-info"> >- <p>You are logging from a different IP address. Please log in again.</p> >+ <p aria-live="assertive" role="alert">You are logging from a different IP address. Please log in again.</p> > </div> > [% END %] > > [% IF invalid_username_or_password || too_many_login_attempts %] > <!-- This is what is displayed if user doesn't have permission or account is locked. (Do not expose more information than needed.) --> > <div class="alert alert-info"> >- <p >+ <p aria-live="assertive" role="alert" > >You entered an incorrect username or password. Please try again! But note that passwords are case sensitive. > [% IF Koha.Preference('FailedLoginAttempts') %] > Your account will be locked after a fixed number of failed login attempts. >@@ -87,7 +87,7 @@ > > [% IF auth_error %] > <div class="alert alert-info"> >- <p>There was an error authenticating to external identity provider</p> >+ <p aria-live="assertive" role="alert">There was an error authenticating to external identity provider</p> > <p>[% auth_error | html %]</p> > </div> > [% END %] >@@ -96,7 +96,7 @@ > [% IF ( invalidShibLogin ) %] > <!-- This is what is displayed if shibboleth login has failed to match a koha user --> > <div class="alert alert-info"> >- <p class="shib_invalid">Sorry, your Shibboleth identity does not match a valid library identity.</p> >+ <p aria-live="assertive" role="alert" class="shib_invalid">Sorry, your Shibboleth identity does not match a valid library identity.</p> > [% UNLESS ( Koha.Preference('OPACShibOnly') ) %] > [% IF ( casAuthentication ) %] > [% IF ( invalidCasLogin ) %] >@@ -144,7 +144,7 @@ > [% IF ( invalidCasLogin ) %] > <div class="alert alert-info"> > <!-- This is what is displayed if cas login has failed --> >- <p class="cas_invalid">Sorry, the CAS login failed.</p> >+ <p class="cas_invalid" role="alert" aria-live="assertive">Sorry, the CAS login failed.</p> > </div> > [% END %] > >@@ -204,18 +204,18 @@ > > [% IF !(invalid_username_or_password || too_many_login_attempts) and is_anonymous_patron %] > <div class="alert alert-info"> >- <p><strong>Error: </strong>You can't log in as the anonymous patron!</p> >+ <p aria-live="assertive" role="alert"><strong>Error: </strong>You can't log in as the anonymous patron!</p> > </div> > [% END %] > > [% IF !(invalid_username_or_password || too_many_login_attempts) and password_has_expired %] > [% IF date_enrolled == password_expiration_date %] > <div class="alert alert-info"> >- <p><strong>Error: </strong>It's your first login! You need to reset your password.</p> >+ <p aria-live="assertive" role="alert"><strong>Error: </strong>It's your first login! You need to reset your password.</p> > </div> > [% ELSE %] > <div class="alert alert-info"> >- <p><strong>Error: </strong>Your password has expired!</p> >+ <p aria-live="assertive" role="alert"><strong>Error: </strong>Your password has expired!</p> > </div> > [% END %] > [% IF Koha.Preference('EnableExpiredPasswordReset') %] >-- >2.49.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 39494
:
180727
|
180736
| 182187