Bug 12026: [Follow up] Added Documentation

Updated to work with match point selection

- The base bug that this patch enhances has added the ability to choose
  your match point in the configuration file. This patch adds code to
  take that change into account.

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>
This commit is contained in:
Martin Renvoize 2014-07-30 14:53:27 +00:00 committed by Kyle M Hall
parent 9b92ce4cd1
commit d0e40439cd
1 changed files with 11 additions and 3 deletions

View File

@ -105,7 +105,7 @@ sub checkpw_shib {
}
if ( $shib->{'autocreate'} ) {
return _autocreate( $dbh, $shib, $userid );
return _autocreate( $dbh, $shib, $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,9 +114,9 @@ sub checkpw_shib {
}
sub _autocreate {
my ( $dbh, $shib, $userid ) = @_;
my ( $dbh, $shib, $match ) = @_;
my %borrower = ( userid => $userid );
my %borrower = ( $shibbolethMatchField => $match );
while ( my ( $key, $entry ) = each %{$shib->{'mapping'}} ) {
$borrower{$key} = ( $entry->{'is'} && $ENV{ $entry->{'is'} } ) || $entry->{'content'} || '';
@ -296,6 +296,14 @@ Given a database handle and a shib_login attribute, this routine checks for a ma
my ( $retval, $retcard, $retuserid ) = C4::Auth_with_shibboleth::checkpw_shib( $shib_login );
=head2 _autocreate
my ( $retval, $retcard, $retuserid ) = _autocreate( $dbh, $shib, $userid );
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
This routine is NOT exported
=head1 SEE ALSO
=cut