private static PiiRedactor <string> GetRedactorForProxyAddress(ProxyAddressPrefix prefix) { PiiRedactor <string> result = null; if (prefix.PrimaryPrefix == ProxyAddressPrefix.LegacyDN.PrimaryPrefix || prefix.PrimaryPrefix == ProxyAddressPrefix.X500.PrimaryPrefix) { result = new PiiRedactor <string>(SuppressingPiiData.RedactLegacyDN); } else if (prefix.PrimaryPrefix == ProxyAddressPrefix.Notes.PrimaryPrefix || prefix.PrimaryPrefix == ProxyAddressPrefix.SIP.PrimaryPrefix || prefix is SmtpProxyAddressPrefix) { result = new PiiRedactor <string>(SuppressingPiiData.RedactSmtpAddress); } else if (prefix is X400ProxyAddressPrefix) { result = new PiiRedactor <string>(SuppressingPiiData.RedactX400Address); } else if (prefix is EumProxyAddressPrefix) { result = new PiiRedactor <string>(SuppressingPiiData.RedactEum); } else if (prefix.PrimaryPrefix == ProxyAddressPrefix.CcMail.PrimaryPrefix) { result = new PiiRedactor <string>(SuppressingPiiData.Redact); } else if (!(prefix.PrimaryPrefix == ProxyAddressPrefix.MsMail.PrimaryPrefix) && !(prefix.PrimaryPrefix == ProxyAddressPrefix.GroupWise.PrimaryPrefix) && !(prefix is MeumProxyAddressPrefix)) { result = new PiiRedactor <string>(SuppressingPiiData.Redact); } return(result); }
internal static int ProxyAddressCount(ProxyAddressCollection collection, ProxyAddressPrefix prefix) { int num = 0; foreach (ProxyAddress proxyAddress in collection) { if (proxyAddress.Prefix == prefix) { num++; } } return(num); }
// Token: 0x06001D65 RID: 7525 RVA: 0x0007A88C File Offset: 0x00078A8C private static NetID GetNetIDWithPrefix(string netIdPrefix, IPropertyBag propertyBag) { ProxyAddressCollection proxyAddressCollection = (ProxyAddressCollection)propertyBag[ADRecipientSchema.EmailAddresses]; if (proxyAddressCollection != null) { ProxyAddress proxyAddress = proxyAddressCollection.FindPrimary(ProxyAddressPrefix.GetPrefix(netIdPrefix)); if (null != proxyAddress) { return(NetID.Parse(proxyAddress.ValueString)); } } return(null); }
internal static bool PhoneNumberExists(ProxyAddressCollection addresses, ProxyAddressPrefix prefix, string phoneNumber) { foreach (ProxyAddress proxyAddress in addresses) { if (proxyAddress.Prefix == prefix) { string extensionFromProxyAddress = UMMailbox.GetExtensionFromProxyAddress(proxyAddress); if (extensionFromProxyAddress.Equals(phoneNumber)) { return(true); } } } return(false); }
public static ProxyAddress Redact(ProxyAddress proxyAddr, out string raw, out string redacted) { raw = null; redacted = null; if (proxyAddr == null) { return(proxyAddr); } ProxyAddressPrefix prefix = proxyAddr.Prefix; PiiRedactor <string> redactorForProxyAddress = SuppressingPiiData.GetRedactorForProxyAddress(prefix); if (redactorForProxyAddress != null) { return(prefix.GetProxyAddress(redactorForProxyAddress(proxyAddr.AddressString, out raw, out redacted), proxyAddr.IsPrimaryAddress)); } return(proxyAddr); }
internal static Hashtable GetAirSyncSafeTable(ProxyAddressCollection collection, ProxyAddressPrefix prefix, UMDialPlan dialPlan) { Hashtable hashtable = new Hashtable(); foreach (ProxyAddress proxyAddress in collection) { if (proxyAddress.Prefix == prefix) { hashtable.Add(proxyAddress.AddressString, true); hashtable.Add(proxyAddress.AddressString.Substring(dialPlan.CountryOrRegionCode.Length + 1), true); } } return(hashtable); }
internal static MultiValuedProperty <string> GetExtensionsFromCollection(ProxyAddressCollection addresses, ProxyAddressPrefix prefix, string phoneContext) { MultiValuedProperty <string> multiValuedProperty = new MultiValuedProperty <string>(); foreach (ProxyAddress proxyAddress in addresses) { if (proxyAddress.Prefix == prefix && (phoneContext == null || proxyAddress.AddressString.EndsWith(phoneContext))) { string extensionFromProxyAddress = UMMailbox.GetExtensionFromProxyAddress(proxyAddress); if (extensionFromProxyAddress != null) { multiValuedProperty.Add(extensionFromProxyAddress); } } } return(multiValuedProperty); }
internal static string GetPrimaryExtension(ProxyAddressCollection emailAddresses, ProxyAddressPrefix prefix) { foreach (ProxyAddress proxyAddress in emailAddresses) { if (proxyAddress.IsPrimaryAddress && proxyAddress.Prefix == prefix) { string extensionFromProxyAddress = UMMailbox.GetExtensionFromProxyAddress(proxyAddress); if (extensionFromProxyAddress != null) { return(extensionFromProxyAddress); } } } return(null); }
internal static void RemoveProxy(ADRecipient recipient, ProxyAddressCollection collection, ProxyAddressPrefix prefix, ArrayList phoneNumbers, UMDialPlan dialPlan) { Hashtable hashtable = new Hashtable(); foreach (object obj in phoneNumbers) { string extension = (string)obj; hashtable.Add(UMMailbox.BuildAddressStringFromExtensionAndPhoneContext(extension, dialPlan.PhoneContext), true); } UMMailbox.RemoveProxy(recipient, collection, prefix, hashtable); }
internal static void RemoveProxy(ADRecipient recipient, ProxyAddressCollection collection, ProxyAddressPrefix prefix, Hashtable addressStringTable) { List <ProxyAddress> list = new List <ProxyAddress>(); foreach (ProxyAddress proxyAddress in collection) { if (proxyAddress.Prefix == prefix && addressStringTable.ContainsKey(proxyAddress.AddressString)) { list.Add(proxyAddress); } } foreach (ProxyAddress item in list) { collection.Remove(item); } }
internal static void ClearProxy(ADRecipient recipient, ProxyAddressCollection targetAddresses, ProxyAddressPrefix targetPrefix, Hashtable safeTable) { Hashtable hashtable = new Hashtable(); foreach (ProxyAddress proxyAddress in targetAddresses) { if (proxyAddress.Prefix == targetPrefix && (safeTable == null || !safeTable.ContainsKey(proxyAddress.AddressString))) { hashtable.Add(proxyAddress.AddressString, true); } } UMMailbox.RemoveProxy(recipient, targetAddresses, targetPrefix, hashtable); }
internal static void AddProxy(ADRecipient recipient, ProxyAddressCollection addresses, string extension, UMDialPlan dialPlan, ProxyAddressPrefix prefix) { string prefixString = (null == UMMailbox.GetPrimaryExtension(addresses, prefix)) ? prefix.PrimaryPrefix : prefix.SecondaryPrefix; addresses.Add(UMMailbox.BuildProxyAddressFromExtensionAndPhoneContext(extension, prefixString, dialPlan.PhoneContext)); }
internal static ProxyAddressCollection GetEmailAddressesByPrefix(IPropertyBag propertyBag, ProxyAddressPrefix proxyAddressPrefix, SyncPropertyDefinition propertyDefinition) { List <ProxyAddress> list = new List <ProxyAddress>(); ADPropertyDefinition propertyDefinition2 = SyncRecipientSchema.EmailAddresses; if ((bool)propertyBag[SyncRecipientSchema.UseShadow]) { propertyDefinition2 = SyncRecipientSchema.EmailAddresses.ShadowProperty; } ProxyAddressCollection proxyAddressCollection = (ProxyAddressCollection)propertyBag[propertyDefinition2]; foreach (ProxyAddress proxyAddress in proxyAddressCollection) { if (proxyAddress.Prefix == proxyAddressPrefix) { list.Add(proxyAddress); } } return(new ProxyAddressCollection(false, propertyDefinition, list)); }