ST added registrar name to domain expiration task
This commit is contained in:
parent
69e8644419
commit
fc83494a33
10 changed files with 260 additions and 26 deletions
|
@ -6352,6 +6352,7 @@ Please, find below details of your domain expiration information.
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Domain</th>
|
<th>Domain</th>
|
||||||
|
<th>Registrar</th>
|
||||||
<th>Customer</th>
|
<th>Customer</th>
|
||||||
<th>Expiration Date</th>
|
<th>Expiration Date</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
@ -6360,8 +6361,9 @@ Please, find below details of your domain expiration information.
|
||||||
<ad:foreach collection="#Domains#" var="Domain" index="i">
|
<ad:foreach collection="#Domains#" var="Domain" index="i">
|
||||||
<tr>
|
<tr>
|
||||||
<td>#Domain.DomainName#</td>
|
<td>#Domain.DomainName#</td>
|
||||||
|
<td>#iif(isnull(Domain.Registrar), "", Domain.Registrar)#</td>
|
||||||
<td>#Domain.Customer#</td>
|
<td>#Domain.Customer#</td>
|
||||||
<td>#Domain.ExpirationDate#</td>
|
<td>#iif(isnull(Domain.ExpirationDate), "", Domain.ExpirationDate)#</td>
|
||||||
</tr>
|
</tr>
|
||||||
</ad:foreach>
|
</ad:foreach>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -6424,8 +6426,9 @@ Please, find below details of your domain expiration information.
|
||||||
|
|
||||||
<ad:foreach collection="#Domains#" var="Domain" index="i">
|
<ad:foreach collection="#Domains#" var="Domain" index="i">
|
||||||
Domain: #Domain.DomainName#
|
Domain: #Domain.DomainName#
|
||||||
|
Registrar: #iif(isnull(Domain.Registrar), "", Domain.Registrar)#
|
||||||
Customer: #Domain.Customer#
|
Customer: #Domain.Customer#
|
||||||
Expiration Date: #Domain.ExpirationDate#
|
Expiration Date: #iif(isnull(Domain.ExpirationDate), "", Domain.ExpirationDate)#
|
||||||
|
|
||||||
</ad:foreach>
|
</ad:foreach>
|
||||||
|
|
||||||
|
@ -6470,6 +6473,7 @@ INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [Property
|
||||||
.Summary { font-family: Tahoma; font-size: 9pt; }
|
.Summary { font-family: Tahoma; font-size: 9pt; }
|
||||||
.Summary H1 { font-size: 1.7em; color: ##1F4978; border-bottom: dotted 3px ##efefef; }
|
.Summary H1 { font-size: 1.7em; color: ##1F4978; border-bottom: dotted 3px ##efefef; }
|
||||||
.Summary H2 { font-size: 1.3em; color: ##1F4978; }
|
.Summary H2 { font-size: 1.3em; color: ##1F4978; }
|
||||||
|
.Summary H3 { font-size: 1em; color: ##1F4978; }
|
||||||
.Summary TABLE { border: solid 1px ##e5e5e5; }
|
.Summary TABLE { border: solid 1px ##e5e5e5; }
|
||||||
.Summary TH,
|
.Summary TH,
|
||||||
.Summary TD.Label { padding: 5px; font-size: 8pt; font-weight: bold; background-color: ##f5f5f5; }
|
.Summary TD.Label { padding: 5px; font-size: 8pt; font-weight: bold; background-color: ##f5f5f5; }
|
||||||
|
@ -6498,6 +6502,7 @@ Please, find below details of MX and NS changes.
|
||||||
|
|
||||||
<ad:foreach collection="#Domains#" var="Domain" index="i">
|
<ad:foreach collection="#Domains#" var="Domain" index="i">
|
||||||
<h2>#Domain.DomainName# - #DomainUsers[Domain.PackageId].FirstName# #DomainUsers[Domain.PackageId].LastName#</h2>
|
<h2>#Domain.DomainName# - #DomainUsers[Domain.PackageId].FirstName# #DomainUsers[Domain.PackageId].LastName#</h2>
|
||||||
|
<h3>#iif(isnull(Domain.Registrar), "", Domain.Registrar)# #iif(isnull(Domain.ExpirationDate), "", Domain.ExpirationDate)#</h3>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
|
@ -6558,6 +6563,8 @@ Please, find below details of MX and NS changes.
|
||||||
<ad:foreach collection="#Domains#" var="Domain" index="i">
|
<ad:foreach collection="#Domains#" var="Domain" index="i">
|
||||||
|
|
||||||
#Domain.DomainName# - #DomainUsers[Domain.PackageId].FirstName# #DomainUsers[Domain.PackageId].LastName#
|
#Domain.DomainName# - #DomainUsers[Domain.PackageId].FirstName# #DomainUsers[Domain.PackageId].LastName#
|
||||||
|
Registrar: #iif(isnull(Domain.Registrar), "", Domain.Registrar)#
|
||||||
|
ExpirationDate: #iif(isnull(Domain.ExpirationDate), "", Domain.ExpirationDate)#
|
||||||
|
|
||||||
<ad:foreach collection="#Domain.DnsChanges#" var="DnsChange" index="j">
|
<ad:foreach collection="#Domain.DnsChanges#" var="DnsChange" index="j">
|
||||||
DNS: #DnsChange.DnsServer#
|
DNS: #DnsChange.DnsServer#
|
||||||
|
@ -6965,7 +6972,6 @@ exec sp_executesql @sql, N'@StartRow int, @MaximumRows int, @PackageID int, @Fil
|
||||||
|
|
||||||
|
|
||||||
RETURN
|
RETURN
|
||||||
|
|
||||||
GO
|
GO
|
||||||
|
|
||||||
|
|
||||||
|
@ -7095,3 +7101,178 @@ AS
|
||||||
|
|
||||||
RETURN @Result
|
RETURN @Result
|
||||||
GO
|
GO
|
||||||
|
|
||||||
|
|
||||||
|
-- Domain Expiration scheduled tasks fixes
|
||||||
|
|
||||||
|
IF NOT EXISTS(SELECT * FROM sys.columns
|
||||||
|
WHERE [name] = N'RegistrarName' AND [object_id] = OBJECT_ID(N'Domains'))
|
||||||
|
BEGIN
|
||||||
|
ALTER TABLE [dbo].[Domains] ADD RegistrarName nvarchar(max);
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'UpdateWhoisDomainInfo')
|
||||||
|
DROP PROCEDURE UpdateWhoisDomainInfo
|
||||||
|
GO
|
||||||
|
CREATE PROCEDURE [dbo].UpdateWhoisDomainInfo
|
||||||
|
(
|
||||||
|
@DomainId INT,
|
||||||
|
@DomainCreationDate DateTime,
|
||||||
|
@DomainExpirationDate DateTime,
|
||||||
|
@DomainLastUpdateDate DateTime,
|
||||||
|
@DomainRegistrarName nvarchar(max)
|
||||||
|
)
|
||||||
|
AS
|
||||||
|
UPDATE [dbo].[Domains] SET [CreationDate] = @DomainCreationDate, [ExpirationDate] = @DomainExpirationDate, [LastUpdateDate] = @DomainLastUpdateDate, [RegistrarName] = @DomainRegistrarName WHERE [DomainID] = @DomainId
|
||||||
|
GO
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetDomainsPaged')
|
||||||
|
DROP PROCEDURE GetDomainsPaged
|
||||||
|
GO
|
||||||
|
CREATE PROCEDURE [dbo].[GetDomainsPaged]
|
||||||
|
(
|
||||||
|
@ActorID int,
|
||||||
|
@PackageID int,
|
||||||
|
@ServerID int,
|
||||||
|
@Recursive bit,
|
||||||
|
@FilterColumn nvarchar(50) = '',
|
||||||
|
@FilterValue nvarchar(50) = '',
|
||||||
|
@SortColumn nvarchar(50),
|
||||||
|
@StartRow int,
|
||||||
|
@MaximumRows int
|
||||||
|
)
|
||||||
|
AS
|
||||||
|
SET NOCOUNT ON
|
||||||
|
|
||||||
|
-- check rights
|
||||||
|
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
|
||||||
|
RAISERROR('You are not allowed to access this package', 16, 1)
|
||||||
|
|
||||||
|
-- build query and run it to the temporary table
|
||||||
|
DECLARE @sql nvarchar(2500)
|
||||||
|
|
||||||
|
IF @SortColumn = '' OR @SortColumn IS NULL
|
||||||
|
SET @SortColumn = 'DomainName'
|
||||||
|
|
||||||
|
SET @sql = '
|
||||||
|
DECLARE @Domains TABLE
|
||||||
|
(
|
||||||
|
ItemPosition int IDENTITY(1,1),
|
||||||
|
DomainID int
|
||||||
|
)
|
||||||
|
INSERT INTO @Domains (DomainID)
|
||||||
|
SELECT
|
||||||
|
D.DomainID
|
||||||
|
FROM Domains AS D
|
||||||
|
INNER JOIN Packages AS P ON D.PackageID = P.PackageID
|
||||||
|
INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID
|
||||||
|
LEFT OUTER JOIN ServiceItems AS Z ON D.ZoneItemID = Z.ItemID
|
||||||
|
LEFT OUTER JOIN Services AS S ON Z.ServiceID = S.ServiceID
|
||||||
|
LEFT OUTER JOIN Servers AS SRV ON S.ServerID = SRV.ServerID
|
||||||
|
WHERE (D.IsInstantAlias = 0 AND D.IsDomainPointer = 0) AND
|
||||||
|
((@Recursive = 0 AND D.PackageID = @PackageID)
|
||||||
|
OR (@Recursive = 1 AND dbo.CheckPackageParent(@PackageID, D.PackageID) = 1))
|
||||||
|
AND (@ServerID = 0 OR (@ServerID > 0 AND S.ServerID = @ServerID))
|
||||||
|
'
|
||||||
|
|
||||||
|
IF @FilterColumn <> '' AND @FilterValue <> ''
|
||||||
|
SET @sql = @sql + ' AND ' + @FilterColumn + ' LIKE @FilterValue '
|
||||||
|
|
||||||
|
IF @SortColumn <> '' AND @SortColumn IS NOT NULL
|
||||||
|
SET @sql = @sql + ' ORDER BY ' + @SortColumn + ' '
|
||||||
|
|
||||||
|
SET @sql = @sql + ' SELECT COUNT(DomainID) FROM @Domains;SELECT
|
||||||
|
D.DomainID,
|
||||||
|
D.PackageID,
|
||||||
|
D.ZoneItemID,
|
||||||
|
D.DomainItemID,
|
||||||
|
D.DomainName,
|
||||||
|
D.HostingAllowed,
|
||||||
|
ISNULL(WS.ItemID, 0) AS WebSiteID,
|
||||||
|
WS.ItemName AS WebSiteName,
|
||||||
|
ISNULL(MD.ItemID, 0) AS MailDomainID,
|
||||||
|
MD.ItemName AS MailDomainName,
|
||||||
|
D.IsSubDomain,
|
||||||
|
D.IsInstantAlias,
|
||||||
|
D.IsDomainPointer,
|
||||||
|
D.ExpirationDate,
|
||||||
|
D.LastUpdateDate,
|
||||||
|
D.RegistrarName,
|
||||||
|
P.PackageName,
|
||||||
|
ISNULL(SRV.ServerID, 0) AS ServerID,
|
||||||
|
ISNULL(SRV.ServerName, '''') AS ServerName,
|
||||||
|
ISNULL(SRV.Comments, '''') AS ServerComments,
|
||||||
|
ISNULL(SRV.VirtualServer, 0) AS VirtualServer,
|
||||||
|
P.UserID,
|
||||||
|
U.Username,
|
||||||
|
U.FirstName,
|
||||||
|
U.LastName,
|
||||||
|
U.FullName,
|
||||||
|
U.RoleID,
|
||||||
|
U.Email
|
||||||
|
FROM @Domains AS SD
|
||||||
|
INNER JOIN Domains AS D ON SD.DomainID = D.DomainID
|
||||||
|
INNER JOIN Packages AS P ON D.PackageID = P.PackageID
|
||||||
|
INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID
|
||||||
|
LEFT OUTER JOIN ServiceItems AS WS ON D.WebSiteID = WS.ItemID
|
||||||
|
LEFT OUTER JOIN ServiceItems AS MD ON D.MailDomainID = MD.ItemID
|
||||||
|
LEFT OUTER JOIN ServiceItems AS Z ON D.ZoneItemID = Z.ItemID
|
||||||
|
LEFT OUTER JOIN Services AS S ON Z.ServiceID = S.ServiceID
|
||||||
|
LEFT OUTER JOIN Servers AS SRV ON S.ServerID = SRV.ServerID
|
||||||
|
WHERE SD.ItemPosition BETWEEN @StartRow + 1 AND @StartRow + @MaximumRows'
|
||||||
|
|
||||||
|
exec sp_executesql @sql, N'@StartRow int, @MaximumRows int, @PackageID int, @FilterValue nvarchar(50), @ServerID int, @Recursive bit',
|
||||||
|
@StartRow, @MaximumRows, @PackageID, @FilterValue, @ServerID, @Recursive
|
||||||
|
|
||||||
|
|
||||||
|
RETURN
|
||||||
|
GO
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetDomains')
|
||||||
|
DROP PROCEDURE GetDomains
|
||||||
|
GO
|
||||||
|
CREATE PROCEDURE [dbo].[GetDomains]
|
||||||
|
(
|
||||||
|
@ActorID int,
|
||||||
|
@PackageID int,
|
||||||
|
@Recursive bit = 1
|
||||||
|
)
|
||||||
|
AS
|
||||||
|
|
||||||
|
-- check rights
|
||||||
|
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
|
||||||
|
RAISERROR('You are not allowed to access this package', 16, 1)
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
D.DomainID,
|
||||||
|
D.PackageID,
|
||||||
|
D.ZoneItemID,
|
||||||
|
D.DomainItemID,
|
||||||
|
D.DomainName,
|
||||||
|
D.HostingAllowed,
|
||||||
|
ISNULL(WS.ItemID, 0) AS WebSiteID,
|
||||||
|
WS.ItemName AS WebSiteName,
|
||||||
|
ISNULL(MD.ItemID, 0) AS MailDomainID,
|
||||||
|
MD.ItemName AS MailDomainName,
|
||||||
|
Z.ItemName AS ZoneName,
|
||||||
|
D.IsSubDomain,
|
||||||
|
D.IsInstantAlias,
|
||||||
|
D.CreationDate,
|
||||||
|
D.ExpirationDate,
|
||||||
|
D.LastUpdateDate,
|
||||||
|
D.IsDomainPointer,
|
||||||
|
D.RegistrarName
|
||||||
|
FROM Domains AS D
|
||||||
|
INNER JOIN PackagesTree(@PackageID, @Recursive) AS PT ON D.PackageID = PT.PackageID
|
||||||
|
LEFT OUTER JOIN ServiceItems AS WS ON D.WebSiteID = WS.ItemID
|
||||||
|
LEFT OUTER JOIN ServiceItems AS MD ON D.MailDomainID = MD.ItemID
|
||||||
|
LEFT OUTER JOIN ServiceItems AS Z ON D.ZoneItemID = Z.ItemID
|
||||||
|
RETURN
|
||||||
|
|
||||||
|
GO
|
|
@ -151,5 +151,6 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
public DateTime? CreationDate { get; set; }
|
public DateTime? CreationDate { get; set; }
|
||||||
public DateTime? ExpirationDate { get; set; }
|
public DateTime? ExpirationDate { get; set; }
|
||||||
public DateTime? LastUpdateDate { get; set; }
|
public DateTime? LastUpdateDate { get; set; }
|
||||||
|
public string RegistrarName { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4827,6 +4827,20 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void UpdateWhoisDomainInfo(int domainId, DateTime? domainCreationDate, DateTime? domainExpirationDate, DateTime? domainLastUpdateDate, string registrarName)
|
||||||
|
{
|
||||||
|
SqlHelper.ExecuteNonQuery(
|
||||||
|
ConnectionString,
|
||||||
|
CommandType.StoredProcedure,
|
||||||
|
"UpdateWhoisDomainInfo",
|
||||||
|
new SqlParameter("@DomainId", domainId),
|
||||||
|
new SqlParameter("@DomainCreationDate", domainCreationDate),
|
||||||
|
new SqlParameter("@DomainExpirationDate", domainExpirationDate),
|
||||||
|
new SqlParameter("@DomainLastUpdateDate", domainLastUpdateDate),
|
||||||
|
new SqlParameter("@DomainRegistrarName", registrarName)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,7 +80,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
|
|
||||||
checkedDomains.Add(domain.DomainId);
|
checkedDomains.Add(domain.DomainId);
|
||||||
|
|
||||||
ServerController.UpdateDomainRegistrationData(domain);
|
ServerController.UpdateDomainWhoisData(domain);
|
||||||
|
|
||||||
if (CheckDomainExpiration(domain.ExpirationDate, daysBeforeNotify))
|
if (CheckDomainExpiration(domain.ExpirationDate, daysBeforeNotify))
|
||||||
{
|
{
|
||||||
|
@ -105,7 +105,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
|
|
||||||
if (mainDomain != null)
|
if (mainDomain != null)
|
||||||
{
|
{
|
||||||
ServerController.UpdateDomainRegistrationData(subDomain, mainDomain.CreationDate, mainDomain.ExpirationDate);
|
ServerController.UpdateDomainWhoisData(subDomain, mainDomain.CreationDate, mainDomain.ExpirationDate, mainDomain.RegistrarName);
|
||||||
|
|
||||||
var nonExistenDomain = nonExistenDomains.FirstOrDefault(x => subDomain.DomainId == x.DomainId);
|
var nonExistenDomain = nonExistenDomains.FirstOrDefault(x => subDomain.DomainId == x.DomainId);
|
||||||
|
|
||||||
|
@ -185,6 +185,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
items["Domains"] = domains.Select(x => new { DomainName = x.DomainName,
|
items["Domains"] = domains.Select(x => new { DomainName = x.DomainName,
|
||||||
ExpirationDate = x.ExpirationDate < DateTime.Now ? "Expired" : x.ExpirationDate.ToString(),
|
ExpirationDate = x.ExpirationDate < DateTime.Now ? "Expired" : x.ExpirationDate.ToString(),
|
||||||
ExpirationDateOrdering = x.ExpirationDate,
|
ExpirationDateOrdering = x.ExpirationDate,
|
||||||
|
Registrar = x.RegistrarName,
|
||||||
Customer = string.Format("{0} {1}", domainUsers[x.PackageId].FirstName, domainUsers[x.PackageId].LastName) })
|
Customer = string.Format("{0} {1}", domainUsers[x.PackageId].FirstName, domainUsers[x.PackageId].LastName) })
|
||||||
.OrderBy(x => x.ExpirationDateOrdering).ThenBy(x => x.Customer).ThenBy(x => x.DomainName);
|
.OrderBy(x => x.ExpirationDateOrdering).ThenBy(x => x.Customer).ThenBy(x => x.DomainName);
|
||||||
|
|
||||||
|
|
|
@ -106,6 +106,8 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
DomainDnsChanges domainChanges = new DomainDnsChanges();
|
DomainDnsChanges domainChanges = new DomainDnsChanges();
|
||||||
domainChanges.DomainName = domain.DomainName;
|
domainChanges.DomainName = domain.DomainName;
|
||||||
domainChanges.PackageId = domain.PackageId;
|
domainChanges.PackageId = domain.PackageId;
|
||||||
|
domainChanges.Registrar = domain.RegistrarName;
|
||||||
|
domainChanges.ExpirationDate = domain.ExpirationDate;
|
||||||
|
|
||||||
var dbDnsRecords = ObjectUtils.CreateListFromDataReader<DnsRecordInfo>(DataProvider.GetDomainAllDnsRecords(domain.DomainId));
|
var dbDnsRecords = ObjectUtils.CreateListFromDataReader<DnsRecordInfo>(DataProvider.GetDomainAllDnsRecords(domain.DomainId));
|
||||||
|
|
||||||
|
|
|
@ -75,6 +75,12 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
@"expires:(.+)" //.fi
|
@"expires:(.+)" //.fi
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private static List<string> _registrarNamePatterns = new List<string> {
|
||||||
|
@"Created by Registrar:(.+)",
|
||||||
|
@"Registrar:(.+)",
|
||||||
|
@"Registrant Name:(.+)"
|
||||||
|
};
|
||||||
|
|
||||||
private static List<string> _datePatterns = new List<string> { @"ddd MMM dd HH:mm:ss G\MT yyyy"
|
private static List<string> _datePatterns = new List<string> { @"ddd MMM dd HH:mm:ss G\MT yyyy"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1837,7 +1843,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
ServerController.AddServiceDNSRecords(packageId, ResourceGroups.VPSForPC, domain, "");
|
ServerController.AddServiceDNSRecords(packageId, ResourceGroups.VPSForPC, domain, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateDomainRegistrationData(domain);
|
UpdateDomainWhoisData(domain);
|
||||||
}
|
}
|
||||||
|
|
||||||
// add instant alias
|
// add instant alias
|
||||||
|
@ -2691,22 +2697,20 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DomainInfo UpdateDomainRegistrationData(DomainInfo domain)
|
public static DomainInfo UpdateDomainWhoisData(DomainInfo domain)
|
||||||
{
|
{
|
||||||
DateTime? createdDate = null;
|
|
||||||
DateTime? expiredDate = null;
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var whoisResult = WhoisClient.Query(domain.DomainName.ToLowerInvariant());
|
var whoisResult = WhoisClient.Query(domain.DomainName.ToLowerInvariant());
|
||||||
|
|
||||||
createdDate = GetDomainInfoDate(whoisResult.Raw, _createdDatePatterns);
|
string creationDateString = ParseWhoisDomainInfo(whoisResult.Raw, _createdDatePatterns);
|
||||||
expiredDate = GetDomainInfoDate(whoisResult.Raw, _expiredDatePatterns);
|
string expirationDateString = ParseWhoisDomainInfo(whoisResult.Raw, _expiredDatePatterns);
|
||||||
|
|
||||||
domain.CreationDate = createdDate;
|
domain.CreationDate = ParseDate(creationDateString);
|
||||||
domain.ExpirationDate = expiredDate;
|
domain.ExpirationDate = ParseDate(expirationDateString);
|
||||||
|
domain.RegistrarName = ParseWhoisDomainInfo(whoisResult.Raw, _registrarNamePatterns);
|
||||||
|
|
||||||
DataProvider.UpdateDomainDates(domain.DomainId, createdDate, expiredDate, DateTime.Now);
|
DataProvider.UpdateWhoisDomainInfo(domain.DomainId, domain.CreationDate, domain.ExpirationDate, DateTime.Now, domain.RegistrarName);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -2716,17 +2720,18 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
return domain;
|
return domain;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static DomainInfo UpdateDomainRegistrationData(DomainInfo domain, DateTime? creationDate, DateTime? expirationDate)
|
public static DomainInfo UpdateDomainWhoisData(DomainInfo domain, DateTime? creationDate, DateTime? expirationDate, string registrarName)
|
||||||
{
|
{
|
||||||
DataProvider.UpdateDomainDates(domain.DomainId, creationDate, expirationDate, DateTime.Now);
|
DataProvider.UpdateWhoisDomainInfo(domain.DomainId, creationDate, expirationDate, DateTime.Now, registrarName);
|
||||||
|
|
||||||
domain.CreationDate = creationDate;
|
domain.CreationDate = creationDate;
|
||||||
domain.ExpirationDate = expirationDate;
|
domain.ExpirationDate = expirationDate;
|
||||||
|
domain.RegistrarName = registrarName;
|
||||||
|
|
||||||
return domain;
|
return domain;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static DateTime? GetDomainInfoDate(string raw, IEnumerable<string> patterns)
|
private static string ParseWhoisDomainInfo(string raw, IEnumerable<string> patterns)
|
||||||
{
|
{
|
||||||
foreach (var createdRegex in patterns)
|
foreach (var createdRegex in patterns)
|
||||||
{
|
{
|
||||||
|
@ -2736,7 +2741,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
{
|
{
|
||||||
if (match.Success && match.Groups.Count == 2)
|
if (match.Success && match.Groups.Count == 2)
|
||||||
{
|
{
|
||||||
return ParseDate(match.Groups[1].ToString().Trim());
|
return match.Groups[1].ToString().Trim();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2746,6 +2751,11 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
|
|
||||||
private static DateTime? ParseDate(string dateString)
|
private static DateTime? ParseDate(string dateString)
|
||||||
{
|
{
|
||||||
|
if (string.IsNullOrEmpty(dateString))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
var result = DateTime.MinValue;
|
var result = DateTime.MinValue;
|
||||||
|
|
||||||
foreach (var datePattern in _datePatterns)
|
foreach (var datePattern in _datePatterns)
|
||||||
|
|
|
@ -8,6 +8,8 @@ namespace WebsitePanel.Providers.DomainLookup
|
||||||
public class DomainDnsChanges
|
public class DomainDnsChanges
|
||||||
{
|
{
|
||||||
public string DomainName { get; set; }
|
public string DomainName { get; set; }
|
||||||
|
public string Registrar { get; set; }
|
||||||
|
public DateTime? ExpirationDate { get; set; }
|
||||||
public int PackageId { get; set; }
|
public int PackageId { get; set; }
|
||||||
|
|
||||||
public List<DnsRecordInfoChange> DnsChanges { get; set; }
|
public List<DnsRecordInfoChange> DnsChanges { get; set; }
|
||||||
|
|
|
@ -216,4 +216,7 @@
|
||||||
<data name="DomainLookup.TooltipHeader" xml:space="preserve">
|
<data name="DomainLookup.TooltipHeader" xml:space="preserve">
|
||||||
<value>Current Real DNS Values</value>
|
<value>Current Real DNS Values</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="DomainLookup.TooltipHeader.Registrar" xml:space="preserve">
|
||||||
|
<value>Registrar:</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
|
@ -38,12 +38,16 @@
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
<asp:TemplateField HeaderText="gvDomainsExpirationDate">
|
<asp:TemplateField HeaderText="gvDomainsExpirationDate">
|
||||||
<ItemStyle Width="15%"></ItemStyle>
|
<ItemStyle Width="11%"></ItemStyle>
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<%# GetDomainExpirationDate(Eval("ExpirationDate"), Eval("LastUpdateDate"))%>
|
<%# GetDomainExpirationDate(Eval("ExpirationDate"), Eval("LastUpdateDate"))%>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
<asp:TemplateField HeaderText="">
|
||||||
|
<ItemStyle Width="5%"></ItemStyle>
|
||||||
|
<ItemTemplate>
|
||||||
<div style="display:inline-block" runat="server" Visible='<%# ShowDomainDnsInfo(Eval("ExpirationDate"), Eval("LastUpdateDate"), !(bool)Eval("IsSubDomain") && !(bool)Eval("IsInstantAlias") && !(bool)Eval("IsDomainPointer")) && !string.IsNullOrEmpty(GetDomainDnsRecords((int)Eval("DomainId"))) %>'>
|
<div style="display:inline-block" runat="server" Visible='<%# ShowDomainDnsInfo(Eval("ExpirationDate"), Eval("LastUpdateDate"), !(bool)Eval("IsSubDomain") && !(bool)Eval("IsInstantAlias") && !(bool)Eval("IsDomainPointer")) && !string.IsNullOrEmpty(GetDomainDnsRecords((int)Eval("DomainId"))) %>'>
|
||||||
<img style="border-width: 0px;" src="App_Themes/Default/Images/information_icon_small.gif" title="<%# GetDomainDnsRecords((int)Eval("DomainId")) %>">
|
<img style="border-width: 0px;" src="App_Themes/Default/Images/information_icon_small.gif" title="<%# GetDomainTooltip((int)Eval("DomainId"), Eval("RegistrarName") != DBNull.Value ? (string)Eval("RegistrarName"):string.Empty) %>">
|
||||||
</div>
|
</div>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
|
|
|
@ -55,10 +55,10 @@ namespace WebsitePanel.Portal
|
||||||
|
|
||||||
// visibility
|
// visibility
|
||||||
chkRecursive.Visible = (PanelSecurity.SelectedUser.Role != UserRole.User);
|
chkRecursive.Visible = (PanelSecurity.SelectedUser.Role != UserRole.User);
|
||||||
gvDomains.Columns[3].Visible = gvDomains.Columns[3].Visible =
|
gvDomains.Columns[4].Visible = gvDomains.Columns[5].Visible =
|
||||||
(PanelSecurity.SelectedUser.Role != UserRole.User) && chkRecursive.Checked;
|
(PanelSecurity.SelectedUser.Role != UserRole.User) && chkRecursive.Checked;
|
||||||
gvDomains.Columns[5].Visible = (PanelSecurity.SelectedUser.Role == UserRole.Administrator);
|
gvDomains.Columns[6].Visible = (PanelSecurity.SelectedUser.Role == UserRole.Administrator);
|
||||||
gvDomains.Columns[6].Visible = (PanelSecurity.EffectiveUser.Role == UserRole.Administrator);
|
gvDomains.Columns[7].Visible = (PanelSecurity.EffectiveUser.Role == UserRole.Administrator);
|
||||||
|
|
||||||
if (!IsPostBack)
|
if (!IsPostBack)
|
||||||
{
|
{
|
||||||
|
@ -185,6 +185,22 @@ namespace WebsitePanel.Portal
|
||||||
return dnsRecords[domainId];
|
return dnsRecords[domainId];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string GetDomainTooltip(int domainId, string registrar)
|
||||||
|
{
|
||||||
|
var dnsString = GetDomainDnsRecords(domainId);
|
||||||
|
|
||||||
|
var tooltipLines = new List<string>();
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(registrar))
|
||||||
|
{
|
||||||
|
var header = GetLocalizedString("DomainLookup.TooltipHeader.Registrar");
|
||||||
|
tooltipLines.Add(header + " " + registrar);
|
||||||
|
tooltipLines.Add("\r\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
return string.Join("\r\n", tooltipLines) + dnsString;
|
||||||
|
}
|
||||||
|
|
||||||
protected void odsDomainsPaged_Selected(object sender, ObjectDataSourceStatusEventArgs e)
|
protected void odsDomainsPaged_Selected(object sender, ObjectDataSourceStatusEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.Exception != null)
|
if (e.Exception != null)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue