BuildAccountName fix reapplied.

This commit is contained in:
robvde 2013-01-26 08:00:52 +04:00
parent fa5ce7eff3
commit 1d2f80f24a
2 changed files with 2 additions and 8 deletions

View file

@ -1238,7 +1238,6 @@ namespace WebsitePanel.EnterpriseServer
private static string BuildAccountName(string orgId, string name) private static string BuildAccountName(string orgId, string name)
{ {
string accountName = name = name.Replace(" ", ""); string accountName = name = name.Replace(" ", "");
string CounterStr = "00000";
int counter = 0; int counter = 0;
bool bFound = false; bool bFound = false;
@ -1246,11 +1245,10 @@ namespace WebsitePanel.EnterpriseServer
do do
{ {
accountName = genSamLogin(name, CounterStr); accountName = genSamLogin(name, counter.ToString("d5"));
if (!AccountExists(accountName)) bFound = true; if (!AccountExists(accountName)) bFound = true;
CounterStr = counter.ToString("d5");
counter++; counter++;
} }
while (!bFound); while (!bFound);

View file

@ -1458,19 +1458,15 @@ namespace WebsitePanel.EnterpriseServer
private static string BuildAccountName(string orgId, string name, int ServiceId) private static string BuildAccountName(string orgId, string name, int ServiceId)
{ {
string accountName = name = name.Replace(" ", ""); string accountName = name = name.Replace(" ", "");
string CounterStr = "00000";
int counter = 0; int counter = 0;
bool bFound = false; bool bFound = false;
if (!AccountExists(accountName, ServiceId)) return accountName;
do do
{ {
accountName = genSamLogin(name, CounterStr); accountName = genSamLogin(name, counter.ToString("d5"));
if (!AccountExists(accountName, ServiceId)) bFound = true; if (!AccountExists(accountName, ServiceId)) bFound = true;
CounterStr = counter.ToString("d5");
counter++; counter++;
} }
while (!bFound); while (!bFound);