mirror of
https://github.com/fergalmoran/DnsServer.git
synced 2025-12-27 11:59:39 +00:00
DnsWebService: minor changes and refactoring done.
This commit is contained in:
@@ -5535,7 +5535,7 @@ namespace DnsServerCore
|
||||
jsonWriter.WriteStartObject();
|
||||
|
||||
jsonWriter.WritePropertyName("name");
|
||||
jsonWriter.WriteValue(application.AppName);
|
||||
jsonWriter.WriteValue(application.Name);
|
||||
|
||||
jsonWriter.WritePropertyName("version");
|
||||
jsonWriter.WriteValue(GetCleanVersion(application.Version));
|
||||
@@ -5545,7 +5545,7 @@ namespace DnsServerCore
|
||||
foreach (dynamic jsonStoreApp in jsonStoreAppsArray)
|
||||
{
|
||||
string name = jsonStoreApp.name.Value;
|
||||
if (name.Equals(application.AppName))
|
||||
if (name.Equals(application.Name))
|
||||
{
|
||||
string version = jsonStoreApp.version.Value;
|
||||
string url = jsonStoreApp.url.Value;
|
||||
@@ -5712,6 +5712,8 @@ namespace DnsServerCore
|
||||
if (string.IsNullOrEmpty(name))
|
||||
throw new DnsWebServiceException("Parameter 'name' missing.");
|
||||
|
||||
name = name.Trim();
|
||||
|
||||
string url = request.QueryString["url"];
|
||||
if (string.IsNullOrEmpty(url))
|
||||
throw new DnsWebServiceException("Parameter 'url' missing.");
|
||||
@@ -5763,6 +5765,8 @@ namespace DnsServerCore
|
||||
if (string.IsNullOrEmpty(name))
|
||||
throw new DnsWebServiceException("Parameter 'name' missing.");
|
||||
|
||||
name = name.Trim();
|
||||
|
||||
string url = request.QueryString["url"];
|
||||
if (string.IsNullOrEmpty(url))
|
||||
throw new DnsWebServiceException("Parameter 'url' missing.");
|
||||
@@ -5814,6 +5818,8 @@ namespace DnsServerCore
|
||||
if (string.IsNullOrEmpty(name))
|
||||
throw new DnsWebServiceException("Parameter 'name' missing.");
|
||||
|
||||
name = name.Trim();
|
||||
|
||||
#region skip to content
|
||||
|
||||
int crlfCount = 0;
|
||||
@@ -5874,6 +5880,8 @@ namespace DnsServerCore
|
||||
if (string.IsNullOrEmpty(name))
|
||||
throw new DnsWebServiceException("Parameter 'name' missing.");
|
||||
|
||||
name = name.Trim();
|
||||
|
||||
#region skip to content
|
||||
|
||||
int crlfCount = 0;
|
||||
@@ -5934,6 +5942,8 @@ namespace DnsServerCore
|
||||
if (string.IsNullOrEmpty(name))
|
||||
throw new DnsWebServiceException("Parameter 'name' missing.");
|
||||
|
||||
name = name.Trim();
|
||||
|
||||
_dnsServer.DnsApplicationManager.UninstallApplication(name);
|
||||
_log.Write(GetRequestRemoteEndPoint(request), "[" + GetSession(request).Username + "] DNS application '" + name + "' was uninstalled successfully.");
|
||||
}
|
||||
@@ -5944,6 +5954,8 @@ namespace DnsServerCore
|
||||
if (string.IsNullOrEmpty(name))
|
||||
throw new DnsWebServiceException("Parameter 'name' missing.");
|
||||
|
||||
name = name.Trim();
|
||||
|
||||
if (!_dnsServer.DnsApplicationManager.Applications.TryGetValue(name, out DnsApplication application))
|
||||
throw new DnsWebServiceException("DNS application was not found: " + name);
|
||||
|
||||
@@ -5959,6 +5971,8 @@ namespace DnsServerCore
|
||||
if (string.IsNullOrEmpty(name))
|
||||
throw new DnsWebServiceException("Parameter 'name' missing.");
|
||||
|
||||
name = name.Trim();
|
||||
|
||||
if (!_dnsServer.DnsApplicationManager.Applications.TryGetValue(name, out DnsApplication application))
|
||||
throw new DnsWebServiceException("DNS application was not found: " + name);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user