completely delete a user

completely delete a user

by Paul Beckett -
Number of replies: 1

I'm using Moodle 2, and need to completely delete some users from a plugin.

I've tried calling the delete_user function defined in /lib/moodlelib.php , this seems to delete a lot of the data associated with the user, but leaves a record in the mdl_users table. This seems to be to allow 'account recovery' based upon the email address.

This sounds quite unsafe for us, as we recycle email addresses when students leave.

Can anyone tell me:

1) Is it safe to modify moodlelib.php to simply delete the record from mdl_user instead of modifying it?

2) What actually gets recovered (as most stuff seems to have been fully deleted) when an account is recovered.

 

Thanks,

Paul

Average of ratings: -
In reply to Paul Beckett

Re: completely delete a user

by ajay sharma -

hi can u tell me how you are deleting user.for delete u have to pass user object but password is encrypted .