diff --git a/inc/HTTPAuthSession.php b/inc/HTTPAuthSession.php index 7e57b0da..e3b208c6 100644 --- a/inc/HTTPAuthSession.php +++ b/inc/HTTPAuthSession.php @@ -100,7 +100,11 @@ class HTTPAuthSession { header('Content-type: text/plain; ; charset="utf-8"' ); header( $auth_header ); echo 'Please log in for access to this system.'; - dbg_error_log( "HTTPAuth", ":Session: User is not authorised: %s ", $_SERVER['REMOTE_ADDR'] ); + if ( isset($_SERVER['PHP_AUTH_USER']) ) { + dbg_error_log( "ERROR", "authentication failure for user '%s' from host [%s]", $_SERVER['PHP_AUTH_USER'], $_SERVER['REMOTE_ADDR'] ); + } else { + dbg_error_log( "HTTPAuth", ":Session: User is not authorised: %s ", $_SERVER['REMOTE_ADDR'] ); + } @ob_flush(); exit(0); }