Bug 22542: Force back button to display personal data
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 21 Mar 2019 17:45:37 +0000 (14:45 -0300)
committerLucas Gass <lucas@bywatersolutions.com>
Mon, 29 Apr 2019 01:05:37 +0000 (01:05 +0000)
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 <katrin.fischer.83@web.de>
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 20d3d6788ec814e721d97f348be3749fffe662b6)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>

13 files changed:
opac/clubs/clubs-tab.pl
opac/clubs/enroll.pl
opac/opac-account-pay.pl
opac/opac-addbybiblionumber.pl
opac/opac-alert-subscribe.pl
opac/opac-illrequests.pl
opac/opac-request-article.pl
opac/opac-reserve.pl
opac/opac-sendbasket.pl
opac/opac-sendshelf.pl
opac/opac-shareshelf.pl
opac/opac-suggestions.pl
opac/svc/auth/googleopenidconnect

index 82a4be0..701d8cf 100755 (executable)
@@ -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 } );
index e6d6adc..91b395e 100755 (executable)
@@ -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 } );
index 6c8211d..a4598bd 100755 (executable)
@@ -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(
index ddc6778..2621ad7 100755 (executable)
@@ -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 };
index 63de7d3..098e42f 100755 (executable)
@@ -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 };
index 1fa1ce3..6b0e3ba 100755 (executable)
@@ -141,4 +141,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 };
index b7621dc..e6ea45c 100755 (executable)
@@ -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 };
index 1c6cbba..0948d0e 100755 (executable)
@@ -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 };
 }
 
 
@@ -228,7 +223,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;
@@ -416,7 +411,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 $frameworkcode = GetFrameworkCode( $biblioData->{biblionumber} );
index bb8ec05..dcb263b 100755 (executable)
@@ -189,7 +189,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;
@@ -201,5 +201,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 };
 }
index 1a88671..b0f037c 100755 (executable)
@@ -192,19 +192,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 };
 }
index 8e79792..34a1778 100755 (executable)
@@ -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 };
 
 #-------------------------------------------------------------------------------
 
index cf562fb..29de7a1 100755 (executable)
@@ -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 };
 
index e3d7df4..623c193 100755 (executable)
@@ -87,7 +87,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;
 }