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

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

Return to bug 20819