|
Lines 104-111
sub checkpw_shib {
Link Here
|
| 104 |
return ( 1, $borrower->get_column('cardnumber'), $borrower->get_column('userid') ); |
104 |
return ( 1, $borrower->get_column('cardnumber'), $borrower->get_column('userid') ); |
| 105 |
} |
105 |
} |
| 106 |
|
106 |
|
| 107 |
if ( $shib->{'autocreate'} ) { |
107 |
if ( $config->{'autocreate'} ) { |
| 108 |
return _autocreate( $dbh, $shib, $match ); |
108 |
return _autocreate( $config, $match ); |
| 109 |
} else { |
109 |
} else { |
| 110 |
# If we reach this point, the user is not a valid koha user |
110 |
# If we reach this point, the user is not a valid koha user |
| 111 |
$debug and warn "User $userid is not a valid Koha user"; |
111 |
$debug and warn "User $userid is not a valid Koha user"; |
|
Lines 114-124
sub checkpw_shib {
Link Here
|
| 114 |
} |
114 |
} |
| 115 |
|
115 |
|
| 116 |
sub _autocreate { |
116 |
sub _autocreate { |
| 117 |
my ( $dbh, $shib, $match ) = @_; |
117 |
my ( $config, $match ) = @_; |
| 118 |
|
118 |
|
| 119 |
my %borrower = ( $shibbolethMatchField => $match ); |
119 |
my %borrower = ( $shibbolethMatchField => $match ); |
| 120 |
|
120 |
|
| 121 |
while ( my ( $key, $entry ) = each %{$shib->{'mapping'}} ) { |
121 |
while ( my ( $key, $entry ) = each %{$config->{'mapping'}} ) { |
| 122 |
$borrower{$key} = ( $entry->{'is'} && $ENV{ $entry->{'is'} } ) || $entry->{'content'} || ''; |
122 |
$borrower{$key} = ( $entry->{'is'} && $ENV{ $entry->{'is'} } ) || $entry->{'content'} || ''; |
| 123 |
} |
123 |
} |
| 124 |
|
124 |
|
|
Lines 292-304
Returns the shibboleth login attribute should it be found present in the http se
Link Here
|
| 292 |
|
292 |
|
| 293 |
=head2 checkpw_shib |
293 |
=head2 checkpw_shib |
| 294 |
|
294 |
|
| 295 |
Given a database handle and a shib_login attribute, this routine checks for a matching local user and if found returns true, their cardnumber and their userid. If a match is not found, then this returns false. |
295 |
Given a shib_login attribute, this routine checks for a matching local user and if found returns true, their cardnumber and their userid. If a match is not found, then this returns false. |
| 296 |
|
296 |
|
| 297 |
my ( $retval, $retcard, $retuserid ) = C4::Auth_with_shibboleth::checkpw_shib( $shib_login ); |
297 |
my ( $retval, $retcard, $retuserid ) = C4::Auth_with_shibboleth::checkpw_shib( $shib_login ); |
| 298 |
|
298 |
|
| 299 |
=head2 _autocreate |
299 |
=head2 _autocreate |
| 300 |
|
300 |
|
| 301 |
my ( $retval, $retcard, $retuserid ) = _autocreate( $dbh, $shib, $userid ); |
301 |
my ( $retval, $retcard, $retuserid ) = _autocreate( $config, $match ); |
| 302 |
|
302 |
|
| 303 |
Given a database handle, a shibboleth attribute reference and a userid this internal routine will add the given user to koha and return their user credentials |
303 |
Given a database handle, a shibboleth attribute reference and a userid this internal routine will add the given user to koha and return their user credentials |
| 304 |
|
304 |
|
| 305 |
- |
|
|