Skip to content

Conversation

@tcitworld
Copy link
Member

Fixes #25912

No tests changed, maybe time to add some ?

@mention-bot
Copy link

@tcitworld, thanks for your PR! By analyzing the annotation information on this pull request, we identified @DeepDiver1975 to be a potential reviewer

$this->usersToDelete[$params['uid']] = $user;

$this->calendarsToDelete = $this->calDav->getCalendarsForUser('principals/users/' . $user->getUID());
$this->addressBooksToDelete = $this->cardDav->getAddressBooksForUser('principals/users/' . $user->getUID());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to cache the books here. Just retrieve the books in the post hook.

@PVince81 PVince81 added this to the 9.2 milestone Aug 24, 2016
@DeepDiver1975
Copy link
Member

No tests changed, maybe time to add some ?

absolutly - give it a shot ... let me know if you need support ....

@DeepDiver1975 DeepDiver1975 force-pushed the delete-calendars-with-their-users branch from e7324e8 to 045d156 Compare September 22, 2016 09:25
@PVince81
Copy link
Contributor

Must calendar shares for these also be deleted somehow ? Or is that done by a cron job that cleans up orphaned shares ?

@DeepDiver1975
Copy link
Member

Must calendar shares for these also be deleted somehow ?

nice catch .... we should add this as well ...

@tcitworld
Copy link
Member Author

Added, but the whole doesn't work. Also, I'm waiting for #26200 to be merged.

@tcitworld
Copy link
Member Author

tcitworld commented Sep 25, 2016

Getting list of calendars to delete is to be done in the preDeleteUser, otherwise we get Principal not found since the user doesn't exist anymore. Deleting all of the shares from this user can be done in postDeleteUser however.
Also, we don't want to delete calendars which are shared to the user, so we don't use getCalendarsForUser() anymore. There's certainly a better solution that the function I brought, though.

@DeepDiver1975
Copy link
Member

tested - works 👍

@DeepDiver1975 DeepDiver1975 merged commit 37177dd into master Sep 26, 2016
@DeepDiver1975 DeepDiver1975 deleted the delete-calendars-with-their-users branch September 26, 2016 10:11
@koenlek
Copy link

koenlek commented Dec 12, 2017

We have orphaned calenders (or more importantly: calendar shares) which I would like to delete. It's fine with me to delete them manually from the database.

Any instructions how I should do that?

@lock
Copy link

lock bot commented Aug 1, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Calendars are not deleted when an user is deleted

6 participants