PDA

View Full Version : DataManager: How to delete a user based on userid ?


PleaseHelp
02-11-2012, 03:25 PM
Hello,

How can we manually delete a user using the DataManager?

We are looking for a function that replicates deleting a user from the AdminCP, but that does it manually using the DataManager and a given userid.

Note that we do NOT wish to delete all the user's posts (I believe vB converts all deleted users posts to Guest Posts when deleting within the AdminCP, and we want to mimic that behavior).

Please advise.

Thanks!

kh99
02-11-2012, 04:10 PM
If you look in admincp/user.php in the section that starts

// ###################### Start Kill #######################
if ($_POST['do'] == 'kill')
{


you can see that it just creates a User datamanager, sets the existing info, then calls delete(). The only other thing it does before that is to check for (social) groups owned by that user and transfers ownership to the admin doing the deleting.

PleaseHelp
02-11-2012, 04:22 PM
If you look in admincp/user.php in the section that starts

// ###################### Start Kill #######################
if ($_POST['do'] == 'kill')
{


you can see that it just creates a User datamanager, sets the existing info, then calls delete(). The only other thing it does before that is to check for (social) groups owned by that user and transfers ownership to the admin doing the deleting.Thanks! We'll have a look, try it out, and report back if we have any problems.