Bugzilla – Attachment 77268 Details for
Bug 20819
GDPR: Add a consent field for processing personal data in account menu and self-registration
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20819: Add check in get_template_and_user to enforce GDPR
Bug-20819-Add-check-in-gettemplateanduser-to-enfor.patch (text/plain), 1.91 KB, created by
Marcel de Rooy
on 2018-07-25 14:51:42 UTC
(
hide
)
Description:
Bug 20819: Add check in get_template_and_user to enforce GDPR
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2018-07-25 14:51:42 UTC
Size:
1.91 KB
patch
obsolete
>From 0c38da5821c9f3b83ea9671b92e940e0ffde487d Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 28 May 2018 14:59:31 +0200 >Subject: [PATCH] Bug 20819: Add check in get_template_and_user to enforce GDPR >Content-Type: text/plain; charset=utf-8 > >If you choose to enforce GDPR policy, a user needs to give consent for >data processing before he does something else in the OPAC while being >logged in. > >Test plan: >[1] Set GDPR_Policy to Disabled or Permissive. Usual behavior. >[2] Set to Enforced. Save a refusal on your consents. Notice that > you are logged out when saving. When you login again, all OPAC > requests are redirected to your consents tab. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > C4/Auth.pm | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index e27b1b3..56bc45a 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -37,6 +37,7 @@ use Koha::DateUtils qw(dt_from_string); > use Koha::Library::Groups; > use Koha::Libraries; > use Koha::Patrons; >+use Koha::Patron::Consents; > use POSIX qw/strftime/; > use List::MoreUtils qw/ any /; > use Encode qw( encode is_utf8); >@@ -180,6 +181,22 @@ sub get_template_and_user { > ); > } > >+ # If we enforce GDPR and the user did not consent, redirect >+ if( $in->{type} eq 'opac' && $user && >+ $in->{'template_name'} !~ /opac-patron-consent/ && >+ C4::Context->preference('GDPR_Policy') eq 'Enforced' ) >+ { >+ my $consent = Koha::Patron::Consents->search({ >+ borrowernumber => getborrowernumber($user), >+ type => 'GDPR_PROCESSING', >+ given_on => { '!=', undef }, >+ })->next; >+ if( !$consent ) { >+ print $in->{query}->redirect(-uri => '/cgi-bin/koha/opac-patron-consent.pl', -cookie => $cookie); >+ safe_exit; >+ } >+ } >+ > if ( $in->{type} eq 'opac' && $user ) { > my $kick_out; > >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 20819
:
75765
|
75766
|
75767
|
75818
|
75819
|
75820
|
76781
|
76782
|
76783
|
76784
|
76785
|
77264
|
77265
|
77266
|
77267
|
77268
|
77269
|
78369
|
78370
|
78371
|
78372
|
78373
|
78374
|
78779
|
78781
|
78783
|
78784
|
78786
|
78788
|
79059
|
79062
|
79063
|
79064
|
79065
|
79066
|
79067
|
79129
|
79130
|
79131
|
79132
|
79133
|
79134
|
79135
|
79175
|
79190