mirror of
https://github.com/fergalmoran/DnsServer.git
synced 2025-12-22 09:29:50 +00:00
AllowedZoneManager & BlockedZoneManager: Using AuthZoneManager's TotalZones.
This commit is contained in:
@@ -39,8 +39,6 @@ namespace DnsServerCore.Dns.ZoneManagers
|
||||
DnsSOARecord _soaRecord;
|
||||
DnsNSRecord _nsRecord;
|
||||
|
||||
int _totalZonesAllowed;
|
||||
|
||||
#endregion
|
||||
|
||||
#region constructor
|
||||
@@ -121,10 +119,7 @@ namespace DnsServerCore.Dns.ZoneManagers
|
||||
public bool AllowZone(string domain)
|
||||
{
|
||||
if (_zoneManager.CreateInternalPrimaryZone(domain, _soaRecord, _nsRecord) != null)
|
||||
{
|
||||
_totalZonesAllowed++;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -132,10 +127,7 @@ namespace DnsServerCore.Dns.ZoneManagers
|
||||
public bool DeleteZone(string domain)
|
||||
{
|
||||
if (_zoneManager.DeleteZone(domain))
|
||||
{
|
||||
_totalZonesAllowed--;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -159,8 +151,6 @@ namespace DnsServerCore.Dns.ZoneManagers
|
||||
{
|
||||
List<AuthZoneInfo> allowedZones = _dnsServer.AllowedZoneManager.ListZones();
|
||||
|
||||
_totalZonesAllowed = allowedZones.Count;
|
||||
|
||||
string allowedZoneFile = Path.Combine(_dnsServer.ConfigFolder, "allowed.config");
|
||||
|
||||
using (FileStream fS = new FileStream(allowedZoneFile, FileMode.Create, FileAccess.Write))
|
||||
@@ -197,7 +187,7 @@ namespace DnsServerCore.Dns.ZoneManagers
|
||||
}
|
||||
|
||||
public int TotalZonesAllowed
|
||||
{ get { return _totalZonesAllowed; } }
|
||||
{ get { return _zoneManager.TotalZones; } }
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
@@ -39,8 +39,6 @@ namespace DnsServerCore.Dns.ZoneManagers
|
||||
DnsSOARecord _soaRecord;
|
||||
DnsNSRecord _nsRecord;
|
||||
|
||||
int _totalZonesBlocked;
|
||||
|
||||
#endregion
|
||||
|
||||
#region constructor
|
||||
@@ -139,10 +137,7 @@ namespace DnsServerCore.Dns.ZoneManagers
|
||||
public bool BlockZone(string domain)
|
||||
{
|
||||
if (_zoneManager.CreateInternalPrimaryZone(domain, _soaRecord, _nsRecord) != null)
|
||||
{
|
||||
_totalZonesBlocked++;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -150,10 +145,7 @@ namespace DnsServerCore.Dns.ZoneManagers
|
||||
public bool DeleteZone(string domain)
|
||||
{
|
||||
if (_zoneManager.DeleteZone(domain))
|
||||
{
|
||||
_totalZonesBlocked--;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -213,7 +205,7 @@ namespace DnsServerCore.Dns.ZoneManagers
|
||||
}
|
||||
|
||||
public int TotalZonesBlocked
|
||||
{ get { return _totalZonesBlocked; } }
|
||||
{ get { return _zoneManager.TotalZones; } }
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user