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