Bugzilla – Attachment 77271 Details for
Bug 21096
Garbled username on intranet login page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21096: Do not display loggedinusername in template
Bug-21096-Do-not-display-loggedinusername-in-templ.patch (text/plain), 7.84 KB, created by
Owen Leonard
on 2018-07-25 16:19:12 UTC
(
hide
)
Description:
Bug 21096: Do not display loggedinusername in template
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2018-07-25 16:19:12 UTC
Size:
7.84 KB
patch
obsolete
>From 10bd83fb8cd01c2a5f60bcb76d1aa80eefbb6c5b Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 25 Jul 2018 12:25:58 -0300 >Subject: [PATCH] Bug 21096: Do not display loggedinusername in template >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This patch is a little fix for a much bigger hidden issues. > >The original issue: >1. Set the firstname and surname values of a paontr to utf-8 characters >("wide characters"), for instance ææ >2. Use this patron to login at the staff interface >=> In the header the logged in patron's info (concat of firstname and >surname) are displayed correctly >3. Hit whatever link >=> In the header the info are now displayed incorrectly >("ææ") > >What happens? >After that the user loggin, loggedinusername is set with the value from >the DB (borrowers.userid) >On next hits it is picked from the session (which contains the decoded >utf8 value, see first lines of C4::Context->set_userenv) >From C4::Auth::checkauth: >834 $s_userid = $session->param('id') // '' > >The quick fix is to use the logged_in_user variable in the template, but >it seems that issues may occurred if external authentication is used >(ldap, shib, cas). Could someone test this? > >Test plan: >Make sure the original issue is fixed > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > C4/Auth.pm | 2 +- > koha-tmpl/intranet-tmpl/prog/en/includes/header.inc | 4 ++-- > koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt | 2 +- > koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt | 2 +- > koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/add-modify.tt | 2 +- > koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt | 2 +- > koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt | 4 ++-- > 7 files changed, 9 insertions(+), 9 deletions(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index e27b1b3..5827204 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -261,7 +261,7 @@ sub get_template_and_user { > } > > # user info >- $template->param( loggedinusername => $user ); # FIXME Should be replaced with something like patron-title.inc >+ $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 ); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc >index 3c112ee..93a1514 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc >@@ -58,7 +58,7 @@ > <i class="fa fa-user"></i> > </span> > <span id="logged-in-info-full"> >- <span class="loggedinusername">[% loggedinusername %]</span> >+ <span class="loggedinusername">[% logged_in_user.userid %]</span> > <span class="separator">|</span> > [% IF ( AutoLocation ) %] > <brand> >@@ -81,7 +81,7 @@ > > <li class="loggedin-menu-label"> > Logged in as:<br /> >- <span class="loggedinusername">[% loggedinusername %]</span> >+ <span class="loggedinusername">[% logged_in_user.userid %]</span> > </li> > <li class="loggedin-menu-label"> > [% IF ( AutoLocation ) %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt >index 37a35af..9e3949e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt >@@ -87,7 +87,7 @@ > > [% UNLESS no_orders_to_display %] > <div id="acqui_receive_summary"> >-<p><strong>Invoice number:</strong> [% invoice |html %] <strong>Received by:</strong> [% loggedinusername %] <strong>On:</strong> [% datereceived | $KohaDates %]</p> >+<p><strong>Invoice number:</strong> [% invoice |html %] <strong>Received by:</strong> [% logged_in_user.userid %]<strong>On:</strong> [% datereceived | $KohaDates %]</p> > </div> > [% UNLESS (invoiceclosedate) %] > <div id="acqui_receive_search"> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt >index fd701ca..8a31899 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt >@@ -308,7 +308,7 @@ > } > > function synchronize() { >- kohadb.saveSetting("userid", "[% loggedinusername %]"); >+ kohadb.saveSetting("userid", "[% logged_in_user.userid %]"); > kohadb.saveSetting("branchcode", "[% LoginBranchcode %]"); > showSyncInfo(); > [% UNLESS (AllowOfflineCirculation) %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/add-modify.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/add-modify.tt >index 23ee885..5dbc08a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/add-modify.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/add-modify.tt >@@ -61,7 +61,7 @@ > </li> > > <li> >- <span class="label">Owner: </span>[% loggedinusername %] >+ <span class="label">Owner: </span>[% logged_in_user.userid %] > </li> > </ol> > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt >index 8f95b49..7e8f777 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt >@@ -30,7 +30,7 @@ fieldset.rows li.radio { width: 100%; } /* override staff-global.css */ > [% ELSE %] > <input type="hidden" name="op" value="addsubscription" /> > [% END %] >- <input type="hidden" name="user" value="[% loggedinusername %]" /> >+ <input type="hidden" name="user" value="[% logged_in_user.userid %]" /> > <input type="hidden" name="irreg_check" value="0" /> > > <div id="page_1"> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >index 35a70ff..15442ff 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >@@ -274,12 +274,12 @@ > <li> > <span class="label">Owner: </span> > [% IF op == 'add_form' %] >- <input type="hidden" name="owner" id="owner" value="[% loggedinusernumber %]" />[% loggedinusername %]</li> >+ <input type="hidden" name="owner" id="owner" value="[% loggedinusernumber %]" />[% logged_in_user.userid %] > [% ELSE %] > [% IF owner %] > <input type="hidden" id="owner" name="owner" value="[% owner.borrowernumber %]" />[% owner.firstname _ ' ' _ owner.surname %] > [% ELSE %] >- <input type="hidden" id="owner" name="owner" value="[% loggedinusernumber %]" />[% loggedinusername %] >+ <input type="hidden" id="owner" name="owner" value="[% loggedinusernumber %]" />[% logged_in_user.userid %] > [% END %] > [% END %] > </li> >-- >2.1.4
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 21096
:
77149
|
77270
|
77271
|
77415
|
78286