Signed-off-by: Anna Larch <anna@nextcloud.com>
$userProperties = $this->accountManager->getAccount($user)->getProperties();
$uid = $user->getUID();
+ $backendClassName = $user->getBackendClassName();
$cloudId = $user->getCloudId();
$image = $this->getAvatarImage($user);
$vCard = new VCard();
$vCard->VERSION = '3.0';
- $vCard->UID = $uid;
+ $vCard->UID = md5("$backendClassName:$uid");
+ $vCard->add(new Text($vCard, 'X-NEXTCLOUD-UID', $uid));
$publish = false;
$allCards = $this->backend->getCards($systemAddressBook['id']);
foreach ($allCards as $card) {
$vCard = Reader::read($card['carddata']);
- $uid = $vCard->UID->getValue();
+ $uid = isset($vCard->{'X-NEXTCLOUD-UID'}) ? $vCard->{'X-NEXTCLOUD-UID'}->getValue() : $vCard->UID->getValue();
// load backend and see if user exists
if (!$this->userManager->userExists($uid)) {
$this->deleteUser($card['uri']);