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