AD provider logging increased due to duplicate user objects

This commit is contained in:
robvde 2013-01-26 10:00:06 +04:00
parent d43a4dc61d
commit 1297722c6a
2 changed files with 6 additions and 6 deletions

View file

@ -75,10 +75,8 @@ namespace WebsitePanel.Providers.HostedSolution
public static void DebugInfo(string message, params object[] args) public static void DebugInfo(string message, params object[] args)
{ {
#if DEBUG
string text = String.Format(message, args); string text = String.Format(message, args);
Log.WriteInfo("{0} {1}", LogPrefix, text); Log.WriteInfo("{0} {1}", LogPrefix, text);
#endif
} }
public static void EndLog(string message, ResultObject res, string errorCode, Exception ex) public static void EndLog(string message, ResultObject res, string errorCode, Exception ex)

View file

@ -719,13 +719,14 @@ namespace WebsitePanel.Providers.HostedSolution
private bool DoesSamAccountNameExistInternal(string accountName) private bool DoesSamAccountNameExistInternal(string accountName)
{ {
HostedSolutionLog.LogStart("DoesSamAccountNameExistInternal"); HostedSolutionLog.LogStart("DoesSamAccountNameExistInternal");
HostedSolutionLog.DebugInfo("userPrincipalName : {0}", accountName); HostedSolutionLog.DebugInfo("sAMAccountName : {0}", accountName);
bool bFound = false; bool bFound = false;
try try
{ {
string path = GetRootOU(); string path = GetRootOU();
HostedSolutionLog.DebugInfo("Search path : {0}", path);
DirectoryEntry entry = ActiveDirectoryUtils.GetADObject(path); DirectoryEntry entry = ActiveDirectoryUtils.GetADObject(path);
DirectorySearcher searcher = new DirectorySearcher(entry); DirectorySearcher searcher = new DirectorySearcher(entry);
@ -737,16 +738,17 @@ namespace WebsitePanel.Providers.HostedSolution
if (resCollection != null) if (resCollection != null)
{ {
if(resCollection.Properties["samaccountname"] != null) if(resCollection.Properties["samaccountname"] != null)
bFound = true; ; bFound = true;
} }
HostedSolutionLog.LogEnd("GetSamAccountNameByUserPrincipalNameInternal");
} }
catch (Exception e) catch (Exception e)
{ {
HostedSolutionLog.DebugInfo("Failed : {0}", e.Message); HostedSolutionLog.DebugInfo("Failed : {0}", e.Message);
} }
HostedSolutionLog.DebugInfo("DoesSamAccountNameExistInternal Result: {0}", bFound);
HostedSolutionLog.LogEnd("DoesSamAccountNameExistInternal");
return bFound; return bFound;
} }