diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/ExchangeServer/ExchangeServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/ExchangeServer/ExchangeServerController.cs index 9e8665bb..15c737f2 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/ExchangeServer/ExchangeServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/ExchangeServer/ExchangeServerController.cs @@ -1238,7 +1238,6 @@ namespace WebsitePanel.EnterpriseServer private static string BuildAccountName(string orgId, string name) { string accountName = name = name.Replace(" ", ""); - string CounterStr = "00000"; int counter = 0; bool bFound = false; @@ -1246,11 +1245,10 @@ namespace WebsitePanel.EnterpriseServer do { - accountName = genSamLogin(name, CounterStr); + accountName = genSamLogin(name, counter.ToString("d5")); if (!AccountExists(accountName)) bFound = true; - CounterStr = counter.ToString("d5"); counter++; } while (!bFound); diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs index fd26bfd9..56265bb7 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs @@ -1458,19 +1458,15 @@ namespace WebsitePanel.EnterpriseServer private static string BuildAccountName(string orgId, string name, int ServiceId) { string accountName = name = name.Replace(" ", ""); - string CounterStr = "00000"; int counter = 0; bool bFound = false; - if (!AccountExists(accountName, ServiceId)) return accountName; - do { - accountName = genSamLogin(name, CounterStr); + accountName = genSamLogin(name, counter.ToString("d5")); if (!AccountExists(accountName, ServiceId)) bFound = true; - CounterStr = counter.ToString("d5"); counter++; } while (!bFound);