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
e6f32b26
Commit
e6f32b26
authored
Oct 24, 2016
by
Côme Chilliet
Browse files
Fixes
#5196
Avoid searching for dn new in groups and roles
parent
160acc95
Changes
1
Show whitespace changes
Inline
Side-by-side
plugins/personal/roles/class_userRoles.inc
View file @
e6f32b26
...
...
@@ -95,10 +95,14 @@ class userRoles extends simplePlugin
$myGroups
=
array
();
}
}
else
{
if
((
$this
->
dn
!=
''
)
&&
(
$this
->
dn
!=
'new'
))
{
$myGroups
=
objects
::
ls
(
'ogroup'
,
NULL
,
NULL
,
'(member='
.
$this
->
dn
.
')'
);
}
else
{
$myGroups
=
array
();
}
$this
->
savedGroupsMembership
=
array_keys
(
$myGroups
);
}
/* We might be in some groups we have no read ACL on, so merge them in the choices */
...
...
@@ -128,10 +132,14 @@ class userRoles extends simplePlugin
$myRoles
=
array
();
}
}
else
{
if
((
$this
->
dn
!=
''
)
&&
(
$this
->
dn
!=
'new'
))
{
$myRoles
=
objects
::
ls
(
'role'
,
NULL
,
NULL
,
'(roleOccupant='
.
$this
->
dn
.
')'
);
}
else
{
$myRoles
=
array
();
}
$this
->
savedRolesMembership
=
array_keys
(
$myRoles
);
}
/* We might be in some roles we have no read ACL on, so merge them in the choices */
...
...
@@ -159,7 +167,7 @@ class userRoles extends simplePlugin
function
remove_from_parent
()
{
if
(
!
$this
->
is_template
)
{
if
(
!
$this
->
is_template
&&
(
$this
->
dn
!=
''
)
&&
(
$this
->
dn
!=
'new'
)
)
{
/* Remove all groups */
foreach
(
$this
->
savedGroupsMembership
as
$ogroupdn
)
{
$g
=
objects
::
open
(
$ogroupdn
,
'ogroup'
);
...
...
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