Using Windows identity for reporting username in system info

This commit is contained in:
Kenneth Skovhede
2024-05-14 14:41:59 +02:00
parent bda368febf
commit 238bfdd02c
@@ -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