Bugzilla – Attachment 50685 Details for
Bug 15823
Can still access patron discharge slip without having the syspref on - Permissions breach
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15823: Can still access patron discharge slip without having the syspref on
Bug-15823-Can-still-access-patron-discharge-slip-w.patch (text/plain), 5.18 KB, created by
Aleisha Amohia
on 2016-04-25 22:59:49 UTC
(
hide
)
Description:
Bug 15823: Can still access patron discharge slip without having the syspref on
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2016-04-25 22:59:49 UTC
Size:
5.18 KB
patch
obsolete
>From 702dcb875ec3c6fc126b86cc175249c3a9ad08bf Mon Sep 17 00:00:00 2001 >From: Aleisha <aleishaamohia@hotmail.com> >Date: Tue, 23 Feb 2016 04:06:30 +0000 >Subject: [PATCH] Bug 15823: Can still access patron discharge slip without > having the syspref on >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >EDIT: Fix for OPAC side > >To test: >1) Ensure syspref useDischarge is disabled >2) Go to /cgi-bin/koha/members/discharge.pl?borrowernumber=X&discharge=1 >3) Validate that you are still able to generate a discharge slip for this patron >4) Apply patch and refresh page >5) Confirm that you are redirected to the circulation.pl page for the user and that an error message is there. >OPAC SIDE >6) Go to the OPAC >7) Go to /cgi-bin/koha/opac-discharge.pl >8) Confirm you get a message saying discharges are disabled >9) Go to /cgi-bin/koha/opac-discharge.pl?op=request >10) Confirm you see same message > >Sponsored-by: Catalyst IT > >Followed test plan, works as expected. >Signed-off-by: Marc Véron <veron@veron.ch> >--- > circ/circulation.pl | 1 + > koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt | 5 ++++- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-discharge.tt | 4 ++++ > members/discharge.pl | 11 +++++++++-- > 4 files changed, 18 insertions(+), 3 deletions(-) > >diff --git a/circ/circulation.pl b/circ/circulation.pl >index 3a57685..1fcb402 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -660,6 +660,7 @@ $template->param( > canned_bor_notes_loop => $canned_notes, > debarments => GetDebarments({ borrowernumber => $borrowernumber }), > todaysdate => output_pref( { dt => dt_from_string()->set(hour => 23)->set(minute => 59), dateformat => 'sql' } ), >+ nopermission => $query->param('nopermission'), > ); > > output_html_with_http_headers $query, $cookie, $template->output; >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >index ec3a1d9..ebb4aaf 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -122,7 +122,6 @@ $(document).ready(function() { > $(':radio', this).attr('checked', 'true') > } > }); >- > }); > > //]]> >@@ -212,6 +211,10 @@ $(document).ready(function() { > <div class="dialog message">The patron has unpaid charges for holds, rentals etc of [% alert.OTHER_CHARGES %]</div> > [% END %] > >+[% IF ( nopermission ) %] >+ <div class="dialog alert">Staff members are not allowed to discharge borrowers, nor borrowers to request a discharge.</div> >+[% END %] >+ > [% IF ( NEEDSCONFIRMATION ) %] > <div class="yui-g"> > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-discharge.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-discharge.tt >index d8f5648..23f088d 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-discharge.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-discharge.tt >@@ -23,6 +23,9 @@ > <div class="span10"> > <div id="discharge" class="maincontainer"> > <h1>Discharge</h1> >+ [% IF not(Koha.Preference("useDischarge")) %] >+ Discharges have not been enabled. Please contact the library. >+ [% ELSE %] > [% FOR message IN messages %] > <div class="dialog [% message.type %]"> > [% IF message.code == "unable_to_generate_pdf" %] >@@ -46,6 +49,7 @@ > <p><strong>Warning</strong>: This request is only valid if you are in good standing with the library. Once the application is made, you can not borrow library materials.</p> > <a href="/cgi-bin/koha/opac-discharge.pl?op=request">Ask for a discharge</a> > [% END %] >+ [% END %] > </div> <!-- / #discharge --> > </div> <!-- / .span10 --> > </div> <!-- / .row-fluid --> >diff --git a/members/discharge.pl b/members/discharge.pl >index c9062dc..0fc9e8e 100755 >--- a/members/discharge.pl >+++ b/members/discharge.pl >@@ -42,6 +42,7 @@ use Koha::Patron::Images; > use Koha::DateUtils; > > my $input = new CGI; >+ > my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user({ > template_name => 'members/discharge.tt', > query => $input, >@@ -50,7 +51,13 @@ my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user({ > flagsrequired => { 'borrowers' => '*' }, > }); > >-my $borrowernumber; >+my $borrowernumber = $input->param('borrowernumber'); >+ >+unless ( C4::Context->preference('useDischarge') ) { >+ print $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber&nopermission=1"); >+ exit; >+} else { >+ > my $data; > if ( $input->param('borrowernumber') ) { > $borrowernumber = $input->param('borrowernumber'); >@@ -132,7 +139,7 @@ if ( $input->param('borrowernumber') ) { > can_be_discharged => $can_be_discharged, > validated_discharges => $validated_discharges, > ); >-} >+}} > > $template->param( dischargeview => 1, ); > >-- >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 15823
:
48082
|
48095
|
48308
|
49181
|
50685
|
50707
|
50771
|
51121
|
51133
|
51229
|
51268
|
51269
|
51750