ForwarderZone: overrided Disabled property to control notify. Updated Notify property to only allow catalog zones to use new notify option.

This commit is contained in:
Shreyas Zare
2024-10-19 16:49:17 +05:30
parent 5361533ae0
commit fb22196bed

View File

@@ -274,6 +274,23 @@ namespace DnsServerCore.Dns.Zones
#region properties
public override bool Disabled
{
get { return base.Disabled; }
set
{
if (base.Disabled == value)
return;
base.Disabled = value; //set value early to be able to use it for notify
if (value)
DisableNotifyTimer();
else
TriggerNotify();
}
}
public override AuthZoneQueryAccess QueryAccess
{
get { return base.QueryAccess; }
@@ -316,6 +333,12 @@ namespace DnsServerCore.Dns.Zones
case AuthZoneNotify.ZoneNameServers:
case AuthZoneNotify.BothZoneAndSpecifiedNameServers:
throw new ArgumentException("The Notify option is invalid for " + GetZoneTypeName() + " zones: " + value.ToString(), nameof(Notify));
case AuthZoneNotify.SeparateNameServersForCatalogAndMemberZones:
if (this is CatalogZone)
break;
throw new ArgumentException("The Notify option is invalid for " + GetZoneTypeName() + " zones: " + value.ToString(), nameof(Notify));
}
base.Notify = value;