Updates following PR review.

This commit is contained in:
Andy Butland
2020-09-01 18:10:12 +02:00
parent 1d124ea0ac
commit f1bda37a64
29 changed files with 48 additions and 48 deletions

View File

@@ -18,7 +18,7 @@ namespace Umbraco.Core.Configuration
public static string GetBackOfficePath(this GlobalSettings globalSettings, IHostingEnvironment hostingEnvironment)
{
if (_backOfficePath != null) return _backOfficePath;
_backOfficePath = hostingEnvironment.ToAbsolute(globalSettings.Path);
_backOfficePath = hostingEnvironment.ToAbsolute(globalSettings.UmbracoPath);
return _backOfficePath;
}
@@ -44,9 +44,9 @@ namespace Umbraco.Core.Configuration
internal static string GetUmbracoMvcAreaNoCache(this GlobalSettings globalSettings, IHostingEnvironment hostingEnvironment)
{
var path = string.IsNullOrEmpty(globalSettings.Path)
var path = string.IsNullOrEmpty(globalSettings.UmbracoPath)
? string.Empty
: hostingEnvironment.ToAbsolute(globalSettings.Path);
: hostingEnvironment.ToAbsolute(globalSettings.UmbracoPath);
if (path.IsNullOrWhiteSpace())
throw new InvalidOperationException("Cannot create an MVC Area path without the umbracoPath specified");

View File

@@ -30,7 +30,7 @@
public int VersionCheckPeriod { get; set; } = 7;
public string Path { get; set; } = "~/umbraco";
public string UmbracoPath { get; set; } = "~/umbraco";
public string IconsPath { get; set; } = $"~/umbraco/assets/icons";

View File

@@ -6,7 +6,7 @@
public int MaxCacheDays { get; set; } = 365;
public uint CachedNameLength { get; set; } = 7;
public uint CachedNameLength { get; set; } = 8;
public string CacheFolder { get; set; } = "../App_Data/Cache";
}

View File

@@ -77,7 +77,7 @@ namespace Umbraco.Web.HealthCheck.Checks.Permissions
{ _globalSettings.UmbracoCssPath, PermissionCheckRequirement.Optional },
{ _globalSettings.UmbracoMediaPath, PermissionCheckRequirement.Optional },
{ _globalSettings.UmbracoScriptsPath, PermissionCheckRequirement.Optional },
{ _globalSettings.Path, PermissionCheckRequirement.Optional },
{ _globalSettings.UmbracoPath, PermissionCheckRequirement.Optional },
{ Constants.SystemDirectories.MvcViews, PermissionCheckRequirement.Optional }
};

View File

@@ -138,7 +138,7 @@ namespace Umbraco.Core.Packaging
if (path.Contains("[$"))
{
//this is experimental and undocumented...
path = path.Replace("[$UMBRACO]", _globalSettings.Path);
path = path.Replace("[$UMBRACO]", _globalSettings.UmbracoPath);
path = path.Replace("[$CONFIG]", Constants.SystemDirectories.Config);
path = path.Replace("[$DATA]", Constants.SystemDirectories.Data);
}

View File

@@ -1,11 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Umbraco.Core.Configuration.UmbracoSettings;
using Umbraco.Core;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.Configuration.Models;
using Microsoft.Extensions.Options;
using Umbraco.Core;
using Umbraco.Core.Configuration.Models;
using Umbraco.Core.Models.PublishedContent;
namespace Umbraco.Web.Routing
{
@@ -28,8 +27,6 @@ namespace Umbraco.Web.Routing
/// <param name="propertyEditorCollection"></param>
public UrlProvider(IUmbracoContextAccessor umbracoContextAccessor, IOptions<WebRoutingSettings> routingSettings, UrlProviderCollection urlProviders, MediaUrlProviderCollection mediaUrlProviders, IVariationContextAccessor variationContextAccessor)
{
if (routingSettings == null) throw new ArgumentNullException(nameof(routingSettings));
_umbracoContextAccessor = umbracoContextAccessor ?? throw new ArgumentNullException(nameof(umbracoContextAccessor));
_urlProviders = urlProviders;
_mediaUrlProviders = mediaUrlProviders;

View File

@@ -103,7 +103,7 @@ namespace Umbraco.Core.Composing.CompositionExtensions
{
var hostingEnvironment = container.GetInstance<IHostingEnvironment>();
var globalSettings = container.GetInstance<IOptions<GlobalSettings>>().Value;
var mainLangFolder = new DirectoryInfo(hostingEnvironment.MapPathContentRoot(WebPath.Combine(globalSettings.Path , "config","lang")));
var mainLangFolder = new DirectoryInfo(hostingEnvironment.MapPathContentRoot(WebPath.Combine(globalSettings.UmbracoPath , "config","lang")));
var appPlugins = new DirectoryInfo(hostingEnvironment.MapPathContentRoot(Constants.SystemDirectories.AppPlugins));
var configLangFolder = new DirectoryInfo(hostingEnvironment.MapPathContentRoot(WebPath.Combine(Constants.SystemDirectories.Config ,"lang")));

View File

@@ -41,7 +41,7 @@ namespace Umbraco.Infrastructure.Configuration
TimeOutInMinutes = globalSettings.TimeOutInMinutes,
UmbracoCssPath = globalSettings.UmbracoCssPath,
UmbracoMediaPath = globalSettings.UmbracoMediaPath,
Path = globalSettings.UmbracoPath,
UmbracoPath = globalSettings.UmbracoPath,
UmbracoScriptsPath = globalSettings.UmbracoScriptsPath,
IconsPath = globalSettings.IconsPath,
UseHttps = globalSettings.UseHttps,

View File

@@ -41,7 +41,7 @@ namespace Umbraco.Infrastructure.Configuration
TimeOutInMinutes = globalSettings.TimeOutInMinutes,
UmbracoCssPath = globalSettings.UmbracoCssPath,
UmbracoMediaPath = globalSettings.UmbracoMediaPath,
UmbracoPath = globalSettings.Path,
UmbracoPath = globalSettings.UmbracoPath,
UmbracoScriptsPath = globalSettings.UmbracoScriptsPath,
IconsPath = globalSettings.IconsPath,
UseHttps = globalSettings.UseHttps,

View File

@@ -31,7 +31,7 @@ namespace Umbraco.Web.Install
_ioHelper = ioHelper;
_publishedSnapshotService = publishedSnapshotService;
_permissionDirs = new[] { _globalSettings.UmbracoCssPath, Constants.SystemDirectories.Config, Constants.SystemDirectories.Data, _globalSettings.UmbracoMediaPath, Constants.SystemDirectories.Preview };
_packagesPermissionsDirs = new[] { Constants.SystemDirectories.Bin, _globalSettings.Path, Constants.SystemDirectories.Packages };
_packagesPermissionsDirs = new[] { Constants.SystemDirectories.Bin, _globalSettings.UmbracoPath, Constants.SystemDirectories.Packages };
}
public bool RunFilePermissionTestSuite(out Dictionary<string, IEnumerable<string>> report)

View File

@@ -1,6 +1,7 @@
using System;
using System.Data.Common;
using System.Threading;
using Microsoft.Extensions.Options;
using NPoco;
using NPoco.FluentMappings;
using Umbraco.Core.Configuration.Models;
@@ -68,8 +69,8 @@ namespace Umbraco.Core.Persistence
/// Initializes a new instance of the <see cref="UmbracoDatabaseFactory"/>.
/// </summary>
/// <remarks>Used by core runtime.</remarks>
public UmbracoDatabaseFactory(ILogger logger, GlobalSettings globalSettings, ConnectionStrings connectionStrings, Lazy<IMapperCollection> mappers,IDbProviderFactoryCreator dbProviderFactoryCreator)
: this(logger, globalSettings, connectionStrings, Constants.System.UmbracoConnectionName, mappers, dbProviderFactoryCreator)
public UmbracoDatabaseFactory(ILogger logger, IOptions<GlobalSettings> globalSettings, IOptions<ConnectionStrings> connectionStrings, Lazy<IMapperCollection> mappers,IDbProviderFactoryCreator dbProviderFactoryCreator)
: this(logger, globalSettings.Value, connectionStrings.Value, Constants.System.UmbracoConnectionName, mappers, dbProviderFactoryCreator)
{
}

View File

@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using Microsoft.Extensions.Options;
using Umbraco.Core.Cache;
using Umbraco.Core.Composing;
using Umbraco.Core.Configuration;
@@ -407,7 +408,7 @@ namespace Umbraco.Core.Runtime
/// </summary>
/// <remarks>This is strictly internal, for tests only.</remarks>
protected internal virtual IUmbracoDatabaseFactory GetDatabaseFactory()
=> new UmbracoDatabaseFactory(Logger, _globalSettings, _connectionStrings, new Lazy<IMapperCollection>(() => _factory.GetInstance<IMapperCollection>()), DbProviderFactoryCreator);
=> new UmbracoDatabaseFactory(Logger, Options.Create(_globalSettings), Options.Create(_connectionStrings), new Lazy<IMapperCollection>(() => _factory.GetInstance<IMapperCollection>()), DbProviderFactoryCreator);
#endregion

View File

@@ -675,7 +675,7 @@ namespace Umbraco.Core.Services.Implement
public IEnumerable<string> GetPartialViewSnippetNames(params string[] filterNames)
{
var snippetPath = _hostingEnvironment.MapPathContentRoot($"{_globalSettings.Path}/PartialViewMacros/Templates/");
var snippetPath = _hostingEnvironment.MapPathContentRoot($"{_globalSettings.UmbracoPath}/PartialViewMacros/Templates/");
var files = Directory.GetFiles(snippetPath, "*.cshtml")
.Select(Path.GetFileNameWithoutExtension)
.Except(filterNames, StringComparer.InvariantCultureIgnoreCase)
@@ -909,7 +909,7 @@ namespace Umbraco.Core.Services.Implement
fileName += ".cshtml";
}
var snippetPath = _hostingEnvironment.MapPathContentRoot($"{_globalSettings.Path}/PartialViewMacros/Templates/{fileName}");
var snippetPath = _hostingEnvironment.MapPathContentRoot($"{_globalSettings.UmbracoPath}/PartialViewMacros/Templates/{fileName}");
return System.IO.File.Exists(snippetPath)
? Attempt<string>.Succeed(snippetPath)
: Attempt<string>.Fail();

View File

@@ -386,7 +386,7 @@ namespace Umbraco.Core.Services.Implement
var protocol = _globalSettings.UseHttps ? "https" : "http";
var subjectVars = new NotificationEmailSubjectParams(
string.Concat(siteUri.Authority, _ioHelper.ResolveUrl(_globalSettings.Path)),
string.Concat(siteUri.Authority, _ioHelper.ResolveUrl(_globalSettings.UmbracoPath)),
actionName,
content.Name);
@@ -402,7 +402,7 @@ namespace Umbraco.Core.Services.Implement
string.Concat(content.Id, ".aspx"),
protocol),
performingUser.Name,
string.Concat(siteUri.Authority, _ioHelper.ResolveUrl(_globalSettings.Path)),
string.Concat(siteUri.Authority, _ioHelper.ResolveUrl(_globalSettings.UmbracoPath)),
summary.ToString());
var fromMail = _contentSettings.Notifications.Email ?? _globalSettings.Smtp.From;

View File

@@ -48,7 +48,7 @@ namespace Umbraco.Web.WebAssets
}
jarray.Append("]");
return WriteScript(jarray.ToString(), hostingEnvironment.ToAbsolute(globalSettings.Path), angularModule);
return WriteScript(jarray.ToString(), hostingEnvironment.ToAbsolute(globalSettings.UmbracoPath), angularModule);
}
/// <summary>

View File

@@ -18,7 +18,7 @@ namespace Umbraco.Tests.Common.Builders
private bool? _hideTopLevelNodeFromPath;
private bool? _installEmptyDatabase;
private bool? _installMissingDatabase;
private string _path;
private string _umbracoPath;
private string _registerType;
private string _reservedPaths;
private string _reservedUrls;
@@ -81,9 +81,9 @@ namespace Umbraco.Tests.Common.Builders
return this;
}
public GlobalSettingsBuilder<TParent> WithPath(string path)
public GlobalSettingsBuilder<TParent> WithUmbracoPath(string umbracoPath)
{
_path = path;
_umbracoPath = umbracoPath;
return this;
}
@@ -164,7 +164,7 @@ namespace Umbraco.Tests.Common.Builders
var registerType = _registerType ?? null;
var reservedPaths = _reservedPaths ?? GlobalSettings.StaticReservedPaths;
var reservedUrls = _reservedUrls ?? GlobalSettings.StaticReservedUrls;
var path = _path ?? "~/umbraco";
var umbracoPath = _umbracoPath ?? "~/umbraco";
var useHttps = _useHttps ?? false;
var umbracoCssPath = _umbracoCssPath ?? "~/css";
var umbracoMediaPath = _umbracoMediaPath ?? "~/media";
@@ -187,7 +187,7 @@ namespace Umbraco.Tests.Common.Builders
RegisterType = registerType,
ReservedPaths = reservedPaths,
ReservedUrls = reservedUrls,
Path = path,
UmbracoPath = umbracoPath,
UseHttps = useHttps,
UmbracoCssPath = umbracoCssPath,
UmbracoMediaPath = umbracoMediaPath,

