Bugzilla – Attachment 20332 Details for
Bug 9254
New option to block patrons from changing messaging preferences in OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9254: redirect to 404 if at least 1 pref is off
Bug-9254-redirect-to-404-if-at-least-1-pref-is-off.patch (text/plain), 2.18 KB, created by
Jonathan Druart
on 2013-08-14 14:22:32 UTC
(
hide
)
Description:
Bug 9254: redirect to 404 if at least 1 pref is off
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-08-14 14:22:32 UTC
Size:
2.18 KB
patch
obsolete
>From dcaa193f1e1c11bcdf09b3519919199773fdc5fe Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Wed, 14 Aug 2013 16:16:01 +0200 >Subject: [PATCH] Bug 9254: redirect to 404 if at least 1 pref is off > >And set the value of EnhancedMessagingPreferencesOPAC = EnhancedMessagingPreferences >--- > installer/data/mysql/updatedatabase.pl | 9 +++++++-- > opac/opac-messaging.pl | 6 ++++++ > 2 files changed, 13 insertions(+), 2 deletions(-) > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 09086b4..2a2ea24 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -7072,8 +7072,13 @@ if ( CheckVersion($DBversion) ) { > > $DBversion = "3.13.00.XXX"; > if (C4::Context->preference("Version") < TransformToNum($DBversion)) { >- $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('EnhancedMessagingPreferencesOPAC',1, 'Show the patrons messaging preferences page in the OPAC', NULL, 'YesNo')"); >- print "Upgrade to $DBversion done (Bug 9254: Problem with EnhancedMessagingPreferences) \n"; >+ $dbh->do(q| >+ INSERT INTO systempreferences (variable,value,explanation,options,type) >+ SELECT 'EnhancedMessagingPreferencesOPAC', value, 'Show the patrons messaging preferences page in the OPAC', NULL, 'YesNo' >+ FROM systempreferences >+ WHERE variable='EnhancedMessagingPreferences' >+ |); >+ print "Upgrade to $DBversion done (Bug 9254: Add EnhancedMessagingPreferencesOPAC syspref) \n"; > SetVersion ($DBversion); > } > >diff --git a/opac/opac-messaging.pl b/opac/opac-messaging.pl >index dc244db..5130298 100755 >--- a/opac/opac-messaging.pl >+++ b/opac/opac-messaging.pl >@@ -35,6 +35,12 @@ use C4::Form::MessagingPreferences; > > 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.tmpl', >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 9254
:
14199
|
14244
|
14246
|
15010
|
15011
|
15764
|
15765
|
20332
|
38122
|
38123
|
38124
|
38513
|
38514
|
38515
|
38516
|
38517