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

(-)a/installer/data/mysql/atomicupdate/bug_22030_add_OverDriveUsername_system_preference.perl (+9 lines)
Line 0 Link Here
1
$DBversion = 'XXX';
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do(q{
4
        INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES
5
        ('OverDriveUsername','cardnumber','cardnumber|userid','Which patron information should be passed as OverDrive username','Choice')
6
    });
7
    SetVersion( $DBversion );
8
    print "Upgrade to $DBversion done (Bug XXXXX - description)\n";
9
}
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 431-436 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
431
('OverDriveClientSecret','','Client key for OverDrive integration','30','YesNo'),
431
('OverDriveClientSecret','','Client key for OverDrive integration','30','YesNo'),
432
('OverDriveLibraryID','','Library ID for OverDrive integration','','Integer'),
432
('OverDriveLibraryID','','Library ID for OverDrive integration','','Integer'),
433
('OverDrivePasswordRequired','',NULL,'Does the library require passwords for OverDrive SIP authentication','YesNo'),
433
('OverDrivePasswordRequired','',NULL,'Does the library require passwords for OverDrive SIP authentication','YesNo'),
434
('OverDriveUsername','cardnumber','cardnumber|userid','Which patron information should be passed as OverDrive username','Choice'),
434
('OverdueNoticeCalendar',0,NULL,'Take the calendar into consideration when generating overdue notices','YesNo'),
435
('OverdueNoticeCalendar',0,NULL,'Take the calendar into consideration when generating overdue notices','YesNo'),
435
('OverduesBlockCirc','noblock','noblock|confirmation|block','When checking out an item should overdues block checkout, generate a confirmation dialogue, or allow checkout','Choice'),
436
('OverduesBlockCirc','noblock','noblock|confirmation|block','When checking out an item should overdues block checkout, generate a confirmation dialogue, or allow checkout','Choice'),
436
('OverduesBlockRenewing','allow','allow|blockitem|block','If any of patron checked out documents is late, should renewal be allowed, blocked only on overdue items or blocked on whatever checked out document','Choice'),
437
('OverduesBlockRenewing','allow','allow|blockitem|block','If any of patron checked out documents is late, should renewal be allowed, blocked only on overdue items or blocked on whatever checked out document','Choice'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref (+6 lines)
Lines 384-389 Enhanced Content: Link Here
384
                  yes: Enable
384
                  yes: Enable
385
                  no: "Don't enable"
385
                  no: "Don't enable"
386
            - users to access their OverDrive circulation history, and circulate items.<br />
386
            - users to access their OverDrive circulation history, and circulate items.<br />
387
            - Overdrive uses the patron's
388
            - pref: OverDriveUsername
389
              choices:
390
                  cardnumber: cardnumber
391
                  userid: user name
392
            - for user access to OverDrive. <br />
387
            - A password is
393
            - A password is
388
            - pref: OverDrivePasswordRequired
394
            - pref: OverDrivePasswordRequired
389
              choices:
395
              choices:
(-)a/opac/svc/overdrive (-2 / +7 lines)
Lines 48-56 eval { Link Here
48
                my $password = $cgi->param("password") // q{} ;
48
                my $password = $cgi->param("password") // q{} ;
49
                my $patron = Koha::Patrons->find({ userid => $user });
49
                my $patron = Koha::Patrons->find({ userid => $user });
50
                my $branch_info = $patron ? Koha::Library::OverDriveInfos->find( $patron->branchcode ) : undef;
50
                my $branch_info = $patron ? Koha::Library::OverDriveInfos->find( $patron->branchcode ) : undef;
51
                my $od_username;
52
                if ( C4::Context->preference('OverDriveUsername') eq 'cardnumber' ){
53
                    $od_username = $patron ? $patron->cardnumber : undef;
54
                } else {
55
                    $od_username = $user;
56
                }
51
                my $branch_authname = $branch_info ? $branch_info->authname : undef;
57
                my $branch_authname = $branch_info ? $branch_info->authname : undef;
52
                my $authname = $branch_authname || C4::Context->preference('OverDriveAuthname');
58
                my $authname = $branch_authname || C4::Context->preference('OverDriveAuthname');
53
                $od->auth_by_userid($user, $password,C4::Context->preference('OverDriveWebsiteID'),$authname);
59
                $od->auth_by_userid($od_username, $password,C4::Context->preference('OverDriveWebsiteID'),$authname);
54
                $data{login_success} = 1;
60
                $data{login_success} = 1;
55
                last;
61
                last;
56
            };
62
            };
57
- 

Return to bug 22030