From 5953c9ebe7b89800d159b33cafa9865a324d313b Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Wed, 1 Sep 2021 07:50:17 +0200 Subject: [PATCH] Fixed issues with confusion about when to use umbracoPath and when to use the const. Now it is possible to change the location of backoffice. { "Umbraco": { "CMS": { "Global": { "UmbracoPath": "~/my-secret-loginpanel", "IconsPath": "~/my-secret-loginpanel/assets/icons" } } } } --- .../DependencyInjection/UmbracoBuilder.Services.cs | 2 +- .../Controllers/BackOfficeController.cs | 4 ++-- src/Umbraco.Web.UI/umbraco/UmbracoBackOffice/Default.cshtml | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Services.cs b/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Services.cs index e535b399e4..861a05b459 100644 --- a/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Services.cs +++ b/src/Umbraco.Infrastructure/DependencyInjection/UmbracoBuilder.Services.cs @@ -103,7 +103,7 @@ namespace Umbraco.Cms.Infrastructure.DependencyInjection { var hostingEnvironment = container.GetRequiredService(); var globalSettings = container.GetRequiredService>().Value; - var mainLangFolder = new DirectoryInfo(hostingEnvironment.MapPathContentRoot(WebPath.Combine(globalSettings.UmbracoPath, "config", "lang"))); + var mainLangFolder = new DirectoryInfo(hostingEnvironment.MapPathContentRoot(WebPath.Combine(Constants.SystemDirectories.Umbraco, "config", "lang"))); var appPlugins = new DirectoryInfo(hostingEnvironment.MapPathContentRoot(Constants.SystemDirectories.AppPlugins)); var configLangFolder = new DirectoryInfo(hostingEnvironment.MapPathContentRoot(WebPath.Combine(Constants.SystemDirectories.Config, "lang"))); diff --git a/src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs b/src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs index a52e018f58..06ba156efc 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/BackOfficeController.cs @@ -118,7 +118,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers // force authentication to occur since this is not an authorized endpoint var result = await this.AuthenticateBackOfficeAsync(); - var viewPath = Path.Combine(_globalSettings.UmbracoPath , Constants.Web.Mvc.BackOfficeArea, nameof(Default) + ".cshtml") + var viewPath = Path.Combine(Constants.SystemDirectories.Umbraco, Constants.Web.Mvc.BackOfficeArea, nameof(Default) + ".cshtml") .Replace("\\", "/"); // convert to forward slashes since it's a virtual path return await RenderDefaultOrProcessExternalLoginAsync( @@ -204,7 +204,7 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers // force authentication to occur since this is not an authorized endpoint var result = await this.AuthenticateBackOfficeAsync(); - var viewPath = Path.Combine(_globalSettings.UmbracoPath, Constants.Web.Mvc.BackOfficeArea, nameof(AuthorizeUpgrade) + ".cshtml"); + var viewPath = Path.Combine(Constants.SystemDirectories.Umbraco, Constants.Web.Mvc.BackOfficeArea, nameof(AuthorizeUpgrade) + ".cshtml"); return await RenderDefaultOrProcessExternalLoginAsync( result, diff --git a/src/Umbraco.Web.UI/umbraco/UmbracoBackOffice/Default.cshtml b/src/Umbraco.Web.UI/umbraco/UmbracoBackOffice/Default.cshtml index 12a3c420fb..50394bc2a1 100644 --- a/src/Umbraco.Web.UI/umbraco/UmbracoBackOffice/Default.cshtml +++ b/src/Umbraco.Web.UI/umbraco/UmbracoBackOffice/Default.cshtml @@ -1,9 +1,11 @@ @using Microsoft.Extensions.Options; @using System.Globalization +@using Umbraco.Cms.Core @using Umbraco.Cms.Core.Configuration @using Umbraco.Cms.Core.Configuration.Models @using Umbraco.Cms.Core.Hosting @using Umbraco.Cms.Core.Logging +@using Umbraco.Cms.Core.Routing @using Umbraco.Cms.Core.Services @using Umbraco.Cms.Core.WebAssets @using Umbraco.Cms.Infrastructure.WebAssets @@ -119,7 +121,7 @@ } - + @if (isDebug)