MDL-20941 store hashed username into user->email field for deleted users. Backported from 19_STABLE

This commit is contained in:
Eloy Lafuente
2009-11-23 19:01:47 +00:00
parent 90cb3f7d20
commit 68bbdf091b
+4 -2
View File
@@ -114,8 +114,8 @@
$updateuser->id = $user->id;
$updateuser->deleted = 1;
$updateuser->username = addslashes("$user->email.".time()); // Remember it just in case
$updateuser->email = ''; // Clear this field to free it up
$updateuser->idnumber = ''; // Clear this field to free it up
$updateuser->email = md5($user->username); // Store hash of username, useful importing/restoring users
$updateuser->idnumber = ''; // Clear this field to free it up
$updateuser->timemodified = time();
if (update_record('user', $updateuser)) {
// Removing a user may have more requirements than just removing their role assignments.
@@ -432,6 +432,8 @@
}
}
require_once($CFG->dirroot . '/blocks/extrafields/admin_user.php');
admin_externalpage_print_footer($adminroot);