AuthenticationInfo authInfo = new AuthenticationInfo(requestorEntry,
isRoot);
InternalClientConnection internalConnection = new
InternalClientConnection(authInfo);
ModifyOperation modifyOperation =
internalConnection.processModify(userDN, modList);
ResultCode resultCode = modifyOperation.getResultCode();
if (resultCode != ResultCode.SUCCESS)
{
operation.setResultCode(resultCode);
operation.setErrorMessage(modifyOperation.getErrorMessage());
operation.setReferralURLs(modifyOperation.getReferralURLs());
return;
}
// If there were any password policy state changes, we need to apply
// them using a root connection because the end user may not have
// sufficient access to apply them. This is less efficient than
// doing them all in the same modification, but it's safer.
List<Modification> pwPolicyMods = pwPolicyState.getModifications();
if (! pwPolicyMods.isEmpty())
{
InternalClientConnection rootConnection =
InternalClientConnection.getRootConnection();
ModifyOperation modOp =
rootConnection.processModify(userDN, pwPolicyMods);
if (modOp.getResultCode() != ResultCode.SUCCESS)
{
// At this point, the user's password is already changed so there's
// not much point in returning a non-success result. However, we
// should at least log that something went wrong.
Message message = WARN_EXTOP_PASSMOD_CANNOT_UPDATE_PWP_STATE.get(
String.valueOf(userDN),
String.valueOf(modOp.getResultCode()),
modOp.getErrorMessage());
ErrorLogger.logError(message);
}
}