Merge
This commit is contained in:
commit
75058fa47f
1 changed files with 15 additions and 2 deletions
|
@ -541,7 +541,7 @@ namespace WebsitePanel.Providers.HostedSolution
|
||||||
|
|
||||||
var pwdLastSetDate = DateTime.FromFileTimeUtc(pwdLastSetTicks);
|
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)
|
if (expirationDate.AddDays(-daysBeforeExpiration) < DateTime.Now)
|
||||||
{
|
{
|
||||||
|
@ -596,7 +596,15 @@ namespace WebsitePanel.Providers.HostedSolution
|
||||||
|
|
||||||
if (sr != null && sr.Properties.Contains("maxPwdAge"))
|
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.");
|
throw new Exception("'maxPwdAge' property not found.");
|
||||||
|
@ -1021,6 +1029,11 @@ namespace WebsitePanel.Providers.HostedSolution
|
||||||
|
|
||||||
var pwdLastSetDate = DateTime.FromFileTimeUtc(pwdLastSetTicks);
|
var pwdLastSetDate = DateTime.FromFileTimeUtc(pwdLastSetTicks);
|
||||||
|
|
||||||
|
if (maxPasswordAgeSpan == TimeSpan.MaxValue)
|
||||||
|
{
|
||||||
|
return DateTime.MaxValue;
|
||||||
|
}
|
||||||
|
|
||||||
return pwdLastSetDate.AddDays(maxPasswordAgeSpan.Days);
|
return pwdLastSetDate.AddDays(maxPasswordAgeSpan.Days);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue