mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°2517 - Supportability : system report (user name)
This commit is contained in:
@@ -2172,4 +2172,14 @@ class utils
|
||||
{
|
||||
return APPROOT.'env-'.utils::GetCurrentEnvironment().'/'.$sModule.'/';
|
||||
}
|
||||
|
||||
public static function GetCurrentUserName()
|
||||
{
|
||||
if (function_exists('posix_getpwuid'))
|
||||
{
|
||||
return posix_getpwuid(posix_geteuid())['name'];
|
||||
}
|
||||
|
||||
return getenv('username');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@ function RunTask($oProcess, BackgroundTask $oTask, $oStartDate, $iTimeLimit)
|
||||
// Record (when starting) that this task was started, just in case it crashes during the execution
|
||||
$oTask->Set('latest_run_date', $oDateStarted->format('Y-m-d H:i:s'));
|
||||
// Record the current user running the cron
|
||||
$oTask->Set('system_user', getenv("username"));
|
||||
$oTask->Set('system_user', utils::GetCurrentUserName());
|
||||
$oTask->DBUpdate();
|
||||
$sMessage = $oProcess->Process($iTimeLimit);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user