Documentation
IPS_GetLoggedInUser
string IPS_GetLoggedInUser ()
Returns
Name of the currently logged in user, e.g. "@admin" or "@unknown"
Description
The function returns the name of the user in whose context the current execution (e.g. a script) runs. A script inherits the user of the context that started it. If a script is started e.g. by an action in a visualization where a user is logged in, the function returns the name of this user.
The following special users exist:
| User | Description |
|---|---|
| @admin | Administrator with all permissions. Logging in is done with the license (e-mail address) and the remote access password, e.g. in the console. |
| @unknown | No user is logged in. This user has no permissions at all. |
The function does not require the RBAC feature in the license. The executing user is also shown in the traces as ExecutionUser, see IPS_GetTraces.
See also: IPS_IsAdministrator, IPS_IsUnknown, IPS_HasPermission
Example
echo IPS_GetLoggedInUser();
/* e.g. returns:
@admin
*/