Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
die_coolen_jungs
our_own_cloud_project
Commits
323af55b
Commit
323af55b
authored
Nov 17, 2014
by
Arthur Schiwon
Browse files
inlcude AD primary group in user filter, if a group is selected. fixes #12190
parent
55142186
Changes
1
Hide whitespace changes
Inline
Side-by-side
apps/user_ldap/lib/wizard.php
View file @
323af55b
...
...
@@ -850,13 +850,23 @@ class Wizard extends LDAPUtility {
}
$base
=
$this
->
configuration
->
ldapBase
[
0
];
foreach
(
$cns
as
$cn
)
{
$rr
=
$this
->
ldap
->
search
(
$cr
,
$base
,
'cn='
.
$cn
,
array
(
'dn'
));
$rr
=
$this
->
ldap
->
search
(
$cr
,
$base
,
'cn='
.
$cn
,
array
(
'dn'
,
'primaryGroupToken'
));
if
(
!
$this
->
ldap
->
isResource
(
$rr
))
{
continue
;
}
$er
=
$this
->
ldap
->
firstEntry
(
$cr
,
$rr
);
$attrs
=
$this
->
ldap
->
getAttributes
(
$cr
,
$er
);
$dn
=
$this
->
ldap
->
getDN
(
$cr
,
$er
);
$filter
.
=
'(memberof='
.
$dn
.
')'
;
if
(
empty
(
$dn
))
{
continue
;
}
$filterPart
=
'(memberof='
.
$dn
.
')'
;
if
(
isset
(
$attrs
[
'primaryGroupToken'
]))
{
$pgt
=
$attrs
[
'primaryGroupToken'
][
0
];
$primaryFilterPart
=
'(primaryGroupID='
.
$pgt
.
')'
;
$filterPart
=
'(|'
.
$filterPart
.
$primaryFilterPart
.
')'
;
}
$filter
.
=
$filterPart
;
}
$filter
.
=
')'
;
}
...
...
Write
Preview
Supports
Markdown
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