View File

@@ -57,7 +57,7 @@ namespace Umbraco.Tests.Security
var mgr = new BackOfficeCookieManager(
Mock.Of<IUmbracoContextAccessor>(),
runtime,
Mock.Of<IHostingEnvironment>(x => x.ApplicationVirtualPath == "/" && x.ToAbsolute(globalSettings.Path) == "/umbraco"),
Mock.Of<IHostingEnvironment>(x => x.ApplicationVirtualPath == "/" && x.ToAbsolute(globalSettings.UmbracoPath) == "/umbraco"),
globalSettings,
Mock.Of<IRequestCache>(),
Mock.Of<LinkGenerator>());
@@ -80,7 +80,7 @@ namespace Umbraco.Tests.Security
var mgr = new BackOfficeCookieManager(
Mock.Of<IUmbracoContextAccessor>(),
runtime,
Mock.Of<IHostingEnvironment>(x => x.ApplicationVirtualPath == "/" && x.ToAbsolute(globalSettings.Path) == "/umbraco" && x.ToAbsolute(Constants.SystemDirectories.Install) == "/install"),
Mock.Of<IHostingEnvironment>(x => x.ApplicationVirtualPath == "/" && x.ToAbsolute(globalSettings.UmbracoPath) == "/umbraco" && x.ToAbsolute(Constants.SystemDirectories.Install) == "/install"),
globalSettings,
Mock.Of<IRequestCache>(),
GetMockLinkGenerator(out var remainingTimeoutSecondsPath, out var isAuthPath));
@@ -105,7 +105,7 @@ namespace Umbraco.Tests.Security
var mgr = new BackOfficeCookieManager(
Mock.Of<IUmbracoContextAccessor>(),
runtime,
Mock.Of<IHostingEnvironment>(x => x.ApplicationVirtualPath == "/" && x.ToAbsolute(globalSettings.Path) == "/umbraco" && x.ToAbsolute(Constants.SystemDirectories.Install) == "/install"),
Mock.Of<IHostingEnvironment>(x => x.ApplicationVirtualPath == "/" && x.ToAbsolute(globalSettings.UmbracoPath) == "/umbraco" && x.ToAbsolute(Constants.SystemDirectories.Install) == "/install"),
globalSettings,
Mock.Of<IRequestCache>(x => x.IsAvailable == true && x.Get(Constants.Security.ForceReAuthFlag) == "not null"),
GetMockLinkGenerator(out var remainingTimeoutSecondsPath, out var isAuthPath));
@@ -127,7 +127,7 @@ namespace Umbraco.Tests.Security
var mgr = new BackOfficeCookieManager(
Mock.Of<IUmbracoContextAccessor>(),
runtime,
Mock.Of<IHostingEnvironment>(x => x.ApplicationVirtualPath == "/" && x.ToAbsolute(globalSettings.Path) == "/umbraco" && x.ToAbsolute(Constants.SystemDirectories.Install) == "/install"),
Mock.Of<IHostingEnvironment>(x => x.ApplicationVirtualPath == "/" && x.ToAbsolute(globalSettings.UmbracoPath) == "/umbraco" && x.ToAbsolute(Constants.SystemDirectories.Install) == "/install"),
globalSettings,
Mock.Of<IRequestCache>(),
GetMockLinkGenerator(out var remainingTimeoutSecondsPath, out var isAuthPath));

View File

@@ -37,7 +37,7 @@ namespace Umbraco.Tests.Components
var typeFinder = TestHelper.GetTypeFinder();
var globalSettings = new GlobalSettingsBuilder().Build();
var connectionStrings = new ConnectionStringsBuilder().Build();
var f = new UmbracoDatabaseFactory(logger, globalSettings, connectionStrings, new Lazy<IMapperCollection>(() => new MapperCollection(Enumerable.Empty<BaseMapper>())), TestHelper.DbProviderFactoryCreator);
var f = new UmbracoDatabaseFactory(logger, Options.Create(globalSettings), Options.Create(connectionStrings), new Lazy<IMapperCollection>(() => new MapperCollection(Enumerable.Empty<BaseMapper>())), TestHelper.DbProviderFactoryCreator);
var fs = new FileSystems(mock.Object, logger, TestHelper.IOHelper, Options.Create(globalSettings), TestHelper.GetHostingEnvironment());
var coreDebug = new CoreDebugSettingsBuilder().Build();
var mediaFileSystem = Mock.Of<IMediaFileSystem>();

View File

@@ -23,7 +23,7 @@ namespace Umbraco.Tests.Configurations
var hostingEnvironment = new AspNetHostingEnvironment(mockHostingSettings.Object);
var globalSettings = new GlobalSettingsBuilder().WithPath(path).Build();
var globalSettings = new GlobalSettingsBuilder().WithUmbracoPath(path).Build();
Assert.AreEqual(outcome, globalSettings.GetUmbracoMvcAreaNoCache(hostingEnvironment));
}

View File

@@ -3,6 +3,7 @@ using System.Configuration;
using System.Data.SqlServerCe;
using System.IO;
using System.Threading;
using Microsoft.Extensions.Options;
using Moq;
using NPoco;
using NUnit.Framework;
@@ -41,7 +42,7 @@ namespace Umbraco.Tests.Persistence
_umbracoVersion = TestHelper.GetUmbracoVersion();
var globalSettings = new GlobalSettingsBuilder().Build();
var connectionStrings = new ConnectionStringsBuilder().Build();
_databaseFactory = new UmbracoDatabaseFactory(_logger, globalSettings, connectionStrings, new Lazy<IMapperCollection>(() => Mock.Of<IMapperCollection>()), TestHelper.DbProviderFactoryCreator);
_databaseFactory = new UmbracoDatabaseFactory(_logger, Options.Create(globalSettings), Options.Create(connectionStrings), new Lazy<IMapperCollection>(() => Mock.Of<IMapperCollection>()), TestHelper.DbProviderFactoryCreator);
}
[TearDown]

View File

