using System.Configuration; namespace Umbraco.Core.Configuration.UmbracoSettings { internal class SecurityElement : UmbracoConfigurationElement, ISecuritySection { [ConfigurationProperty("keepUserLoggedIn")] internal InnerTextConfigurationElement KeepUserLoggedIn => GetOptionalTextElement("keepUserLoggedIn", true); [ConfigurationProperty("hideDisabledUsersInBackoffice")] internal InnerTextConfigurationElement HideDisabledUsersInBackoffice => GetOptionalTextElement("hideDisabledUsersInBackoffice", false); /// /// Used to enable/disable the forgot password functionality on the back office login screen /// [ConfigurationProperty("allowPasswordReset")] internal InnerTextConfigurationElement AllowPasswordReset => GetOptionalTextElement("allowPasswordReset", true); /// /// A boolean indicating that by default the email address will be the username /// /// /// Even if this is true and the username is different from the email in the database, the username field will still be shown. /// When this is false, the username and email fields will be shown in the user section. /// [ConfigurationProperty("usernameIsEmail")] internal InnerTextConfigurationElement UsernameIsEmail => GetOptionalTextElement("usernameIsEmail", true); [ConfigurationProperty("authCookieName")] internal InnerTextConfigurationElement AuthCookieName => GetOptionalTextElement("authCookieName", "UMB_UCONTEXT"); [ConfigurationProperty("authCookieDomain")] internal InnerTextConfigurationElement AuthCookieDomain => GetOptionalTextElement("authCookieDomain", null); [ConfigurationProperty("userPasswordConfiguration")] public UserPasswordConfigurationElement UserPasswordConfiguration => (UserPasswordConfigurationElement)this["userPasswordConfiguration"]; [ConfigurationProperty("memberPasswordConfiguration")] public MemberPasswordConfigurationElement MemberPasswordConfiguration => (MemberPasswordConfigurationElement)this["memberPasswordConfiguration"]; bool ISecuritySection.KeepUserLoggedIn => KeepUserLoggedIn; bool ISecuritySection.HideDisabledUsersInBackoffice => HideDisabledUsersInBackoffice; /// /// Used to enable/disable the forgot password functionality on the back office login screen /// bool ISecuritySection.AllowPasswordReset => AllowPasswordReset; /// /// A boolean indicating that by default the email address will be the username /// /// /// Even if this is true and the username is different from the email in the database, the username field will still be shown. /// When this is false, the username and email fields will be shown in the user section. /// bool ISecuritySection.UsernameIsEmail => UsernameIsEmail; string ISecuritySection.AuthCookieName => AuthCookieName; string ISecuritySection.AuthCookieDomain => AuthCookieDomain; IUserPasswordConfigurationSection ISecuritySection.UserPasswordConfiguration => UserPasswordConfiguration; IMemberPasswordConfigurationSection ISecuritySection.MemberPasswordConfiguration => MemberPasswordConfiguration; } }