getCurrentUser
[ Function ]
public static getCurrentUser(): string | null;
Returns the name of the current user as string or null.
Parameter
Name | Type | Description |
---|---|---|
- | - | - |
Return value
Type | Description |
---|---|
The name of the currently logged on user or null in the event of an error or if no user is logged on. |
Available from 1.8 |
Sample - JavaScript
var user = TcHmi.Server.getCurrentUser();
if(user) {
console.log('Current user is ' + user);
} else {
console.log('We have no current user.');
}