You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by nv...@apache.org on 2022/04/14 04:17:55 UTC

[cloudstack] branch main updated (c7941278f7 -> 3674aff4d4)

This is an automated email from the ASF dual-hosted git repository.

nvazquez pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


    from c7941278f7 Allow creating snapshot from VM snapshot (#4739)
     add fbf77978e1 Fix: Allow disabling the login attempts mechanism for disabling users (#6254)
     new 3674aff4d4 Merge branch '4.16'

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../main/java/com/cloud/configuration/Config.java  |  2 +-
 .../java/com/cloud/user/AccountManagerImpl.java    | 28 ++++++++++++++--------
 .../com/cloud/user/AccountManagerImplTest.java     | 27 +++++++++++++++++++++
 3 files changed, 46 insertions(+), 11 deletions(-)


[cloudstack] 01/01: Merge branch '4.16'

Posted by nv...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

nvazquez pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudstack.git

commit 3674aff4d4d39b94be19de2c82da1a5f6a74b2fc
Merge: c7941278f7 fbf77978e1
Author: nvazquez <ni...@gmail.com>
AuthorDate: Thu Apr 14 01:17:38 2022 -0300

    Merge branch '4.16'

 .../main/java/com/cloud/configuration/Config.java  |  2 +-
 .../java/com/cloud/user/AccountManagerImpl.java    | 28 ++++++++++++++--------
 .../com/cloud/user/AccountManagerImplTest.java     | 27 +++++++++++++++++++++
 3 files changed, 46 insertions(+), 11 deletions(-)

diff --cc server/src/main/java/com/cloud/user/AccountManagerImpl.java
index 031ba9e22c,f0028192df..5b241cb807
--- a/server/src/main/java/com/cloud/user/AccountManagerImpl.java
+++ b/server/src/main/java/com/cloud/user/AccountManagerImpl.java
@@@ -2552,19 -2544,10 +2552,10 @@@ public class AccountManagerImpl extend
                  return null;
              }
  
 -            if (userAccount.getState().equalsIgnoreCase(Account.State.enabled.toString())) {
 +            if (userAccount.getState().equalsIgnoreCase(Account.State.ENABLED.toString())) {
                  if (!isInternalAccount(userAccount.getId())) {
                      // Internal accounts are not disabled
-                     int attemptsMade = userAccount.getLoginAttempts() + 1;
-                     if (updateIncorrectLoginCount) {
-                         if (attemptsMade < _allowedLoginAttempts) {
-                             updateLoginAttempts(userAccount.getId(), attemptsMade, false);
-                             s_logger.warn("Login attempt failed. You have " + (_allowedLoginAttempts - attemptsMade) + " attempt(s) remaining");
-                         } else {
-                             updateLoginAttempts(userAccount.getId(), _allowedLoginAttempts, true);
-                             s_logger.warn("User " + userAccount.getUsername() + " has been disabled due to multiple failed login attempts." + " Please contact admin.");
-                         }
-                     }
+                     updateLoginAttemptsWhenIncorrectLoginAttemptsEnabled(userAccount, updateIncorrectLoginCount, _allowedLoginAttempts);
                  }
              } else {
                  s_logger.info("User " + userAccount.getUsername() + " is disabled/locked");