Permalink
Browse files

MDL-20941 store hashed username into user->email field for deleted us…

…ers. Backported from 19_STABLE
  • Loading branch information...
1 parent 90cb3f7 commit 68bbdf091b449344930df36e4bb4e293daf0fb2d @stronk7 stronk7 committed Nov 23, 2009
Showing with 4 additions and 2 deletions.
  1. +4 −2 admin/user.php
View
@@ -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);

0 comments on commit 68bbdf0

Please sign in to comment.