Lines 340-355
sub output_and_exit_if_error {
Link Here
|
340 |
# But in the long term we will want to get a biblio in parameter |
340 |
# But in the long term we will want to get a biblio in parameter |
341 |
$error = 'unknown_biblio' unless $params->{record}; |
341 |
$error = 'unknown_biblio' unless $params->{record}; |
342 |
} |
342 |
} |
343 |
elsif ( $params->{module} eq 'CSRF_TOKEN_CHECK' ) { |
343 |
} |
344 |
$error = 'wrong_csrf_token' |
344 |
elsif ( $params->{check} eq 'csrf_token' ) { |
345 |
unless Koha::Token->new->check_csrf( |
345 |
$error = 'wrong_csrf_token' |
346 |
{ |
346 |
unless Koha::Token->new->check_csrf( |
347 |
session_id => scalar $query->cookie('CGISESSID'), |
347 |
{ |
348 |
token => scalar $query->param('csrf_token'), |
348 |
session_id => scalar $query->cookie('CGISESSID'), |
349 |
} |
349 |
token => scalar $query->param('csrf_token'), |
350 |
); |
|
|
351 |
} |
350 |
} |
352 |
} |
351 |
); |
353 |
} |
352 |
} |
354 |
output_and_exit( $query, $cookie, $template, $error ) if $error; |
353 |
output_and_exit( $query, $cookie, $template, $error ) if $error; |
355 |
return; |
354 |
return; |