From 09b78c16342787c675ed8578331f178dbf08a899 Mon Sep 17 00:00:00 2001 From: Paula Quispe Date: Tue, 21 Mar 2017 14:21:12 -0400 Subject: [PATCH] I corrected the observation --- gulliver/system/class.g.php | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/gulliver/system/class.g.php b/gulliver/system/class.g.php index df2f7177e..5ba76ab5a 100644 --- a/gulliver/system/class.g.php +++ b/gulliver/system/class.g.php @@ -5451,34 +5451,39 @@ class G } /** - */ + * This function save history about some actions in the file audit.log + * The data is used in the Audit Log functionality + * + * @param string $actionToLog + * @param string $valueToLog + * @return void + */ public static function auditLog($actionToLog, $valueToLog = "") { - $workspace = defined('SYS_SYS') ? SYS_SYS : 'Wokspace Undefined'; + $workspace = defined('SYS_SYS') ? SYS_SYS : 'Wokspace Undefined'; $conf = new Configurations(); $sflag = $conf->getConfiguration('AUDIT_LOG', 'log'); $sflagAudit = $sflag == 'true' ? true : false; $ipClient = G::getIpAddress(); - $username = 'Unknow User'; - $fullname = '-'; + $userUid = 'Unknow User'; + $fullName = '-'; /*----------------------------------********---------------------------------*/ $licensedFeatures = PMLicensedFeatures::getSingleton(); if ($sflagAudit && $licensedFeatures->verifyfeature('vtSeHNhT0JnSmo1bTluUVlTYUxUbUFSVStEeXVqc1pEUG5EeXc0MGd2Q3ErYz0=')) { if (isset($_SESSION['USER_LOGGED']) && $_SESSION['USER_LOGGED'] != '') { - $username = $_SESSION['USER_LOGGED']; + $userUid = $_SESSION['USER_LOGGED']; } else { //Get the usrUid related to the accessToken $userUid = \ProcessMaker\Services\OAuth2\Server::getUserId(); if (!empty($userUid)) { $oUserLogged = new \Users(); $user = $oUserLogged->loadDetails($userUid); - $username = $user['USR_UID']; - $fullname = $user['USR_FULLNAME']; + $fullName = $user['USR_FULLNAME']; } } - $fullname = isset($_SESSION['USR_FULLNAME']) && $_SESSION['USR_FULLNAME'] != '' ? $_SESSION['USR_FULLNAME'] : $fullname; - G::log("|". $workspace ."|". $ipClient ."|". $username . "|" . $fullname ."|" . $actionToLog . "|" . $valueToLog, PATH_DATA, "audit.log"); + $fullName = isset($_SESSION['USR_FULLNAME']) && $_SESSION['USR_FULLNAME'] != '' ? $_SESSION['USR_FULLNAME'] : $fullName; + G::log("|". $workspace ."|". $ipClient ."|". $userUid . "|" . $fullName ."|" . $actionToLog . "|" . $valueToLog, PATH_DATA, "audit.log"); } /*----------------------------------********---------------------------------*/ }