This commit is contained in:
Virtuworks 2014-12-10 11:36:30 -05:00
commit cb74e4c632
28 changed files with 788 additions and 158 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')
@ -6211,6 +6218,12 @@ INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [D
END
GO
IF NOT EXISTS (SELECT * FROM [dbo].[ScheduleTaskParameters] WHERE [TaskID] = N'SCHEDULE_TASK_DOMAIN_EXPIRATION' AND [ParameterID]= N'INCLUDE_NONEXISTEN_DOMAINS' )
BEGIN
INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_DOMAIN_EXPIRATION', N'INCLUDE_NONEXISTEN_DOMAINS', N'Boolean', N'false', 4)
END
GO
-- Domain lookup tables
@ -6247,6 +6260,13 @@ BEGIN
END
GO
IF NOT EXISTS(SELECT * FROM sys.columns
WHERE [name] = N'LastUpdateDate' AND [object_id] = OBJECT_ID(N'Domains'))
BEGIN
ALTER TABLE [dbo].[Domains] ADD LastUpdateDate DateTime null;
END
GO
IF EXISTS (SELECT * FROM SYS.TABLES WHERE name = 'ScheduleTasksEmailTemplates')
DROP TABLE ScheduleTasksEmailTemplates
GO
@ -6318,6 +6338,29 @@ Please, find below details of your domain expiration information.
</tbody>
</table>
<ad:if test="#IncludeNonExistenDomains#">
<p>
Please, find below details of your non-existen domains.
</p>
<table>
<thead>
<tr>
<th>Domain</th>
<th>Customer</th>
</tr>
</thead>
<tbody>
<ad:foreach collection="#NonExistenDomains#" var="Domain" index="i">
<tr>
<td>#Domain.DomainName#</td>
<td>#Domain.Customer#</td>
</tr>
</ad:foreach>
</tbody>
</table>
</ad:if>
<p>
If you have any questions regarding your hosting account, feel free to contact our support department at any time.
@ -6344,9 +6387,7 @@ INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [Property
Domain Expiration Information
=================================
<ad:if test="#user#">
<p>
Hello #user.FirstName#,
</p>
</ad:if>
Please, find below details of your domain expiration information.
@ -6359,6 +6400,16 @@ Please, find below details of your domain expiration information.
</ad:foreach>
<ad:if test="#IncludeNonExistenDomains#">
Please, find below details of your non-existen domains.
<ad:foreach collection="#NonExistenDomains#" var="Domain" index="i">
Domain: #Domain.DomainName#
Customer: #Domain.Customer#
</ad:foreach>
</ad:if>
If you have any questions regarding your hosting account, feel free to contact our support department at any time.
Best regards')
@ -6366,6 +6417,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')
@ -6499,6 +6683,18 @@ AS
UPDATE [dbo].[Domains] SET [ExpirationDate] = @Date WHERE [DomainID] = @DomainId
GO
IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'UpdateDomainLastUpdateDate')
DROP PROCEDURE UpdateDomainLastUpdateDate
GO
CREATE PROCEDURE [dbo].UpdateDomainLastUpdateDate
(
@DomainId INT,
@Date DateTime
)
AS
UPDATE [dbo].[Domains] SET [LastUpdateDate] = @Date WHERE [DomainID] = @DomainId
GO
--Updating Domain procedures
@ -6533,6 +6729,7 @@ SELECT
D.IsInstantAlias,
D.CreationDate,
D.ExpirationDate,
D.LastUpdateDate,
D.IsDomainPointer
FROM Domains AS D
INNER JOIN PackagesTree(@PackageID, @Recursive) AS PT ON D.PackageID = PT.PackageID
@ -6614,6 +6811,7 @@ SET @sql = @sql + ' SELECT COUNT(DomainID) FROM @Domains;SELECT
D.IsInstantAlias,
D.IsDomainPointer,
D.ExpirationDate,
D.LastUpdateDate,
P.PackageName,
ISNULL(SRV.ServerID, 0) AS ServerID,
ISNULL(SRV.ServerName, '''') AS ServerName,

View file

@ -150,5 +150,6 @@ namespace WebsitePanel.EnterpriseServer
public DateTime? CreationDate { get; set; }
public DateTime? ExpirationDate { get; set; }
public DateTime? LastUpdateDate { get; set; }
}
}

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,
@ -4787,6 +4787,11 @@ namespace WebsitePanel.EnterpriseServer
UpdateDomainDate(domainId, "UpdateDomainExpirationDate", date);
}
public static void UpdateDomainLastUpdateDate(int domainId, DateTime date)
{
UpdateDomainDate(domainId, "UpdateDomainLastUpdateDate", date);
}
private static void UpdateDomainDate(int domainId, string stroredProcedure, DateTime date)
{
SqlHelper.ExecuteReader(

View file

@ -18,6 +18,7 @@ namespace WebsitePanel.EnterpriseServer
private static readonly string DaysBeforeNotify = "DAYS_BEFORE";
private static readonly string MailToParameter = "MAIL_TO";
private static readonly string EnableNotification = "ENABLE_NOTIFICATION";
private static readonly string IncludeNonExistenDomains = "INCLUDE_NONEXISTEN_DOMAINS";
private static readonly string MailBodyTemplateParameter = "MAIL_BODY";
@ -27,16 +28,19 @@ namespace WebsitePanel.EnterpriseServer
{
BackgroundTask topTask = TaskManager.TopTask;
var domainUsers = new Dictionary<int, UserInfo>();
var checkedDomains = new List<int>();
var expiredDomains = new List<DomainInfo>();
var nonExistenDomains = new List<DomainInfo>();
// get input parameters
int daysBeforeNotify;
bool sendEmailNotifcation = Convert.ToBoolean( topTask.GetParamValue(EnableNotification));
bool includeNonExistenDomains = Convert.ToBoolean(topTask.GetParamValue(IncludeNonExistenDomains));
// check input parameters
if (String.IsNullOrEmpty((string)topTask.GetParamValue("MAIL_TO")))
{
TaskManager.WriteWarning("The e-mail message has not been sent because 'Mail To' is empty.");
return;
}
@ -46,15 +50,16 @@ namespace WebsitePanel.EnterpriseServer
var packages = GetUserPackages(user.UserId, user.Role);
var expiredDomains = new List<DomainInfo>();
foreach (var package in packages)
{
var domains = ServerController.GetDomains(package.PackageId);
domains = domains.Where(x => !x.IsSubDomain && !x.IsDomainPointer).ToList(); //Selecting top-level domains
var subDomains = domains.Where(x => x.IsSubDomain).ToList();
domains = domains.Where(x => x.CreationDate == null || x.ExpirationDate == null ? true : CheckDomainExpiration(x.ExpirationDate, daysBeforeNotify)).ToList(); // selecting expired or with empty expire date domains
var topLevelDomains = domains = domains.Where(x => !x.IsSubDomain && !x.IsDomainPointer).ToList(); //Selecting top-level domains
domains = topLevelDomains.Where(x => x.CreationDate == null || x.ExpirationDate == null ? true : CheckDomainExpiration(x.ExpirationDate, daysBeforeNotify)).ToList(); // selecting expired or with empty expire date domains
var domainUser = UserController.GetUser(package.UserId);
@ -65,12 +70,34 @@ 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))
{
expiredDomains.Add(domain);
}
if (domain.ExpirationDate == null && domain.CreationDate == null)
{
nonExistenDomains.Add(domain);
}
}
foreach (var subDomain in subDomains)
{
var mainDomain = topLevelDomains.Where(x => subDomain.DomainName.Contains(x.DomainName)).OrderByDescending(s => s.DomainName.Length).FirstOrDefault(); ;
if (mainDomain != null)
{
ServerController.UpdateDomainRegistrationData(subDomain, mainDomain.CreationDate, mainDomain.ExpirationDate);
}
}
}
@ -78,7 +105,7 @@ namespace WebsitePanel.EnterpriseServer
if (expiredDomains.Count > 0 && sendEmailNotifcation)
{
SendMailMessage(user, expiredDomains, domainUsers);
SendMailMessage(user, expiredDomains, domainUsers, nonExistenDomains, includeNonExistenDomains);
}
}
@ -113,7 +140,7 @@ namespace WebsitePanel.EnterpriseServer
return (date.Value - DateTime.Now).Days < daysBeforeNotify;
}
private void SendMailMessage(UserInfo user, IEnumerable<DomainInfo> domains, Dictionary<int, UserInfo> domainUsers)
private void SendMailMessage(UserInfo user, IEnumerable<DomainInfo> domains, Dictionary<int, UserInfo> domainUsers, IEnumerable<DomainInfo> nonExistenDomains, bool includeNonExistenDomains)
{
BackgroundTask topTask = TaskManager.TopTask;
@ -141,6 +168,15 @@ namespace WebsitePanel.EnterpriseServer
ExpirationDate = x.ExpirationDate,
Customer = string.Format("{0} {1}", domainUsers[x.PackageId].FirstName, domainUsers[x.PackageId].LastName) });
items["IncludeNonExistenDomains"] = includeNonExistenDomains;
items["NonExistenDomains"] = nonExistenDomains.Select(x => new
{
DomainName = x.DomainName,
Customer = string.Format("{0} {1}", domainUsers[x.PackageId].FirstName, domainUsers[x.PackageId].LastName)
});
body = PackageController.EvaluateTemplate(body, items);
// send mail message

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,51 +197,36 @@ 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

@ -2664,6 +2664,8 @@ namespace WebsitePanel.EnterpriseServer
{
try
{
DataProvider.UpdateDomainLastUpdateDate(domain.DomainId, DateTime.Now);
var whoisResult = WhoisClient.Query(domain.DomainName);
var createdDate = GetDomainInfoDate(whoisResult.Raw, _createdDatePatterns);
@ -2689,6 +2691,17 @@ namespace WebsitePanel.EnterpriseServer
return domain;
}
public static DomainInfo UpdateDomainRegistrationData(DomainInfo domain, DateTime? creationDate, DateTime? expirationDate)
{
domain.CreationDate = creationDate;
DataProvider.UpdateDomainCreationDate(domain.DomainId, creationDate.Value);
domain.ExpirationDate = expirationDate;
DataProvider.UpdateDomainExpirationDate(domain.DomainId, expirationDate.Value);
DataProvider.UpdateDomainLastUpdateDate(domain.DomainId, DateTime.Now);
return domain;
}
private static DateTime? GetDomainInfoDate(string raw, IEnumerable<string> patterns)
{
foreach (var createdRegex in patterns)

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

@ -207,4 +207,10 @@
<data name="gvDomainsExpirationDate.Header" xml:space="preserve">
<value>Expiration Date</value>
</data>
<data name="DomainExpirationDate.NotChecked" xml:space="preserve">
<value>Not Checked</value>
</data>
<data name="DomainExpirationDate.NotExist" xml:space="preserve">
<value>Non-Existent</value>
</data>
</root>

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

@ -40,7 +40,7 @@
<asp:TemplateField HeaderText="gvDomainsExpirationDate">
<ItemStyle Width="15%"></ItemStyle>
<ItemTemplate>
<%# GetDomainExpirationDate(Eval("ExpirationDate"))%>
<%# GetDomainExpirationDate(Eval("ExpirationDate"), Eval("LastUpdateDate"))%>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="gvDomainsType">

View file

@ -100,16 +100,27 @@ namespace WebsitePanel.Portal
return GetLocalizedString("DomainType.Domain");
}
public string GetDomainExpirationDate(object expirationDateObject)
public string GetDomainExpirationDate(object expirationDateObject, object LastUpdateDateObject)
{
var expirationDate = expirationDateObject as DateTime?;
var lastUpdateDate = LastUpdateDateObject as DateTime?;
if (expirationDate == null)
return GetLocalizedString("DomainExpirationDate.Unknown");
else if (expirationDate < DateTime.Now)
if (expirationDate != null && expirationDate < DateTime.Now)
{
return GetLocalizedString("DomainExpirationDate.Expired");
else
}
else if(expirationDate != null)
{
return expirationDate.Value.ToShortDateString();
}
else if (lastUpdateDate == null)
{
return GetLocalizedString("DomainExpirationDate.NotChecked");
}
else
{
return GetLocalizedString("DomainExpirationDate.NotExist");
}
}
protected void odsDomainsPaged_Selected(object sender, ObjectDataSourceStatusEventArgs e)

View file

@ -120,6 +120,9 @@
<data name="cbEnableNotify" xml:space="preserve">
<value>Enable Client Notification</value>
</data>
<data name="cbIncludeNonExistenDomains" xml:space="preserve">
<value>Include Non-Existen Domains</value>
</data>
<data name="lblDayBeforeNotify" xml:space="preserve">
<value>Notify before (days)</value>
</data>

View file

@ -10,6 +10,14 @@
<asp:CheckBox runat="server" ID="cbEnableNotify" meta:resourcekey="cbEnableNotify" /><br/>
</td>
</tr>
<tr>
<td class="SubHead" nowrap>
<asp:Label ID="lblSendNonExistenDomains" runat="server" meta:resourcekey="cbIncludeNonExistenDomains" Text="Include Non-Existen Domains:"></asp:Label>
</td>
<td>
<asp:CheckBox runat="server" ID="cbIncludeNonExistenDomains" meta:resourcekey="cbIncludeNonExistenDomains" /><br/>
</td>
</tr>
<tr>
<td class="SubHead" nowrap>
<asp:Label ID="lblMailTo" runat="server" meta:resourcekey="lblMailTo" Text="Mail To:"></asp:Label>

View file

@ -14,6 +14,7 @@ namespace WebsitePanel.Portal.ScheduleTaskControls
private static readonly string DaysBeforeParameter = "DAYS_BEFORE";
private static readonly string MailToParameter = "MAIL_TO";
private static readonly string EnableNotificationParameter = "ENABLE_NOTIFICATION";
private static readonly string IncludeNonExistenDomainsParameter = "INCLUDE_NONEXISTEN_DOMAINS";
protected void Page_Load(object sender, EventArgs e)
{
@ -31,6 +32,7 @@ namespace WebsitePanel.Portal.ScheduleTaskControls
this.SetParameter(this.txtDaysBeforeNotify, DaysBeforeParameter);
this.SetParameter(this.txtMailTo, MailToParameter);
this.SetParameter(this.cbEnableNotify, EnableNotificationParameter);
this.SetParameter(this.cbIncludeNonExistenDomains, IncludeNonExistenDomainsParameter);
}
/// <summary>
@ -42,8 +44,9 @@ namespace WebsitePanel.Portal.ScheduleTaskControls
ScheduleTaskParameterInfo daysBefore = this.GetParameter(this.txtDaysBeforeNotify, DaysBeforeParameter);
ScheduleTaskParameterInfo mailTo = this.GetParameter(this.txtMailTo, MailToParameter);
ScheduleTaskParameterInfo enableNotification = this.GetParameter(this.cbEnableNotify, EnableNotificationParameter);
ScheduleTaskParameterInfo includeNonExistenDomains = this.GetParameter(this.cbIncludeNonExistenDomains, IncludeNonExistenDomainsParameter);
return new ScheduleTaskParameterInfo[3] { daysBefore, mailTo, enableNotification };
return new ScheduleTaskParameterInfo[4] { daysBefore, mailTo, enableNotification, includeNonExistenDomains };
}
}
}

View file

@ -30,6 +30,24 @@ namespace WebsitePanel.Portal.ScheduleTaskControls {
/// </remarks>
protected global::System.Web.UI.WebControls.CheckBox cbEnableNotify;
/// <summary>
/// lblSendNonExistenDomains 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 lblSendNonExistenDomains;
/// <summary>
/// cbIncludeNonExistenDomains 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.CheckBox cbIncludeNonExistenDomains;
/// <summary>
/// lblMailTo control.
/// </summary>

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" />