From 804b2f709541926a8a2cdbf80af959a9612a1a04 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 21 Mar 2019 14:45:37 -0300 Subject: [PATCH] Bug 22542: Force back button to display personal data This is a follow-up of bug 5371 The following command must not return anything: grep ^output_html_with_http_headers `git grep -l -P "authnotrequired\s*=>\s*0" opac`|grep -v force_no_caching This must be a test somehwere to prevent further regressions. Signed-off-by: Katrin Fischer --- opac/clubs/clubs-tab.pl | 2 +- opac/clubs/enroll.pl | 2 +- opac/opac-account-pay.pl | 2 +- opac/opac-addbybiblionumber.pl | 2 +- opac/opac-alert-subscribe.pl | 2 +- opac/opac-illrequests.pl | 2 +- opac/opac-request-article.pl | 2 +- opac/opac-reserve.pl | 15 +++++---------- opac/opac-sendbasket.pl | 4 ++-- opac/opac-sendshelf.pl | 6 +++--- opac/opac-shareshelf.pl | 3 +-- opac/opac-suggestions.pl | 2 +- opac/svc/auth/googleopenidconnect | 2 +- 13 files changed, 20 insertions(+), 26 deletions(-) diff --git a/opac/clubs/clubs-tab.pl b/opac/clubs/clubs-tab.pl index 82a4be0f54..701d8cfb69 100755 --- a/opac/clubs/clubs-tab.pl +++ b/opac/clubs/clubs-tab.pl @@ -49,4 +49,4 @@ $template->param( borrower => $borrower, ); -output_html_with_http_headers( $cgi, $cookie, $template->output ); +output_html_with_http_headers( $cgi, $cookie, $template->output, undef, { force_no_caching => 1 } ); diff --git a/opac/clubs/enroll.pl b/opac/clubs/enroll.pl index e6d6adc9d7..91b395ed6e 100755 --- a/opac/clubs/enroll.pl +++ b/opac/clubs/enroll.pl @@ -46,4 +46,4 @@ $template->param( borrowernumber => $borrowernumber, ); -output_html_with_http_headers( $cgi, $cookie, $template->output ); +output_html_with_http_headers( $cgi, $cookie, $template->output, undef, { force_no_caching => 1 } ); diff --git a/opac/opac-account-pay.pl b/opac/opac-account-pay.pl index 6c8211d055..a4598bda38 100755 --- a/opac/opac-account-pay.pl +++ b/opac/opac-account-pay.pl @@ -138,7 +138,7 @@ if ( $payment_method eq 'paypal' ) { $error = 1; } - output_html_with_http_headers( $cgi, $cookie, $template->output ) if $error; + output_html_with_http_headers( $cgi, $cookie, $template->output, undef, { force_no_caching => 1 } ) if $error; } else { Koha::Plugins::Handler->run( diff --git a/opac/opac-addbybiblionumber.pl b/opac/opac-addbybiblionumber.pl index ddc6778502..2621ad7265 100755 --- a/opac/opac-addbybiblionumber.pl +++ b/opac/opac-addbybiblionumber.pl @@ -164,4 +164,4 @@ if ($authorized) { ); } $template->param( authorized => $authorized, errcode => $errcode, ); -output_html_with_http_headers $query, $cookie, $template->output; +output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 }; diff --git a/opac/opac-alert-subscribe.pl b/opac/opac-alert-subscribe.pl index 63de7d34d9..098e42fb0e 100755 --- a/opac/opac-alert-subscribe.pl +++ b/opac/opac-alert-subscribe.pl @@ -90,4 +90,4 @@ else { biblionumber => $biblionumber, ); } -output_html_with_http_headers $query, $cookie, $template->output; +output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 }; diff --git a/opac/opac-illrequests.pl b/opac/opac-illrequests.pl index 18453a4260..f35b19ada9 100755 --- a/opac/opac-illrequests.pl +++ b/opac/opac-illrequests.pl @@ -142,4 +142,4 @@ $template->param( method => $op ); -output_html_with_http_headers $query, $cookie, $template->output; +output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 }; diff --git a/opac/opac-request-article.pl b/opac/opac-request-article.pl index b7621dcf3d..e6ea45cdd8 100755 --- a/opac/opac-request-article.pl +++ b/opac/opac-request-article.pl @@ -84,4 +84,4 @@ $template->param( patron => $patron, ); -output_html_with_http_headers $cgi, $cookie, $template->output; +output_html_with_http_headers $cgi, $cookie, $template->output, undef, { force_no_caching => 1 }; diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl index 725b31d07b..eb017b6485 100755 --- a/opac/opac-reserve.pl +++ b/opac/opac-reserve.pl @@ -71,11 +71,6 @@ for ( C4::Context->preference("OPACShowHoldQueueDetails") ) { m/priority/ and $show_priority = 1; } -sub get_out { - output_html_with_http_headers(shift,shift,shift); # $query, $cookie, $template->output; - exit; -} - my $patron = Koha::Patrons->find( $borrowernumber ); my $can_place_hold_if_available_at_pickup = C4::Context->preference('OPACHoldsIfAvailableAtPickup'); @@ -94,7 +89,7 @@ if ( $patron->category->effective_BlockExpiredPatronOpacActions ) { # cannot reserve, their card has expired and the rules set mean this is not allowed $template->param( message => 1, expired_patron => 1 ); - get_out( $query, $cookie, $template->output ); + output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 }; } } @@ -120,7 +115,7 @@ if (! $biblionumbers) { if ((! $biblionumbers) && (! $query->param('place_reserve'))) { $template->param(message=>1, no_biblionumber=>1); - &get_out($query, $cookie, $template->output); + output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 }; } # Pass the numbers to the page so they can be fed back @@ -132,7 +127,7 @@ my @biblionumbers = split /\//, $biblionumbers; if (($#biblionumbers < 0) && (! $query->param('place_reserve'))) { # TODO: New message? $template->param(message=>1, no_biblionumber=>1); - &get_out($query, $cookie, $template->output); + output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 }; } @@ -224,7 +219,7 @@ if ( $query->param('place_reserve') ) { my $selectionCount = @selectedItems; if (($selectionCount == 0) || (($selectionCount % 3) != 0)) { $template->param(message=>1, bad_data=>1); - &get_out($query, $cookie, $template->output); + output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 }; } my $failed_holds = 0; @@ -413,7 +408,7 @@ foreach my $biblioNum (@biblionumbers) { my $biblioData = $biblioDataHash{$biblioNum}; if (! $biblioData) { $template->param(message=>1, bad_biblionumber=>$biblioNum); - &get_out($query, $cookie, $template->output); + output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 }; } my @not_available_at = (); diff --git a/opac/opac-sendbasket.pl b/opac/opac-sendbasket.pl index 91d09a0798..d5e6c7fdfd 100755 --- a/opac/opac-sendbasket.pl +++ b/opac/opac-sendbasket.pl @@ -192,7 +192,7 @@ END_OF_BODY $template->param( error => 1 ); } $template->param( email_add => $email_add ); - output_html_with_http_headers $query, $cookie, $template->output; + output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 }; } else { my $new_session_id = $cookie->value; @@ -204,5 +204,5 @@ else { csrf_token => Koha::Token->new->generate_csrf( { session_id => $new_session_id, } ), ); - output_html_with_http_headers $query, $cookie, $template->output; + output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 }; } diff --git a/opac/opac-sendshelf.pl b/opac/opac-sendshelf.pl index a5b393e5e4..1df7a672fd 100755 --- a/opac/opac-sendshelf.pl +++ b/opac/opac-sendshelf.pl @@ -197,19 +197,19 @@ END_OF_BODY shelfid => $shelfid, email => $email, ); - output_html_with_http_headers $query, $cookie, $template->output; + output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 }; }else{ $template->param( shelfid => $shelfid, url => "/cgi-bin/koha/opac-sendshelf.pl", ); - output_html_with_http_headers $query, $cookie, $template->output; + output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 }; } } else { $template->param( invalidlist => 1, url => "/cgi-bin/koha/opac-sendshelf.pl", ); - output_html_with_http_headers $query, $cookie, $template->output; + output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 }; } diff --git a/opac/opac-shareshelf.pl b/opac/opac-shareshelf.pl index 8e79792e43..34a17788ed 100755 --- a/opac/opac-shareshelf.pl +++ b/opac/opac-shareshelf.pl @@ -54,8 +54,7 @@ if ( !$pvar->{errcode} ) { show_accept($pvar) if $pvar->{op} eq 'accept'; } load_template_vars($pvar); -output_html_with_http_headers $pvar->{query}, $pvar->{cookie}, - $pvar->{template}->output; +output_html_with_http_headers $pvar->{query}, $pvar->{cookie}, $pvar->{template}->output, undef, { force_no_caching => 1 }; #------------------------------------------------------------------------------- diff --git a/opac/opac-suggestions.pl b/opac/opac-suggestions.pl index cf562fb97e..29de7a1f65 100755 --- a/opac/opac-suggestions.pl +++ b/opac/opac-suggestions.pl @@ -228,5 +228,5 @@ $template->param( patrons_pending_suggestions_count => $patrons_pending_suggestions_count, ); -output_html_with_http_headers $input, $cookie, $template->output; +output_html_with_http_headers $input, $cookie, $template->output, undef, { force_no_caching => 1 }; diff --git a/opac/svc/auth/googleopenidconnect b/opac/svc/auth/googleopenidconnect index 2804005f8e..2cb4c9ec8d 100755 --- a/opac/svc/auth/googleopenidconnect +++ b/opac/svc/auth/googleopenidconnect @@ -86,7 +86,7 @@ sub loginfailed { ); $template->param( 'invalidGoogleOpenIDConnectLogin' => $reason ); $template->param( 'loginprompt' => 1 ); - output_html_with_http_headers $cgi_query, $cookie, $template->output; + output_html_with_http_headers $cgi_query, $cookie, $template->output, undef, { force_no_caching => 1 }; return; } -- 2.11.0