示例#1
0
        // Token: 0x0600023A RID: 570 RVA: 0x0000DC0C File Offset: 0x0000BE0C
        public bool TryWriteMapiHttpNodes(UserConfigurationSettings settings, XmlWriter xmlFragment, int clientMapiHttpResponseVersion, ClientAccessModes clientAccessMode)
        {
            MapiHttpProtocolUrls mapiHttpProtocolUrls = settings.Get <MapiHttpProtocolUrls>(UserConfigurationSettingName.MapiHttpUrls);
            bool flag = mapiHttpProtocolUrls != null && mapiHttpProtocolUrls.HasUrls;

            if (flag)
            {
                xmlFragment.WriteStartElement("Protocol", "http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a");
                xmlFragment.WriteAttributeString("Type", null, "mapiHttp");
                xmlFragment.WriteAttributeString("Version", null, Math.Min(clientMapiHttpResponseVersion, 1).ToString());
                this.WriteMapiHttpProtocolUrls(clientAccessMode, MapiHttpProtocolUrls.Protocol.Emsmdb, mapiHttpProtocolUrls, xmlFragment);
                this.WriteMapiHttpProtocolUrls(clientAccessMode, MapiHttpProtocolUrls.Protocol.Nspi, mapiHttpProtocolUrls, xmlFragment);
                xmlFragment.WriteEndElement();
                return(true);
            }
            return(false);
        }
示例#2
0
        // Token: 0x06000237 RID: 567 RVA: 0x0000DA54 File Offset: 0x0000BC54
        public bool ShouldWriteMapiHttpProtocolNode(UserConfigurationSettings settings, int clientMapiHttpResponseVersion, bool?mapiHttpOverrideRegistryValue, Version minimumMapiHttpAutodiscoverVersion, bool useMapiHttpADSettingFlightEnabled, bool mapiHttpFlightEnabled, bool mapiHttpForOutlook14FlightEnabled, Version callingOutlookVersion)
        {
            bool flag  = false;
            bool flag2 = false;

            if (clientMapiHttpResponseVersion > 0)
            {
                if (mapiHttpOverrideRegistryValue != null)
                {
                    flag = mapiHttpOverrideRegistryValue.Value;
                    if (flag)
                    {
                        flag = this.VerifyMapiHttpServerVersion(settings, minimumMapiHttpAutodiscoverVersion, "MapiHttpRegKeySetting");
                    }
                    else
                    {
                        this.Log("ForceDisabled(Registry)");
                    }
                }
                else if (useMapiHttpADSettingFlightEnabled)
                {
                    bool?flag3 = settings.Get <bool?>(UserConfigurationSettingName.MapiHttpEnabledForUser);
                    flag = ((flag3 != null) ? flag3.Value : settings.Get <bool>(UserConfigurationSettingName.MapiHttpEnabled));
                    if (flag)
                    {
                        flag = this.VerifyMapiHttpServerVersion(settings, MapiHttpProvider.MinimumMapiHttpServerVersion, "MapiHttpADSetting");
                    }
                    else
                    {
                        this.Log("ForceDisabled(AD)");
                    }
                }
                else if (callingOutlookVersion != null)
                {
                    if (callingOutlookVersion.Major == 14)
                    {
                        flag = mapiHttpForOutlook14FlightEnabled;
                        this.Log(flag ? "Flighted(Outlook 14)" : "FlightedDisabled(Outlook 14)");
                    }
                    else if (callingOutlookVersion.Major >= 15)
                    {
                        flag = mapiHttpFlightEnabled;
                        this.Log(flag ? "Flighted" : "FlightedDisabled");
                    }
                    else
                    {
                        this.Log("VersionTooLow");
                    }
                }
                else
                {
                    this.Log("ParseFailed");
                }
                if (flag)
                {
                    MapiHttpProtocolUrls mapiHttpProtocolUrls = settings.Get <MapiHttpProtocolUrls>(UserConfigurationSettingName.MapiHttpUrls);
                    flag2 = (mapiHttpProtocolUrls != null && mapiHttpProtocolUrls.HasUrls);
                }
            }
            else
            {
                this.Log("NotRequested");
            }
            return(flag && flag2);
        }
示例#3
0
        // Token: 0x0600023B RID: 571 RVA: 0x0000DC90 File Offset: 0x0000BE90
        private void WriteMapiHttpProtocolUrls(ClientAccessModes clientAccessMode, MapiHttpProtocolUrls.Protocol protocol, MapiHttpProtocolUrls urls, XmlWriter xmlFragment)
        {
            xmlFragment.WriteStartElement(MapiHttpProvider.ProtocolNameToElementName[protocol], "http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a");
            Uri uri;

            if ((clientAccessMode & ClientAccessModes.InternalAccess) != ClientAccessModes.None && urls.TryGetProtocolUrl(ClientAccessType.Internal, protocol, out uri))
            {
                xmlFragment.WriteElementString("InternalUrl", "http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a", uri.ToString());
            }
            if ((clientAccessMode & ClientAccessModes.ExternalAccess) != ClientAccessModes.None && urls.TryGetProtocolUrl(ClientAccessType.External, protocol, out uri))
            {
                xmlFragment.WriteElementString("ExternalUrl", "http://schemas.microsoft.com/exchange/autodiscover/outlook/responseschema/2006a", uri.ToString());
            }
            xmlFragment.WriteEndElement();
        }