Commit adfdb74c authored by Côme Bernigaud's avatar Côme Bernigaud Committed by Benoit Mortier
Browse files

Fixes #1887 Fixed template_cn handling

parent 3823c4c6
......@@ -80,7 +80,6 @@ class plugin
\sa plugin::save() plugin::execute()
*/
var $is_template = FALSE;
var $template_cn = FALSE;
var $ignore_account = FALSE;
var $is_modified = FALSE;
......@@ -263,7 +262,7 @@ class plugin
{
$this->is_template = TRUE;
if ($this->mainTab) {
$this->template_cn = $template_attrs['cn'][0];
$this->_template_cn = $template_attrs['cn'][0];
}
$this->attrs = self::tpl_template_to_attrs($template_attrs);
}
......@@ -291,7 +290,7 @@ class plugin
unset($template_attrs['count']);
}
if ($this->mainTab) {
$template_attrs['cn'] = $this->template_cn;
$template_attrs['cn'] = $this->_template_cn;
}
/* First remove all concerned values */
foreach ($template_attrs['fdTemplateField'] as $key => $value) {
......@@ -317,6 +316,7 @@ class plugin
}
}
sort($template_attrs['fdTemplateField']);
print_r($template_attrs);
return $template_attrs;
}
......
......@@ -176,7 +176,7 @@ class tabs
}
}
unset($obj);
/* Show object */
$display = '<div class="tab_content">'."\n";
......@@ -426,7 +426,7 @@ class tabs
function setTemplateMode($cn)
{
$this->getBaseObject()->template_cn = $cn;
$this->getBaseObject()->_template_cn = $cn;
foreach ($this->by_object as &$obj) {
$obj->is_template = TRUE;
......
......@@ -356,7 +356,7 @@ class user extends simplePlugin
function compute_dn()
{
if ($this->is_template) {
$dn = 'cn='.$this->template_cn.',ou=templates,'.get_ou("userRDN").$this->base;
$dn = 'cn='.$this->_template_cn.',ou=templates,'.get_ou("userRDN").$this->base;
return $dn;
}
......
Supports Markdown
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