Bugzilla – Attachment 181093 Details for
Bug 36197
Allow unauthenticated ILL requests in the OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36197: (QA follow-up): Move unauth_request_data_check to core
Bug-36197-QA-follow-up-Move-unauthrequestdatacheck.patch (text/plain), 2.89 KB, created by
Tomás Cohen Arazi (tcohen)
on 2025-04-17 13:40:44 UTC
(
hide
)
Description:
Bug 36197: (QA follow-up): Move unauth_request_data_check to core
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2025-04-17 13:40:44 UTC
Size:
2.89 KB
patch
obsolete
>From 6cee1e5d357beee51cfadabedbeb27caac782d77 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Fri, 17 Jan 2025 13:10:56 +0000 >Subject: [PATCH] Bug 36197: (QA follow-up): Move unauth_request_data_check to > core > >Move this out of Standard specific logic. > Other backends that support unauthenticated requests may want to make use of this and not duplicate code. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/ILL/Backend/Standard.pm | 22 ++-------------------- > Koha/ILL/Request.pm | 19 +++++++++++++++++++ > 2 files changed, 21 insertions(+), 20 deletions(-) > >diff --git a/Koha/ILL/Backend/Standard.pm b/Koha/ILL/Backend/Standard.pm >index af13dcaa8be..3db432f5c2c 100644 >--- a/Koha/ILL/Backend/Standard.pm >+++ b/Koha/ILL/Backend/Standard.pm >@@ -24,6 +24,7 @@ use C4::Installer; > > use Koha::DateUtils qw/ dt_from_string /; > use Koha::I18N qw(__); >+use Koha::ILL::Request; > use Koha::ILL::Requests; > use Koha::ILL::Request::Attribute; > use C4::Biblio qw( AddBiblio ); >@@ -292,7 +293,7 @@ sub create { > C4::Context->preference("ILLOpacUnauthenticatedRequest") && !$other->{'cardnumber'}; > if ($unauthenticated_request) { > ( $failed, $result ) = _validate_form_params( $other, $result, $params ); >- if ( !_unauth_request_data_check($other) ) { >+ if ( !Koha::ILL::Request::unauth_request_data_check($other) ) { > $result->{status} = "missing_unauth_data"; > $result->{value} = $params; > $failed = 1; >@@ -1228,25 +1229,6 @@ sub _set_suppression { > return 1; > } > >-=head3 _unauth_request_data_check >- >- _unauth_request_data_check($other); >- >-Checks if unauthenticated request data is present >- >-=cut >- >-sub _unauth_request_data_check { >- my ($other) = @_; >- >- return 1 unless C4::Context->preference("ILLOpacUnauthenticatedRequest"); >- >- return >- $other->{unauthenticated_first_name} >- && $other->{unauthenticated_last_name} >- && $other->{unauthenticated_email}; >-} >- > =head3 _validate_form_params > > _validate_form_params( $other, $result, $params ); >diff --git a/Koha/ILL/Request.pm b/Koha/ILL/Request.pm >index f659d697bb2..ddc5438a55e 100644 >--- a/Koha/ILL/Request.pm >+++ b/Koha/ILL/Request.pm >@@ -1959,6 +1959,25 @@ sub append_unauthenticated_notes { > $self->notesopac($unauthenticated_notes_text)->store; > } > >+=head3 unauth_request_data_check >+ >+ unauth_request_data_check($metadata); >+ >+Checks if unauthenticated request data is present >+ >+=cut >+ >+sub unauth_request_data_check { >+ my ($metadata) = @_; >+ >+ return 1 unless C4::Context->preference("ILLOpacUnauthenticatedRequest"); >+ >+ return >+ $metadata->{unauthenticated_first_name} >+ && $metadata->{unauthenticated_last_name} >+ && $metadata->{unauthenticated_email}; >+} >+ > =head3 append_to_note > > append_to_note("Some text"); >-- >2.49.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 36197
:
171358
|
171359
|
171360
|
171361
|
171362
|
171363
|
171364
|
171365
|
171366
|
171367
|
171368
|
171369
|
171370
|
171371
|
174495
|
174496
|
174497
|
174498
|
174499
|
174500
|
174501
|
174502
|
174503
|
174504
|
174505
|
174506
|
174507
|
174508
|
176564
|
176565
|
176680
|
176723
|
176724
|
176726
|
176727
|
179764
|
179765
|
179766
|
179767
|
179769
|
179770
|
179771
|
179772
|
179773
|
179774
|
179775
|
179776
|
179777
|
179778
|
179779
|
179780
|
179781
|
179782
|
179783
|
179784
|
179785
|
180850
|
180851
|
180852
|
180853
|
180854
|
180855
|
180856
|
180857
|
180858
|
180859
|
180860
|
180861
|
180862
|
180863
|
180864
|
180865
|
180866
|
180867
|
180868
|
180869
|
180870
|
180871
|
180872
|
180873
|
181073
|
181074
|
181075
|
181076
|
181077
|
181078
|
181079
|
181080
|
181081
|
181082
|
181083
|
181084
|
181085
|
181086
|
181087
|
181088
|
181089
|
181090
|
181091
|
181092
| 181093 |
181094
|
181095
|
181096
|
181097
|
181098
|
181592