Commit fb140ff0 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Fixes #5487 Fixed template apply on multiple objects

parent 4a12d993
......@@ -193,6 +193,11 @@ class template
* Cannot be called twice! If you need to, call reset between calls */
function apply($targetdn = NULL)
{
if ($this->applied) {
trigger_error('Templates can’t be applied twice without calling reset before');
return;
}
if ($targetdn !== NULL) {
$this->tabObject = objects::open($targetdn, $this->type);
unset($this->attrs['objectClass']['count']);
......@@ -201,9 +206,6 @@ class template
$this->attrs['objectClass'] = $plugin->mergeObjectClasses($this->attrs['objectClass']);
}
}
} elseif ($this->applied) {
trigger_error('Templates can’t be applied twice without calling reset before');
return;
}
foreach ($this->tabObject->by_object as $class => &$plugin) {
......
......@@ -85,6 +85,7 @@ class templateDialog
function setNextTarget ($target)
{
$this->target = $target;
$this->template->reset();
}
function execute ()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment