Bug 37104: (Follow up) Restructure checkpw code
Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
0f2a5bf987
commit
99b2fab569
1 changed files with 4 additions and 5 deletions
|
@ -1418,8 +1418,8 @@ sub checkauth {
|
|||
my $auth_template_name = ( $type eq 'opac' ) ? 'opac-auth.tt' : 'auth.tt';
|
||||
my $template = C4::Templates::gettemplate( $auth_template_name, $type, $query );
|
||||
|
||||
my $borrowernumber = $patron and $patron->borrowernumber;
|
||||
my $anonymous_patron = C4::Context->preference('AnonymousPatron');
|
||||
my $borrowernumber = $patron and $patron->borrowernumber;
|
||||
my $anonymous_patron = C4::Context->preference('AnonymousPatron');
|
||||
my $is_anonymous_patron = $patron && ( $patron->borrowernumber eq $anonymous_patron );
|
||||
|
||||
$template->param(
|
||||
|
@ -2062,10 +2062,9 @@ sub checkpw {
|
|||
@return = ();
|
||||
} elsif ($passwd_ok) {
|
||||
$patron->update( { login_attempts => 0 } );
|
||||
if ( $patron->password_expired ) {
|
||||
@return = ( -2, $patron );
|
||||
}
|
||||
if ( $patron->borrowernumber eq $anonymous_patron ) {
|
||||
@return = ( -3, $patron );
|
||||
} elsif ( $patron->password_expired ) {
|
||||
@return = ( -2, $patron );
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue