protected override void RenderChanges() { PowerShellResults <AdminAuditLogDetailRow> powerShellResults = base.Results as PowerShellResults <AdminAuditLogDetailRow>; if (powerShellResults != null && powerShellResults.Output != null && powerShellResults.Output.Length > 0 && powerShellResults.Succeeded) { Table table = new Table(); int num = 0; while (num < powerShellResults.Output.Length && num < 500) { AdminAuditLogDetailRow adminAuditLogDetailRow = powerShellResults.Output[num]; table.Rows.Add(base.GetDetailRowForTable(adminAuditLogDetailRow.AdminAuditLogEvent.RunDate.Value.ToUniversalTime().UtcToUserDateTimeString())); table.Rows.Add(base.GetDetailRowForTable(adminAuditLogDetailRow.UserFriendlyCaller)); string text = null; string text2 = null; foreach (AdminAuditLogCmdletParameter adminAuditLogCmdletParameter in adminAuditLogDetailRow.AdminAuditLogEvent.CmdletParameters) { if (adminAuditLogCmdletParameter.Name.Equals("Members", StringComparison.InvariantCultureIgnoreCase) || adminAuditLogCmdletParameter.Name.Equals("Member", StringComparison.InvariantCultureIgnoreCase)) { text = AuditHelper.MakeUserFriendly(adminAuditLogCmdletParameter.Value); } if (adminAuditLogCmdletParameter.Name.Equals("Roles", StringComparison.InvariantCultureIgnoreCase) || adminAuditLogCmdletParameter.Name.Equals("Role", StringComparison.InvariantCultureIgnoreCase)) { text2 = adminAuditLogCmdletParameter.Value; } } if (adminAuditLogDetailRow.AdminAuditLogEvent.CmdletName.Equals("New-RoleGroup", StringComparison.InvariantCultureIgnoreCase) || adminAuditLogDetailRow.AdminAuditLogEvent.CmdletName.Equals("Remove-RoleGroup", StringComparison.InvariantCultureIgnoreCase)) { table.Rows.Add(base.GetDetailRowForTable(this.GetLocalizedAction(adminAuditLogDetailRow.AdminAuditLogEvent.CmdletName))); } if (text != null) { StringBuilder stringBuilder = new StringBuilder(); if (adminAuditLogDetailRow.AdminAuditLogEvent.CmdletName.Equals("Update-RoleGroupMember", StringComparison.InvariantCultureIgnoreCase)) { stringBuilder.Append(Strings.UpdatedMembers); } else { stringBuilder.Append(Strings.AddedMembers); } stringBuilder.Append(AntiXssEncoder.HtmlEncode(text, false)); table.Rows.Add(base.GetDetailRowForTable(stringBuilder.ToString())); } if (text2 != null) { StringBuilder stringBuilder2 = new StringBuilder(); stringBuilder2.Append(Strings.AddedRoles); stringBuilder2.Append(text2); table.Rows.Add(base.GetDetailRowForTable(stringBuilder2.ToString())); } table.Rows.Add(base.GetEmptyRowForTable()); num++; } if (table.Rows.Count > 0) { this.detailsPane.Controls.Add(table); } } }
private static void SendAjaxErrorToClient(HttpContext httpContext) { httpContext.ClearError(); httpContext.Response.Clear(); httpContext.Response.TrySkipIisCustomErrors = true; httpContext.Response.Cache.SetCacheability(HttpCacheability.Private); httpContext.Response.ContentType = (httpContext.IsWebServiceRequest() ? "application/json; charset=utf-8" : "text/html"); httpContext.Response.Headers["jsonerror"] = "true"; httpContext.Response.AddHeader("X-ECP-ERROR", "ClientAccessRulesBlock"); httpContext.Response.Write(AntiXssEncoder.HtmlEncode(Strings.ClientAccessRulesEACBlockMessage, false)); httpContext.Response.StatusCode = (httpContext.IsWebServiceRequest() ? 500 : 200); httpContext.Response.End(); }
private EnumValue[] QueryDLPPolicies() { if (!RbacPrincipal.Current.IsInRole("Get-DLPPolicy")) { return(new EnumValue[0]); } WebServiceReference webServiceReference = new WebServiceReference(EcpUrl.EcpVDirForStaticResource + "DDI/DDIService.svc?schema=DLPPolicy&Workflow=GetPolicyList"); PowerShellResults <JsonDictionary <object> > list = webServiceReference.GetList(null, null); if (list.Output != null) { List <EnumValue> list2 = new List <EnumValue>(); JsonDictionary <object>[] output = list.Output; for (int i = 0; i < output.Length; i++) { Dictionary <string, object> dictionary = output[i]; string text = (string)dictionary["Name"]; list2.Add(new EnumValue(AntiXssEncoder.HtmlEncode(text, false), text)); } return(list2.ToArray()); } return(new EnumValue[0]); }
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); }