Skip to content

fix: Remove avatar and credentials only after user removal - #65435

Draft
SystemKeeper wants to merge 1 commit into
masterfrom
fix/noid/cleanup-only-on-successful-delete
Draft

SystemKeeper wants to merge 1 commit into
masterfrom
fix/noid/cleanup-only-on-successful-delete

Conversation

@SystemKeeper

Copy link
Copy Markdown
Contributor

Summary

When deleting a user, we already call $avatarManager->deleteUserAvatar($this->uid);, which removes the avatars after the user was deleted. Additionally we had a before listener, which removed the avatars before a user was actually deleted. This (alongside the removal of credentials) is tricky when the userbackend denies the user deletion (e.g. LDAP with an active user).

How to test:

  • Have a LDAP user with a custom avatar
  • Run occ user:delete <ldap-user>
  • See The specified user could not be deleted. Please check the logs.
  • Check the avatar of the user -> it is gone.

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Marcel Müller <marcel-mueller@gmx.de>
@SystemKeeper SystemKeeper added this to the Nextcloud 36 milestone Oct 12, 2026
@SystemKeeper SystemKeeper self-assigned this Oct 12, 2026
@SystemKeeper SystemKeeper added bug 3. to review Waiting for reviews feature: users and groups php Pull requests that update Php code labels Oct 12, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews AI assisted bug feature: users and groups php Pull requests that update Php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants