@@ -, +, @@ --- Koha/REST/V1/OAuth/Client.pm | 4 ---- authorities/authorities-home.pl | 5 ----- authorities/detail.pl | 1 - basket/sendbasket.pl | 3 --- circ/circulation.pl | 5 ----- ill/ill-requests.pl | 3 --- members/apikeys.pl | 1 - members/boraccount.pl | 5 ----- members/deletemem.pl | 1 - members/mancredit.pl | 3 --- members/maninvoice.pl | 3 --- members/member-flags.pl | 2 -- members/member-password.pl | 1 - members/memberentry.pl | 5 ----- members/moremember.pl | 5 ----- members/paycollect.pl | 2 -- members/two_factor_auth.pl | 3 --- opac/opac-memberentry.pl | 9 --------- opac/opac-messaging.pl | 5 ----- opac/opac-sendbasket.pl | 2 -- opac/opac-user.pl | 3 --- opac/sco/sco-main.pl | 1 - tools/import_borrowers.pl | 7 ------- tools/picture-upload.pl | 5 ----- 24 files changed, 84 deletions(-) --- a/Koha/REST/V1/OAuth/Client.pm +++ a/Koha/REST/V1/OAuth/Client.pm @@ -97,10 +97,6 @@ sub login { return $c->redirect_to( $uri . "?auth_error=$error" ); } } - else { - # initial request, generate CSRF token - $state = Koha::Token->new->generate_csrf( { session_id => $c->req->cookie('CGISESSID')->value } ); - } return $c->oauth2->get_token_p( $provider => { ( !$is_callback ? ( state => $state ) : () ), redirect_uri => $redirect_url . $provider . "/" . $interface } )->then( sub { --- a/authorities/authorities-home.pl +++ a/authorities/authorities-home.pl @@ -113,11 +113,6 @@ if ( $op eq "do_search" ) { } $template->param( search_query => $search_query ) if C4::Context->preference('DumpSearchQueryTemplate'); - $template->param( - csrf_token => Koha::Token->new->generate_csrf({ - session_id => scalar $query->cookie('CGISESSID'), - }), - ); # search history if (C4::Context->preference('EnableSearchHistory')) { --- a/authorities/detail.pl +++ a/authorities/detail.pl @@ -230,7 +230,6 @@ $template->param( authtypetext => $type ? $type->authtypetext: "", authtypecode => $authtypecode, authority_types => $authority_types, - csrf_token => Koha::Token->new->generate_csrf({ session_id => scalar $query->cookie('CGISESSID') }), servers => $servers, ); --- a/basket/sendbasket.pl +++ a/basket/sendbasket.pl @@ -124,9 +124,6 @@ else { url => "/cgi-bin/koha/basket/sendbasket.pl", suggestion => C4::Context->preference("suggestion"), virtualshelves => C4::Context->preference("virtualshelves"), - csrf_token => Koha::Token->new->generate_csrf( - { session_id => scalar $query->cookie('CGISESSID'), } - ), ); output_html_with_http_headers $query, $cookie, $template->output; } --- a/circ/circulation.pl +++ a/circ/circulation.pl @@ -634,9 +634,4 @@ $template->param( logged_in_user => $logged_in_user, ); -# Generate CSRF token for upload and delete image buttons -$template->param( - csrf_token => Koha::Token->new->generate_csrf({ session_id => $query->cookie('CGISESSID'),}), -); - output_html_with_http_headers $query, $cookie, $template->output; --- a/ill/ill-requests.pl +++ a/ill/ill-requests.pl @@ -89,9 +89,6 @@ if ( $backends_available ) { $template->param( notices => $notices, request => $request, - csrf_token => Koha::Token->new->generate_csrf({ - session_id => scalar $cgi->cookie('CGISESSID'), - }), ( $params->{tran_error} ? ( tran_error => $params->{tran_error} ) : () ), ( $params->{tran_success} ? --- a/members/apikeys.pl +++ a/members/apikeys.pl @@ -123,7 +123,6 @@ if ($op) { $template->param( api_keys => Koha::ApiKeys->search({ patron_id => $patron_id }), - csrf_token => Koha::Token->new->generate_csrf({ session_id => scalar $cgi->cookie('CGISESSID') }), patron => $patron ); --- a/members/boraccount.pl +++ a/members/boraccount.pl @@ -244,10 +244,6 @@ foreach my $renew_result(@renew_results) { }; } -my $csrf_token = Koha::Token->new->generate_csrf({ - session_id => scalar $input->cookie('CGISESSID'), -}); - $template->param( patron => $patron, finesview => 1, @@ -258,7 +254,6 @@ $template->param( change_given => $change_given, renew_results => $renew_results_display, receipt_sent => $receipt_sent, - csrf_token => $csrf_token, ); output_html_with_http_headers $input, $cookie, $template->output; --- a/members/deletemem.pl +++ a/members/deletemem.pl @@ -114,7 +114,6 @@ $template->param( if ( $op eq 'delete_confirm' or $countissues > 0 or $debits or $is_guarantor ) { $template->param( op => 'delete_confirm', - csrf_token => Koha::Token->new->generate_csrf({ session_id => scalar $input->cookie('CGISESSID') }), ); } elsif ( $op eq 'delete_confirmed' ) { --- a/members/mancredit.pl +++ a/members/mancredit.pl @@ -141,9 +141,6 @@ else { patron => $patron, credit_types => \@credit_types, finesview => 1, - csrf_token => Koha::Token->new->generate_csrf( - { session_id => scalar $input->cookie('CGISESSID') } - ), available_additional_fields => [ Koha::AdditionalFields->search({ tablename => 'accountlines:credit' })->as_list ], ); output_html_with_http_headers $input, $cookie, $template->output; --- a/members/maninvoice.pl +++ a/members/maninvoice.pl @@ -227,9 +227,6 @@ my $debit_types = Koha::Account::DebitTypes->search_with_library_limits( $template->param( debit_types => $debit_types, - csrf_token => Koha::Token->new->generate_csrf( - { session_id => scalar $input->cookie('CGISESSID') } - ), patron => $patron, finesview => 1, available_additional_fields => [ Koha::AdditionalFields->search({ tablename => 'accountlines:debit' })->as_list ], --- a/members/member-flags.pl +++ a/members/member-flags.pl @@ -181,8 +181,6 @@ if ($input->param('newflags')) { $template->param( patron => $patron, loop => \@loop, - csrf_token => - Koha::Token->new->generate_csrf( { session_id => scalar $input->cookie('CGISESSID'), } ), disable_superlibrarian_privs => C4::Context->preference('ProtectSuperlibrarianPrivileges') ? !C4::Context->IsSuperLibrarian : 0, ); --- a/members/member-password.pl +++ a/members/member-password.pl @@ -97,7 +97,6 @@ if ( $newpassword and not @errors) { $template->param( patron => $patron, destination => $destination, - csrf_token => Koha::Token->new->generate_csrf({ session_id => scalar $input->cookie('CGISESSID'), }), ); if ( scalar(@errors) ) { --- a/members/memberentry.pl +++ a/members/memberentry.pl @@ -772,11 +772,6 @@ $template->param( CanUpdatePasswordExpiration => $CanUpdatePasswordExpiration, ); -# Generate CSRF token -$template->param( csrf_token => - Koha::Token->new->generate_csrf( { session_id => scalar $input->cookie('CGISESSID'), } ), -); - # HouseboundModule data $template->param( housebound_role => Koha::Patron::HouseboundRoles->find($borrowernumber), --- a/members/moremember.pl +++ a/members/moremember.pl @@ -128,11 +128,6 @@ if ( !$patron->is_valid_age ) { $template->param( age_high => $patron->category->upperagelimit ); } -# Generate CSRF token for upload and delete image buttons -$template->param( - csrf_token => Koha::Token->new->generate_csrf({ session_id => $input->cookie('CGISESSID'),}), -); - if (C4::Context->preference('ExtendedPatronAttributes')) { my @attributes = $patron->extended_attributes->as_list; # FIXME Must be improved! my @classes = uniq( map {$_->type->class} @attributes ); --- a/members/paycollect.pl +++ a/members/paycollect.pl @@ -282,8 +282,6 @@ $template->param( borrowernumber => $borrowernumber, # some templates require global patron => $patron, total => $total_due, - - csrf_token => Koha::Token->new->generate_csrf( { session_id => scalar $input->cookie('CGISESSID') } ), available_additional_fields => [ Koha::AdditionalFields->search({ tablename => 'accountlines:credit' })->as_list ], ); --- a/members/two_factor_auth.pl +++ a/members/two_factor_auth.pl @@ -84,9 +84,6 @@ else { } $template->param( - csrf_token => Koha::Token->new->generate_csrf( - { session_id => scalar $cgi->cookie('CGISESSID') } - ), patron => $logged_in_user, op => $op, ); --- a/opac/opac-memberentry.pl +++ a/opac/opac-memberentry.pl @@ -331,9 +331,6 @@ elsif ( $action eq 'update' ) { empty_mandatory_fields => \@empty_mandatory_fields, invalid_form_fields => $invalidformfields, borrower => \%borrower, - csrf_token => Koha::Token->new->generate_csrf({ - session_id => scalar $cgi->cookie('CGISESSID'), - }), ); $template->param( patron_attribute_classes => GeneratePatronAttributesForm( $borrowernumber, $attributes ) ); @@ -379,9 +376,6 @@ elsif ( $action eq 'update' ) { nochanges => 1, borrower => $patron->unblessed, patron_attribute_classes => GeneratePatronAttributesForm( $borrowernumber, $attributes ), - csrf_token => Koha::Token->new->generate_csrf({ - session_id => scalar $cgi->cookie('CGISESSID'), - }), ); } } @@ -393,9 +387,6 @@ elsif ( $action eq 'edit' ) { #Display logged in borrower's data $template->param( borrower => $borrower, hidden => GetHiddenFields( $mandatory, 'edit' ), - csrf_token => Koha::Token->new->generate_csrf({ - session_id => scalar $cgi->cookie('CGISESSID'), - }), ); if (C4::Context->preference('OPACpatronimages')) { --- a/opac/opac-messaging.pl +++ a/opac/opac-messaging.pl @@ -92,11 +92,6 @@ if( $opac_messaging && C4::Context->preference("SMSSendDriver") eq 'Email' ) { } my $new_session_id = $query->cookie('CGISESSID'); -$template->param( - csrf_token => Koha::Token->new->generate_csrf({ - session_id => $new_session_id, - }), -); if ( C4::Context->preference('TranslateNotices') ) { my $translated_languages = C4::Languages::getTranslatedLanguages( 'opac', C4::Context->preference('template') ); --- a/opac/opac-sendbasket.pl +++ a/opac/opac-sendbasket.pl @@ -126,8 +126,6 @@ else { url => "/cgi-bin/koha/opac-sendbasket.pl", suggestion => C4::Context->preference("suggestion"), virtualshelves => C4::Context->preference("virtualshelves"), - csrf_token => - Koha::Token->new->generate_csrf( { session_id => $new_session_id, } ), ); output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 }; --- a/opac/opac-user.pl +++ a/opac/opac-user.pl @@ -181,9 +181,6 @@ $template->param( surname => $borr->{surname}, RENEW_ERROR => $renew_error, borrower => $borr, - csrf_token => Koha::Token->new->generate_csrf({ - session_id => scalar $query->cookie('CGISESSID'), - }), ); #get issued items .... --- a/opac/sco/sco-main.pl +++ a/opac/sco/sco-main.pl @@ -363,7 +363,6 @@ if ( $patron) { my $patron_image = $patron->image; $template->param( display_patron_image => 1, - csrf_token => Koha::Token->new->generate_csrf( { session_id => scalar $query->cookie('CGISESSID') . $patron->cardnumber, id => $patron->userid } ), ) if $patron_image; } } else { --- a/tools/import_borrowers.pl +++ a/tools/import_borrowers.pl @@ -176,13 +176,6 @@ else { } $template->param( matchpoints => \@matchpoints ); } - - $template->param( - csrf_token => Koha::Token->new->generate_csrf( - { session_id => scalar $input->cookie('CGISESSID'), } - ), - ); - } output_html_with_http_headers $input, $cookie, $template->output; --- a/tools/picture-upload.pl +++ a/tools/picture-upload.pl @@ -209,11 +209,6 @@ if ( $borrowernumber && !%errors && !$template->param('ERRORS') ) { "/cgi-bin/koha/members/moremember.pl?borrowernumber=$borrowernumber"); } else { - $template->param( - csrf_token => Koha::Token->new->generate_csrf({ - session_id => scalar $input->cookie('CGISESSID'), - }), - ); output_html_with_http_headers $input, $cookie, $template->output; } --