Пример #1
0
		internal SAMGroupsSet(UnsafeNativeMethods.IADsMembers iADsMembers, SAMStoreCtx storeCtx, DirectoryEntry ctxBase)
		{
			this.atBeginning = true;
			this.groupsEnumerator = ((IEnumerable)iADsMembers).GetEnumerator();
			this.storeCtx = storeCtx;
			this.ctxBase = ctxBase;
		}
Пример #2
0
 internal SAMGroupsSet(UnsafeNativeMethods.IADsMembers iADsMembers, SAMStoreCtx storeCtx, DirectoryEntry ctxBase)
 {
     this.atBeginning      = true;
     this.groupsEnumerator = ((IEnumerable)iADsMembers).GetEnumerator();
     this.storeCtx         = storeCtx;
     this.ctxBase          = ctxBase;
 }
Пример #3
0
        private StoreCtx CreateContextFromDirectoryEntry(DirectoryEntry entry)
        {
            StoreCtx storeCtx;

            Debug.Assert(entry != null);

            GlobalDebug.WriteLineIf(GlobalDebug.Info, "PrincipalContext", "CreateContextFromDirectoryEntry: path is " + entry.Path);

            if (entry.Path.StartsWith("LDAP:", StringComparison.Ordinal))
            {
                if (this.ContextType == ContextType.ApplicationDirectory)
                {
                    storeCtx = new ADAMStoreCtx(entry, true, _username, _password, _name, _options);
                }
                else
                {
                    storeCtx = new ADStoreCtx(entry, true, _username, _password, _options);
                }
            }
            else
            {
                Debug.Assert(entry.Path.StartsWith("WinNT:", StringComparison.Ordinal));
                storeCtx = new SAMStoreCtx(entry, true, _username, _password, _options);
            }

            storeCtx.OwningContext = this;
            return(storeCtx);
        }
Пример #4
0
        internal SAMGroupsSet(UnsafeNativeMethods.IADsMembers iADsMembers, SAMStoreCtx storeCtx, DirectoryEntry ctxBase)
        {
            GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMGroupsSet", "SAMGroupsSet: creating for path={0}", ctxBase.Path);

            _groupsEnumerator = ((IEnumerable)iADsMembers).GetEnumerator();

            _storeCtx = storeCtx;
            _ctxBase  = ctxBase;
        }
Пример #5
0
        internal SAMGroupsSet(UnsafeNativeMethods.IADsMembers iADsMembers, SAMStoreCtx storeCtx, DirectoryEntry ctxBase)
        {
            GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMGroupsSet", "SAMGroupsSet: creating for path={0}", ctxBase.Path);

            _groupsEnumerator = ((IEnumerable)iADsMembers).GetEnumerator();

            _storeCtx = storeCtx;
            _ctxBase = ctxBase;
        }
Пример #6
0
 internal SAMQuerySet(List <string> schemaTypes, DirectoryEntries entries, DirectoryEntry ctxBase, int sizeLimit, SAMStoreCtx storeCtx, SAMMatcher samMatcher)
 {
     this.schemaTypes = schemaTypes;
     this.entries     = entries;
     this.sizeLimit   = sizeLimit;
     this.storeCtx    = storeCtx;
     this.ctxBase     = ctxBase;
     this.matcher     = samMatcher;
     this.enumerator  = this.entries.GetEnumerator();
 }
Пример #7
0
		internal SAMQuerySet(List<string> schemaTypes, DirectoryEntries entries, DirectoryEntry ctxBase, int sizeLimit, SAMStoreCtx storeCtx, SAMMatcher samMatcher)
		{
			this.schemaTypes = schemaTypes;
			this.entries = entries;
			this.sizeLimit = sizeLimit;
			this.storeCtx = storeCtx;
			this.ctxBase = ctxBase;
			this.matcher = samMatcher;
			this.enumerator = this.entries.GetEnumerator();
		}
