Skip to main content

Sitecore.Form.Submit.UserBaseAction class

Abstract

The Sitecore.Form.Submit.UserBaseAction class lets you manage users’ accounts.

The Sitecore.Form.Submit.UserBaseAction class lets you manage users’ accounts. The Sitecore.Form.Submit.UserBaseAction class contains the following methods:

Method

Description

public static string Escape(string userName)

Formats a username (replaces “.” with “_dot_” and “@” with “_at_”).

public static string GetFullUserName(string domainName, string userName)

Ensures that a username contains a domain name.

protected string GetProfileProperty(UserProfile profile, string profileproperty)

Gets a profile property value by its name.

protected string GetUserNameIfExist(string preUserName)

Returns a username if the user with the specified name exists, otherwise returns null.

public static string GetValidUserName(string domainName, string userName)

Returns a valid username based on the specified one.

protected virtual string ProccessBaseOperations(ID formId, AdaptedResultList fields, bool createIfNotExist)

Returns a username if the user exists or was created (depending on the boolcreateIfNotExist argument value) by the method.

protected virtual void UpdateEmail(string userName, string mail)

Sets the user mail if the specified email is valid.

protected virtual void UpdateGlobalSession(string userName)

Updates the analytics global session with the specified user.

protected virtual void UpdatePassword(ID formID, string userName, string password)

Creates a user with the specified name and password if none exists. If the Password property value is blankPassword, the user is created with a blank password, if the value is randomPassword, a random password is generated. This method also sets the profile item ID for the created user.

protected void UpdateProfileProperty(UserProfile profile, string profileproperty, string propertyValue)

Sets the profile property value.

The Sitecore.Form.Submit.UserBaseAction class contains the following properties:

Property

Description

public bool AssociateUserWithVisitor { get; set; }

Indicates whether the analytics global session must be updated with the user information. This property is checked in the UpdateGlobalSession method.

public string AuditField { get; set; }

It is only used in derived types.

public string DomainField { get; set; }

Specifies the domain name.

public string PasswordField { get; set; }

Specifies if the password field name can contain special values.

public string ProfileItemId { get; set; }

Sets or gets the ID of the user profile item.

public string UserNameField { get; set; }

Sets or gets the name of the web form field that contains a username.

public string UserNameIsEmpty { get; set; }

Sets or gets the exception message that is thrown if a username is empty.