using System.Configuration;
using System.Web;
using System.Web.Configuration;
namespace Neo.Afx.Security
{
///
/// Represents the forms auth settings configuration section.
///
public class FormsAuthSettings : ConfigurationSection
{
readonly ConfigurationProperty _enabled = new ConfigurationProperty("enabled", typeof(bool), true);
///
/// Gets the forms auth settings configuration section.
///
/// Expects the section to be named formsAuthSettings.
///
///
/// The forms auth settings configuration section.
public static FormsAuthSettings GetSection(HttpContext httpContext)
{
return WebConfigurationManager.GetSection("formsAuthSettings", httpContext.Request.Path) as FormsAuthSettings;
}
#region IsEnabled
///
/// Gets or sets a value indicating whether forms authentication is enabled.
///
[ConfigurationProperty("enabled", DefaultValue = true)]
public bool IsEnabled
{
get
{
return (bool)base[_enabled];
}
set
{
base[_enabled] = value;
}
}
#endregion
}
}