Bug 18025: Simplify logic and avoid 1 call to ValidateBorrowernumber
Signed-off-by: Liz Rea <liz@catalyst.net.nz> This is fine with me. Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
parent
01f69eb8a2
commit
a471ad80bb
1 changed files with 8 additions and 10 deletions
|
@ -90,18 +90,16 @@ if ( $query->param('sendEmail') || $query->param('resendEmail') ) {
|
|||
}
|
||||
|
||||
# Check if a password reset already issued for this borrower AND we are not asking for a new email
|
||||
elsif ( ValidateBorrowernumber( $borrower->borrowernumber )
|
||||
&& !$query->param('resendEmail') )
|
||||
{
|
||||
elsif ( not $query->param('resendEmail') ) {
|
||||
if ( ValidateBorrowernumber( $borrower->borrowernumber ) ) {
|
||||
$hasError = 1;
|
||||
$errAlreadyStartRecovery = 1;
|
||||
}
|
||||
elsif ( !ValidateBorrowernumber($borrower->borrowernumber)
|
||||
&& !$query->param('resendEmail') )
|
||||
{
|
||||
else {
|
||||
DeleteExpiredPasswordRecovery( $borrower->borrowernumber );
|
||||
}
|
||||
}
|
||||
}
|
||||
else { # 0 matching borrower
|
||||
$hasError = 1;
|
||||
$errNoBorrowerFound = 1;
|
||||
|
|
Loading…
Reference in a new issue