From 09a35ef96ce778bf9d35e7f79035c7fd603ed080 Mon Sep 17 00:00:00 2001 From: Nikolaj Geisle Date: Thu, 7 Oct 2021 09:51:04 +0200 Subject: [PATCH] Fixed breaking change --- src/Umbraco.Core/Services/UserDataService.cs | 7 ++-- .../Controllers/CurrentUserController.cs | 33 +++++++++++++++++++ 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/src/Umbraco.Core/Services/UserDataService.cs b/src/Umbraco.Core/Services/UserDataService.cs index f0dcf78c60..490b5af6a8 100644 --- a/src/Umbraco.Core/Services/UserDataService.cs +++ b/src/Umbraco.Core/Services/UserDataService.cs @@ -20,9 +20,8 @@ namespace Umbraco.Cms.Core.Services _localizationService = localizationService; } - public IEnumerable GetUserData() - { - var userDataList = new List + public IEnumerable GetUserData() => + new List { new("Server OS", RuntimeInformation.OSDescription), new("Server Framework", RuntimeInformation.FrameworkDescription), @@ -32,8 +31,6 @@ namespace Umbraco.Cms.Core.Services new("Current UI Culture", Thread.CurrentThread.CurrentUICulture.ToString()), new("Current Webserver", GetCurrentWebServer()) }; - return userDataList; - } private string GetCurrentWebServer() => IsRunningInProcessIIS() ? "IIS" : "Kestrel"; diff --git a/src/Umbraco.Web.BackOffice/Controllers/CurrentUserController.cs b/src/Umbraco.Web.BackOffice/Controllers/CurrentUserController.cs index 6a83613017..b174f447af 100644 --- a/src/Umbraco.Web.BackOffice/Controllers/CurrentUserController.cs +++ b/src/Umbraco.Web.BackOffice/Controllers/CurrentUserController.cs @@ -6,6 +6,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using Newtonsoft.Json; using Umbraco.Cms.Core; @@ -24,6 +25,7 @@ using Umbraco.Cms.Core.Strings; using Umbraco.Cms.Web.BackOffice.Filters; using Umbraco.Cms.Web.Common.Attributes; using Umbraco.Cms.Web.Common.Authorization; +using Umbraco.Cms.Web.Common.DependencyInjection; using Umbraco.Cms.Web.Common.Security; using Umbraco.Extensions; using Constants = Umbraco.Cms.Core.Constants; @@ -80,6 +82,37 @@ namespace Umbraco.Cms.Web.BackOffice.Controllers _userDataService = userDataService; } + [Obsolete("This constructor is obsolete, use constructor with all values")] + public CurrentUserController( + MediaFileManager mediaFileManager, + IOptions contentSettings, + IHostingEnvironment hostingEnvironment, + IImageUrlGenerator imageUrlGenerator, + IBackOfficeSecurityAccessor backofficeSecurityAccessor, + IUserService userService, + IUmbracoMapper umbracoMapper, + IBackOfficeUserManager backOfficeUserManager, + ILocalizedTextService localizedTextService, + AppCaches appCaches, + IShortStringHelper shortStringHelper, + IPasswordChanger passwordChanger) : + this(mediaFileManager, + contentSettings, + hostingEnvironment, + imageUrlGenerator, + backofficeSecurityAccessor, + userService, + umbracoMapper, + backOfficeUserManager, + localizedTextService, + appCaches, + shortStringHelper, + passwordChanger, + StaticServiceProvider.Instance.GetRequiredService()) + { + + } + /// /// Returns permissions for all nodes passed in for the current user