Merge remote-tracking branch 'origin/netcore/netcore' into netcore/task/6973-migrating-authenticationcontroller

Signed-off-by: Bjarke Berg <mail@bergmania.dk>

# Conflicts:
#	src/Umbraco.Infrastructure/HealthCheck/NotificationMethods/EmailNotificationMethod.cs
#	src/Umbraco.Web/Editors/AuthenticationController.cs
This commit is contained in:
Bjarke Berg
2020-10-26 14:30:59 +01:00
319 changed files with 2623 additions and 5551 deletions

View File

@@ -1,6 +1,6 @@
using Microsoft.AspNetCore.Mvc;
namespace Umbraco.Web.Common.ActionResults
namespace Umbraco.Web.BackOffice.ActionResults
{
public class JavaScriptResult : ContentResult
{

View File

@@ -1,7 +1,7 @@
using System.Net;
using Microsoft.AspNetCore.Mvc;
namespace Umbraco.Web.Common.ActionResults
namespace Umbraco.Web.BackOffice.ActionResults
{
public class UmbracoErrorResult : ObjectResult
{

View File

@@ -1,7 +1,7 @@
using Microsoft.AspNetCore.Mvc;
using Umbraco.Web.Models.ContentEditing;
namespace Umbraco.Web.Common.ActionResults
namespace Umbraco.Web.BackOffice.ActionResults
{
public class UmbracoNotificationSuccessResponse : OkObjectResult
{

View File

@@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Mail;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Routing;
using Microsoft.AspNetCore.Authentication;
@@ -345,6 +344,7 @@ namespace Umbraco.Web.BackOffice.Controllers
var user = _userService.GetByEmail(model.Email);
if (user != null)
{
var from = _globalSettings.Smtp.From;
var code = await _userManager.GeneratePasswordResetTokenAsync(identityUser);
var callbackUrl = ConstructCallbackUrl(identityUser.Id, code);
@@ -357,13 +357,7 @@ namespace Umbraco.Web.BackOffice.Controllers
// Ensure the culture of the found user is used for the email!
UmbracoUserExtensions.GetUserCulture(identityUser.Culture, _textService, _globalSettings));
var mailMessage = new MailMessage()
{
Subject = subject,
Body = message,
IsBodyHtml = true,
To = { user.Email }
};
var mailMessage = new EmailMessage(from, user.Email, subject, message, true);
await _emailSender.SendAsync(mailMessage);
@@ -405,6 +399,7 @@ namespace Umbraco.Web.BackOffice.Controllers
return NotFound();
}
var from = _globalSettings.Smtp.From;
// Generate the token and send it
var code = await _userManager.GenerateTwoFactorTokenAsync(user, provider);
if (string.IsNullOrWhiteSpace(code))
@@ -424,13 +419,7 @@ namespace Umbraco.Web.BackOffice.Controllers
if (provider == "Email")
{
var mailMessage = new MailMessage()
{
Subject = subject,
Body = message,
IsBodyHtml = true,
To = { user.Email }
};
var mailMessage = new EmailMessage(from, user.Email, subject, message, true);
await _emailSender.SendAsync(mailMessage);
}

View File

@@ -20,8 +20,8 @@ using Umbraco.Core.Serialization;
using Umbraco.Core.Services;
using Umbraco.Core.WebAssets;
using Umbraco.Extensions;
using Umbraco.Web.BackOffice.ActionResults;
using Umbraco.Web.BackOffice.Filters;
using Umbraco.Web.Common.ActionResults;
using Umbraco.Web.Common.Attributes;
using Umbraco.Web.Common.Filters;
using Umbraco.Web.Common.Security;
@@ -34,6 +34,7 @@ using System.Security.Claims;
namespace Umbraco.Web.BackOffice.Controllers
{
[DisableBrowserCache] //TODO Reintroduce
//[UmbracoRequireHttps] //TODO Reintroduce
[PluginController(Constants.Web.Mvc.BackOfficeArea)]
public class BackOfficeController : UmbracoController

View File

@@ -1,5 +1,4 @@
using Umbraco.Web.BackOffice.Filters;
using Umbraco.Web.WebApi.Filters;
namespace Umbraco.Web.BackOffice.Controllers
{

View File

@@ -18,7 +18,8 @@ using Umbraco.Web.BackOffice.HealthCheck;
using Umbraco.Web.BackOffice.Profiling;
using Umbraco.Web.BackOffice.PropertyEditors;
using Umbraco.Web.BackOffice.Routing;
using Umbraco.Web.Common.Attributes;
using Umbraco.Web.BackOffice.Trees;
using Umbraco.Web.Common.Attributes;
using Umbraco.Web.Editors;
using Umbraco.Web.Features;
using Umbraco.Web.Models.ContentEditing;

View File

@@ -31,12 +31,12 @@ using Constants = Umbraco.Core.Constants;
using Umbraco.Extensions;
using Umbraco.Web.BackOffice.Filters;
using Umbraco.Web.BackOffice.ModelBinders;
using Umbraco.Web.Common.ActionResults;
using Umbraco.Web.BackOffice.ActionResults;
using Umbraco.Web.Common.Attributes;
using Umbraco.Web.Common.Exceptions;
using Umbraco.Web.Common.Filters;
using Umbraco.Web.Models.Mapping;
using Umbraco.Web.WebApi.Filters;
namespace Umbraco.Web.BackOffice.Controllers
{

View File

@@ -33,12 +33,11 @@ using Umbraco.Core.Strings;
using Umbraco.Extensions;
using Umbraco.Web.BackOffice.Filters;
using Umbraco.Web.BackOffice.ModelBinders;
using Umbraco.Web.Common.ActionResults;
using Umbraco.Web.BackOffice.ActionResults;
using Umbraco.Web.Common.Attributes;
using Umbraco.Web.Common.Exceptions;
using Umbraco.Web.ContentApps;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.WebApi.Filters;
using Constants = Umbraco.Core.Constants;
namespace Umbraco.Web.BackOffice.Controllers

View File

@@ -32,7 +32,6 @@ using Umbraco.Web.Common.Filters;
using Umbraco.Web.ContentApps;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Security;
using Umbraco.Web.WebApi.Filters;
using Constants = Umbraco.Core.Constants;
namespace Umbraco.Web.BackOffice.Controllers

View File

@@ -15,7 +15,7 @@ using Umbraco.Core.Services;
using Umbraco.Core.WebAssets;
using Umbraco.Extensions;
using Umbraco.Web.BackOffice.Filters;
using Umbraco.Web.Common.ActionResults;
using Umbraco.Web.BackOffice.ActionResults;
using Umbraco.Web.Common.Filters;
using Umbraco.Web.Editors;
using Umbraco.Web.Features;

View File

@@ -8,12 +8,12 @@ using Umbraco.Core.Models;
using Umbraco.Core.Security;
using Umbraco.Core.Services;
using Umbraco.Web.BackOffice.Controllers;
using Umbraco.Web.BackOffice.Trees;
using Umbraco.Web.Common.Attributes;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.Security;
using Umbraco.Web.Services;
using Umbraco.Web.Trees;
namespace Umbraco.Web.BackOffice.Controllers
{

View File

@@ -10,7 +10,7 @@ using Umbraco.Core.Security;
using Umbraco.Core.Services;
using Umbraco.Core.Strings;
using Umbraco.Web.BackOffice.Filters;
using Umbraco.Web.Common.ActionResults;
using Umbraco.Web.BackOffice.ActionResults;
using Umbraco.Web.Common.Attributes;
using Umbraco.Web.Common.Exceptions;
using Umbraco.Web.Models.ContentEditing;

View File

@@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Mail;
using System.Runtime.Serialization;
using System.Security.Cryptography;
using System.Threading.Tasks;
@@ -29,12 +28,11 @@ using Umbraco.Core.Services;
using Umbraco.Core.Strings;
using Umbraco.Web.Models;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.WebApi.Filters;
using Umbraco.Extensions;
using Umbraco.Web.BackOffice.Filters;
using Umbraco.Web.BackOffice.ModelBinders;
using Umbraco.Web.BackOffice.Security;
using Umbraco.Web.Common.ActionResults;
using Umbraco.Web.BackOffice.ActionResults;
using Umbraco.Web.Common.Attributes;
using Umbraco.Web.Common.Exceptions;
using Umbraco.Web.Editors;
@@ -543,13 +541,7 @@ namespace Umbraco.Web.BackOffice.Controllers
UmbracoUserExtensions.GetUserCulture(to.Language, _localizedTextService, _globalSettings),
new[] { userDisplay.Name, from, message, inviteUri.ToString(), fromEmail });
var mailMessage = new MailMessage()
{
Subject = emailSubject,
Body = emailBody,
IsBodyHtml = true,
To = { to.Email}
};
var mailMessage = new EmailMessage(fromEmail, to.Email, emailSubject, emailBody, true);
await _emailSender.SendAsync(mailMessage);
}

View File

@@ -1,7 +1,13 @@
using System;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using SixLabors.ImageSharp.Web.DependencyInjection;
using Umbraco.Composing;
using Umbraco.Core;
using Umbraco.Core.Configuration.Models;
using Umbraco.Core.IO;
using Umbraco.Web.BackOffice.Routing;
using Umbraco.Web.BackOffice.Security;
@@ -23,6 +29,18 @@ namespace Umbraco.Extensions
app.UseUmbracoPreview();
app.UseUmbracoInstaller();
// TODO: remove current class, it's on its last legs.
Current.Initialize(
app.ApplicationServices.GetService<ILogger<object>>(),
app.ApplicationServices.GetService<IOptions<SecuritySettings>>().Value,
app.ApplicationServices.GetService<IOptions<GlobalSettings>>().Value,
app.ApplicationServices.GetService<IIOHelper>(),
app.ApplicationServices.GetService<Umbraco.Core.Hosting.IHostingEnvironment>(),
app.ApplicationServices.GetService<IBackOfficeInfo>(),
app.ApplicationServices.GetService<Umbraco.Core.Logging.IProfiler>()
);
return app;
}

View File

@@ -14,6 +14,7 @@ using Umbraco.Core.BackOffice;
using Umbraco.Core.Configuration.Models;
using Umbraco.Core.Security;
using Umbraco.Core.Serialization;
using Umbraco.Infrastructure.BackOffice;
using Umbraco.Net;
using Umbraco.Web.BackOffice.Filters;
using Umbraco.Web.BackOffice.Security;
@@ -72,7 +73,7 @@ namespace Umbraco.Extensions
services.ConfigureOptions<ConfigureBackOfficeSecurityStampValidatorOptions>();
}
private static IdentityBuilder BuildUmbracoBackOfficeIdentity(this IServiceCollection services)
private static BackOfficeIdentityBuilder BuildUmbracoBackOfficeIdentity(this IServiceCollection services)
{
// Borrowed from https://github.com/dotnet/aspnetcore/blob/master/src/Identity/Extensions.Core/src/IdentityServiceCollectionExtensions.cs#L33
// The reason we need our own is because the Identity system doesn't cater easily for multiple identity systems and particularly being
@@ -96,7 +97,7 @@ namespace Umbraco.Extensions
services.TryAddScoped<BackOfficeLookupNormalizer>();
services.TryAddScoped<BackOfficeIdentityErrorDescriber>();
return new IdentityBuilder(typeof(BackOfficeIdentityUser), services);
return new BackOfficeIdentityBuilder(services);
}
}
}

View File

@@ -1,5 +1,8 @@
using Umbraco.Core.Composing;
using Umbraco.Web.Trees;
using Umbraco.Web.BackOffice.Controllers;
using Umbraco.Web.Common.Controllers;
using Umbraco.Web.Common.Install;
using Umbraco.Web.BackOffice.Trees;
// the namespace here is intentional - although defined in Umbraco.Web assembly,
// this class should be visible when using Umbraco.Core.Components, alongside
@@ -25,5 +28,25 @@ namespace Umbraco.Extensions
#endregion
/// <summary>
/// Registers Umbraco backoffice controllers.
/// </summary>
public static Composition ComposeUmbracoBackOfficeControllers(this Composition composition)
{
composition.RegisterControllers(new []
{
typeof(BackOfficeController),
typeof(PreviewController),
typeof(AuthenticationController),
typeof(InstallController),
typeof(InstallApiController),
});
var umbracoAuthorizedApiControllers = composition.TypeLoader.GetTypes<UmbracoApiController>();
composition.RegisterControllers(umbracoAuthorizedApiControllers);
return composition;
}
}
}

View File

@@ -4,7 +4,7 @@ using System.Linq;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ModelBinding;
using Umbraco.Core;
using Umbraco.Web.PropertyEditors.Validation;
using Umbraco.Web.BackOffice.PropertyEditors.Validation;
namespace Umbraco.Extensions
{

View File

@@ -4,9 +4,9 @@ namespace Umbraco.Extensions
{
public static class UmbracoBuilderExtensions
{
public static void BuildWithAllBackOfficeComponents(this IUmbracoBuilder builder)
public static IUmbracoBuilder WithAllBackOfficeComponents(this IUmbracoBuilder builder)
{
builder
return builder
.WithConfiguration()
.WithCore()
.WithWebComponents()
@@ -16,8 +16,7 @@ namespace Umbraco.Extensions
.WithMiniProfiler()
.WithMvcAndRazor()
.WithWebServer()
.WithPreview()
.Build();
.WithPreview();
}
public static IUmbracoBuilder WithBackOffice(this IUmbracoBuilder builder)

View File

@@ -2,7 +2,7 @@
using Umbraco.Core.BackOffice;
using Umbraco.Core.Composing;
using Umbraco.Core.Mapping;
using Umbraco.Web.Models.Mapping;
using Umbraco.Web.BackOffice.Mapping;
namespace Umbraco.Extensions
{

View File

@@ -5,7 +5,7 @@ using Microsoft.AspNetCore.Mvc.Filters;
using Umbraco.Core.Events;
using Umbraco.Web.Models.ContentEditing;
namespace Umbraco.Web.WebApi.Filters
namespace Umbraco.Web.BackOffice.Filters
{
/// <summary>
/// Automatically checks if any request is a non-GET and if the

View File

@@ -13,7 +13,7 @@ using Umbraco.Web.Common.ActionsResults;
using Umbraco.Web.Common.Exceptions;
using Umbraco.Web.Models.ContentEditing;
namespace Umbraco.Web.Editors
namespace Umbraco.Web.BackOffice.Filters
{
/// <summary>
/// An attribute/filter that wires up the persisted entity of the DataTypeSave model and validates the whole request

View File

@@ -2,9 +2,10 @@
using Microsoft.AspNetCore.Mvc.Filters;
using Umbraco.Core.Dashboards;
using Umbraco.Core.Events;
using Umbraco.Web.Editors;
using Umbraco.Web.Models.ContentEditing;
namespace Umbraco.Web.Editors
namespace Umbraco.Web.BackOffice.Filters
{
/// <summary>
/// Used to emit events for editor models in the back office

View File

@@ -10,7 +10,7 @@ using Umbraco.Web.Common.Exceptions;
using Umbraco.Web.Editors;
using Umbraco.Web.Security;
namespace Umbraco.Web.WebApi.Filters
namespace Umbraco.Web.BackOffice.Filters
{
/// <summary>
/// Auth filter to check if the current user has access to the content item

View File

@@ -9,7 +9,7 @@ using Microsoft.Extensions.Logging;
using Umbraco.Core;
using Umbraco.Web.Models.ContentEditing;
namespace Umbraco.Web.WebApi.Filters
namespace Umbraco.Web.BackOffice.Filters
{
/// <summary>
/// Checks if the parameter is IHaveUploadedFiles and then deletes any temporary saved files from file uploads

View File

@@ -13,7 +13,7 @@ using Umbraco.Core.Services;
using Umbraco.Web.Security;
namespace Umbraco.Web.WebApi.Filters
namespace Umbraco.Web.BackOffice.Filters
{
/// <summary>
/// This inspects the result of the action that returns a collection of content and removes

View File

@@ -3,7 +3,7 @@ using Microsoft.AspNetCore.Mvc.Filters;
using Umbraco.Core.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Umbraco.Core.WebAssets;
using Umbraco.Web.Common.ActionResults;
using Umbraco.Web.BackOffice.ActionResults;
namespace Umbraco.Web.BackOffice.Filters
{

View File

@@ -6,7 +6,7 @@ using Umbraco.Core.Security;
using Umbraco.Web.Editors;
using Umbraco.Web.Security;
namespace Umbraco.Web.WebApi.Filters
namespace Umbraco.Web.BackOffice.Filters
{
/// <summary>
/// Used to emit outgoing editor model events

View File

@@ -7,7 +7,7 @@ using Umbraco.Core;
using Umbraco.Core.Configuration.Models;
using Umbraco.Web.BackOffice.Security;
namespace Umbraco.Extensions
namespace Umbraco.Web.BackOffice.Filters
{
/// <summary>
/// An attribute/filter to set the csrf cookie token based on angular conventions

View File

@@ -6,7 +6,7 @@ using Umbraco.Core;
using Umbraco.Core.Mapping;
using Umbraco.Core.Models.Membership;
using Umbraco.Core.Services;
using Umbraco.Web.Common.ActionResults;
using Umbraco.Web.BackOffice.ActionResults;
using Umbraco.Web.Common.Exceptions;
using Umbraco.Web.Models.ContentEditing;

View File

@@ -5,9 +5,9 @@ using Microsoft.AspNetCore.Routing;
using Umbraco.Core.Models;
using Umbraco.Extensions;
using Umbraco.Web.Common.Controllers;
using Umbraco.Web.Trees;
using Umbraco.Web.BackOffice.Trees;
namespace Umbraco.Web.Models.Mapping
namespace Umbraco.Web.BackOffice.Mapping
{
public class CommonTreeNodeMapper
{

View File

@@ -10,10 +10,11 @@ using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.Models.Membership;
using Umbraco.Core.Services;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Models.Mapping;
using Umbraco.Web.Routing;
using Umbraco.Web.Trees;
using Umbraco.Web.BackOffice.Trees;
namespace Umbraco.Web.Models.Mapping
namespace Umbraco.Web.BackOffice.Mapping
{
/// <summary>
/// Declares how model mappings for content

View File

@@ -8,9 +8,10 @@ using Umbraco.Core.Models;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Services;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Trees;
using Umbraco.Web.Models.Mapping;
using Umbraco.Web.BackOffice.Trees;
namespace Umbraco.Web.Models.Mapping
namespace Umbraco.Web.BackOffice.Mapping
{
/// <summary>
/// Declares model mappings for media.

View File

@@ -3,9 +3,10 @@ using Umbraco.Core;
using Umbraco.Core.Mapping;
using Umbraco.Core.Models;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Trees;
using Umbraco.Web.Models.Mapping;
using Umbraco.Web.BackOffice.Trees;
namespace Umbraco.Web.Models.Mapping
namespace Umbraco.Web.BackOffice.Mapping
{
/// <summary>
/// Declares model mappings for members.

View File

@@ -1,7 +1,8 @@
using Newtonsoft.Json;
using System.ComponentModel.DataAnnotations;
using Umbraco.Web.PropertyEditors.Validation;
namespace Umbraco.Web.PropertyEditors.Validation
namespace Umbraco.Web.BackOffice.PropertyEditors.Validation
{
/// <summary>
/// Custom <see cref="ValidationResult"/> for content properties
@@ -9,7 +10,7 @@ namespace Umbraco.Web.PropertyEditors.Validation
/// <remarks>
/// This clones the original result and then ensures the nested result if it's the correct type.
///
/// For a more indepth explanation of how server side validation works with the angular app, see this GitHub PR:
/// For a more indepth explanation of how server side validation works with the angular app, see this GitHub PR:
/// https://github.com/umbraco/Umbraco-CMS/pull/8339
/// </remarks>
public class ContentPropertyValidationResult : ValidationResult

View File

@@ -7,8 +7,9 @@ using System.Linq;
using Microsoft.AspNetCore.Mvc.ModelBinding;
using Umbraco.Core;
using Umbraco.Extensions;
using Umbraco.Web.PropertyEditors.Validation;
namespace Umbraco.Web.PropertyEditors.Validation
namespace Umbraco.Web.BackOffice.PropertyEditors.Validation
{
/// <summary>
/// Custom json converter for <see cref="ValidationResult"/> and <see cref="ContentPropertyValidationResult"/>

View File

@@ -41,7 +41,7 @@ namespace Umbraco.Web.BackOffice.Runtime
composition.ComposeWebMappingProfiles();
composition.RegisterUniqueFor<IFileSystem, FilesTreeController>(factory =>
composition.RegisterUnique<IPhysicalFileSystem>(factory =>
new PhysicalFileSystem(
factory.GetInstance<IIOHelper>(),
factory.GetInstance<IHostingEnvironment>(),
@@ -50,6 +50,8 @@ namespace Umbraco.Web.BackOffice.Runtime
composition.RegisterUnique<IIconService, IconService>();
composition.RegisterUnique<UnhandledExceptionLoggerMiddleware>();
composition.ComposeUmbracoBackOfficeControllers();
}
}
}

View File

@@ -27,6 +27,7 @@ namespace Umbraco.Web.BackOffice.Security
/// </summary>
public class ConfigureBackOfficeCookieOptions : IConfigureNamedOptions<CookieAuthenticationOptions>
{
private readonly IServiceProvider _serviceProvider;
private readonly IUmbracoContextAccessor _umbracoContextAccessor;
private readonly SecuritySettings _securitySettings;
private readonly GlobalSettings _globalSettings;
@@ -37,10 +38,10 @@ namespace Umbraco.Web.BackOffice.Security
private readonly IUserService _userService;
private readonly IIpResolver _ipResolver;
private readonly ISystemClock _systemClock;
private readonly BackOfficeSessionIdValidator _sessionIdValidator;
private readonly LinkGenerator _linkGenerator;
public ConfigureBackOfficeCookieOptions(
IServiceProvider serviceProvider,
IUmbracoContextAccessor umbracoContextAccessor,
IOptions<SecuritySettings> securitySettings,
IOptions<GlobalSettings> globalSettings,
@@ -51,9 +52,9 @@ namespace Umbraco.Web.BackOffice.Security
IUserService userService,
IIpResolver ipResolver,
ISystemClock systemClock,
BackOfficeSessionIdValidator sessionIdValidator,
LinkGenerator linkGenerator)
{
_serviceProvider = serviceProvider;
_umbracoContextAccessor = umbracoContextAccessor;
_securitySettings = securitySettings.Value;
_globalSettings = globalSettings.Value;
@@ -64,7 +65,6 @@ namespace Umbraco.Web.BackOffice.Security
_userService = userService;
_ipResolver = ipResolver;
_systemClock = systemClock;
_sessionIdValidator = sessionIdValidator;
_linkGenerator = linkGenerator;
}
@@ -226,7 +226,10 @@ namespace Umbraco.Web.BackOffice.Security
private async Task EnsureValidSessionId(CookieValidatePrincipalContext context)
{
if (_runtimeState.Level == RuntimeLevel.Run)
await _sessionIdValidator.ValidateSessionAsync(TimeSpan.FromMinutes(1), context);
{
var validator = _serviceProvider.GetRequiredService<BackOfficeSessionIdValidator>();
await validator.ValidateSessionAsync(TimeSpan.FromMinutes(1), context);
}
}
/// <summary>

View File

@@ -1,5 +1,4 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.SignalR;
namespace Umbraco.Web.BackOffice.SignalR
{

View File

@@ -1,5 +1,4 @@
using Microsoft.AspNetCore.SignalR;
using System.Threading.Tasks;
namespace Umbraco.Web.BackOffice.SignalR
{

View File

@@ -1,5 +1,4 @@
using System;
using System.Configuration;
using Microsoft.AspNetCore.SignalR;
using Umbraco.Core.Cache;
using Umbraco.Core.Composing;

View File

@@ -1,8 +1,7 @@
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.BackOffice.SignalR;
namespace Umbraco.Web.SignalR
namespace Umbraco.Web.BackOffice.SignalR
{
[RuntimeLevel(MinLevel = RuntimeLevel.Run)]
public class PreviewHubComposer : ComponentComposer<PreviewHubComponent>, ICoreComposer

View File

@@ -1,5 +1,4 @@

using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
@@ -15,16 +14,16 @@ using Umbraco.Core;
using Umbraco.Core.Services;
using Umbraco.Extensions;
using Umbraco.Web.BackOffice.Controllers;
using Umbraco.Web.BackOffice.Trees;
using Umbraco.Web.Common.Attributes;
using Umbraco.Web.Common.Exceptions;
using Umbraco.Web.Common.Filters;
using Umbraco.Web.Common.ModelBinders;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.Services;
using Umbraco.Web.Trees;
using Constants = Umbraco.Core.Constants;
namespace Umbraco.Web.Trees
namespace Umbraco.Web.BackOffice.Trees
{
/// <summary>
/// Used to return tree root nodes

View File

@@ -7,13 +7,13 @@ using Umbraco.Core.Models.Entities;
using Umbraco.Core.Services;
using Umbraco.Web.Actions;
using Umbraco.Web.BackOffice.Filters;
using Umbraco.Web.BackOffice.Trees;
using Umbraco.Web.Common.Attributes;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.Trees;
using Umbraco.Web.WebApi;
using Constants = Umbraco.Core.Constants;
namespace Umbraco.Web.Trees
namespace Umbraco.Web.BackOffice.Trees
{
/// <summary>
/// The content blueprint tree controller

View File

@@ -16,15 +16,15 @@ using Umbraco.Core.Configuration;
using Umbraco.Core.Security;
using Constants = Umbraco.Core.Constants;
using Umbraco.Web.BackOffice.Filters;
using Umbraco.Web.BackOffice.Trees;
using Umbraco.Web.Common.Attributes;
using Umbraco.Web.Common.Exceptions;
using Umbraco.Web.Security;
using Umbraco.Web.WebApi;
using Umbraco.Core.Configuration.Models;
using Microsoft.Extensions.Options;
using Umbraco.Web.Trees;
namespace Umbraco.Web.Trees
namespace Umbraco.Web.BackOffice.Trees
{
//We will not allow the tree to render unless the user has access to any of the sections that the tree gets rendered
// this is not ideal but until we change permissions to be tree based (not section) there's not much else we can do here.

View File

@@ -14,13 +14,13 @@ using Microsoft.AspNetCore.Mvc;
using Umbraco.Web.Actions;
using Umbraco.Core.Security;
using Umbraco.Extensions;
using Umbraco.Web.BackOffice.Trees;
using Umbraco.Web.Common.Exceptions;
using Umbraco.Web.Common.ModelBinders;
using Umbraco.Web.Security;
using Umbraco.Web.Trees;
using Umbraco.Web.WebApi;
namespace Umbraco.Web.Trees
namespace Umbraco.Web.BackOffice.Trees
{
public abstract class ContentTreeControllerBase : TreeController, ITreeNodeController
{

View File

@@ -7,14 +7,14 @@ using Umbraco.Core.Models;
using Umbraco.Core.Services;
using Umbraco.Web.Actions;
using Umbraco.Web.BackOffice.Filters;
using Umbraco.Web.BackOffice.Trees;
using Umbraco.Web.Common.Attributes;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.Search;
using Umbraco.Web.Trees;
using Umbraco.Web.WebApi;
namespace Umbraco.Web.Trees
namespace Umbraco.Web.BackOffice.Trees
{
[UmbracoTreeAuthorize(Constants.Trees.DocumentTypes)]
[Tree(Constants.Applications.Settings, Constants.Trees.DocumentTypes, SortOrder = 0, TreeGroup = Constants.Trees.Groups.Settings)]

View File

@@ -11,11 +11,11 @@ using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Search;
using Constants = Umbraco.Core.Constants;
using Umbraco.Web.BackOffice.Filters;
using Umbraco.Web.BackOffice.Trees;
using Umbraco.Web.Common.Attributes;
using Umbraco.Web.Trees;
using Umbraco.Web.WebApi;
namespace Umbraco.Web.Trees
namespace Umbraco.Web.BackOffice.Trees
{
[UmbracoTreeAuthorize(Constants.Trees.DataTypes)]
[Tree(Constants.Applications.Settings, Constants.Trees.DataTypes, SortOrder = 3, TreeGroup = Constants.Trees.Groups.Settings)]

View File

@@ -6,12 +6,12 @@ using Umbraco.Core.Models;
using Umbraco.Core.Services;
using Umbraco.Web.Actions;
using Umbraco.Web.BackOffice.Filters;
using Umbraco.Web.BackOffice.Trees;
using Umbraco.Web.Common.Attributes;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.Trees;
using Umbraco.Web.WebApi;
namespace Umbraco.Web.Trees
namespace Umbraco.Web.BackOffice.Trees
{
[UmbracoTreeAuthorize(

View File

@@ -3,10 +3,10 @@ using Umbraco.Core.Hosting;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.Services;
using Umbraco.Web.BackOffice.Trees;
using Umbraco.Web.Trees;
using Umbraco.Web.WebApi;
namespace Umbraco.Web.Trees
namespace Umbraco.Web.BackOffice.Trees
{
[Tree(Constants.Applications.Settings, "files", TreeTitle = "Files", TreeUse = TreeUse.Dialog)]
[CoreTree]
@@ -20,7 +20,7 @@ namespace Umbraco.Web.Trees
ILocalizedTextService localizedTextService,
UmbracoApiControllerTypeCollection umbracoApiControllerTypeCollection,
IMenuItemCollectionFactory menuItemCollectionFactory,
IFileSystem fileSystem)
IPhysicalFileSystem fileSystem)
: base(localizedTextService, umbracoApiControllerTypeCollection, menuItemCollectionFactory)
{
FileSystem = fileSystem;

View File

@@ -3,7 +3,7 @@ using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Umbraco.Web.Common.ModelBinders;
namespace Umbraco.Web.Trees
namespace Umbraco.Web.BackOffice.Trees
{
/// <summary>
/// Represents an TreeNodeController

View File

@@ -1,13 +1,13 @@
using Microsoft.AspNetCore.Http;
using Umbraco.Core.Services;
using Umbraco.Web.BackOffice.Filters;
using Umbraco.Web.BackOffice.Trees;
using Umbraco.Web.Common.Attributes;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.Trees;
using Umbraco.Web.WebApi;
using Constants = Umbraco.Core.Constants;
namespace Umbraco.Web.Trees
namespace Umbraco.Web.BackOffice.Trees
{
[UmbracoTreeAuthorize(Constants.Trees.Languages)]
[Tree(Constants.Applications.Settings, Constants.Trees.Languages, SortOrder = 11, TreeGroup = Constants.Trees.Groups.Settings)]

View File

@@ -1,13 +1,13 @@
using Microsoft.AspNetCore.Http;
using Umbraco.Core.Services;
using Umbraco.Web.BackOffice.Filters;
using Umbraco.Web.BackOffice.Trees;
using Umbraco.Web.Common.Attributes;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.Trees;
using Umbraco.Web.WebApi;
using Constants = Umbraco.Core.Constants;
namespace Umbraco.Web.Trees
namespace Umbraco.Web.BackOffice.Trees
{
[UmbracoTreeAuthorize(Constants.Trees.LogViewer)]
[Tree(Constants.Applications.Settings, Constants.Trees.LogViewer, SortOrder= 9, TreeGroup = Constants.Trees.Groups.Settings)]

View File

@@ -4,12 +4,12 @@ using Umbraco.Core.Services;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.Actions;
using Umbraco.Web.BackOffice.Filters;
using Umbraco.Web.BackOffice.Trees;
using Umbraco.Web.Common.Attributes;
using Umbraco.Web.Trees;
using Umbraco.Web.WebApi;
using Constants = Umbraco.Core.Constants;
namespace Umbraco.Web.Trees
namespace Umbraco.Web.BackOffice.Trees
{
[UmbracoTreeAuthorize(Constants.Trees.Macros)]
[Tree(Constants.Applications.Settings, Constants.Trees.Macros, TreeTitle = "Macros", SortOrder = 4, TreeGroup = Constants.Trees.Groups.Settings)]

View File

@@ -15,13 +15,13 @@ using Umbraco.Web.Search;
using Umbraco.Core.Security;
using Constants = Umbraco.Core.Constants;
using Umbraco.Web.BackOffice.Filters;
using Umbraco.Web.BackOffice.Trees;
using Umbraco.Web.Common.Attributes;
using Umbraco.Web.Common.Exceptions;
using Umbraco.Web.Security;
using Umbraco.Web.Trees;
using Umbraco.Web.WebApi;
namespace Umbraco.Web.Trees
namespace Umbraco.Web.BackOffice.Trees
{
//We will not allow the tree to render unless the user has access to any of the sections that the tree gets rendered
// this is not ideal but until we change permissions to be tree based (not section) there's not much else we can do here.

View File

@@ -10,11 +10,11 @@ using Umbraco.Web.Actions;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Search;
using Umbraco.Web.BackOffice.Filters;
using Umbraco.Web.BackOffice.Trees;
using Umbraco.Web.Common.Attributes;
using Umbraco.Web.Trees;
using Umbraco.Web.WebApi;
namespace Umbraco.Web.Trees
namespace Umbraco.Web.BackOffice.Trees
{
[UmbracoTreeAuthorize(Constants.Trees.MediaTypes)]
[Tree(Constants.Applications.Settings, Constants.Trees.MediaTypes, SortOrder = 1, TreeGroup = Constants.Trees.Groups.Settings)]

View File

@@ -4,12 +4,12 @@ using Microsoft.AspNetCore.Http;
using Umbraco.Core;
using Umbraco.Core.Services;
using Umbraco.Web.BackOffice.Filters;
using Umbraco.Web.BackOffice.Trees;
using Umbraco.Web.Common.Attributes;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.Trees;
using Umbraco.Web.WebApi;
namespace Umbraco.Web.Trees
namespace Umbraco.Web.BackOffice.Trees
{
[UmbracoTreeAuthorize(Constants.Trees.MemberGroups)]
[Tree(Constants.Applications.Members, Constants.Trees.MemberGroups, SortOrder = 1)]

View File

@@ -18,9 +18,10 @@ using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Search;
using Constants = Umbraco.Core.Constants;
using Umbraco.Web.Security;
using Umbraco.Web.Trees;
using Umbraco.Web.WebApi;
namespace Umbraco.Web.Trees
namespace Umbraco.Web.BackOffice.Trees
{
//We will not allow the tree to render unless the user has access to any of the sections that the tree gets rendered
// this is not ideal but until we change permissions to be tree based (not section) there's not much else we can do here.

View File

@@ -3,12 +3,12 @@ using Microsoft.AspNetCore.Http;
using Umbraco.Core;
using Umbraco.Core.Services;
using Umbraco.Web.Actions;
using Umbraco.Web.BackOffice.Trees;
using Umbraco.Web.Common.Attributes;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.Trees;
using Umbraco.Web.WebApi;
namespace Umbraco.Web.Trees
namespace Umbraco.Web.BackOffice.Trees
{
[PluginController(Constants.Web.Mvc.BackOfficeTreeArea)]
[CoreTree]

View File

@@ -10,9 +10,10 @@ using Umbraco.Web.Common.Attributes;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.Search;
using Umbraco.Web.Trees;
using Umbraco.Web.WebApi;
namespace Umbraco.Web.Trees
namespace Umbraco.Web.BackOffice.Trees
{
[CoreTree]
[UmbracoTreeAuthorize(Constants.Trees.MemberTypes)]

View File

@@ -1,13 +1,13 @@
using Microsoft.AspNetCore.Http;
using Umbraco.Core.Services;
using Umbraco.Web.BackOffice.Filters;
using Umbraco.Web.BackOffice.Trees;
using Umbraco.Web.Common.Attributes;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.Trees;
using Umbraco.Web.WebApi;
using Constants = Umbraco.Core.Constants;
namespace Umbraco.Web.Trees
namespace Umbraco.Web.BackOffice.Trees
{
[UmbracoTreeAuthorize(Constants.Trees.Packages)]
[Tree(Constants.Applications.Packages, Constants.Trees.Packages, SortOrder = 0, IsSingleNodeTree = true)]

View File

@@ -2,12 +2,12 @@
using Umbraco.Core.IO;
using Umbraco.Core.Services;
using Umbraco.Web.BackOffice.Filters;
using Umbraco.Web.BackOffice.Trees;
using Umbraco.Web.Common.Attributes;
using Umbraco.Web.Trees;
using Umbraco.Web.WebApi;
using Constants = Umbraco.Core.Constants;
namespace Umbraco.Web.Trees
namespace Umbraco.Web.BackOffice.Trees
{
/// <summary>
/// Tree for displaying partial view macros in the developer app

View File

@@ -2,15 +2,14 @@
using Umbraco.Core.IO;
using Umbraco.Core.Services;
using Umbraco.Web.BackOffice.Filters;
using Umbraco.Web.BackOffice.Trees;
using Umbraco.Web.Common.Attributes;
using Umbraco.Web.Composing;
using Umbraco.Web.Mvc;
using Umbraco.Web.Trees;
using Umbraco.Web.WebApi;
using Umbraco.Web.WebApi.Filters;
using Constants = Umbraco.Core.Constants;
namespace Umbraco.Web.Trees
namespace Umbraco.Web.BackOffice.Trees
{
/// <summary>
/// Tree for displaying partial views in the settings app

View File

@@ -6,11 +6,11 @@ using Umbraco.Core.Models;
using Umbraco.Core.Services;
using Umbraco.Web.Actions;
using Umbraco.Web.BackOffice.Filters;
using Umbraco.Web.BackOffice.Trees;
using Umbraco.Web.Common.Attributes;
using Umbraco.Web.Trees;
using Umbraco.Web.WebApi;
namespace Umbraco.Web.Trees
namespace Umbraco.Web.BackOffice.Trees
{
[UmbracoTreeAuthorize(Constants.Trees.RelationTypes)]
[Tree(Constants.Applications.Settings, Constants.Trees.RelationTypes, SortOrder = 5, TreeGroup = Constants.Trees.Groups.Settings)]

View File

@@ -2,9 +2,10 @@
using Umbraco.Core.IO;
using Umbraco.Core.Services;
using Umbraco.Web.BackOffice.Trees;
using Umbraco.Web.Trees;
using Umbraco.Web.WebApi;
namespace Umbraco.Web.Trees
namespace Umbraco.Web.BackOffice.Trees
{
[CoreTree]
[Tree(Constants.Applications.Settings, Constants.Trees.Scripts, TreeTitle = "Scripts", SortOrder = 10, TreeGroup = Constants.Trees.Groups.Templating)]

View File

@@ -1,10 +1,10 @@
using Umbraco.Core;
using Umbraco.Core.IO;
using Umbraco.Core.Services;
using Umbraco.Web.BackOffice.Trees;
using Umbraco.Web.Trees;
using Umbraco.Web.WebApi;
namespace Umbraco.Web.Trees
namespace Umbraco.Web.BackOffice.Trees
{
[CoreTree]
[Tree(Constants.Applications.Settings, Constants.Trees.Stylesheets, TreeTitle = "Stylesheets", SortOrder = 9, TreeGroup = Constants.Trees.Groups.Templating)]

View File

@@ -9,15 +9,15 @@ using Umbraco.Core.Services;
using Umbraco.Extensions;
using Umbraco.Web.Actions;
using Umbraco.Web.BackOffice.Filters;
using Umbraco.Web.BackOffice.Trees;
using Umbraco.Web.Common.Attributes;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.Search;
using Umbraco.Web.Trees;
using Umbraco.Web.WebApi;
using Constants = Umbraco.Core.Constants;
namespace Umbraco.Web.Trees
namespace Umbraco.Web.BackOffice.Trees
{
[UmbracoTreeAuthorize(Constants.Trees.Templates)]
[Tree(Constants.Applications.Settings, Constants.Trees.Templates, SortOrder = 6, TreeGroup = Constants.Trees.Groups.Templating)]

View File

@@ -2,9 +2,9 @@
using System.Collections.Generic;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.BackOffice.Trees;
using Umbraco.Web.Trees;
namespace Umbraco.Web.Trees
namespace Umbraco.Web.BackOffice.Trees
{
/// <summary>
/// Builds a <see cref="TreeCollection"/>.

View File

@@ -7,14 +7,14 @@ using Umbraco.Core.Mapping;
using Umbraco.Core.Persistence;
using Umbraco.Core.Services;
using Umbraco.Web.BackOffice.Filters;
using Umbraco.Web.BackOffice.Trees;
using Umbraco.Web.Common.Attributes;
using Umbraco.Web.Models.Trees;
using Umbraco.Web.Routing;
using Umbraco.Web.Trees;
using Umbraco.Web.WebApi;
using Constants = Umbraco.Core.Constants;
namespace Umbraco.Web.Trees
namespace Umbraco.Web.BackOffice.Trees
{
[UmbracoTreeAuthorize(Constants.Trees.Users)]
[Tree(Constants.Applications.Users, Constants.Trees.Users, SortOrder = 0, IsSingleNodeTree = true)]