Exemplo n.º 1
0
        private ResultSet FindByDate(
            FindByDateMatcher.DateProperty property,
            MatchType matchType,
            DateTime value,
            Type principalType
            )
        {
            // We use the same SAMQuery set that we use for query-by-example, but with a different
            // SAMMatcher class to perform the date-range filter.

            // Get the entries we'll iterate over.  Write access to Children is controlled through the
            // ctxBaseLock, but we don't want to have to hold that lock while we're iterating over all
            // the child entries.  So we have to clone the ctxBase --- not ideal, but it prevents
            // multithreading issues.
            DirectoryEntries entries = SDSUtils.BuildDirectoryEntry(_ctxBase.Path, _credentials, _authTypes).Children;

            Debug.Assert(entries != null);

            // The SAMQuerySet will use this to restrict the types of DirectoryEntry objects returned.
            List <string> schemaTypes = GetSchemaFilter(principalType);

            // Create the ResultSet that will perform the client-side filtering
            SAMQuerySet resultSet = new SAMQuerySet(
                schemaTypes,
                entries,
                _ctxBase,
                -1,                                             // no size limit
                this,
                new FindByDateMatcher(property, matchType, value));

            return(resultSet);
        }
Exemplo n.º 2
0
        internal override bool Matches(DirectoryEntry de)
        {
            if (de.Properties["objectSid"] == null || de.Properties["objectSid"].Count == 0)
            {
                return(false);
            }
            else
            {
                FindByDateMatcher.DateProperty dateProperty = this.propertyToMatch;
                switch (dateProperty)
                {
                case FindByDateMatcher.DateProperty.LogonTime:
                {
                    return(this.MatchOnLogonTime(de));
                }

                case FindByDateMatcher.DateProperty.PasswordSetTime:
                {
                    return(this.MatchOnPasswordSetTime(de));
                }

                case FindByDateMatcher.DateProperty.AccountExpirationTime:
                {
                    return(this.MatchOnAccountExpirationTime(de));
                }
                }
                return(false);
            }
        }
Exemplo n.º 3
0
 internal FindByDateMatcher(FindByDateMatcher.DateProperty property, MatchType matchType, DateTime value)
 {
     this.propertyToMatch = property;
     this.matchType       = matchType;
     this.valueToMatch    = value;
 }
Exemplo n.º 4
0
		internal FindByDateMatcher(FindByDateMatcher.DateProperty property, MatchType matchType, DateTime value)
		{
			this.propertyToMatch = property;
			this.matchType = matchType;
			this.valueToMatch = value;
		}