diff options
author | Thomas Citharel <tcit@tcit.fr> | 2016-08-23 16:20:41 +0200 |
---|---|---|
committer | Lukas Reschke <lukas@statuscode.ch> | 2016-09-27 18:30:02 +0200 |
commit | 18c07f06929679cccf0b1dabe55bb549bae32ddd (patch) | |
tree | 2ad8e64a5d3e0dab54a6875c1e4a2e16cd8244bb /apps/dav | |
parent | 7db01ff8055c660dfaa2ab9d88865245dcac9e62 (diff) | |
download | nextcloud-server-18c07f06929679cccf0b1dabe55bb549bae32ddd.tar.gz nextcloud-server-18c07f06929679cccf0b1dabe55bb549bae32ddd.zip |
delete also addressbooks on user deletion
Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
Diffstat (limited to 'apps/dav')
-rw-r--r-- | apps/dav/lib/HookManager.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/apps/dav/lib/HookManager.php b/apps/dav/lib/HookManager.php index 9a14c322d01..f82e642c00d 100644 --- a/apps/dav/lib/HookManager.php +++ b/apps/dav/lib/HookManager.php @@ -43,6 +43,9 @@ class HookManager { /** @var array */ private $calendarsToDelete; + /** @var array */ + private $addressBooksToDelete; + /** @var CalDavBackend */ private $calDav; @@ -93,6 +96,7 @@ class HookManager { $this->usersToDelete[$params['uid']] = $user; $this->calendarsToDelete = $this->calDav->getCalendarsForUser('principals/users/' . $user->getUID()); + $this->addressBooksToDelete = $this->cardDav->getAddressBooksForUser('principals/users/' . $user->getUID()); } public function postDeleteUser($params) { @@ -105,6 +109,11 @@ class HookManager { $this->calDav->deleteCalendar($calendar['id']); } } + if (!is_null($this->addressBooksToDelete)) { + foreach ($this->addressBooksToDelete as $addressBook) { + $this->cardDav->deleteAddressBook($addressBook['id']); + } + } } public function changeUser($params) { |