示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }