Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
Openfire
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Openfire
Commits
d8980554
Commit
d8980554
authored
Jan 19, 2016
by
Guus der Kinderen
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #511 from anuko/master
A fix for OF-1041
parents
fa5b0ee0
c66703d9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
LdapGroupProvider.java
...ava/org/jivesoftware/openfire/ldap/LdapGroupProvider.java
+15
-4
No files found.
src/java/org/jivesoftware/openfire/ldap/LdapGroupProvider.java
View file @
d8980554
...
...
@@ -226,8 +226,12 @@ public class LdapGroupProvider extends AbstractGroupProvider {
Pattern
pattern
=
Pattern
.
compile
(
"(?i)(^"
+
manager
.
getUsernameField
()
+
"=)([^,]+)(.+)"
);
// We have to process Active Directory differently.
boolean
isAD
=
manager
.
getUsernameField
().
equals
(
"sAMAccountName"
);
String
[]
returningAttributes
=
isAD
?
new
String
[]
{
"distinguishedName"
,
manager
.
getUsernameField
()
}
:
new
String
[]
{
manager
.
getUsernameField
()
};
SearchControls
searchControls
=
new
SearchControls
();
searchControls
.
setReturningAttributes
(
new
String
[]
{
"distinguishedName"
,
manager
.
getUsernameField
()
}
);
searchControls
.
setReturningAttributes
(
returningAttributes
);
// See if recursive searching is enabled. Otherwise, only search one level.
if
(
manager
.
isSubTreeSearch
())
{
searchControls
.
setSearchScope
(
SearchControls
.
SUBTREE_SCOPE
);
...
...
@@ -289,9 +293,16 @@ public class LdapGroupProvider extends AbstractGroupProvider {
while
(
usrAnswer
.
hasMoreElements
())
{
searchResult
=
(
SearchResult
)
usrAnswer
.
nextElement
();
Attributes
attrs
=
searchResult
.
getAttributes
();
Attribute
userdnAttr
=
attrs
.
get
(
"distinguishedName"
);
if
(
username
.
equals
((
String
)
userdnAttr
.
get
()))
{
// Exact match found, use it.
if
(
isAD
)
{
Attribute
userdnAttr
=
attrs
.
get
(
"distinguishedName"
);
if
(
username
.
equals
((
String
)
userdnAttr
.
get
()))
{
// Exact match found, use it.
username
=
(
String
)
attrs
.
get
(
manager
.
getUsernameField
()).
get
();
break
;
}
}
else
{
// No iteration occurs here, which is probably a bug.
username
=
(
String
)
attrs
.
get
(
manager
.
getUsernameField
()).
get
();
break
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment