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
This commit is contained in:
Olivier Lamy 2013-01-21 22:44:00 +00:00
parent a30eb5b561
commit 931c1cd295
1 changed files with 4 additions and 4 deletions

View File

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