AdministrativeCreateUser Method
Syntax
Context.Security.AdministrativeCreateUser as L (UserName as C, Password as C, IsApproved as L = .T.)
Arguments
- UserNameCharacter
The user name for the new user.
- PasswordCharacter
The password for the new user.
- 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 the user is created; otherwise .F.
Description
Adds a new user with a password.
Discussion
Context.Security.AdministrativeCreateUser() adds a new user with a password. Normally Context.Security.CreateUser is used to create users.
When the security setting for "Reset Password" is set require a question and answer, a security question and answer are required to create a user. This requirement is not practical when an administrative task creates a user. The AdministrativeCreateUser method can be used in this case. It does not require a security question and answer even if the security settings require one. Because of this, its use should be limited to pages/code that require administrative access and the application should require the user to set a security question and answer on first login.
Check Context.Security.CallResult.Success before using the return value.