Merge remote-tracking branch 'origin/v8/dev' into netcore/dev

# Conflicts:
#	src/Umbraco.Core/Umbraco.Core.csproj
#	src/Umbraco.Infrastructure/Runtime/CoreInitialComposer.cs
#	src/Umbraco.Web/Editors/UpdateCheckController.cs
#	src/Umbraco.Web/Install/InstallHelper.cs
This commit is contained in:
Bjarke Berg
2020-02-20 08:06:37 +01:00
34 changed files with 385 additions and 534 deletions

View File

@@ -47,6 +47,8 @@ namespace Umbraco.Core.Composing.CompositionExtensions
composition.RegisterUnique<IScriptRepository, ScriptRepository>();
composition.RegisterUnique<IStylesheetRepository, StylesheetRepository>();
composition.RegisterUnique<IContentTypeCommonRepository, ContentTypeCommonRepository>();
composition.RegisterUnique<IInstallationRepository, InstallationRepository>();
composition.RegisterUnique<IUpgradeCheckRepository, UpgradeCheckRepository>();
return composition;
}

View File

@@ -543,6 +543,16 @@ ORDER BY colName";
}
}
// If userlogin or the email has changed then need to reset security stamp
if (changedCols.Contains("userLogin") || changedCols.Contains("userEmail"))
{
userDto.EmailConfirmedDate = null;
userDto.SecurityStampToken = entity.SecurityStamp = Guid.NewGuid().ToString();
changedCols.Add("emailConfirmedDate");
changedCols.Add("securityStampToken");
}
//only update the changed cols
if (changedCols.Count > 0)
{

View File

@@ -19,11 +19,13 @@ using Umbraco.Core.PropertyEditors.Validators;
using Umbraco.Core.Scoping;
using Umbraco.Core.Serialization;
using Umbraco.Core.Services;
using Umbraco.Core.Services.Implement;
using Umbraco.Core.Strings;
using Umbraco.Core.Sync;
using Umbraco.Web.Models.PublishedContent;
using Umbraco.Web.PublishedCache;
using Umbraco.Web;
using Umbraco.Web.Migrations.PostMigrations;
using Umbraco.Web.PropertyEditors;
using Umbraco.Web.Services;
using IntegerValidator = Umbraco.Core.PropertyEditors.Validators.IntegerValidator;
@@ -143,8 +145,8 @@ namespace Umbraco.Core.Runtime
// by default, register a noop factory
composition.RegisterUnique<IPublishedModelFactory, NoopPublishedModelFactory>();
// by default, register a noop rebuilder
composition.RegisterUnique<IPublishedSnapshotRebuilder, NoopPublishedSnapshotRebuilder>();
// by default
composition.RegisterUnique<IPublishedSnapshotRebuilder, PublishedSnapshotRebuilder>();
composition.SetCultureDictionaryFactory<DefaultCultureDictionaryFactory>();
composition.Register(f => f.GetInstance<ICultureDictionaryFactory>().CreateDictionary(), Lifetime.Singleton);
@@ -160,6 +162,10 @@ namespace Umbraco.Core.Runtime
// register core CMS dashboards and 3rd party types - will be ordered by weight attribute & merged with package.manifest dashboards
composition.Dashboards()
.Add(composition.TypeLoader.GetTypes<IDashboard>());
// will be injected in controllers when needed to invoke rest endpoints on Our
composition.RegisterUnique<IInstallationService, InstallationService>();
composition.RegisterUnique<IUpgradeService, UpgradeService>();
}
}
}

View File

@@ -0,0 +1,10 @@
using System.Threading.Tasks;
using Umbraco.Core.Models;
namespace Umbraco.Core.Services
{
public interface IInstallationService
{
Task LogInstall(InstallLog installLog);
}
}

View File

@@ -0,0 +1,11 @@
using System.Threading.Tasks;
using Semver;
using Umbraco.Core.Models;
namespace Umbraco.Core.Services
{
public interface IUpgradeService
{
Task<UpgradeResult> CheckUpgrade(SemVersion version);
}
}

View File

@@ -0,0 +1,21 @@
using System.Threading.Tasks;
using Umbraco.Core.Models;
using Umbraco.Core.Persistence.Repositories;
namespace Umbraco.Core.Services.Implement
{
public class InstallationService : IInstallationService
{
private readonly IInstallationRepository _installationRepository;
public InstallationService(IInstallationRepository installationRepository)
{
_installationRepository = installationRepository;
}
public async Task LogInstall(InstallLog installLog)
{
await _installationRepository.SaveInstallLogAsync(installLog);
}
}
}