Lines 19-24
use Modern::Perl;
Link Here
|
19 |
|
19 |
|
20 |
use CGI qw ( -utf8 ); |
20 |
use CGI qw ( -utf8 ); |
21 |
use Digest::MD5 qw( md5_base64 md5_hex ); |
21 |
use Digest::MD5 qw( md5_base64 md5_hex ); |
|
|
22 |
use Encode qw( encode ); |
22 |
use String::Random qw( random_string ); |
23 |
use String::Random qw( random_string ); |
23 |
|
24 |
|
24 |
use C4::Auth; |
25 |
use C4::Auth; |
Lines 200-206
elsif ( $action eq 'update' ) {
Link Here
|
200 |
die "Wrong CSRF token" |
201 |
die "Wrong CSRF token" |
201 |
unless Koha::Token->new->check_csrf({ |
202 |
unless Koha::Token->new->check_csrf({ |
202 |
id => $borrower->{userid}, |
203 |
id => $borrower->{userid}, |
203 |
secret => md5_base64( C4::Context->config('pass') ), |
204 |
secret => md5_base64( Encode::encode( 'UTF-8', C4::Context->config('pass') ) ), |
204 |
token => scalar $cgi->param('csrf_token'), |
205 |
token => scalar $cgi->param('csrf_token'), |
205 |
}); |
206 |
}); |
206 |
|
207 |
|
Lines 221-227
elsif ( $action eq 'update' ) {
Link Here
|
221 |
borrower => \%borrower, |
222 |
borrower => \%borrower, |
222 |
csrf_token => Koha::Token->new->generate_csrf({ |
223 |
csrf_token => Koha::Token->new->generate_csrf({ |
223 |
id => $borrower->{userid}, |
224 |
id => $borrower->{userid}, |
224 |
secret => md5_base64( C4::Context->config('pass') ), |
225 |
secret => md5_base64( Encode::encode( 'UTF-8', C4::Context->config('pass') ) ), |
225 |
}), |
226 |
}), |
226 |
); |
227 |
); |
227 |
|
228 |
|
Lines 262-268
elsif ( $action eq 'update' ) {
Link Here
|
262 |
borrower => GetMember( borrowernumber => $borrowernumber ), |
263 |
borrower => GetMember( borrowernumber => $borrowernumber ), |
263 |
csrf_token => Koha::Token->new->generate_csrf({ |
264 |
csrf_token => Koha::Token->new->generate_csrf({ |
264 |
id => $borrower->{userid}, |
265 |
id => $borrower->{userid}, |
265 |
secret => md5_base64( C4::Context->config('pass') ), |
266 |
secret => md5_base64( Encode::encode( 'UTF-8', C4::Context->config('pass') ) ), |
266 |
}), |
267 |
}), |
267 |
); |
268 |
); |
268 |
} |
269 |
} |
Lines 285-291
elsif ( $action eq 'edit' ) { #Display logged in borrower's data
Link Here
|
285 |
hidden => GetHiddenFields( $mandatory, 'modification' ), |
286 |
hidden => GetHiddenFields( $mandatory, 'modification' ), |
286 |
csrf_token => Koha::Token->new->generate_csrf({ |
287 |
csrf_token => Koha::Token->new->generate_csrf({ |
287 |
id => $borrower->{userid}, |
288 |
id => $borrower->{userid}, |
288 |
secret => md5_base64( C4::Context->config('pass') ), |
289 |
secret => md5_base64( Encode::encode( 'UTF-8', C4::Context->config('pass') ) ), |
289 |
}), |
290 |
}), |
290 |
); |
291 |
); |
291 |
|
292 |
|