public static IOrganizationSettingsData GetOrganizationSettingsData(IAirSyncUser user) { if (user == null) { throw new ArgumentNullException("user"); } return(ADNotificationManager.GetOrganizationSettingsData(user.OrganizationId, user.Context)); }
// Token: 0x060005B9 RID: 1465 RVA: 0x00021F98 File Offset: 0x00020198 public static bool IsDeviceInFilter(string filterName) { if (Command.CurrentCommand != null && Command.CurrentCommand.Context != null) { IOrganizationSettingsData organizationSettingsData = ADNotificationManager.GetOrganizationSettingsData(Command.CurrentCommand.Context.User); if (organizationSettingsData == null || organizationSettingsData.DeviceFiltering == null || organizationSettingsData.DeviceFiltering.Count == 0) { AirSyncDiagnostics.TraceDebug(ExTraceGlobals.RequestsTracer, null, "There are no device filters or failed to get device filters"); return(false); } ActiveSyncDeviceFilter filter = organizationSettingsData.DeviceFiltering.GetFilter(filterName); if (filter == null) { AirSyncDiagnostics.TraceDebug <string>(ExTraceGlobals.RequestsTracer, null, "There are no device filters by given name:{0}", filterName); return(false); } if (filter.ApplyForAllDevices) { AirSyncDiagnostics.TraceDebug <string>(ExTraceGlobals.RequestsTracer, null, "Device filter name:{0} has been set to apply for all devices", filterName); return(true); } if (filter.Rules == null) { AirSyncDiagnostics.TraceDebug <string>(ExTraceGlobals.RequestsTracer, null, "There are no rules for the given device filters name:{0}", filterName); return(false); } string text; string text2; string text3; string text4; string text5; DeviceFilterManager.GetActualValues(out text, out text2, out text3, out text4, out text5); foreach (ActiveSyncDeviceFilterRule activeSyncDeviceFilterRule in filter.Rules) { if ((activeSyncDeviceFilterRule.Characteristic == DeviceAccessCharacteristic.DeviceType && DeviceFilterManager.IsRuleValueMatch(activeSyncDeviceFilterRule, text)) || (activeSyncDeviceFilterRule.Characteristic == DeviceAccessCharacteristic.DeviceModel && DeviceFilterManager.IsRuleValueMatch(activeSyncDeviceFilterRule, text2)) || (activeSyncDeviceFilterRule.Characteristic == DeviceAccessCharacteristic.DeviceOS && DeviceFilterManager.IsRuleValueMatch(activeSyncDeviceFilterRule, text3)) || (activeSyncDeviceFilterRule.Characteristic == DeviceAccessCharacteristic.UserAgent && DeviceFilterManager.IsRuleValueMatch(activeSyncDeviceFilterRule, text4)) || (activeSyncDeviceFilterRule.Characteristic == DeviceAccessCharacteristic.XMSWLHeader && DeviceFilterManager.IsRuleValueMatch(activeSyncDeviceFilterRule, text5))) { AirSyncDiagnostics.TraceDebug(ExTraceGlobals.RequestsTracer, null, "The current request with DeviceType:{0} DeviceModel:{1} DeviceOS:{2} UserAgent:{3} XMSWLHeader:{4} has a matching filter:{5}", new object[] { text, text2, text3, text4, text5, filterName }); return(true); } } return(false); } return(false); }
// Token: 0x06000D93 RID: 3475 RVA: 0x0004AF14 File Offset: 0x00049114 internal static void SendBootstrapMailForWM61(IAirSyncUser user) { if (user == null) { throw new ArgumentNullException("user"); } if (user.ExchangePrincipal == null) { throw new ArgumentNullException("user.ExchangePrincipal"); } using (MailboxSession mailboxSession = MailboxSession.OpenAsSystemService(user.ExchangePrincipal, CultureInfo.InvariantCulture, "Client=ActiveSync")) { CultureInfo preferedCulture = mailboxSession.PreferedCulture; string subject = Strings.BootstrapMailForWM61Subject.ToString(preferedCulture); string text = string.Format("<a href=\"{0}\">{1}</a>", GlobalSettings.MobileUpdateInformationURL, AirSyncUtility.HtmlEncode(Strings.BootstrapMailForWM61Body7.ToString(preferedCulture), false)); string text2 = string.Format("<a href=\"{0}\">{1}</a>", GlobalSettings.BootstrapCABForWM61HostingURL, AirSyncUtility.HtmlEncode(Strings.BootstrapMailForWM61Body8.ToString(preferedCulture), false)); string text3 = string.Empty; IOrganizationSettingsData organizationSettingsData = ADNotificationManager.GetOrganizationSettingsData(user); if (organizationSettingsData != null && !string.IsNullOrEmpty(organizationSettingsData.OtaNotificationMailInsert)) { text3 = string.Format("<p>{0}</p><hr>", organizationSettingsData.OtaNotificationMailInsert); } string body = string.Format("<html><head><style>p, li {{font-size:10pt; font-family:Tahoma;}}</style></head><body><p style=\"font-size:12pt; color:darkblue;\"><b>{0}</b></p><p>{1}</p><ul><li>{2}</li><li>{3}</li><li>{4}</li><li>{5}</li><li>{6}</li></ul><p><span style=\"font-size:12pt;\"><b>{7}</b></span><br>{8}</p><hr>{9}<p style=\"font-size:8pt; color:gray;\">{10}</p></body></html>", new object[] { AirSyncUtility.HtmlEncode(Strings.BootstrapMailForWM61Body1.ToString(preferedCulture), false), AirSyncUtility.HtmlEncode(Strings.BootstrapMailForWM61Body2.ToString(preferedCulture), false), AirSyncUtility.HtmlEncode(Strings.BootstrapMailForWM61Body3.ToString(preferedCulture), false), AirSyncUtility.HtmlEncode(Strings.BootstrapMailForWM61Body4.ToString(preferedCulture), false), AirSyncUtility.HtmlEncode(Strings.BootstrapMailForWM61Body5.ToString(preferedCulture), false), AirSyncUtility.HtmlEncode(Strings.BootstrapMailForWM61Body6.ToString(preferedCulture), false), text, text2, AirSyncUtility.HtmlEncode(Strings.BootstrapMailForWM61Body9.ToString(preferedCulture), false), text3, AirSyncUtility.HtmlEncode(Strings.BootstrapMailForWM61Body10.ToString(preferedCulture), false) }); SystemMessageHelper.PostMessage(mailboxSession, subject, body, "IPM.Note", Importance.High); } }