password reset fix
This commit is contained in:
parent
c84b09750d
commit
6f06614e8f
1 changed files with 15 additions and 2 deletions
|
@ -541,7 +541,7 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
|
||||
var pwdLastSetDate = DateTime.FromFileTimeUtc(pwdLastSetTicks);
|
||||
|
||||
var expirationDate = pwdLastSetDate.AddDays(maxPasswordAgeSpan.Days);
|
||||
var expirationDate = maxPasswordAgeSpan == TimeSpan.MaxValue ? DateTime.MaxValue : pwdLastSetDate.AddDays(maxPasswordAgeSpan.Days);
|
||||
|
||||
if (expirationDate.AddDays(-daysBeforeExpiration) < DateTime.Now)
|
||||
{
|
||||
|
@ -596,7 +596,15 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
|
||||
if (sr != null && sr.Properties.Contains("maxPwdAge"))
|
||||
{
|
||||
return TimeSpan.FromTicks((long)sr.Properties["maxPwdAge"][0]).Duration();
|
||||
try
|
||||
{
|
||||
return TimeSpan.FromTicks((long)sr.Properties["maxPwdAge"][0]).Duration();
|
||||
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return TimeSpan.MaxValue;
|
||||
}
|
||||
}
|
||||
|
||||
throw new Exception("'maxPwdAge' property not found.");
|
||||
|
@ -1021,6 +1029,11 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
|
||||
var pwdLastSetDate = DateTime.FromFileTimeUtc(pwdLastSetTicks);
|
||||
|
||||
if (maxPasswordAgeSpan == TimeSpan.MaxValue)
|
||||
{
|
||||
return DateTime.MaxValue;
|
||||
}
|
||||
|
||||
return pwdLastSetDate.AddDays(maxPasswordAgeSpan.Days);
|
||||
}
|
||||
finally
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue