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
fusiondirectory
fusiondirectory
Commits
395245f8
Commit
395245f8
authored
Mar 03, 2015
by
Côme Bernigaud
Committed by
Benoit Mortier
Mar 04, 2015
Browse files
For unicity, only check concerned objectTypes (see
#3623
)
parent
197f2751
Changes
1
Hide whitespace changes
Inline
Side-by-side
include/simpleplugin/class_attribute.inc
View file @
395245f8
...
...
@@ -434,12 +434,25 @@ class Attribute
}
else
{
$filter
=
'('
.
$this
->
getLdapName
()
.
'='
.
$value
.
')'
;
}
$infos
=
pluglist
::
pluginInfos
(
get_class
(
$this
->
plugin
));
$filters
=
array_map
(
function
(
$key
,
$ot
)
{
if
(
!
is_numeric
(
$key
))
{
$ot
=
$key
;
}
$oinfos
=
objects
::
infos
(
$ot
);
return
$oinfos
[
'filter'
];
},
array_keys
(
$infos
[
'plObjectType'
]),
array_values
(
$infos
[
'plObjectType'
])
);
$pluginFilter
=
$this
->
plugin
->
getObjectClassFilter
();
if
(
!
empty
(
$pluginFilter
))
{
$filter
=
"(&
$pluginFilter
$filter
)"
;
$filter
s
[]
=
$pluginFilter
;
}
$filter
=
'(&'
.
$filter
.
implode
(
$filters
)
.
')'
;
$ldap
->
search
(
$filter
,
array
(
$this
->
getLdapName
()));
$infos
=
pluglist
::
pluginInfos
(
get_class
(
$this
->
plugin
));
$branches
=
array_map
(
function
(
$key
,
$ot
)
{
...
...
@@ -458,7 +471,6 @@ class Attribute
$found
=
FALSE
;
if
(
$this
->
unique
===
'one'
)
{
/* Check that this entry is in a concerned branch */
$dn_branch
=
preg_replace
(
'/,'
.
preg_quote
(
$base
,
'/'
)
.
'$/'
,
''
,
$dn_base
);
foreach
(
$branches
as
$branch
)
{
if
(
$branch
.
$base
==
$dn_base
)
{
$dn_base
=
preg_replace
(
'/^'
.
preg_quote
(
$branch
,
'/'
)
.
'/'
,
''
,
$dn_base
);
...
...
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