From 931c1cd2954796cc14748a9b6b3aed107d8c5b92 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Mon, 21 Jan 2013 22:44:00 +0000 Subject: [PATCH] fix user dn when adding user to a group git-svn-id: https://svn.apache.org/repos/asf/archiva/redback/redback-core/trunk@1436674 13f79535-47bb-0310-9956-ffa450edef68 --- .../redback/common/ldap/role/DefaultLdapRoleMapper.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/role/DefaultLdapRoleMapper.java b/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/role/DefaultLdapRoleMapper.java index 950570a6..921868c7 100644 --- a/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/role/DefaultLdapRoleMapper.java +++ b/redback-common/redback-common-ldap/src/main/java/org/apache/archiva/redback/common/ldap/role/DefaultLdapRoleMapper.java @@ -584,14 +584,14 @@ public class DefaultLdapRoleMapper if ( attribute == null ) { BasicAttribute basicAttribute = new BasicAttribute( "uniquemember" ); - basicAttribute.add( this.userIdAttribute + "=" + username + "," + getGroupsDn() ); - context.modifyAttributes( "cn=" + groupName + "," + getBaseDn(), new ModificationItem[]{ + basicAttribute.add( this.userIdAttribute + "=" + username + "," + getBaseDn() ); + context.modifyAttributes( "cn=" + groupName + "," + getGroupsDn(), new ModificationItem[]{ new ModificationItem( DirContext.ADD_ATTRIBUTE, basicAttribute ) } ); } else { - attribute.add( this.userIdAttribute + "=" + username + "," + getGroupsDn() ); - context.modifyAttributes( "cn=" + groupName + "," + getBaseDn(), new ModificationItem[]{ + attribute.add( this.userIdAttribute + "=" + username + "," + getBaseDn() ); + context.modifyAttributes( "cn=" + groupName + "," + getGroupsDn(), new ModificationItem[]{ new ModificationItem( DirContext.REPLACE_ATTRIBUTE, attribute ) } ); } return true;