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 <martin.renvoize@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This commit is contained in:
Thomas 2015-01-13 23:25:49 +00:00 committed by Tomas Cohen Arazi
parent b8989510ec
commit bcbcad897a

View file

@ -45,6 +45,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 suggestedbyme>;
$op = 'else' unless $op;