Re-factored IIS 7 provider to improve GetSite() operation performance.

This commit is contained in:
feodor_fitsner 2011-12-12 15:04:33 -08:00
parent 58b073a6aa
commit eb64f13221
21 changed files with 1058 additions and 1058 deletions

View file

@ -41,23 +41,20 @@ namespace WebsitePanel.Providers.Web.Iis.Authentication
public const string UserNameAttribute = "userName";
public const string PasswordAttribute = "password";
public PropertyBag GetAuthenticationSettings(string siteId)
public PropertyBag GetAuthenticationSettings(ServerManager srvman, string siteId)
{
using (var srvman = GetServerManager())
{
var config = srvman.GetApplicationHostConfiguration();
//
var section = config.GetSection(Constants.AnonymousAuthenticationSection, siteId);
//
PropertyBag bag = new PropertyBag();
//
bag[AuthenticationGlobals.AnonymousAuthenticationUserName] = Convert.ToString(section.GetAttributeValue(UserNameAttribute));
bag[AuthenticationGlobals.AnonymousAuthenticationPassword] = Convert.ToString(section.GetAttributeValue(PasswordAttribute));
bag[AuthenticationGlobals.Enabled] = Convert.ToBoolean(section.GetAttributeValue(EnabledAttribute));
bag[AuthenticationGlobals.IsLocked] = section.IsLocked;
//
return bag;
}
var config = srvman.GetApplicationHostConfiguration();
//
var section = config.GetSection(Constants.AnonymousAuthenticationSection, siteId);
//
PropertyBag bag = new PropertyBag();
//
bag[AuthenticationGlobals.AnonymousAuthenticationUserName] = Convert.ToString(section.GetAttributeValue(UserNameAttribute));
bag[AuthenticationGlobals.AnonymousAuthenticationPassword] = Convert.ToString(section.GetAttributeValue(PasswordAttribute));
bag[AuthenticationGlobals.Enabled] = Convert.ToBoolean(section.GetAttributeValue(EnabledAttribute));
bag[AuthenticationGlobals.IsLocked] = section.IsLocked;
//
return bag;
}
public void SetAuthenticationSettings(string virtualPath, string userName,