CreateUser Method

Syntax

Context.Security.CreateUser as L (UserName as C, Password as C, IsApproved as L = .T.)

Context.Security.CreateUser as L (UserName as C, Password as C, Email as C, IsApproved as L = .T.)

Context.Security.CreateUser as L (UserName as C, Password as C, Email as C, PasswordQuestion as C, PasswordAnswer as C, IsApproved as L = .T.)

Arguments

UserNameCharacter

The name of the new user.

PasswordCharacter

The password for the new user.

EmailCharacter

The email address of the new user.

PasswordQuestionCharacter

The question to be used for password reset.

PasswordAnswerCharacter

The answer to the PasswordQuestion to be used for password reset.

IsApprovedLogical

Set the user to being approved for login or not approved for login. If this value is set to .F. the user will not be able to login even if the credentials are valid. Optional. Defaults to .T.

Returns

resultLogical

Returns .T. if user is created; otherwise .F.

Description

Adds a new user with a password.

Discussion

Context.Security.CreateUser() adds a new user with a password. There are method overloads for creating a user with an email address and a password question and answer. Check Context.Security.CallResult.Success before using the return value.