コード例 #1
0
 public PageContext(HttpContext context, string owaVersion)
 {
     this.UserAgent = OwaUserAgentUtilities.CreateUserAgentWithLayoutOverride(context);
     this.IsAppCacheEnabledClient = (context == null || context.Request.QueryString["appcacheclient"] == "1");
     this.ManifestType            = (DefaultPageBase.IsPalEnabled(context, this.UserAgent.RawString) ? SlabManifestType.Pal : SlabManifestType.Standard);
     this.Theme = ThemeManagerFactory.GetInstance(owaVersion).GetThemeFolderName(this.UserAgent, context);
 }
コード例 #2
0
        // Token: 0x06002639 RID: 9785 RVA: 0x00089F64 File Offset: 0x00088164
        void IHttpHandler.ProcessRequest(HttpContext context)
        {
            this.Context   = context;
            this.UserAgent = OwaUserAgentUtilities.CreateUserAgentWithLayoutOverride(context);
            ExTraceGlobals.AppcacheManifestHandlerTracer.TraceDebug <string, LayoutType>((long)this.GetHashCode(), "User {0} requested for {1} manifest ", AppCacheManifestHandler.GetUserContextId(context), this.UserAgent.Layout);
            bool flag = this.IsManifestRequest();

            this.SetResponseHeaders(flag);
            this.AddAppCacheVersionCookie();
            UserAgent userAgent  = OwaUserAgentUtilities.CreateUserAgentWithLayoutOverride(context, null, true);
            UserAgent userAgent2 = OwaUserAgentUtilities.CreateUserAgentWithLayoutOverride(context);

            if ((!this.IsManifestLinkerRequest() && !flag) || (this.ShouldUnInstallAppCache() && flag) || (userAgent2.Layout == LayoutType.TouchNarrow && userAgent.Layout == LayoutType.TouchWide))
            {
                this.RemoveManifest();
                return;
            }
            if (flag && this.IsRealmRewrittenFromPathToQuery(this.Context))
            {
                this.RemoveManifest();
                return;
            }
            try
            {
                if (flag)
                {
                    bool?isRequestForOfflineManifest = this.IsRequestForOfflineManifest;
                    if (isRequestForOfflineManifest == null)
                    {
                        this.Response.StatusCode = 440;
                    }
                    else
                    {
                        this.AddIsClientAppCacheEnabledCookie();
                        if (isRequestForOfflineManifest.Value)
                        {
                            this.WriteManifest(true);
                        }
                        else
                        {
                            this.WriteManifest(false);
                        }
                    }
                }
                else
                {
                    this.WriteManifestLinker();
                }
            }
            catch (IOException)
            {
                this.Response.StatusCode = 500;
            }
        }
コード例 #3
0
        public void ProcessRequest(HttpContext context)
        {
            string      userContextId           = Plt1WebHandler.GetUserContextId(context);
            bool        isMowa                  = OfflineClientRequestUtilities.IsRequestFromMOWAClient(context.Request, context.Request.UserAgent);
            HttpRequest request                 = context.Request;
            string      clientAddressWithoutPII = this.GetClientAddressWithoutPII(request);
            UserAgent   userAgent               = OwaUserAgentUtilities.CreateUserAgentWithLayoutOverride(context);
            string      userName                = string.Empty;
            string      cookieValueAndSetIfNull = ClientIdCookie.GetCookieValueAndSetIfNull(context);
            UserContext userContext             = UserContextManager.GetUserContext(context, false);

            if (userContext != null && userContext.LogonIdentity != null)
            {
                SmtpAddress primarySmtpAddress = userContext.LogonIdentity.PrimarySmtpAddress;
                userName = userContext.LogonIdentity.PrimarySmtpAddress.ToString();
            }
            if (Plt1WebHandler.IsPlt1PerformanceRequest(request))
            {
                string text = "";
                if (context.Request.HttpMethod == "POST")
                {
                    using (StreamReader streamReader = new StreamReader(context.Request.InputStream))
                    {
                        text = streamReader.ReadToEnd();
                        context.Response.AppendToLog(text);
                    }
                }
                string clientVersion = context.Request.QueryString.Get("cver") ?? string.Empty;
                Uri    uri;
                string refererQueryString = request.TryParseUrlReferrer(out uri) ? uri.Query : "noRefUrl";
                Dictionary <string, string> dictionary  = new Dictionary <string, string>();
                Dictionary <string, string> dictionary2 = new Dictionary <string, string>();
                Plt1WebHandler.GetPlt1PerformanceEventData(userAgent, refererQueryString, request.QueryString, text, dictionary, dictionary2);
                Plt1WebHandler.AddClientLoadTimeDataPoint(dictionary, dictionary2, userContextId, clientAddressWithoutPII, clientVersion, isMowa, userName, userContext, cookieValueAndSetIfNull);
                if (dictionary2.Count > 0 && dictionary.ContainsKey("msg") && dictionary["msg"].Contains("success"))
                {
                    Plt1WebHandler.AddCalculatedClientLoadTimeDataPoint(dictionary, dictionary2, userContextId, clientAddressWithoutPII, clientVersion, isMowa, userName, cookieValueAndSetIfNull);
                }
                if (userContext != null && userContext.FeaturesManager != null && userContext.FeaturesManager.ServerSettings.OwaServerLogonActivityLogging.Enabled)
                {
                    this.AddtoActivityLog(userContext, dictionary, userName, clientAddressWithoutPII, userAgent.RawString);
                }
            }
            else
            {
                string         clientVersion2  = context.Request.QueryString.Get("v") ?? string.Empty;
                ClientLogEvent plt1AccessEvent = Plt1WebHandler.GetPlt1AccessEvent(userContextId, request.UserAgent, clientAddressWithoutPII, clientVersion2, isMowa, cookieValueAndSetIfNull);
                OwaClientLogger.AppendToLog(plt1AccessEvent);
            }
            Plt1WebHandler.SetResponseHeaders(context.Response);
            Plt1WebHandler.WriteImage(context.Response);
        }
コード例 #4
0
 protected override void OnPreInit(EventArgs e)
 {
     this.UserAgent = OwaUserAgentUtilities.CreateUserAgentWithLayoutOverride(this.Context);
     this.IsAppCacheEnabledClient        = this.GetIsClientAppCacheEnabled(this.Context);
     this.IsOfflineAppCacheEnabledClient = (this.IsAppCacheEnabledClient && this.IsClientInOfflineMode);
     this.CompositeSessionData           = this.CalculateCompositeSessionDataEnabled();
     base.Response.AddHeader("pragma", "no-cache");
     base.Response.Cache.SetCacheability(HttpCacheability.NoCache);
     base.Response.Cache.SetExpires(DateTime.UtcNow.AddYears(-1));
     if (UrlUtilities.IsAuthRedirectRequest(this.Context.Request) || AppCacheManifestHandlerBase.DoesBrowserSupportAppCache(this.UserAgent))
     {
         string url = null;
         if (this.ShouldRedirectWithoutUnnecessaryParams(out url))
         {
             base.Response.Redirect(url);
         }
     }
 }