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

(-)a/C4/Auth.pm (-2 / +1 lines)
Lines 2142-2149 sub checkpw { Link Here
2142
    }
2142
    }
2143
2143
2144
    if ( defined $userid && !$patron ) {
2144
    if ( defined $userid && !$patron ) {
2145
        $patron = Koha::Patrons->find( { userid     => $userid } );
2145
        $patron = Koha::Patrons->find_by_identifier($userid);
2146
        $patron = Koha::Patrons->find( { cardnumber => $userid } ) unless $patron;
2147
        push @return, $patron if $check_internal_as_fallback;    # We pass back the patron if authentication fails
2146
        push @return, $patron if $check_internal_as_fallback;    # We pass back the patron if authentication fails
2148
    }
2147
    }
2149
2148
(-)a/C4/Auth_with_cas.pm (-5 / +1 lines)
Lines 160-170 sub checkpw_cas { Link Here
160
160
161
            # Does it match one of our users ?
161
            # Does it match one of our users ?
162
            my $dbh    = C4::Context->dbh;
162
            my $dbh    = C4::Context->dbh;
163
            my $patron = Koha::Patrons->find( { userid => $userid } );
163
            my $patron = Koha::Patrons->find_by_identifier($userid);
164
            if ($patron) {
165
                return ( 1, $patron->cardnumber, $patron->userid, $ticket, $patron );
166
            }
167
            $patron = Koha::Patrons->find( { cardnumber => $userid } );
168
            if ($patron) {
164
            if ($patron) {
169
                return ( 1, $patron->cardnumber, $patron->userid, $ticket, $patron );
165
                return ( 1, $patron->cardnumber, $patron->userid, $ticket, $patron );
170
            }
166
            }
(-)a/C4/Circulation.pm (-4 / +2 lines)
Lines 4542-4549 Missing POD for ProcessOfflineIssue. Link Here
4542
sub ProcessOfflineIssue {
4542
sub ProcessOfflineIssue {
4543
    my $operation = shift;
4543
    my $operation = shift;
4544
4544
4545
    my $patron = Koha::Patrons->find( { cardnumber => $operation->{cardnumber} } );
4545
    my $patron = Koha::Patrons->find_by_identifier( $operation->{cardnumber} );
4546
    $patron ||= Koha::Patrons->find( { userid => $operation->{cardnumber} } );
4547
4546
4548
    if ($patron) {
4547
    if ($patron) {
4549
        my $item = Koha::Items->find( { barcode => $operation->{barcode} } );
4548
        my $item = Koha::Items->find( { barcode => $operation->{barcode} } );
Lines 4584-4591 Missing POD for ProcessOfflinePayment. Link Here
4584
sub ProcessOfflinePayment {
4583
sub ProcessOfflinePayment {
4585
    my $operation = shift;
4584
    my $operation = shift;
4586
4585
4587
    my $patron = Koha::Patrons->find( { cardnumber => $operation->{cardnumber} } );
4586
    my $patron = Koha::Patrons->find_by_identifier( $operation->{cardnumber} );
4588
    $patron ||= Koha::Patrons->find( { userid => $operation->{cardnumber} } );
4589
4587
4590
    $patron->account->pay(
4588
    $patron->account->pay(
4591
        {
4589
        {
(-)a/C4/SIP/ILS/Patron.pm (-2 / +1 lines)
Lines 59-66 sub new { Link Here
59
            $patron = Koha::Patrons->find( { userid => $patron_id->{userid} } );
59
            $patron = Koha::Patrons->find( { userid => $patron_id->{userid} } );
60
        }
60
        }
61
    } else {
61
    } else {
62
        $patron = Koha::Patrons->find( { cardnumber => $patron_id } )
62
        $patron = Koha::Patrons->find_by_identifier($patron_id);
63
            || Koha::Patrons->find( { userid => $patron_id } );
64
    }
63
    }
65
64
66
    unless ($patron) {
65
    unless ($patron) {
(-)a/Koha/REST/V1/Auth.pm (-2 / +1 lines)
Lines 339-346 sub _basic_auth { Link Here
339
    my $decoded_credentials = decode_base64($credentials);
339
    my $decoded_credentials = decode_base64($credentials);
340
    my ( $identifier, $password ) = split( /:/, $decoded_credentials, 2 );
340
    my ( $identifier, $password ) = split( /:/, $decoded_credentials, 2 );
341
341
342
    my $patron = Koha::Patrons->find( { userid => $identifier } );
342
    my $patron = Koha::Patrons->find_by_identifier($identifier);
343
    $patron //= Koha::Patrons->find( { cardnumber => $identifier } );
344
343
345
    unless ( checkpw_internal( $identifier, $password ) ) {
344
    unless ( checkpw_internal( $identifier, $password ) ) {
346
        Koha::Exceptions::Authorization::Unauthorized->throw( error => 'Invalid password' );
345
        Koha::Exceptions::Authorization::Unauthorized->throw( error => 'Invalid password' );
(-)a/offline_circ/list.pl (-2 / +1 lines)
Lines 53-60 for (@$operations) { Link Here
53
53
54
    my $patron =
54
    my $patron =
55
        $_->{cardnumber}
55
        $_->{cardnumber}
56
        ? Koha::Patrons->find( { cardnumber => $_->{cardnumber} } )
56
        ? Koha::Patrons->find_by_identifier( $_->{cardnumber} )
57
        || Koha::Patrons->find( { userid => $_->{cardnumber} } )
58
        : undef;
57
        : undef;
59
58
60
    if ($patron) {
59
    if ($patron) {
(-)a/opac/opac-reset-password.pl (-3 / +1 lines)
Lines 45-52 if ( $op eq 'cud-update' ) { Link Here
45
    my $newpassword     = $query->param('newpassword');
45
    my $newpassword     = $query->param('newpassword');
46
    my $confirmpassword = $query->param('confirmpassword');
46
    my $confirmpassword = $query->param('confirmpassword');
47
47
48
    my $patron = Koha::Patrons->find( { userid => $userid } );
48
    my $patron = Koha::Patrons->find_by_identifier($userid);
49
    $patron = Koha::Patrons->find( { cardnumber => $userid } ) unless $patron;
50
49
51
    if ( $patron && $patron->password_expiration_date ) {
50
    if ( $patron && $patron->password_expiration_date ) {
52
        if ( $patron->account_locked ) {
51
        if ( $patron->account_locked ) {
53
- 

Return to bug 40275