Bug 12702 - Suggestions still accessible in OPAC when deactivated
authorThomas <tomsStudy@gmail.com>
Tue, 13 Jan 2015 23:25:49 +0000 (23:25 +0000)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Sun, 18 Jan 2015 13:40:56 +0000 (10:40 -0300)
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>
opac/opac-suggestions.pl

index 701e431..16aadf8 100755 (executable)
@@ -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;