Bugzilla – Attachment 162144 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.60 KB, created by
Jonathan Druart
on 2024-02-14 11:27:41 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 11:27:41 UTC
Size:
2.60 KB
patch
obsolete
>From 051ba3370342873037e57f611402cf669743e9aa 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 f779a9e94df..d5bad41daf5 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -291,12 +291,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 ); >@@ -312,12 +312,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( >@@ -406,8 +400,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( >@@ -631,6 +623,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 ); >+ > return ( $template, $borrowernumber, $cookie, $flags ); > } > >-- >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