Domain Properties

Domain Properties

Domain Properties

  • AccountNameValidation retrieves the account name validation (regex)
  • AccountPrefix retrieves the account prefix (Name\)
  • AnonymousUserEmailPattern retrieves the anonymous user email pattern
  • AnonymousUserName retrieves the name assigned to the anonymous user
  • Appearance.DisplayName retrieves the display name of the domain
  • Appearance.HelpLink retrieves the help link
  • Appearance.Icon retrieves the icon for the domain
  • Appearance.LongDescription retrieves the long description
  • Appearance.ShortDescription retrieves the short description
  • Appearance.Style retrieves the CSS style
  • DefaultProfileItemID retrieves the default profile item ID
  • EnsureAnonymousUser retrieves a value indicating whether to ensure that an anonymous user exists for the domain
  • EveryoneRoleName retrieves the name of the Everyone role for the domain
  • IsDefault indicates whether this instance is the default domain 
  • LocallyManaged retrieves a value indicating whether the domain is locally managed
  • MemberPattern retrieves the pattern string for members of this domain
  • Name retrieves the name of the domain

Domain Properties C# Web Control Code

Sitecore.Security.Domains.Domain domain = Sitecore.Security.Domains.Domain.GetDomain("extranet");
if (domain == null) return;

Sitecore.Data.Items.Item item = Sitecore.Context.Item;
if (item == null) return;
output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Style, "font-weight:bold; width:100%; clear:both");
output.Write("C# Web Control Real-time Output");

output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Style, "font-size:x-small; width:100%; clear:both");
output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Style, "font-weight:bold");
///using : for colon and   for space
output.Write("{0}: {1}", "Item", item.DisplayName);
output.RenderEndTag(); //P

output.Write("{0}&#58;&#160;{1}", "DisplayName: ", "<b>" + domain.Appearance.DisplayName + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Account Name Validation", "<b>" + domain.AccountNameValidation + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Account Prefix", "<b>" + domain.AccountPrefix + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Anonymous User Email Pattern", "<b>" + domain.AnonymousUserEmailPattern + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Anonymous User Name", "<b>" + domain.AnonymousUserName + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Help Link", "<b>" + domain.Appearance.HelpLink + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Icon", "<b>" + domain.Appearance.Icon + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Long Description", "<b>" + domain.Appearance.LongDescription + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Short Description", "<b>" + domain.Appearance.ShortDescription + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Style", "<b>" + domain.Appearance.Style + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Default Profile Item ID", "<b>" + domain.DefaultProfileItemID + "</b><br/>");
output.Write("{0}&#63;&#160;{1}", "Ensure Anonymous User", "<b>" + domain.EnsureAnonymousUser.ToString() + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Everyone Role Name", "<b>" + domain.EveryoneRoleName + "</b><br/>");
output.Write("{0}&#63;&#160;{1}", "Is Default", "<b>" + domain.IsDefault.ToString() + "</b><br/>");
output.Write("{0}&#63;&#160;{1}", "Locally Managed", "<b>" + domain.LocallyManaged.ToString() + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Member Pattern", "<b>" + domain.MemberPattern + "</b>");

output.RenderEndTag(); //Div

Domain Properties C# Web Control Output

DisplayName: : extranet
Account Name Validation: ^\w[\w\s]*$
Account Prefix: extranet\
Anonymous User Email Pattern: 
Anonymous User Name: extranet\Anonymous
Help Link: 
Long Description: 
Short Description: 
Default Profile Item ID: 
Ensure Anonymous User? True
Everyone Role Name: extranet\Everyone
Is Default? False
Locally Managed? False
Member Pattern: extranet\*