MX NS Scheduler tasks fixes

This commit is contained in:
vfedosevich 2014-12-10 01:48:18 -08:00
parent 72a4c0d1ff
commit 7d753484d9
19 changed files with 619 additions and 143 deletions

View file

@ -6154,39 +6154,46 @@ GO
-- Domain lookup tasks
--IF NOT EXISTS (SELECT * FROM [dbo].[ScheduleTasks] WHERE [TaskID] = N'SCHEDULE_TASK_DOMAIN_LOOKUP')
--BEGIN
--INSERT [dbo].[ScheduleTasks] ([TaskID], [TaskType], [RoleID]) VALUES (N'SCHEDULE_TASK_DOMAIN_LOOKUP', N'WebsitePanel.EnterpriseServer.DomainLookupViewTask, WebsitePanel.EnterpriseServer.Code', 1)
--END
--GO
IF NOT EXISTS (SELECT * FROM [dbo].[ScheduleTasks] WHERE [TaskID] = N'SCHEDULE_TASK_DOMAIN_LOOKUP')
BEGIN
INSERT [dbo].[ScheduleTasks] ([TaskID], [TaskType], [RoleID]) VALUES (N'SCHEDULE_TASK_DOMAIN_LOOKUP', N'WebsitePanel.EnterpriseServer.DomainLookupViewTask, WebsitePanel.EnterpriseServer.Code', 1)
END
GO
--IF NOT EXISTS (SELECT * FROM [dbo].[ScheduleTaskViewConfiguration] WHERE [TaskID] = N'SCHEDULE_TASK_DOMAIN_LOOKUP')
--BEGIN
--INSERT [dbo].[ScheduleTaskViewConfiguration] ([TaskID], [ConfigurationID], [Environment], [Description]) VALUES (N'SCHEDULE_TASK_DOMAIN_LOOKUP', N'ASP_NET', N'ASP.NET', N'~/DesktopModules/WebsitePanel/ScheduleTaskControls/DomainLookupView.ascx')
--END
--GO
IF NOT EXISTS (SELECT * FROM [dbo].[ScheduleTaskViewConfiguration] WHERE [TaskID] = N'SCHEDULE_TASK_DOMAIN_LOOKUP')
BEGIN
INSERT [dbo].[ScheduleTaskViewConfiguration] ([TaskID], [ConfigurationID], [Environment], [Description]) VALUES (N'SCHEDULE_TASK_DOMAIN_LOOKUP', N'ASP_NET', N'ASP.NET', N'~/DesktopModules/WebsitePanel/ScheduleTaskControls/DomainLookupView.ascx')
END
GO
--IF NOT EXISTS (SELECT * FROM [dbo].[ScheduleTaskParameters] WHERE [TaskID] = N'SCHEDULE_TASK_DOMAIN_LOOKUP' AND [ParameterID]= N'DNS_SERVERS' )
--BEGIN
--INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_DOMAIN_LOOKUP', N'DNS_SERVERS', N'String', NULL, 1)
--END
--GO
IF NOT EXISTS (SELECT * FROM [dbo].[ScheduleTaskParameters] WHERE [TaskID] = N'SCHEDULE_TASK_DOMAIN_LOOKUP' AND [ParameterID]= N'DNS_SERVERS' )
BEGIN
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_DOMAIN_LOOKUP', N'DNS_SERVERS', N'String', NULL, 1)
END
GO
--IF NOT EXISTS (SELECT * FROM [dbo].[ScheduleTaskParameters] WHERE [TaskID] = N'SCHEDULE_TASK_DOMAIN_LOOKUP' AND [ParameterID]= N'MAIL_TO' )
--BEGIN
--INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_DOMAIN_LOOKUP', N'MAIL_TO', N'String', NULL, 2)
--END
--GO
IF NOT EXISTS (SELECT * FROM [dbo].[ScheduleTaskParameters] WHERE [TaskID] = N'SCHEDULE_TASK_DOMAIN_LOOKUP' AND [ParameterID]= N'MAIL_TO' )
BEGIN
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_DOMAIN_LOOKUP', N'MAIL_TO', N'String', NULL, 2)
END
GO
-- Domain Expiration Task
IF NOT EXISTS (SELECT * FROM [dbo].[ScheduleTasks] WHERE [TaskID] = N'SCHEDULE_TASK_DOMAIN_EXPIRATION')
BEGIN
INSERT [dbo].[ScheduleTasks] ([TaskID], [TaskType], [RoleID]) VALUES (N'SCHEDULE_TASK_DOMAIN_EXPIRATION', N'WebsitePanel.EnterpriseServer.DomainExpirationTask, WebsitePanel.EnterpriseServer.Code', 1)
INSERT [dbo].[ScheduleTasks] ([TaskID], [TaskType], [RoleID]) VALUES (N'SCHEDULE_TASK_DOMAIN_EXPIRATION', N'WebsitePanel.EnterpriseServer.DomainExpirationTask, WebsitePanel.EnterpriseServer.Code', 3)
END
GO
IF EXISTS (SELECT * FROM [dbo].[ScheduleTasks] WHERE [TaskID] = N'SCHEDULE_TASK_DOMAIN_EXPIRATION' AND [RoleID] = 1)
BEGIN
UPDATE [dbo].[ScheduleTasks] SET [RoleID] = 3 WHERE [TaskID] = N'SCHEDULE_TASK_DOMAIN_EXPIRATION'
END
GO
IF NOT EXISTS (SELECT * FROM [dbo].[ScheduleTaskViewConfiguration] WHERE [TaskID] = N'SCHEDULE_TASK_DOMAIN_EXPIRATION')
BEGIN
INSERT [dbo].[ScheduleTaskViewConfiguration] ([TaskID], [ConfigurationID], [Environment], [Description]) VALUES (N'SCHEDULE_TASK_DOMAIN_EXPIRATION', N'ASP_NET', N'ASP.NET', N'~/DesktopModules/WebsitePanel/ScheduleTaskControls/DomainExpirationView.ascx')
@ -6366,6 +6373,139 @@ END
GO
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'DomainLookupLetter' AND [PropertyName]= N'CC' )
BEGIN
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'DomainLookupLetter', N'CC', N'support@HostingCompany.com')
END
GO
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'DomainLookupLetter' AND [PropertyName]= N'From' )
BEGIN
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'DomainLookupLetter', N'From', N'support@HostingCompany.com')
END
GO
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'DomainLookupLetter' AND [PropertyName]= N'HtmlBody' )
BEGIN
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'DomainLookupLetter', N'HtmlBody', N'<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>MX and NS Changes 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 Changes Information
</div>
<ad:if test="#user#">
<p>
Hello #user.FirstName#,
</p>
</ad:if>
<p>
Please, find below details of MX and NS changes.
</p>
<ad:foreach collection="#Domains#" var="Domain" index="i">
<h2>#Domain.DomainName#</h2>
<table>
<thead>
<tr>
<th>DNS</th>
<th>Type</th>
<th>Status</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<ad:foreach collection="#Domain.DnsChanges#" var="DnsChange" index="j">
<tr>
<td>#DnsChange.DnsServer#</td>
<td>#DnsChange.Type#</td>
<td>#DnsChange.Status#</td>
<td>#DnsChange.Record.Value#</td>
</tr>
</ad:foreach>
</tbody>
</table>
</ad:foreach>
<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>')
END
GO
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'DomainLookupLetter' AND [PropertyName]= N'Priority' )
BEGIN
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'DomainLookupLetter', N'Priority', N'Normal')
END
GO
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'DomainLookupLetter' AND [PropertyName]= N'Subject' )
BEGIN
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'DomainLookupLetter', N'Subject', N'MX and NS changes notification')
END
GO
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'DomainLookupLetter' AND [PropertyName]= N'TextBody' )
BEGIN
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'DomainLookupLetter', N'TextBody', N'=================================
MX and NS Changes Information
=================================
<ad:if test="#user#">
<p>
Hello #user.FirstName#,
</p>
</ad:if>
Please, find below details of your domain expiration information.
<ad:foreach collection="#Domains#" var="Domain" index="i">
#Domain.DomainName#
<ad:foreach collection="#Domain.DnsChanges#" var="DnsChange" index="j">
DNS: #DnsChange.DnsServer#
Type: #DnsChange.Type#
Status: #DnsChange.Status#
Value: #DnsChange.Record.Value#
</ad:foreach>
</ad:foreach>
If you have any questions regarding your hosting account, feel free to contact our support department at any time.
Best regards
')
END
GO
-- Procedures for Domain lookup service
IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetAllPackages')

