Bug 12528: redirect to 404 if at least 1 pref is off
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 4 Jan 2016 09:23:15 +0000 (09:23 +0000)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 29 Apr 2016 17:54:10 +0000 (17:54 +0000)
Signed-off-by: Marc VĂ©ron <veron@veron.ch>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
opac/opac-messaging.pl

index 1a07f13..6a97ca6 100755 (executable)
@@ -35,6 +35,12 @@ use Koha::SMS::Providers;
 
 my $query = CGI->new();
 
+unless ( C4::Context->preference('EnhancedMessagingPreferencesOPAC') and
+         C4::Context->preference('EnhancedMessagingPreferences') ) {
+    print $query->redirect("/cgi-bin/koha/errors/404.pl");
+    exit;
+}
+
 my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
     {
         template_name   => 'opac-messaging.tt',