Bugzilla – Attachment 68631 Details for
Bug 19531
When editing patrons without circulation permission redirect should be to the patron's detail page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19531: When saving patron record do not redirect to circ if not authorised
Bug-19531-When-saving-patron-record-do-not-redirec.patch (text/plain), 2.08 KB, created by
Nick Clemens (kidclamp)
on 2017-10-26 16:05:06 UTC
(
hide
)
Description:
Bug 19531: When saving patron record do not redirect to circ if not authorised
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2017-10-26 16:05:06 UTC
Size:
2.08 KB
patch
obsolete
>From e47508319fdd081d5d5af0f497e411af49ffde54 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 25 Oct 2017 17:29:16 -0300 >Subject: [PATCH] Bug 19531: When saving patron record do not redirect to circ > if not authorised > >If the logged in patron does not have the necessary permission we should >not redirect to circulation.pl but moremember.pl instead > >Test plan: >With the borrowers permission, you should be able to edit a patron and >be redirect to the moremember page > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> > >Signed-off-by: Nick Clemens <nick@bywatersolutions.com> >--- > members/memberentry.pl | 16 ++++++++++++---- > 1 file changed, 12 insertions(+), 4 deletions(-) > >diff --git a/members/memberentry.pl b/members/memberentry.pl >index ed35e1b..fcb6c56 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -523,10 +523,18 @@ if ((!$nok) and $nodouble and ($op eq 'insert' or $op eq 'save')){ > C4::Form::MessagingPreferences::handle_form_action($input, { borrowernumber => $borrowernumber }, $template); > } > } >- print scalar ($destination eq "circ") ? >- $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber") : >- $input->redirect("/cgi-bin/koha/members/moremember.pl?borrowernumber=$borrowernumber") ; >- exit; # You can only send 1 redirect! After that, content or other headers don't matter. >+ >+ if ( $destination eq 'circ' and not C4::Auth::haspermission( C4::Context->userenv->{id}, { circulate => 'circulate_remaining_permissions' } ) ) { >+ # If we want to redirect to circulation.pl and need to check if the logged in user has the necessary permission >+ $destination = 'not_circ'; >+ } >+ print scalar( $destination eq "circ" ) >+ ? $input->redirect( >+ "/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber") >+ : $input->redirect( >+ "/cgi-bin/koha/members/moremember.pl?borrowernumber=$borrowernumber" >+ ); >+ exit; # You can only send 1 redirect! After that, content or other headers don't matter. > } > > if ($delete){ >-- >2.1.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 19531
:
68557
|
68568
| 68631