Domain Expiration Task Fixes
This commit is contained in:
parent
32f259ecec
commit
81162ca00e
3 changed files with 24 additions and 7 deletions
|
@ -6249,7 +6249,7 @@ Please, find below details of your domain expiration information.
|
||||||
<tr>
|
<tr>
|
||||||
<td>#Domain.DomainName#</td>
|
<td>#Domain.DomainName#</td>
|
||||||
<td>#Domain.Customer#</td>
|
<td>#Domain.Customer#</td>
|
||||||
<td>#Domain.ExpirationDate#</td>
|
<td>Expired</td>
|
||||||
</tr>
|
</tr>
|
||||||
</ad:foreach>
|
</ad:foreach>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -6313,7 +6313,7 @@ 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#
|
||||||
Customer: #Domain.Customer#
|
Customer: #Domain.Customer#
|
||||||
Expiration Date: #Domain.ExpirationDate#
|
Expiration Date: Expired
|
||||||
|
|
||||||
</ad:foreach>
|
</ad:foreach>
|
||||||
|
|
||||||
|
|
|
@ -60,11 +60,9 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
|
|
||||||
subDomains.AddRange(domains.Where(x => x.IsSubDomain));
|
subDomains.AddRange(domains.Where(x => x.IsSubDomain));
|
||||||
|
|
||||||
var topLevelDomains = domains = domains.Where(x => !x.IsSubDomain && !x.IsDomainPointer).ToList(); //Selecting top-level domains
|
domains = domains.Where(x => !x.IsSubDomain && !x.IsDomainPointer).ToList(); //Selecting top-level domains
|
||||||
|
|
||||||
allTopLevelDomains.AddRange(topLevelDomains);
|
allTopLevelDomains.AddRange(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);
|
var domainUser = UserController.GetUser(package.UserId);
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,7 @@ using WebsitePanel.Providers.HostedSolution;
|
||||||
using Whois.NET;
|
using Whois.NET;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using WebsitePanel.Providers.DomainLookup;
|
using WebsitePanel.Providers.DomainLookup;
|
||||||
|
using System.Globalization;
|
||||||
|
|
||||||
namespace WebsitePanel.EnterpriseServer
|
namespace WebsitePanel.EnterpriseServer
|
||||||
{
|
{
|
||||||
|
@ -72,6 +73,9 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
@"expires:(.+)" //.fi
|
@"expires:(.+)" //.fi
|
||||||
};
|
};
|
||||||
|
|
||||||
|
private static List<string> _datePatterns = new List<string> { @"ddd MMM dd HH:mm:ss G\MT yyyy"
|
||||||
|
};
|
||||||
|
|
||||||
#region Servers
|
#region Servers
|
||||||
public static List<ServerInfo> GetAllServers()
|
public static List<ServerInfo> GetAllServers()
|
||||||
{
|
{
|
||||||
|
@ -2723,7 +2727,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
{
|
{
|
||||||
if (match.Success && match.Groups.Count == 2)
|
if (match.Success && match.Groups.Count == 2)
|
||||||
{
|
{
|
||||||
return DateTime.Parse(match.Groups[1].ToString().Trim());
|
return ParseDate(match.Groups[1].ToString().Trim());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2731,6 +2735,21 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static DateTime? ParseDate(string dateString)
|
||||||
|
{
|
||||||
|
var result = DateTime.MinValue;
|
||||||
|
|
||||||
|
foreach (var datePattern in _datePatterns)
|
||||||
|
{
|
||||||
|
if (DateTime.TryParseExact(dateString, datePattern, CultureInfo.InvariantCulture, DateTimeStyles.None, out result))
|
||||||
|
{
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return DateTime.Parse(dateString);
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region DNS Zones
|
#region DNS Zones
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue