PHP Database shows weird users

PHP Database shows weird users

by Simon Barrios -
Number of replies: 2

Hey everyone! Sorry if this isn't where the post should go.

I'm having a weird situation, not endangering anything in my Moodle but werid nonetheless. When I look up mdl_user in my PHP database, I see users like this "example@company.com.2415489635" (emails and numbers vary). Why is moodle creating these users? Investigating a little we realized that we can delete this users without apparent consequences, however we'd like to be sure if that is the case and how to avoid creating these, as to keep things neat and organized.


Thanks for your answers!

Average of ratings: -
In reply to Simon Barrios

Re: PHP Database shows weird users

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

These are "deleted" users. You can't actually fully delete users from the database as it can break things (e.g. a posting from a deleted user in the middle of a forum thread), so you *should not* delete these.

They are marked in this way so that a new account can be created with the same username as the old one without risking a clash. 

You'll notice that all these users have the field 'deleted' set to '1'. So, if you are querying that table you might want to filter on 'deleted<>1'.