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 <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>
This commit is contained in:
Jonathan Druart 2019-03-21 14:45:37 -03:00 committed by Lucas Gass
parent a2a9596c22
commit 63691c6f24
13 changed files with 20 additions and 26 deletions

View File

@ -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 } );

View File

@ -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 } );

View File

@ -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(

View File

@ -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 };

View File

@ -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 };

View File

@ -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 };

View File

@ -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 };

View File

@ -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} );

View File

@ -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 };
}

View File

@ -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 };
}

View File

@ -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 };
#-------------------------------------------------------------------------------

View File

@ -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 };

View File

@ -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;
}