Fixed: When onboarding a tenant with resources all globaldnsrecords are

interpreted and created, even when service offering is not subscribed or not
used yet.

Service globaldnsrecords are ignored when onboarding a tenant. Virtual Server
and Server globaldnsrecords are applied when onboarding a user

Service globaldns records are now applied when service is applied/activated

DNS record definitions removed for those services where no globaldnsrecords are
user

TaskManager unhandled exception handled
This commit is contained in:
robvde 2012-10-24 13:05:14 +04:00
parent 2907c27592
commit 75ca39ea5f
13 changed files with 458 additions and 109 deletions

View file

@ -331,27 +331,13 @@ namespace WebsitePanel.EnterpriseServer.Code.SharePoint
string hostName = tmpStr[0];
string domainName = siteName.Substring(hostName.Length + 1, siteName.Length - (hostName.Length + 1));
DomainInfo domain = ServerController.GetDomain(domainName);
if (domain != null)
{
string website = siteName;
List<GlobalDnsRecord> dnsRecords = ServerController.GetDnsRecordsByService(serviceId);
List<DnsRecord> resourceRecords = DnsServerController.BuildDnsResourceRecords(dnsRecords, hostName, domainName, "");
DNSServer dns = new DNSServer();
DnsRecord[] records = ServerController.GetDnsZoneRecords(domain.DomainId);
foreach (DnsRecord record in records)
{
var type = record.RecordType;
if ((type == DnsRecordType.A || type == DnsRecordType.AAAA) && String.IsNullOrEmpty(record.RecordName))
{
ServerController.DeleteDnsZoneRecord(domain.DomainId, String.Empty, type, record.RecordData);
break;
}
}
ServerController.AddDnsZoneRecord(domain.DomainId, hostName, DnsRecordType.A, hostedSharePointSettings["RootWebApplicationIpAddress"], 0, 0, 0, 0);
var ip = hostedSharePointSettings["RootWebApplicationIpAddress"];
var type2 = ip.Contains(":") ? DnsRecordType.AAAA : DnsRecordType.A;
ServerController.AddDnsZoneRecord(domain.DomainId, String.Empty, type2, ip, 0, 0, 0, 0);
}
ServiceProviderProxy.Init(dns, dnsServiceId);
// add new resource records
dns.AddZoneRecords(domainName, resourceRecords.ToArray());
}
TaskManager.ItemId = itemId;
@ -412,27 +398,13 @@ namespace WebsitePanel.EnterpriseServer.Code.SharePoint
string hostName = tmpStr[0];
string domainName = siteName.Substring(hostName.Length + 1, siteName.Length - (hostName.Length + 1));
DomainInfo domain = ServerController.GetDomain(domainName);
if (domain != null)
{
var ip = hostedSharePointSettings["RootWebApplicationIpAddress"];
var type = ip.Contains(":") ? DnsRecordType.AAAA : DnsRecordType.A;
ServerController.DeleteDnsZoneRecord(domain.DomainId, String.Empty, type, ip);
ServerController.DeleteDnsZoneRecord(domain.DomainId, "www", type, ip);
if (!String.IsNullOrEmpty(domain.WebSiteName))
{
DnsRecord[] records = ServerController.GetDnsZoneRecords(domain.DomainId);
foreach (DnsRecord record in records)
{
type = record.RecordType;
if ((type == DnsRecordType.A || type == DnsRecordType.AAAA) && record.RecordName.Equals("www", StringComparison.CurrentCultureIgnoreCase))
{
ServerController.AddDnsZoneRecord(domain.DomainId, String.Empty, DnsRecordType.A, record.RecordData, 0, 0, 0, 0);
break;
}
}
}
}
List<GlobalDnsRecord> dnsRecords = ServerController.GetDnsRecordsByService(origItem.ServiceId);
List<DnsRecord> resourceRecords = DnsServerController.BuildDnsResourceRecords(dnsRecords, hostName, domainName, "");
DNSServer dns = new DNSServer();
ServiceProviderProxy.Init(dns, dnsServiceId);
// add new resource records
dns.DeleteZoneRecords(domainName, resourceRecords.ToArray());
}
return 0;