AB3677 - Moved usages of Current (Core) to Current (Web)

This commit is contained in:
Bjarke Berg
2019-12-19 15:53:50 +01:00
parent 0e4ac7f7d1
commit dfeb97caa4
101 changed files with 127 additions and 303 deletions
-68
View File
@@ -1,12 +1,6 @@
using System;
using Umbraco.Core.Configuration;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.PackageActions;
using Umbraco.Core.Services;
using Umbraco.Core.Strings;
using Umbraco.Core.Sync;
namespace Umbraco.Core.Composing
{
@@ -23,15 +17,6 @@ namespace Umbraco.Core.Composing
{
private static IFactory _factory;
// TODO: get rid of these oddities
// we don't want Umbraco tests to die because the container has not been properly initialized,
// for some too-important things such as IShortStringHelper or loggers, so if it's not
// registered we setup a default one. We should really refactor our tests so that it does
// not happen.
private static ILogger _logger;
private static Configs _configs;
/// <summary>
/// Gets or sets the factory.
/// </summary>
@@ -45,7 +30,6 @@ namespace Umbraco.Core.Composing
set
{
if (_factory != null) throw new InvalidOperationException("A factory has already been set.");
if (_configs != null) throw new InvalidOperationException("Configs are unlocked.");
_factory = value;
}
}
@@ -64,65 +48,13 @@ namespace Umbraco.Core.Composing
_factory.DisposeIfDisposable();
_factory = null;
_configs = null;
_logger = null;
Resetted?.Invoke(null, EventArgs.Empty);
}
/// <summary>
/// Unlocks <see cref="Configs"/>. Intended for testing only, and not supported in production code.
/// </summary>
/// <remarks>
/// <para>For UNIT TESTS exclusively.</para>
/// <para>Unlocks <see cref="Configs"/> so that it is possible to add configurations
/// directly to <see cref="Current"/> without having to wire composition.</para>
/// </remarks>
public static void UnlockConfigs(IConfigsFactory configsFactory, IIOHelper ioHelper)
{
if (_factory != null)
throw new InvalidOperationException("Cannot unlock configs when a factory has been set.");
_configs = configsFactory.Create(ioHelper);
}
internal static event EventHandler Resetted;
#region Getters
public static IShortStringHelper ShortStringHelper => Factory.GetInstance<IShortStringHelper>();
public static ILogger Logger
=> _logger ?? (_logger = _factory?.TryGetInstance<ILogger>()
?? new DebugDiagnosticsLogger(new MessageTemplates()));
public static Configs Configs
{
get
{
if (_configs != null) return _configs;
if (_factory == null) throw new InvalidOperationException("Can not get Current.Config during composition. Use composition.Config.");
return _factory.GetInstance<Configs>();
}
}
internal static PackageActionCollection PackageActions
=> Factory.GetInstance<PackageActionCollection>();
internal static IPublishedModelFactory PublishedModelFactory
=> Factory.GetInstance<IPublishedModelFactory>();
public static IServerMessenger ServerMessenger
=> Factory.GetInstance<IServerMessenger>();
public static ServiceContext Services
=> Factory.GetInstance<ServiceContext>();
public static IIOHelper IOHelper
=> Factory.GetInstance<IIOHelper>();
#endregion
}
}
@@ -5,6 +5,7 @@ using System.Collections.Specialized;
using System.ComponentModel;
using System.Linq;
using Umbraco.Core.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Core.Models.Entities;
using Umbraco.Core.Models.Membership;
@@ -37,12 +38,12 @@ namespace Umbraco.Core.Models.Identity
/// <param name="email">This is allowed to be null (but would need to be filled in if trying to persist this instance)</param>
/// <param name="culture"></param>
/// <returns></returns>
public static BackOfficeIdentityUser CreateNew(string username, string email, string culture)
public static BackOfficeIdentityUser CreateNew(IGlobalSettings globalSettings, string username, string email, string culture)
{
if (string.IsNullOrWhiteSpace(username)) throw new ArgumentException("Value cannot be null or whitespace.", nameof(username));
if (string.IsNullOrWhiteSpace(culture)) throw new ArgumentException("Value cannot be null or whitespace.", nameof(culture));
var user = new BackOfficeIdentityUser(Array.Empty<IReadOnlyUserGroup>());
var user = new BackOfficeIdentityUser(globalSettings, Array.Empty<IReadOnlyUserGroup>());
user.DisableChangeTracking();
user._userName = username;
user._email = email;
@@ -55,12 +56,12 @@ namespace Umbraco.Core.Models.Identity
return user;
}
private BackOfficeIdentityUser(IReadOnlyUserGroup[] groups)
private BackOfficeIdentityUser(IGlobalSettings globalSettings, IReadOnlyUserGroup[] groups)
{
_startMediaIds = Array.Empty<int>();
_startContentIds = Array.Empty<int>();
_allowedSections = Array.Empty<string>();
_culture = Current.Configs.Global().DefaultUILanguage; // TODO: inject
_culture = globalSettings.DefaultUILanguage;
// must initialize before setting groups
_roles = new ObservableCollection<IdentityUserRole<string>>();
@@ -73,10 +74,11 @@ namespace Umbraco.Core.Models.Identity
/// <summary>
/// Creates an existing user with the specified groups
/// </summary>
/// <param name="globalSettings"></param>
/// <param name="userId"></param>
/// <param name="groups"></param>
public BackOfficeIdentityUser(int userId, IEnumerable<IReadOnlyUserGroup> groups)
: this(groups.ToArray())
public BackOfficeIdentityUser(IGlobalSettings globalSettings, int userId, IEnumerable<IReadOnlyUserGroup> groups)
: this(globalSettings, groups.ToArray())
{
// use the property setters - they do more than just setting a field
Id = userId;
@@ -426,6 +428,6 @@ namespace Umbraco.Core.Models.Identity
private static readonly DelegateEqualityComparer<int[]> StartIdsComparer = new DelegateEqualityComparer<int[]>(
(groups, enumerable) => groups.UnsortedSequenceEqual(enumerable),
groups => groups.GetHashCode());
}
}
@@ -24,7 +24,7 @@ namespace Umbraco.Core.Models.Identity
mapper.Define<IUser, BackOfficeIdentityUser>(
(source, context) =>
{
var target = new BackOfficeIdentityUser(source.Id, source.Groups);
var target = new BackOfficeIdentityUser(_globalSettings, source.Id, source.Groups);
target.DisableChangeTracking();
return target;
},
@@ -24,17 +24,19 @@ namespace Umbraco.Tests.Composing
var composition = new Composition(container, TestHelper.GetMockedTypeLoader(), Mock.Of<IProfilingLogger>(), ComponentTests.MockRuntimeState(RuntimeLevel.Run), TestHelper.GetConfigs(), TestHelper.IOHelper, AppCaches.NoCache);
var expectedPackageActions = TypeLoader.GetPackageActions();
composition.WithCollectionBuilder<PackageActionCollectionBuilder>()
.Add(() => TypeLoader.GetPackageActions());
.Add(() => expectedPackageActions);
Current.Factory = composition.CreateFactory();
var factory = composition.CreateFactory();
var actions = Current.PackageActions;
var actions = factory.GetInstance<PackageActionCollection>();
Assert.AreEqual(2, actions.Count());
// order is unspecified, but both must be there
var hasAction1 = actions.ElementAt(0) is PackageAction1 || actions.ElementAt(1) is PackageAction1;
var hasAction2 = actions.ElementAt(0) is PackageAction2 || actions.ElementAt(1) is PackageAction2;
Assert.IsTrue(hasAction1);
Assert.IsTrue(hasAction2);
}
+2 -1
View File
@@ -5,6 +5,7 @@ using Umbraco.Core.Persistence;
using Umbraco.Tests.Testing;
using Umbraco.Core;
using Umbraco.Tests.TestHelpers;
using Umbraco.Web.Composing;
namespace Umbraco.Tests.Issues
{
@@ -21,7 +22,7 @@ namespace Umbraco.Tests.Issues
contentType.Name = "test";
var propertyType = new PropertyType(ShortStringHelper, "test", ValueStorageType.Ntext, "prop") { Name = "Prop", Description = "", Mandatory = false, SortOrder = 1, DataTypeId = -88 };
contentType.PropertyTypeCollection.Add(propertyType);
Core.Composing.Current.Services.ContentTypeService.Save(contentType);
Current.Services.ContentTypeService.Save(contentType);
var aliasName = string.Empty;
-5
View File
@@ -23,11 +23,6 @@ namespace Umbraco.Tests.Macros
new ObjectCacheAppCache(typeFinder),
NoAppCache.Instance,
new IsolatedCaches(type => new ObjectCacheAppCache(typeFinder)));
//Current.ApplicationContext = new ApplicationContext(cacheHelper, new ProfilingLogger(Mock.Of<ILogger>(), Mock.Of<IProfiler>()));
Current.Reset();
Current.UnlockConfigs(TestHelper.GetConfigsFactory(), TestHelper.IOHelper);
Current.Configs.Add(SettingsForTests.GetDefaultUmbracoSettings);
}
[TestCase("PartialView", true)]
-10
View File
@@ -1,8 +1,6 @@
using System;
using System.Linq;
using NUnit.Framework;
using Umbraco.Core.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Entities;
using Umbraco.Tests.TestHelpers;
@@ -12,14 +10,6 @@ namespace Umbraco.Tests.Models
[TestFixture]
public class MacroTests
{
[SetUp]
public void Init()
{
Current.Reset();
Current.UnlockConfigs(TestHelper.GetConfigsFactory(), TestHelper.IOHelper);
Current.Configs.Add(SettingsForTests.GetDefaultUmbracoSettings);
}
[Test]
public void Can_Deep_Clone()
{
-9
View File
@@ -13,15 +13,6 @@ namespace Umbraco.Tests.Models
[TestFixture]
public class MemberTests
{
[SetUp]
public void Setup()
{
Current.Reset();
Current.UnlockConfigs(TestHelper.GetConfigsFactory(), TestHelper.IOHelper);
Current.Configs.Add(SettingsForTests.GetDefaultGlobalSettings);
Current.Configs.Add(SettingsForTests.GetDefaultUmbracoSettings);
}
[Test]
public void Can_Deep_Clone()
{
+1 -9
View File
@@ -14,15 +14,7 @@ namespace Umbraco.Tests.Models
[TestFixture]
public class UserTests
{
private IGlobalSettings GlobalSettings { get; } = SettingsForTests.GenerateMockGlobalSettings();
[SetUp]
public void Setup()
{
Current.Reset();
Current.UnlockConfigs(TestHelper.GetConfigsFactory(), TestHelper.IOHelper);
Current.Configs.Add(SettingsForTests.GetDefaultGlobalSettings);
}
private IGlobalSettings GlobalSettings { get; } = SettingsForTests.GetDefaultGlobalSettings();
[Test]
public void Can_Deep_Clone()
@@ -178,7 +178,7 @@ namespace Umbraco.Tests.Published
[Test]
public void SimpleConverter3Test()
{
Current.Reset();
// Current.Reset();
var register = TestHelper.GetRegister();
var composition = new Composition(register, TestHelper.GetMockedTypeLoader(), Mock.Of<IProfilingLogger>(), ComponentTests.MockRuntimeState(RuntimeLevel.Run), TestHelper.GetConfigs(), TestHelper.IOHelper, AppCaches.NoCache);
@@ -194,7 +194,7 @@ namespace Umbraco.Tests.Published
});
register.Register(f => factory);
Current.Factory = composition.CreateFactory();
var registerFactory = composition.CreateFactory();
var cacheMock = new Mock<IPublishedContentCache>();
var cacheContent = new Dictionary<int, IPublishedContent>();
@@ -205,7 +205,7 @@ namespace Umbraco.Tests.Published
publishedSnapshotAccessorMock.Setup(x => x.PublishedSnapshot).Returns(publishedSnapshotMock.Object);
register.Register(f => publishedSnapshotAccessorMock.Object);
var converters = Current.Factory.GetInstance<PropertyValueConverterCollection>();
var converters = registerFactory.GetInstance<PropertyValueConverterCollection>();
var dataTypeService = new TestObjects.TestDataTypeService(
new DataType(new VoidEditor(Mock.Of<ILogger>(), Mock.Of<IDataTypeService>(), Mock.Of<ILocalizationService>(),Mock.Of<ILocalizedTextService>(), Mock.Of<IShortStringHelper>())) { Id = 1 },
@@ -236,8 +236,9 @@ namespace Umbraco.Tests.Published
Properties = new[] { new SolidPublishedProperty { Alias = "prop2", SolidHasValue = true, SolidValue = "1003" } }
};
cacheContent[cnt1.Id] = cnt1.CreateModel(Current.PublishedModelFactory);
cacheContent[cnt2.Id] = cnt2.CreateModel(Current.PublishedModelFactory);
var publishedModelFactory = registerFactory.GetInstance<IPublishedModelFactory>();
cacheContent[cnt1.Id] = cnt1.CreateModel(publishedModelFactory);
cacheContent[cnt2.Id] = cnt2.CreateModel(publishedModelFactory);
// can get the actual property Clr type
// ie ModelType gets properly mapped by IPublishedContentModelFactory
@@ -4,8 +4,7 @@ using System.Collections.ObjectModel;
using System.Linq;
using Moq;
using NUnit.Framework;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Models.PublishedContent;
@@ -1,6 +1,6 @@
using System.Collections.Generic;
using NUnit.Framework;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.Models;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Tests.Testing;
@@ -1,7 +1,6 @@
using System;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Web.Routing;
using Moq;
using Umbraco.Core;
@@ -10,10 +9,8 @@ using Umbraco.Web;
using Umbraco.Web.PublishedCache;
using Umbraco.Web.Routing;
using Umbraco.Web.Security;
using Umbraco.Core.Composing;
using Current = Umbraco.Core.Composing.Current;
using Umbraco.Core.Cache;
using Umbraco.Core.Configuration;
using Umbraco.Core.Composing;
using Umbraco.Core.Hosting;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
@@ -23,6 +20,7 @@ using Umbraco.Core.Services;
using Umbraco.Core.Strings;
using Umbraco.Tests.TestHelpers;
using Umbraco.Tests.Testing.Objects.Accessors;
using Current = Umbraco.Web.Composing.Current;
namespace Umbraco.Tests.PublishedContent
{
@@ -1,32 +1,28 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
using NUnit.Framework;
using Umbraco.Core;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.PropertyEditors;
using Umbraco.Web;
using Umbraco.Web.PublishedCache;
using Umbraco.Core.Composing;
using Moq;
using Newtonsoft.Json;
using Umbraco.Core.Cache;
using Umbraco.Core.Configuration;
using Umbraco.Core.Composing;
using Umbraco.Core.Hosting;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Services;
using Umbraco.Core.Services.Implement;
using Umbraco.Core.Strings;
using Umbraco.Tests.TestHelpers;
using Umbraco.Tests.Testing;
using Umbraco.Web.Models.PublishedContent;
using Umbraco.Web.PropertyEditors;
using Umbraco.Web.Templates;
using Current = Umbraco.Web.Composing.Current;
namespace Umbraco.Tests.PublishedContent
{
@@ -5,7 +5,7 @@ using System.Linq;
using Moq;
using Umbraco.Core;
using Umbraco.Core.Cache;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Models.PublishedContent;
@@ -3,9 +3,8 @@ using System.Globalization;
using Moq;
using NUnit.Framework;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Core.Models;
using Umbraco.Tests.TestHelpers;
using Umbraco.Tests.Testing;
using Umbraco.Web.Routing;
@@ -4,8 +4,7 @@ using System.Linq;
using Moq;
using NUnit.Framework;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Web.Composing;
using Umbraco.Core.Models;
using Umbraco.Core.Services;
using Umbraco.Tests.TestHelpers.Entities;
@@ -5,7 +5,7 @@ using System.Linq;
using Moq;
using NUnit.Framework;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Core.Models;
using Umbraco.Core.Models.PublishedContent;
@@ -7,8 +7,7 @@ using Microsoft.Owin;
using Moq;
using NUnit.Framework;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.Services;
using Umbraco.Web.Composing;
using Umbraco.Tests.TestHelpers;
using Umbraco.Tests.Testing;
using Umbraco.Tests.Testing.Objects.Accessors;
@@ -5,9 +5,8 @@ using System.Linq;
using System.Text;
using NUnit.Framework;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.Strings;
using Umbraco.Tests.TestHelpers;
using Umbraco.Tests.Testing;
using Umbraco.Web;
@@ -22,6 +22,7 @@ using Umbraco.Core.Services;
using Umbraco.Core.Services.Implement;
using Umbraco.Core.Strings;
using Umbraco.Tests.TestHelpers.Stubs;
using Current = Umbraco.Web.Composing.Current;
namespace Umbraco.Tests.TestHelpers
{
@@ -8,7 +8,7 @@ using Moq;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using NUnit.Framework;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Entities;
using Umbraco.Core.Models.Membership;
@@ -1,17 +1,8 @@
@using System.Collections
@using System.Net.Http
@using System.Web.Mvc.Html
@using Umbraco.Core
@using Umbraco.Core
@using ClientDependency.Core
@using ClientDependency.Core.Mvc
@using Microsoft.Owin.Security
@using Newtonsoft.Json
@using Newtonsoft.Json.Linq
@using Umbraco.Core.Composing
@using Umbraco.Core.IO
@using Umbraco.Web.Composing
@using Umbraco.Web
@using Umbraco.Web.Editors
@using Umbraco.Core.Configuration
@inherits System.Web.Mvc.WebViewPage<Umbraco.Web.Editors.BackOfficeModel>
@{
Layout = null;
@@ -1,10 +1,8 @@
@using Umbraco.Core
@using ClientDependency.Core
@using ClientDependency.Core.Mvc
@using Umbraco.Core.Composing
@using Umbraco.Core.IO
@using Umbraco.Web.Composing
@using Umbraco.Web
@using Umbraco.Core.Configuration
@inherits WebViewPage<Umbraco.Web.Editors.BackOfficeModel>
@@ -1,10 +1,8 @@
@using Umbraco.Core
@using ClientDependency.Core
@using ClientDependency.Core.Mvc
@using Umbraco.Core.Composing
@using Umbraco.Core.IO
@using Umbraco.Web.Composing
@using Umbraco.Web
@using Umbraco.Core.Configuration
@inherits System.Web.Mvc.WebViewPage<Umbraco.Web.Editors.BackOfficePreviewModel>
@{
+3 -12
View File
@@ -3,22 +3,13 @@
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Umbraco.Web.UI.Config.Splashes {
public partial class NoNodes {
/// <summary>
/// Form1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm Form1;
}
}
@@ -1,6 +1,6 @@
<%@ Page Language="C#" AutoEventWireup="True" Inherits="Umbraco.Web.UI.Config.Splashes.NoNodes" CodeBehind="NoNodes.aspx.cs" %>
<%@ Import Namespace="Umbraco.Core" %>
<%@ Import Namespace="Umbraco.Core.Composing" %>
<%@ Import Namespace="Umbraco.Web.Composing" %>
<%@ Import Namespace="Umbraco.Core.Configuration" %>
<%@ Import Namespace="Umbraco.Core.IO" %>
@@ -464,6 +464,7 @@ namespace Umbraco.Web.Editors
var groups = Services.UserService.GetUserGroupsByAlias(autoLinkOptions.GetDefaultUserGroups(UmbracoContext, loginInfo));
var autoLinkUser = BackOfficeIdentityUser.CreateNew(
GlobalSettings,
loginInfo.Email,
loginInfo.Email,
autoLinkOptions.GetDefaultCulture(UmbracoContext, loginInfo));
@@ -11,7 +11,7 @@ using ClientDependency.Core.Config;
using Microsoft.Owin;
using Microsoft.Owin.Security;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Web.Features;
using Umbraco.Web.HealthCheck;
@@ -6,12 +6,11 @@ using System.Net.Http;
using System.Web.Http.Controllers;
using System.Web.Http.ModelBinding;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Services;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Security;
namespace Umbraco.Web.Editors.Filters
{
@@ -4,7 +4,7 @@ using System.Net.Http;
using System.Web.Http;
using System.Web.Http.Controllers;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
namespace Umbraco.Web.Editors.Filters
{
+1 -2
View File
@@ -13,7 +13,6 @@ using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Membership;
using Umbraco.Core.Persistence.DatabaseModelDefinitions;
using Umbraco.Core.Services;
using Umbraco.Web.Models.ContentEditing;
using Umbraco.Web.Mvc;
@@ -21,7 +20,7 @@ using Umbraco.Web.WebApi;
using System.Linq;
using System.Web.Http.Controllers;
using Umbraco.Core.Cache;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Web.WebApi.Filters;
using Umbraco.Core.Persistence.Querying;
@@ -6,7 +6,7 @@ using System.Net.Http;
using System.Web.Http;
using Umbraco.Core;
using Umbraco.Core.Cache;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Core.Dictionary;
using Umbraco.Core.Logging;
@@ -1,7 +1,6 @@
using System;
using System.Web.Http;
using System.Xml;
using System.Collections.Generic;
using System.Linq;
using System.Security;
using Umbraco.Core.Logging;
@@ -11,7 +10,7 @@ using Umbraco.Web.Mvc;
using Umbraco.Web.WebApi;
using File = System.IO.File;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
namespace Umbraco.Web.Editors
{
@@ -5,7 +5,7 @@ using System.Net.Http;
using System.Web.Http;
using Umbraco.Core;
using Umbraco.Core.Cache;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
+1 -3
View File
@@ -4,9 +4,7 @@ using System.IO;
using System.Linq;
using Newtonsoft.Json;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Core.IO;
using Umbraco.Web.Composing;
using Umbraco.Web.Models;
using Umbraco.Web.Mvc;
using Umbraco.Web.Tour;
@@ -4,7 +4,7 @@ using System.Net.Http;
using System.Net.Http.Headers;
using System.Web.Http.Filters;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Core.Models;
using Umbraco.Web.Models;
@@ -4,8 +4,7 @@ using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Membership;
using Umbraco.Core.Services;
+2 -2
View File
@@ -297,7 +297,7 @@ namespace Umbraco.Web.Editors
//we want to create the user with the UserManager, this ensures the 'empty' (special) password
//format is applied without us having to duplicate that logic
var identityUser = BackOfficeIdentityUser.CreateNew(userSave.Username, userSave.Email, GlobalSettings.DefaultUILanguage);
var identityUser = BackOfficeIdentityUser.CreateNew(GlobalSettings, userSave.Username, userSave.Email, GlobalSettings.DefaultUILanguage);
identityUser.Name = userSave.Name;
var created = await UserManager.CreateAsync(identityUser);
@@ -391,7 +391,7 @@ namespace Umbraco.Web.Editors
{
//we want to create the user with the UserManager, this ensures the 'empty' (special) password
//format is applied without us having to duplicate that logic
var identityUser = BackOfficeIdentityUser.CreateNew(userSave.Username, userSave.Email, GlobalSettings.DefaultUILanguage);
var identityUser = BackOfficeIdentityUser.CreateNew(GlobalSettings, userSave.Username, userSave.Email, GlobalSettings.DefaultUILanguage);
identityUser.Name = userSave.Name;
var created = await UserManager.CreateAsync(identityUser);
@@ -2,8 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.IO;
using Umbraco.Web.Composing;
using Umbraco.Core.Services;
using Umbraco.Web.Install;
@@ -1,14 +1,10 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration;
using System.Linq;
using System.Web.Http;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.Configuration;
using Umbraco.Core.Configuration.HealthChecks;
using Umbraco.Web.Editors;
using Umbraco.Web.WebApi.Filters;
@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using HeyRed.MarkdownSharp;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.Configuration.HealthChecks;
using Umbraco.Core.Logging;
@@ -1,10 +1,9 @@
using System;
using System.Collections.Generic;
using System.Net.Mail;
using System.Threading;
using System.Threading.Tasks;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Core.Logging;
using Umbraco.Core.Services;
@@ -3,8 +3,7 @@ using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Web.Composing;
using Umbraco.Core.Configuration.HealthChecks;
namespace Umbraco.Web.HealthCheck.NotificationMethods
+1 -1
View File
@@ -1,7 +1,7 @@
using System;
using System.Runtime.CompilerServices;
using ImageProcessor.Common.Exceptions;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.Logging;
namespace Umbraco.Web
@@ -1,7 +1,7 @@
using System;
using System.Web.Mvc;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Core.Logging;
using Umbraco.Web.JavaScript;
@@ -1,7 +1,7 @@
using System;
using System.Threading.Tasks;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.Migrations.Install;
using Umbraco.Web.Install.Models;
@@ -6,7 +6,7 @@ using System.Threading.Tasks;
using System.Web;
using Newtonsoft.Json;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Core.Migrations.Install;
using Umbraco.Core.Models.Identity;
@@ -7,8 +7,7 @@ using ClientDependency.Core;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.IO;
using Umbraco.Web.Composing;
using Umbraco.Core.Manifest;
namespace Umbraco.Web.JavaScript
@@ -2,8 +2,7 @@
using ClientDependency.Core.Controls;
using ClientDependency.Core.FileRegistration.Providers;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.IO;
using Umbraco.Web.Composing;
namespace Umbraco.Web.JavaScript
{
@@ -4,10 +4,7 @@ using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Runtime.Serialization;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Core.IO;
using Umbraco.Core.Models.Validation;
using Umbraco.Web.Composing;
namespace Umbraco.Web.Models.ContentEditing
{
@@ -3,8 +3,7 @@ using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Runtime.Serialization;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Web.Composing;
namespace Umbraco.Web.Models.ContentEditing
{
@@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.Mapping;
using Umbraco.Core.Models;
@@ -1,6 +1,5 @@
using System.Linq;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core;
using Umbraco.Web.Composing;
using Umbraco.Core.Dictionary;
using Umbraco.Core.Logging;
using Umbraco.Core.Mapping;
@@ -1,14 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Umbraco.Composing;
using Umbraco.Core;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Services;
using Umbraco.Web.Composing;
using Umbraco.Web.Models.ContentEditing;
using Current = Umbraco.Core.Composing.Current;
namespace Umbraco.Web.Models.Mapping
{
@@ -4,7 +4,7 @@ using System.Globalization;
using System.Linq;
using Umbraco.Core;
using Umbraco.Core.Cache;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Core.IO;
using Umbraco.Core.Mapping;
+1 -2
View File
@@ -2,8 +2,7 @@
using System.Collections.Generic;
using System.Runtime.Serialization;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.IO;
using Umbraco.Web.Composing;
using Umbraco.Web.Models.ContentEditing;
namespace Umbraco.Web.Models.Trees
@@ -1,8 +1,6 @@
using System.Web.Mvc;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.Configuration;
using GlobalSettings = Umbraco.Core.Configuration.GlobalSettings;
using Umbraco.Web.Composing;
namespace Umbraco.Web.Mvc
{
@@ -1,6 +1,6 @@
using System.Collections.Generic;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.Models.Editors;
@@ -1,5 +1,5 @@
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors;
@@ -1,10 +1,9 @@
using System;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.Models;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Services;
using Umbraco.Core.Strings;
namespace Umbraco.Web.PropertyEditors
{
@@ -1,5 +1,5 @@
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.PropertyEditors.Validators;
@@ -1,5 +1,5 @@
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors;
@@ -2,14 +2,13 @@
using System.Collections.Generic;
using System.Linq;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.Configuration.UmbracoSettings;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Services;
using Umbraco.Core.Services.Implement;
using Umbraco.Web.Media;
namespace Umbraco.Web.PropertyEditors
@@ -1,10 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Newtonsoft.Json.Linq;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.IO;
using Umbraco.Core.Models.Editors;
using Umbraco.Core.PropertyEditors;
@@ -3,7 +3,7 @@ using System;
using System.Collections.Generic;
using System.Linq;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
@@ -2,7 +2,7 @@
using System;
using Newtonsoft.Json;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
@@ -1,6 +1,5 @@
using System.Collections.Generic;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core;
using Umbraco.Web.Composing;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors;
@@ -1,5 +1,5 @@
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors;
@@ -1,14 +1,12 @@
using System.Collections.Generic;
using System.Collections.Generic;
using Umbraco.Core;
using Umbraco.Core.IO;
using Umbraco.Core.Composing;
using Umbraco.Core.IO;
using Umbraco.Web.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.Models.Editors;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Services;
using Umbraco.Core.Strings;
using Umbraco.Core.Services;
namespace Umbraco.Web.PropertyEditors
{
@@ -1,5 +1,5 @@
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors;
@@ -1,5 +1,5 @@
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors;
@@ -1,6 +1,6 @@
using System.Collections.Generic;
using System.Collections.Generic;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.Models.Editors;
@@ -1,6 +1,6 @@
using System;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.IO;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Logging;
@@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations;
using System.Linq;
using Newtonsoft.Json.Linq;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.Exceptions;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
@@ -1,5 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
@@ -7,7 +6,7 @@ using System.Text.RegularExpressions;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
@@ -1,4 +1,4 @@
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors;
@@ -1,5 +1,5 @@
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors;
@@ -1,4 +1,4 @@
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors;
@@ -1,5 +1,5 @@
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors;
@@ -1,4 +1,4 @@
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors;
@@ -1,4 +1,4 @@
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors;
@@ -1,4 +1,4 @@
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors;
@@ -1,4 +1,4 @@
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors;
@@ -1,5 +1,5 @@
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors;
@@ -1,8 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
@@ -1,5 +1,5 @@
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors;
@@ -4,10 +4,9 @@ using System.ComponentModel.DataAnnotations;
using System.Linq;
using Newtonsoft.Json.Linq;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Editors;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Services;
@@ -1,7 +1,5 @@
using System.ComponentModel;
using System.Web.Mvc;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core;
using Umbraco.Web.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.PropertyEditors;
@@ -29,6 +29,7 @@ using Umbraco.Web.Install;
using Umbraco.Web.PublishedCache.NuCache.DataSource;
using Umbraco.Web.Routing;
using File = System.IO.File;
using Current = Umbraco.Web.Composing.Current;
namespace Umbraco.Web.PublishedCache.NuCache
{
+1 -1
View File
@@ -4,7 +4,7 @@ using System.Globalization;
using System.Threading;
using System.Web;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.Models;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Web.Macros;
@@ -2,8 +2,7 @@
using System.Threading;
using System.Threading.Tasks;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Web.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core.Sync;
using Umbraco.Web.HealthCheck;
@@ -4,15 +4,14 @@ using System.IO;
using System.Threading;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Core.Configuration.HealthChecks;
using Umbraco.Core.Configuration.UmbracoSettings;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.Scoping;
using Umbraco.Core.Services;
using Umbraco.Web.HealthCheck;
using Umbraco.Web.Routing;
using Current = Umbraco.Web.Composing.Current;
namespace Umbraco.Web.Scheduling
{
@@ -1,10 +1,6 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Security.Claims;
using System.Security.Principal;
using System.Threading;
using System.Web;
using Microsoft.AspNet.Identity;
@@ -12,8 +8,7 @@ using Microsoft.Owin;
using Microsoft.Owin.Security;
using Newtonsoft.Json;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Web.Composing;
using Umbraco.Core.Security;
using Constants = Umbraco.Core.Constants;
@@ -1,15 +1,11 @@
using System;
using System.Collections.Concurrent;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Security.Claims;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNet.Identity;
using Microsoft.Owin;
using Microsoft.Owin.Security.Cookies;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Core.IO;
using Umbraco.Core.Security;
@@ -101,7 +101,7 @@ namespace Umbraco.Web.Security
//if the user is null, create an empty one which can be used for auto-linking
if (user == null)
user = BackOfficeIdentityUser.CreateNew(userName, null, _globalSettings.DefaultUILanguage);
user = BackOfficeIdentityUser.CreateNew(_globalSettings, userName, null, _globalSettings.DefaultUILanguage);
//check the password for the user, this will allow a developer to auto-link
//an account if they have specified an IBackOfficeUserPasswordChecker
@@ -1,8 +1,7 @@
using System;
using Microsoft.AspNet.Identity.Owin;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Web.Composing;
using Umbraco.Core.Models.Identity;
namespace Umbraco.Web.Security
+1 -2
View File
@@ -7,11 +7,10 @@ using System.Web.Security;
using Umbraco.Core;
using Umbraco.Core.Logging;
using Umbraco.Core.Models;
using Umbraco.Core.Security;
using Umbraco.Web.Models;
using Umbraco.Web.PublishedCache;
using Umbraco.Core.Cache;
using Umbraco.Core.Composing;
using Umbraco.Web.Composing;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.Services;
using Umbraco.Web.Editors;
@@ -5,10 +5,11 @@ using System.Linq;
using System.Net.Http;
using System.Web.Http.Filters;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Membership;
using Umbraco.Core.Composing;
using Umbraco.Core.Security;
using Current = Umbraco.Web.Composing.Current;
namespace Umbraco.Web.WebApi.Filters
{
@@ -2,11 +2,9 @@
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Web.Helpers;
using System.Web.Http.Filters;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Web.Composing;
namespace Umbraco.Web.WebApi.Filters
{

Some files were not shown because too many files have changed in this diff Show More