Hi!, here is an update of your script, this execute exactly the same process that is follow by the regular way of users deletion. This change the delete field into 1, timemodified is updated with the current time, username is updated with email and timemodified values, email is leaved in blank and it cleans all the role_assignments entries for the user.
It was tested in 1.8.4. Try it!
General developer forum
Databases: Remove users not seen for a while
This discussion has been locked because a year has elapsed since the last post. Please start a new discussion topic.