@@ -68,7 +68,7 @@ namespace Umbraco.Tests.Runtimes
var globalSettings = new GlobalSettingsBuilder().Build();
var connectionStrings = new ConnectionStringsBuilder().Build();
var typeFinder = TestHelper.GetTypeFinder();
var databaseFactory = new UmbracoDatabaseFactory(logger, globalSettings, connectionStrings, new Lazy<IMapperCollection>(() => factory.GetInstance<IMapperCollection>()), TestHelper.DbProviderFactoryCreator);
var databaseFactory = new UmbracoDatabaseFactory(logger, Options.Create(globalSettings), Options.Create(connectionStrings), new Lazy<IMapperCollection>(() => factory.GetInstance<IMapperCollection>()), TestHelper.DbProviderFactoryCreator);
var ioHelper = TestHelper.IOHelper;
var hostingEnvironment = Mock.Of<IHostingEnvironment>();
var typeLoader = new TypeLoader(typeFinder, appCaches.RuntimeCache, new DirectoryInfo(ioHelper.MapPath("~/App_Data/TEMP")), profilingLogger);

View File

@@ -188,7 +188,7 @@ namespace Umbraco.Tests.TestHelpers
new PackagesRepository(contentService.Value, contentTypeService.Value, dataTypeService.Value, fileService.Value, macroService.Value, localizationService.Value, hostingEnvironment,
new EntityXmlSerializer(contentService.Value, mediaService.Value, dataTypeService.Value, userService.Value, localizationService.Value, contentTypeService.Value, urlSegmentProviders, TestHelper.ShortStringHelper, propertyEditorCollection), logger, umbracoVersion, Options.Create(globalSettings), "installedPackages.config"),
new PackageInstallation(
new PackageDataInstallation(logger, fileService.Value, macroService.Value, localizationService.Value, dataTypeService.Value, entityService.Value, contentTypeService.Value, contentService.Value, propertyEditorCollection, scopeProvider, shortStringHelper, Microsoft.Extensions.Options.Options.Create(globalSettings), localizedTextService.Value),
new PackageDataInstallation(logger, fileService.Value, macroService.Value, localizationService.Value, dataTypeService.Value, entityService.Value, contentTypeService.Value, contentService.Value, propertyEditorCollection, scopeProvider, shortStringHelper, Options.Create(globalSettings), localizedTextService.Value),
new PackageFileInstallation(compiledPackageXmlParser, ioHelper, new ProfilingLogger(logger, new TestProfiler())),
compiledPackageXmlParser, Mock.Of<IPackageActionRunner>(),
Mock.Of<IHostingEnvironment>(x => x.ApplicationPhysicalPath == ioHelper.MapPath("~"))),

View File

@@ -21,7 +21,7 @@ namespace Umbraco.Web.BackOffice.Controllers
public BackOfficeAssetsController(IIOHelper ioHelper, IHostingEnvironment hostingEnvironment, ILogger logger, IOptions<GlobalSettings> globalSettings)
{
_jsLibFileSystem = new PhysicalFileSystem(ioHelper, hostingEnvironment, logger, globalSettings.Value.Path + Path.DirectorySeparatorChar + "lib");
_jsLibFileSystem = new PhysicalFileSystem(ioHelper, hostingEnvironment, logger, globalSettings.Value.UmbracoPath + Path.DirectorySeparatorChar + "lib");
}
[HttpGet]

View File

