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

@ -1241,7 +1241,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;
@ -1249,11 +1248,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);