Details
-
Type:
Improvement
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.9, 2.0
-
Fix Version/s: DEV backlog
-
Component/s: Administration
-
Labels:
-
Affected Branches:MOODLE_19_STABLE, MOODLE_20_STABLE
Description
As best as I can tell, the delete_user function in /lib/moodlelib.php causes data loss when deleting a user. The problem from my perspective is that the username is replaced with the email address concatenated with the time. The goal is to make the old username, email, and idnumbers available for use. However, as implemented, we lose the username and id number. The email could be found in the new username field. I think a better solution would be to use the description field and prepend a concatenation of those field to the description. Then if we opt to enable the ability to undelete a user, we could attempt to repopulate those fields (providing they do not conflict with an already existing username, email, or idnumber). Alternatively, another simpler solution would be to use username+time, email+time and idnumber+time; however, my concern would be that the username and email fields are varchar(100). Although I suspect that would be fine, in theory, a long username or email would get concatenate but that may be a risk worth taking since implementing would be so easy. Peace - Anthony
Attachments
Issue Links
| This issue will help resolve: | ||||
| MDL-16647 | When user is deleted, the username is lost |
|
|
|
| This issue has a non-specific relationship to: | ||||
| MDL-13563 | Hiding but not deleting users who are suspended in LDAP |
|
|
|
| MDL-16824 | Message: Orphaned unread messages when user deleted |
|
|
|
| MDL-7918 | Add a function to each module to report whether a given user has any data in a given activity |
|
|
|
changing to critical since technically speaking it results in a loss of data