@Override
public boolean execute(IActionHandler actionHandler, Map<String, Object> context) {
Map<String, Object> actionParam = getModelConnector(context).getConnectorValue();
String typedPasswd = (String) actionParam.get(PASSWD_TYPED);
String retypedPasswd = (String) actionParam.get(PASSWD_RETYPED);
if (!ObjectUtils.equals(typedPasswd, retypedPasswd)) {
throw new ActionBusinessException("Typed and retyped passwords are different.",
"password.typed.retyped.different");
}
checkPasswordValidity(typedPasswd, context);
UserPrincipal principal = getApplicationSession(context).getPrincipal();
if (changePassword(principal, (String) actionParam.get(PASSWD_CURRENT), typedPasswd)) {
setActionParameter(getTranslationProvider(context).getTranslation("password.change.success", getLocale(context)),
context);
return super.execute(actionHandler, context);
}
return false;
}