summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/dav/command/syncsystemaddressbook.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/dav/command/syncsystemaddressbook.php b/apps/dav/command/syncsystemaddressbook.php
index bb2896abc60..162ab362892 100644
--- a/apps/dav/command/syncsystemaddressbook.php
+++ b/apps/dav/command/syncsystemaddressbook.php
@@ -88,6 +88,18 @@ class SyncSystemAddressBook extends Command {
}
$progress->advance();
});
+
+ // remove no longer existing
+ $allCards = $this->backend->getCards($systemAddressBook['id']);
+ foreach($allCards as $card) {
+ $vCard = Reader::read($card['carddata']);
+ $uid = $vCard->UID->getValue();
+ // load backend and see if user exists
+ if (!$this->userManager->userExists($uid)) {
+ $this->backend->deleteCard($systemAddressBook['id'], $card['uri']);
+ }
+ }
+
$progress->finish();
$output->writeln('');
}