From 751337b53c728cc968a78f4a6b9d8b682551fac4 Mon Sep 17 00:00:00 2001 From: David Cook Date: Wed, 20 Apr 2022 01:53:26 +0000 Subject: [PATCH] Bug 22990: (follow-up) fix merge mistakes Signed-off-by: David Cook --- acqui/basketheader.pl | 2 +- circ/add_message.pl | 2 +- members/pay.pl | 1 + members/setstatus.pl | 11 ++++++++++- suggestion/suggestion.pl | 2 +- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/acqui/basketheader.pl b/acqui/basketheader.pl index 284963847e..5e98c4e4eb 100755 --- a/acqui/basketheader.pl +++ b/acqui/basketheader.pl @@ -49,7 +49,7 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Context; use C4::Auth qw( get_template_and_user ); -use C4::Output qw( output_html_with_http_headers ); +use C4::Output qw( output_html_with_http_headers output_and_exit_if_error ); use C4::Acquisition qw( GetBasket ModBasket ModBasketHeader NewBasket ); use C4::Contract qw( GetContracts GetContract ); diff --git a/circ/add_message.pl b/circ/add_message.pl index 2018c4fece..a7f5ac99aa 100755 --- a/circ/add_message.pl +++ b/circ/add_message.pl @@ -22,7 +22,7 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Auth qw( get_template_and_user ); -use C4::Output; +use C4::Output qw( output_and_exit_if_error ); use Koha::Patron::Message; my $input = CGI->new; diff --git a/members/pay.pl b/members/pay.pl index 35b84df6c5..adc34b37c3 100755 --- a/members/pay.pl +++ b/members/pay.pl @@ -98,6 +98,7 @@ elsif ( $input->param('apply_credits') ) { apply_credits({ patron => $patron, cgi => $input }); } elsif ( $input->param('confirm_writeoff') ) { + output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' }); my $item_id = $input->param('itemnumber'); my $accountlines_id = $input->param('accountlines_id'); my $amount = $input->param('amountwrittenoff'); diff --git a/members/setstatus.pl b/members/setstatus.pl index 1a28c25384..6813c5ff5c 100755 --- a/members/setstatus.pl +++ b/members/setstatus.pl @@ -53,7 +53,16 @@ my $patron = Koha::Patrons->find( $borrowernumber ); if ( $logged_in_user->can_see_patron_infos($patron) ) { if ( $reregistration eq 'y' ) { # re-reregistration function to automatic calcul of date expiry - output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' }); + #FIXME: Can't use output_and_exit_if_error here because there's no $template available + #output_and_exit_if_error($input, $cookie, $template, { check => 'csrf_token' }); + #TODO: + #die "Wrong CSRF token" unless Koha::Token->new->check_csrf( + # { + # session_id => scalar $input->cookie('CGISESSID'), + # token => scalar $input->param('csrf_token'), + # } + #); + $dateexpiry = $patron->renew_account; } else { my $sth = $dbh->prepare("UPDATE borrowers SET debarred = ?, debarredcomment = '' WHERE borrowernumber = ?"); diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl index d32302e5b4..84ed4c334d 100755 --- a/suggestion/suggestion.pl +++ b/suggestion/suggestion.pl @@ -21,7 +21,7 @@ use Modern::Perl; require Exporter; use CGI qw ( -utf8 ); use C4::Auth qw( get_template_and_user ); -use C4::Output qw( output_html_with_http_headers ); +use C4::Output qw( output_html_with_http_headers output_and_exit_if_error ); use C4::Suggestions; use C4::Koha qw( GetAuthorisedValues ); use C4::Budgets qw( GetBudget GetBudgets GetBudgetHierarchy CanUserUseBudget ); -- 2.30.2