Bug 7317: (QA folowup) 404 if module is disabled (intranet)
authorTomas Cohen Arazi <tomascohen@theke.io>
Mon, 23 Oct 2017 18:33:17 +0000 (15:33 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 9 Nov 2017 14:42:13 +0000 (11:42 -0300)
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Magnus Enger <magnus@libriotech.no>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Benjamin Rokseth <benjamin.rokseth@kul.oslo.kommune.no>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

ill/ill-requests.pl

index 26cb350..f6572e4 100755 (executable)
@@ -27,7 +27,7 @@ use Koha::AuthorisedValues;
 use Koha::Illrequests;
 use Koha::Libraries;
 
-my $cgi = CGI->new;
+our $cgi = CGI->new;
 my $illRequests = Koha::Illrequests->new;
 
 # Grab all passed data
@@ -35,6 +35,12 @@ my $illRequests = Koha::Illrequests->new;
 # of 'my'
 our $params = $cgi->Vars();
 
+# Leave immediately if ILLModule is disabled
+unless ( C4::Context->preference('ILLModule') ) {
+    print $cgi->redirect("/cgi-bin/koha/errors/404.pl");
+    exit;
+}
+
 my $op = $params->{method} || 'illlist';
 
 my ( $template, $patronnumber, $cookie ) = get_template_and_user( {