Commit 9c4c0035 authored by Daryl Herzmann's avatar Daryl Herzmann Committed by akrherz

include LDAP filter for user searches, resolves OF-112


git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@12050 b35dd754-fafc-0310-a699-88a17e54d16e
parent 4cd3d7e3
......@@ -359,9 +359,14 @@ public class LdapGroupProvider implements GroupProvider {
LdapName ldapName = new LdapName(username);
// Turn the LDAP name into something we can use in a
// search by stripping off the comma.
String userDNPart = ldapName.get(ldapName.size() - 1);
StringBuilder userFilter = new StringBuilder();
userFilter.append("(&(");
userFilter.append(ldapName.get(ldapName.size() - 1));
userFilter.append(")");
userFilter.append(MessageFormat.format(manager.getSearchFilter(), "*"));
userFilter.append(")");
NamingEnumeration usrAnswer = ctx.search("",
userDNPart, searchControls);
userFilter.toString(), searchControls);
if (usrAnswer != null && usrAnswer.hasMoreElements()) {
Attribute usernameAttr = ((SearchResult)usrAnswer.next()).getAttributes().get(manager.getUsernameField());
if (usernameAttr != null) {
......
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