View file

@ -46,6 +46,7 @@ namespace WebsitePanel.EnterpriseServer
public const string ORGANIZATION_USER_SUMMARY_LETTER = "OrganizationUserSummaryLetter";
public const string VPS_SUMMARY_LETTER = "VpsSummaryLetter";
public const string DOMAIN_EXPIRATION_LETTER = "DomainExpirationLetter";
public const string DOMAIN_LOOKUP_LETTER = "DomainLookupLetter";
public const string WEB_POLICY = "WebPolicy";
public const string FTP_POLICY = "FtpPolicy";
public const string MAIL_POLICY = "MailPolicy";

View file

@ -4732,7 +4732,7 @@ namespace WebsitePanel.EnterpriseServer
);
}
public static IDataReader GetDomainMXRecords(int domainId, DnsRecordType recordType)
public static IDataReader GetDomainDnsRecords(int domainId, DnsRecordType recordType)
{
return SqlHelper.ExecuteReader(
ConnectionString,

View file

@ -27,6 +27,7 @@ namespace WebsitePanel.EnterpriseServer
{
BackgroundTask topTask = TaskManager.TopTask;
var domainUsers = new Dictionary<int, UserInfo>();
var checkedDomains = new List<int>();
// get input parameters
int daysBeforeNotify;
@ -65,6 +66,13 @@ namespace WebsitePanel.EnterpriseServer
foreach (var domain in domains)
{
if (checkedDomains.Contains(domain.DomainId))
{
continue;
}
checkedDomains.Add(domain.DomainId);
ServerController.UpdateDomainRegistrationData(domain);
if (CheckDomainExpiration(domain.ExpirationDate, daysBeforeNotify))

View file

@ -1,6 +1,8 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Net.Mail;
using System.Text;
using WebsitePanel.Providers.DNS;
using WebsitePanel.Providers.DomainLookup;
@ -22,7 +24,7 @@ namespace WebsitePanel.EnterpriseServer
{
BackgroundTask topTask = TaskManager.TopTask;
List<DomainChanges> domainsChanges = new List<DomainChanges>();
List<DomainDnsChanges> domainsChanges = new List<DomainDnsChanges>();
// get input parameters
string dnsServersString = (string)topTask.GetParamValue(DnsServersParameter);
@ -34,6 +36,14 @@ namespace WebsitePanel.EnterpriseServer
return;
}
if (String.IsNullOrEmpty((string)topTask.GetParamValue("MAIL_TO")))
{
TaskManager.WriteWarning("The e-mail message has not been sent because 'Mail To' is empty.");
return;
}
var user = UserController.GetUser(topTask.UserId);
var dnsServers = dnsServersString.Split(';');
var packages = ObjectUtils.CreateListFromDataReader<PackageInfo>(DataProvider.GetAllPackages());
@ -48,11 +58,16 @@ namespace WebsitePanel.EnterpriseServer
foreach (var domain in domains)
{
DomainChanges domainChanges = new DomainChanges();
domainChanges.Domain = domain.DomainName;
if (domainsChanges.Any(x => x.DomainName == domain.DomainName))
{
continue;
}
var mxRecords = ObjectUtils.CreateListFromDataReader<DnsRecordInfo>(DataProvider.GetDomainMXRecords(domain.DomainId, DnsRecordType.MX));
var nsRecords = ObjectUtils.CreateListFromDataReader<DnsRecordInfo>(DataProvider.GetDomainMXRecords(domain.DomainId, DnsRecordType.NS));
DomainDnsChanges domainChanges = new DomainDnsChanges();
domainChanges.DomainName = domain.DomainName;
var mxRecords = ObjectUtils.CreateListFromDataReader<DnsRecordInfo>(DataProvider.GetDomainDnsRecords(domain.DomainId, DnsRecordType.MX));
var nsRecords = ObjectUtils.CreateListFromDataReader<DnsRecordInfo>(DataProvider.GetDomainDnsRecords(domain.DomainId, DnsRecordType.NS));
//execute server
foreach (var dnsServer in dnsServers)
@ -63,8 +78,8 @@ namespace WebsitePanel.EnterpriseServer
FillRecordData(dnsMxRecords, domain, dnsServer);
FillRecordData(dnsNsRecords, domain, dnsServer);
domainChanges.DnsChanges.Add(ApplyDomainRecordsChanges(mxRecords, dnsMxRecords, dnsServer));
domainChanges.DnsChanges.Add(ApplyDomainRecordsChanges(nsRecords, dnsNsRecords, dnsServer));
domainChanges.DnsChanges.AddRange(ApplyDomainRecordsChanges(mxRecords, dnsMxRecords, dnsServer));
domainChanges.DnsChanges.AddRange(ApplyDomainRecordsChanges(nsRecords, dnsNsRecords, dnsServer));
}
domainsChanges.Add(domainChanges);
@ -75,7 +90,7 @@ namespace WebsitePanel.EnterpriseServer
if (changedDomains.Any())
{
SendMailMessage(changedDomains);
SendMailMessage(user,changedDomains);
}
}
@ -83,20 +98,20 @@ namespace WebsitePanel.EnterpriseServer
#region Helpers
private IEnumerable<DomainChanges> FindDomainsWithChangedRecords(IEnumerable<DomainChanges> domainsChanges)
private IEnumerable<DomainDnsChanges> FindDomainsWithChangedRecords(IEnumerable<DomainDnsChanges> domainsChanges)
{
var changedDomains = new List<DomainChanges>();
var changedDomains = new List<DomainDnsChanges>();
foreach (var domainChanges in domainsChanges)
{
var firstTimeAdditon = domainChanges.DnsChanges.All(x => x.DnsRecordsCompare.All(dns => dns.DbRecord == null));
var firstTimeAdditon = domainChanges.DnsChanges.All(x => x.Status == DomainDnsRecordStatuses.Added);
if (firstTimeAdditon)
{
continue;
}
bool isChanged = domainChanges.DnsChanges.Any(x => x.DnsRecordsCompare.Any(d => d.Status != DomainDnsRecordStatuses.NotChanged));
bool isChanged = domainChanges.DnsChanges.Any(d => d.Status != DomainDnsRecordStatuses.NotChanged);
if (isChanged)
{
@ -107,10 +122,9 @@ namespace WebsitePanel.EnterpriseServer
return changedDomains;
}
private DomainDnsRecordsChanges ApplyDomainRecordsChanges(List<DnsRecordInfo> dbRecords, List<DnsRecordInfo> dnsRecords, string dnsServer)
private IEnumerable<DnsRecordInfoChange> ApplyDomainRecordsChanges(List<DnsRecordInfo> dbRecords, List<DnsRecordInfo> dnsRecords, string dnsServer)
{
var domainRecordChanges = new DomainDnsRecordsChanges();
domainRecordChanges.DnsServer = dnsServer;
var dnsRecordChanges = new List<DnsRecordInfoChange>();
var filteredDbRecords = dbRecords.Where(x => x.DnsServer == dnsServer);
@ -120,30 +134,26 @@ namespace WebsitePanel.EnterpriseServer
if (dnsRecord != null)
{
domainRecordChanges.DnsRecordsCompare.Add(new DomainDnsRecordCompare { DbRecord = record, DnsRecord = dnsRecord, Type= record.RecordType, Status = DomainDnsRecordStatuses.NotChanged });
dnsRecordChanges.Add(new DnsRecordInfoChange { Record = record, Type = record.RecordType, Status = DomainDnsRecordStatuses.NotChanged, DnsServer = dnsServer });
dnsRecords.Remove(dnsRecord);
}
else
{
domainRecordChanges.DnsRecordsCompare.Add(new DomainDnsRecordCompare { DbRecord = record, DnsRecord = null, Type = record.RecordType, Status = DomainDnsRecordStatuses.Removed });
dnsRecordChanges.Add(new DnsRecordInfoChange { Record = record, Type = record.RecordType, Status = DomainDnsRecordStatuses.Removed, DnsServer = dnsServer });
RemoveRecord(record);
domainRecordChanges.IsChanged = true;
}
}
foreach (var record in dnsRecords)
{
domainRecordChanges.DnsRecordsCompare.Add(new DomainDnsRecordCompare { DbRecord = null, DnsRecord = record, Type = record.RecordType, Status = DomainDnsRecordStatuses.Added });
dnsRecordChanges.Add(new DnsRecordInfoChange { Record = record, Type = record.RecordType, Status = DomainDnsRecordStatuses.Added, DnsServer= dnsServer});
AddRecord(record);
domainRecordChanges.IsChanged = true;
}
return domainRecordChanges;
return dnsRecordChanges;
}
private void FillRecordData(IEnumerable<DnsRecordInfo> records, DomainInfo domain, string dnsServer)
@ -187,52 +197,37 @@ namespace WebsitePanel.EnterpriseServer
DataProvider.AddDomainDnsRecord(dnsRecord);
}
private void SendMailMessage(IEnumerable<DomainChanges> domainsChanges)
private void SendMailMessage(UserInfo user, IEnumerable<DomainDnsChanges> domainsChanges)
{
BackgroundTask topTask = TaskManager.TopTask;
var bodyTempalte = ObjectUtils.FillObjectFromDataReader<ScheduleTaskEmailTemplate>(DataProvider.GetScheduleTaskEmailTemplate(TaskId));
var domainRecordTemplate = ObjectUtils.FillObjectFromDataReader<ScheduleTaskEmailTemplate>(DataProvider.GetScheduleTaskEmailTemplate(TaskId));
UserSettings settings = UserController.GetUserSettings(user.UserId, UserSettings.DOMAIN_LOOKUP_LETTER);
string from = settings["From"];
var bcc = settings["CC"];
string subject = settings["Subject"];
string body = user.HtmlMail ? settings["HtmlBody"] : settings["TextBody"];
bool isHtml = user.HtmlMail;
MailPriority priority = MailPriority.Normal;
if (!String.IsNullOrEmpty(settings["Priority"]))
priority = (MailPriority)Enum.Parse(typeof(MailPriority), settings["Priority"], true);
// input parameters
string mailFrom = "wsp-scheduler@noreply.net";
string mailTo = (string)topTask.GetParamValue("MAIL_TO");
string mailSubject = "MX and NS notification";
if (String.IsNullOrEmpty(mailTo))
{
TaskManager.WriteWarning("The e-mail message has not been sent because 'Mail To' is empty.");
}
else
{
var tableRecords = new List<string>();
Hashtable items = new Hashtable();
foreach (var domain in domainsChanges)
{
var changes = domain.DnsChanges;
items["user"] = user;
items["Domains"] = domainsChanges;
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.Template, "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 : "-");
body = PackageController.EvaluateTemplate(body, items);
tableRecords.Add(tableRow);
}
}
}
var mailBody = Utils.ReplaceStringVariable(bodyTempalte.Template, "RecordRow", string.Join(" ", tableRecords));
// send mail message
MailHelper.SendMessage(mailFrom, mailTo, mailSubject, mailBody, true);
}
}
// send mail message
MailHelper.SendMessage(from, mailTo, bcc, subject, body, priority, isHtml);
}
#endregion
}

View file

@ -6,10 +6,10 @@ using WebsitePanel.Providers.DNS;
namespace WebsitePanel.Providers.DomainLookup
{
public class DomainDnsRecordCompare
public class DnsRecordInfoChange
{
public DnsRecordInfo DbRecord { get; set; }
public DnsRecordInfo DnsRecord { get; set; }
public string DnsServer { get; set; }
public DnsRecordInfo Record { get; set; }
public DomainDnsRecordStatuses Status { get; set; }
public DnsRecordType Type { get; set; }
}

View file

@ -1,19 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace WebsitePanel.Providers.DomainLookup
{
public class DomainChanges
{
public string Domain { get; set; }
public List<DomainDnsRecordsChanges> DnsChanges { get; set; }
public DomainChanges()
{
DnsChanges = new List<DomainDnsRecordsChanges>();
}
}
}

View file

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace WebsitePanel.Providers.DomainLookup
{
public class DomainDnsChanges
{
public string DomainName { get; set; }
public List<DnsRecordInfoChange> DnsChanges { get; set; }
public DomainDnsChanges()
{
DnsChanges = new List<DnsRecordInfoChange>();
}
}
}

View file

@ -1,21 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace WebsitePanel.Providers.DomainLookup
{
public class DomainDnsRecordsChanges
{
public string DnsServer { get; set; }
public bool IsChanged { get; set; }
public List<DomainDnsRecordCompare> DnsRecordsCompare { get; set; }
public DomainDnsRecordsChanges()
{
DnsRecordsCompare = new List<DomainDnsRecordCompare>();
}
}
}

View file

@ -1,15 +0,0 @@
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 From { get; set; }
public string Subject { get; set; }
public string Template { get; set; }
}
}

