Bugzilla – Attachment 87545 Details for
Bug 18205
Use Koha::Logger/Log4Perl using Mojolicious app log method
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[UGLY FIX] Bug 18205: Set userenv in Koha::REST::V1::Auth::authenticate_api_request
UGLY-FIX-Bug-18205-Set-userenv-in-KohaRESTV1Authau.patch (text/plain), 1.31 KB, created by
Tomás Cohen Arazi (tcohen)
on 2019-04-08 19:03:12 UTC
(
hide
)
Description:
[UGLY FIX] Bug 18205: Set userenv in Koha::REST::V1::Auth::authenticate_api_request
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2019-04-08 19:03:12 UTC
Size:
1.31 KB
patch
obsolete
>From 9a1f4917e99262a7fab7209b1d2c7b9fc3ff222b Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 8 Apr 2019 15:56:44 -0300 >Subject: [PATCH] [UGLY FIX] Bug 18205: Set userenv in > Koha::REST::V1::Auth::authenticate_api_request > >Koha code (like C4::Log::logaction) relies on C4::Context::userenv to be >set. This could be fixed in many ways. The easiest way is to set that >environmental variables after authorization happens. > >I don't think this is a good design, but I'm not sure adding a new param >to logaction is the best option. > >I'd rather make the action_logs table another target for Log4Perl at >some point. But I strongly disagree on making tiny enhancements be >required to refactor all the things :-D > >I drop this code here for others to weight in. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/REST/V1/Auth.pm | 2 ++ > 1 file changed, 2 insertions(+) > >diff --git a/Koha/REST/V1/Auth.pm b/Koha/REST/V1/Auth.pm >index 53c6bacfc9..58d8f54e25 100644 >--- a/Koha/REST/V1/Auth.pm >+++ b/Koha/REST/V1/Auth.pm >@@ -219,6 +219,8 @@ sub authenticate_api_request { > } > > $c->stash('koha.user' => $user); >+ C4::Context->_new_userenv( 1 ); >+ C4::Context->set_userenv( $user->borrowernumber, $user->userid ); > > # We do not need any authorization > unless ($authorization) { >-- >2.21.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 18205
:
60848
|
60849
|
60850
|
69226
|
69227
|
69228
|
69232
|
85711
|
85712
|
85713
|
85714
|
87537
|
87538
|
87539
|
87540
|
87541
|
87542
| 87545 |
139811