]> 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 14:55:21 +0000 (16:55 +0200)
apps/user_ldap/lib/access.php

index a7611eb3e846690c0a69b8f90756ae625dcbb5de..04f73cf01fe96b25895e12bb74b7287e15362c17 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++;