Ejemplo n.º 1
0
        // Token: 0x06000BD5 RID: 3029 RVA: 0x000305D4 File Offset: 0x0002E7D4
        internal static string CreateUrlWithQueryString(string baseUrl, string requestId)
        {
            string installedOwaVersion = DefaultExtensionTable.GetInstalledOwaVersion();
            string url = ExtensionData.AppendUnencodedQueryParameter(baseUrl, "CV", installedOwaVersion);

            url = ExtensionData.AppendUnencodedQueryParameter(url, "Client", "WAC_Outlook");
            return(ExtensionData.AppendUnencodedQueryParameter(url, "corr", requestId));
        }
        private static Uri CreateDownloadUri(string marketplaceDownloadServiceUrl, string marketplaceQueryMarket, string marketplaceAssetID, string deploymentId, string etoken = null)
        {
            string text = string.Format("{0}?cmu={1}&av=OLW150&ret=0&assetid={2}&build={3}&deployId={4}", new object[]
            {
                marketplaceDownloadServiceUrl,
                marketplaceQueryMarket,
                marketplaceAssetID,
                DefaultExtensionTable.GetInstalledOwaVersion(),
                deploymentId
            });

            if (!string.IsNullOrWhiteSpace(etoken))
            {
                text += string.Format("&clienttoken={0}", etoken);
            }
            return(new Uri(text));
        }
Ejemplo n.º 3
0
        // Token: 0x06000BA4 RID: 2980 RVA: 0x0002F7E4 File Offset: 0x0002D9E4
        internal static string CreateQueryString(IDownloadAppRequestAsset asset, string deploymentId, string requestId)
        {
            string installedOwaVersion = DefaultExtensionTable.GetInstalledOwaVersion();
            string text = string.Format("?cmu={0}&av=MOW&ret=0&assetid={1}&build={2}&deployId={3}&corr={4}", new object[]
            {
                asset.MarketplaceContentMarket,
                asset.MarketplaceAssetID,
                installedOwaVersion,
                deploymentId,
                requestId
            });

            if (!string.IsNullOrWhiteSpace(asset.Etoken))
            {
                text += string.Format("&clienttoken={0}", asset.Etoken);
            }
            return(text);
        }
 internal static bool TryConvertToCompleteUrl(IExchangePrincipal exchangePrincipal, string url, string extensionId, out string completeUrl, out Exception exception)
 {
     exception   = null;
     completeUrl = url;
     if (!url.StartsWith("http://") && !url.StartsWith("https://") && !url.StartsWith("/"))
     {
         string contentDeliveryNetworkEndpoint = DefaultExtensionTable.GetContentDeliveryNetworkEndpoint();
         if (string.IsNullOrEmpty(contentDeliveryNetworkEndpoint))
         {
             string domain = exchangePrincipal.MailboxInfo.PrimarySmtpAddress.Domain;
             string text   = HttpUtility.UrlEncode(string.Format("{0}@{1}", exchangePrincipal.MailboxInfo.MailboxGuid, domain));
             if (DefaultExtensionTable.baseOwaUrl == null && !DefaultExtensionTable.TryFindOwaServiceUrl(exchangePrincipal, out exception))
             {
                 return(false);
             }
             completeUrl = string.Format("{0}/{1}/prem/{2}/ext/def/{3}/{4}", new object[]
             {
                 DefaultExtensionTable.baseOwaUrl,
                 text,
                 DefaultExtensionTable.GetInstalledOwaVersion(),
                 extensionId,
                 url
             });
         }
         else
         {
             completeUrl = string.Format("{0}/owa/prem/{1}/ext/def/{2}/{3}", new object[]
             {
                 contentDeliveryNetworkEndpoint,
                 DefaultExtensionTable.GetInstalledOwaVersion(),
                 extensionId,
                 url
             });
         }
     }
     return(true);
 }
        private static Dictionary <string, ExtensionData> ReadDefaultExtensionData(IExchangePrincipal exchangePrincipal)
        {
            Dictionary <string, ExtensionData> dictionary = new Dictionary <string, ExtensionData>();
            string text = ExchangeSetupContext.InstallPath + "ClientAccess\\owa\\" + string.Format("\\prem\\{0}\\ext\\def\\", DefaultExtensionTable.GetInstalledOwaVersion());

            string[] array = null;
            try
            {
                if (!Directory.Exists(text))
                {
                    DefaultExtensionTable.Tracer.TraceError <string>(0L, "Default extension path {0} does not exist", text);
                    ExtensionDiagnostics.Logger.LogEvent(ApplicationLogicEventLogConstants.Tuple_DefaultExtensionPathNotExist, null, new object[]
                    {
                        DefaultExtensionTable.scenario
                    });
                    return(dictionary);
                }
                array = Directory.GetDirectories(text);
            }
            catch (Exception ex)
            {
                DefaultExtensionTable.Tracer.TraceError <Exception>(0L, "Failed to access default extension folder. ", ex);
                ExtensionDiagnostics.Logger.LogEvent(ApplicationLogicEventLogConstants.Tuple_DefaultExtensionFolderAccessFailed, ex.GetType().ToString(), new object[]
                {
                    DefaultExtensionTable.scenario,
                    ExtensionDiagnostics.GetLoggedExceptionString(ex)
                });
                return(dictionary);
            }
            foreach (string text2 in array)
            {
                try
                {
                    string path = text2 + "\\" + "manifest.xml";
                    if (File.Exists(path))
                    {
                        using (FileStream fileStream = new FileStream(path, FileMode.Open, FileAccess.Read))
                        {
                            ExtensionData extensionData = ExtensionData.ParseOsfManifest(fileStream, null, null, ExtensionType.Default, ExtensionInstallScope.Default, true, DisableReasonType.NotDisabled, string.Empty, null);
                            extensionData.ProvidedTo         = ClientExtensionProvidedTo.Everyone;
                            extensionData.IsMandatory        = false;
                            extensionData.IsEnabledByDefault = true;
                            extensionData.InstalledByVersion = ExchangeSetupContext.InstalledVersion;
                            if (exchangePrincipal != null)
                            {
                                Exception arg = null;
                                if (!DefaultExtensionTable.TryUpdateDefaultExtensionPath(exchangePrincipal, "SourceLocation", extensionData, out arg))
                                {
                                    DefaultExtensionTable.Tracer.TraceError <Exception>(0L, "Skip one default extension because entry point path cannot be updated: {0}", arg);
                                    goto IL_22D;
                                }
                                if (!DefaultExtensionTable.TryUpdateDefaultExtensionPath(exchangePrincipal, "IconUrl", extensionData, out arg))
                                {
                                    DefaultExtensionTable.Tracer.TraceError <Exception>(0L, "Skip one default extension because icon path cannot be updated: {0}", arg);
                                    goto IL_22D;
                                }
                                if (!DefaultExtensionTable.TryUpdateDefaultExtensionPath(exchangePrincipal, "HighResolutionIconUrl", extensionData, out arg))
                                {
                                    DefaultExtensionTable.Tracer.TraceError <Exception>(0L, "Skip one default extension because hi-res icon path cannot be updated: {0}", arg);
                                    goto IL_22D;
                                }
                            }
                            dictionary[ExtensionDataHelper.FormatExtensionId(extensionData.ExtensionId)] = extensionData;
                        }
                    }
                }
                catch (Exception ex2)
                {
                    DefaultExtensionTable.Tracer.TraceError <Exception>(0L, "Skip one default extension because of error. {0}", ex2);
                    ExtensionDiagnostics.Logger.LogEvent(ApplicationLogicEventLogConstants.Tuple_DefaultExtensionRetrievalFailed, text2, new object[]
                    {
                        DefaultExtensionTable.scenario,
                        text2,
                        ExtensionDiagnostics.GetLoggedExceptionString(ex2)
                    });
                }
                IL_22D :;
            }
            return(dictionary);
        }
        // Token: 0x06000BB1 RID: 2993 RVA: 0x0002FA30 File Offset: 0x0002DC30
        internal static string CreateQueryString(string deploymentId, string requestId)
        {
            string installedOwaVersion = DefaultExtensionTable.GetInstalledOwaVersion();

            return(string.Format("?av=MOW&ret=1&build={0}&deployId={1}&corr={2}", installedOwaVersion, deploymentId, requestId));
        }