// Token: 0x06000DDC RID: 3548 RVA: 0x00040938 File Offset: 0x0003EB38 private void ConvertInChainFilter(InChainFilter inChainFilter) { ADPropertyDefinition adpropertyDefinition = (ADPropertyDefinition)inChainFilter.Property; string ldapDisplayName = adpropertyDefinition.LdapDisplayName; this.IncrementFilterSize(); this.ldapFilter.Append("("); this.ldapFilter.Append(ldapDisplayName); this.ldapFilter.Append(":1.2.840.113556.1.4.1941:="); ADValueConvertor.ConvertToAndAppendFilterString(adpropertyDefinition, inChainFilter.Value, this.ldapFilter, false, 0); this.ldapFilter.Append(")"); }
// Token: 0x06000DDB RID: 3547 RVA: 0x00040790 File Offset: 0x0003E990 private void ConvertTextFilter(TextFilter textFilter) { if (textFilter.Property.Type.IsEnum) { throw new ADFilterException(DirectoryStrings.ExceptionUnsupportedOperatorForProperty(textFilter.Property.Name, "LIKE")); } ADPropertyDefinition adpropertyDefinition = (ADPropertyDefinition)textFilter.Property; string ldapDisplayName = adpropertyDefinition.LdapDisplayName; this.IncrementFilterSize(); this.ldapFilter.Append("("); this.ldapFilter.Append(ldapDisplayName); this.ldapFilter.Append("="); switch (textFilter.MatchOptions) { case MatchOptions.FullString: ADValueConvertor.ConvertToAndAppendFilterString(adpropertyDefinition, textFilter.Text, this.ldapFilter, false, 0); this.ldapFilter.Append(")"); return; case MatchOptions.SubString: this.ldapFilter.Append("*"); ADValueConvertor.ConvertToAndAppendFilterString(adpropertyDefinition, textFilter.Text, this.ldapFilter, false, 0); this.ldapFilter.Append("*)"); return; case MatchOptions.Prefix: ADValueConvertor.ConvertToAndAppendFilterString(adpropertyDefinition, textFilter.Text, this.ldapFilter, false, 0); this.ldapFilter.Append("*)"); return; case MatchOptions.Suffix: this.ldapFilter.Append("*"); ADValueConvertor.ConvertToAndAppendFilterString(adpropertyDefinition, textFilter.Text, this.ldapFilter, false, 0); this.ldapFilter.Append(")"); return; case MatchOptions.WildcardString: ADValueConvertor.EscapeAndAppendString(textFilter.Text, this.ldapFilter, true); this.ldapFilter.Append(")"); return; } throw new ADFilterException(DirectoryStrings.ExceptionUnsupportedTextFilterOption(textFilter.MatchOptions.ToString())); }
// Token: 0x06000DD8 RID: 3544 RVA: 0x0003FF84 File Offset: 0x0003E184 private void ConvertComparisonFilterInternal(ComparisonFilter comparisonFilter, QueryFilter parentFilter, bool isSoftLink, byte softLinkPrefix = 0) { ADPropertyDefinition adpropertyDefinition = (ADPropertyDefinition)comparisonFilter.Property; object obj = comparisonFilter.PropertyValue; string ldapDisplayName = adpropertyDefinition.LdapDisplayName; if (isSoftLink && adpropertyDefinition.IsSoftLinkAttribute) { ldapDisplayName = adpropertyDefinition.SoftLinkShadowProperty.LdapDisplayName; if (obj != null) { obj = ADObjectIdResolutionHelper.ResolveSoftLink((ADObjectId)obj); } } bool flag = adpropertyDefinition.Type.IsGenericType && adpropertyDefinition.Type.GetGenericTypeDefinition() == typeof(Unlimited <>); if (flag) { bool flag2 = adpropertyDefinition.DefaultValue.Equals(obj); switch (comparisonFilter.ComparisonOperator) { case ComparisonOperator.Equal: if (flag2) { this.IncrementFilterSize(2); this.ldapFilter.Append("(!("); this.ldapFilter.Append(ldapDisplayName); this.ldapFilter.Append("=*))"); return; } break; case ComparisonOperator.NotEqual: case ComparisonOperator.LessThan: if (flag2) { this.IncrementFilterSize(); this.ldapFilter.Append('('); this.ldapFilter.Append(ldapDisplayName); this.ldapFilter.Append("=*)"); return; } break; case ComparisonOperator.LessThanOrEqual: if (flag2) { this.IncrementFilterSize(); this.ldapFilter.Append("(objectclass=*)"); return; } break; case ComparisonOperator.GreaterThan: if (flag2) { this.IncrementFilterSize(); this.ldapFilter.Append("(!(objectclass=*))"); return; } break; case ComparisonOperator.GreaterThanOrEqual: if (flag2) { this.IncrementFilterSize(2); this.ldapFilter.Append("(!("); this.ldapFilter.Append(ldapDisplayName); this.ldapFilter.Append("=*))"); return; } this.IncrementFilterSize(4); this.ldapFilter.Append("(|("); this.ldapFilter.Append(ldapDisplayName); this.ldapFilter.Append(">="); ADValueConvertor.ConvertToAndAppendFilterString(adpropertyDefinition, obj, this.ldapFilter, isSoftLink, softLinkPrefix); this.ldapFilter.Append(")(!("); this.ldapFilter.Append(ldapDisplayName); this.ldapFilter.Append("=*)))"); return; } } switch (comparisonFilter.ComparisonOperator) { case ComparisonOperator.LessThan: this.ConvertCompositeFilter(new AndFilter(new QueryFilter[] { new ComparisonFilter(ComparisonOperator.LessThanOrEqual, comparisonFilter.Property, obj), new ComparisonFilter(ComparisonOperator.NotEqual, comparisonFilter.Property, obj) }), parentFilter); return; case ComparisonOperator.GreaterThan: this.ConvertCompositeFilter(new AndFilter(new QueryFilter[] { new ComparisonFilter(ComparisonOperator.GreaterThanOrEqual, comparisonFilter.Property, obj), new ComparisonFilter(ComparisonOperator.NotEqual, comparisonFilter.Property, obj) }), parentFilter); return; } if (!adpropertyDefinition.PersistDefaultValue && !flag && adpropertyDefinition.DefaultValue != null && adpropertyDefinition.DefaultValue.Equals(comparisonFilter.PropertyValue)) { switch (comparisonFilter.ComparisonOperator) { case ComparisonOperator.Equal: this.IncrementFilterSize(4); this.ldapFilter.Append("(|("); this.ldapFilter.Append(ldapDisplayName); this.ldapFilter.Append("="); ADValueConvertor.ConvertToAndAppendFilterString(adpropertyDefinition, adpropertyDefinition.DefaultValue, this.ldapFilter, isSoftLink, softLinkPrefix); this.ldapFilter.Append(")(!("); this.ldapFilter.Append(ldapDisplayName); this.ldapFilter.Append("=*)))"); return; case ComparisonOperator.NotEqual: this.IncrementFilterSize(4); this.ldapFilter.Append("(&(!("); this.ldapFilter.Append(ldapDisplayName); this.ldapFilter.Append("="); ADValueConvertor.ConvertToAndAppendFilterString(adpropertyDefinition, adpropertyDefinition.DefaultValue, this.ldapFilter, isSoftLink, softLinkPrefix); this.ldapFilter.Append("))("); this.ldapFilter.Append(ldapDisplayName); this.ldapFilter.Append("=*))"); return; default: throw new ADFilterException(DirectoryStrings.ExceptionUnsupportedDefaultValueFilter(adpropertyDefinition.Name, comparisonFilter.ComparisonOperator.ToString(), (comparisonFilter.PropertyValue == null) ? string.Empty : obj.ToString())); } } else { string value = string.Empty; switch (comparisonFilter.ComparisonOperator) { case ComparisonOperator.Equal: value = "="; goto IL_49B; case ComparisonOperator.NotEqual: value = "="; goto IL_49B; case ComparisonOperator.LessThanOrEqual: value = "<="; goto IL_49B; case ComparisonOperator.GreaterThanOrEqual: value = ">="; goto IL_49B; } throw new ADFilterException(DirectoryStrings.ExceptionUnsupportedOperator(comparisonFilter.ComparisonOperator.ToString(), typeof(ComparisonFilter).ToString())); IL_49B: if (comparisonFilter.ComparisonOperator == ComparisonOperator.NotEqual) { this.IncrementFilterSize(2); this.ldapFilter.Append("(!("); this.ldapFilter.Append(ldapDisplayName); this.ldapFilter.Append(value); ADValueConvertor.ConvertToAndAppendFilterString(adpropertyDefinition, obj, this.ldapFilter, isSoftLink, softLinkPrefix); this.ldapFilter.Append("))"); return; } if (adpropertyDefinition == ADObjectSchema.Id && Guid.Empty != ((ADObjectId)obj).ObjectGuid && this.tenantScoped && comparisonFilter.ComparisonOperator == ComparisonOperator.Equal) { this.IncrementFilterSize(3); this.ldapFilter.Append("(|("); this.ldapFilter.Append(ldapDisplayName); this.ldapFilter.Append(value); ADValueConvertor.ConvertToAndAppendFilterString(adpropertyDefinition, obj, this.ldapFilter, false, softLinkPrefix); this.ldapFilter.Append(")("); this.ldapFilter.Append(ADObjectSchema.CorrelationIdRaw.LdapDisplayName); this.ldapFilter.Append(value); this.ldapFilter.Append(ADValueConvertor.EscapeBinaryValue(((ADObjectId)obj).ObjectGuid.ToByteArray())); this.ldapFilter.Append("))"); return; } if (adpropertyDefinition == ADObjectSchema.Guid && this.tenantScoped && comparisonFilter.ComparisonOperator == ComparisonOperator.Equal) { string value2 = ADValueConvertor.EscapeBinaryValue(((Guid)obj).ToByteArray()); this.IncrementFilterSize(3); this.ldapFilter.Append("(|("); this.ldapFilter.Append(ldapDisplayName); this.ldapFilter.Append(value); this.ldapFilter.Append(value2); this.ldapFilter.Append(")("); this.ldapFilter.Append(ADObjectSchema.CorrelationIdRaw.LdapDisplayName); this.ldapFilter.Append(value); this.ldapFilter.Append(value2); this.ldapFilter.Append("))"); return; } this.IncrementFilterSize(); this.ldapFilter.Append("("); this.ldapFilter.Append(ldapDisplayName); this.ldapFilter.Append(value); ADValueConvertor.ConvertToAndAppendFilterString(adpropertyDefinition, obj, this.ldapFilter, isSoftLink, softLinkPrefix); this.ldapFilter.Append(")"); return; } }