コード例 #1
0
        // Token: 0x06000DD3 RID: 3539 RVA: 0x0003FB54 File Offset: 0x0003DD54
        public static string LdapFilterFromQueryFilter(QueryFilter queryFilter, bool skipCheckVirtualIndex, SoftLinkMode softLinkMode, bool tenantScoped, out bool containsUnsafeIdentity)
        {
            containsUnsafeIdentity = false;
            string text;

            if (queryFilter == null)
            {
                ExTraceGlobals.LdapFilterBuilderTracer.TraceDebug(0L, "LdapFilterBuilder::LdapFilterFromQueryFilter - forming LDAP Filter for <null>.");
                text = "(objectclass=*)";
            }
            else
            {
                ExTraceGlobals.LdapFilterBuilderTracer.TraceDebug <QueryFilter>(0L, "LdapFilterBuilder::LdapFilterFromQueryFilter - forming LDAP Filter for {0}.", queryFilter);
                LdapFilterBuilder ldapFilterBuilder = new LdapFilterBuilder(LdapFilterBuilder.EstimatedFilterStringSize, skipCheckVirtualIndex, softLinkMode, tenantScoped);
                ldapFilterBuilder.BuildLdapFilter(queryFilter, null);
                text = ldapFilterBuilder.ldapFilter.ToString();
                containsUnsafeIdentity = ldapFilterBuilder.containsUnsafeIdentity;
                int value = (LdapFilterBuilder.EstimatedFilterStringSize + text.Length) / 2;
                Interlocked.Exchange(ref LdapFilterBuilder.EstimatedFilterStringSize, value);
            }
            if ((long)text.Length > 128000L)
            {
                throw new ADFilterException(DirectoryStrings.InvalidFilterLength);
            }
            ExTraceGlobals.LdapFilterBuilderTracer.TraceDebug <string>(0L, "LdapFilterBuilder::LdapFilterFromQueryFilter - Ldap filter = {0}.", text);
            return(text);
        }
コード例 #2
0
        protected internal ADGenericPagedReader(IDirectorySession session, ADObjectId rootId, QueryScope scope, QueryFilter filter, SortBy sortBy, int pageSize, IEnumerable <PropertyDefinition> properties, bool skipCheckVirtualIndex) : base(session, rootId, scope, sortBy)
        {
            if (!typeof(ADRawEntry).IsAssignableFrom(typeof(TResult)))
            {
                throw new InvalidOperationException(DirectoryStrings.ErrorMustBeADRawEntry);
            }
            if (pageSize < 0 || pageSize > 10000)
            {
                throw new ArgumentOutOfRangeException("pageSize", pageSize, string.Format("pageSize should be between 1 and {0} or 0 to use the default page size: {1}", 10000, ADGenericPagedReader <TResult> .DefaultPageSize));
            }
            this.dummyInstance = (ADRawEntry)((object)((default(TResult) == null) ? Activator.CreateInstance <TResult>() : default(TResult)));
            QueryFilter  filter2 = filter;
            ConfigScopes configScopes;
            ADScope      readScope = session.GetReadScope(rootId, this.dummyInstance, false, out configScopes);
            ADObject     adobject;

            string[] ldapAttributes;
            base.Session.GetSchemaAndApplyFilter(this.dummyInstance, readScope, out adobject, out ldapAttributes, ref filter, ref properties);
            ADDataSession addataSession = base.Session as ADDataSession;

            if (addataSession != null)
            {
                addataSession.UpdateFilterforInactiveMailboxSearch(this.dummyInstance, ref filter);
            }
            base.LdapAttributes   = ldapAttributes;
            this.pageSize         = ((pageSize == 0) ? ADGenericPagedReader <TResult> .DefaultPageSize : pageSize);
            this.retrievedAllData = null;
            this.properties       = properties;
            session.CheckFilterForUnsafeIdentity(filter2);
            base.LdapFilter           = LdapFilterBuilder.LdapFilterFromQueryFilter(filter, skipCheckVirtualIndex, base.Session.SessionSettings.PartitionSoftLinkMode, base.Session.SessionSettings.IsTenantScoped);
            this.skipNonUniqueResults = (session is IConfigurationSession);
        }
