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: v6.0.0alpha2~707 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=bd7771867bb68cd608be826ecd00e89b350cac7a;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 a7611eb3e84..04f73cf01fe 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++;