Forum .LRN Q&A: How to get rid of deleted users?

Collapse
Posted by Joerg Winckler on
When I delete a user, he is still in the data base (marked deleted). Is there any way to get completely rid of him?
Collapse
Posted by Peter Marklund on
Yes, there is a proc called ad_remove_user (in acs-tcl/tcl/community-core-procs.tcl) that you can use. I recently fixed this proc for PG so if you're on PG you should get the latest CVS HEAD sources. Note however that this proc can only really be used for users who have recently registered and don't have contents from various packages associated with them. For a typical user I think there will be referential constraints that will cause the proc to fail.
Collapse
Posted by Dirk Gomez on
And it's fair enough that the proc then fails. The user may have contributed content that cannot be undone anymore.
Collapse
Posted by Jade Rubick on
This question gets asked enough that I've added this thread to the Programmer's FAQ: https://openacs.org/faq/
Collapse
Posted by Malte Sussdorff on
Has this actually been changed so that you really delete a user by default if there is no content and otherwise just mark him/her deleted showing the currently still active content owned by the user with the option to delete that content ?
Collapse
Posted by Deds Castillo on
I fixed the remove_user procs called by the dotlrn applets service contracts so that it also correctly removes the user from dotlrn.  These include the user's fs folders and private calendar.  I believe I've covered all the applets including those not installed on standard .LRN installs.

These should have been included on the latest tag by Tracy.  You can try it using /dotlrn/admin/users interface and selecing "Nuke".  The minor hack is that the Nuke for one user display is assumed so it's displayed only when the user's last visit is NULL.  With the advent of Peter's fixes to acs_user delete, that shouldn't be necessary now so you can probably change your copy to always display the Nuke.  I'll see if I can change and commit that in the next couple of days.