From 0f31324b6642876ad51aba7b35684646a4cac4c2 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 19 Dec 2018 17:53:08 +0000 Subject: [PATCH] Bug 22030: Send cardnumber to overdrive instead of username To test: 1 - Have an OverDrive account setup with SIP authentication Note: You can apply for a testing account at developer.overdrive.com and setup an environment 2 - Fill in all your OverDrive system preferences 3 - Test with a patron whose username is theri cardnumber 4 - Confirm their overdrive account tab on opac loads 5 - Change the username to be another value like "borked_wont_work" 6 - Note the overdrive account tab won't load 7 - Apply patch 8 - Note the OD account loads successfully --- opac/svc/overdrive | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/opac/svc/overdrive b/opac/svc/overdrive index 3ede3f4..9ac9405 100755 --- a/opac/svc/overdrive +++ b/opac/svc/overdrive @@ -48,9 +48,10 @@ eval { my $password = $cgi->param("password") // q{} ; my $patron = Koha::Patrons->find({ userid => $user }); my $branch_info = $patron ? Koha::Library::OverDriveInfos->find( $patron->branchcode ) : undef; + my $cardnumber = $patron ? $patron->cardnumber : undef; my $branch_authname = $branch_info ? $branch_info->authname : undef; my $authname = $branch_authname || C4::Context->preference('OverDriveAuthname'); - $od->auth_by_userid($user, $password,C4::Context->preference('OverDriveWebsiteID'),$authname); + $od->auth_by_userid($cardnumber, $password,C4::Context->preference('OverDriveWebsiteID'),$authname); $data{login_success} = 1; last; }; -- 2.1.4