From bd7771867bb68cd608be826ecd00e89b350cac7a Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Thu, 30 May 2013 14:14:43 +0200 Subject: [PATCH] LDAP: fix generation of alternate internal name on conflicts. Use also smaller number for better user experience on e.g. *DAV links --- apps/user_ldap/lib/access.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php index a7611eb3e8..04f73cf01f 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++;