From: Arthur Schiwon Date: Thu, 30 May 2013 12:14:43 +0000 (+0200) Subject: LDAP: fix generation of alternate internal name on conflicts. Use also smaller number... X-Git-Tag: v5.0.7~25^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=955eff8d879933c0fb19bd007910b3f88b58452b;p=nextcloud-server.git LDAP: fix generation of alternate internal name on conflicts. Use also smaller number for better user experience on e.g. *DAV links --- diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php index 8c372766c00..a6029445bd1 100644 --- a/apps/user_ldap/lib/access.php +++ b/apps/user_ldap/lib/access.php @@ -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++;