View file

@ -86,11 +86,9 @@
<Compile Include="Common\PasswdHelper.cs" />
<Compile Include="Common\WPIEntries.cs" />
<Compile Include="DomainLookup\DnsRecordInfo.cs" />
<Compile Include="DomainLookup\DomainChanges.cs" />
<Compile Include="DomainLookup\DomainDnsRecordCompare.cs" />
<Compile Include="DomainLookup\DomainDnsRecordsChanges.cs" />
<Compile Include="DomainLookup\DnsRecordInfoChange.cs" />
<Compile Include="DomainLookup\DomainDnsChanges.cs" />
<Compile Include="DomainLookup\DomainDnsRecordStatuses.cs" />
<Compile Include="DomainLookup\ScheduleTaskEmailTemplate.cs" />
<Compile Include="EnterpriseStorage\IEnterpriseStorage.cs" />
<Compile Include="HeliconZoo\IHeliconZooServer.cs" />
<Compile Include="HostedSolution\BaseReport.cs" />

View file

@ -0,0 +1,147 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="ddlPriorityItem.High" xml:space="preserve">
<value>High</value>
</data>
<data name="ddlPriorityItem.Low" xml:space="preserve">
<value>Low</value>
</data>
<data name="ddlPriorityItem.Normal" xml:space="preserve">
<value>Normal</value>
</data>
<data name="lblCC.Text" xml:space="preserve">
<value>CC:</value>
</data>
<data name="lblFrom.Text" xml:space="preserve">
<value>From:</value>
</data>
<data name="lblHtmlBody.Text" xml:space="preserve">
<value>HTML Body:</value>
</data>
<data name="lblPriority.Text" xml:space="preserve">
<value>Priority:</value>
</data>
<data name="lblSubject.Text" xml:space="preserve">
<value>Subject:</value>
</data>
<data name="lblTextBody.Text" xml:space="preserve">
<value>Text Body:</value>
</data>
</root>

View file

@ -144,4 +144,7 @@
<data name="lnkDomainExpirationLetter.Text" xml:space="preserve">
<value>Domain Expiration Letter</value>
</data>
<data name="lnkDomainLookupLetter.Text" xml:space="preserve">
<value>Domain MX and NS Letter</value>
</data>
</root>

View file

@ -0,0 +1,42 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SettingsDomainLookupLetter.ascx.cs" Inherits="WebsitePanel.Portal.SettingsDomainLookupLetter" %>
<table>
<tr>
<td class="SubHead" width="150" nowrap><asp:Label ID="lblFrom" runat="server" meta:resourcekey="lblFrom" Text="From:"></asp:Label></td>
<td class="Normal" width="100%">
<asp:TextBox ID="txtFrom" runat="server" Width="500px" CssClass="NormalTextBox"></asp:TextBox></td>
</tr>
<tr>
<td class="SubHead"><asp:Label ID="lblCC" runat="server" meta:resourcekey="lblCC" Text="CC:"></asp:Label></td>
<td class="Normal">
<asp:TextBox ID="txtCC" runat="server" Width="500px" CssClass="NormalTextBox"></asp:TextBox></td>
</tr>
<tr>
<td class="SubHead"><asp:Label ID="lblSubject" runat="server" meta:resourcekey="lblSubject" Text="Subject:"></asp:Label></td>
<td class="Normal">
<asp:TextBox ID="txtSubject" runat="server" Width="500px" CssClass="NormalTextBox"></asp:TextBox></td>
</tr>
<tr>
<td class="SubHead"><asp:Label ID="lblPriority" runat="server" meta:resourcekey="lblPriority" Text="Priority"></asp:Label></td>
<td class="Normal">
<asp:DropDownList ID="ddlPriority" runat="server" CssClass="NormalTextBox" resourcekey="ddlPriority">
<asp:ListItem Value="High">High</asp:ListItem>
<asp:ListItem Value="Normal">Normal</asp:ListItem>
<asp:ListItem Value="Low">Low</asp:ListItem>
</asp:DropDownList>
</td>
</tr>
<tr>
<td class="SubHead" colspan="2"><br /><br /><asp:Label ID="lblHtmlBody" runat="server" meta:resourcekey="lblHtmlBody" Text="HTML Body:"></asp:Label></td>
</tr>
<tr>
<td class="Normal" colspan="2">
<asp:TextBox ID="txtHtmlBody" runat="server" Rows="15" TextMode="MultiLine" Width="680px" CssClass="NormalTextBox" Wrap="false"></asp:TextBox></td>
</tr>
<tr>
<td class="SubHead" colspan="2"><br /><br /><asp:Label ID="lblTextBody" runat="server" meta:resourcekey="lblTextBody" Text="Text Body:"></asp:Label></td>
</tr>
<tr>
<td class="Normal" colspan="2">
<asp:TextBox ID="txtTextBody" runat="server" Rows="15" TextMode="MultiLine" Width="680px" CssClass="NormalTextBox" Wrap="false"></asp:TextBox></td>
</tr>
</table>

View file

@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebsitePanel.EnterpriseServer;
namespace WebsitePanel.Portal
{
public partial class SettingsDomainLookupLetter : WebsitePanelControlBase, IUserSettingsEditorControl
{
public void BindSettings(UserSettings settings)
{
txtFrom.Text = settings["From"];
txtCC.Text = settings["CC"];
txtSubject.Text = settings["Subject"];
Utils.SelectListItem(ddlPriority, settings["Priority"]);
txtHtmlBody.Text = settings["HtmlBody"];
txtTextBody.Text = settings["TextBody"];
}
public void SaveSettings(UserSettings settings)
{
settings["From"] = txtFrom.Text;
settings["CC"] = txtCC.Text;
settings["Subject"] = txtSubject.Text;
settings["Priority"] = ddlPriority.SelectedValue;
settings["HtmlBody"] = txtHtmlBody.Text;
settings["TextBody"] = txtTextBody.Text;
}
}
}

View file

@ -0,0 +1,123 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WebsitePanel.Portal {
public partial class SettingsDomainLookupLetter {
/// <summary>
/// lblFrom control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblFrom;
/// <summary>
/// txtFrom control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtFrom;
/// <summary>
/// lblCC control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblCC;
/// <summary>
/// txtCC control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtCC;
/// <summary>
/// lblSubject control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblSubject;
/// <summary>
/// txtSubject control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtSubject;
/// <summary>
/// lblPriority control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblPriority;
/// <summary>
/// ddlPriority control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.DropDownList ddlPriority;
/// <summary>
/// lblHtmlBody control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblHtmlBody;
/// <summary>
/// txtHtmlBody control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtHtmlBody;
/// <summary>
/// lblTextBody control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblTextBody;
/// <summary>
/// txtTextBody control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtTextBody;
}
}

