aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Library
diff options
context:
space:
mode:
authorVasily <JustAMan@users.noreply.github.com>2019-02-04 14:08:21 +0300
committerGitHub <noreply@github.com>2019-02-04 14:08:21 +0300
commit0b3e6548dbea5db4d31e3947cc2406852d8e3733 (patch)
tree58498940d6f7af752b7b62f855670510b699a774 /Emby.Server.Implementations/Library
parentc4c0894b29898ab6826542abc7a247291b46f804 (diff)
parent78e4e2ed929155b433fc0cbb2ea6fc7f64411a72 (diff)
Merge pull request #797 from Bond-009/warnings
Fix all warnings
Diffstat (limited to 'Emby.Server.Implementations/Library')
-rw-r--r--Emby.Server.Implementations/Library/UserManager.cs34
1 files changed, 17 insertions, 17 deletions
diff --git a/Emby.Server.Implementations/Library/UserManager.cs b/Emby.Server.Implementations/Library/UserManager.cs
index 6dd9366b0..3ff84382f 100644
--- a/Emby.Server.Implementations/Library/UserManager.cs
+++ b/Emby.Server.Implementations/Library/UserManager.cs
@@ -448,30 +448,30 @@ namespace Emby.Server.Implementations.Library
private void UpdateInvalidLoginAttemptCount(User user, int newValue)
{
- if (user.Policy.InvalidLoginAttemptCount != newValue || newValue > 0)
+ if (user.Policy.InvalidLoginAttemptCount == newValue || newValue <= 0)
{
- user.Policy.InvalidLoginAttemptCount = newValue;
+ return;
+ }
- var maxCount = user.Policy.IsAdministrator ? 3 : 5;
+ user.Policy.InvalidLoginAttemptCount = newValue;
- // TODO: Fix
- /*
- var fireLockout = false;
+ var maxCount = user.Policy.IsAdministrator ? 3 : 5;
- if (newValue >= maxCount)
- {
- _logger.LogDebug("Disabling user {0} due to {1} unsuccessful login attempts.", user.Name, newValue.ToString(CultureInfo.InvariantCulture));
- user.Policy.IsDisabled = true;
+ var fireLockout = false;
- fireLockout = true;
- }*/
+ if (newValue >= maxCount)
+ {
+ _logger.LogDebug("Disabling user {0} due to {1} unsuccessful login attempts.", user.Name, newValue);
+ user.Policy.IsDisabled = true;
- UpdateUserPolicy(user, user.Policy, false);
+ fireLockout = true;
+ }
- /* if (fireLockout)
- {
- UserLockedOut?.Invoke(this, new GenericEventArgs<User>(user));
- }*/
+ UpdateUserPolicy(user, user.Policy, false);
+
+ if (fireLockout)
+ {
+ UserLockedOut?.Invoke(this, new GenericEventArgs<User>(user));
}
}