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
d07ca592
Commit
d07ca592
authored
Jan 25, 2017
by
Côme Chilliet
Browse files
Fixes
#5357
Do not remove tabs when applying templates to existing objects
Conflicts: include/simpleplugin/class_simplePlugin.inc
parent
4996946c
Changes
4
Hide whitespace changes
Inline
Side-by-side
include/class_baseSelector.inc
View file @
d07ca592
...
...
@@ -142,7 +142,7 @@ class baseSelector {
{
global
$config
;
if
(
!
isset
(
$this
->
base
)
||
(
$this
->
base
==
""
))
{
if
(
!
isset
(
$this
->
base
)
||
(
$this
->
base
==
''
))
{
$this
->
lastState
=
FALSE
;
return
FALSE
;
}
...
...
@@ -179,7 +179,6 @@ class baseSelector {
}
}
}
}
/* Skip if there's no change */
...
...
include/class_plugin.inc
View file @
d07ca592
...
...
@@ -459,7 +459,7 @@ class plugin
$is_new
=
empty
(
$oc
);
/* Load (minimum) attributes, add missing ones */
$this
->
attrs
[
'objectClass'
]
=
array_merge_unique
(
$oc
,
$this
->
o
bject
c
lasses
);
$this
->
attrs
[
'objectClass'
]
=
$this
->
mergeO
bject
C
lasses
(
$oc
);
/* Copy standard attributes */
foreach
(
$this
->
attributes
as
$val
)
{
...
...
include/class_template.inc
View file @
d07ca592
...
...
@@ -191,6 +191,11 @@ class template
{
if
(
$targetdn
!==
NULL
)
{
$this
->
tabObject
=
objects
::
open
(
$targetdn
,
$this
->
type
);
foreach
(
$this
->
tabObject
->
by_object
as
$class
=>
&
$plugin
)
{
if
(
$plugin
->
is_account
||
$plugin
->
ignore_account
)
{
$this
->
attrs
[
'objectClass'
]
=
$plugin
->
mergeObjectClasses
(
$this
->
attrs
[
'objectClass'
]);
}
}
}
elseif
(
$this
->
applied
)
{
trigger_error
(
'Templates can’t be applied twice without calling reset before'
);
return
;
...
...
include/simpleplugin/class_simplePlugin.inc
View file @
d07ca592
...
...
@@ -657,6 +657,12 @@ class simplePlugin extends plugin
$this
->
post_save
();
}
/* Used by prepare_save and template::apply */
public
function
mergeObjectClasses
(
array
$oc
)
{
return
array_merge_unique
(
$oc
,
$this
->
objectclasses
);
}
protected
function
prepare_save
()
{
/* Call parents save to prepare $this->attrs */
...
...
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