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>
|
||||
<td>#Domain.DomainName#</td>
|
||||
<td>#Domain.Customer#</td>
|
||||
<td>#Domain.ExpirationDate#</td>
|
||||
<td>Expired</td>
|
||||
</tr>
|
||||
</ad:foreach>
|
||||
</tbody>
|
||||
|
@ -6313,7 +6313,7 @@ Please, find below details of your domain expiration information.
|
|||
<ad:foreach collection="#Domains#" var="Domain" index="i">
|
||||
Domain: #Domain.DomainName#
|
||||
Customer: #Domain.Customer#
|
||||
Expiration Date: #Domain.ExpirationDate#
|
||||
Expiration Date: Expired
|
||||
|
||||
</ad:foreach>
|
||||
|
||||
|
|
|
@ -60,11 +60,9 @@ namespace WebsitePanel.EnterpriseServer
|
|||
|
||||
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);
|
||||
|
||||
domains = topLevelDomains.Where(x => x.CreationDate == null || x.ExpirationDate == null ? true : CheckDomainExpiration(x.ExpirationDate, daysBeforeNotify)).ToList(); // selecting expired or with empty expire date domains
|
||||
allTopLevelDomains.AddRange(domains);
|
||||
|
||||
var domainUser = UserController.GetUser(package.UserId);
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@ using WebsitePanel.Providers.HostedSolution;
|
|||
using Whois.NET;
|
||||
using System.Text.RegularExpressions;
|
||||
using WebsitePanel.Providers.DomainLookup;
|
||||
using System.Globalization;
|
||||
|
||||
namespace WebsitePanel.EnterpriseServer
|
||||
{
|
||||
|
@ -72,6 +73,9 @@ namespace WebsitePanel.EnterpriseServer
|
|||
@"expires:(.+)" //.fi
|
||||
};
|
||||
|
||||
private static List<string> _datePatterns = new List<string> { @"ddd MMM dd HH:mm:ss G\MT yyyy"
|
||||
};
|
||||
|
||||
#region Servers
|
||||
public static List<ServerInfo> GetAllServers()
|
||||
{
|
||||
|
@ -2723,7 +2727,7 @@ namespace WebsitePanel.EnterpriseServer
|
|||
{
|
||||
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;
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
#region DNS Zones
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue