From a07db3537d70aa642f1f2e2731eb8e0cf200e1f4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marc=20V=C3=A9ron?= Date: Thu, 5 May 2016 08:13:53 +0200 Subject: [PATCH] Bug 15823: Redirect opac-discharge.pl to 404 page See comment #17: Redirect to 404 in opac-discharge.pl and remove message in template because with the redirect it will never be reached. Signed-off-by: Katrin Fischer Signed-off-by: Brendan Gallagher --- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-discharge.tt | 4 ---- opac/opac-discharge.pl | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-discharge.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-discharge.tt index 23f088dca3..d8f5648c81 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-discharge.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-discharge.tt @@ -23,9 +23,6 @@

Discharge

- [% IF not(Koha.Preference("useDischarge")) %] - Discharges have not been enabled. Please contact the library. - [% ELSE %] [% FOR message IN messages %]
[% IF message.code == "unable_to_generate_pdf" %] @@ -49,7 +46,6 @@

Warning: This request is only valid if you are in good standing with the library. Once the application is made, you can not borrow library materials.

Ask for a discharge [% END %] - [% END %]
diff --git a/opac/opac-discharge.pl b/opac/opac-discharge.pl index c9dea911c0..605efb7b49 100755 --- a/opac/opac-discharge.pl +++ b/opac/opac-discharge.pl @@ -33,6 +33,11 @@ use Koha::DateUtils; my $input = new CGI; +unless ( C4::Context->preference('useDischarge') ) { + print $input->redirect("/cgi-bin/koha/errors/404.pl"); + exit; +} + my $op = $input->param("op"); # Getting the template and auth -- 2.39.5