LDAP: fix generation of alternate internal name on conflicts. Use also smaller number for better user experience on e.g. *DAV links
This commit is contained in:
parent
476747ee89
commit
bd7771867b
1 changed files with 2 additions and 2 deletions
|
@ -441,8 +441,8 @@ abstract class Access {
|
|||
//while loop is just a precaution. If a name is not generated within
|
||||
//20 attempts, something else is very wrong. Avoids infinite loop.
|
||||
while($attempts < 20){
|
||||
$altName = $name . '_' . uniqid();
|
||||
if(\OCP\User::userExists($altName)) {
|
||||
$altName = $name . '_' . rand(1000,9999);
|
||||
if(!\OCP\User::userExists($altName)) {
|
||||
return $altName;
|
||||
}
|
||||
$attempts++;
|
||||
|
|
Loading…
Reference in a new issue