Bugzilla – Attachment 177061 Details for
Bug 37512
Add a function to reset login attempts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37512: Add a button to reset login attempts
Bug-37512-Add-a-button-to-reset-login-attempts.patch (text/plain), 3.18 KB, created by
Baptiste Wojtkowski (bwoj)
on 2025-01-23 15:03:16 UTC
(
hide
)
Description:
Bug 37512: Add a button to reset login attempts
Filename:
MIME Type:
Creator:
Baptiste Wojtkowski (bwoj)
Created:
2025-01-23 15:03:16 UTC
Size:
3.18 KB
patch
obsolete
>From 91e5f589382d0531cfb1cc1ad3eaba25b7d64c7e Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Mon, 29 Jul 2024 16:35:55 +0200 >Subject: [PATCH] Bug 37512: Add a button to reset login attempts > >When using system preference 'FailedLoginAttempts', a patron's account is blocked after X many failed login attempts on the OPAC. > >This patch adds, like for "Patron's card has expired" message : > * a link to reset login attempts to 0 >Link is only displayed if libarian has permission to edit patrons. > >Reset login attempts to 0 feature uses members/setstatus.pl with >resetloginattempts=y like reregistration=y for an expired patron > >To test: >1. Apply BZ25947 >2. Change system preference 'FailedLoginAttempts' to a small number, like 2 >3. Go to a patron's account and copy their username (while you're there, change the password and add some fines, too) >4. In the OPAC, try to log in with the username and a wrong password 3 times >5. Go back to the patron's account in the staff interface >6. Note that there is a message : "Patron's account has been locked (due to 3 failed login attempts)" > >Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> >--- > koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc | 1 + > members/setstatus.pl | 3 +++ > 2 files changed, 4 insertions(+) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc >index 72e813b0..6a16fa45 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc >@@ -64,6 +64,7 @@ > <a href="/cgi-bin/koha/members/member-password.pl?member=[% patron.borrowernumber | uri %]">Change password</a> > <span data-bs-toggle="tooltip" title="Resetting password will remove lock on account" data-bs-placement="right" class="fa fa-info-circle" /> > </span> >+ or <a href="/cgi-bin/koha/members/setstatus.pl?borrowernumber=[% patron.borrowernumber | uri %]&destination=circ&resetloginattempts=y">Reset login attempts</a> > [% END %] > </li> > [% END %] >diff --git a/members/setstatus.pl b/members/setstatus.pl >index 83ef1590..faf9bf9c 100755 >--- a/members/setstatus.pl >+++ b/members/setstatus.pl >@@ -40,6 +40,7 @@ my $destination = $input->param("destination") || ''; > my $borrowernumber=$input->param('borrowernumber'); > my $status = $input->param('status'); > my $reregistration = $input->param('reregistration') || ''; >+my $resetloginattempts = $input->param('resetloginattempts') || ''; > > my $dbh = C4::Context->dbh; > my $dateexpiry; >@@ -54,6 +55,8 @@ if ( $logged_in_user->can_see_patron_infos($patron) ) { > if ( $reregistration eq 'y' ) { > # re-reregistration function to automatic calcul of date expiry > $dateexpiry = $patron->renew_account; >+ } elsif ( $resetloginattempts eq 'y' ) { >+ $patron->login_attempts(0)->store; > } else { > my $sth = $dbh->prepare("UPDATE borrowers SET debarred = ?, debarredcomment = '' WHERE borrowernumber = ?"); > $sth->execute( $status, $borrowernumber ); >-- >2.30.2
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 37512
:
169845
|
169846
|
169854
|
169865
|
176958
| 177061