diff options
| author | LogicalPhallacy <44458166+LogicalPhallacy@users.noreply.github.com> | 2019-03-18 22:58:37 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-03-18 22:58:37 -0700 |
| commit | c2667f99f4d50f4f7d9bbeec50e8491e52468962 (patch) | |
| tree | 6718ba28640b32b7198fbca31fc7a9bb510b0df4 /Emby.Server.Implementations/Library/UserManager.cs | |
| parent | e3dbed1c1aff986e51e25ba244a6a6bf52816dbe (diff) | |
| parent | c7e7aa0a6166f0909964c9a321c79422575a7d64 (diff) | |
Merge pull request #4 from jellyfin/master
updating local master
Diffstat (limited to 'Emby.Server.Implementations/Library/UserManager.cs')
| -rw-r--r-- | Emby.Server.Implementations/Library/UserManager.cs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Emby.Server.Implementations/Library/UserManager.cs b/Emby.Server.Implementations/Library/UserManager.cs index ee90b3558..4cf703add 100644 --- a/Emby.Server.Implementations/Library/UserManager.cs +++ b/Emby.Server.Implementations/Library/UserManager.cs @@ -448,11 +448,19 @@ namespace Emby.Server.Implementations.Library user.Policy.InvalidLoginAttemptCount = newValue; - var maxCount = user.Policy.IsAdministrator ? 3 : 5; + // Check for users without a value here and then fill in the default value + // also protect from an always lockout if misconfigured + if (user.Policy.LoginAttemptsBeforeLockout == null || user.Policy.LoginAttemptsBeforeLockout == 0) + { + user.Policy.LoginAttemptsBeforeLockout = user.Policy.IsAdministrator ? 5 : 3; + } + + var maxCount = user.Policy.LoginAttemptsBeforeLockout; var fireLockout = false; - if (newValue >= maxCount) + // -1 can be used to specify no lockout value + if (maxCount != -1 && newValue >= maxCount) { _logger.LogDebug("Disabling user {0} due to {1} unsuccessful login attempts.", user.Name, newValue); user.Policy.IsDisabled = true; |
