From 27f6ca35210a70662de50577c9f1c3fa2774dd08 Mon Sep 17 00:00:00 2001 From: Thomas Date: Tue, 13 Jan 2015 23:25:49 +0000 Subject: [PATCH] Bug 12702 - Suggestions still accessible in OPAC when deactivated Added check for suggestions turned off. If off user is redirected to 404 error. If patron suggestions are off guest sugestions will also redirect to 404 Signed-off-by: Martin Renvoize Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi (cherry picked from commit bcbcad897a3f383b38851f8d0fb27017170d181f) Signed-off-by: Chris Cormack --- opac/opac-suggestions.pl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/opac/opac-suggestions.pl b/opac/opac-suggestions.pl index 2d89d9367c..c9b6a98200 100755 --- a/opac/opac-suggestions.pl +++ b/opac/opac-suggestions.pl @@ -44,6 +44,12 @@ if ($negcaptcha ) { exit; } +#If suggestions are turned off we redirect to 404 error. This will also redirect guest suggestions +if ( ! C4::Context->preference('suggestion') ) { + print $input->redirect("/cgi-bin/koha/errors/404.pl"); + exit; +} + delete $$suggestion{$_} foreach qw; $op = 'else' unless $op; -- 2.39.5