Bugzilla – Attachment 190761 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: (follow-up) Fix the reset behaviour
Bug-37512-follow-up-Fix-the-reset-behaviour.patch (text/plain), 5.68 KB, created by
Baptiste Wojtkowski (bwoj)
on 2025-12-29 13:11:38 UTC
(
hide
)
Description:
Bug 37512: (follow-up) Fix the reset behaviour
Filename:
MIME Type:
Creator:
Baptiste Wojtkowski (bwoj)
Created:
2025-12-29 13:11:38 UTC
Size:
5.68 KB
patch
obsolete
>From dbabf6dbd8334d4c6546109c4c6c9b691df4ac9d Mon Sep 17 00:00:00 2001 >From: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com> >Date: Mon, 29 Dec 2025 12:58:00 +0000 >Subject: [PATCH] Bug 37512: (follow-up) Fix the reset behaviour > >This follow-up fixes the notifications and behaviour of the reset login >attempts function, in circ/circulation.pl and members/moremember.pl >--- > .../prog/en/modules/circ/circulation.tt | 3 +++ > .../prog/en/modules/members/moremember.tt | 3 +++ > members/moremember.pl | 21 ++++++++++--------- > members/setstatus.pl | 5 ++++- > 4 files changed, 21 insertions(+), 11 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >index 6214dd4c704..82d399d0f82 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -84,6 +84,9 @@ > [% IF ( was_renewed ) %] > <div class="alert alert-info">Patron's account has been renewed until [% expiry | $KohaDates %]</div> > [% END %] >+ [% IF ( was_resetted ) %] >+ <div class="alert alert-info"> Patron's account has been unlocked </div> >+ [% END %] > > [% IF autoswitched %] > <div id="autoswitched" class="alert alert-info">Patron was automatically switched by reading the patron card during checking out. Ensure you are working with the right patron.</div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >index 6ac0d5fd485..11b5d7c61d1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -90,6 +90,9 @@ > [% IF ( was_renewed ) %] > <div class="alert alert-info"> Patron's account has been renewed until [% patron.dateexpiry | $KohaDates %] </div> > [% END %] >+ [% IF ( was_resetted ) %] >+ <div class="alert alert-info"> Patron's account has been unlocked </div> >+ [% END %] > > [% messages = INCLUDE 'patron_messages.inc' moremember = 1 | trim %] > [% IF messages %] >diff --git a/members/moremember.pl b/members/moremember.pl >index 9cf8574e101..8bb6fc8297c 100755 >--- a/members/moremember.pl >+++ b/members/moremember.pl >@@ -292,16 +292,17 @@ my $has_modifications = Koha::Patron::Modifications->search( { borrowernumber = > my $patron_lists_count = $patron->get_lists_with_patron->count(); > > $template->param( >- patron => $patron, >- issuecount => $patron->checkouts->count, >- holds_count => $patron->holds->count_holds, >- fines => $patron->account->balance, >- translated_language => $translated_language, >- detailview => 1, >- was_renewed => scalar $input->param('was_renewed') ? 1 : 0, >- $category_type => 1, # [% IF ( I ) %] = institutional/organisation >- housebound_role => scalar $patron->housebound_role, >- relatives_issues_count => $relatives_issues_count, >+ patron => $patron, >+ issuecount => $patron->checkouts->count, >+ holds_count => $patron->holds->count_holds, >+ fines => $patron->account->balance, >+ translated_language => $translated_language, >+ detailview => 1, >+ was_renewed => scalar $input->param('was_renewed') ? 1 : 0, >+ was_resetted => scalar $input->param('was_resetted') ? 1 : 0, >+ $category_type => 1, # [% IF ( I ) %] = institutional/organisation >+ housebound_role => scalar $patron->housebound_role, >+ relatives_issues_count => $relatives_issues_count, > relatives_borrowernumbers => \@relatives, > logged_in_user => $logged_in_user, > files => Koha::Patron::Files->new( borrowernumber => $borrowernumber )->GetFilesInfo(), >diff --git a/members/setstatus.pl b/members/setstatus.pl >index 4574ac36547..e6d88da9eb8 100755 >--- a/members/setstatus.pl >+++ b/members/setstatus.pl >@@ -69,7 +69,6 @@ if ( $logged_in_user->can_see_patron_infos($patron) ) { > } elsif ( $op == "cud-reset_login_attempts" ) { > try { > $patron->login_attempts(0)->store; >- $dateexpiry = $patron->renew_account; > } catch { > if ( ref($_) eq 'Koha::Exceptions::Patron::Relationship::NoGuarantor' ) { > $cannot_reset = '1'; >@@ -91,6 +90,8 @@ if ( $destination eq "circ" ) { > print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber&noresetnoguarantor=1"); > } elsif ($dateexpiry) { > print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber&was_renewed=1"); >+ } elsif ( $op == "cud-reset_login_attempts" ) { >+ print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber&was_resetted=1"); > } else { > print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber"); > } >@@ -101,6 +102,8 @@ if ( $destination eq "circ" ) { > ); > } elsif ($dateexpiry) { > print $input->redirect("/cgi-bin/koha/members/moremember.pl?borrowernumber=$borrowernumber&was_renewed=1"); >+ } elsif ( $op == "cud-reset_login_attempts" ) { >+ print $input->redirect("/cgi-bin/koha/members/moremember.pl?borrowernumber=$borrowernumber&was_resetted=1"); > } else { > print $input->redirect("/cgi-bin/koha/members/moremember.pl?borrowernumber=$borrowernumber"); > } >-- >2.43.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 37512
:
169845
|
169846
|
169854
|
169865
|
176958
|
177061
|
179433
|
179470
|
179471
|
179829
|
179830
|
184730
|
184731
|
188666
| 190761