From 53d611e9e25c49b86f82f62280e22a393f88906b Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Thu, 6 Feb 2014 17:29:58 +0000 Subject: [PATCH] earlier check for duplicate user names --- lam/lib/modules/posixAccount.inc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lam/lib/modules/posixAccount.inc b/lam/lib/modules/posixAccount.inc index 762739d4..446d2ab2 100644 --- a/lam/lib/modules/posixAccount.inc +++ b/lam/lib/modules/posixAccount.inc @@ -2855,6 +2855,11 @@ class posixAccount extends baseModule implements passwordService { } $format = str_replace(array_keys($this->umlautReplacements), array_values($this->umlautReplacements), strtolower($format)); $format = str_replace(array(' ', '_', '-'), array('', '', ''), $format); + if (!empty($format) && $this->userNameExists($format)) { + while ($this->userNameExists($format)) { + $format = $this->getNextUserName($format); + } + } return $format; }