aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Library/UserManager.cs
diff options
context:
space:
mode:
authorBond_009 <bond.009@outlook.com>2019-11-01 18:38:54 +0100
committerBond_009 <bond.009@outlook.com>2019-11-27 16:29:56 +0100
commit42ffddc26932bcf2da762bf4fe1ec4bdc42e8166 (patch)
tree3e412b3a58f2915092abee792572de209844b731 /Emby.Server.Implementations/Library/UserManager.cs
parentf3ca4631c39e89afa0cc4af3631016c00e47037c (diff)
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 2b22129f3..1233dcc43 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;
@@ -358,6 +360,8 @@ namespace Emby.Server.Implementations.Library
return success ? user : null;
}
+#nullable enable
+
private static string GetAuthenticationProviderId(IAuthenticationProvider provider)
{
return provider.GetType().FullName;
@@ -378,7 +382,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;
@@ -399,7 +403,7 @@ namespace Emby.Server.Implementations.Library
return providers;
}
- private IPasswordResetProvider[] GetPasswordResetProviders(User user)
+ private IPasswordResetProvider[] GetPasswordResetProviders(User? user)
{
var passwordResetProviderId = user?.Policy.PasswordResetProviderId;
@@ -418,7 +422,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
{
@@ -442,15 +450,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))
{
@@ -547,6 +555,8 @@ namespace Emby.Server.Implementations.Library
_users[user.Id] = user;
}
+#nullable restore
+
public UserDto GetUserDto(User user, string remoteEndPoint = null)
{
if (user == null)