@@ -, +, @@
* a message "Patron's account has been locked (due to X failed login attempts)" on the patron details and circulation pages
* a link to change password
* a link to reset login attempts to 0
---
.../prog/en/includes/patron_messages.inc | 20 ++++++++++++++++++-
members/setstatus.pl | 3 +++
2 files changed, 22 insertions(+), 1 deletion(-)
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc
+++ a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc
@@ -4,7 +4,7 @@
[% SET return_claims = patron.return_claims %]
[% SET logged_in_branchcode = Branches.GetLoggedInBranchcode() %]
-[% IF ( has_modifications || warndeparture || returnbeforeexpiry || expired || patron.gonenoaddress || patron.lost || userdebarred || odues || ( return_claims.count > ClaimReturnedWarningThreshold ) || age_limitations || charges || charges_guarantors_guarantees || charges_guarantees || credits ) %]
+[% IF ( has_modifications || warndeparture || returnbeforeexpiry || expired || patron.account_locked || patron.gonenoaddress || patron.lost || userdebarred || odues || ( return_claims.count > ClaimReturnedWarningThreshold ) || age_limitations || charges || charges_guarantors_guarantees || charges_guarantees || credits ) %]
Attention
[% IF ( has_modifications ) %]
@@ -44,6 +44,24 @@
[% END %]
+ [% IF patron.account_locked %]
+ [% IF patron.login_attempts < 0 %]
+ -
+ Locked: Patron's account has been administratively locked
+
+ [% ELSE %]
+ -
+ Locked: Patron's account has been locked (due to [% patron.login_attempts | html %] failed login attempts)
+ [% IF CAN_user_borrowers_edit_borrowers %]
+
+ Change password
+ or Reset login attempts
+
+ [% END %]
+
+ [% END %]
+ [% END %]
+
[% IF ( patron.gonenoaddress ) %]
-
Address: Patron's address flagged as in doubt
--- a/members/setstatus.pl
+++ a/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 );
--