TE2000 | TC3 HMI Engineering

addUser

[ Function ]

public static addUser(
    userName: string,
    password: string,
    callback: null | ((this: void, data: TcHmi.IResultObject) => void) = null
): TcHmi.IErrorDetails;

Creates a new user.

 

By default, all new users are members of the group __SystemUsers as a minimum and are assigned English as language. If no domain is specified, the extension TcHmiUserManagement is used for user management.

This behavior can be changed on the server configuration page under TcHmiSrv > "Default Usergroup", "Default Locale" and "Default authentication extension".

 
 

Parameter

 
Name
Type
Description
userName
Name of the new user
password
Plain text password of the new user
callback [ optional ]
(data: TcHmi.IResultObject) => void, null
Asynchronous callback function that is triggered once the action is completed.
 

Return value

 
Type
Description
Returns confirmation as to whether the operation was successfully sent.
 

Note: Available since version 1.10.1018.48

 

Example - JavaScript

TcHmi.Server.UserManagement.addUser('newUser', 'Gbt3fC79ZmMEFUFJ', function(data) {
    if (data.error === TcHmi.Errors.NONE) {
        // Success
    } else {
        // Error
    }
});