private static bool handleWin32Exception(Win32Exception ex, MethodBase Method) { Logging.Logger("ERROR: MethodName =" + Method.Name + " Type: " + ex.GetType().Name + " #:" + ex.NativeErrorCode + " Message:" + ex.Message); switch (ex.NativeErrorCode) { case 1909: //Locked account PromptUser("ERROR: MethodName=" + Method.Name + " Type: " + ex.GetType().Name + " #:" + ex.NativeErrorCode + " Message:" + ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Exclamation, "Network Error"); SecurityTools.ClearAdminCreds(); return(true); case 1326: //Bad credentials error. Clear AdminCreds PromptUser("ERROR: MethodName=" + Method.Name + " Type: " + ex.GetType().Name + " #:" + ex.NativeErrorCode + " Message:" + ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Exclamation, "Network Error"); SecurityTools.ClearAdminCreds(); return(true); case 86: //Bad credentials error. Clear AdminCreds PromptUser("ERROR: MethodName=" + Method.Name + " Type: " + ex.GetType().Name + " #:" + ex.NativeErrorCode + " Message:" + ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Exclamation, "Network Error"); SecurityTools.ClearAdminCreds(); return(true); case 5: //Access denied error. Clear AdminCreds PromptUser("ERROR: MethodName=" + Method.Name + " Type: " + ex.GetType().Name + " #:" + ex.NativeErrorCode + " Message:" + ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Exclamation, "Network Error"); SecurityTools.ClearAdminCreds(); return(true); default: PromptUser("ERROR: MethodName=" + Method.Name + " Type: " + ex.GetType().Name + " #:" + ex.NativeErrorCode + " Message:" + ex.Message, MessageBoxButtons.OK, MessageBoxIcon.Exclamation, "Network Error"); return(true); } }
public static string SetCurrentDomain(DatabaseName database) { _currentDomain = DomainNames[database]; SecurityTools.ClearAdminCreds(); if (database == DatabaseName.vintondd) { SecurityTools.VerifyAdminCreds("Credentials for Vinton AD"); } return(DomainNames[database]); }
private void CriticalStop(object sender, EventArgs e) { StopQueue(); OtherFunctions.Message("The queue was stopped because of an access error. Please re-enter your credentials.", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, "Queue Stopped", this); SecurityTools.ClearAdminCreds(); if (SecurityTools.VerifyAdminCreds()) { StartQueue(); } }
private void ReEnterLACredentialsMenuItem_Click(object sender, EventArgs e) { SecurityTools.ClearAdminCreds(); SecurityTools.VerifyAdminCreds(); }
private void CopyCritcalError(object sender, EventArgs e) { cancel = true; SecurityTools.ClearAdminCreds(); }