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

(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-blocked.tt (+26 lines)
Line 0 Link Here
1
[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog ›  An error has occurred
2
[% INCLUDE 'doc-head-close.inc' %]
3
</head>
4
<body id="error404">
5
[% IF ( OpacNav ) %]<div id="doc3" class="yui-t1">[% ELSE %]<div id="doc3" class="yui-t7">[% END %]
6
<div id="bd">
7
[% INCLUDE 'masthead.inc' %]
8
9
<div id="yui-main">
10
<div class="yui-b">
11
<div class="yui-g">
12
            <div id="opac-blocked-message">
13
            <h3>Blocked</h3>
14
            <p>[% blockedmessage %]</p>
15
            </div>
16
</div>
17
</div>
18
</div>
19
[% IF ( OpacNav ) %]
20
<div class="yui-b">
21
<div id="leftmenus" class="container">
22
[% INCLUDE 'navigation.inc' %]
23
</div>
24
</div>[% END %]
25
</div>
26
[% INCLUDE 'opac-bottom.inc' %]
(-)a/opac/opac-blocked.pl (+39 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it under the
6
# terms of the GNU General Public License as published by the Free Software
7
# Foundation; either version 2 of the License, or (at your option) any later
8
# version.
9
#
10
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
11
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
12
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License along with
15
# Koha; if not, write to the Free Software Foundation, Inc.,
16
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
18
19
use strict;
20
use warnings;
21
use CGI;
22
use C4::Auth;
23
use C4::Output;
24
use C4::Context;
25
26
my $query = new CGI;
27
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
28
    {
29
        template_name   => "opac-blocked.tt",
30
        query           => $query,
31
        type            => "opac",
32
        authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
33
    }
34
);
35
36
my $blockedmessage = "You don't have permission to see this record.";
37
38
$template->param( blockedmessage => $blockedmessage );
39
output_with_http_headers $query, $cookie, $template->output, 'html';
(-)a/opac/opac-detail.pl (-1 / +25 lines)
Lines 78-83 if ( ! $record ) { Link Here
78
    print $query->redirect("/cgi-bin/koha/errors/404.pl"); # escape early
78
    print $query->redirect("/cgi-bin/koha/errors/404.pl"); # escape early
79
    exit;
79
    exit;
80
}
80
}
81
82
# redirect if opacsuppression is enabled and biblio is suppressed
83
if (C4::Context->preference('OpacSuppression')) {
84
    my $opacsuppressionfield = '942';
85
    my $opacsuppressionfieldvalue = $record->field($opacsuppressionfield);
86
    # if OPAC suppression by IP address
87
    if (C4::Context->preference('OpacSuppressionByIPRange')) {
88
        my $IPAddress = $ENV{'REMOTE_ADDR'};
89
        my $IPRange = C4::Context->preference('OpacSuppressionByIPRange');
90
        if ($IPAddress !~ /^$IPRange/)  {
91
            if ( $opacsuppressionfieldvalue->subfield("n") == 1) {
92
                print $query->redirect("/cgi-bin/koha/opac-blocked.pl");
93
                exit;
94
            }
95
        }
96
    }
97
    else {
98
        if ( $opacsuppressionfieldvalue->subfield("n") == 1) {
99
            print $query->redirect("/cgi-bin/koha/opac-blocked.pl");
100
            exit;
101
        }
102
    }
103
}
104
105
81
$template->param( biblionumber => $biblionumber );
106
$template->param( biblionumber => $biblionumber );
82
107
83
# get biblionumbers stored in the cart
108
# get biblionumbers stored in the cart
84
- 

Return to bug 10195