mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Ludovic Poitou
10.14.2011 a790a48cc8b3f954072bd7e2d4dd6d80363311e5
Fix for OPENDJ-349: manage-account returns Seconds Until Idle Account Lockout: 0 (zero) if the last log on date is more than 24 days before the idle lock out interval.
There's a bad casting between int and long.
1 files modified
4 ■■■■ changed files
opends/src/server/org/opends/server/extensions/PasswordPolicyStateExtendedOperation.java 4 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/extensions/PasswordPolicyStateExtendedOperation.java
@@ -1148,7 +1148,7 @@
        {
          long lockoutTime = lastLoginTime + (lockoutInterval*1000);
          long currentTime = pwpState.getCurrentTime();
          int secondsUntilLockout = (int) ((lockoutTime - currentTime) / 1000);
          int secondsUntilLockout = (int) ((lockoutTime - currentTime) / 1000L);
          if (secondsUntilLockout <= 0)
          {
            secondsStr = "0";
@@ -1184,7 +1184,7 @@
        {
          long currentTime = pwpState.getCurrentTime();
          long changedTime = pwpState.getPasswordChangedTime();
          int changeAge = (int) ((currentTime - changedTime) / 1000);
          int changeAge = (int) ((currentTime - changedTime) / 1000L);
          long timeToLockout = maxAge - changeAge;
          if (timeToLockout <= 0)
          {