Пример #8
0
		internal SAMMembersSet(string groupPath, UnsafeNativeMethods.IADsGroup group, bool recursive, SAMStoreCtx storeCtx, DirectoryEntry ctxBase)
		{
			this.atBeginning = true;
			this.groupsVisited = new List<string>();
			this.groupsToVisit = new List<string>();
			this.foreignMembers = new List<DirectoryEntry>();
			this.foreignGroups = new List<GroupPrincipal>();
			this.storeCtx = storeCtx;
			this.ctxBase = ctxBase;
			this.@group = group;
			this.originalGroup = group;
			this.recursive = recursive;
			this.groupsVisited.Add(groupPath);
			UnsafeNativeMethods.IADsMembers aDsMember = group.Members();
			this.membersEnumerator = ((IEnumerable)aDsMember).GetEnumerator();
		}
Пример #9
0
 internal SAMMembersSet(string groupPath, UnsafeNativeMethods.IADsGroup group, bool recursive, SAMStoreCtx storeCtx, DirectoryEntry ctxBase)
 {
     this.atBeginning    = true;
     this.groupsVisited  = new List <string>();
     this.groupsToVisit  = new List <string>();
     this.foreignMembers = new List <DirectoryEntry>();
     this.foreignGroups  = new List <GroupPrincipal>();
     this.storeCtx       = storeCtx;
     this.ctxBase        = ctxBase;
     this.@group         = group;
     this.originalGroup  = group;
     this.recursive      = recursive;
     this.groupsVisited.Add(groupPath);
     UnsafeNativeMethods.IADsMembers aDsMember = group.Members();
     this.membersEnumerator = ((IEnumerable)aDsMember).GetEnumerator();
 }
Пример #10
0
        // We will iterate over all principals under ctxBase, returning only those which are in the list of types and which
        // satisfy ALL the matching properties.
        internal SAMQuerySet(
            List <string> schemaTypes,
            DirectoryEntries entries,
            DirectoryEntry ctxBase,
            int sizeLimit,
            SAMStoreCtx storeCtx,
            SAMMatcher samMatcher)
        {
            GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMQuerySet", "SAMQuerySet: creating for path={0}, sizelimit={1}", ctxBase.Path, sizeLimit);

            _schemaTypes = schemaTypes;
            _entries     = entries;
            _sizeLimit   = sizeLimit;   // -1 == no limit
            _storeCtx    = storeCtx;
            _ctxBase     = ctxBase;
            _matcher     = samMatcher;

            _enumerator = _entries.GetEnumerator();
        }
Пример #11
0
        // We will iterate over all principals under ctxBase, returning only those which are in the list of types and which
        // satisfy ALL the matching properties.
        internal SAMQuerySet(
                        List<string> schemaTypes,
                        DirectoryEntries entries,
                        DirectoryEntry ctxBase,
                        int sizeLimit,
                        SAMStoreCtx storeCtx,
                        SAMMatcher samMatcher)
        {
            GlobalDebug.WriteLineIf(GlobalDebug.Info, "SAMQuerySet", "SAMQuerySet: creating for path={0}, sizelimit={1}", ctxBase.Path, sizeLimit);

            _schemaTypes = schemaTypes;
            _entries = entries;
            _sizeLimit = sizeLimit;     // -1 == no limit
            _storeCtx = storeCtx;
            _ctxBase = ctxBase;
            _matcher = samMatcher;

            _enumerator = _entries.GetEnumerator();
        }
Пример #12
0
        internal SAMMembersSet(string groupPath, UnsafeNativeMethods.IADsGroup group, bool recursive, SAMStoreCtx storeCtx, DirectoryEntry ctxBase)
        {
            GlobalDebug.WriteLineIf(GlobalDebug.Info,
                                    "SAMMembersSet",
                                    "SAMMembersSet: groupPath={0}, recursive={1}, base={2}",
                                    groupPath,
                                    recursive,
                                    ctxBase.Path);

            _storeCtx = storeCtx;

            _group         = group;
            _originalGroup = group;
            _recursive     = recursive;

            _groupsVisited.Add(groupPath);    // so we don't revisit it

            UnsafeNativeMethods.IADsMembers iADsMembers = group.Members();
            _membersEnumerator = ((IEnumerable)iADsMembers).GetEnumerator();
        }
