Bugzilla – Attachment 134853 Details for
Bug 22990
Add CSRF protection to boraccount, pay, suggestions and virtualshelves on staff
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22990: Follow-up to fix merge mistakes
Bug-22990-Follow-up-to-fix-merge-mistakes.patch (text/plain), 3.47 KB, created by
David Cook
on 2022-05-11 07:12:37 UTC
(
hide
)
Description:
Bug 22990: Follow-up to fix merge mistakes
Filename:
MIME Type:
Creator:
David Cook
Created:
2022-05-11 07:12:37 UTC
Size:
3.47 KB
patch
obsolete
>From 649740f318e00c589bb088cc3604a286079ce740 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Wed, 20 Apr 2022 01:53:26 +0000 >Subject: [PATCH] Bug 22990: Follow-up to fix merge mistakes > >--- > acqui/basketheader.pl | 2 +- > circ/add_message.pl | 2 +- > members/pay.pl | 1 + > members/setstatus.pl | 10 +++++++++- > suggestion/suggestion.pl | 2 +- > 5 files changed, 13 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..6809030aaf 100755 >--- a/members/setstatus.pl >+++ b/members/setstatus.pl >@@ -53,7 +53,15 @@ 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' }); >+ 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 b9ab8773f4..03a137eba5 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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 22990
:
90102
|
90192
|
90194
|
90202
|
90204
|
90209
|
90238
|
90239
|
90240
|
95381
|
95382
|
95383
|
95384
|
95385
|
95391
|
95392
|
95393
|
95394
|
95395
|
95396
|
97814
|
122010
|
122011
|
122012
|
122013
|
122014
|
122015
|
122016
|
122023
|
122024
|
122025
|
122026
|
122027
|
122028
|
122029
|
122030
|
122031
|
122046
|
124924
|
124925
|
124926
|
124927
|
124928
|
124929
|
124930
|
124931
|
124932
|
124933
|
124934
|
126091
|
126092
|
126093
|
126094
|
126095
|
126096
|
126097
|
126098
|
126099
|
126100
|
126101
|
133238
|
133239
|
133240
|
133241
|
133242
|
133243
|
133244
|
133245
|
133246
|
133247
|
133248
|
133254
|
133255
|
133256
|
133257
|
133258
|
133422
|
133423
|
133424
|
133425
|
133426
|
133427
|
134848
|
134849
|
134850
|
134851
|
134852
|
134853
|
134854
|
141294
|
141295
|
141296
|
144315
|
144316
|
144317
|
144318
|
144319
|
144320
|
144321
|
144322
|
152626
|
152627
|
152628
|
153394
|
153751
|
153753
|
154044