24 lines
550 B
Text
24 lines
550 B
Text
|
|
#-------------------------------------------------------------------------------
|
|
# _GetCurrentUser
|
|
# Retrieves the user of the current process
|
|
# Params:
|
|
# user - On return contains the user for the current process
|
|
#-------------------------------------------------------------------------------
|
|
Sub _GetCurrentUser(OUT string $user)
|
|
{
|
|
|
|
@record on;
|
|
if (!`whoami`) {
|
|
return false;
|
|
}
|
|
@record off;
|
|
|
|
if (!GetCmdData("user::name", $user) || !defined($user)) {
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
# END GetCurrentUser
|