From 48c474ec9fc202f6fe49f551eedf17b7eaa043be Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 4 Jan 2016 09:23:15 +0000 Subject: [PATCH] Bug 12528: redirect to 404 if at least 1 pref is off MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marc VĂ©ron Signed-off-by: Jonathan Druart --- opac/opac-messaging.pl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/opac/opac-messaging.pl b/opac/opac-messaging.pl index 1a07f13..6a97ca6 100755 --- a/opac/opac-messaging.pl +++ b/opac/opac-messaging.pl @@ -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', -- 2.7.0