From 238bfdd02c28193abd634f7a95dc7003cf72b12a Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Tue, 14 May 2024 14:41:59 +0200 Subject: [PATCH] Using Windows identity for reporting username in system info --- Duplicati.Library.RestAPI/RESTMethods/SystemInfo.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Duplicati.Library.RestAPI/RESTMethods/SystemInfo.cs b/Duplicati.Library.RestAPI/RESTMethods/SystemInfo.cs index f3fa0f8b7..93d5f780c 100644 --- a/Duplicati.Library.RestAPI/RESTMethods/SystemInfo.cs +++ b/Duplicati.Library.RestAPI/RESTMethods/SystemInfo.cs @@ -22,9 +22,9 @@ using System; using System.Linq; using System.Collections.Generic; using Duplicati.Library.Interface; -using Duplicati.Library.Common; +using Duplicati.Library.Common; using Duplicati.Library.RestAPI; - + namespace Duplicati.Server.WebServer.RESTMethods { public class SystemInfo : IRESTMethodGET, IRESTMethodDocumented @@ -77,7 +77,7 @@ namespace Duplicati.Server.WebServer.RESTMethods CaseSensitiveFilesystem = Duplicati.Library.Utility.Utility.IsFSCaseSensitive, MachineName = System.Environment.MachineName, PackageTypeId = Duplicati.Library.AutoUpdater.UpdaterManager.PackageTypeId, - UserName = System.Environment.UserName, + UserName = OperatingSystem.IsWindows() ? System.Security.Principal.WindowsIdentity.GetCurrent().Name : System.Environment.UserName, NewLine = System.Environment.NewLine, CLRVersion = System.Environment.Version.ToString(), CLROSInfo = new @@ -106,7 +106,8 @@ namespace Duplicati.Server.WebServer.RESTMethods }, SupportedLocales = Library.Localization.LocalizationService.SupportedCultures - .Select(x => new { + .Select(x => new + { Code = x, EnglishName = new System.Globalization.CultureInfo(x).EnglishName, DisplayName = new System.Globalization.CultureInfo(x).NativeName