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

neil_a_wilson
17.59.2007 2c7b8d6d8c0c177e8089272140dae66b87852ff7
opends/src/server/org/opends/server/extensions/PasswordModifyExtendedOperation.java
@@ -861,6 +861,7 @@
        }
        else
        {
          // Run the new password through the set of password validators.
          if (selfChange ||
               (! pwPolicyState.getPolicy().skipValidationForAdministrators()))
          {
@@ -919,6 +920,33 @@
              return;
            }
          }
          // Prepare to update the password history, if necessary.
          if (pwPolicyState.maintainHistory())
          {
            if (pwPolicyState.isPasswordInHistory(newPassword))
            {
              if (oldPassword == null)
              {
                operation.setResultCode(ResultCode.UNWILLING_TO_PERFORM);
                int msgID = MSGID_EXTOP_PASSMOD_PW_IN_HISTORY;
                operation.appendErrorMessage(getMessage(msgID));
              }
              else
              {
                operation.setResultCode(ResultCode.INVALID_CREDENTIALS);
                int msgID = MSGID_EXTOP_PASSMOD_PW_IN_HISTORY;
                operation.appendAdditionalLogMessage(getMessage(msgID));
              }
            }
            else
            {
              pwPolicyState.updatePasswordHistory();
            }
          }
        }
      }