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> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
parent
244e798a51
commit
c93df0695f
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Reference in New Issue