Removed ITAR check
This commit is contained in:
@ -131,145 +131,6 @@ namespace Fab2ApprovalSystem.Misc
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="userID"></param>
|
||||
/// <returns></returns>
|
||||
public static bool CheckITARAccess(string userID)
|
||||
{
|
||||
MembershipProvider domainProvider = Membership.Providers["ADMembershipProvider"];
|
||||
MembershipUser mu = domainProvider.GetUser(userID, false);
|
||||
if (mu == null)
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="userID"></param>
|
||||
/// <returns></returns>
|
||||
public static bool NA_HasITARAccess(string userID, string pwd)
|
||||
{
|
||||
string ECDomain = ConfigurationManager.AppSettings["ECDomain"];
|
||||
string ECADGroup = ConfigurationManager.AppSettings["ECADGroup"];
|
||||
string naContainer = ConfigurationManager.AppSettings["NAContainer"];
|
||||
string naDomain = ConfigurationManager.AppSettings["NADomain"];
|
||||
|
||||
|
||||
//WriteEvent("NA - Before PrincipalContext for EC for " + userID, System.Diagnostics.EventLogEntryType.Information);
|
||||
PrincipalContext contextGroup = new PrincipalContext(ContextType.Domain, ECDomain);
|
||||
//WriteEvent("NA - After PrincipalContext for EC for " + userID, System.Diagnostics.EventLogEntryType.Information);
|
||||
|
||||
//WriteEvent("NA - Before PrincipalContext for NA for " + userID, System.Diagnostics.EventLogEntryType.Information);
|
||||
PrincipalContext contextUser = new PrincipalContext(ContextType.Domain,
|
||||
naDomain,
|
||||
naContainer,
|
||||
ContextOptions.Negotiate, userID, pwd);
|
||||
//WriteEvent("NA - After PrincipalContext for NA for " + userID, System.Diagnostics.EventLogEntryType.Information);
|
||||
|
||||
//WriteEvent("NA - Before check user in EC group for " + userID, System.Diagnostics.EventLogEntryType.Information);
|
||||
GroupPrincipal gp = GroupPrincipal.FindByIdentity(contextGroup, ECADGroup);
|
||||
//WriteEvent("NA - After check user in EC group for " + userID, System.Diagnostics.EventLogEntryType.Information);
|
||||
|
||||
//WriteEvent("NA - Before check user in NA group for " + userID, System.Diagnostics.EventLogEntryType.Information);
|
||||
UserPrincipal up = UserPrincipal.FindByIdentity(contextUser, userID);
|
||||
//WriteEvent("NA - After check user in NA group for " + userID, System.Diagnostics.EventLogEntryType.Information);
|
||||
|
||||
if (null == up)
|
||||
{
|
||||
//WriteEvent("NA - User not in NA for " + userID, System.Diagnostics.EventLogEntryType.Information);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
//WriteEvent("NA - Member of EC group is " + up.IsMemberOf(gp).ToString() + " for " + userID, System.Diagnostics.EventLogEntryType.Information);
|
||||
return up.IsMemberOf(gp);
|
||||
}
|
||||
}
|
||||
//public static bool NA_GetUsers()
|
||||
//{
|
||||
// //string ECDomain = ConfigurationManager.AppSettings["ECDomain"];
|
||||
// //string ECADGroup = ConfigurationManager.AppSettings["ECADGroup"];
|
||||
// string naContainer = ConfigurationManager.AppSettings["NAContainer"];
|
||||
// string naDomain = ConfigurationManager.AppSettings["NADomain"];
|
||||
|
||||
|
||||
// //WriteEvent("NA - Before PrincipalContext for EC for " + userID, System.Diagnostics.EventLogEntryType.Information);
|
||||
// //PrincipalContext contextGroup = new PrincipalContext(ContextType.Domain, ECDomain);
|
||||
// //WriteEvent("NA - After PrincipalContext for EC for " + userID, System.Diagnostics.EventLogEntryType.Information);
|
||||
|
||||
// //WriteEvent("NA - Before PrincipalContext for NA for " + userID, System.Diagnostics.EventLogEntryType.Information);
|
||||
// PrincipalContext contextUser = new PrincipalContext(ContextType.Domain,
|
||||
// naDomain,
|
||||
// naContainer,
|
||||
// ContextOptions.Negotiate, userID, pwd);
|
||||
// //WriteEvent("NA - After PrincipalContext for NA for " + userID, System.Diagnostics.EventLogEntryType.Information);
|
||||
|
||||
// //WriteEvent("NA - Before check user in EC group for " + userID, System.Diagnostics.EventLogEntryType.Information);
|
||||
// GroupPrincipal gp = GroupPrincipal.FindByIdentity(contextGroup, ECADGroup);
|
||||
// //WriteEvent("NA - After check user in EC group for " + userID, System.Diagnostics.EventLogEntryType.Information);
|
||||
|
||||
// //WriteEvent("NA - Before check user in NA group for " + userID, System.Diagnostics.EventLogEntryType.Information);
|
||||
// UserPrincipal up = UserPrincipal.FindByIdentity(contextUser, userID);
|
||||
// //WriteEvent("NA - After check user in NA group for " + userID, System.Diagnostics.EventLogEntryType.Information);
|
||||
|
||||
// if (null == up)
|
||||
// {
|
||||
// //WriteEvent("NA - User not in NA for " + userID, System.Diagnostics.EventLogEntryType.Information);
|
||||
// return false;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// //WriteEvent("NA - Member of EC group is " + up.IsMemberOf(gp).ToString() + " for " + userID, System.Diagnostics.EventLogEntryType.Information);
|
||||
// return up.IsMemberOf(gp);
|
||||
// }
|
||||
//}
|
||||
|
||||
public static bool IFX_HasITARAccess(string userID, string pwd)
|
||||
{
|
||||
string ECDomain = ConfigurationManager.AppSettings["ECDomain"];
|
||||
string ECADGroup = ConfigurationManager.AppSettings["ECADGroup"];
|
||||
|
||||
|
||||
string ifxcontainer = ConfigurationManager.AppSettings["IFXContainer"];
|
||||
string ifxdomain = ConfigurationManager.AppSettings["IFXDomain"];
|
||||
|
||||
//WriteEvent("IFX - Before PrincipalContext for EC for user " + userID, System.Diagnostics.EventLogEntryType.Information);
|
||||
PrincipalContext contextGroup = new PrincipalContext(ContextType.Domain, ECDomain);
|
||||
//WriteEvent("IFX - After PrincipalContext for EC for user " + userID, System.Diagnostics.EventLogEntryType.Information);
|
||||
|
||||
//WriteEvent("IFX - Before PrincipalContext for IFX for user " + userID, System.Diagnostics.EventLogEntryType.Information);
|
||||
PrincipalContext contextUser = new PrincipalContext(ContextType.Domain,
|
||||
ifxdomain,
|
||||
ifxcontainer,
|
||||
ContextOptions.Negotiate, userID, pwd);
|
||||
|
||||
//WriteEvent("IFX - After PrincipalContext for IFX for user " + userID, System.Diagnostics.EventLogEntryType.Information);
|
||||
|
||||
//WriteEvent("IFX - Before check user in EC group for " + userID, System.Diagnostics.EventLogEntryType.Information);
|
||||
GroupPrincipal gp = GroupPrincipal.FindByIdentity(contextGroup, ECADGroup);
|
||||
//WriteEvent("IFX - After check user in EC group for " + userID, System.Diagnostics.EventLogEntryType.Information);
|
||||
|
||||
//WriteEvent("IFX - Before check user in IFX for " + userID, System.Diagnostics.EventLogEntryType.Information);
|
||||
UserPrincipal up = UserPrincipal.FindByIdentity(contextUser, userID);
|
||||
//WriteEvent("IFX - After check user in IFX for " + userID, System.Diagnostics.EventLogEntryType.Information);
|
||||
|
||||
if (null == up)
|
||||
{
|
||||
//WriteEvent("IFX - not a member of IFX for " + userID, System.Diagnostics.EventLogEntryType.Information);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
//WriteEvent("IFX - Member of EC group is " + up.IsMemberOf(gp).ToString() + " for " + userID, System.Diagnostics.EventLogEntryType.Information);
|
||||
return up.IsMemberOf(gp);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
|
@ -20,8 +20,10 @@ namespace Fab2ApprovalSystem.Misc
|
||||
public const string CAN_CREATE_PARTS_REQUEST = "CanCreatePartsRequest";
|
||||
|
||||
public static bool USER_ISADMIN = false;
|
||||
public static bool IS_INFINEON_DOMAIN = false;
|
||||
public static string hostURL = "";
|
||||
public static string DBConnection = "TEST";
|
||||
public static string DB_CONNECTION_STRING = "";
|
||||
|
||||
public static string AttachmentUrl = "";
|
||||
public static string NDriveURL = "";
|
||||
|
Reference in New Issue
Block a user