Bug 10019: Fix for userid containing UTF8 chars

Decodes userid on two places in checkauth of C4/Auth.pm

Test plan:
Include some non-Latin characters in your userid (loginname). Arab, Chinese?
Login into opac and check user page.
Go to staff (no new login), check your login name at various places.
Logout, login via staff.
Do the same.
Go to opac again (no new login), check user page.
Optionally: Remove all your sessions from table. Do a login. Check sessions.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Comment: Works as described. No errors.
This patch fixes this problem, but I wonder if
there is a general solution that handle all as utf8.
Tested in opac and staff.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
This commit is contained in:
Marcel de Rooy 2013-04-10 10:13:52 +02:00 committed by Jared Camins-Esakov
parent bd6cd72148
commit 7e90e1524f

View file

@ -675,6 +675,7 @@ sub checkauth {
$ip = $session->param('ip');
$lasttime = $session->param('lasttime');
$userid = $session->param('id');
utf8::decode($userid);
$sessiontype = $session->param('sessiontype') || '';
}
if ( ( ($query->param('koha_login_context')) && ($query->param('userid') ne $session->param('id')) )
@ -750,6 +751,7 @@ sub checkauth {
-HttpOnly => 1
);
$userid = $query->param('userid');
utf8::decode($userid);
if ( ( $cas && $query->param('ticket') )
|| $userid
|| ( my $pki_field = C4::Context->preference('AllowPKIAuth') ) ne