Horde_Kolab_Server_Exception::SYSTEM);
}
} else {
- /* Net_LDAP2 will work on this as a reference */
- $mod_uid = $uid;
- $result = $this->_ldap->modify($mod_uid, $data);
+ $entry = $this->_ldap->getEntry($mod_uid, $changes['attributes']);
+ $result = $this->_ldap->modify($entry, $data);
if ($result instanceOf PEAR_Error) {
throw new Horde_Kolab_Server_Exception($result,
Horde_Kolab_Server_Exception::SYSTEM);
}
if ($old === false && !($value === null || $value === '' || $value === array())) {
$changes['add'][$key] = $value;
+ $changes['attributes'][] = $key;
} else if ($old !== false && ($value === null || $value === '' || $value === array())) {
$changes['delete'][] = $key;
+ $changes['attributes'][] = $key;
} else if (is_array($old) || is_array($value)) {
if (!is_array($old)) {
$old = array($old);
$adds = array_diff($value, $old);
if (!empty($adds)) {
$changes['add'][$key] = $adds;
+ $changes['attributes'][] = $key;
}
$deletes = array_diff($old, $value);
if (!empty($deletes)) {
$changes['delete'][$key] = $deletes;
+ $changes['attributes'][] = $key;
}
} else {
$changes['replace'][$key] = $value;
+ $changes['attributes'][] = $key;
}
}
}
+ $changes['attributes'] = array_unique($changes['attributes']);
+
return $changes;
}
*
* @return array The differences between both arrays.
*/
- protected function getArrayChanges($a1, $a2)
+ public function getArrayChanges($a1, $a2)
{
if (empty($a1) || empty($a2)) {
return !empty($a1) ? $a1 : $a2;