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

(-)a/installer/data/mysql/sysprefs.sql (+3 lines)
Lines 340-345 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
340
('previousIssuesDefaultSortOrder','asc','asc|desc','Specify the sort order of Previous Issues on the circulation page','Choice'),
340
('previousIssuesDefaultSortOrder','asc','asc|desc','Specify the sort order of Previous Issues on the circulation page','Choice'),
341
('printcirculationslips','1','','If ON, enable printing circulation receipts','YesNo'),
341
('printcirculationslips','1','','If ON, enable printing circulation receipts','YesNo'),
342
('PrintNoticesMaxLines','0','','If greater than 0, sets the maximum number of lines an overdue notice will print. If the number of items is greater than this number, the notice will end with a warning asking the borrower to check their online account for a full list of overdue items.','Integer'),
342
('PrintNoticesMaxLines','0','','If greater than 0, sets the maximum number of lines an overdue notice will print. If the number of items is greater than this number, the notice will end with a warning asking the borrower to check their online account for a full list of overdue items.','Integer'),
343
('ProxyPageLocalIPs','',NULL,'Beginning of IP addresses considered as local (comma separated ex: "127.0.0,127.0.2")','Free'),
344
('ProxyPageContent','',NULL,'HTML content of the proxy page','TextArea'),
345
('ProxyPageTitle','',NULL,'Title of the proxy page (breadcrumb and header)','Free'),
343
('QueryAutoTruncate','1',NULL,'If ON, query truncation is enabled by default','YesNo'),
346
('QueryAutoTruncate','1',NULL,'If ON, query truncation is enabled by default','YesNo'),
344
('QueryFuzzy','1',NULL,'If ON, enables fuzzy option for searches','YesNo'),
347
('QueryFuzzy','1',NULL,'If ON, enables fuzzy option for searches','YesNo'),
345
('QueryStemming','1',NULL,'If ON, enables query stemming','YesNo'),
348
('QueryStemming','1',NULL,'If ON, enables query stemming','YesNo'),
(-)a/installer/data/mysql/updatedatabase.pl (+7 lines)
Lines 9628-9633 if ( CheckVersion($DBversion) ) { Link Here
9628
    SetVersion($DBversion);
9628
    SetVersion($DBversion);
9629
}
9629
}
9630
9630
9631
$DBversion = "XXX";
9632
if ( CheckVersion($DBversion) ) {
9633
    $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('ProxyPageLocalIPs','',NULL,'Beginning of IP addresses considered as local (comma separated ex: \"127.0.0,127.0.2\")','Free'), ('ProxyPageContent','',NULL,'HTML content of the proxy page','TextArea'), ('ProxyPageTitle','',NULL,'Title of the proxy page (breadcrumb and header)','Free')");
9634
    print "Upgrade done (Proxy page)\n";
9635
    SetVersion ($DBversion);
9636
}
9637
9631
=head1 FUNCTIONS
9638
=head1 FUNCTIONS
9632
9639
9633
=head2 TableExists($table)
9640
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+15 lines)
Lines 595-600 OPAC: Link Here
595
                  track: "Track"
595
                  track: "Track"
596
                  no: "Don't track"
596
                  no: "Don't track"
597
            - links that patrons click on
597
            - links that patrons click on
598
    Proxy page:
599
        -
600
            - "Access from IP addresses beginning with"
601
            - pref: ProxyPageLocalIPs
602
            - "do not need to be authenticated (comma separated - ex: '127.0.0,127.0.1')"
603
        -
604
            - "HTML content of your proxy page"
605
            - pref: ProxyPageContent
606
              type: textarea
607
              class: HTML
608
        -
609
            - Use
610
            - pref: ProxyPageTitle
611
              class: long
612
            - "as title of your proxy page (appears in the breadcrumb and on the top of the proxy page)"
598
613
599
    Shelf Browser:
614
    Shelf Browser:
600
        -
615
        -
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-proxypage.tt (+40 lines)
Line 0 Link Here
1
[% USE Koha %]
2
[% USE KohaDates %]
3
4
[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog[% IF ProxyPageTitle %] › [% ProxyPageTitle %][% END %]
5
6
[% INCLUDE 'doc-head-close.inc' %]
7
[% BLOCK cssinclude %][% END %]
8
</head>
9
<body id="opac-account" class="scrollto">
10
[% INCLUDE 'masthead.inc' %]
11
12
<div class="main">
13
    <ul class="breadcrumb">
14
        <li><a href="/cgi-bin/koha/opac-main.pl">Home</a></li>
15
        [% IF ( ProxyPageTitle ) %]
16
            <li> <span class="divider">&rsaquo;</span> [% ProxyPageTitle %]</li>
17
        [% END %]
18
    </ul>
19
20
    <div class="container-fluid">
21
        <div class="row-fluid">
22
            <div class="span2">
23
                <div id="navigation">
24
                    [% INCLUDE 'navigation.inc' %]
25
                </div>
26
            </div>
27
            <div class="span10">
28
                <div id="proxycontent" class="maincontent">
29
                    [% IF ( ProxyPageTitle ) %]
30
                        <h1>[% ProxyPageTitle %]</h1>
31
                    [% END %]
32
                    [% ProxyPageContent %]
33
                </div>
34
            </div> <!-- / .span10 -->
35
        </div> <!-- / .row-fluid -->
36
    </div> <!-- / .container-fluid -->
37
</div> <!-- / .main -->
38
39
[% INCLUDE 'opac-bottom.inc' %]
40
[% BLOCK jsinclude %][% END %]
(-)a/opac/opac-proxypage.pl (-1 / +54 lines)
Line 0 Link Here
0
- 
1
#!/usr/bin/perl
2
3
# Copyright Solutions inLibro inc 2014
4
#
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it
8
# under the terms of the GNU General Public License as published by
9
# the Free Software Foundation; either version 3 of the License, or
10
# (at your option) any later version .
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19
20
21
use strict;
22
use CGI;
23
use C4::Auth;
24
use C4::Output;
25
use warnings;
26
27
my $localNetwork  = C4::Context->preference('ProxyPageLocalIPs');
28
my $userIP = $ENV{'REMOTE_ADDR'};
29
30
my $withinNetwork = 0;
31
foreach my $IPRange ( split( ',', $localNetwork ) )
32
{
33
    $withinNetwork = ( $userIP =~ /^$IPRange/ );
34
    last if $withinNetwork;
35
}
36
37
my $query = new CGI;
38
my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
39
    {
40
        template_name   => "opac-proxypage.tt",
41
        query           => $query,
42
        type            => "opac",
43
        authnotrequired => $withinNetwork,
44
        flagsrequired   => { borrow => 1 },
45
        debug           => 1,
46
    }
47
);
48
49
$template->param(
50
                    ProxyPageContent => C4::Context->preference('ProxyPageContent'),
51
                    ProxyPageTitle => C4::Context->preference('ProxyPageTitle')
52
                );
53
54
output_html_with_http_headers $query, $cookie, $template->output;

Return to bug 13485