SoftadminApi.User_InsertUpdate

 Show all Hide all

Creates a new user or updates an existing one.

Type: Stored procedure
Area of use: General use

Parameters:

@id mandatory int
User id. OUTPUT parameter
Possible value Description
n Update user with this id
NULL Create new user. The new user's identity is returned in the parameter
@UserName mandatory varchar(50)
@Password mandatory nvarchar(50)
The user's password. Can also be updated using SoftadminApi.User_UpdatePassword.
Possible value Description
#SAME# Leave the existing password unchanged
NULL A user with a NULL password is not able to log in via the login page. Typically used for special user accounts handled by the system.
xxx User's new password.
@PasswordHash optional varbinary(1000)
If you already have a hash of the password, for example because you've used a password field with the Hash Password setting then you can pass the hash directly to this procedure.

If you don't then just pass NULL and the procedure will hash the plaintext password in the @Password parameter.
@UserNameFirst mandatory varchar(50)
@UserNameLast mandatory varchar(50)
@UserEmail mandatory varchar(100)
@RoleID mandatory int
@LanguageId optional int
Defaults to the system's default language when inserting and to the user's current language when updating.
@IsAdministrator optional int
If the user is a Softadmin® administrator. You should not allow customers to update or create these users. Always defaults to 0
@IsHelpAdministrator optional bit
Defaults to 0 when inserting and to the user's current help administrator status when updating.
@MaintenanceUserRightsID optional int
Defaults to 2 when inserting and to the user's current rights when updating.
@IsEnabled optional bit
Defaults to 1 when inserting and the user's current enabled state when updating.
@PasswordHasExpired optional bit
If the user will be forced to change password the next time he logs in. Can also be updated using SoftadminApi.User_UpdatePassword. Defaults to 0 when inserting and the user's current password state when updating.
@EnforcePasswordPolicy optional bit
If the new password has to comply with the current password policy. Defaults to 1.