Commit 96bf88b7 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Use correct based DN based on username when loading groups of user. JM-1516

git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@10957 b35dd754-fafc-0310-a699-88a17e54d16e
parent e613fc49
...@@ -18,16 +18,23 @@ import org.jivesoftware.openfire.group.GroupNotFoundException; ...@@ -18,16 +18,23 @@ import org.jivesoftware.openfire.group.GroupNotFoundException;
import org.jivesoftware.openfire.group.GroupProvider; import org.jivesoftware.openfire.group.GroupProvider;
import org.jivesoftware.openfire.user.UserManager; import org.jivesoftware.openfire.user.UserManager;
import org.jivesoftware.openfire.user.UserNotFoundException; import org.jivesoftware.openfire.user.UserNotFoundException;
import org.jivesoftware.util.Log;
import org.jivesoftware.util.JiveConstants; import org.jivesoftware.util.JiveConstants;
import org.jivesoftware.util.Log;
import org.xmpp.packet.JID; import org.xmpp.packet.JID;
import javax.naming.NamingEnumeration; import javax.naming.NamingEnumeration;
import javax.naming.NamingException; import javax.naming.NamingException;
import javax.naming.directory.*; import javax.naming.directory.Attribute;
import javax.naming.ldap.*; import javax.naming.directory.Attributes;
import javax.naming.directory.SearchControls;
import javax.naming.directory.SearchResult;
import javax.naming.ldap.LdapContext;
import javax.naming.ldap.LdapName;
import java.text.MessageFormat; import java.text.MessageFormat;
import java.util.*; import java.util.Collection;
import java.util.Collections;
import java.util.Set;
import java.util.TreeSet;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
...@@ -174,7 +181,7 @@ public class LdapGroupProvider implements GroupProvider { ...@@ -174,7 +181,7 @@ public class LdapGroupProvider implements GroupProvider {
} }
username = JID.unescapeNode(user.getNode()); username = JID.unescapeNode(user.getNode());
try { try {
username = manager.findUserDN(username) + "," + manager.getBaseDN(); username = manager.findUserDN(username) + "," + manager.getUsersBaseDN(username);
} }
catch (Exception e) { catch (Exception e) {
Log.error("Could not find user in LDAP " + username); Log.error("Could not find user in LDAP " + username);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment