Example #1
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);
        }
Example #2
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);
        }
Example #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;
        }
Example #4
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;
		}