コード例 #3
0
        internal ADVirtualListView(IDirectorySession session, ADObjectId rootId, ADObjectId[] addressListIds, SortBy sortBy, int rowsToPrefetch, IEnumerable <PropertyDefinition> properties) : base(session, rootId, QueryScope.SubTree, sortBy)
        {
            if (properties == null)
            {
                throw new ArgumentNullException("properties");
            }
            if (sortBy == null)
            {
                throw new ArgumentNullException("sortBy");
            }
            if (rowsToPrefetch < 1)
            {
                throw new ArgumentOutOfRangeException("rowsToPrefetch");
            }
            this.rowsToPrefetch = rowsToPrefetch;
            QueryFilter[] array;
            if (addressListIds == null)
            {
                array    = new QueryFilter[2];
                array[0] = new ExistsFilter(ADRecipientSchema.AddressListMembership);
            }
            else
            {
                array = new QueryFilter[addressListIds.Length + 1];
                for (int i = 0; i < addressListIds.Length; i++)
                {
                    array[i] = new ComparisonFilter(ComparisonOperator.Equal, ADRecipientSchema.AddressListMembership, addressListIds[i]);
                }
            }
            array[array.Length - 1] = new ExistsFilter(ADRecipientSchema.DisplayName);
            QueryFilter queryFilter  = new AndFilter(array);
            QueryFilter queryFilter2 = (addressListIds == null) ? queryFilter : new ExistsFilter(ADObjectSchema.ObjectClass);

            this.requestedProperties = properties;
            ADScope  readScope = session.GetReadScope(rootId, ADVirtualListView.dummyADRawEntry);
            ADObject adobject;

            string[] ldapAttributes;
            session.GetSchemaAndApplyFilter(ADVirtualListView.dummyADRawEntry, readScope, out adobject, out ldapAttributes, ref queryFilter2, ref properties);
            base.LdapAttributes               = ldapAttributes;
            this.properties                   = properties;
            base.LdapFilter                   = LdapFilterBuilder.LdapFilterFromQueryFilter((addressListIds == null) ? queryFilter2 : queryFilter, false, base.Session.SessionSettings.PartitionSoftLinkMode, base.Session.SessionSettings.IsTenantScoped);
            this.vlvRequestControl            = new VlvRequestControl();
            this.vlvRequestControl.AfterCount = this.rowsToPrefetch;
            base.DirectoryControls.Add(this.vlvRequestControl);
        }
コード例 #4
0
 // Token: 0x060006F2 RID: 1778 RVA: 0x00025440 File Offset: 0x00023640
 private ADVlvPagedReader(ADObjectId addressBook, IDirectorySession session, ADObjectId rootId, QueryScope scope, QueryFilter filter, SortBy sortBy, bool includeBookmarkObject, bool searchForward, int pageSize, int offset, string target, IEnumerable <PropertyDefinition> properties) : base(session, rootId, scope, filter, sortBy, pageSize, properties, false)
 {
     if (addressBook != null)
     {
         filter = new AndFilter(new QueryFilter[]
         {
             new ComparisonFilter(ComparisonOperator.Equal, ADRecipientSchema.AddressListMembership, addressBook),
             new ExistsFilter(ADRecipientSchema.DisplayName)
         });
         base.LdapFilter  = LdapFilterBuilder.LdapFilterFromQueryFilter(filter, false, base.Session.SessionSettings.PartitionSoftLinkMode, base.Session.SessionSettings.IsTenantScoped);
         base.UseNullRoot = true;
     }
     this.searchForward         = searchForward;
     this.includeBookmarkObject = includeBookmarkObject;
     this.offSet = offset;
     if (this.offSet == 2147483647)
     {
         this.offSet = 0;
     }
     this.vlvRequestControl = new VlvRequestControl(0, 0, target);
     base.DirectoryControls.Add(this.vlvRequestControl);
 }
コード例 #5
0
        // Token: 0x06000DD2 RID: 3538 RVA: 0x0003FB3C File Offset: 0x0003DD3C
        public static string LdapFilterFromQueryFilter(QueryFilter queryFilter, bool skipCheckVirtualIndex, SoftLinkMode softLinkMode, bool tenantScoped)
        {
            bool flag;

            return(LdapFilterBuilder.LdapFilterFromQueryFilter(queryFilter, skipCheckVirtualIndex, softLinkMode, tenantScoped, out flag));
        }
コード例 #6
0
 // Token: 0x06000DD1 RID: 3537 RVA: 0x0003FB2E File Offset: 0x0003DD2E
 public static string LdapFilterFromQueryFilter(QueryFilter queryFilter, bool skipCheckVirtualIndex)
 {
     return(LdapFilterBuilder.LdapFilterFromQueryFilter(queryFilter, skipCheckVirtualIndex, SoftLinkMode.Disabled, false));
 }
コード例 #7
0
 // Token: 0x06000DD0 RID: 3536 RVA: 0x0003FB25 File Offset: 0x0003DD25
 public static string LdapFilterFromQueryFilter(QueryFilter queryFilter)
 {
     return(LdapFilterBuilder.LdapFilterFromQueryFilter(queryFilter, false));
 }