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

(-)a/C4/Auth.pm (-1 / +1 lines)
Lines 193-199 sub get_template_and_user { Link Here
193
    # Exceptions for consent page itself and SCI/SCO system
193
    # Exceptions for consent page itself and SCI/SCO system
194
    if( $in->{type} eq 'opac' && $user &&
194
    if( $in->{type} eq 'opac' && $user &&
195
        $in->{'template_name'} !~ /^(opac-page|opac-patron-consent|sc[io]\/)/ &&
195
        $in->{'template_name'} !~ /^(opac-page|opac-patron-consent|sc[io]\/)/ &&
196
        C4::Context->preference('GDPR_Policy') eq 'Enforced' )
196
        C4::Context->preference('PrivacyPolicyConsent') eq 'Enforced' )
197
    {
197
    {
198
        my $consent = Koha::Patron::Consents->search({
198
        my $consent = Koha::Patron::Consents->search({
199
            borrowernumber => getborrowernumber($user),
199
            borrowernumber => getborrowernumber($user),
(-)a/installer/data/mysql/atomicupdate/bug_33179_rename_gdpr_policy.pl (+12 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => "33197",
5
    description => "Rename GDPR_Policy system preference",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
        $dbh->do(q{UPDATE systempreferences set variable = "PrivacyPolicyConsent" WHERE variable = "GDPR_Policy"});
10
        say $out "Rename system preference GDPR_Policy to PrivacyPolicyConsent";
11
    },
12
};
(-)a/installer/data/mysql/mandatory/sysprefs.sql (-1 / +1 lines)
Lines 253-259 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
253
('FinesLog','1',NULL,'If ON, log fines','YesNo'),
253
('FinesLog','1',NULL,'If ON, log fines','YesNo'),
254
('finesMode','off','off|production','Choose the fines mode, \'off\' (no charges), \'production\' (accrue overdue fines).  Requires accruefines cronjob.','Choice'),
254
('finesMode','off','off|production','Choose the fines mode, \'off\' (no charges), \'production\' (accrue overdue fines).  Requires accruefines cronjob.','Choice'),
255
('FRBRizeEditions','0','','If ON, Koha will query one or more ISBN web services for associated ISBNs and display an Editions tab on the details pages','YesNo'),
255
('FRBRizeEditions','0','','If ON, Koha will query one or more ISBN web services for associated ISBNs and display an Editions tab on the details pages','YesNo'),
256
('GDPR_Policy','','Enforced|Permissive|Disabled','General Data Protection Regulation - policy', 'Choice'),
257
('GenerateAuthorityField667', 'Machine generated authority record', NULL, 'When BiblioAddsAuthorities and AutoCreateAuthorities are enabled, use this as a default value for the 667$a field of MARC21 records', 'free'),
256
('GenerateAuthorityField667', 'Machine generated authority record', NULL, 'When BiblioAddsAuthorities and AutoCreateAuthorities are enabled, use this as a default value for the 667$a field of MARC21 records', 'free'),
258
('GenerateAuthorityField670', 'Work cat.', NULL, 'When BiblioAddsAuthorities and AutoCreateAuthorities are enabled, use this as a default value for the 670$a field of MARC21 records', 'free'),
257
('GenerateAuthorityField670', 'Work cat.', NULL, 'When BiblioAddsAuthorities and AutoCreateAuthorities are enabled, use this as a default value for the 670$a field of MARC21 records', 'free'),
259
('GoogleJackets','0',NULL,'if ON, displays jacket covers from Google Books API','YesNo'),
258
('GoogleJackets','0',NULL,'if ON, displays jacket covers from Google Books API','YesNo'),
Lines 577-582 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
577
('PreserveSerialNotes','1','','When a new "Expected" issue is generated, should it be prefilled with last created issue notes?','YesNo'),
576
('PreserveSerialNotes','1','','When a new "Expected" issue is generated, should it be prefilled with last created issue notes?','YesNo'),
578
('previousIssuesDefaultSortOrder','asc','asc|desc','Specify the sort order of Previous Issues on the circulation page','Choice'),
577
('previousIssuesDefaultSortOrder','asc','asc|desc','Specify the sort order of Previous Issues on the circulation page','Choice'),
579
('PrintNoticesMaxLines','0','','If greater than 0, sets the maximum number of lines an overdue notice will print. If the number of items is greater than this number, the notice will end with a warning asking the borrower to check their online account for a full list of overdue items.','Integer'),
578
('PrintNoticesMaxLines','0','','If greater than 0, sets the maximum number of lines an overdue notice will print. If the number of items is greater than this number, the notice will end with a warning asking the borrower to check their online account for a full list of overdue items.','Integer'),
579
('PrivacyPolicyConsent','','Enforced|Permissive|Disabled','Data privacy policy consent in the OPAC', 'Choice'),
580
('PrivacyPolicyURL','',NULL,'This URL is used in messages about GDPR consents.', 'Free'),
580
('PrivacyPolicyURL','',NULL,'This URL is used in messages about GDPR consents.', 'Free'),
581
('ProcessingFeeNote', '', NULL, 'Set the text to be recorded in the column note, table accountlines when the processing fee (defined in item type) is applied', 'textarea'),
581
('ProcessingFeeNote', '', NULL, 'Set the text to be recorded in the column note, table accountlines when the processing fee (defined in item type) is applied', 'textarea'),
582
('ProtectSuperlibrarianPrivileges','1',NULL,'If enabled, non-superlibrarians cannot set superlibrarian privileges','YesNo'),
582
('ProtectSuperlibrarianPrivileges','1',NULL,'If enabled, non-superlibrarians cannot set superlibrarian privileges','YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref (-5 / +5 lines)
Lines 355-370 Patrons: Link Here
355
         - Use the following URL
355
         - Use the following URL
356
         - pref: PrivacyPolicyURL
356
         - pref: PrivacyPolicyURL
357
           class: url
357
           class: url
358
         - to refer to your local privacy policy in messages about privacy and data protection. (If you enforce GDPR policy, make sure that this page is not blocked.)
358
         - to refer to your local privacy policy in messages about privacy and data protection. (If you enforce a data privacy policy, make sure that this page is not blocked.)
359
         - '<br><strong>NOTE:</strong> The URL will only be displayed if <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=GDPR_Policy">GDPR_Policy</a> is set.'
359
         - '<br><strong>NOTE:</strong> The URL will only be displayed if <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=PrivacyPolicyConsent">PrivacyPolicyConsent</a> is set.'
360
     -
360
     -
361
         - "Set GDPR policy to:"
361
         - "Set data privacy policy consent to:"
362
         - pref: GDPR_Policy
362
         - pref: PrivacyPolicyConsent
363
           choices:
363
           choices:
364
               '': 'disabled'
364
               '': 'disabled'
365
               Enforced: 'enforced'
365
               Enforced: 'enforced'
366
               Permissive: 'permissive'
366
               Permissive: 'permissive'
367
         - ". GDPR is the EU General Data Protection Regulation. When you enforce, patrons need to give consent before using the OPAC. If you set to permissive, Koha will warn but not enforce."
367
         - ". When you enforce a data privacy policy, patrons need to give consent before using the OPAC. If you set to permissive, Koha will warn but not enforce."
368
         - '<br><strong>NOTE:</strong> If you enable this you will also have to set the URL of your public privacy policy with the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=PrivacyPolicyURL">PrivacyPolicyURL</a> setting.'
368
         - '<br><strong>NOTE:</strong> If you enable this you will also have to set the URL of your public privacy policy with the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=PrivacyPolicyURL">PrivacyPolicyURL</a> setting.'
369
     -
369
     -
370
         - Lock/expire patrons that submitted an unsubscribe request (refused consent) after
370
         - Lock/expire patrons that submitted an unsubscribe request (refused consent) after
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc (-1 / +1 lines)
Lines 24-30 Link Here
24
            [% END %]
24
            [% END %]
25
                <a href="/cgi-bin/koha/opac-memberentry.pl">Personal details</a></li>
25
                <a href="/cgi-bin/koha/opac-memberentry.pl">Personal details</a></li>
26
26
27
            [% IF Koha.Preference('GDPR_Policy') # remove when extending %]
27
            [% IF Koha.Preference('PrivacyPolicyConsent') # remove when extending %]
28
                [% IF consentview %]<li class="active">[% ELSE %]<li>[% END %]
28
                [% IF consentview %]<li class="active">[% ELSE %]<li>[% END %]
29
                    <a href="/cgi-bin/koha/opac-patron-consent.pl">Consents</a>
29
                    <a href="/cgi-bin/koha/opac-patron-consent.pl">Consents</a>
30
                </li>
30
                </li>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt (-2 / +2 lines)
Lines 970-980 Link Here
970
                        </div> <!-- /.row -->
970
                        </div> <!-- /.row -->
971
                    [% END %]
971
                    [% END %]
972
972
973
                    [% IF Koha.Preference('GDPR_Policy') && action != 'edit' %]
973
                    [% IF Koha.Preference('PrivacyPolicyConsent') && action != 'edit' %]
974
                        <div class="row">
974
                        <div class="row">
975
                            <div class="col">
975
                            <div class="col">
976
                                <fieldset class="rows" id="memberentry_gdpr_consent">
976
                                <fieldset class="rows" id="memberentry_gdpr_consent">
977
                                    <legend>GDPR consent</legend>
977
                                    <legend>Data privacy policy consent</legend>
978
                                    <ol>
978
                                    <ol>
979
                                    <li>
979
                                    <li>
980
                                        <div class="label"></div>
980
                                        <div class="label"></div>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-patron-consent.tt (-5 / +6 lines)
Lines 1-4 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% USE KohaDates %]
2
[% USE AdditionalContents %]
3
[% USE AdditionalContents %]
3
[% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
4
[% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
4
[% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
5
[% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %]
Lines 36-44 Link Here
36
            <div class="col-lg-10 order-first order-md-first order-lg-2">
37
            <div class="col-lg-10 order-first order-md-first order-lg-2">
37
                <div id="patronconsents" class="maincontent">
38
                <div id="patronconsents" class="maincontent">
38
39
39
                    [% IF Koha.Preference('GDPR_Policy') %]
40
                    [% IF Koha.Preference('PrivacyPolicyConsent') %]
40
                    <div class="alert alert-warning">
41
                    <div class="alert alert-warning">
41
                            <p>In order to keep you logged in, we need your consent to process personal data as specified in the EU General Data Protection Regulation of May 25, 2018.</p>
42
                            <p>In order to keep you logged in, we need your consent to process personal data as specified in the privacy policy linked below.</p>
42
                            <p>Please save your consent below or log out. Thank you!</p>
43
                            <p>Please save your consent below or log out. Thank you!</p>
43
                    </div>
44
                    </div>
44
                    [% END %]
45
                    [% END %]
Lines 46-53 Link Here
46
                    <h1>Your consents</h1>
47
                    <h1>Your consents</h1>
47
48
48
                    <form action="/cgi-bin/koha/opac-patron-consent.pl" method="post">
49
                    <form action="/cgi-bin/koha/opac-patron-consent.pl" method="post">
49
                        [% IF Koha.Preference('GDPR_Policy') %]
50
                        [% IF Koha.Preference('PrivacyPolicyConsent') %]
50
                        <legend><h2 id="GDPR_consents">GDPR consents</h2></legend>
51
                        <legend><h2 id="GDPR_consents">Privacy policy consents</h2></legend>
51
                            <input type="hidden" name="op" value="gdpr_proc_save"/>
52
                            <input type="hidden" name="op" value="gdpr_proc_save"/>
52
                            <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]"/>
53
                            <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]"/>
53
                            <fieldset>
54
                            <fieldset>
Lines 56-62 Link Here
56
                                    <p><input type="radio" name="gdpr_processing" value="agreed"> Yes, I agree.<br>
57
                                    <p><input type="radio" name="gdpr_processing" value="agreed"> Yes, I agree.<br>
57
                                    <input type="radio" name="gdpr_processing" value="disagreed"> No, I do not agree. Please remove my account within a reasonable time.</p>
58
                                    <input type="radio" name="gdpr_processing" value="disagreed"> No, I do not agree. Please remove my account within a reasonable time.</p>
58
                                    [% IF gdpr_proc_consent %]
59
                                    [% IF gdpr_proc_consent %]
59
                                        <p>Your consent was registered on [% gdpr_proc_consent | html %].</p>
60
                                        <p>Your consent was registered on [% gdpr_proc_consent | $KohaDates with_hours => 1 %].</p>
60
                                    [% ELSIF gdpr_proc_refusal %]
61
                                    [% ELSIF gdpr_proc_refusal %]
61
                                        <p>You indicated recently that you do not consent, and we will process your request soon.</p>
62
                                        <p>You indicated recently that you do not consent, and we will process your request soon.</p>
62
                                    [% END %]
63
                                    [% END %]
(-)a/opac/opac-memberentry.pl (-1 / +1 lines)
Lines 435-441 sub GetMandatoryFields { Link Here
435
      C4::Context->preference("PatronSelfRegistrationBorrowerMandatoryField");
435
      C4::Context->preference("PatronSelfRegistrationBorrowerMandatoryField");
436
436
437
    my @fields = split( /\|/, $BorrowerMandatoryField );
437
    my @fields = split( /\|/, $BorrowerMandatoryField );
438
    push @fields, 'gdpr_proc_consent' if C4::Context->preference('GDPR_Policy') && $action eq 'create';
438
    push @fields, 'gdpr_proc_consent' if C4::Context->preference('PrivacyPolicyConsent') && $action eq 'create';
439
439
440
    foreach (@fields) {
440
    foreach (@fields) {
441
        $mandatory_fields{$_} = 1;
441
        $mandatory_fields{$_} = 1;
(-)a/opac/opac-patron-consent.pl (-2 / +2 lines)
Lines 40-46 my ( $template, $borrowernumber, $cookie ) = get_template_and_user({ Link Here
40
40
41
my $patron = Koha::Patrons->find($borrowernumber);
41
my $patron = Koha::Patrons->find($borrowernumber);
42
my $gdpr_proc_consent;
42
my $gdpr_proc_consent;
43
if( C4::Context->preference('GDPR_Policy') ) {
43
if( C4::Context->preference('PrivacyPolicyConsent') ) {
44
    $gdpr_proc_consent = Koha::Patron::Consents->search({
44
    $gdpr_proc_consent = Koha::Patron::Consents->search({
45
        borrowernumber => $borrowernumber,
45
        borrowernumber => $borrowernumber,
46
        type => GDPR_PROCESSING,
46
        type => GDPR_PROCESSING,
Lines 64-70 if( $op eq 'gdpr_proc_save' && $gdpr_proc_consent ) { Link Here
64
}
64
}
65
65
66
# If user refused GDPR consent and we enforce GDPR, logout (when saving)
66
# If user refused GDPR consent and we enforce GDPR, logout (when saving)
67
if( $op =~ /save/ && C4::Context->preference('GDPR_Policy') eq 'Enforced' && $gdpr_proc_consent->refused_on )
67
if( $op =~ /save/ && C4::Context->preference('PrivacyPolicyConsent') eq 'Enforced' && $gdpr_proc_consent->refused_on )
68
{
68
{
69
    print $query->redirect('/cgi-bin/koha/opac-main.pl?logout.x=1');
69
    print $query->redirect('/cgi-bin/koha/opac-main.pl?logout.x=1');
70
    exit;
70
    exit;
(-)a/t/db_dependent/Auth.t (-2 / +1 lines)
Lines 32-38 my $builder = t::lib::TestBuilder->new; Link Here
32
# FIXME: SessionStorage defaults to mysql, but it seems to break transaction
32
# FIXME: SessionStorage defaults to mysql, but it seems to break transaction
33
# handling
33
# handling
34
t::lib::Mocks::mock_preference( 'SessionStorage', 'tmp' );
34
t::lib::Mocks::mock_preference( 'SessionStorage', 'tmp' );
35
t::lib::Mocks::mock_preference( 'GDPR_Policy', '' ); # Disabled
35
t::lib::Mocks::mock_preference( 'PrivacyPolicyConsent', '' ); # Disabled
36
36
37
# To silence useless warnings
37
# To silence useless warnings
38
$ENV{REMOTE_ADDR} = '127.0.0.1';
38
$ENV{REMOTE_ADDR} = '127.0.0.1';
39
- 

Return to bug 33197