@@ -78,7 +78,7 @@ namespace Umbraco.Web.BackOffice.Controllers
[HttpGet]
public async Task<IActionResult> Default()
{
var viewPath = Path.Combine(_globalSettings.Path , Constants.Web.Mvc.BackOfficeArea, nameof(Default) + ".cshtml")
var viewPath = Path.Combine(_globalSettings.UmbracoPath , Constants.Web.Mvc.BackOfficeArea, nameof(Default) + ".cshtml")
.Replace("\\", "/"); // convert to forward slashes since it's a virtual path
return await RenderDefaultOrProcessExternalLoginAsync(
@@ -156,7 +156,7 @@ namespace Umbraco.Web.BackOffice.Controllers
[StatusCodeResult(System.Net.HttpStatusCode.ServiceUnavailable)]
public async Task<IActionResult> AuthorizeUpgrade()
{
var viewPath = Path.Combine(_globalSettings.Path, Umbraco.Core.Constants.Web.Mvc.BackOfficeArea, nameof(AuthorizeUpgrade) + ".cshtml");
var viewPath = Path.Combine(_globalSettings.UmbracoPath, Umbraco.Core.Constants.Web.Mvc.BackOfficeArea, nameof(AuthorizeUpgrade) + ".cshtml");
return await RenderDefaultOrProcessExternalLoginAsync(
//The default view to render when there is no external login info or errors
() => View(viewPath),

View File

@@ -77,7 +77,7 @@ namespace Umbraco.Web.BackOffice.Controllers
}
var viewPath = Path.Combine(
_globalSettings.Path,
_globalSettings.UmbracoPath,
Constants.Web.Mvc.BackOfficeArea,
ControllerExtensions.GetControllerName<PreviewController>() + ".cshtml")
.Replace("\\", "/"); // convert to forward slashes since it's a virtual path

View File

@@ -13,7 +13,7 @@ namespace Umbraco.Web.Common.AspNetCore
public AspNetCoreBackOfficeInfo(GlobalSettings globalSettings)
{
GetAbsoluteUrl = globalSettings.Path;
GetAbsoluteUrl = globalSettings.UmbracoPath;
}
public string GetAbsoluteUrl { get; } // TODO make absolute

View File

@@ -64,7 +64,7 @@ namespace Umbraco.Web.Common.AspNetCore
// creating previewBadge markup
markupToInject =
string.Format(ContentSettings.PreviewBadge,
IOHelper.ResolveUrl(GlobalSettings.Path),
IOHelper.ResolveUrl(GlobalSettings.UmbracoPath),
Context.Request.GetEncodedUrl(),
UmbracoContext.PublishedRequest.PublishedContent.Id);
}

View File

@@ -78,7 +78,7 @@ namespace Umbraco.Web.Common.Install
{
case ValidateRequestAttempt.FailedNoPrivileges:
case ValidateRequestAttempt.FailedNoContextId:
return Redirect(_globalSettings.Path + "/AuthorizeUpgrade?redir=" + Request.GetEncodedUrl());
return Redirect(_globalSettings.UmbracoPath + "/AuthorizeUpgrade?redir=" + Request.GetEncodedUrl());
}
}
@@ -86,7 +86,7 @@ namespace Umbraco.Web.Common.Install
ViewData.SetInstallApiBaseUrl(Url.GetInstallerApiUrl());
// get the base umbraco folder
var baseFolder = _hostingEnvironment.ToAbsolute(_globalSettings.Path);
var baseFolder = _hostingEnvironment.ToAbsolute(_globalSettings.UmbracoPath);
ViewData.SetUmbracoBaseFolder(baseFolder);
ViewData.SetUmbracoVersion(_umbracoVersion.SemanticVersion);

View File

@@ -115,7 +115,7 @@ namespace Umbraco.Web.Common.Security
private static bool RequestIsInUmbracoApplication(IHttpContextAccessor httpContextAccessor, GlobalSettings globalSettings, IHostingEnvironment hostingEnvironment)
{
return httpContextAccessor.GetRequiredHttpContext().Request.Path.ToString().IndexOf(hostingEnvironment.ToAbsolute(globalSettings.Path), StringComparison.InvariantCultureIgnoreCase) > -1;
return httpContextAccessor.GetRequiredHttpContext().Request.Path.ToString().IndexOf(hostingEnvironment.ToAbsolute(globalSettings.UmbracoPath), StringComparison.InvariantCultureIgnoreCase) > -1;
}
}
}