Fixes sni-related bug where customers and resellers are not allowed to see website properties.

This commit is contained in:
Olov Karlsson 2014-10-31 20:02:19 +01:00
parent 94d79fefd4
commit 750587f38d
4 changed files with 16 additions and 9 deletions

View file

@ -63,6 +63,7 @@ namespace WebsitePanel.Providers.Web
private bool heliconApeInstalled; private bool heliconApeInstalled;
private bool heliconApeEnabled; private bool heliconApeEnabled;
private HeliconApeStatus heliconApeStatus; private HeliconApeStatus heliconApeStatus;
private bool sniEnabled;
public WebSite() public WebSite()
{ {
@ -187,6 +188,12 @@ namespace WebsitePanel.Providers.Web
get { return this.heliconApeStatus; } get { return this.heliconApeStatus; }
set { this.heliconApeStatus = value; } set { this.heliconApeStatus = value; }
} }
public bool SniEnabled
{
get { return this.sniEnabled; }
set { this.sniEnabled = value; }
}
} }
[Flags] [Flags]

View file

@ -1240,6 +1240,7 @@ namespace WebsitePanel.Providers.Web
// //
site.SiteState = GetSiteState(srvman, siteId); site.SiteState = GetSiteState(srvman, siteId);
// //
site.SniEnabled = false;
} }
return site; return site;
} }

View file

@ -182,5 +182,12 @@ namespace WebsitePanel.Providers.Web
return sslObjectService.InstallCertificate(certificate, website); return sslObjectService.InstallCertificate(certificate, website);
} }
public override WebSite GetSite(string siteId)
{
var site = base.GetSite(siteId);
site.SniEnabled = UseSni;
return site;
}
} }
} }

View file

@ -278,15 +278,7 @@ namespace WebsitePanel.Portal
webSitesHeliconZooControl.BindWebItem(site); webSitesHeliconZooControl.BindWebItem(site);
// If SNI is enabled on the server, we do allow for SSL even if site not has dedicated Ip // If SNI is enabled on the server, we do allow for SSL even if site not has dedicated Ip
var sniEnabled = false; if (site.IsDedicatedIP || site.SniEnabled)
var serverSettings = ES.Services.Servers.GetServiceSettings(site.ServiceId);
var sniEnabledItem = serverSettings.FirstOrDefault(s => s.StartsWith("sslusesni"));
if (sniEnabledItem != null)
{
sniEnabled = Utils.ParseBool(sniEnabledItem.Split('=')[1], false);
}
if (site.IsDedicatedIP || sniEnabled)
{ {
AllowSsl = true; AllowSsl = true;
WebsitesSSLControl.Visible = true; WebsitesSSLControl.Visible = true;