Bugzilla – Attachment 162141 Details for
Bug 36092
sessionID not passed to the template on auth.tt
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36092: Pass sessionID at the end of get_template_and_user
Bug-36092-Pass-sessionID-at-the-end-of-gettemplate.patch (text/plain), 2.77 KB, created by
Jonathan Druart
on 2024-02-14 10:48:13 UTC
(
hide
)
Description:
Bug 36092: Pass sessionID at the end of get_template_and_user
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-02-14 10:48:13 UTC
Size:
2.77 KB
patch
obsolete
>From 0839778db5623e9f8131f9da17ca951605783f59 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 14 Feb 2024 09:45:45 +0100 >Subject: [PATCH] Bug 36092: Pass sessionID at the end of get_template_and_user > >It seems safer to pass the logged in user and session info at the end of >the sub. >--- > C4/Auth.pm | 16 +++++++--------- > 1 file changed, 7 insertions(+), 9 deletions(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index 57fd8cfba4a..cc5a7a3ac65 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -295,12 +295,12 @@ sub get_template_and_user { > } > > my $borrowernumber; >+ my $patron; > if ($user) { > > # It's possible for $user to be the borrowernumber if they don't have a > # userid defined (and are logging in through some other method, such > # as SSL certs against an email address) >- my $patron; > $borrowernumber = getborrowernumber($user) if defined($user); > if ( !defined($borrowernumber) && defined($user) ) { > $patron = Koha::Patrons->find( $user ); >@@ -316,12 +316,6 @@ sub get_template_and_user { > # FIXME What to do if $patron does not exist? > } > >- # user info >- $template->param( loggedinusername => $user ); # OBSOLETE - Do not reuse this in template, use logged_in_user.userid instead >- $template->param( loggedinusernumber => $borrowernumber ); # FIXME Should be replaced with logged_in_user.borrowernumber >- $template->param( logged_in_user => $patron ); >- $template->param( sessionID => $sessionID ); >- > if ( $in->{'type'} eq 'opac' ) { > require Koha::Virtualshelves; > my $some_private_shelves = Koha::Virtualshelves->get_some_shelves( >@@ -410,8 +404,6 @@ sub get_template_and_user { > } > } > >- $template->param( sessionID => $sessionID ); >- > if ( $in->{'type'} eq 'opac' ){ > require Koha::Virtualshelves; > my $some_public_shelves = Koha::Virtualshelves->get_some_shelves( >@@ -643,6 +635,12 @@ sub get_template_and_user { > $cookie = $cookie_mgr->replace_in_list( $cookie, $languagecookie ); > } > >+ # user info >+ $template->param( loggedinusername => $user ); # OBSOLETE - Do not reuse this in template, use logged_in_user.userid instead >+ $template->param( loggedinusernumber => $borrowernumber ); # FIXME Should be replaced with logged_in_user.borrowernumber >+ $template->param( logged_in_user => $patron ); >+ $template->param( sessionID => $sessionID ); >+ > if ( $in->{query}->param('invalid_csrf_token') ) { > Koha::Logger->get->debug("The form submission failed (Wrong CSRF token)."); > C4::Output::output_and_exit( $in->{query}, $cookie, $template, 'wrong_csrf_token' ); >-- >2.34.1
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 36092
:
162139
|
162140
|
162141
|
162142
|
162143
|
162144
|
162158
|
162160
|
162161
|
162189
|
162190
|
162191