From aa11b4b2025f4536943d54118a8353452229628f Mon Sep 17 00:00:00 2001 From: robvde Date: Thu, 4 Oct 2012 09:40:21 +0400 Subject: [PATCH] =?UTF-8?q?Fixed=201.=09Remove=20the=20text=20on=20the=20C?= =?UTF-8?q?reate=20a=20website=20tab=20that=20says=20=E2=80=9Cignore?= =?UTF-8?q?=E2=80=9D=20really=20can=20just=20delete=20whole=20line=202.=09?= =?UTF-8?q?Database=20records=20for=20SSL=20need=20to=20be=20deleted=20fro?= =?UTF-8?q?m=20database=20when=20switching=20from=20Static=20to=20Dynamic?= =?UTF-8?q?=20(If=20you=20make=20a=20cert=20request,=20switch=20and=20swit?= =?UTF-8?q?ch=20again=20it=20shows=20the=20prior=20request.=20It=20should?= =?UTF-8?q?=20be=20defaulted=20again)=203.=09Instant=20alias=20should=20ig?= =?UTF-8?q?nore=20global=20dns=20rules?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Code/DnsServers/DnsServerController.cs | 14 +++++++++----- .../Code/Servers/ServerController.cs | 2 +- .../Code/WebServers/WebServerController.cs | 10 +++++++++- .../WebsitePanel.EnterpriseServer/Web.config | 4 ++-- .../App_LocalResources/WebSitesAddSite.ascx.resx | 2 +- 5 files changed, 22 insertions(+), 10 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/DnsServers/DnsServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/DnsServers/DnsServerController.cs index d7e0a36a..4dd29dc7 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/DnsServers/DnsServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/DnsServers/DnsServerController.cs @@ -47,10 +47,10 @@ namespace WebsitePanel.EnterpriseServer public static int AddZone(int packageId, int serviceId, string zoneName) { - return AddZone(packageId, serviceId, zoneName, true); + return AddZone(packageId, serviceId, zoneName, true, false); } - public static int AddZone(int packageId, int serviceId, string zoneName, bool addPackageItem) + public static int AddZone(int packageId, int serviceId, string zoneName, bool addPackageItem, bool ignoreGlobalDNSRecords) { // get DNS provider DNSServer dns = GetDNSServer(serviceId); @@ -148,13 +148,17 @@ namespace WebsitePanel.EnterpriseServer zoneRecords.Add(ns); } - // add all other records - zoneRecords.AddRange(BuildDnsResourceRecords(records, "", zoneName, "")); + if (!ignoreGlobalDNSRecords) + { + // add all other records + zoneRecords.AddRange(BuildDnsResourceRecords(records, "", zoneName, "")); + } // add zone records dns.AddZoneRecords(zoneName, zoneRecords.ToArray()); + // add secondary zones foreach (int secondaryId in secondaryServiceIds) { @@ -443,7 +447,7 @@ namespace WebsitePanel.EnterpriseServer if (!dns.ZoneExists(itemName)) { // create primary and secondary zones - AddZone(packageId, serviceId, itemName, false); + AddZone(packageId, serviceId, itemName, false, false); // restore records XmlSerializer serializer = new XmlSerializer(typeof(DnsRecord)); diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Servers/ServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Servers/ServerController.cs index 6ab389c3..0be8b46c 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Servers/ServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Servers/ServerController.cs @@ -1852,7 +1852,7 @@ namespace WebsitePanel.EnterpriseServer int serviceId = PackageController.GetPackageServiceId(packageId, ResourceGroups.Dns); if (serviceId > 0) { - zoneItemId = DnsServerController.AddZone(packageId, serviceId, domainName); + zoneItemId = DnsServerController.AddZone(packageId, serviceId, domainName, true, isInstantAlias); } if (zoneItemId < 0) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebServers/WebServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebServers/WebServerController.cs index 708e00da..64a9446f 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebServers/WebServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebServers/WebServerController.cs @@ -642,7 +642,15 @@ namespace WebsitePanel.EnterpriseServer DomainInfo ZoneInfo = ServerController.GetDomain(domain.ZoneName); if (ZoneInfo == null) - throw new Exception("failed to retrieve parent zone"); + throw new Exception("Parent zone not found"); + + //cleanup certificates + List certificates = GetCertificatesForSite(siteItemId); + foreach (SSLCertificate c in certificates) + { + DeleteCertificate(siteItemId, c); + } + List pointers = GetWebSitePointers(siteItemId); foreach (DomainInfo pointer in pointers) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config index 4df2c0f1..11cbebba 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config @@ -5,11 +5,11 @@ - + - + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/WebSitesAddSite.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/WebSitesAddSite.ascx.resx index b4919109..f34ebbf3 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/WebSitesAddSite.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/WebSitesAddSite.ascx.resx @@ -142,7 +142,7 @@ If you need your web site to be accessible via dedicated IP address or you are planning to enable SSL for your site you should choose "Dedicated IP" option; otherwise leave this settings by default. In order to create IP-based site you need to purchase IP address from your host. - Note: A Zone Template is often defined by your host and contains additional Web Site Pointers to create when creating a new Web Site. Static record definitions such as 'www' conflicts when creating an additional Web Site in the same Domain. </p>Do not check the option to include the Zone Template and create the new Web Site with this Web Site Pointer only. + Dedicated