Lines 995-1006
sub checkauth {
Link Here
|
995 |
# doesn't have a userid. So if there is none, we pass along the |
995 |
# doesn't have a userid. So if there is none, we pass along the |
996 |
# borrower number, and the bits of code that need to know the user |
996 |
# borrower number, and the bits of code that need to know the user |
997 |
# ID will have to be smart enough to handle that. |
997 |
# ID will have to be smart enough to handle that. |
998 |
require C4::Members; |
998 |
my $patrons = Koha::Patrons->search({ email => $value }); |
999 |
my @users_info = C4::Members::GetBorrowersWithEmail($value); |
999 |
if ($patrons->count) { |
1000 |
if (@users_info) { |
|
|
1001 |
|
1000 |
|
1002 |
# First the userid, then the borrowernum |
1001 |
# First the userid, then the borrowernum |
1003 |
$value = $users_info[0][1] || $users_info[0][0]; |
1002 |
my $patron = $patrons->next; |
|
|
1003 |
$value = $patron->userid || $patron->borrowernumber; |
1004 |
} else { |
1004 |
} else { |
1005 |
undef $value; |
1005 |
undef $value; |
1006 |
} |
1006 |
} |