Bugzilla – Attachment 129844 Details for
Bug 29931
Script plugins-enable.pl should check the cookie status before running plugins
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29931: (follow-up) Similar thing in opac-patron-image.pl
Bug-29931-follow-up-Similar-thing-in-opac-patron-i.patch (text/plain), 1.44 KB, created by
Jonathan Druart
on 2022-01-27 08:24:42 UTC
(
hide
)
Description:
Bug 29931: (follow-up) Similar thing in opac-patron-image.pl
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-01-27 08:24:42 UTC
Size:
1.44 KB
patch
obsolete
>From a9c184554ce71ce3b2743a7f576ddf9bea4ca4e5 Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 24 Jan 2022 13:06:33 +0000 >Subject: [PATCH] Bug 29931: (follow-up) Similar thing in opac-patron-image.pl > >Although less harmful indeed. No borrowernumber, no image. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Tested: logged in, logged out, prefs toggled. All fine. > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > opac/opac-patron-image.pl | 13 +++++++------ > 1 file changed, 7 insertions(+), 6 deletions(-) > >diff --git a/opac/opac-patron-image.pl b/opac/opac-patron-image.pl >index df1efdf4ef6..dccba229eb2 100755 >--- a/opac/opac-patron-image.pl >+++ b/opac/opac-patron-image.pl >@@ -32,13 +32,14 @@ unless (C4::Context->preference('OPACpatronimages')) { > exit; > } > >-my $needed_flags; >-my %cookies = CGI::Cookie->fetch; >-my $sessid = $cookies{'CGISESSID'}->value; >-my ($auth_status) = check_cookie_auth($sessid, $needed_flags); >-my $borrowernumber = C4::Context->userenv->{'number'}; >+my ($auth_status) = check_cookie_auth( $query->cookie('CGISESSID') ); >+if( $auth_status ne 'ok' ) { >+ print CGI::header( '-status' => '401' ); >+ exit 0; >+} > >-my $patron_image = Koha::Patron::Images->find($borrowernumber); >+my $userenv = C4::Context->userenv; >+my $patron_image = $userenv ? Koha::Patron::Images->find( $userenv->{number} ) : undef; > > if ($patron_image) { > print $query->header( >-- >2.25.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 29931
:
129717
|
129721
|
129722
|
129746
|
129747
|
129840
|
129841
|
129842
|
129843
| 129844 |
129845
|
131483