Prework switch web dedicated to shared
Dedicated sites supports now hostheaders
This commit is contained in:
parent
465731273a
commit
6868241a6d
15 changed files with 358 additions and 318 deletions
|
@ -1237,7 +1237,7 @@ namespace WebsitePanel.Providers.Web
|
|||
// Create site
|
||||
webObjectsSvc.CreateSite(site);
|
||||
// Update web site bindings
|
||||
webObjectsSvc.UpdateSiteBindings(site.SiteId, site.Bindings);
|
||||
webObjectsSvc.UpdateSiteBindings(site.SiteId, site.Bindings, false);
|
||||
// Set web site logging settings
|
||||
webObjectsSvc.SetWebSiteLoggingSettings(site);
|
||||
}
|
||||
|
@ -1322,7 +1322,7 @@ namespace WebsitePanel.Providers.Web
|
|||
// Update website
|
||||
webObjectsSvc.UpdateSite(site);
|
||||
// Update website bindings
|
||||
webObjectsSvc.UpdateSiteBindings(site.SiteId, site.Bindings);
|
||||
webObjectsSvc.UpdateSiteBindings(site.SiteId, site.Bindings, false);
|
||||
// Set website logging settings
|
||||
webObjectsSvc.SetWebSiteLoggingSettings(site);
|
||||
//
|
||||
|
@ -1440,9 +1440,9 @@ namespace WebsitePanel.Providers.Web
|
|||
/// </summary>
|
||||
/// <param name="siteId">Site's id to update bindings for.</param>
|
||||
/// <param name="bindings">Bindings information.</param>
|
||||
public override void UpdateSiteBindings(string siteId, ServerBinding[] bindings)
|
||||
public override void UpdateSiteBindings(string siteId, ServerBinding[] bindings, bool emptyBindingsAllowed)
|
||||
{
|
||||
this.webObjectsSvc.UpdateSiteBindings(siteId, bindings);
|
||||
this.webObjectsSvc.UpdateSiteBindings(siteId, bindings, emptyBindingsAllowed);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -422,11 +422,14 @@ namespace WebsitePanel.Providers.Web.Iis.WebObjects
|
|||
return bindings.ToArray();
|
||||
}
|
||||
|
||||
private void SyncWebSiteBindingsChanges(string siteId, ServerBinding[] bindings)
|
||||
private void SyncWebSiteBindingsChanges(string siteId, ServerBinding[] bindings, bool emptyBindingsAllowed)
|
||||
{
|
||||
// ensure site bindings
|
||||
if (bindings == null || bindings.Length == 0)
|
||||
throw new Exception("SiteServerBindingsEmpty");
|
||||
if (!emptyBindingsAllowed)
|
||||
{
|
||||
if (bindings == null || bindings.Length == 0)
|
||||
throw new Exception("SiteServerBindingsEmpty");
|
||||
}
|
||||
|
||||
using (var srvman = GetServerManager())
|
||||
{
|
||||
|
@ -461,7 +464,7 @@ namespace WebsitePanel.Providers.Web.Iis.WebObjects
|
|||
}
|
||||
}
|
||||
|
||||
public void UpdateSiteBindings(string siteId, ServerBinding[] bindings)
|
||||
public void UpdateSiteBindings(string siteId, ServerBinding[] bindings, bool emptyBindingsAllowed)
|
||||
{
|
||||
using (ServerManager srvman = GetServerManager())
|
||||
{
|
||||
|
@ -470,7 +473,7 @@ namespace WebsitePanel.Providers.Web.Iis.WebObjects
|
|||
return;
|
||||
}
|
||||
//
|
||||
SyncWebSiteBindingsChanges(siteId, bindings);
|
||||
SyncWebSiteBindingsChanges(siteId, bindings, emptyBindingsAllowed);
|
||||
}
|
||||
|
||||
public string GetPhysicalPath(ServerManager srvman, WebVirtualDirectory virtualDir)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue