Beispiel #1
0
        private static void AddSafeLinkToMessageParametersList(Strings.IDs messageId, HttpRequest request, ref List <string> messageParameters)
        {
            string item  = string.Empty;
            string realm = string.Empty;

            if (ErrorFE.MessagesToRenderLogoutLinks.Contains(messageId))
            {
                item = ErrorFE.GetLocalizedLiveIdSignoutLinkMessage(request);
                messageParameters.Insert(0, item);
                return;
            }
            if (ErrorFE.MessagesToRenderLoginLinks.Contains(messageId))
            {
                string dnsSafeHost = request.Url.DnsSafeHost;
                if (messageParameters != null && messageParameters.Count > 0)
                {
                    realm = messageParameters[0];
                }
                item = Utilities.GetAccessURLFromHostnameAndRealm(dnsSafeHost, realm, false);
                messageParameters.Insert(0, item);
                messageParameters.Remove(dnsSafeHost);
            }
        }
Beispiel #2
0
 protected void RenderErrorDetails()
 {
     if (!this.errorInformation.GroupMailbox)
     {
         Strings.IDs ds;
         if (HttpContext.Current != null && HttpContext.Current.Request != null && HttpContext.Current.Request.QueryString["msg"] != null && Enum.TryParse <Strings.IDs>(HttpContext.Current.Request.QueryString["msg"], out ds))
         {
             string        text = ErrorFE.SafeErrorMessagesNoHtmlEncoding.Contains(ds) ? Strings.GetLocalizedString(ds) : LocalizedStrings.GetHtmlEncoded(ds);
             List <string> list = Microsoft.Exchange.Clients.Common.ErrorInformation.ParseMessageParameters(text, HttpContext.Current.Request);
             if (list != null && list.Count > 0)
             {
                 for (int i = 0; i < list.Count; i++)
                 {
                     list[i] = EncodingUtilities.HtmlEncode(list[i]);
                 }
                 if (ErrorFE.MessagesToRenderLogoutLinks.Contains(ds) || ErrorFE.MessagesToRenderLoginLinks.Contains(ds))
                 {
                     ErrorFE.AddSafeLinkToMessageParametersList(ds, HttpContext.Current.Request, ref list);
                 }
                 base.Response.Write(string.Format(text, list.ToArray()));
                 return;
             }
             if (!ErrorFE.MessagesToRenderLogoutLinks.Contains(ds) && !ErrorFE.MessagesToRenderLoginLinks.Contains(ds))
             {
                 base.Response.Write(text);
                 return;
             }
             list = new List <string>();
             ErrorFE.AddSafeLinkToMessageParametersList(ds, HttpContext.Current.Request, ref list);
             if (list.Count > 0)
             {
                 base.Response.Write(string.Format(text, list.ToArray()));
                 return;
             }
         }
         else
         {
             if (this.errorInformation.HttpCode == 404)
             {
                 base.Response.Write(LocalizedStrings.GetHtmlEncoded(236137810));
                 return;
             }
             if (this.errorInformation.HttpCode == 302)
             {
                 LegacyRedirectTypeOptions?legacyRedirectTypeOptions = HttpContext.Current.Items["redirectType"] as LegacyRedirectTypeOptions?;
                 if (legacyRedirectTypeOptions == null || legacyRedirectTypeOptions != LegacyRedirectTypeOptions.Manual)
                 {
                     base.Response.Redirect(this.errorInformation.RedirectionUrl);
                     return;
                 }
                 base.Response.Write(LocalizedStrings.GetHtmlEncoded(967320822));
                 base.Response.Write("<br/>");
                 base.Response.Write(string.Format("<a href=\"{0}\">{0}</a>", this.errorInformation.RedirectionUrl));
                 base.Response.Headers.Add("X-OWA-FEError", ErrorFE.FEErrorCodes.CasRedirect.ToString());
                 return;
             }
             else
             {
                 base.Response.Write(LocalizedStrings.GetHtmlEncoded(236137783));
             }
         }
         return;
     }
     if (this.errorInformation.GroupMailboxDestination == "conv")
     {
         base.Response.Write(LocalizedStrings.GetHtmlEncoded(-364732161));
         return;
     }
     if (this.errorInformation.GroupMailboxDestination == "cal")
     {
         base.Response.Write(LocalizedStrings.GetHtmlEncoded(-292781713));
     }
 }