diff --git a/examples/fieldsynchronisation/syncFieldFromLDAP.php b/examples/fieldsynchronisation/syncFieldFromLDAP.php index a14a9eb..d3d13fe 100644 --- a/examples/fieldsynchronisation/syncFieldFromLDAP.php +++ b/examples/fieldsynchronisation/syncFieldFromLDAP.php @@ -77,7 +77,11 @@ foreach ($aResults->entries() as $oEntry) { // print $oEntry->dn() . "\n"; $sValue = $oEntry->get_value($sAttribute, 'single'); // print $sValue . "\n"; - $aValues[] = $sValue; + if (!empty($sValue)) { + $aValues[] = $sValue; + } } +$aValues = array_unique($aValues); + KTMetadataUtil::synchroniseMetadata($oField, $aValues);