Sfoglia il codice sorgente

fix #1648 store attributes to ldap

Shinsuke Sugaya 7 anni fa
parent
commit
9b8b5a07a1

+ 1 - 0
src/main/java/org/codelibs/fess/app/web/admin/group/AdminGroupAction.java

@@ -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;
         });

+ 1 - 0
src/main/java/org/codelibs/fess/app/web/admin/role/AdminRoleAction.java

@@ -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;
         });

+ 1 - 0
src/main/java/org/codelibs/fess/app/web/admin/user/AdminUserAction.java

@@ -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);

+ 5 - 0
src/main/java/org/codelibs/fess/app/web/base/FessBaseAction.java

@@ -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);
     }