]> source.dussan.org Git - nextcloud-server.git/commitdiff
LDAP: fix generation of alternate internal name on conflicts. Use also smaller number...
authorArthur Schiwon <blizzz@owncloud.com>
Thu, 30 May 2013 12:14:43 +0000 (14:14 +0200)
committerArthur Schiwon <blizzz@owncloud.com>
Thu, 30 May 2013 12:14:43 +0000 (14:14 +0200)
apps/user_ldap/lib/access.php

index 8c372766c006dce65e2554a5c03a46494ce1dc04..a6029445bd1c96ef4f7f2ec8bc9cfb95602bd8a2 100644 (file)
@@ -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++;