From 5dfc026fad2b0e92e00e501cf15284fae042a711 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 20 Oct 2014 13:04:45 +0000 Subject: [PATCH] Bug 13114: Prevent Shibboleth Patches from spamming logs - The shibboleth patch introduced an undefined message into the error logs, when shiboleth is disabled. Testplan 1. Ensure shibboleth is disabled. 2. Refresh any opac page 3. See 'Use of uninitialized value $ENV{"REMOTE_USER"} in string ne at /home/koha/kohaclone/C4/Auth.pm line 711.' popup in the opac-error.log 4. Apply patch 5. Refresh opac page 6. Error should no longer appear Signed-off-by: Tomas Cohen Arazi Signed-off-by: Katrin Fischer Works as described. Signed-off-by: Tomas Cohen Arazi --- C4/Auth.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index 7dfe3d21a5..bb2f3084e8 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -708,7 +708,7 @@ sub checkauth { # Finally, after those tests, we can assume (although if it would be better with # a syspref) that if we get a REMOTE_USER, that's from basic authentication, # and we can affect it to $userid. - if ( !$shib and $ENV{'REMOTE_USER'} ne '' and $userid = $ENV{'REMOTE_USER'} ) { + if ( !$shib and defined($ENV{'REMOTE_USER'}) and $ENV{'REMOTE_USER'} ne '' and $userid = $ENV{'REMOTE_USER'} ) { # Using Basic Authentication, no cookies required $cookie = $query->cookie( -- 2.11.4.GIT