From 8c7153df0fc99167dc701772f6ede6c90227e4d4 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Thu, 17 Oct 2013 17:41:43 -0700 Subject: [PATCH] Bug 11077: remove uninitialized value $pki_field warning During login at the Staff interface you get warnings in the logs regarding an uninitialized value for the $pki_field variable. To test: - tail -f /path/to/your-intranet-logs - Point your browser to your staff login page - Login - Three warnings are showed - Apply the patch - Log out - Log in - No new warnings, and you can still log in. Sponsored-by: Universidad Nacional de Cordoba Signed-off-by: Petter Goksoyr Asen Followed test plan; it works as advertised. Also works when I deleted AllowPKIAuth system pref. Signed-off-by: Marcel de Rooy Signed-off-by: Galen Charlton (cherry picked from commit ce5ab3b31457793815a2f49bc8287fdcbd0dd3c5) Signed-off-by: Fridolin SOMERS --- C4/Auth.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index 8b0bebe9fd..c6475bbf70 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -687,7 +687,7 @@ sub checkauth { $userid = $session->param('id'); $sessiontype = $session->param('sessiontype') || ''; } - if ( ( ($query->param('koha_login_context')) && ($query->param('userid') ne $session->param('id')) ) + if ( ( ($query->param('koha_login_context')) && ($query->param('userid') ne ($session->param('id') // '')) ) || ( $cas && $query->param('ticket') ) ) { #if a user enters an id ne to the id in the current session, we need to log them in... #first we need to clear the anonymous session... @@ -759,11 +759,12 @@ sub checkauth { -value => $session->id, -HttpOnly => 1 ); - $userid = $query->param('userid'); + $userid = $query->param('userid'); + my $pki_field = C4::Context->preference('AllowPKIAuth') // 'None'; if ( ( $cas && $query->param('ticket') ) || $userid - || ( my $pki_field = C4::Context->preference('AllowPKIAuth') ) ne - 'None' || $persona ) + || $pki_field ne 'None' + || $persona ) { my $password = $query->param('password'); -- 2.39.5