コード例 #1
0
        // Token: 0x060019E1 RID: 6625 RVA: 0x00096008 File Offset: 0x00094208
        public static void DispatchRequest(OwaContext owaContext)
        {
            ExTraceGlobals.CoreCallTracer.TraceDebug(0L, "CalendarVDirRequestDispatcher.DispatchRequest");
            bool flag = CalendarVDirRequestDispatcher.ValidateAndRemapTheRequest(owaContext.HttpContext);

            if (flag)
            {
                Utilities.EndResponse(owaContext.HttpContext, HttpStatusCode.BadRequest);
                return;
            }
            flag = CalendarVDirRequestDispatcher.CheckRequestType(owaContext);
            if (flag)
            {
                return;
            }
            flag = CalendarVDirRequestDispatcher.BindExchangePrincipal(owaContext);
            if (flag)
            {
                return;
            }
            owaContext.RequestExecution        = RequestExecution.Local;
            owaContext.AnonymousSessionContext = new AnonymousSessionContext(owaContext);
            if (owaContext.RequestExecution == RequestExecution.Local)
            {
                CalendarVDirRequestDispatcher.SetThreadCulture(owaContext);
                CalendarVDirRequestDispatcher.LookupExperience(owaContext);
                if (owaContext.RequestType == OwaRequestType.ServiceRequest)
                {
                    return;
                }
                CalendarVDirRequestDispatcher.MapPublishedCalendarViewUrl(owaContext);
            }
        }
コード例 #2
0
 internal override void OnPostAuthorizeRequest(object sender, EventArgs e)
 {
     CalendarVDirRequestDispatcher.DispatchRequest(OwaContext.Current);
 }
コード例 #3
0
        // Token: 0x060019E4 RID: 6628 RVA: 0x00096148 File Offset: 0x00094348
        private static bool ValidateAndRemapTheRequest(HttpContext httpContext)
        {
            Uri url = httpContext.Request.Url;

            if (Utilities.IsOwaUrl(url, OwaUrl.ProxyPing, true))
            {
                ExTraceGlobals.CoreTracer.TraceDebug <Uri>(0L, "RemapPublishedRequest: Ignore the ProxyPing - {0}", url);
                return(false);
            }
            bool flag = url.PathAndQuery.Contains("/S-1-8-");
            int  num  = flag ? 7 : 6;

            if (url.Segments.Length < num)
            {
                ExTraceGlobals.CoreTracer.TraceError <Uri>(0L, "RemapPublishedRequest: Invalid Segments.Length - {0}", url);
                return(true);
            }
            int num2 = url.Segments[0].Length + url.Segments[1].Length + url.Segments[2].Length;
            int num3 = num2;

            for (int i = 3; i < num - 1; i++)
            {
                num3 += url.Segments[i].Length;
            }
            string text = url.PathAndQuery.Remove(num2, num3 - num2);
            string a    = url.Segments[url.Segments.Length - 1];
            string url2;

            if (string.Equals(a, "calendar.html", StringComparison.OrdinalIgnoreCase) || string.Equals(a, "reachcalendar.html", StringComparison.OrdinalIgnoreCase) || string.Equals(a, "calendar.ics", StringComparison.OrdinalIgnoreCase) || string.Equals(a, "reachcalendar.ics", StringComparison.OrdinalIgnoreCase))
            {
                url2 = url.AbsoluteUri;
            }
            else
            {
                UriBuilder uriBuilder = new UriBuilder(url);
                if (flag)
                {
                    uriBuilder.Path = string.Concat(new string[]
                    {
                        url.Segments[0],
                        url.Segments[1],
                        url.Segments[2],
                        url.Segments[3],
                        url.Segments[4],
                        url.Segments[5],
                        SharingDataType.ReachCalendar.PublishResourceName,
                        ".html"
                    });
                }
                else
                {
                    uriBuilder.Path = string.Concat(new string[]
                    {
                        url.Segments[0],
                        url.Segments[1],
                        url.Segments[2],
                        url.Segments[3],
                        url.Segments[4],
                        SharingDataType.Calendar.PublishResourceName,
                        ".html"
                    });
                }
                url2 = uriBuilder.Uri.ToString();
            }
            if (!CalendarVDirRequestDispatcher.ValidateAndCapturePublishingUrl(httpContext, url2))
            {
                return(true);
            }
            ExTraceGlobals.CoreTracer.TraceDebug <Uri, string>(0L, "RemapPublishedRequest: Rewrite {0} to {1}", url, text);
            httpContext.RewritePath(text);
            return(false);
        }