BuildAccountName fix reapplied.

This commit is contained in:
robvde 2013-01-26 08:02:15 +04:00
parent 7ffa59a4d2
commit 8102049d80
2 changed files with 2 additions and 8 deletions

View file

@ -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);