External IP address bound to SSL binding, now internal dedicated IP
SSL Tab only to show website name and domain
default choice to include global dns zone during site creation is unchecked
When switching SSL enabled site to shared, certificate to be deleted
When deleted SSL enabled site, certificate to be deleted
Switch IP Mode added to the hosting plan
This commit is contained in:
robvde 2012-10-03 20:52:15 +04:00
parent d35094412d
commit 83886b94e2
9 changed files with 84 additions and 25 deletions

View file

@ -473,6 +473,13 @@ INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDe
END
GO
IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Web.AllowIPAddressModeSwitch')
BEGIN
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (333, 2, 22, N'Web.AllowIPAddressModeSwitch', N'Allow IP Address Mode Switch', 1, 0, NULL)
END
GO
DELETE FROM [dbo].[PackageQuotas] WHERE [QuotaID] IN (SELECT [QuotaID] FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.POP3Enabled')
DELETE FROM [dbo].[HostingPlanQuotas] WHERE [QuotaID] IN (SELECT [QuotaID] FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.POP3Enabled')

View file

@ -79,6 +79,7 @@ order by rg.groupOrder
public const string WEB_CFVIRTUALDIRS = "Web.CFVirtualDirectories"; //ColdFusion Virtual Directories
public const string WEB_REMOTEMANAGEMENT = "Web.RemoteManagement"; //IIS 7 Remote Management
public const string WEB_SSL = "Web.SSL"; //SSL
public const string WEB_ALLOWIPADDRESSMODESWITCH = "Web.AllowIPAddressModeSwitch"; //SSL
public const string FTP_ACCOUNTS = "FTP.Accounts"; // FTP Accounts
public const string MAIL_ACCOUNTS = "Mail.Accounts"; // Mail Accounts
public const string MAIL_FORWARDINGS = "Mail.Forwardings"; // Mail Forwardings

View file

@ -565,7 +565,15 @@ namespace WebsitePanel.EnterpriseServer
// delete web site
try
{
// remove all web site pointers
//cleanup certificates
//cleanup certificates
List<SSLCertificate> certificates = GetCertificatesForSite(siteItemId);
foreach (SSLCertificate c in certificates)
{
DeleteCertificate(siteItemId, c);
}
// remove all web site pointers
List<DomainInfo> pointers = GetWebSitePointers(siteItemId);
foreach (DomainInfo pointer in pointers)
DeleteWebSitePointer(siteItemId, pointer.DomainId, false, true, true);
@ -641,7 +649,6 @@ namespace WebsitePanel.EnterpriseServer
DeleteWebSitePointer(siteItemId, pointer.DomainId, true, true, false);
// remove web site main pointer
if (domain != null)
DeleteWebSitePointer(siteItemId, domain.DomainId, true, true, false);
@ -737,7 +744,13 @@ namespace WebsitePanel.EnterpriseServer
if (ZoneInfo == null)
throw new Exception("Parent zone not found");
//cleanup certificates
List<SSLCertificate> certificates = GetCertificatesForSite(siteItemId);
foreach (SSLCertificate c in certificates)
{
DeleteCertificate(siteItemId, c);
}
// remove all web site pointers
List<DomainInfo> pointers = GetWebSitePointers(siteItemId);
foreach (DomainInfo pointer in pointers)
@ -3656,6 +3669,10 @@ Please ensure the space has been allocated {0} IP address as a dedicated one and
long ticks = DateTime.UtcNow.Ticks - DateTime.Parse("01/01/1970 00:00:00").Ticks;
ticks /= 10000000; // Convert windows ticks to seconds
//clean up bindings
certificate.FriendlyName = String.Format("{0}_{1}", certificate.Hostname, ticks.ToString());
certificate = server.generateCSR(certificate);
certificate.id = DataProvider.AddSSLRequest(SecurityContext.User.UserId, item.PackageId,
@ -3692,12 +3709,19 @@ Please ensure the space has been allocated {0} IP address as a dedicated one and
WebServer server = GetWebServer(item.ServiceId);
TaskManager.WriteParameter("item.ServiceId", item.ServiceId);
IPAddressInfo ip = ServerController.GetIPAddress(item.SiteIPAddressId);
if (ip != null)
item.SiteIPAddress = !String.IsNullOrEmpty(ip.InternalIP) ? ip.InternalIP : ip.ExternalIP;
certificate = server.installCertificate(certificate, item);
if (certificate.SerialNumber == null)
{
result.AddError("Error_Installing_certificate", null);
result.IsSuccess = false;
}
DataProvider.CompleteSSLRequest(SecurityContext.User.UserId, item.PackageId,
certificate.id, certificate.Certificate,
certificate.DistinguishedName, certificate.SerialNumber,
@ -3735,6 +3759,11 @@ Please ensure the space has been allocated {0} IP address as a dedicated one and
WebServer server = GetWebServer(item.ServiceId);
TaskManager.WriteParameter("item.ServiceId", item.ServiceId);
// remove all web site pointers
List<DomainInfo> pointers = GetWebSitePointers(siteItemId);
foreach (DomainInfo pointer in pointers)
DeleteWebSitePointer(siteItemId, pointer.DomainId, true, true, true);
SSLCertificate certificate = server.installPFX(pfx, password, item);
if (certificate.SerialNumber == null)
{

View file

@ -4855,6 +4855,9 @@
<data name="Quota.Web.SSL" xml:space="preserve">
<value>SSL</value>
</data>
<data name="Quota.Web.AllowIPAddressModeSwitch" xml:space="preserve">
<value>Allow IP Address Mode Switch</value>
</data>
<data name="ServiceItemType.ExchangeOrganization" xml:space="preserve">
<value>Exchange Organization</value>
</data>

View file

@ -127,7 +127,7 @@
<value>Cancel</value>
</data>
<data name="chkIgnoreGlobalDNSRecords.Text" xml:space="preserve">
<value>Ignore Zone Template</value>
<value>Include Zone Template</value>
</data>
<data name="lblAspNetVersion.Text" xml:space="preserve">
<value>ASP.NET Version:</value>

View file

@ -23,7 +23,7 @@
<td class="Normal" nowrap rowspan="2"></td>
<td class="Normal">
<asp:CheckBox ID="chkIgnoreGlobalDNSRecords" runat="server" meta:resourcekey="chkIgnoreGlobalDNSRecords"
Text="This hostname only, Ignore Zone Template" Checked="True" />
Text="Include Zone Template" Checked="True" />
</td>
</tr>
<tr>

View file

@ -107,7 +107,7 @@ namespace WebsitePanel.Portal
int packageAddressId = rbDedicatedIP.Checked ? Utils.ParseInt(ddlIpAddresses.SelectedValue, 0) : 0;
siteItemId = ES.Services.WebServers.AddWebSite(PanelSecurity.PackageId, txtHostName.Text.ToLower(), domainsSelectDomainControl.DomainId,
packageAddressId, chkIgnoreGlobalDNSRecords.Checked);
packageAddressId, !chkIgnoreGlobalDNSRecords.Checked);
if (siteItemId < 0)
{

View file

@ -197,8 +197,13 @@ namespace WebsitePanel.Portal
dedicatedIP.Visible = site.IsDedicatedIP;
sharedIP.Visible = !site.IsDedicatedIP;
cmdSwitchToDedicatedIP.Visible = (ddlIpAddresses.Items.Count > 0);
PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId);
if (Utils.CheckQouta(Quotas.WEB_ALLOWIPADDRESSMODESWITCH, cntx))
cmdSwitchToDedicatedIP.Visible = (ddlIpAddresses.Items.Count > 0);
else
cmdSwitchToDedicatedIP.Visible = cmdSwitchToSharedIP.Visible = false;
litFrontPageUnavailable.Visible = false;
tblSharePoint.Visible = site.SharePointInstalled;
@ -1016,6 +1021,7 @@ namespace WebsitePanel.Portal
protected void cmdSwitchToDedicatedIP_Click(object sender, EventArgs e)
{
sharedIP.Visible = false;
switchToDedicatedIP.Visible = true;
}

View file

@ -107,23 +107,11 @@ namespace WebsitePanel.Portal
}
}
private void BindListOfAvailableSslDomains(ServerBinding[] siteBindings, SSLCertificate[] siteCertificates, string websiteName = "")
private void BindListOfAvailableSslDomains(string websiteName, string domainName)
{
lstDomains.Items.Clear();
//
foreach (ServerBinding binding in siteBindings)
{
//
if (binding.IP.ToString().Length > 0 && binding.Host.Length == 0)
{
lstDomains.Items.Add(new ListItem(websiteName, websiteName));
lstDomains.Items.Add(new ListItem(String.Format("www.{0}", websiteName), String.Format("www.{0}", websiteName)));
}
else
{
lstDomains.Items.Add(new ListItem(binding.Host, binding.Host));
}
}
lstDomains.Items.Add(new ListItem(websiteName, websiteName));
lstDomains.Items.Add(new ListItem(domainName, domainName));
}
public void BindWebItem(WebVirtualDirectory item)
@ -144,8 +132,20 @@ namespace WebsitePanel.Portal
SSLCertificate[] certificates = ES.Services.WebServers.GetCertificatesForSite(item.Id);
SSLNotInstalled.Visible = true;
DomainInfo[] domains = ES.Services.Servers.GetDomains(PanelSecurity.PackageId);
string zoneName = string.Empty;
foreach (DomainInfo d in domains)
{
if (d.WebSiteId == SiteId)
{
zoneName = d.ZoneName;
break;
}
}
//
BindListOfAvailableSslDomains(webSite.Bindings, certificates, webSite.Name);
BindListOfAvailableSslDomains(webSite.Name, zoneName);
if (certificates.Length > 0)
{
@ -568,7 +568,20 @@ namespace WebsitePanel.Portal
SSLNotInstalled.Visible = true;
//
BindListOfAvailableSslDomains(item.Bindings, certificates, item.Name);
DomainInfo[] domains = ES.Services.Servers.GetDomains(PanelSecurity.PackageId);
string zoneName = string.Empty;
foreach (DomainInfo d in domains)
{
if (d.WebSiteId == item.Id)
{
zoneName = d.ZoneName;
break;
}
}
//
BindListOfAvailableSslDomains(item.Name, zoneName);
if (certificates.Length > 0)
{