|
Lines 21-26
use Modern::Perl;
Link Here
|
| 21 |
|
21 |
|
| 22 |
use C4::Debug; |
22 |
use C4::Debug; |
| 23 |
use C4::Context; |
23 |
use C4::Context; |
|
|
24 |
use Koha::Database; |
| 24 |
use Carp; |
25 |
use Carp; |
| 25 |
use CGI; |
26 |
use CGI; |
| 26 |
|
27 |
|
|
Lines 94-109
sub checkpw_shib {
Link Here
|
| 94 |
my $config = _get_shib_config(); |
95 |
my $config = _get_shib_config(); |
| 95 |
$debug and warn "User Shibboleth-authenticated as: $match"; |
96 |
$debug and warn "User Shibboleth-authenticated as: $match"; |
| 96 |
|
97 |
|
| 97 |
# Does the given shibboleth attribute value ($match) match a valid koha user ? |
98 |
# Does the given shibboleth attribute value ($match) match a valid koha user ? |
| 98 |
my $sth = $dbh->prepare( |
99 |
my $borrower = |
| 99 |
"select cardnumber, userid from borrowers where $config->{matchpoint}=?" |
100 |
Koha::Database->new()->schema()->resultset('Borrower') |
| 100 |
); |
101 |
->find( { $config->{matchpoint} => $match } ); |
| 101 |
$sth->execute($match); |
102 |
if ( defined($borrower) ) { |
| 102 |
if ( $sth->rows ) { |
103 |
return ( 1, $borrower->get_column('cardnumber'), $borrower->get_column('userid') ); |
| 103 |
my @retvals = $sth->fetchrow; |
|
|
| 104 |
$retnumber = $retvals[0]; |
| 105 |
$userid = $retvals[1]; |
| 106 |
return ( 1, $retnumber, $userid ); |
| 107 |
} |
104 |
} |
| 108 |
|
105 |
|
| 109 |
# If we reach this point, the user is not a valid koha user |
106 |
# If we reach this point, the user is not a valid koha user |
| 110 |
- |
|
|