diff options
| author | Andrew Rabert <6550543+nvllsvm@users.noreply.github.com> | 2019-01-24 23:03:54 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-24 23:03:54 -0500 |
| commit | b4fdfb562dada77ff6d9c75bbc9e5e5b3ee977a2 (patch) | |
| tree | cafeb8316e0120f052eb094e44a02e94639fc223 /Emby.Server.Implementations/Library/UserManager.cs | |
| parent | 15806de2aad07a4b4c799a0ee56d770dd5248543 (diff) | |
| parent | 48ad18d12baeeb42ec0ec7df9473330dcbc76754 (diff) | |
Merge pull request #700 from jellyfin/dev
Dev sync
Diffstat (limited to 'Emby.Server.Implementations/Library/UserManager.cs')
| -rw-r--r-- | Emby.Server.Implementations/Library/UserManager.cs | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/Emby.Server.Implementations/Library/UserManager.cs b/Emby.Server.Implementations/Library/UserManager.cs index d5bc3d332..6139659b7 100644 --- a/Emby.Server.Implementations/Library/UserManager.cs +++ b/Emby.Server.Implementations/Library/UserManager.cs @@ -322,17 +322,14 @@ namespace Emby.Server.Implementations.Library throw new SecurityException(string.Format("The {0} account is currently disabled. Please consult with your administrator.", user.Name)); } - if (user != null) + if (!user.Policy.EnableRemoteAccess && !_networkManager.IsInLocalNetwork(remoteEndPoint)) { - if (!user.Policy.EnableRemoteAccess && !_networkManager.IsInLocalNetwork(remoteEndPoint)) - { - throw new SecurityException("Forbidden."); - } + throw new SecurityException("Forbidden."); + } - if (!user.IsParentalScheduleAllowed()) - { - throw new SecurityException("User is not allowed access at this time."); - } + if (!user.IsParentalScheduleAllowed()) + { + throw new SecurityException("User is not allowed access at this time."); } // Update LastActivityDate and LastLoginDate, then save @@ -463,26 +460,26 @@ namespace Emby.Server.Implementations.Library { user.Policy.InvalidLoginAttemptCount = newValue; - var maxCount = user.Policy.IsAdministrator ? - 3 : - 5; + var maxCount = user.Policy.IsAdministrator ? 3 : 5; + // TODO: Fix + /* var fireLockout = false; if (newValue >= maxCount) { - //_logger.LogDebug("Disabling user {0} due to {1} unsuccessful login attempts.", user.Name, newValue.ToString(CultureInfo.InvariantCulture)); - //user.Policy.IsDisabled = true; + _logger.LogDebug("Disabling user {0} due to {1} unsuccessful login attempts.", user.Name, newValue.ToString(CultureInfo.InvariantCulture)); + user.Policy.IsDisabled = true; - //fireLockout = true; - } + fireLockout = true; + }*/ UpdateUserPolicy(user, user.Policy, false); - if (fireLockout) + /* if (fireLockout) { UserLockedOut?.Invoke(this, new GenericEventArgs<User>(user)); - } + }*/ } } |
