mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2024-11-23 20:36:33 +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);
|
entitlements.Add(Messages.LICENSE_NOT_ELIGIBLE_FOR_SUPPORT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (CurrentState == HostState.Free)
|
||||||
if (CurrentState == HostState.Free)
|
|
||||||
{
|
{
|
||||||
entitlements.Add(Messages.LICENSE_NOT_ELIGIBLE_FOR_SUPPORT);
|
entitlements.Add(Messages.LICENSE_NOT_ELIGIBLE_FOR_SUPPORT);
|
||||||
}
|
}
|
||||||
|
@ -353,10 +353,10 @@ namespace XenAPI
|
|||||||
{
|
{
|
||||||
var cssExpiry = LicenseCssExpiry();
|
var cssExpiry = LicenseCssExpiry();
|
||||||
|
|
||||||
if (cssExpiry != null)
|
if (cssExpiry.HasValue)
|
||||||
{
|
{
|
||||||
// User can circumvent this by changing system date
|
// User can circumvent this by changing system date
|
||||||
return DateTime.Now > cssExpiry;
|
return DateTime.UtcNow > cssExpiry.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user