Commit 0cd0a206 authored by Penny Leach's avatar Penny Leach Committed by Andrew Robert Nicols
Browse files

Bug #841723: Increase precision of user deletion times



Delete user: use microtime() (float) instead of time() for username & email

This prevents collisions when a username with the same details being
deleted in the same second (which happens when tests are running)

Change-Id: I1fe53d0e3904b3a2658aea9e00434b767cc1e0d0
Signed-off-by: default avatarPenny Leach <penny@mjollnir.org>
parent 82ff6466
......@@ -1140,7 +1140,7 @@ function delete_user($userid) {
// We want to append 'deleted.timestamp' to some unique fields in the usr
// table, so they can be reused by new accounts
$fieldstomunge = array('username', 'email');
$datasuffix = '.deleted.' . time();
$datasuffix = '.deleted.' . microtime(true);
$user = get_record('usr', 'id', $userid, null, null, null, null, implode(', ', $fieldstomunge));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment