aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Library/UserManager.cs
diff options
context:
space:
mode:
authordkanada <dkanada@users.noreply.github.com>2019-12-11 01:14:55 +0900
committerGitHub <noreply@github.com>2019-12-11 01:14:55 +0900
commit67922dff50967c02e8c0c10f43884fd4e788b012 (patch)
tree40d05de6e82107337d20b62a2d3f3bd93ca71a45 /Emby.Server.Implementations/Library/UserManager.cs
parent2a7210ca287f9b7421a9c50497434c3839b07f7f (diff)
parentaffb58ef9e11f7f14192c76074b1199604f6bd67 (diff)
Merge pull request #2041 from Bond-009/warn11
Fix more warnings
Diffstat (limited to 'Emby.Server.Implementations/Library/UserManager.cs')
-rw-r--r--Emby.Server.Implementations/Library/UserManager.cs28
1 files changed, 19 insertions, 9 deletions
diff --git a/Emby.Server.Implementations/Library/UserManager.cs b/Emby.Server.Implementations/Library/UserManager.cs
index e1b031e45..85bfa154a 100644
--- a/Emby.Server.Implementations/Library/UserManager.cs
+++ b/Emby.Server.Implementations/Library/UserManager.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
@@ -36,19 +38,19 @@ using Microsoft.Extensions.Logging;
namespace Emby.Server.Implementations.Library
{
/// <summary>
- /// Class UserManager
+ /// Class UserManager.
/// </summary>
public class UserManager : IUserManager
{
/// <summary>
- /// The _logger
+ /// The logger.
/// </summary>
private readonly ILogger _logger;
private readonly object _policySyncLock = new object();
/// <summary>
- /// Gets the active user repository
+ /// Gets the active user repository.
/// </summary>
/// <value>The user repository.</value>
private readonly IUserRepository _userRepository;
@@ -354,6 +356,8 @@ namespace Emby.Server.Implementations.Library
return success ? user : null;
}
+#nullable enable
+
private static string GetAuthenticationProviderId(IAuthenticationProvider provider)
{
return provider.GetType().FullName;
@@ -374,7 +378,7 @@ namespace Emby.Server.Implementations.Library
return GetPasswordResetProviders(user)[0];
}
- private IAuthenticationProvider[] GetAuthenticationProviders(User user)
+ private IAuthenticationProvider[] GetAuthenticationProviders(User? user)
{
var authenticationProviderId = user?.Policy.AuthenticationProviderId;
@@ -395,7 +399,7 @@ namespace Emby.Server.Implementations.Library
return providers;
}
- private IPasswordResetProvider[] GetPasswordResetProviders(User user)
+ private IPasswordResetProvider[] GetPasswordResetProviders(User? user)
{
var passwordResetProviderId = user?.Policy.PasswordResetProviderId;
@@ -414,7 +418,11 @@ namespace Emby.Server.Implementations.Library
return providers;
}
- private async Task<(string username, bool success)> AuthenticateWithProvider(IAuthenticationProvider provider, string username, string password, User resolvedUser)
+ private async Task<(string username, bool success)> AuthenticateWithProvider(
+ IAuthenticationProvider provider,
+ string username,
+ string password,
+ User? resolvedUser)
{
try
{
@@ -438,15 +446,15 @@ namespace Emby.Server.Implementations.Library
}
}
- private async Task<(IAuthenticationProvider authenticationProvider, string username, bool success)> AuthenticateLocalUser(
+ private async Task<(IAuthenticationProvider? authenticationProvider, string username, bool success)> AuthenticateLocalUser(
string username,
string password,
string hashedPassword,
- User user,
+ User? user,
string remoteEndPoint)
{
bool success = false;
- IAuthenticationProvider authenticationProvider = null;
+ IAuthenticationProvider? authenticationProvider = null;
foreach (var provider in GetAuthenticationProviders(user))
{
@@ -543,6 +551,8 @@ namespace Emby.Server.Implementations.Library
_users[user.Id] = user;
}
+#nullable restore
+
public UserDto GetUserDto(User user, string remoteEndPoint = null)
{
if (user == null)