From 020ab83ddeb303d8522d9321ae312b95fac87e89 Mon Sep 17 00:00:00 2001 From: koha Date: Tue, 30 May 2017 13:29:11 -0700 Subject: [PATCH] Bug 18616 - The "Add forgot password link to OPAC" should allow patrons to use their library card number in addition to username Allow patrons to enter either their library card number or user name in the "Log in" box for password recovery. Most patrons at our library use their card number to log in and are unaware of what their userid is. However there are some who have set a customized userid and would prefer to use that. This patch would allow either to be entered for password recovery. To test: 1. Enable the password recovery feature. 2. In the OPAC, click on "Forgot you password?" link and enter a valid library card number. 3. The error message "No account found with the provided information" appears. 4. Apply the patch. 5. Repeat step 2. The recovery email is now sent. --- opac/opac-password-recovery.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opac/opac-password-recovery.pl b/opac/opac-password-recovery.pl index 8c76015..7b397a9 100755 --- a/opac/opac-password-recovery.pl +++ b/opac/opac-password-recovery.pl @@ -58,7 +58,7 @@ if ( $query->param('sendEmail') || $query->param('resendEmail') ) { # Find the borrower by his userid or email if ($username) { - $search_results = [ Koha::Patrons->search( { userid => $username } ) ]; + $search_results = [ Koha::Patrons->search( { -or => { userid => $username, cardnumber => $username } } ) ]; } elsif ($email) { $search_results = [ Koha::Patrons->search( { -or => { email => $email, emailpro => $email, B_email => $email } } ) ]; -- 2.1.4