Esempio n. 1
0
        public void ProcessRequest(HttpContext context)
        {
            string text = context.Request.QueryString["helpid"];

            if (string.IsNullOrEmpty(text) || (!Enum.IsDefined(typeof(EACHelpId), text) && !Enum.IsDefined(typeof(OptionsHelpId), text)))
            {
                throw new BadRequestException(new Exception("Invalid HelpId: \"" + text + "\" ."));
            }
            context.Response.Redirect(HelpUtil.BuildEhcHref(text));
        }
Esempio n. 2
0
        protected override void BuildScriptDescriptor(ScriptComponentDescriptor descriptor)
        {
            base.BuildScriptDescriptor(descriptor);
            OptionsHelpId optionsHelpId = base.UseSetObject ? OptionsHelpId.EditInboxRule : OptionsHelpId.NewInboxRule;

            descriptor.AddProperty("HrefForStopProcessingRules", HelpUtil.BuildEhcHref(optionsHelpId.ToString()), true);
            if (this.ruleObj != null)
            {
                descriptor.AddScriptProperty("MailMessageObject", this.ruleObj.ToJsonString(null));
            }
            if (this.templatePhraseNames != null)
            {
                descriptor.AddScriptProperty("TemplatePhraseNames", this.templatePhraseNames.ToJsonString(null));
            }
        }
Esempio n. 3
0
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);
            this.EnsureChildControls();
            if (HttpContext.Current.Error != null)
            {
                this.debugInformation = HttpContext.Current.Error.ToTraceString();
                HttpContext.Current.ClearError();
            }
            if (HttpContext.Current.Request.ServerVariables["X-ECP-ERROR"] != null)
            {
                HttpContext.Current.Response.AddHeader("X-ECP-ERROR", HttpContext.Current.Request.ServerVariables["X-ECP-ERROR"]);
            }
            string            text = base.Request.QueryString["cause"] ?? "unexpected";
            ErrorPageContents contentsForErrorType = ErrorPageContents.GetContentsForErrorType(text);
            string            text2 = null;

            if (text == "browsernotsupported")
            {
                string    helpId   = EACHelpId.BrowserNotSupportedHelp.ToString();
                IThemable themable = this.Page as IThemable;
                if (themable != null && themable.FeatureSet == FeatureSet.Options)
                {
                    helpId = OptionsHelpId.OwaOptionsBrowserNotSupportedHelp.ToString();
                }
                text2 = string.Format(contentsForErrorType.ErrorMessageText, HelpUtil.BuildEhcHref(helpId));
            }
            else if (text == "nocookies")
            {
                HttpBrowserCapabilities browser = HttpContext.Current.Request.Browser;
                if (browser != null && browser.IsBrowser("IE"))
                {
                    text2 = string.Format(Strings.CookiesDisabledMessageForIE, HelpUtil.BuildEhcHref(EACHelpId.CookiesDisabledMessageForIE.ToString()));
                }
            }
            else if (text == "liveidmismatch")
            {
                string value = HttpContextExtensions.CurrentUserLiveID();
                if (string.IsNullOrEmpty(value))
                {
                    contentsForErrorType = ErrorPageContents.GetContentsForErrorType("unexpected");
                }
                else
                {
                    string arg = EcpUrl.EcpVDir + "logoff.aspx?src=exch&ru=" + HttpUtility.UrlEncode(HttpContext.Current.GetRequestUrl().OriginalString);
                    text2 = string.Format(contentsForErrorType.ErrorMessageText, HttpContextExtensions.CurrentUserLiveID(), arg);
                }
            }
            else if (text == "verificationfailed")
            {
                text2 = string.Format(contentsForErrorType.ErrorMessageText, EcpUrl.EcpVDir);
            }
            else if (text == "verificationprocessingerror")
            {
                text2 = contentsForErrorType.ErrorMessageText;
            }
            else if (text == "noroles")
            {
                this.ShowSignOutHint   = true;
                this.ShowSignOutLink   = true;
                this.SignOutReturnVdir = "/ecp/";
            }
            else if (text == "cannotaccessoptionswithbeparamorcookie")
            {
                this.ShowSignOutLink   = true;
                this.SignOutReturnVdir = "/owa/";
            }
            if (string.IsNullOrEmpty(text2))
            {
                this.msgText.Text = contentsForErrorType.ErrorMessageText;
            }
            else
            {
                this.msgText.Text = text2;
            }
            base.Title         = contentsForErrorType.PageTitle;
            this.msgTitle.Text = Strings.ErrorTitle(contentsForErrorType.ErrorMessageTitle);
            this.msgCode.Text  = ((int)contentsForErrorType.StatusCode).ToString(CultureInfo.InvariantCulture);
            HttpContext.Current.Response.StatusCode             = (int)contentsForErrorType.StatusCode;
            HttpContext.Current.Response.SubStatusCode          = contentsForErrorType.SubStatusCode;
            HttpContext.Current.Response.TrySkipIisCustomErrors = true;
            this.causeMarker.Text = "<!-- cause:" + contentsForErrorType.CauseMarker + " -->";
        }
Esempio n. 4
0
 public static string BuildFVAEhcHref(string helpId, string controlId)
 {
     HelpUtil.EnsureInit();
     return(HelpUtil.BuildEhcHref(controlId, HelpUtil.IsEACHelpId(helpId)));
 }
Esempio n. 5
0
 public static string BuildEhcHref(OptionsHelpId helpId)
 {
     HelpUtil.EnsureInit();
     return(HelpUtil.BuildEhcHref(helpId.ToString(), false));
 }
Esempio n. 6
0
 public static string BuildEhcHref(EACHelpId helpId)
 {
     HelpUtil.EnsureInit();
     return(HelpUtil.BuildEhcHref(helpId.ToString(), true));
 }
Esempio n. 7
0
        private void AddCustomSubLinks(bool isMockObject)
        {
            NavBarLinkData[] currentWorkloadUserSubLinks = null;
            if (this.showAdminFeature)
            {
                this.navBarPack.FeatureSet = "myorg";
                this.navBarPack.NavBarData.CurrentMainLinkElementID = "ShellAdmin";
                if (this.rbacPrincipal.IsInRole("UserOptions+OrgMgmControlPanel"))
                {
                    currentWorkloadUserSubLinks = new NavBarLinkData[]
                    {
                        MockNavBar.CreateLink("eso_O365L", Strings.EntryOnBehalfOf, null, null)
                    };
                }
            }
            else
            {
                this.navBarPack.FeatureSet = "myself";
                this.navBarPack.NavBarData.CurrentMainLinkElementID = "ShellOutlook";
                if (isMockObject && NavigationUtil.ShouldRenderOwaLink(this.rbacPrincipal, this.showAdminFeature))
                {
                    NavBarLinkData[] workloadLinks = new NavBarLinkData[]
                    {
                        MockNavBar.CreateLink("ShellOutlook", Strings.NavBarMail, EcpUrl.OwaVDir, null)
                    };
                    this.navBarPack.NavBarData.WorkloadLinks = workloadLinks;
                }
            }
            this.navBarPack.NavBarData.CurrentWorkloadUserSubLinks = currentWorkloadUserSubLinks;
            List <NavBarLinkData> list = new List <NavBarLinkData>();
            string flightName          = this.navBarPack.NavBarData.FlightName;

            if (!string.IsNullOrEmpty(flightName) && flightName.Contains("GeminiShellUX"))
            {
                this.navBarPack.HelpParameters          = this.navBarPack.NavBarData.HelpLink.Url;
                this.navBarPack.NavBarData.HelpLink.Id  = (this.showAdminFeature ? "openHelp_O365L" : "openOptionHelp_O365L");
                this.navBarPack.NavBarData.HelpLink.Url = HelpUtil.BuildEhcHref(this.showAdminFeature ? EACHelpId.Default.ToString() : OptionsHelpId.OwaOptionsDefault.ToString());
            }
            else if (this.showAdminFeature)
            {
                list.Add(MockNavBar.CreateLink("openHelp_O365L", Strings.Help, HelpUtil.BuildEhcHref(EACHelpId.Default.ToString()), null));
            }
            else
            {
                list.Add(MockNavBar.CreateLink("openOptionHelp_O365L", Strings.Help, HelpUtil.BuildEhcHref(OptionsHelpId.OwaOptionsDefault.ToString()), null));
            }
            HttpCookie httpCookie = HttpContext.Current.Request.Cookies["msExchEcpFvaHelp"];
            bool       flag       = httpCookie != null && httpCookie.Value != null && httpCookie.Value.StartsWith("0");

            list.Add(MockNavBar.CreateLink("toggleFVA_O365L", flag ? ClientStrings.EnableFVA : ClientStrings.DisableFVA, null, null));
            if (NavBarClientBase.showPerfConsole)
            {
                list.Add(MockNavBar.CreateLink("perfConsole_O365L", Strings.PerformanceConsole, null, null));
            }
            if (this.showAdminFeature && EacFlightUtility.GetSnapshotForCurrentUser().Eac.CmdletLogging.Enabled)
            {
                list.Add(MockNavBar.CreateLink("cmdletLogging_O365L", Strings.CmdLogButtonText, null, null));
            }
            this.navBarPack.NavBarData.CurrentWorkloadHelpSubLinks = list.ToArray();
            if (this.isGallatin && this.navBarPack.NavBarData.FooterICPLink != null)
            {
                if (!string.IsNullOrEmpty(this.navBarPack.NavBarData.FooterICPLink.Text))
                {
                    this.navBarPack.NavBarData.FooterICPLink.Text = this.navBarPack.NavBarData.FooterICPLink.Text.Replace("-10", "-22");
                }
                if (!string.IsNullOrEmpty(this.navBarPack.NavBarData.FooterICPLink.Title))
                {
                    this.navBarPack.NavBarData.FooterICPLink.Title = this.navBarPack.NavBarData.FooterICPLink.Title.Replace("-10", "-22");
                }
            }
        }