From 307476470e8f100b71f6c2d9b3d79fff90a51d61 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Tue, 5 Mar 2024 17:09:03 +0000 Subject: [PATCH] Bug 36197: Make authentication not required if conditions are met /cgi-bin/koha/opac-illrequests.pl was an authrequired page Now, its authnotrequired if creating or viewing an unauthenticated request Signed-off-by: David Nind --- opac/opac-illrequests.pl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/opac/opac-illrequests.pl b/opac/opac-illrequests.pl index a7c079a544..3a22104301 100755 --- a/opac/opac-illrequests.pl +++ b/opac/opac-illrequests.pl @@ -50,10 +50,17 @@ if ( ! C4::Context->preference('ILLModule') ) { exit; } +my $op = Koha::ILL::Request->get_op_param_deprecation( 'opac', $params ); + my ( $template, $loggedinuser, $cookie ) = get_template_and_user({ template_name => "opac-illrequests.tt", query => $query, type => "opac", + authnotrequired => ( + ( C4::Context->preference("ILLOpacUnauthenticatedRequest") && ( $op eq 'cud-create' || $op eq 'unauth_view' ) ) + ? 1 + : 0 + ) }); # Are we able to actually work? @@ -62,8 +69,6 @@ my $backends = Koha::ILL::Backends->opac_available_backends($patron); my $backends_available = ( scalar @{$backends} > 0 ); $template->param( backends_available => $backends_available ); -my $op = Koha::ILL::Request->get_op_param_deprecation( 'opac', $params ); - my ( $illrequest_id, $request ); if ( $illrequest_id = $params->{illrequest_id} ) { $request = Koha::ILL::Requests->find($illrequest_id); -- 2.39.2