public static string BuildPrivacyStatmentHref() { HelpUtil.EnsureInit(); if (Util.IsDataCenter) { return(HelpUtil.AppendLCID(HelpProvider.GetMSOnlinePrivacyStatementUrl().ToString())); } return(HelpUtil.AppendLCID(HelpProvider.GetExchange2013PrivacyStatementUrl().ToString())); }
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)); }
public static string BuildCommunitySiteHref() { Uri uri; if (HelpProvider.TryGetCommunityUrl(RbacPrincipal.Current.RbacConfiguration.OrganizationId, out uri)) { return(HelpUtil.AppendLCID(uri.ToEscapedString())); } return(string.Empty); }
public static string BuildErrorAssistanceUrl(LocalizedException locEx) { HelpUtil.EnsureInit(); Uri uri = null; HelpProvider.TryGetErrorAssistanceUrl(locEx, out uri); if (!(uri != null)) { return(null); } return(uri.ToEscapedString()); }
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)); } }
private static string BuildEhcHref(string helpId, bool isEACHelpId) { string result; if (isEACHelpId) { RbacPrincipal rbacPrincipal = HttpContext.Current.User as RbacPrincipal; result = ((rbacPrincipal != null) ? HelpProvider.ConstructHelpRenderingUrl(helpId, rbacPrincipal.RbacConfiguration).ToString() : HelpProvider.ConstructHelpRenderingUrl(helpId).ToString()); } else { result = HelpUtil.ConstructOwaOptionsHelpUrl(helpId); } return(result); }
public static InfoCore ToInfo(this ErrorInformationBase error) { InfoCore infoCore = new InfoCore(); if (error.Exception is WarningException) { infoCore.MessageBoxType = ModalDialogType.Warning; infoCore.JsonTitle = ClientStrings.Warning; } else { infoCore.MessageBoxType = ModalDialogType.Error; infoCore.JsonTitle = ClientStrings.Error; infoCore.StackTrace = error.CallStack; } if (error.Exception is LocalizedException) { infoCore.HelpUrl = HelpUtil.BuildErrorAssistanceUrl(error.Exception as LocalizedException); infoCore.Help = ClientStrings.ClickHereForHelp; } infoCore.Message = error.Message; infoCore.Details = ((error.Exception.InnerException != null) ? error.Exception.InnerException.GetFullMessage() : string.Empty); return(infoCore); }
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 + " -->"; }
protected override void CreateChildControls() { base.CreateChildControls(); LiteralControl child = new LiteralControl("\r\n <div class='brandingArrowContainer'>\r\n <svg version='1.1' width='6px' height='8px' viewBox='0 0 6 8'>\r\n <polygon class='vectorFillColor' points='0.504,0.161 0.504,7.849 5.504,4.005 '/>\r\n </svg>\r\n </div>\r\n <div class='appIconContainer'>\r\n <svg version='1.1' width='24px' height='24px' viewBox='0 0 48 48'>\r\n <g>\r\n <path class='vectorFillColor' d='M37.586,32.563c-0.557-0.164-1.48-0.335-2.258-0.335c-2.734,0-4.15,1.416-4.15,1.416v6.836h5.078 l0.004-6.836C36.26,33.645,36.644,32.823,37.586,32.563z'/>\r\n <polyline class='vectorStrokeColor' fill='none' stroke-width='1.5' stroke-miterlimit='10' points='28.785,35.256 1.148,35.256 1.148,8.156 43.824,8.156 43.824,22.609 \t'/>\r\n <path class='vectorFillColor' d='M46.852,33.645c0,0-1.367-1.416-4.102-1.416s-4.15,1.416-4.15,1.416v6.836h8.252V33.645z'/>\r\n <circle class='vectorFillColor' cx='34.879' cy='27.734' r='2.969'/>\r\n <circle class='vectorFillColor' cx='42.645' cy='27.734' r='2.969'/>\r\n <rect class='vectorFillColor' x='31.91' y='11.188' width='8.141' height='6'/>\r\n <line class='vectorStrokeColor' fill='none' stroke-width='1.5' stroke-miterlimit='10' x1='7.863' y1='23.229' x2='28.885' y2='23.229'/>\r\n <line class='vectorStrokeColor' fill='none' stroke-width='1.5' stroke-miterlimit='10' x1='7.863' y1='27.042' x2='25.885' y2='27.042'/>\r\n </g>\r\n </svg>\r\n </div>\r\n "); Label label = new Label(); label.ID = "brandingLabel"; label.CssClass = "brandingLabel"; label.Text = OwaOptionStrings.TeamMailboxAppTitle; Panel panel = new Panel(); panel.ID = "brandingPanel"; panel.CssClass = "newTMNavBrandingPanel"; this.brandingLink.Text = AntiXssEncoder.HtmlEncode(this.displayName, true); panel.Controls.Add(this.brandingLink); panel.Controls.Add(child); panel.Controls.Add(label); DropDownButton dropDownButton = new DropDownButton(HtmlTextWriterTag.Span); dropDownButton.ID = "nameDropDown"; dropDownButton.DropDownCommand.Name = "UserName"; dropDownButton.DropDownCommand.Text = RbacPrincipal.Current.Name; dropDownButton.DropDownCommand.Commands.Add(new Command { Name = "SignOff", Text = Strings.SignOff, OnClientClick = NewTeamMailboxControl.GetLogoffScript() }); DropDownButton dropDownButton2 = new DropDownButton(HtmlTextWriterTag.Span); dropDownButton2.ID = "helpControl"; DropDownCommand dropDownCommand = dropDownButton2.DropDownCommand; dropDownCommand.Name = "Help"; dropDownCommand.DefaultCommandName = "ContextualHelp"; dropDownCommand.Text = Strings.Help; if (Util.IsDataCenter) { Command command = new Command(); command.Name = "Community"; command.Text = Strings.Community; command.OnClientClick = string.Format("PopupWindowManager.showHelpClient('{0}');", HttpUtility.HtmlEncode(HelpUtil.BuildCommunitySiteHref())); dropDownCommand.Commands.Add(command); Command command2 = new Command(); command2.Name = "Privacy"; command2.Text = Strings.Privacy; command2.OnClientClick = string.Format("PopupWindowManager.showHelpClient('{0}');", HttpUtility.HtmlEncode(HelpUtil.BuildPrivacyStatmentHref())); dropDownCommand.Commands.Add(command2); } Command command3 = new Command(); command3.Name = "Copyright"; command3.Text = Strings.CopyRight; command3.OnClientClick = string.Format("PopupWindowManager.showHelpClient('{0}');", "http://go.microsoft.com/fwlink/p/?LinkId=256676"); dropDownCommand.Commands.Add(command3); Panel panel2 = new Panel(); panel2.ID = "topRightNavPanel"; panel2.CssClass = "newTMNavRight"; panel2.Controls.Add(dropDownButton); panel2.Controls.Add(dropDownButton2); Panel panel3 = new Panel(); panel3.ID = "headerPanel"; panel3.CssClass = "newTMNavHeader"; panel3.Controls.Add(panel); panel3.Controls.Add(panel2); Panel panel4 = new Panel(); panel4.CssClass = "newTMSeparator"; panel4.ID = "headerSeparatorPanel"; this.Controls.Add(panel3); this.Controls.Add(panel4); this.Controls.Add(this.contentPanel); }
public static string BuildFVAEhcHref(string helpId, string controlId) { HelpUtil.EnsureInit(); return(HelpUtil.BuildEhcHref(controlId, HelpUtil.IsEACHelpId(helpId))); }
public static string BuildEhcHref(OptionsHelpId helpId) { HelpUtil.EnsureInit(); return(HelpUtil.BuildEhcHref(helpId.ToString(), false)); }
public static string BuildEhcHref(EACHelpId helpId) { HelpUtil.EnsureInit(); return(HelpUtil.BuildEhcHref(helpId.ToString(), true)); }
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"); } } }