// Token: 0x06000BCE RID: 3022 RVA: 0x0004DF24 File Offset: 0x0004C124 internal static bool InRole(IRecipientSession rs, ADRecipient recipient, MultiValuedProperty <string> roleMembersLegDN, MultiValuedProperty <ADObjectId> roleMemberslegacy) { if (recipient == null) { return(false); } if (roleMemberslegacy == null && roleMembersLegDN == null) { return(false); } if (roleMembersLegDN != null && roleMembersLegDN.Count != 0) { foreach (string text in roleMembersLegDN) { if (string.Equals(text, recipient.LegacyExchangeDN, StringComparison.InvariantCultureIgnoreCase)) { return(true); } ADRecipient adrecipient = rs.FindByLegacyExchangeDN(text); if (adrecipient != null && adrecipient is ADGroup && recipient.IsMemberOf(adrecipient.Id, false)) { BookingPolicy.Tracer.TraceDebug((long)recipient.GetHashCode(), "{0}: Group match", new object[] { TraceContext.Get() }); return(true); } } } if (roleMemberslegacy != null && roleMemberslegacy.Count != 0) { foreach (ADObjectId adobjectId in roleMemberslegacy) { if (ADObjectId.Equals(adobjectId, recipient.Id)) { return(true); } ADRecipient adrecipient2 = rs.Read(adobjectId); if (adrecipient2 != null && adrecipient2 is ADGroup && recipient.IsMemberOf(adrecipient2.Id, false)) { BookingPolicy.Tracer.TraceDebug((long)recipient.GetHashCode(), "{0}: Group match", new object[] { TraceContext.Get() }); return(true); } } } return(false); }
// Token: 0x06000BCD RID: 3021 RVA: 0x0004DDF0 File Offset: 0x0004BFF0 public static BookingRoles QueryRole(IRecipientSession rs, ADRecipient recipient, CalendarConfiguration mailboxConfig, out bool reqInPolicy, out bool bookInPolicy) { BookingRoles bookingRoles = BookingRoles.NoRole; reqInPolicy = false; bookInPolicy = false; BookingPolicy.Tracer.TraceDebug((long)((recipient != null) ? recipient.GetHashCode() : 0), "{0}: Evaluating RequestInPolicy", new object[] { TraceContext.Get() }); if (mailboxConfig.AllRequestInPolicy || BookingPolicy.InRole(rs, recipient, mailboxConfig.RequestInPolicy, mailboxConfig.RequestInPolicyLegacy)) { bookingRoles = BookingRoles.RequestInPolicy; reqInPolicy = true; } BookingPolicy.Tracer.TraceDebug((long)((recipient != null) ? recipient.GetHashCode() : 0), "{0}: Evaluating BookInPolicy", new object[] { TraceContext.Get() }); if (mailboxConfig.AllBookInPolicy || BookingPolicy.InRole(rs, recipient, mailboxConfig.BookInPolicy, mailboxConfig.BookInPolicyLegacy)) { bookingRoles = BookingRoles.BookInPolicy; bookInPolicy = true; } BookingPolicy.Tracer.TraceDebug((long)((recipient != null) ? recipient.GetHashCode() : 0), "{0}: Evaluating RequestOutOfPolicy", new object[] { TraceContext.Get() }); if (mailboxConfig.AllRequestOutOfPolicy || BookingPolicy.InRole(rs, recipient, mailboxConfig.RequestOutOfPolicy, mailboxConfig.RequestOutOfPolicyLegacy)) { bookingRoles = BookingRoles.RequestOutOfPolicy; } if (bookingRoles == BookingRoles.NoRole) { BookingPolicy.Tracer.TraceDebug((long)((recipient != null) ? recipient.GetHashCode() : 0), "{0}: No Role", new object[] { TraceContext.Get() }); } return(bookingRoles); }
// Token: 0x060050C9 RID: 20681 RVA: 0x0012BB94 File Offset: 0x00129D94 internal static ADRecipient UnMarshalObject(object rusResult, ADObject originalRecipient) { if (rusResult == null || !(rusResult is object[])) { return(null); } SortedList sortedList = new SortedList(new CaseInsensitiveComparer(CultureInfo.InvariantCulture)); foreach (object[] array2 in (object[])rusResult) { string[] array3 = new string[array2.Length - 1]; Array.Copy(array2, 1, array3, 0, array2.Length - 1); sortedList.Add(array2[0], array3); } string[] array4 = new string[sortedList.Count]; sortedList.Keys.CopyTo(array4, 0); ADRecipient adrecipient = new ADRecipient(); List <ADPropertyDefinition> list = new List <ADPropertyDefinition>((ADPropertyDefinition[])RUSMarshal.LdapAttributesToPropertyDefinitions(RUSMarshal.SchemaInstance, array4)); List <object> list2 = new List <object>(list.Count); for (int j = 0; j < list.Count; j++) { list2.Add(RUSMarshal.UnMarshalAttribute(list[j], (object[])sortedList[list[j].LdapDisplayName])); } int k = list.Count - 1; while (k >= 0) { if (list[k] != ADRecipientSchema.WindowsEmailAddress) { goto IL_171; } SmtpAddress smtpAddress = (SmtpAddress)list2[k]; if (((SmtpAddress)list2[k]).Length <= 256) { goto IL_171; } list.RemoveAt(k); list2.RemoveAt(k); ExTraceGlobals.RecipientUpdateServiceTracer.TraceDebug <string>((long)adrecipient.GetHashCode(), "RecipientUpdateService:: A Windows Email Address exceeding 256 characters for recipient \"{0}\" is generated and discarded", adrecipient.ToString()); IL_286: k--; continue; IL_171: if (!list[k].IsMultivalued) { goto IL_286; } int num = (list2[k] == null) ? 0 : ((MultiValuedPropertyBase)list2[k]).Count; int num2 = (originalRecipient[list[k]] == null) ? 0 : ((MultiValuedPropertyBase)originalRecipient[list[k]]).Count; bool flag = num != num2; if (!flag && num != 0) { object[] array5 = (object[])RUSMarshal.MarshalAttribute(list[k], list2[k]); object[] array6 = (object[])RUSMarshal.MarshalAttribute(list[k], originalRecipient[list[k]]); for (int l = 1; l < array6.Length; l++) { if (-1 == Array.IndexOf <object>(array5, array6[l])) { flag = true; break; } } } if (!flag) { list.RemoveAt(k); list2.RemoveAt(k); ExTraceGlobals.RecipientUpdateServiceTracer.TraceDebug <string>((long)adrecipient.GetHashCode(), "RecipientUpdateService:: the value of 'msExchPoliciesIncluded' property of recipient \"{0}\" does NOT change at all.", adrecipient.ToString()); goto IL_286; } goto IL_286; } adrecipient.SetProperties(list.ToArray(), list2.ToArray()); return(adrecipient); }