Bug 12026: [Followup] Rebasing
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 12 Oct 2016 10:08:31 +0000 (10:08 +0000)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 31 Mar 2017 14:28:17 +0000 (14:28 +0000)
Signed-off-by: Mirko Tietgen <mirko@abunchofthings.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
C4/Auth_with_shibboleth.pm

index b9b98d3..1a68c96 100644 (file)
@@ -104,8 +104,8 @@ sub checkpw_shib {
         return ( 1, $borrower->get_column('cardnumber'), $borrower->get_column('userid') );
     }
 
-    if ( $shib->{'autocreate'} ) {
-        return _autocreate( $dbh, $shib, $match );
+    if ( $config->{'autocreate'} ) {
+        return _autocreate( $config, $match );
     } else {
         # If we reach this point, the user is not a valid koha user
         $debug and warn "User $userid is not a valid Koha user";
@@ -114,11 +114,11 @@ sub checkpw_shib {
 }
 
 sub _autocreate {
-    my ( $dbh, $shib, $match ) = @_;
+    my ( $config, $match ) = @_;
 
     my %borrower = ( $shibbolethMatchField => $match );
 
-    while ( my ( $key, $entry ) = each %{$shib->{'mapping'}} ) {
+    while ( my ( $key, $entry ) = each %{$config->{'mapping'}} ) {
         $borrower{$key} = ( $entry->{'is'} && $ENV{ $entry->{'is'} } ) || $entry->{'content'} || '';
     }
 
@@ -292,13 +292,13 @@ Returns the shibboleth login attribute should it be found present in the http se
 
 =head2 checkpw_shib
 
-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.
+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.
 
   my ( $retval, $retcard, $retuserid ) = C4::Auth_with_shibboleth::checkpw_shib( $shib_login );
 
 =head2 _autocreate
 
-  my ( $retval, $retcard, $retuserid ) = _autocreate( $dbh, $shib, $userid );
+  my ( $retval, $retcard, $retuserid ) = _autocreate( $config, $match );
 
 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