Commit 92c725cb authored by Côme Chilliet's avatar Côme Chilliet

Merge branch '6034-applying-a-template-to-a-user-removes-the-mail-tab' into '1.4-dev'

Resolve "Applying a template to a user removes the mail tab"

See merge request fusiondirectory/fd!684
parents c1c59ab8 481d5f26
......@@ -313,7 +313,11 @@ class Attribute
$this->initialValue = $this->getValue();
}
/*! \brief Loads this attribute value from the attrs array
/*! \brief Loads this attribute value from the attrs array if present
*
* If the attribute is not present in $attrs, does not change value
*
* \param array $attrs The attributes array as fetch from the LDAP
*/
protected function loadAttrValue (array $attrs)
{
......
......@@ -1915,10 +1915,16 @@ class simplePlugin implements SimpleTab
/*
* \brief Adapt from template
*
* Adapts fields to the values from a template.
* Should not empty any fields, only take values for the ones provided by the caller.
*
* \param array $attrs LDAP attributes values for template-modified attributes
* \param array $skip attributes to leave untouched
*/
function adapt_from_template (array $attrs, array $skip = [])
{
$this->attrs = $attrs;
$this->attrs = array_merge($this->attrs, $attrs);
/* Walk through attributes */
foreach ($this->attributesAccess as $ldapName => &$attr) {
......@@ -1927,7 +1933,7 @@ class simplePlugin implements SimpleTab
continue;
}
/* Load values */
$attr->loadValue($this->attrs);
$attr->loadValue($attrs);
}
unset($attr);
......
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