Lines 22-27
use warnings;
Link Here
|
22 |
use C4::Service; |
22 |
use C4::Service; |
23 |
use C4::Members; |
23 |
use C4::Members; |
24 |
use Koha::Patron::Images; |
24 |
use Koha::Patron::Images; |
|
|
25 |
use Koha::Patrons; |
26 |
use Koha::Token; |
25 |
|
27 |
|
26 |
my ($query, $response) = C4::Service->init(circulate => 'self_checkout'); |
28 |
my ($query, $response) = C4::Service->init(circulate => 'self_checkout'); |
27 |
|
29 |
|
Lines 35-44
unless (C4::Context->preference('ShowPatronImageInWebBasedSelfCheck')) {
Link Here
|
35 |
} |
37 |
} |
36 |
|
38 |
|
37 |
my ($borrowernumber) = C4::Service->require_params('borrowernumber'); |
39 |
my ($borrowernumber) = C4::Service->require_params('borrowernumber'); |
|
|
40 |
my ($csrf_token) = C4::Service->require_params('csrf_token'); |
38 |
|
41 |
|
39 |
my $patron_image = Koha::Patron::Images->find($borrowernumber); |
42 |
my $patron = Koha::Patrons->find( $borrowernumber ); |
|
|
43 |
my $patron_image = $patron->image; |
40 |
|
44 |
|
41 |
if ($patron_image) { |
45 |
if ($patron_image) { |
|
|
46 |
|
47 |
unless ( |
48 |
Koha::Token->new->check_csrf( |
49 |
{ |
50 |
session_id => scalar $query->cookie('CGISESSID') |
51 |
. $patron->cardnumber, |
52 |
id => $patron->userid, |
53 |
token => $csrf_token, |
54 |
} |
55 |
) |
56 |
) |
57 |
{ |
58 |
|
59 |
print $query->header(-type => 'text/plain', -status => '403 Forbidden'); |
60 |
exit; |
61 |
} |
42 |
print $query->header( |
62 |
print $query->header( |
43 |
-type => $patron_image->mimetype, |
63 |
-type => $patron_image->mimetype, |
44 |
-Content_Length => length( $patron_image->imagefile ) |
64 |
-Content_Length => length( $patron_image->imagefile ) |
45 |
- |
|
|