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

Fixed template cn and dn system

parent a849ff2b
......@@ -130,13 +130,19 @@ class simplePlugin extends plugin
'_template_cn', TRUE
)
)
),
'_template_dummy' => array(
'class' => array('invisible'),
'name' => '_template_dummy',
'attrs' => array()
)
),
$this->attributesInfo
);
$this->attributesAccess['_template_cn'] =& $this->attributesInfo['_template']['attrs']['_template_cn'];
$this->attributesAccess['_template_cn']->setInLdap(FALSE);
$this->attributesAccess['_template_cn']->setValue($this->template_cn);
$this->attributesAccess['_template_cn']->setValue($this->_template_cn);
unset($this->_template_cn);
}
$this->orig_dn = $dn;
......@@ -258,6 +264,10 @@ class simplePlugin extends plugin
}
$attr = $infos['mainAttr'];
$ou = $infos['ou'];
if ($this->is_template) {
$dn = 'cn='.$this->_template_cn.',ou=templates,'.$ou.$this->base;
return $dn;
}
return $attr.'='.$this->attributesAccess[$attr]->computeLdapValue().','.$ou.$this->base;
}
......@@ -904,14 +914,6 @@ class simplePlugin extends plugin
{
return $this->attributesAccess[$field]->foreignKeyCheck($value, $source);
}
protected function templateSaveAttrs()
{
if ($this->mainTab) {
$this->template_cn = $this->_template_cn;
}
return parent::templateSaveAttrs();
}
}
?>
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