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

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

Return to bug 38936