| | |
| | | } |
| | | } |
| | | |
| | | setResultCode(ResultCode.UNWILLING_TO_PERFORM); |
| | | setResultCode(ResultCode.CONSTRAINT_VIOLATION); |
| | | appendErrorMessage(ERR_MODIFY_MUST_CHANGE_PASSWORD.get()); |
| | | break modifyProcessing; |
| | | } |
| | |
| | | { |
| | | // The user did not attempt to change their password. |
| | | pwpErrorType = PasswordPolicyErrorType.CHANGE_AFTER_RESET; |
| | | setResultCode(ResultCode.UNWILLING_TO_PERFORM); |
| | | setResultCode(ResultCode.CONSTRAINT_VIOLATION); |
| | | appendErrorMessage(ERR_MODIFY_MUST_CHANGE_PASSWORD.get()); |
| | | break modifyProcessing; |
| | | } |
| | |
| | | if (! (isInternalOperation() || isSynchronizationOperation() || |
| | | m.isInternal())) |
| | | { |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, |
| | | throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, |
| | | ERR_MODIFY_ATTR_IS_NO_USER_MOD.get( |
| | | String.valueOf(entryDN), a.getName())); |
| | | } |
| | |
| | | if (! (isInternalOperation() || isSynchronizationOperation() || |
| | | m.isInternal())) |
| | | { |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, |
| | | throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, |
| | | ERR_MODIFY_ATTR_IS_OBSOLETE.get( |
| | | String.valueOf(entryDN), a.getName())); |
| | | } |
| | |
| | | { |
| | | if (a.hasOptions()) |
| | | { |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, |
| | | throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, |
| | | ERR_MODIFY_PASSWORDS_CANNOT_HAVE_OPTIONS.get()); |
| | | } |
| | | |
| | |
| | | && (!clientConnection.isSecure())) |
| | | { |
| | | pwpErrorType = PasswordPolicyErrorType.PASSWORD_MOD_NOT_ALLOWED; |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, |
| | | throw new DirectoryException(ResultCode.CONFIDENTIALITY_REQUIRED, |
| | | ERR_MODIFY_REQUIRE_SECURE_CHANGES.get()); |
| | | } |
| | | |
| | |
| | | break; |
| | | |
| | | default: |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, |
| | | throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, |
| | | ERR_MODIFY_INVALID_MOD_TYPE_FOR_PASSWORD.get(String.valueOf(m |
| | | .getModificationType()), a.getName())); |
| | | } |
| | |
| | | .isAllowMultiplePasswordValues()) && (passwordsToAdd > 1)) |
| | | { |
| | | pwpErrorType = PasswordPolicyErrorType.PASSWORD_MOD_NOT_ALLOWED; |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, |
| | | throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, |
| | | ERR_MODIFY_MULTIPLE_VALUES_NOT_ALLOWED.get()); |
| | | } |
| | | |
| | |
| | | .isAllowPreEncodedPasswords()) |
| | | { |
| | | pwpErrorType = PasswordPolicyErrorType.INSUFFICIENT_PASSWORD_QUALITY; |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, |
| | | throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, |
| | | ERR_MODIFY_NO_PREENCODED_PASSWORDS.get()); |
| | | } |
| | | else |
| | |
| | | if ((!isInternalOperation()) && selfChange) |
| | | { |
| | | pwpErrorType = PasswordPolicyErrorType.INSUFFICIENT_PASSWORD_QUALITY; |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, |
| | | throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, |
| | | ERR_MODIFY_NO_PREENCODED_PASSWORDS.get()); |
| | | } |
| | | else |
| | |
| | | .getAttributeType()); |
| | | if ((attrList == null) || (attrList.isEmpty())) |
| | | { |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, |
| | | throw new DirectoryException(ResultCode.NO_SUCH_ATTRIBUTE, |
| | | ERR_MODIFY_NO_EXISTING_VALUES.get()); |
| | | } |
| | | boolean found = false; |
| | |
| | | .getAttributeType()); |
| | | if ((attrList == null) || (attrList.isEmpty())) |
| | | { |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, |
| | | throw new DirectoryException(ResultCode.NO_SUCH_ATTRIBUTE, |
| | | ERR_MODIFY_NO_EXISTING_VALUES.get()); |
| | | } |
| | | boolean found = false; |
| | |
| | | } |
| | | else |
| | | { |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, |
| | | throw new DirectoryException(ResultCode.NO_SUCH_ATTRIBUTE, |
| | | ERR_MODIFY_INVALID_PASSWORD.get()); |
| | | } |
| | | |
| | |
| | | { |
| | | Message message = ERR_ENTRY_ADD_OBSOLETE_OC.get(name, String |
| | | .valueOf(entryDN)); |
| | | throw new DirectoryException(ResultCode.OBJECTCLASS_VIOLATION, message); |
| | | throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, message); |
| | | } |
| | | } |
| | | } |
| | |
| | | .isAllowMultiplePasswordValues())) |
| | | { |
| | | pwpErrorType = PasswordPolicyErrorType.PASSWORD_MOD_NOT_ALLOWED; |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, |
| | | throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, |
| | | ERR_MODIFY_MULTIPLE_PASSWORDS_NOT_ALLOWED.get()); |
| | | } |
| | | |
| | |
| | | { |
| | | pwpErrorType = |
| | | PasswordPolicyErrorType.INSUFFICIENT_PASSWORD_QUALITY; |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, |
| | | throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, |
| | | ERR_MODIFY_PW_VALIDATION_FAILED.get( |
| | | invalidReason)); |
| | | } |
| | |
| | | isSkipValidationForAdministrators())) |
| | | { |
| | | pwpErrorType = PasswordPolicyErrorType.PASSWORD_IN_HISTORY; |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, |
| | | throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, |
| | | ERR_MODIFY_PW_IN_HISTORY.get()); |
| | | } |
| | | } |