mirror of
https://github.com/fergalmoran/DnsServer.git
synced 2025-12-27 03:49:54 +00:00
WebServiceDhcpApi: Updated SetDhcpScopeAsync() to rename the scope after all the changes are saved to the existing scope.
This commit is contained in:
@@ -369,16 +369,6 @@ namespace DnsServerCore
|
||||
if (string.IsNullOrEmpty(scopeName))
|
||||
throw new DnsWebServiceException("Parameter 'name' missing.");
|
||||
|
||||
string newName = request.QueryString["newName"];
|
||||
if (!string.IsNullOrEmpty(newName) && !newName.Equals(scopeName))
|
||||
{
|
||||
_dnsWebService.DhcpServer.RenameScope(scopeName, newName);
|
||||
|
||||
_dnsWebService.Log.Write(DnsWebService.GetRequestRemoteEndPoint(request), "[" + _dnsWebService.GetSession(request).Username + "] DHCP scope was renamed successfully: '" + scopeName + "' to '" + newName + "'");
|
||||
|
||||
scopeName = newName;
|
||||
}
|
||||
|
||||
string strStartingAddress = request.QueryString["startingAddress"];
|
||||
string strEndingAddress = request.QueryString["endingAddress"];
|
||||
string strSubnetMask = request.QueryString["subnetMask"];
|
||||
@@ -653,6 +643,14 @@ namespace DnsServerCore
|
||||
|
||||
_dnsWebService.Log.Write(DnsWebService.GetRequestRemoteEndPoint(request), "[" + _dnsWebService.GetSession(request).Username + "] DHCP scope was added successfully: " + scopeName);
|
||||
}
|
||||
|
||||
string newName = request.QueryString["newName"];
|
||||
if (!string.IsNullOrEmpty(newName) && !newName.Equals(scopeName))
|
||||
{
|
||||
_dnsWebService.DhcpServer.RenameScope(scopeName, newName);
|
||||
|
||||
_dnsWebService.Log.Write(DnsWebService.GetRequestRemoteEndPoint(request), "[" + _dnsWebService.GetSession(request).Username + "] DHCP scope was renamed successfully: '" + scopeName + "' to '" + newName + "'");
|
||||
}
|
||||
}
|
||||
|
||||
public async Task EnableDhcpScopeAsync(HttpListenerRequest request)
|
||||
|
||||
Reference in New Issue
Block a user