}
if ( defined $userid && !$patron ) {
$patron = Koha::Patrons->find( { userid => $userid } );
$patron = Koha::Patrons->find_by_identifier($userid);
$patron = Koha::Patrons->find( { cardnumber => $userid } ) unless $patron;
push @return, $patron if $check_internal_as_fallback; # We pass back the patron if authentication fails
# Does it match one of our users ?
my $dbh = C4::Context->dbh;
my $patron = Koha::Patrons->find( { userid => $userid } );
my $patron = Koha::Patrons->find_by_identifier($userid);
if ($patron) {
return ( 1, $patron->cardnumber, $patron->userid, $ticket, $patron );
$patron = Koha::Patrons->find( { cardnumber => $userid } );
sub ProcessOfflineIssue {
my $operation = shift;
my $patron = Koha::Patrons->find( { cardnumber => $operation->{cardnumber} } );
my $patron = Koha::Patrons->find_by_identifier( $operation->{cardnumber} );
$patron ||= Koha::Patrons->find( { userid => $operation->{cardnumber} } );
my $item = Koha::Items->find( { barcode => $operation->{barcode} } );
sub ProcessOfflinePayment {
$patron->account->pay(
{
$patron = Koha::Patrons->find( { userid => $patron_id->{userid} } );
} else {
$patron = Koha::Patrons->find( { cardnumber => $patron_id } )
$patron = Koha::Patrons->find_by_identifier($patron_id);
|| Koha::Patrons->find( { userid => $patron_id } );
unless ($patron) {
my $decoded_credentials = decode_base64($credentials);
my ( $identifier, $password ) = split( /:/, $decoded_credentials, 2 );
my $patron = Koha::Patrons->find( { userid => $identifier } );
my $patron = Koha::Patrons->find_by_identifier($identifier);
$patron //= Koha::Patrons->find( { cardnumber => $identifier } );
unless ( checkpw_internal( $identifier, $password ) ) {
Koha::Exceptions::Authorization::Unauthorized->throw( error => 'Invalid password' );
my $patron =
$_->{cardnumber}
? Koha::Patrons->find( { cardnumber => $_->{cardnumber} } )
? Koha::Patrons->find_by_identifier( $_->{cardnumber} )
|| Koha::Patrons->find( { userid => $_->{cardnumber} } )
: undef;
my $newpassword = $query->param('newpassword');
my $confirmpassword = $query->param('confirmpassword');
if ( $patron && $patron->password_expiration_date ) {
if ( $patron->account_locked ) {
-