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
|
@ -441,8 +441,8 @@ abstract class Access {
|
||||||
//while loop is just a precaution. If a name is not generated within
|
//while loop is just a precaution. If a name is not generated within
|
||||||
//20 attempts, something else is very wrong. Avoids infinite loop.
|
//20 attempts, something else is very wrong. Avoids infinite loop.
|
||||||
while($attempts < 20){
|
while($attempts < 20){
|
||||||
$altName = $name . '_' . uniqid();
|
$altName = $name . '_' . rand(1000,9999);
|
||||||
if(\OCP\User::userExists($altName)) {
|
if(!\OCP\User::userExists($altName)) {
|
||||||
return $altName;
|
return $altName;
|
||||||
}
|
}
|
||||||
$attempts++;
|
$attempts++;
|
||||||
|
|
Loading…
Reference in New Issue