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

(-)a/opac/opac-ISBDdetail.pl (-26 / +3 lines)
Lines 42-48 use Modern::Perl; Link Here
42
42
43
use C4::Auth qw( get_template_and_user );
43
use C4::Auth qw( get_template_and_user );
44
use C4::Context;
44
use C4::Context;
45
use C4::Output qw( parametrized_url output_html_with_http_headers );
45
use C4::Output qw( parametrized_url output_html_with_http_headers redirect_if_opac_suppressed );
46
use CGI        qw ( -utf8 );
46
use CGI        qw ( -utf8 );
47
use C4::Biblio qw(
47
use C4::Biblio qw(
48
    CountItemsIssued
48
    CountItemsIssued
Lines 76-106 if ( !$biblio ) { Link Here
76
}
76
}
77
77
78
# If record should be suppressed, handle it early
78
# If record should be suppressed, handle it early
79
if ( C4::Context->preference('OpacSuppression') ) {
79
redirect_if_opac_suppressed( $query, $biblio )
80
80
    if C4::Context->preference('OpacSuppression');
81
    # redirect to opac-blocked info page or 404?
82
    my $redirect_url;
83
    if ( C4::Context->preference("OpacSuppressionRedirect") ) {
84
        $redirect_url = "/cgi-bin/koha/opac-blocked.pl";
85
    } else {
86
        $redirect_url = "/cgi-bin/koha/errors/404.pl";
87
    }
88
    if ( $biblio->opac_suppressed() ) {
89
90
        # if OPAC suppression by IP address
91
        if ( C4::Context->preference('OpacSuppressionByIPRange') ) {
92
            my $IPAddress = $ENV{'REMOTE_ADDR'};
93
            my $IPRange   = C4::Context->preference('OpacSuppressionByIPRange');
94
            if ( $IPAddress !~ /^$IPRange/ ) {
95
                print $query->redirect($redirect_url);
96
                exit;
97
            }
98
        } else {
99
            print $query->redirect($redirect_url);
100
            exit;
101
        }
102
    }
103
}
104
81
105
#open template
82
#open template
106
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
83
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
(-)a/opac/opac-MARCdetail.pl (-26 / +3 lines)
Lines 46-52 use Modern::Perl; Link Here
46
46
47
use C4::Auth qw( get_template_and_user );
47
use C4::Auth qw( get_template_and_user );
48
use C4::Context;
48
use C4::Context;
49
use C4::Output qw( parametrized_url output_html_with_http_headers );
49
use C4::Output qw( parametrized_url output_html_with_http_headers redirect_if_opac_suppressed );
50
use CGI        qw ( -utf8 );
50
use CGI        qw ( -utf8 );
51
use C4::Biblio qw(
51
use C4::Biblio qw(
52
    CountItemsIssued
52
    CountItemsIssued
Lines 97-127 if ( !$biblio ) { Link Here
97
}
97
}
98
98
99
# If record should be suppressed, handle it early
99
# If record should be suppressed, handle it early
100
if ( C4::Context->preference('OpacSuppression') ) {
100
redirect_if_opac_suppressed( $query, $biblio )
101
101
    if C4::Context->preference('OpacSuppression');
102
    # redirect to opac-blocked info page or 404?
103
    my $redirect_url;
104
    if ( C4::Context->preference("OpacSuppressionRedirect") ) {
105
        $redirect_url = "/cgi-bin/koha/opac-blocked.pl";
106
    } else {
107
        $redirect_url = "/cgi-bin/koha/errors/404.pl";
108
    }
109
    if ( $biblio->opac_suppressed() ) {
110
111
        # if OPAC suppression by IP address
112
        if ( C4::Context->preference('OpacSuppressionByIPRange') ) {
113
            my $IPAddress = $ENV{'REMOTE_ADDR'};
114
            my $IPRange   = C4::Context->preference('OpacSuppressionByIPRange');
115
            if ( $IPAddress !~ /^$IPRange/ ) {
116
                print $query->redirect($redirect_url);
117
                exit;
118
            }
119
        } else {
120
            print $query->redirect($redirect_url);
121
            exit;
122
        }
123
    }
124
}
125
102
126
unless ( $patron and $patron->category->override_hidden_items ) {
103
unless ( $patron and $patron->category->override_hidden_items ) {
127
104
(-)a/opac/opac-detail.pl (-27 / +3 lines)
Lines 33-39 use C4::Koha qw( Link Here
33
);
33
);
34
use C4::Search  qw( new_record_from_zebra searchResults getRecords );
34
use C4::Search  qw( new_record_from_zebra searchResults getRecords );
35
use C4::Serials qw( CountSubscriptionFromBiblionumber SearchSubscriptions GetLatestSerials );
35
use C4::Serials qw( CountSubscriptionFromBiblionumber SearchSubscriptions GetLatestSerials );
36
use C4::Output  qw( parametrized_url output_html_with_http_headers );
36
use C4::Output  qw( parametrized_url output_html_with_http_headers redirect_if_opac_suppressed );
37
use C4::Biblio  qw(
37
use C4::Biblio  qw(
38
    CountItemsIssued
38
    CountItemsIssued
39
    GetBiblioData
39
    GetBiblioData
Lines 112-142 unless ( $biblio && $record ) { Link Here
112
}
112
}
113
113
114
# If record should be suppressed, handle it early
114
# If record should be suppressed, handle it early
115
if ( C4::Context->preference('OpacSuppression') ) {
115
redirect_if_opac_suppressed( $query, $biblio )
116
116
    if C4::Context->preference('OpacSuppression');
117
    # redirect to opac-blocked info page or 404?
118
    my $redirect_url;
119
    if ( C4::Context->preference("OpacSuppressionRedirect") ) {
120
        $redirect_url = "/cgi-bin/koha/opac-blocked.pl";
121
    } else {
122
        $redirect_url = "/cgi-bin/koha/errors/404.pl";
123
    }
124
    if ( $biblio->opac_suppressed() ) {
125
126
        # if OPAC suppression by IP address
127
        if ( C4::Context->preference('OpacSuppressionByIPRange') ) {
128
            my $IPAddress = $ENV{'REMOTE_ADDR'};
129
            my $IPRange   = C4::Context->preference('OpacSuppressionByIPRange');
130
            if ( $IPAddress !~ /^$IPRange/ ) {
131
                print $query->redirect($redirect_url);
132
                exit;
133
            }
134
        } else {
135
            print $query->redirect($redirect_url);
136
            exit;
137
        }
138
    }
139
}
140
117
141
my $metadata_extractor = $biblio->metadata_extractor;
118
my $metadata_extractor = $biblio->metadata_extractor;
142
119
143
- 

Return to bug 38936