public AUser GetZTOPAccount(string SAMAccountName) { var user = ADController.GetUser(SAMAccountName); if (user.Type == GroupType.Guest) { return(user); } user.Managers = Core.AuthorizeManager.GetList(user.Name); user.MGroup = ADController.GetGroupList(SAMAccountName); if (ADController.IsAdministrator(user)) { user.Type = GroupType.Administrator; } else if (ADController.IsManager(user)) { user.Type = GroupType.Manager; } else { if (user.Managers != null && user.Managers.Count != 0) { user.Type = GroupType.Manager; } else { user.Type = GroupType.Member; } } return(user); }
private User Get(string Name) { var user = ADController.GetUser(Name); user.Managers = Core.AuthorizeManager.GetList(user.Name); if (user.Group.Contains("Administrators")) { user.Type = GroupType.Administrator; } else { if (user.Managers.Count != 0) { user.Type = GroupType.Manager; } else { user.Type = GroupType.Member; } } return(user); }
public User GetWindowsAccount(string sAMAccountName) { if (string.IsNullOrEmpty(sAMAccountName)) { return(null); } var user = ADController.GetUser(sAMAccountName); if (user.Type == GroupType.Guest) { return(user); } user.Managers = Core.AuthorizeManager.GetList(user.Name); user.MGroup = ADController.GetGroupList(sAMAccountName); if (ADController.IsAdministrator(user)) { user.Type = GroupType.Administrator; } else if (ADController.IsManager(user)) { user.Type = GroupType.Manager; } else { if (user.Managers.Count != 0) { user.Type = GroupType.Manager; } else { user.Type = GroupType.Member; } } return(user); }