fix #1648 store attributes to ldap
This commit is contained in:
parent
39144fb83c
commit
9b8b5a07a1
4 changed files with 8 additions and 0 deletions
|
@ -255,6 +255,7 @@ public class AdminGroupAction extends FessAdminAction {
|
|||
|
||||
public static OptionalEntity<Group> getGroup(final CreateForm form) {
|
||||
return getEntity(form).map(entity -> {
|
||||
copyMapToBean(form.attributes, entity, op -> op.exclude(Constants.COMMON_CONVERSION_RULE));
|
||||
copyBeanToBean(form, entity, op -> op.exclude(Constants.COMMON_CONVERSION_RULE));
|
||||
return entity;
|
||||
});
|
||||
|
|
|
@ -209,6 +209,7 @@ public class AdminRoleAction extends FessAdminAction {
|
|||
|
||||
public static OptionalEntity<Role> getRole(final CreateForm form) {
|
||||
return getEntity(form).map(entity -> {
|
||||
copyMapToBean(form.attributes, entity, op -> op.exclude(Constants.COMMON_CONVERSION_RULE));
|
||||
copyBeanToBean(form, entity, op -> op.exclude(Constants.COMMON_CONVERSION_RULE));
|
||||
return entity;
|
||||
});
|
||||
|
|
|
@ -285,6 +285,7 @@ public class AdminUserAction extends FessAdminAction {
|
|||
|
||||
public static OptionalEntity<User> getUser(final CreateForm form) {
|
||||
return getEntity(form).map(entity -> {
|
||||
copyMapToBean(form.attributes, entity, op -> op.exclude(Constants.COMMON_CONVERSION_RULE));
|
||||
copyBeanToBean(form, entity, op -> op.exclude(ArrayUtils.addAll(Constants.COMMON_CONVERSION_RULE, "password")));
|
||||
if (form.crudMode.intValue() == CrudMode.CREATE || StringUtil.isNotBlank(form.password)) {
|
||||
final String encodedPassword = ComponentUtil.getComponent(FessLoginAssist.class).encryptPassword(form.password);
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
*/
|
||||
package org.codelibs.fess.app.web.base;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
@ -194,6 +195,10 @@ public abstract class FessBaseAction extends TypicalAction // has several interf
|
|||
BeanUtil.copyBeanToBean(src, dest, option);
|
||||
}
|
||||
|
||||
protected static void copyMapToBean(final Map<String, ? extends Object> src, final Object dest, final Consumer<CopyOptions> option) {
|
||||
BeanUtil.copyMapToBean(src, dest, option);
|
||||
}
|
||||
|
||||
protected static <T> T copyBeanToNewBean(final Object src, final Class<T> destClass) {
|
||||
return BeanUtil.copyBeanToNewBean(src, destClass);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue