Delet User

Delet User

by bharat bharat -
Number of replies: 7
I am using moodle 1.6. I want to know that that is it possible that when admin delete the user it should delete all the data which is related to that that user from every table of moodle.

If it is possible then how...?
Average of ratings: -
In reply to bharat bharat

Re: Delet User

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
In order to prevent creating orphaned forum posts and to allow for recovery of student work in the event of an accidental or mistaken deletion, the data is not actually deleted. Deleting a user simply marks the user as a deleted user in the mdl_user table. This is by design and is considered a feature. Peace - Anthony
In reply to Anthony Borrow

Re: Delet User

by bharat bharat -
Thanks for information
In reply to bharat bharat

Re: Delet User

by Tyler Menezes -
If for some reason you really want to, though, it's possible with some DROP SQL commands. If your host has phpMyAdmin installed you can probably figure it out there. However it's very long and you have about a 50% chance of breaking something I'd guess.
In reply to Anthony Borrow

Re: Delet User

by Bruce Wilder -

Unfortunately I accidentally deleted a student thus erasing all her grades and the instructor is steamed as the grades are due today.

I'm glad to hear that the data is still somewhere but how do I access it?

Thanks

In reply to Bruce Wilder

Re: Delet User

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Did you actually delete the student, or just unenrol them from the course?
In reply to Tim Hunt

Re: Delet User

by Bruce Wilder -

Yes, unfortunately I deleted her from the data base.

Thanks, Bruce

In reply to Bruce Wilder

Re: Delet User

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Well, then there is probably a limit to what you can restore.

You will see that in the user table, the row for that user has been munged, but no actually removed. The deleted column will have been set to 1, and the username and some other fields messed around with in a way you can probably undo.

When you deleted that user, Moodle will have attempted to delete a lot of their associated data, however some bits of it, particularly in the colaborative areas like forum posts will still be there.