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

(-)a/C4/Auth_with_shibboleth.pm (-4 / +11 lines)
Lines 105-111 sub checkpw_shib { Link Here
105
    }
105
    }
106
106
107
    if ( $shib->{'autocreate'} ) {
107
    if ( $shib->{'autocreate'} ) {
108
        return _autocreate( $dbh, $shib, $userid );
108
        return _autocreate( $dbh, $shib, $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-122 sub checkpw_shib { Link Here
114
}
114
}
115
115
116
sub _autocreate {
116
sub _autocreate {
117
    my ( $dbh, $shib, $userid ) = @_;
117
    my ( $dbh, $shib, $match ) = @_;
118
118
119
    my %borrower = ( userid => $userid );
119
    my %borrower = ( $shibbolethMatchField => $match );
120
120
121
    while ( my ( $key, $entry ) = each %{$shib->{'mapping'}} ) {
121
    while ( my ( $key, $entry ) = each %{$shib->{'mapping'}} ) {
122
        $borrower{$key} = ( $entry->{'is'} && $ENV{ $entry->{'is'} } ) || $entry->{'content'} || '';
122
        $borrower{$key} = ( $entry->{'is'} && $ENV{ $entry->{'is'} } ) || $entry->{'content'} || '';
Lines 296-301 Given a database handle and a shib_login attribute, this routine checks for a ma Link Here
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
300
301
  my ( $retval, $retcard, $retuserid ) = _autocreate( $dbh, $shib, $userid );
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
304
305
This routine is NOT exported
306
299
=head1 SEE ALSO
307
=head1 SEE ALSO
300
308
301
=cut
309
=cut
302
- 

Return to bug 12026