Koha/admin/overdrive.pl
Nick Clemens e762bdb9b2 Bug 21082: Update OverDrive authentication method
Testing will require an OverDrive account, you should be able to obtain a
developer account here:
https://developer.overdrive.com/

You will need to register a SIP connection for patron authentication

To test authentication:
 1 - Set authname default in OD prefs
 2 - Sign in as a patron whose branch matches authname
 3 - Verify the patron can sign into OverDrive
 4 - Set the patrons branch authname to be incorrect
 5 - Verify branch specific authname is used and patron cannot sign in
 6 - Set the default authname to be incorrect and patron's branch
 authname to be correct
 7 - Verofy patron can sign in

To test circulation:
 1 - Fill out all OD prefs and enable circulation
 2 - Sign in to opac
 3 - Verify you have an OverDrive tab
 4 - Click 'Login to Overdrive'
 5 - If password required you shoudl be prompted, otherwise you should be
signed in and see account info
 6 - Test logging out and in
 7 - Log-in, perform a search on the opac - you should see hold/checkout
buttons
 8 - Test the buttons
 9 - After holding/checking out items, check your account page
10 - Verify info is correct
11 - Log out of overdrive
12 - Search catalog click overdrive results
13 - Test "Login to Overdrive" link on OD results
14 - Verify page is reloaded, buttons show and work

Signed-off-by: Sandy Allgood <sandy.allgood@citruslibraries.org>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2018-10-09 11:04:23 +00:00

74 lines
2.3 KiB
Perl
Executable file

#!/usr/bin/perl
# Copyright Koha Development Team
#
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Koha is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Koha; if not, see <http://www.gnu.org/licenses>.
use Modern::Perl;
use CGI qw ( -utf8 );
use C4::Auth;
use C4::Context;
use C4::Output;
use Koha::Libraries;
use Koha::Library::OverDriveInfos;
my $input = CGI->new;
my @branchcodes = $input->multi_param('branchcode');
my @authnames = $input->multi_param('authname');
my $op = $input->param('op');
our ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ template_name => 'admin/overdrive.tt',
query => $input,
type => 'intranet',
authnotrequired => 0,
flagsrequired => { parameters => 'parameters_remaining_permissions' },
}
);
if ( $op && $op eq 'update' ) {
my %od_info;
@od_info{ @branchcodes } = @authnames;
while( my($branchcode,$authname) = each %od_info){
my $cur_info = Koha::Library::OverDriveInfos->find($branchcode);
if( $cur_info ) {
$cur_info->authname($authname)->store;
} else {
Koha::Library::OverDriveInfo->new({
branchcode => $branchcode,
authname => $authname,
})->store;
}
}
}
my @branches = Koha::Libraries->search();
my @branch_od_info;
foreach my $branch ( @branches ){
my $od_info = Koha::Library::OverDriveInfos->find($branch->branchcode);
if( $od_info ){
push @branch_od_info, { branchcode => $od_info->branchcode, authname => $od_info->authname };
} else {
push @branch_od_info, { branchcode => $branch->branchcode, authname => "" };
}
}
$template->param(
branches => \@branch_od_info,
);
output_html_with_http_headers $input, $cookie, $template->output;