| | |
| | | |
| | | /** Indicates whether the request included the user's current password. */ |
| | | private boolean currentPasswordProvided; |
| | | |
| | | /** |
| | | * Indicates whether the user's account has been enabled or disabled |
| | | * by this modify operation. |
| | | */ |
| | | private boolean enabledStateChanged; |
| | | |
| | | /** Indicates whether the user's account is currently enabled. */ |
| | | private boolean isEnabled; |
| | | |
| | |
| | | * @throws CanceledOperationException |
| | | * if this operation should be cancelled |
| | | */ |
| | | public void processLocalModify(final LocalBackendWorkflowElement wfe) |
| | | throws CanceledOperationException |
| | | void processLocalModify(final LocalBackendWorkflowElement wfe) throws CanceledOperationException |
| | | { |
| | | this.backend = wfe.getBackend(); |
| | | |
| | |
| | | return; |
| | | } |
| | | |
| | | if (isAuthnManagedLocally()) |
| | | { |
| | | processPasswordPolicyModifications(); |
| | | performAdditionalPasswordChangedProcessing(); |
| | | |
| | | if (!passwordChanged && !isInternalOperation() && selfChange |
| | | && pwPolicyState != null && pwPolicyState.mustChangePassword()) |
| | | if (!isInternalOperation() |
| | | && selfChange && !passwordChanged && pwPolicyState.mustChangePassword()) |
| | | { |
| | | // The user did not attempt to change their password. |
| | | pwpErrorType = PasswordPolicyErrorType.CHANGE_AFTER_RESET; |
| | | setResultCode(ResultCode.CONSTRAINT_VIOLATION); |
| | | appendErrorMessage(ERR_MODIFY_MUST_CHANGE_PASSWORD |
| | | .get(authzDN != null ? authzDN : "anonymous")); |
| | | appendErrorMessage(ERR_MODIFY_MUST_CHANGE_PASSWORD.get(authzDN != null ? authzDN : "anonymous")); |
| | | return; |
| | | } |
| | | } |
| | | |
| | | if (mustCheckSchema()) |
| | | { |
| | |
| | | |
| | | backend.replaceEntry(currentEntry, modifiedEntry, this); |
| | | |
| | | if (isAuthnManagedLocally()) |
| | | { |
| | | generatePwpAccountStatusNotifications(); |
| | | } |
| | | } |
| | | |
| | | // Handle any processing that may be needed for the pre-read and/or post-read controls. |
| | | LocalBackendWorkflowElement.addPreReadResponse(this, preReadRequest, currentEntry); |
| | |
| | | isEnabled = true; |
| | | enabledStateChanged = false; |
| | | |
| | | if (!isAuthnManagedLocally()) |
| | | { |
| | | // nothing to do. |
| | | return; |
| | | } |
| | | |
| | | final PasswordPolicy authPolicy = pwPolicyState.getAuthenticationPolicy(); |
| | | if (currentEntry.hasAttribute(authPolicy.getPasswordAttribute())) |
| | | { |
| | |
| | | && t.equals(getAttributeTypeOrDefault(OP_ATTR_ACCOUNT_DISABLED))) |
| | | { |
| | | enabledStateChanged = true; |
| | | isEnabled = pwPolicyState != null && !pwPolicyState.isDisabled(); |
| | | isEnabled = !pwPolicyState.isDisabled(); |
| | | } |
| | | } |
| | | } |
| | |
| | | * @throws DirectoryException |
| | | * If a problem occurs that should cause the modify operation to fail. |
| | | */ |
| | | public void performAdditionalPasswordChangedProcessing() throws DirectoryException |
| | | private void performAdditionalPasswordChangedProcessing() throws DirectoryException |
| | | { |
| | | if (!isAuthnManagedLocally() || !passwordChanged) |
| | | if (!passwordChanged) |
| | | { |
| | | // Nothing to do. |
| | | return; |
| | |
| | | /** Generate any password policy account status notifications as a result of modify processing. */ |
| | | private void generatePwpAccountStatusNotifications() |
| | | { |
| | | if (!isAuthnManagedLocally()) |
| | | { |
| | | // nothing to do. |
| | | return; |
| | | } |
| | | |
| | | if (passwordChanged) |
| | | { |
| | | if (selfChange) |