View file

@ -34,6 +34,10 @@
<asp:HyperLink ID="lnkDomainExpirationLetter" runat="server" meta:resourcekey="lnkDomainExpirationLetter"
Text="Domain Expiration Letter" NavigateUrl='<%# GetSettingsLink("DomainExpirationLetter", "SettingsDomainExpirationLetter") %>'></asp:HyperLink>
</li>
<li>
<asp:HyperLink ID="lnkDomainLookupLetter" runat="server" meta:resourcekey="lnkDomainLookupLetter"
Text="Domain MX and NS Letter" NavigateUrl='<%# GetSettingsLink("DomainLookupLetter", "SettingsDomainLookupLetter") %>'></asp:HyperLink>
</li>
</ul>
</div>
<div class="FormFooter">

View file

@ -84,6 +84,15 @@ namespace WebsitePanel.Portal {
/// </remarks>
protected global::System.Web.UI.WebControls.HyperLink lnkDomainExpirationLetter;
/// <summary>
/// lnkDomainLookupLetter control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.HyperLink lnkDomainLookupLetter;
/// <summary>
/// btnCancel control.
/// </summary>

View file

@ -314,6 +314,13 @@
<Compile Include="SettingsDomainExpirationLetter.ascx.designer.cs">
<DependentUpon>SettingsDomainExpirationLetter.ascx</DependentUpon>
</Compile>
<Compile Include="SettingsDomainLookupLetter.ascx.cs">
<DependentUpon>SettingsDomainLookupLetter.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="SettingsDomainLookupLetter.ascx.designer.cs">
<DependentUpon>SettingsDomainLookupLetter.ascx</DependentUpon>
</Compile>
<Compile Include="SettingsServiceLevels.ascx.cs">
<DependentUpon>SettingsServiceLevels.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@ -4269,6 +4276,7 @@
<Content Include="RDS\UserControls\RDSCollectionUsers.ascx" />
<Content Include="ScheduleTaskControls\App_LocalResources\DomainExpirationView.ascx.resx" />
<Content Include="App_LocalResources\SettingsDomainExpirationLetter.ascx.resx" />
<Content Include="App_LocalResources\SettingsDomainLookupLetter.ascx.resx" />
<EmbeddedResource Include="ScheduleTaskControls\App_LocalResources\DomainLookupView.ascx.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>DomainLookupView.ascx.Designer.cs</LastGenOutput>
@ -4276,6 +4284,7 @@
<Content Include="ScheduleTaskControls\DomainExpirationView.ascx" />
<Content Include="ScheduleTaskControls\DomainLookupView.ascx" />
<Content Include="SettingsDomainExpirationLetter.ascx" />
<Content Include="SettingsDomainLookupLetter.ascx" />
<Content Include="SettingsServiceLevels.ascx" />
<Content Include="CRM\CRMStorageSettings.ascx" />
<Content Include="ExchangeServer\EnterpriseStorageCreateDriveMap.ascx" />