moin
moin copied to clipboard
Unable to delete/destroy users
Admin/Users/ (e.g., +admin/userbrowser) enables disabling users, but I created a bunch of test accounts that I'd like to get rid of (destroy).
FWIW, the ./m command line utility and friends also don't seem to support deleting users.
the problem with nuking users is that the edit history (revision metadata) contains a reference to the user who created the revision. that reference would be invalid if you completely get rid of users, so moin does only offer to disable them, to keep that reference intact.
Okay, I see what you mean, but then can the "disabled" users be dropped via maint-reduce-revisions?
reduce-revisions is (as the name says) a means to reduce the amount of revisions of an item (keep latest revisions, drop all older revisions). it is not intended to kill the whole item by removing all revisions.
there could be a separate special admin command to drop disabled users, but we better first check what the consequences are for items referring to non-existing users.
Perhaps it would be easier (and enough?) to delete users only if they own no revisions:
- if the account has never created/modified a page, it can be deleted automatically
- else, it will be deletable when
reduce-revisionwill remove the last reference to the account.
There is a limit: if an account has modified a page which is never modified, there will no new revisions so the account will never be droppable.
It is not just the current revision that links to an editor, but all revisions of an item. Deleting (destroying) last editor of an item causes a traceback when viewing the item. Deleting prior editor of an item causes traceback when viewing item's history.
To remove all traces of a rouge user:
- create admin function to list all revisions modified by a user (there is +mychanges to show all revisions made by current logged in user, but no function to show changes made by some other user)
- destroy all revisions modified by a user (functionality to destroy one revision at a time already exists on the UI subject to ACL rules))
- create admin function to destroy a user after verifying there are no revisions made by target user