getCurrentUser
Returns the username of the current DashBoard user.
When a User Rights Management server is present, this function returns the username of the user signed-in to DashBoard.
When no User Rights Management Server is found, this function returns the computer account name.
Syntax
ogscript.getCurrentUser ( );
Parameters
N/A
Returns
String
Example
This example uses the getCurrentUser function to read the user name, and then uses the rename function to rename a label. For more information about the rename function, see rename on page 173.
The label is defined in the .grid file as follows:
<labelheight="49" id="Welcome Label" left="136" name="Welcome" style="txt-align:west;" top="275" width="188"/>
The script to read the user name and then rename the label is as follows:
//read the login user name
var loginName= ogscript.getCurrentUser();
//display the user name in the Welcomelabel var message = 'Welcome ' + loginName; ogscript.rename('Welcome Label',message);