Mx and ns scheduled tasks fixes
This commit is contained in:
parent
5c239f0933
commit
133de4b747
8 changed files with 197 additions and 39 deletions
|
@ -6130,8 +6130,112 @@ REFERENCES [dbo].[Domains] ([DomainID])
|
||||||
ON DELETE CASCADE
|
ON DELETE CASCADE
|
||||||
GO
|
GO
|
||||||
|
|
||||||
|
IF EXISTS (SELECT * FROM SYS.TABLES WHERE name = 'ScheduleTasksEmailTemplates')
|
||||||
|
DROP TABLE ScheduleTasksEmailTemplates
|
||||||
|
GO
|
||||||
|
CREATE TABLE ScheduleTasksEmailTemplates
|
||||||
|
(
|
||||||
|
[TaskID] [nvarchar](100) NOT NULL,
|
||||||
|
[ParameterID] [nvarchar](100) NOT NULL,
|
||||||
|
[Value] [nvarchar](Max) NULL
|
||||||
|
)
|
||||||
|
GO
|
||||||
|
|
||||||
|
IF NOT EXISTS (SELECT * FROM [dbo].[ScheduleTasksEmailTemplates] WHERE [TaskID] = N'SCHEDULE_TASK_DOMAIN_LOOKUP' AND [ParameterID]= N'MAIL_BODY' )
|
||||||
|
BEGIN
|
||||||
|
INSERT [dbo].[ScheduleTasksEmailTemplates] ([TaskID], [ParameterID], [Value]) VALUES (N'SCHEDULE_TASK_DOMAIN_LOOKUP', N'MAIL_BODY', N'<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<title>Account Summary Information</title>
|
||||||
|
<style type="text/css">
|
||||||
|
.Summary { background-color: #ffffff; padding: 5px; }
|
||||||
|
.Summary .Header { padding: 10px 0px 10px 10px; font-size: 16pt; background-color: #E5F2FF; color: #1F4978; border-bottom: solid 2px #86B9F7; }
|
||||||
|
.Summary A { color: #0153A4; }
|
||||||
|
.Summary { font-family: Tahoma; font-size: 9pt; }
|
||||||
|
.Summary H1 { font-size: 1.7em; color: #1F4978; border-bottom: dotted 3px #efefef; }
|
||||||
|
.Summary H2 { font-size: 1.3em; color: #1F4978; }
|
||||||
|
.Summary TABLE { border: solid 1px #e5e5e5; }
|
||||||
|
.Summary TH,
|
||||||
|
.Summary TD.Label { padding: 5px; font-size: 8pt; font-weight: bold; background-color: #f5f5f5; }
|
||||||
|
.Summary TD { padding: 8px; font-size: 9pt; }
|
||||||
|
.Summary UL LI { font-size: 1.1em; font-weight: bold; }
|
||||||
|
.Summary UL UL LI { font-size: 0.9em; font-weight: normal; }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="Summary">
|
||||||
|
|
||||||
|
<a name="top"></a>
|
||||||
|
<div class="Header">
|
||||||
|
MX and NS Information
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Hello!,
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Please, find below details for mx and ns changes.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Domain</th>
|
||||||
|
<th>DNS</th>
|
||||||
|
<th>Record Type</th>
|
||||||
|
<th>DataBase Value</th>
|
||||||
|
<th>Dns Value</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
[RecordRow]
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
<p>
|
||||||
|
If you have any questions regarding your hosting account, feel free to contact our support department at any time.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<p>
|
||||||
|
Best regards
|
||||||
|
</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>')
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
IF NOT EXISTS (SELECT * FROM [dbo].[ScheduleTasksEmailTemplates] WHERE [TaskID] = N'SCHEDULE_TASK_DOMAIN_LOOKUP' AND [ParameterID]= N'MAIL_DOMAIN_RECORD' )
|
||||||
|
BEGIN
|
||||||
|
INSERT [dbo].[ScheduleTasksEmailTemplates] ([TaskID], [ParameterID], [Value]) VALUES (N'SCHEDULE_TASK_DOMAIN_LOOKUP', N'MAIL_DOMAIN_RECORD',N'<tr>
|
||||||
|
<td>[domain]</td>
|
||||||
|
<td>[dns]</td>
|
||||||
|
<td>[recordType]</td>
|
||||||
|
<td>[dbRecord]</td>
|
||||||
|
<td>[dnsRecord]</td>
|
||||||
|
</tr>')
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
-- Procedures for Domai lookup service
|
-- Procedures for Domai lookup service
|
||||||
|
|
||||||
|
IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetScheduleTaskEmailTemplate')
|
||||||
|
DROP PROCEDURE GetScheduleTaskEmailTemplate
|
||||||
|
GO
|
||||||
|
CREATE PROCEDURE [dbo].GetScheduleTaskEmailTemplate
|
||||||
|
(
|
||||||
|
@TaskID [nvarchar](100) ,
|
||||||
|
@ParameterID [nvarchar](100)
|
||||||
|
)
|
||||||
|
AS
|
||||||
|
SELECT
|
||||||
|
[TaskID] ,
|
||||||
|
[ParameterID],
|
||||||
|
[Value]
|
||||||
|
FROM [dbo].[ScheduleTasksEmailTemplates] where [TaskID] = @TaskID AND [ParameterID] = @ParameterID
|
||||||
|
GO
|
||||||
|
|
||||||
IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetAllPackageIds')
|
IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetAllPackageIds')
|
||||||
DROP PROCEDURE GetAllPackageIds
|
DROP PROCEDURE GetAllPackageIds
|
||||||
|
|
|
@ -4743,9 +4743,9 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IDataReader AddDomainDnsRecord(DnsRecordInfo domainDnsRecord)
|
public static void AddDomainDnsRecord(DnsRecordInfo domainDnsRecord)
|
||||||
{
|
{
|
||||||
return SqlHelper.ExecuteReader(
|
SqlHelper.ExecuteReader(
|
||||||
ConnectionString,
|
ConnectionString,
|
||||||
CommandType.StoredProcedure,
|
CommandType.StoredProcedure,
|
||||||
"AddDomainDnsRecord",
|
"AddDomainDnsRecord",
|
||||||
|
@ -4757,9 +4757,20 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IDataReader DeleteDomainDnsRecord(int id)
|
public static IDataReader GetScheduleTaskEmailTemplate(string taskId, string parameterId)
|
||||||
{
|
{
|
||||||
return SqlHelper.ExecuteReader(
|
return SqlHelper.ExecuteReader(
|
||||||
|
ConnectionString,
|
||||||
|
CommandType.StoredProcedure,
|
||||||
|
"GetScheduleTaskEmailTemplate",
|
||||||
|
new SqlParameter("@taskId", taskId),
|
||||||
|
new SqlParameter("@parameterId", parameterId)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void DeleteDomainDnsRecord(int id)
|
||||||
|
{
|
||||||
|
SqlHelper.ExecuteReader(
|
||||||
ConnectionString,
|
ConnectionString,
|
||||||
CommandType.StoredProcedure,
|
CommandType.StoredProcedure,
|
||||||
"DeleteDomainDnsRecord",
|
"DeleteDomainDnsRecord",
|
||||||
|
|
|
@ -9,10 +9,15 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
{
|
{
|
||||||
public class DomainLookupViewTask : SchedulerTask
|
public class DomainLookupViewTask : SchedulerTask
|
||||||
{
|
{
|
||||||
|
private static readonly string TaskId = "SCHEDULE_TASK_DOMAIN_LOOKUP";
|
||||||
|
|
||||||
// Input parameters:
|
// Input parameters:
|
||||||
private static readonly string DnsServersParameter = "DNS_SERVERS";
|
private static readonly string DnsServersParameter = "DNS_SERVERS";
|
||||||
private static readonly string MailToParameter = "MAIL_TO";
|
private static readonly string MailToParameter = "MAIL_TO";
|
||||||
|
|
||||||
|
private static readonly string MailBodyTemplateParameter = "MAIL_BODY";
|
||||||
|
private static readonly string MailBodyDomainRecordTemplateParameter = "MAIL_DOMAIN_RECORD";
|
||||||
|
|
||||||
public override void DoWork()
|
public override void DoWork()
|
||||||
{
|
{
|
||||||
BackgroundTask topTask = TaskManager.TopTask;
|
BackgroundTask topTask = TaskManager.TopTask;
|
||||||
|
@ -57,6 +62,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
foreach (var domain in domains)
|
foreach (var domain in domains)
|
||||||
{
|
{
|
||||||
DomainChanges domainChanges = new DomainChanges();
|
DomainChanges domainChanges = new DomainChanges();
|
||||||
|
domainChanges.Domain = domain.DomainName;
|
||||||
|
|
||||||
var mxRecords = ObjectUtils.CreateListFromDataReader<DnsRecordInfo>(DataProvider.GetDomainMXRecords(domain.DomainId, DnsRecordType.MX));
|
var mxRecords = ObjectUtils.CreateListFromDataReader<DnsRecordInfo>(DataProvider.GetDomainMXRecords(domain.DomainId, DnsRecordType.MX));
|
||||||
var nsRecords = ObjectUtils.CreateListFromDataReader<DnsRecordInfo>(DataProvider.GetDomainMXRecords(domain.DomainId, DnsRecordType.NS));
|
var nsRecords = ObjectUtils.CreateListFromDataReader<DnsRecordInfo>(DataProvider.GetDomainMXRecords(domain.DomainId, DnsRecordType.NS));
|
||||||
|
@ -70,8 +76,8 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
FillRecordData(dnsMxRecords, domain, dnsServer);
|
FillRecordData(dnsMxRecords, domain, dnsServer);
|
||||||
FillRecordData(dnsNsRecords, domain, dnsServer);
|
FillRecordData(dnsNsRecords, domain, dnsServer);
|
||||||
|
|
||||||
domainChanges.MxChanges.Add(ApplyDomainRecordsChanges(mxRecords, dnsMxRecords, dnsServer));
|
domainChanges.DnsChanges.Add(ApplyDomainRecordsChanges(mxRecords, dnsMxRecords, dnsServer));
|
||||||
domainChanges.NsChanges.Add(ApplyDomainRecordsChanges(nsRecords, dnsNsRecords, dnsServer));
|
domainChanges.DnsChanges.Add(ApplyDomainRecordsChanges(nsRecords, dnsNsRecords, dnsServer));
|
||||||
}
|
}
|
||||||
|
|
||||||
domainsChanges.Add(domainChanges);
|
domainsChanges.Add(domainChanges);
|
||||||
|
@ -96,18 +102,16 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
|
|
||||||
foreach (var domainChanges in domainsChanges)
|
foreach (var domainChanges in domainsChanges)
|
||||||
{
|
{
|
||||||
var firstTimeAdditon = domainChanges.MxChanges.All(x => x.DnsRecordsCompare.All(dns => dns.DbRecord == null))
|
var firstTimeAdditon = domainChanges.DnsChanges.All(x => x.DnsRecordsCompare.All(dns => dns.DbRecord == null));
|
||||||
&& domainChanges.NsChanges.All(x => x.DnsRecordsCompare.All(dns => dns.DbRecord == null));
|
|
||||||
|
|
||||||
if (firstTimeAdditon)
|
if (firstTimeAdditon)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool mxIsChanged = domainChanges.MxChanges.Any(x => x.DnsRecordsCompare.Any(d => d.Status != DomainDnsRecordStatuses.NotChanged));
|
bool isChanged = domainChanges.DnsChanges.Any(x => x.DnsRecordsCompare.Any(d => d.Status != DomainDnsRecordStatuses.NotChanged));
|
||||||
bool nsIsChanged = domainChanges.NsChanges.Any(x => x.DnsRecordsCompare.Any(d => d.Status != DomainDnsRecordStatuses.NotChanged));
|
|
||||||
|
|
||||||
if (mxIsChanged || nsIsChanged)
|
if (isChanged)
|
||||||
{
|
{
|
||||||
changedDomains.Add(domainChanges);
|
changedDomains.Add(domainChanges);
|
||||||
}
|
}
|
||||||
|
@ -129,13 +133,13 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
|
|
||||||
if (dnsRecord != null)
|
if (dnsRecord != null)
|
||||||
{
|
{
|
||||||
domainRecordChanges.DnsRecordsCompare.Add(new DomainDnsRecordCompare { DbRecord = record, DnsRecord = dnsRecord, Status = DomainDnsRecordStatuses.NotChanged });
|
domainRecordChanges.DnsRecordsCompare.Add(new DomainDnsRecordCompare { DbRecord = record, DnsRecord = dnsRecord, Type= record.RecordType, Status = DomainDnsRecordStatuses.NotChanged });
|
||||||
|
|
||||||
dnsRecords.Remove(dnsRecord);
|
dnsRecords.Remove(dnsRecord);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
domainRecordChanges.DnsRecordsCompare.Add(new DomainDnsRecordCompare { DbRecord = record, DnsRecord = null, Status = DomainDnsRecordStatuses.Removed });
|
domainRecordChanges.DnsRecordsCompare.Add(new DomainDnsRecordCompare { DbRecord = record, DnsRecord = null, Type = record.RecordType, Status = DomainDnsRecordStatuses.Removed });
|
||||||
|
|
||||||
RemoveRecord(record);
|
RemoveRecord(record);
|
||||||
|
|
||||||
|
@ -145,7 +149,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
|
|
||||||
foreach (var record in dnsRecords)
|
foreach (var record in dnsRecords)
|
||||||
{
|
{
|
||||||
domainRecordChanges.DnsRecordsCompare.Add(new DomainDnsRecordCompare { DbRecord = null, DnsRecord = record, Status = DomainDnsRecordStatuses.Added });
|
domainRecordChanges.DnsRecordsCompare.Add(new DomainDnsRecordCompare { DbRecord = null, DnsRecord = record, Type = record.RecordType, Status = DomainDnsRecordStatuses.Added });
|
||||||
|
|
||||||
AddRecord(record);
|
AddRecord(record);
|
||||||
|
|
||||||
|
@ -200,11 +204,13 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
{
|
{
|
||||||
BackgroundTask topTask = TaskManager.TopTask;
|
BackgroundTask topTask = TaskManager.TopTask;
|
||||||
|
|
||||||
|
var bodyTempalte = ObjectUtils.FillObjectFromDataReader<ScheduleTaskEmailTemplate>(DataProvider.GetScheduleTaskEmailTemplate(TaskId, MailBodyTemplateParameter));
|
||||||
|
var domainRecordTemplate = ObjectUtils.FillObjectFromDataReader<ScheduleTaskEmailTemplate>(DataProvider.GetScheduleTaskEmailTemplate(TaskId, MailBodyDomainRecordTemplateParameter));
|
||||||
|
|
||||||
// input parameters
|
// input parameters
|
||||||
string mailFrom = "wsp@scheduler.noreply";
|
string mailFrom = "wsp-scheduler@noreply.net";
|
||||||
string mailTo = (string)topTask.GetParamValue("MAIL_TO");
|
string mailTo = (string)topTask.GetParamValue("MAIL_TO");
|
||||||
string mailSubject = "WSP MX and NS notification";
|
string mailSubject = "MX and NS notification";
|
||||||
string mailBody = "Hello!<br><br>";
|
|
||||||
|
|
||||||
if (String.IsNullOrEmpty(mailTo))
|
if (String.IsNullOrEmpty(mailTo))
|
||||||
{
|
{
|
||||||
|
@ -212,8 +218,32 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
var tableRecords = new List<string>();
|
||||||
|
|
||||||
|
foreach (var domain in domainsChanges)
|
||||||
|
{
|
||||||
|
var changes = domain.DnsChanges;
|
||||||
|
|
||||||
|
foreach (var dnsChanged in changes.Where(x=>x.IsChanged))
|
||||||
|
{
|
||||||
|
foreach (var record in dnsChanged.DnsRecordsCompare.Where(x=>x.Status != DomainDnsRecordStatuses.NotChanged))
|
||||||
|
{
|
||||||
|
var tableRow = Utils.ReplaceStringVariable(domainRecordTemplate.Value, "domain", domain.Domain);
|
||||||
|
tableRow = Utils.ReplaceStringVariable(tableRow, "dns", dnsChanged.DnsServer);
|
||||||
|
tableRow = Utils.ReplaceStringVariable(tableRow, "recordType", record.Type.ToString());
|
||||||
|
tableRow = Utils.ReplaceStringVariable(tableRow, "dbRecord", record.DbRecord != null ? record.DbRecord.Value : "-");
|
||||||
|
tableRow = Utils.ReplaceStringVariable(tableRow, "dnsRecord", record.DnsRecord != null ? record.DnsRecord.Value : "-");
|
||||||
|
|
||||||
|
tableRecords.Add(tableRow);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var mailBody = Utils.ReplaceStringVariable(bodyTempalte.Value, "RecordRow", string.Join(" ", tableRecords));
|
||||||
|
|
||||||
// send mail message
|
// send mail message
|
||||||
// MailHelper.SendMessage(mailFrom, mailTo, mailSubject, mailBody, false);
|
MailHelper.SendMessage(mailFrom, mailTo, mailSubject, mailBody, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,13 +9,11 @@ namespace WebsitePanel.Providers.DomainLookup
|
||||||
{
|
{
|
||||||
public string Domain { get; set; }
|
public string Domain { get; set; }
|
||||||
|
|
||||||
public List<DomainDnsRecordsChanges> MxChanges { get; set; }
|
public List<DomainDnsRecordsChanges> DnsChanges { get; set; }
|
||||||
public List<DomainDnsRecordsChanges> NsChanges { get; set; }
|
|
||||||
|
|
||||||
public DomainChanges()
|
public DomainChanges()
|
||||||
{
|
{
|
||||||
MxChanges = new List<DomainDnsRecordsChanges>();
|
DnsChanges = new List<DomainDnsRecordsChanges>();
|
||||||
NsChanges = new List<DomainDnsRecordsChanges>();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using WebsitePanel.Providers.DNS;
|
||||||
|
|
||||||
namespace WebsitePanel.Providers.DomainLookup
|
namespace WebsitePanel.Providers.DomainLookup
|
||||||
{
|
{
|
||||||
|
@ -10,5 +11,6 @@ namespace WebsitePanel.Providers.DomainLookup
|
||||||
public DnsRecordInfo DbRecord { get; set; }
|
public DnsRecordInfo DbRecord { get; set; }
|
||||||
public DnsRecordInfo DnsRecord { get; set; }
|
public DnsRecordInfo DnsRecord { get; set; }
|
||||||
public DomainDnsRecordStatuses Status { get; set; }
|
public DomainDnsRecordStatuses Status { get; set; }
|
||||||
|
public DnsRecordType Type { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace WebsitePanel.Providers.DomainLookup
|
||||||
|
{
|
||||||
|
public class ScheduleTaskEmailTemplate
|
||||||
|
{
|
||||||
|
public string TaskId { get; set; }
|
||||||
|
public string ParameterID { get; set; }
|
||||||
|
public string Value { get; set; }
|
||||||
|
}
|
||||||
|
}
|
|
@ -90,6 +90,7 @@
|
||||||
<Compile Include="DomainLookup\DomainDnsRecordCompare.cs" />
|
<Compile Include="DomainLookup\DomainDnsRecordCompare.cs" />
|
||||||
<Compile Include="DomainLookup\DomainDnsRecordsChanges.cs" />
|
<Compile Include="DomainLookup\DomainDnsRecordsChanges.cs" />
|
||||||
<Compile Include="DomainLookup\DomainDnsRecordStatuses.cs" />
|
<Compile Include="DomainLookup\DomainDnsRecordStatuses.cs" />
|
||||||
|
<Compile Include="DomainLookup\ScheduleTaskEmailTemplate.cs" />
|
||||||
<Compile Include="EnterpriseStorage\IEnterpriseStorage.cs" />
|
<Compile Include="EnterpriseStorage\IEnterpriseStorage.cs" />
|
||||||
<Compile Include="HeliconZoo\IHeliconZooServer.cs" />
|
<Compile Include="HeliconZoo\IHeliconZooServer.cs" />
|
||||||
<Compile Include="HostedSolution\BaseReport.cs" />
|
<Compile Include="HostedSolution\BaseReport.cs" />
|
||||||
|
|
|
@ -322,19 +322,22 @@ namespace WebsitePanel.Providers.OS
|
||||||
{
|
{
|
||||||
foreach (var dnsRecordPs in dnsRecordsPs)
|
foreach (var dnsRecordPs in dnsRecordsPs)
|
||||||
{
|
{
|
||||||
DnsRecordInfo newRecord;
|
DnsRecordInfo newRecord = null;
|
||||||
|
|
||||||
switch (recordType)
|
switch (recordType)
|
||||||
{
|
{
|
||||||
case DnsRecordType.MX: { newRecord = CreateMxDnsRecordFromPsObject(dnsRecordPs); break; }
|
case DnsRecordType.MX: { newRecord = CreateDnsRecordFromPsObject(dnsRecordPs, "NameExchange"); break; }
|
||||||
case DnsRecordType.NS: { newRecord = CreateNsDnsRecordFromPsObject(dnsRecordPs); break; }
|
case DnsRecordType.NS: { newRecord = CreateDnsRecordFromPsObject(dnsRecordPs, "NameHost"); break; }
|
||||||
default: continue;
|
default: continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
newRecord.DnsServer = dnsServer;
|
if (newRecord != null)
|
||||||
newRecord.RecordType = recordType;
|
{
|
||||||
|
newRecord.DnsServer = dnsServer;
|
||||||
|
newRecord.RecordType = recordType;
|
||||||
|
|
||||||
records.Add(newRecord);
|
records.Add(newRecord);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -347,21 +350,16 @@ namespace WebsitePanel.Providers.OS
|
||||||
return records.ToArray();
|
return records.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
private DnsRecordInfo CreateMxDnsRecordFromPsObject(PSObject psObject)
|
private DnsRecordInfo CreateDnsRecordFromPsObject(PSObject psObject, string valueName)
|
||||||
{
|
{
|
||||||
|
if (!psObject.Members.Any(x => x.Name == valueName))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
var dnsRecord = new DnsRecordInfo
|
var dnsRecord = new DnsRecordInfo
|
||||||
{
|
{
|
||||||
Value = Convert.ToString(GetPSObjectProperty(psObject, "NameExchange")),
|
Value = Convert.ToString(GetPSObjectProperty(psObject, valueName)),
|
||||||
};
|
|
||||||
|
|
||||||
return dnsRecord;
|
|
||||||
}
|
|
||||||
|
|
||||||
private DnsRecordInfo CreateNsDnsRecordFromPsObject(PSObject psObject)
|
|
||||||
{
|
|
||||||
var dnsRecord = new DnsRecordInfo
|
|
||||||
{
|
|
||||||
Value = Convert.ToString(GetPSObjectProperty(psObject, "NameHost")),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return dnsRecord;
|
return dnsRecord;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue