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

(-)a/installer/data/mysql/atomicupdate/selfcheckallowbyiprange.sql (+2 lines)
Line 0 Link Here
1
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES
2
	('SelfCheckAllowByIPRanges','',NULL,'(Leave blank if not used. Use ranges or simple ip addresses separated by spaces, like <code>192.168.1.1 192.168.0.0/24</code>.)','Short');
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 55-60 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
55
('AutoSelfCheckAllowed','0','','For corporate and special libraries which want web-based self-check available from any PC without the need for a manual staff login. Most libraries will want to leave this turned off. If on, requires self-check ID and password to be entered in AutoSelfCheckID and AutoSelfCheckPass sysprefs.','YesNo'),
55
('AutoSelfCheckAllowed','0','','For corporate and special libraries which want web-based self-check available from any PC without the need for a manual staff login. Most libraries will want to leave this turned off. If on, requires self-check ID and password to be entered in AutoSelfCheckID and AutoSelfCheckPass sysprefs.','YesNo'),
56
('AutoSelfCheckID','','','Staff ID with circulation rights to be used for automatic web-based self-check. Only applies if AutoSelfCheckAllowed syspref is turned on.','free'),
56
('AutoSelfCheckID','','','Staff ID with circulation rights to be used for automatic web-based self-check. Only applies if AutoSelfCheckAllowed syspref is turned on.','free'),
57
('AutoSelfCheckPass','','','Password to be used for automatic web-based self-check. Only applies if AutoSelfCheckAllowed syspref is turned on.','free'),
57
('AutoSelfCheckPass','','','Password to be used for automatic web-based self-check. Only applies if AutoSelfCheckAllowed syspref is turned on.','free'),
58
('SelfCheckAllowByIPRanges','',NULL,('Leave blank if not used. Use ranges or simple ip addresses separated by spaces, like <code>192.168.1.1 192.168.0.0/24</code>.)','Short'),
58
('Babeltheque','0','','Turn ON Babeltheque content  - See babeltheque.com to subscribe to this service','YesNo'),
59
('Babeltheque','0','','Turn ON Babeltheque content  - See babeltheque.com to subscribe to this service','YesNo'),
59
('Babeltheque_url_js','','','Url for Babeltheque javascript (e.g. http://www.babeltheque.com/bw_XX.js)','Free'),
60
('Babeltheque_url_js','','','Url for Babeltheque javascript (e.g. http://www.babeltheque.com/bw_XX.js)','Free'),
60
('Babeltheque_url_update','','','Url for Babeltheque update (E.G. http://www.babeltheque.com/.../file.csv.bz2)','Free'),
61
('Babeltheque_url_update','','','Url for Babeltheque update (E.G. http://www.babeltheque.com/.../file.csv.bz2)','Free'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (+4 lines)
Lines 681-686 Circulation: Link Here
681
                  yes: Show
681
                  yes: Show
682
                  no: "Don't show"
682
                  no: "Don't show"
683
            - "the print receipt popup dialog when self checkout is finished"
683
            - "the print receipt popup dialog when self checkout is finished"
684
        -
685
            - pref: SelfCheckAllowByIPRanges
686
              class: short
687
            - (Leave blank if not used. Use ranges or simple ip addresses separated by spaces, like <code>192.168.1.1 192.168.0.0/24</code>.)
684
688
685
    Course Reserves:
689
    Course Reserves:
686
        -
690
        -
(-)a/opac/sco/help.pl (+10 lines)
Lines 24-34 Link Here
24
use strict;
24
use strict;
25
use warnings;
25
use warnings;
26
use CGI qw ( -utf8 );
26
use CGI qw ( -utf8 );
27
use Net::IP::Match::XS;
27
28
28
use C4::Auth   qw(get_template_and_user);
29
use C4::Auth   qw(get_template_and_user);
29
use C4::Output qw(output_html_with_http_headers);
30
use C4::Output qw(output_html_with_http_headers);
30
31
31
my $query = new CGI;
32
my $query = new CGI;
33
34
my @allowedipranges = split(' ', C4::Context->preference('SelfCheckAllowByIPRanges'));
35
if (scalar @allowedipranges > 0) {
36
    unless (match_ip($ENV{'REMOTE_ADDR'}, @allowedipranges)) {
37
        print $query->redirect("/cgi-bin/koha/opac-main.pl");
38
        exit;
39
    }
40
}
41
32
my ($template, $borrowernumber, $cookie) = get_template_and_user({
42
my ($template, $borrowernumber, $cookie) = get_template_and_user({
33
    template_name => "sco/help.tt",
43
    template_name => "sco/help.tt",
34
    query => $query,
44
    query => $query,
(-)a/opac/sco/sco-main.pl (+9 lines)
Lines 36-41 use warnings; Link Here
36
36
37
use CGI qw ( -utf8 );
37
use CGI qw ( -utf8 );
38
use Digest::MD5 qw(md5_base64);
38
use Digest::MD5 qw(md5_base64);
39
use Net::IP::Match::XS;
39
40
40
use C4::Auth qw(get_template_and_user checkpw);
41
use C4::Auth qw(get_template_and_user checkpw);
41
use C4::Koha;
42
use C4::Koha;
Lines 54-59 unless (C4::Context->preference('WebBasedSelfCheck')) { Link Here
54
    exit;
55
    exit;
55
}
56
}
56
57
58
my @allowedipranges = split(' ', C4::Context->preference('SelfCheckAllowByIPRanges'));
59
if (scalar @allowedipranges > 0) {
60
    unless (match_ip($ENV{'REMOTE_ADDR'}, @allowedipranges)) {
61
        print $query->redirect("/cgi-bin/koha/opac-main.pl");
62
        exit;
63
    }
64
}
65
57
if (C4::Context->preference('AutoSelfCheckAllowed')) 
66
if (C4::Context->preference('AutoSelfCheckAllowed')) 
58
{
67
{
59
    my $AutoSelfCheckID = C4::Context->preference('AutoSelfCheckID');
68
    my $AutoSelfCheckID = C4::Context->preference('AutoSelfCheckID');
(-)a/opac/sco/sco-patron-image.pl (-1 / +11 lines)
Lines 19-24 Link Here
19
19
20
use strict;
20
use strict;
21
use warnings;
21
use warnings;
22
use Net::IP::Match::XS;
23
22
use C4::Service;
24
use C4::Service;
23
use C4::Members;
25
use C4::Members;
24
26
Lines 33-38 unless (C4::Context->preference('ShowPatronImageInWebBasedSelfCheck')) { Link Here
33
    exit;
35
    exit;
34
}
36
}
35
37
38
my @allowedipranges = split(' ', C4::Context->preference('SelfCheckAllowByIPRanges'));
39
if (scalar @allowedipranges > 0) {
40
    unless (match_ip($ENV{'REMOTE_ADDR'}, @allowedipranges)) {
41
        print $query->header(status => '403 Forbidden - functionality not available from your location');
42
        exit;
43
    }
44
}
45
46
36
my ($borrowernumber) = C4::Service->require_params('borrowernumber');
47
my ($borrowernumber) = C4::Service->require_params('borrowernumber');
37
48
38
my ($imagedata, $dberror) = GetPatronImage($borrowernumber);
49
my ($imagedata, $dberror) = GetPatronImage($borrowernumber);
39
- 

Return to bug 14407