Пример #13
0
        internal SAMMembersSet(string groupPath, UnsafeNativeMethods.IADsGroup group, bool recursive, SAMStoreCtx storeCtx, DirectoryEntry ctxBase)
        {
            GlobalDebug.WriteLineIf(GlobalDebug.Info,
                                    "SAMMembersSet",
                                    "SAMMembersSet: groupPath={0}, recursive={1}, base={2}",
                                    groupPath,
                                    recursive,
                                    ctxBase.Path);

            _storeCtx = storeCtx;
            _ctxBase = ctxBase;

            _group = group;
            _originalGroup = group;
            _recursive = recursive;

            _groupsVisited.Add(groupPath);    // so we don't revisit it

            UnsafeNativeMethods.IADsMembers iADsMembers = group.Members();
            _membersEnumerator = ((IEnumerable)iADsMembers).GetEnumerator();
        }
Пример #14
0
        private StoreCtx CreateContextFromDirectoryEntry(DirectoryEntry entry)
        {
            StoreCtx sAMStoreCtx;

            if (!entry.Path.StartsWith("LDAP:", StringComparison.Ordinal))
            {
                sAMStoreCtx = new SAMStoreCtx(entry, true, this.username, this.password, this.options);
            }
            else
            {
                if (this.ContextType != ContextType.ApplicationDirectory)
                {
                    sAMStoreCtx = new ADStoreCtx(entry, true, this.username, this.password, this.options);
                }
                else
                {
                    sAMStoreCtx = new ADAMStoreCtx(entry, true, this.username, this.password, this.name, this.options);
                }
            }
            sAMStoreCtx.OwningContext = this;
            return(sAMStoreCtx);
        }
Пример #15
0
        private StoreCtx CreateContextFromDirectoryEntry(DirectoryEntry entry)
        {
            StoreCtx storeCtx;

            Debug.Assert(entry != null);

            GlobalDebug.WriteLineIf(GlobalDebug.Info, "PrincipalContext", "CreateContextFromDirectoryEntry: path is " + entry.Path);

            if (entry.Path.StartsWith("LDAP:", StringComparison.Ordinal))
            {
                if (this.ContextType == ContextType.ApplicationDirectory)
                {
                    storeCtx = new ADAMStoreCtx(entry, true, _username, _password, _name, _options);
                }
                else
                {
                    storeCtx = new ADStoreCtx(entry, true, _username, _password, _options);
                }
            }
            else
            {
                Debug.Assert(entry.Path.StartsWith("WinNT:", StringComparison.Ordinal));
                storeCtx = new SAMStoreCtx(entry, true, _username, _password, _options);
            }

            storeCtx.OwningContext = this;
            return storeCtx;
        }
Пример #16
0
		private StoreCtx CreateContextFromDirectoryEntry(DirectoryEntry entry)
		{
			StoreCtx sAMStoreCtx;
			if (!entry.Path.StartsWith("LDAP:", StringComparison.Ordinal))
			{
				sAMStoreCtx = new SAMStoreCtx(entry, true, this.username, this.password, this.options);
			}
			else
			{
				if (this.ContextType != ContextType.ApplicationDirectory)
				{
					sAMStoreCtx = new ADStoreCtx(entry, true, this.username, this.password, this.options);
				}
				else
				{
					sAMStoreCtx = new ADAMStoreCtx(entry, true, this.username, this.password, this.name, this.options);
				}
			}
			sAMStoreCtx.OwningContext = this;
			return sAMStoreCtx;
		}