From cb033c0b70953d0aaf5b0b3226381b0604567736 Mon Sep 17 00:00:00 2001 From: Gary Sharp Date: Thu, 19 Apr 2018 17:11:19 +1000 Subject: [PATCH] Allow remote maintenance via web.config setting --- Disco.Web/Controllers/InitialConfigController.cs | 3 ++- Disco.Web/Controllers/UpdateController.cs | 4 +++- Disco.Web/Web.Release.config | 1 + Disco.Web/Web.config | 1 + Disco.sln | 7 +++++-- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Disco.Web/Controllers/InitialConfigController.cs b/Disco.Web/Controllers/InitialConfigController.cs index cfb5d038..12113de4 100644 --- a/Disco.Web/Controllers/InitialConfigController.cs +++ b/Disco.Web/Controllers/InitialConfigController.cs @@ -5,6 +5,7 @@ using Disco.Services.Users; using Disco.Web.Areas.API.Models.Shared; using Disco.Web.Models.InitialConfig; using System; +using System.Configuration; using System.Data.SqlClient; using System.IO; using System.IO.Compression; @@ -64,7 +65,7 @@ namespace Disco.Web.Controllers protected override void OnActionExecuting(ActionExecutingContext filterContext) { - if (!Request.IsLocal && !ServerIsCoreSKU.Value) + if (!Request.IsLocal && !ServerIsCoreSKU.Value && !("true".Equals(ConfigurationManager.AppSettings["DiscoAllowRemoteMaintenance"], StringComparison.OrdinalIgnoreCase))) { filterContext.Result = new ContentResult() { Content = "Initial Configuration of Disco ICT is only allowed via a localhost connection", diff --git a/Disco.Web/Controllers/UpdateController.cs b/Disco.Web/Controllers/UpdateController.cs index 48961068..0fc3d90b 100644 --- a/Disco.Web/Controllers/UpdateController.cs +++ b/Disco.Web/Controllers/UpdateController.cs @@ -1,4 +1,6 @@ using Disco.Services.Plugins; +using System; +using System.Configuration; using System.Web.Mvc; namespace Disco.Web.Controllers @@ -8,7 +10,7 @@ namespace Disco.Web.Controllers { protected override void OnActionExecuting(ActionExecutingContext filterContext) { - if (!Request.IsLocal && !InitialConfigController.ServerIsCoreSKU.Value) + if (!Request.IsLocal && !InitialConfigController.ServerIsCoreSKU.Value && !("true".Equals(ConfigurationManager.AppSettings["DiscoIgnoreVersionUpdate"], StringComparison.OrdinalIgnoreCase))) { filterContext.Result = new ContentResult() { diff --git a/Disco.Web/Web.Release.config b/Disco.Web/Web.Release.config index 82be2ff0..9bb612f7 100644 --- a/Disco.Web/Web.Release.config +++ b/Disco.Web/Web.Release.config @@ -17,6 +17,7 @@ + diff --git a/Disco.Web/Web.config b/Disco.Web/Web.config index c519f5e2..43886422 100644 --- a/Disco.Web/Web.config +++ b/Disco.Web/Web.config @@ -11,6 +11,7 @@ + diff --git a/Disco.sln b/Disco.sln index 8e87dada..07bd7e95 100644 --- a/Disco.sln +++ b/Disco.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 +# Visual Studio 15 +VisualStudioVersion = 15.0.27004.2010 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Disco.ClientBootstrapper", "Disco.ClientBootstrapper\Disco.ClientBootstrapper.csproj", "{15BD9561-A3C7-4608-9F7E-F1A1CFB60055}" EndProject @@ -129,6 +129,9 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {1CCC4DCB-653B-464B-B05D-285032B28DC4} + EndGlobalSection GlobalSection(AutomaticVersions) = postSolution UpdateAssemblyVersion = False UpdateAssemblyFileVersion = False