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

(-)a/C4/ILSDI/Services.pm (-6 / +7 lines)
Lines 369-382 sub AuthenticatePatron { Link Here
369
    my $username = $cgi->param('username');
369
    my $username = $cgi->param('username');
370
    my $password = $cgi->param('password');
370
    my $password = $cgi->param('password');
371
    my ($status, $cardnumber, $userid) = C4::Auth::checkpw( C4::Context->dbh, $username, $password );
371
    my ($status, $cardnumber, $userid) = C4::Auth::checkpw( C4::Context->dbh, $username, $password );
372
    if ( $status ) {
372
    if ( $status )
373
        # Get the borrower
373
        # Get the borrower
374
        my $patron = Koha::Patrons->find( { userid => $userid } );
374
        my $patron = Koha::Patrons->find( { userid => $userid } );
375
        return { id => $patron->borrowernumber };
375
    else
376
    }
377
    else {
378
        return { code => 'PatronNotFound' };
376
        return { code => 'PatronNotFound' };
379
    }
377
378
    if ( $patron->lost )
379
	return { code => 'PatronLostCard' };
380
381
    return { id => $patron->borrowernumber };
380
}
382
}
381
383
382
=head2 GetPatronInfo
384
=head2 GetPatronInfo
383
- 

Return to bug 22925