diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2013-05-30 14:14:43 +0200 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2013-05-30 16:55:21 +0200 |
commit | bd7771867bb68cd608be826ecd00e89b350cac7a (patch) | |
tree | 917887cc2ef494e6b96d9ff5764e130731188497 /apps/user_ldap | |
parent | 476747ee892c0a97ca37547046189e4da5ffd573 (diff) | |
download | nextcloud-server-bd7771867bb68cd608be826ecd00e89b350cac7a.tar.gz nextcloud-server-bd7771867bb68cd608be826ecd00e89b350cac7a.zip |
LDAP: fix generation of alternate internal name on conflicts. Use also smaller number for better user experience on e.g. *DAV links
Diffstat (limited to 'apps/user_ldap')
-rw-r--r-- | apps/user_ldap/lib/access.php | 4 |
1 files changed, 2 insertions, 2 deletions
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++; |