From 26d5ae8da27093655afd4630162029ecd13422d8 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Wed, 5 Jul 2006 19:51:20 +0000 Subject: [PATCH] fixed handling of multi-value attributes --- lam/lib/modules.inc | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lam/lib/modules.inc b/lam/lib/modules.inc index 3e47e97c..7e2027a7 100644 --- a/lam/lib/modules.inc +++ b/lam/lib/modules.inc @@ -1135,10 +1135,11 @@ class accountContainer { else if ($attributes[$attr_names[$i]][$j]!='') $toadd[$attr_names[$i]][] = $attributes[$attr_names[$i]][$j]; } // find unchanged attributes - for ($j=0; $jdn]['add'])) $attr = array_merge_recursive($attr, $attributes[$this->dn]['add']); - if (is_array($attributes[$this->dn]['notchanged'])) $attr = array_merge_recursive($attr, $attributes[$this->dn]['notchanged']); if (is_array($attributes[$this->dn]['modify'])) $attr = array_merge_recursive($attr, $attributes[$this->dn]['modify']); + // add unchanged attributes if not already set + if (is_array($attributes[$this->dn]['notchanged'])) { + $notChangedKeys = array_keys($attributes[$this->dn]['notchanged']); + for ($i = 0; $i < sizeof($notChangedKeys); $i++) { + if (!isset($attr[$notChangedKeys[$i]])) { + $attr[$notChangedKeys[$i]] = $attributes[$this->dn]['notchanged'][$notChangedKeys[$i]]; + } + } + } // add attributes which are not controlled by modules from original account $attrNames = array_keys($this->attributes_orig); for ($i = 0; $i < sizeof($attrNames); $i++) {