View | Details | Raw Unified | Return to bug 18880
Collapse All | Expand All

(-)a/C4/Auth.pm (-9 / +8 lines)
Lines 1776-1785 sub checkpw { Link Here
1776
    } elsif ($ldap) {
1776
    } elsif ($ldap) {
1777
        $debug and print STDERR "## checkpw - checking LDAP\n";
1777
        $debug and print STDERR "## checkpw - checking LDAP\n";
1778
        my ( $retval, $retcard, $retuserid ) = checkpw_ldap(@_);    # EXTERNAL AUTH
1778
        my ( $retval, $retcard, $retuserid ) = checkpw_ldap(@_);    # EXTERNAL AUTH
1779
        if ( $retval ) {
1779
        if ( $retval == 1 ) {
1780
            @return = ( $retval, $retcard, $retuserid );
1780
            @return = ( $retval, $retcard, $retuserid );
1781
            $passwd_ok = 1;
1781
        }
1782
        }
1782
        $passwd_ok = 1 if $retval == 1;
1783
        $check_internal_as_fallback = 1 if $retval == 0;
1783
        $check_internal_as_fallback = 1 if $retval == 0;
1784
1784
1785
    } elsif ( $cas && $query && $query->param('ticket') ) {
1785
    } elsif ( $cas && $query && $query->param('ticket') ) {
Lines 1824-1835 sub checkpw { Link Here
1824
        $passwd_ok = 1 if $return[0] > 0; # 1 or 2
1824
        $passwd_ok = 1 if $return[0] > 0; # 1 or 2
1825
    }
1825
    }
1826
1826
1827
    unless ( $passwd_ok ) { # Auth failed
1827
    if( $patron ) {
1828
        $patron->update({ login_attempts => $patron->login_attempts + 1 }) if $patron;
1828
        if ( $passwd_ok ) {
1829
    } elsif ( $patron ) {
1829
            $patron->update({ login_attempts => 0 });
1830
        # FIXME Koha::Object->update should return a Koha::Object to allow chaining
1830
        } else {
1831
        $patron->update({ login_attempts => 0 });
1831
            $patron->update({ login_attempts => $patron->login_attempts + 1 });
1832
        $patron->store;
1832
        }
1833
    }
1833
    }
1834
    return @return;
1834
    return @return;
1835
}
1835
}
1836
- 

Return to bug 18880