Cicode Programming Reference > Cicode Function Categories > Security Functions > UserCreate

UserCreate

Not available for a Windows user.

Creates a record for a new user. A new user of the specified type is created. The name of the user needs to be unique.

Note: Only those users assigned a role with "Manage User" privilege set to True can create a user. Other users attempting to run will encounter an error.

An alarm server needs to be configured and running in the project, so that all clients are notified that an online change to the users configuration has been completed.

In order to perform user configuration changes online in a system with multiple computers running SCADA nodes using these functions, you will need to use the RUN and COPY parameters to check the updates are distributed throughout the system, and that the functions are called from the computer which uses the COPY path as it's RUN path.

This function is a blocking function. It blocks the calling Cicode task until the operation is complete.

Note: This function is not supported on the Internet Display Client. If this function is called on the Internet Display Client then it will return an error.

Syntax

UserCreate(sName, sFullName, sPassword, sType )

sName:

The name of the user.

sFullName:

The full name of the user.

sPassword:

The password of the user.

The sPassword argument is optional. If not passed, this argument defaults to an empty string which is subsequently ignored. It is included for the purposes of handling duplicate user names and separate password identification compatibility.

sType:

The generic type of user. The type needs to be defined in the Users database (with the Users form).

Return Value

0 (zero) if successful, otherwise an error code is returned.

Related Functions

UserDelete, UserEditForm, UserPassword, UserPasswordForm, UserCreateForm

Example

/* Create a new user */
UserCreate("Fred", "Fred Jones", "secret", "Operator");

See Also

Security Functions

Published June 2018