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

(-)a/C4/Auth.pm (-1 / +17 lines)
Lines 36-41 use Koha::DateUtils qw(dt_from_string); Link Here
36
use Koha::Library::Groups;
36
use Koha::Library::Groups;
37
use Koha::Libraries;
37
use Koha::Libraries;
38
use Koha::Patrons;
38
use Koha::Patrons;
39
use Koha::Patron::Consents;
39
use POSIX qw/strftime/;
40
use POSIX qw/strftime/;
40
use List::MoreUtils qw/ any /;
41
use List::MoreUtils qw/ any /;
41
use Encode qw( encode is_utf8);
42
use Encode qw( encode is_utf8);
Lines 179-184 sub get_template_and_user { Link Here
179
        );
180
        );
180
    }
181
    }
181
182
183
    # If we enforce GDPR and the user did not consent, redirect
184
    if( $in->{type} eq 'opac' && $user &&
185
        $in->{'template_name'} !~ /opac-patron-consent/ &&
186
        C4::Context->preference('GDPR_Policy') eq 'Enforced' )
187
    {
188
        my $consent = Koha::Patron::Consents->search({
189
            borrowernumber => getborrowernumber($user),
190
            type => 'GDPR_PROCESSING',
191
            given_on => { '!=', undef },
192
        })->next;
193
        if( !$consent ) {
194
            print $in->{query}->redirect(-uri => '/cgi-bin/koha/opac-patron-consent.pl', -cookie => $cookie);
195
            safe_exit;
196
        }
197
    }
198
182
    if ( $in->{type} eq 'opac' && $user ) {
199
    if ( $in->{type} eq 'opac' && $user ) {
183
        my $kick_out;
200
        my $kick_out;
184
201
185
- 

Return to bug 20819