Bugzilla – Attachment 84946 Details for
Bug 9422
Patron picture uploader ignores patronimages syspref
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9422: Don't allow access to 'Upload patron images' when patronimages syspref is off
Bug-9422-Dont-allow-access-to-Upload-patron-images.patch (text/plain), 4.30 KB, created by
Katrin Fischer
on 2019-02-10 11:19:57 UTC
(
hide
)
Description:
Bug 9422: Don't allow access to 'Upload patron images' when patronimages syspref is off
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2019-02-10 11:19:57 UTC
Size:
4.30 KB
patch
obsolete
>From f5f10ded572842dff3fa2ebba16baad30f64de99 Mon Sep 17 00:00:00 2001 >From: Katrin Fischer <katrin.fischer.83@web.de> >Date: Sun, 10 Feb 2019 12:09:08 +0100 >Subject: [PATCH] Bug 9422: Don't allow access to 'Upload patron images' when > patronimages syspref is off > >In addition to checking the patron image upload permission, this >adds a check for the patronimages system preference to the tools >home page and sidebar. > >To test: >- Check that the patron image upload tool only displays when > - system preference patronimages is set to 'Allow' > and user is either > - superlibrarian or > - has bath_upload_patron_images permission >- Save URL of patron image uploader page >- Turn off patronimages >- Verify you get redirected to the home page of Koha when trying > to access the page > >Note: this redirect is already used by the stock rotation feature. >--- > koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc | 4 ++-- > koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt | 4 ++-- > tools/picture-upload.pl | 6 ++++++ > 3 files changed, 10 insertions(+), 4 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc >index 67ccf5507e..6799a70bbc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/tools-menu.inc >@@ -7,7 +7,7 @@ > </ul> > [% IF ( CAN_user_tools_manage_patron_lists || CAN_user_clubs || CAN_user_tools_moderate_comments || CAN_user_tools_import_patrons > || CAN_user_tools_edit_notices || CAN_user_tools_edit_notice_status_triggers || CAN_user_tools_label_creator || CAN_user_tools_delete_anonymize_patrons >- || CAN_user_tools_edit_patrons || CAN_user_tools_moderate_tags || CAN_user_tools_batch_upload_patron_images ) %] >+ || CAN_user_tools_edit_patrons || CAN_user_tools_moderate_tags || ( CAN_user_tools_batch_upload_patron_images && Koha.Preference('patronimages') ) ) %] > <h5>Patrons and circulation</h5> > <ul> > [% IF ( CAN_user_tools_manage_patron_lists ) %] >@@ -40,7 +40,7 @@ > [% IF ( CAN_user_tools_moderate_tags ) %] > <li><a href="/cgi-bin/koha/tags/review.pl">Tag moderation</a></li> > [% END %] >- [% IF ( CAN_user_tools_batch_upload_patron_images ) %] >+ [% IF ( CAN_user_tools_batch_upload_patron_images && Koha.Preference('patronimages') ) %] > <li><a href="/cgi-bin/koha/tools/picture-upload.pl">Upload patron images</a></li> > [% END %] > </ul> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt >index df906c3567..39c010c606 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/tools-home.tt >@@ -15,7 +15,7 @@ > <div class="col-sm-4"> > [% IF ( CAN_user_tools_manage_patron_lists || CAN_user_clubs || CAN_user_tools_moderate_comments || CAN_user_tools_import_patrons > || CAN_user_tools_edit_notices || CAN_user_tools_edit_notice_status_triggers || CAN_user_tools_label_creator || CAN_user_tools_delete_anonymize_patrons >- || CAN_user_tools_edit_patrons || CAN_user_tools_moderate_tags || CAN_user_tools_batch_upload_patron_images ) %] >+ || CAN_user_tools_edit_patrons || CAN_user_tools_moderate_tags || ( CAN_user_tools_batch_upload_patron_images && Koha.Preference('patronimages') ) ) %] > <h3>Patrons and circulation</h3> > [% END %] > <dl> >@@ -69,7 +69,7 @@ > <dd>Moderate patron tags</dd> > [% END %] > >- [% IF ( CAN_user_tools_batch_upload_patron_images ) %] >+ [% IF ( CAN_user_tools_batch_upload_patron_images && Koha.Preference('patronimages') ) %] > <dt><a href="/cgi-bin/koha/tools/picture-upload.pl">Upload patron images</a></dt> > <dd>Upload patron images in a batch or one at a time</dd> > [% END %] >diff --git a/tools/picture-upload.pl b/tools/picture-upload.pl >index 54f18b53ad..e349f5a432 100755 >--- a/tools/picture-upload.pl >+++ b/tools/picture-upload.pl >@@ -37,6 +37,12 @@ use Koha::Token; > > my $input = new CGI; > >+unless (C4::Context->preference('patronimages')) { >+ # redirect to intranet home if patronimages is not enabled >+ print $input->redirect("/cgi-bin/koha/mainpage.pl"); >+ exit; >+} >+ > my ($template, $loggedinuser, $cookie) > = get_template_and_user({template_name => "tools/picture-upload.tt", > query => $input, >-- >2.17.1
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 9422
:
84946
|
85021
|
102039