Lines 25-32
use Modern::Perl;
Link Here
|
25 |
use CGI qw ( -utf8 ); |
25 |
use CGI qw ( -utf8 ); |
26 |
use C4::Auth qw( check_api_auth ); |
26 |
use C4::Auth qw( check_api_auth ); |
27 |
use C4::Context; |
27 |
use C4::Context; |
28 |
use C4::Members; |
28 |
use Koha::Patrons; |
29 |
use Koha::Patron::Images; |
|
|
30 |
|
29 |
|
31 |
$|=1; |
30 |
$|=1; |
32 |
|
31 |
|
Lines 54-68
unless ( $status eq 'ok' ) {
Link Here
|
54 |
exit 0; |
53 |
exit 0; |
55 |
} |
54 |
} |
56 |
|
55 |
|
57 |
|
|
|
58 |
|
59 |
if ($query->param('borrowernumber')) { |
56 |
if ($query->param('borrowernumber')) { |
60 |
$borrowernumber = $query->param('borrowernumber'); |
57 |
$borrowernumber = $query->param('borrowernumber'); |
61 |
} else { |
58 |
} else { |
62 |
$borrowernumber = shift; |
59 |
$borrowernumber = shift; |
63 |
} |
60 |
} |
64 |
|
61 |
|
65 |
my $patron_image = Koha::Patron::Images->find($borrowernumber); |
62 |
my $patron = Koha::Patrons->find( $borrowernumber ); |
|
|
63 |
my $userenv = C4::Context->userenv; |
64 |
my $logged_in_user = Koha::Patrons->find( $userenv->{number} ); |
65 |
|
66 |
unless ( $logged_in_user->can_see_patron_infos( $patron ) ) { |
67 |
print $query->header(-type => 'text/plain', -status => '403 Forbidden'); |
68 |
exit 0; |
69 |
} |
70 |
|
71 |
my $patron_image = $patron->image; |
66 |
|
72 |
|
67 |
# NOTE: Never dump the contents of $imagedata->{'patronimage'} via a warn to a log or nasty |
73 |
# NOTE: Never dump the contents of $imagedata->{'patronimage'} via a warn to a log or nasty |
68 |
# things will result... you have been warned! |
74 |
# things will result... you have been warned! |
69 |
- |
|
|