From 6471e5de1c34b3685a8fd986a1f070ffbb4c8c85 Mon Sep 17 00:00:00 2001 From: "Hahn Axel (hahn)" <axel.hahn@iml.unibe.ch> Date: Wed, 29 Mar 2017 15:03:15 +0200 Subject: [PATCH] fix: set username in action log --- public_html/deployment/classes/actionlog.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public_html/deployment/classes/actionlog.class.php b/public_html/deployment/classes/actionlog.class.php index 0a899161..7eb14abe 100644 --- a/public_html/deployment/classes/actionlog.class.php +++ b/public_html/deployment/classes/actionlog.class.php @@ -1,4 +1,5 @@ <?php +require_once 'user.class.php'; /** * class to log all project actions, ie. build, deploy etc. @@ -41,12 +42,11 @@ class Actionlog { die("ERROR: unable to create sqlite database " . $this->_dbfile); } } - $this->_sProject = $sProject; - if (isset($_SERVER) && is_array($_SERVER) && array_key_exists("PHP_AUTH_USER", $_SERVER) && $_SERVER["PHP_AUTH_USER"] - ) { + $oUser=new user(); + if ($oUser->getUsername()) { $this->_sIP = $_SERVER["REMOTE_ADDR"]; - $this->_sUser = $_SERVER["PHP_AUTH_USER"] . " (web)"; + $this->_sUser = $oUser->getUsername() . " (web)"; } else { $this->_sIP = 'local'; $aUser=posix_getpwuid(posix_geteuid()); -- GitLab