mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-11-23 12:30:50 +01:00
Apply code review suggestions
- Use `Nullable.HasValue` and `Nullable.Value` to handle `DateTime?` type returned by `LicenseCssExpiry` - Check UTC time when checking CSS license expiry Signed-off-by: Danilo Del Busso <danilo.delbusso@cloud.com>
This commit is contained in:
parent
b8a3a7cdeb
commit
cd920531c8
@ -361,9 +361,8 @@ namespace XenAdmin.Dialogs
|
||||
{
|
||||
entitlements.Add(Messages.LICENSE_NOT_ELIGIBLE_FOR_SUPPORT);
|
||||
}
|
||||
}
|
||||
|
||||
if (CurrentState == HostState.Free)
|
||||
}
|
||||
else if (CurrentState == HostState.Free)
|
||||
{
|
||||
entitlements.Add(Messages.LICENSE_NOT_ELIGIBLE_FOR_SUPPORT);
|
||||
}
|
||||
|
@ -353,10 +353,10 @@ namespace XenAPI
|
||||
{
|
||||
var cssExpiry = LicenseCssExpiry();
|
||||
|
||||
if (cssExpiry != null)
|
||||
if (cssExpiry.HasValue)
|
||||
{
|
||||
// User can circumvent this by changing system date
|
||||
return DateTime.Now > cssExpiry;
|
||||
return DateTime.UtcNow > cssExpiry.Value;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user