Commit 69349bb7 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Fixed error when searching for groups of a remote user and not using posixMode. JM-646

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@3785 b35dd754-fafc-0310-a699-88a17e54d16e
parent d064c3ee
......@@ -254,16 +254,24 @@ public class LdapGroupProvider implements GroupProvider {
public Collection<Group> getGroups(JID user) {
XMPPServer server = XMPPServer.getInstance();
String username = server.isLocal(user) ? JID.unescapeNode(user.getNode()) : user.toString();
String username;
if (!manager.isPosixMode()) {
// Check if the user exists (only if user is a local user)
if (!server.isLocal(user)) {
return Collections.emptyList();
}
username = JID.unescapeNode(user.getNode());
try {
username = manager.findUserDN(username) + "," + manager.getBaseDN();
}
catch (Exception e) {
Log.error("Could not find user in LDAP " + username);
return new ArrayList<Group>();
return Collections.emptyList();
}
}
else {
username = server.isLocal(user) ? JID.unescapeNode(user.getNode()) : user.toString();
}
String filter = MessageFormat.format(manager.getGroupSearchFilter(), username);
try {
......
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