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

(-)a/C4/Auth.pm (-2 / +1 lines)
Lines 2146-2153 sub checkpw { Link Here
2146
    }
2146
    }
2147
2147
2148
    if ( defined $userid && !$patron ) {
2148
    if ( defined $userid && !$patron ) {
2149
        $patron = Koha::Patrons->find( { userid     => $userid } );
2149
        $patron = Koha::Patrons->find_by_identifier($userid);
2150
        $patron = Koha::Patrons->find( { cardnumber => $userid } ) unless $patron;
2151
        push @return, $patron if $check_internal_as_fallback;    # We pass back the patron if authentication fails
2150
        push @return, $patron if $check_internal_as_fallback;    # We pass back the patron if authentication fails
2152
    }
2151
    }
2153
2152
(-)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 4494-4501 Missing POD for ProcessOfflineIssue. Link Here
4494
sub ProcessOfflineIssue {
4494
sub ProcessOfflineIssue {
4495
    my $operation = shift;
4495
    my $operation = shift;
4496
4496
4497
    my $patron = Koha::Patrons->find( { cardnumber => $operation->{cardnumber} } );
4497
    my $patron = Koha::Patrons->find_by_identifier( $operation->{cardnumber} );
4498
    $patron ||= Koha::Patrons->find( { userid => $operation->{cardnumber} } );
4499
4498
4500
    if ($patron) {
4499
    if ($patron) {
4501
        my $item = Koha::Items->find( { barcode => $operation->{barcode} } );
4500
        my $item = Koha::Items->find( { barcode => $operation->{barcode} } );
Lines 4536-4543 Missing POD for ProcessOfflinePayment. Link Here
4536
sub ProcessOfflinePayment {
4535
sub ProcessOfflinePayment {
4537
    my $operation = shift;
4536
    my $operation = shift;
4538
4537
4539
    my $patron = Koha::Patrons->find( { cardnumber => $operation->{cardnumber} } );
4538
    my $patron = Koha::Patrons->find_by_identifier( $operation->{cardnumber} );
4540
    $patron ||= Koha::Patrons->find( { userid => $operation->{cardnumber} } );
4541
4539
4542
    $patron->account->pay(
4540
    $patron->account->pay(
4543
        {
4541
        {
(-)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 338-345 sub _basic_auth { Link Here
338
    my $decoded_credentials = decode_base64($credentials);
338
    my $decoded_credentials = decode_base64($credentials);
339
    my ( $identifier, $password ) = split( /:/, $decoded_credentials, 2 );
339
    my ( $identifier, $password ) = split( /:/, $decoded_credentials, 2 );
340
340
341
    my $patron = Koha::Patrons->find( { userid => $identifier } );
341
    my $patron = Koha::Patrons->find_by_identifier($identifier);
342
    $patron //= Koha::Patrons->find( { cardnumber => $identifier } );
343
342
344
    unless ( checkpw_internal( $identifier, $password ) ) {
343
    unless ( checkpw_internal( $identifier, $password ) ) {
345
        Koha::Exceptions::Authorization::Unauthorized->throw( error => 'Invalid password' );
344
        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