aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Library/UserManager.cs
diff options
context:
space:
mode:
authordkanada <dkanada@users.noreply.github.com>2020-06-04 03:20:48 +0900
committerGitHub <noreply@github.com>2020-06-04 03:20:48 +0900
commitfe16c3fad4b3ea2cab0ec4a4008e31be626b5eee (patch)
tree3cd2fd175c174030e0f72335fea3c1582ac44f56 /Emby.Server.Implementations/Library/UserManager.cs
parent7176a9a30a7c9c925e04529f3ba7feac022f9248 (diff)
parentf0d182b8fe2a2ff2c893c3973b99cda85c30ca70 (diff)
Merge branch 'master' into install-plugin
Diffstat (limited to 'Emby.Server.Implementations/Library/UserManager.cs')
-rw-r--r--Emby.Server.Implementations/Library/UserManager.cs35
1 files changed, 5 insertions, 30 deletions
diff --git a/Emby.Server.Implementations/Library/UserManager.cs b/Emby.Server.Implementations/Library/UserManager.cs
index b8feb5535..140155d0e 100644
--- a/Emby.Server.Implementations/Library/UserManager.cs
+++ b/Emby.Server.Implementations/Library/UserManager.cs
@@ -126,7 +126,7 @@ namespace Emby.Server.Implementations.Library
/// <param name="user">The user.</param>
private void OnUserUpdated(User user)
{
- UserUpdated?.Invoke(this, new GenericEventArgs<User> { Argument = user });
+ UserUpdated?.Invoke(this, new GenericEventArgs<User>(user));
}
/// <summary>
@@ -135,7 +135,7 @@ namespace Emby.Server.Implementations.Library
/// <param name="user">The user.</param>
private void OnUserDeleted(User user)
{
- UserDeleted?.Invoke(this, new GenericEventArgs<User> { Argument = user });
+ UserDeleted?.Invoke(this, new GenericEventArgs<User>(user));
}
public NameIdPair[] GetAuthenticationProviders()
@@ -608,31 +608,6 @@ namespace Emby.Server.Implementations.Library
return dto;
}
- public PublicUserDto GetPublicUserDto(User user, string remoteEndPoint = null)
- {
- if (user == null)
- {
- throw new ArgumentNullException(nameof(user));
- }
-
- IAuthenticationProvider authenticationProvider = GetAuthenticationProvider(user);
- bool hasConfiguredPassword = authenticationProvider.HasPassword(user);
- bool hasConfiguredEasyPassword = !string.IsNullOrEmpty(authenticationProvider.GetEasyPasswordHash(user));
-
- bool hasPassword = user.Configuration.EnableLocalPassword &&
- !string.IsNullOrEmpty(remoteEndPoint) &&
- _networkManager.IsInLocalNetwork(remoteEndPoint) ? hasConfiguredEasyPassword : hasConfiguredPassword;
-
- PublicUserDto dto = new PublicUserDto
- {
- Name = user.Name,
- HasPassword = hasPassword,
- HasConfiguredPassword = hasConfiguredPassword,
- };
-
- return dto;
- }
-
public UserDto GetOfflineUserDto(User user)
{
var dto = GetUserDto(user);
@@ -776,7 +751,7 @@ namespace Emby.Server.Implementations.Library
_userRepository.CreateUser(user);
- EventHelper.QueueEventIfNotNull(UserCreated, this, new GenericEventArgs<User> { Argument = user }, _logger);
+ EventHelper.QueueEventIfNotNull(UserCreated, this, new GenericEventArgs<User>(user), _logger);
return user;
}
@@ -1001,7 +976,7 @@ namespace Emby.Server.Implementations.Library
if (fireEvent)
{
- UserPolicyUpdated?.Invoke(this, new GenericEventArgs<User> { Argument = user });
+ UserPolicyUpdated?.Invoke(this, new GenericEventArgs<User>(user));
}
}
@@ -1071,7 +1046,7 @@ namespace Emby.Server.Implementations.Library
if (fireEvent)
{
- UserConfigurationUpdated?.Invoke(this, new GenericEventArgs<User> { Argument = user });
+ UserConfigurationUpdated?.Invoke(this, new GenericEventArgs<User>(user));
}
}
}