Bug 21096: Do not display loggedinusername in template
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 25 Jul 2018 15:25:58 +0000 (12:25 -0300)
committerNick Clemens <nick@bywatersolutions.com>
Thu, 30 Aug 2018 13:40:31 +0000 (13:40 +0000)
commitbe691d86e35acebace0f1576ea9380f405dd55ce
tree316348340b4e9308d8b3b5a7ae1c16025ba06083
parent823c76cdc58b7b80b365a4f313fed3462f0df720
Bug 21096: Do not display loggedinusername in template

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>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
C4/Auth.pm
koha-tmpl/intranet-tmpl/prog/en/includes/header.inc
koha-tmpl/intranet-tmpl/prog/en/modules/acqui/parcel.tt
koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt
koha-tmpl/intranet-tmpl/prog/en/modules/patron_lists/add-modify.tt
koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt
koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt