Cicode Programming Reference > Cicode Function Categories > Security Functions Introduction > UserPassword

UserPassword

Not available for a Windows user.

Changes the password for the user. Changes are written to both the Users database and the runtime database in memory.

Syntax

UserPassword(sName [, sPassword] [, sOldPassword] )

sName:

The 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.

sOldPassword:

The password assigned to the user before the UserPassword() function is run.

The sOldPassword argument is optional. If passed, CitectSCADA will only permit the password change (and consequent re-setting of the expiry period) when the old password is correctly entered. If the sOldPassword parameter is not passed, the password change will proceed without restriction.

Return Value

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

Related Functions

UserPasswordForm, UserCreate, UserEditForm

Example

/* Change Fred's password */
UserPassword("Fred", "secret");

See Also

Security Functions