From 3e5581611c013f8728ff3b0e1a56956dcaae359e Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Sat, 25 Aug 2012 12:26:54 -0400 Subject: [PATCH] Update AntiXSS Protection --- .../WebsitePanel.Installer/Updater.exe | Bin 198144 -> 198144 bytes .../Code/PortalAntiXSS.cs | 59 ++++++ .../Code/SecureSessionModule.cs | 1 - .../WebsitePanel.WebPortal/Default.aspx.cs | 4 +- .../UserControls/CreateUserAccount.ascx.cs | 1 - .../WebsitePanel/BandwidthReport.ascx.cs | 1 - .../WebsitePanel/DiskspaceReport.ascx.cs | 1 - .../DiskspaceReportPackageDetails.ascx.cs | 3 +- .../ExchangeContactGeneralSettings.ascx.cs | 5 +- ...ngeDistributionListGeneralSettings.ascx.cs | 5 +- .../ExchangeMailboxGeneralSettings.ascx.cs | 1 - ...xchangePublicFolderGeneralSettings.ascx.cs | 3 +- .../OrganizationUserGeneralSettings.ascx.cs | 3 +- .../WebsitePanel/FileManager.ascx.cs | 5 +- .../WebsitePanel/HostingAddons.ascx | 4 +- .../HostingAddons.ascx.designer.cs | 31 ++- .../HostingAddonsEditAddon.ascx.cs | 11 +- .../WebsitePanel/HostingPlans.ascx | 4 +- .../HostingPlans.ascx.designer.cs | 31 ++- .../WebsitePanel/HostingPlansEditPlan.ascx.cs | 11 +- .../LoggedUserEditDetails.ascx.cs | 8 +- .../WebsitePanel/PeersEditPeer.ascx.cs | 9 +- .../SmarterMail60_EditList.ascx.cs | 3 +- .../SmarterMail_EditList.ascx.cs | 1 - .../WebsitePanel/Schedules.ascx | 3 +- .../WebsitePanel/Schedules.ascx.designer.cs | 31 ++- .../SchedulesEditSchedule.ascx.cs | 7 +- .../DesktopModules/WebsitePanel/Servers.ascx | 5 +- .../WebsitePanel/Servers.ascx.designer.cs | 72 ++++++- .../WebsitePanel/ServersAddServer.ascx.cs | 2 +- .../WebsitePanel/ServersEditServer.ascx.cs | 8 +- .../SettingsExchangeMailboxPlansPolicy.ascx | 3 +- ...SettingsExchangeMailboxPlansPolicy.ascx.cs | 5 +- ...xchangeMailboxPlansPolicy.ascx.designer.cs | 1 - .../SkinControls/UserSpaceBreadcrumb.ascx.cs | 8 +- .../WebsitePanel/SpaceDetails.ascx.cs | 2 +- .../WebsitePanel/SpaceEditAddon.ascx.cs | 16 +- .../SpaceEditAddon.ascx.designer.cs | 192 ++++++++++++++++-- .../WebsitePanel/SpaceEditDetails.ascx.cs | 11 +- .../SpaceNestedSpacesSummary.ascx.cs | 3 +- .../WebsitePanel/UserAccountDetails.ascx.cs | 4 +- .../UserAccountEditDetails.ascx.cs | 12 +- .../UserControls/AuditLogControl.ascx | 5 +- .../UserControls/AuditLogControl.ascx.cs | 6 +- .../AuditLogControl.ascx.designer.cs | 33 ++- .../UserControls/EditItemComments.ascx.cs | 4 +- .../UserControls/MessageBox.ascx.cs | 3 +- .../UserControls/PasswordControl.ascx.cs | 1 - .../UserControls/UsernameControl.ascx.cs | 3 +- .../WebsitePanel/UserCreateSpace.ascx.cs | 3 +- .../WebsitePanel/UserCustomers.ascx | 2 +- .../WebsitePanel/UserCustomersSummary.ascx.cs | 3 +- .../WebsitePanel/UserSpaces.ascx | 3 +- .../WebsitePanel/UserSpaces.ascx.designer.cs | 31 ++- .../VPS/RemoteDesktop/Connect.aspx.cs | 3 +- .../WebsitePanel/VPS/VdcCreateServer.ascx.cs | 23 +-- .../VPSForPC/RemoteDesktop/Connect.aspx.cs | 3 +- .../VPSForPC/VdcCreateServer.ascx.cs | 13 +- .../WebsitePanel/VirtualServers.ascx | 5 +- .../VirtualServers.ascx.designer.cs | 72 ++++++- .../VirtualServersAddServer.ascx.cs | 4 +- .../VirtualServersEditServer.ascx.cs | 8 +- .../WebsitePanel.WebPortal.csproj | 1 + 63 files changed, 636 insertions(+), 183 deletions(-) create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/Code/PortalAntiXSS.cs diff --git a/WebsitePanel.Installer/Sources/WebsitePanel.Installer/Updater.exe b/WebsitePanel.Installer/Sources/WebsitePanel.Installer/Updater.exe index b635d50e5f2a1d4f0d295d9001b40fca6a4f68aa..874fb22179b4b69c947fca2f18af500901a2775f 100644 GIT binary patch delta 45 zcmZqZ;c4jMnb5)fcAiCJcWXD})^4VQ1p@o~_HHu$%kS3^mb#-}p{R6wOd->fDFDl; B6fpn* delta 45 zcmV+|0Mh?}j0}K`43LNe^{Y04i-n5;wTlA5a1bO(79YmCr$L&-s87zlC)&4MaRQ{2 Dz;hI8 diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/Code/PortalAntiXSS.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/Code/PortalAntiXSS.cs new file mode 100644 index 00000000..061f3847 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/Code/PortalAntiXSS.cs @@ -0,0 +1,59 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +using System; +//using System.Collections.Generic; +//using System.Linq; +using System.Web; +using Microsoft.Security.Application; + +//usage +//<%@ Import Namespace="WebsitePanel.Portal" %> +//using WebsitePanel.Portal; + +namespace WebsitePanel.Portal +{ + public class PortalAntiXSS + { + public static string Encode(string input) + { + return Encoder.HtmlEncode(input); + } + + public static string EncodeOld(string input) + { + return Encoder.HtmlEncode(HttpUtility.HtmlDecode(input)); // HtmlDecode is used for compatability reasons with WSP pre-1.2.2 versions + } + + public static string DecodeOld(string input) + { + return HttpUtility.HtmlDecode(input); // HtmlDecode is used for compatability reasons with WSP pre-1.2.2 versions + } + + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/Code/SecureSessionModule.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/Code/SecureSessionModule.cs index 37bde9ba..42cc31b9 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/Code/SecureSessionModule.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/Code/SecureSessionModule.cs @@ -35,7 +35,6 @@ using System.Security.Cryptography; using System.Runtime.Serialization; using System.Globalization; using System.Text; -using Microsoft.Security.Application; namespace WebsitePanel.WebPortal { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/Default.aspx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/Default.aspx.cs index b831b110..50c487d0 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/Default.aspx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/Default.aspx.cs @@ -42,7 +42,7 @@ using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Globalization; -using Microsoft.Security.Application; +using WebsitePanel.Portal; namespace WebsitePanel.WebPortal { @@ -387,7 +387,7 @@ namespace WebsitePanel.WebPortal { Label lbl = new Label(); lbl.Text = - Microsoft.Security.Application.Encoder.HtmlEncode("
" + message.Replace("\n", "
") + + PortalAntiXSS.Encode("
" + message.Replace("\n", "
") + "
"); lbl.ForeColor = Color.Red; lbl.Font.Bold = true; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/Ecommerce/UserControls/CreateUserAccount.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/Ecommerce/UserControls/CreateUserAccount.ascx.cs index 3fc40e80..c6c78afa 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/Ecommerce/UserControls/CreateUserAccount.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/Ecommerce/UserControls/CreateUserAccount.ascx.cs @@ -27,7 +27,6 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using System; -using Microsoft.Security.Application; using WSP = WebsitePanel.Portal; using WebsitePanel.Ecommerce.EnterpriseServer; using WebsitePanel.EnterpriseServer; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/BandwidthReport.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/BandwidthReport.ascx.cs index 67d0b8be..59cd0268 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/BandwidthReport.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/BandwidthReport.ascx.cs @@ -31,7 +31,6 @@ using System; using System.Data; using System.Text; using System.Web.UI.WebControls; -using Microsoft.Security.Application; namespace WebsitePanel.Portal { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DiskspaceReport.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DiskspaceReport.ascx.cs index 6aa7773f..ce8f460c 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DiskspaceReport.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DiskspaceReport.ascx.cs @@ -37,7 +37,6 @@ using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; -using Microsoft.Security.Application; using WebsitePanel.EnterpriseServer; namespace WebsitePanel.Portal diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DiskspaceReportPackageDetails.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DiskspaceReportPackageDetails.ascx.cs index 6e709956..c7c74d83 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DiskspaceReportPackageDetails.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DiskspaceReportPackageDetails.ascx.cs @@ -39,7 +39,6 @@ using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using WebsitePanel.EnterpriseServer; -using Microsoft.Security.Application; namespace WebsitePanel.Portal { @@ -94,7 +93,7 @@ namespace WebsitePanel.Portal i++; } - litTotal.Text = Microsoft.Security.Application.Encoder.HtmlEncode(DiskspaceTotal.ToString()); + litTotal.Text = PortalAntiXSS.Encode(DiskspaceTotal.ToString()); // get summary gvSummary.DataSource = ds; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeContactGeneralSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeContactGeneralSettings.ascx.cs index ebc64bfa..501cab8b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeContactGeneralSettings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeContactGeneralSettings.ascx.cs @@ -29,7 +29,6 @@ using System; using System.Web.UI.WebControls; using WebsitePanel.Providers.HostedSolution; -using Microsoft.Security.Application; using WebsitePanel.EnterpriseServer; namespace WebsitePanel.Portal.ExchangeServer @@ -64,7 +63,7 @@ namespace WebsitePanel.Portal.ExchangeServer ExchangeContact contact = ES.Services.ExchangeServer.GetContactGeneralSettings(PanelRequest.ItemID, PanelRequest.AccountID); - litDisplayName.Text = Microsoft.Security.Application.Encoder.HtmlEncode(contact.DisplayName); + litDisplayName.Text = PortalAntiXSS.Encode(contact.DisplayName); // bind form txtDisplayName.Text = contact.DisplayName; @@ -146,7 +145,7 @@ namespace WebsitePanel.Portal.ExchangeServer return; } - litDisplayName.Text = Microsoft.Security.Application.Encoder.HtmlEncode(txtDisplayName.Text); + litDisplayName.Text = PortalAntiXSS.Encode(txtDisplayName.Text); messageBox.ShowSuccessMessage("EXCHANGE_UPDATE_CONTACT_SETTINGS"); } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListGeneralSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListGeneralSettings.ascx.cs index bdf839bf..feb9ed19 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListGeneralSettings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListGeneralSettings.ascx.cs @@ -38,7 +38,6 @@ using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using WebsitePanel.Providers.HostedSolution; -using Microsoft.Security.Application; using WebsitePanel.EnterpriseServer; namespace WebsitePanel.Portal.ExchangeServer @@ -63,7 +62,7 @@ namespace WebsitePanel.Portal.ExchangeServer ExchangeDistributionList dlist = ES.Services.ExchangeServer.GetDistributionListGeneralSettings( PanelRequest.ItemID, PanelRequest.AccountID); - litDisplayName.Text = dlist.DisplayName; + litDisplayName.Text = PortalAntiXSS.Encode(dlist.DisplayName); // bind form txtDisplayName.Text = dlist.DisplayName; @@ -105,7 +104,7 @@ namespace WebsitePanel.Portal.ExchangeServer return; } - litDisplayName.Text = Microsoft.Security.Application.Encoder.HtmlEncode(txtDisplayName.Text); + litDisplayName.Text = PortalAntiXSS.Encode(txtDisplayName.Text); messageBox.ShowSuccessMessage("EXCHANGE_UPDATE_DLIST_SETTINGS"); } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.cs index 35b5b5b8..a06f972b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.cs @@ -29,7 +29,6 @@ using System; using WebsitePanel.Providers.HostedSolution; using WebsitePanel.EnterpriseServer; -using Microsoft.Security.Application; namespace WebsitePanel.Portal.ExchangeServer { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangePublicFolderGeneralSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangePublicFolderGeneralSettings.ascx.cs index 708b7774..66152db9 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangePublicFolderGeneralSettings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangePublicFolderGeneralSettings.ascx.cs @@ -29,7 +29,6 @@ using System; using WebsitePanel.Providers.HostedSolution; using WebsitePanel.EnterpriseServer; -using Microsoft.Security.Application; using System.Collections.Generic; using System.Text; using System.Reflection; @@ -120,7 +119,7 @@ namespace WebsitePanel.Portal.ExchangeServer string origName = litDisplayName.Text; origName = origName.Substring(0, origName.LastIndexOf("\\")); - litDisplayName.Text = Microsoft.Security.Application.Encoder.HtmlEncode(origName + txtName.Text); + litDisplayName.Text = PortalAntiXSS.Encode(origName + txtName.Text); BindSettings(); } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs index b58fbea9..540fb703 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs @@ -29,7 +29,6 @@ using System; using WebsitePanel.EnterpriseServer; using WebsitePanel.Providers.HostedSolution; -using Microsoft.Security.Application; using WebsitePanel.Providers.ResultObjects; namespace WebsitePanel.Portal.HostedSolution @@ -70,7 +69,7 @@ namespace WebsitePanel.Portal.HostedSolution OrganizationUser user = ES.Services.Organizations.GetUserGeneralSettings(PanelRequest.ItemID, PanelRequest.AccountID); - litDisplayName.Text = Microsoft.Security.Application.Encoder.HtmlEncode(user.DisplayName); + litDisplayName.Text = PortalAntiXSS.Encode(user.DisplayName); lblUserDomainName.Text = user.DomainUserName; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/FileManager.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/FileManager.ascx.cs index 94d5833a..b8fe38e6 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/FileManager.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/FileManager.ascx.cs @@ -33,7 +33,6 @@ using System.Text; using System.Web; using System.Web.UI.WebControls; using WebsitePanel.Providers.OS; -using Microsoft.Security.Application; namespace WebsitePanel.Portal { @@ -243,7 +242,7 @@ function SetCreateZipFocus() { if (e.CommandName == "browse") { - litPath.Text = HttpContext.Current.Server.HtmlEncode((string)e.CommandArgument); + litPath.Text = PortalAntiXSS.Encode((string)e.CommandArgument); BindPath(); } } @@ -697,7 +696,7 @@ function SetCreateZipFocus() if (e.CommandName == "browse") { string fileName = (string)e.CommandArgument; - litPath.Text += HttpContext.Current.Server.HtmlEncode((litPath.Text != "\\") ? ("\\" + fileName) : fileName); + litPath.Text += PortalAntiXSS.Encode((litPath.Text != "\\") ? ("\\" + fileName) : fileName); BindPath(); } else if (e.CommandName == "download") diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostingAddons.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostingAddons.ascx index a13b0bd1..0af12b0d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostingAddons.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostingAddons.ascx @@ -11,9 +11,9 @@ - <%# Eval("PlanName") %> + <%# PortalAntiXSS.EncodeOld((string) Eval("PlanName")) %>
- <%# Eval("PlanDescription") %> + <%# PortalAntiXSS.EncodeOld((string) Eval("PlanDescription")) %>
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostingAddons.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostingAddons.ascx.designer.cs index ebd26788..26ff079a 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostingAddons.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostingAddons.ascx.designer.cs @@ -1,10 +1,37 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.3074 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostingAddonsEditAddon.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostingAddonsEditAddon.ascx.cs index ee7df6f3..bb5b4fac 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostingAddonsEditAddon.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostingAddonsEditAddon.ascx.cs @@ -29,7 +29,6 @@ using System; using System.Web; using WebsitePanel.EnterpriseServer; -using Microsoft.Security.Application; namespace WebsitePanel.Portal { @@ -79,8 +78,8 @@ namespace WebsitePanel.Portal } // bind plan - txtPlanName.Text = Server.HtmlDecode(plan.PlanName); - txtPlanDescription.Text = Server.HtmlDecode(plan.PlanDescription); + txtPlanName.Text = PortalAntiXSS.DecodeOld(plan.PlanName); + txtPlanDescription.Text = PortalAntiXSS.DecodeOld(plan.PlanDescription); //chkAvailable.Checked = plan.Available; //txtSetupPrice.Text = plan.SetupPrice.ToString("0.00"); @@ -107,8 +106,8 @@ namespace WebsitePanel.Portal plan.UserId = PanelSecurity.SelectedUserId; plan.PlanId = PanelRequest.PlanID; plan.IsAddon = true; - plan.PlanName = Server.HtmlEncode(txtPlanName.Text); - plan.PlanDescription = Server.HtmlEncode(txtPlanDescription.Text); + plan.PlanName = txtPlanName.Text; + plan.PlanDescription = txtPlanDescription.Text; plan.Available = true; // always available plan.SetupPrice = 0; @@ -144,7 +143,7 @@ namespace WebsitePanel.Portal try { PackageResult result = ES.Services.Packages.UpdateHostingPlan(plan); - lblMessage.Text = Microsoft.Security.Application.Encoder.HtmlEncode(GetExceedingQuotasMessage(result.ExceedingQuotas)); + lblMessage.Text = PortalAntiXSS.Encode(GetExceedingQuotasMessage(result.ExceedingQuotas)); if (result.Result < 0) { ShowResultMessage(result.Result); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostingPlans.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostingPlans.ascx index e7534921..63d61b1a 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostingPlans.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostingPlans.ascx @@ -12,9 +12,9 @@ - <%# Eval("PlanName") %> + <%# PortalAntiXSS.Encode((string)Eval("PlanName")) %>
- <%# Eval("PlanDescription") %> + <%# PortalAntiXSS.Encode((string)Eval("PlanDescription")) %>
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostingPlans.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostingPlans.ascx.designer.cs index cfdf9e07..27a8b616 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostingPlans.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostingPlans.ascx.designer.cs @@ -1,10 +1,37 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.3074 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostingPlansEditPlan.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostingPlansEditPlan.ascx.cs index 61ecfb3f..d7ba9fa8 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostingPlansEditPlan.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostingPlansEditPlan.ascx.cs @@ -30,7 +30,6 @@ using System; using System.Web; using System.Web.UI.WebControls; using WebsitePanel.EnterpriseServer; -using Microsoft.Security.Application; namespace WebsitePanel.Portal { @@ -104,8 +103,8 @@ namespace WebsitePanel.Portal } // bind plan - txtPlanName.Text = Server.HtmlDecode(plan.PlanName); - txtPlanDescription.Text = Server.HtmlDecode(plan.PlanDescription); + txtPlanName.Text = PortalAntiXSS.DecodeOld(plan.PlanName); + txtPlanDescription.Text = PortalAntiXSS.DecodeOld(plan.PlanDescription); //chkAvailable.Checked = plan.Available; //txtSetupPrice.Text = plan.SetupPrice.ToString("0.00"); @@ -137,8 +136,8 @@ namespace WebsitePanel.Portal plan.UserId = PanelSecurity.SelectedUserId; plan.PlanId = PanelRequest.PlanID; plan.IsAddon = false; - plan.PlanName = Server.HtmlEncode(txtPlanName.Text); - plan.PlanDescription = Server.HtmlEncode(txtPlanDescription.Text); + plan.PlanName = txtPlanName.Text; + plan.PlanDescription = txtPlanDescription.Text; plan.Available = true; // always available plan.SetupPrice = 0; @@ -196,7 +195,7 @@ namespace WebsitePanel.Portal if (result.Result < 0) { ShowResultMessage(result.Result); - lblMessage.Text = Microsoft.Security.Application.Encoder.HtmlEncode(GetExceedingQuotasMessage(result.ExceedingQuotas)); + lblMessage.Text = PortalAntiXSS.Encode(GetExceedingQuotasMessage(result.ExceedingQuotas)); return; } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/LoggedUserEditDetails.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/LoggedUserEditDetails.ascx.cs index 4f0d0126..eafcbe40 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/LoggedUserEditDetails.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/LoggedUserEditDetails.ascx.cs @@ -64,8 +64,8 @@ namespace WebsitePanel.Portal userPassword.SetUserPolicy(user.UserId, UserSettings.WEBSITEPANEL_POLICY, "PasswordPolicy"); // account info - txtFirstName.Text = Server.HtmlDecode(user.FirstName); - txtLastName.Text = Server.HtmlDecode(user.LastName); + txtFirstName.Text = PortalAntiXSS.DecodeOld(user.FirstName); + txtLastName.Text = PortalAntiXSS.DecodeOld(user.LastName); txtEmail.Text = user.Email; txtSecondaryEmail.Text = user.SecondaryEmail; lblUsername.Text = user.Username; @@ -106,8 +106,8 @@ namespace WebsitePanel.Portal { // gather data from form // account info - user.FirstName = Server.HtmlEncode(txtFirstName.Text); - user.LastName = Server.HtmlEncode(txtLastName.Text); + user.FirstName = txtFirstName.Text; + user.LastName = txtLastName.Text; user.Email = txtEmail.Text; user.SecondaryEmail = txtSecondaryEmail.Text; user.HtmlMail = ddlMailFormat.SelectedIndex == 1; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PeersEditPeer.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PeersEditPeer.ascx.cs index 6750e309..0f052cb3 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PeersEditPeer.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PeersEditPeer.ascx.cs @@ -38,7 +38,6 @@ using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; -using Microsoft.Security.Application; using WebsitePanel.EnterpriseServer; namespace WebsitePanel.Portal @@ -111,8 +110,8 @@ namespace WebsitePanel.Portal userPassword.ValidationGroup = "NewPassword"; // account info - txtFirstName.Text = Server.HtmlDecode(user.FirstName); - txtLastName.Text = Server.HtmlDecode(user.LastName); + txtFirstName.Text = PortalAntiXSS.DecodeOld(user.FirstName); + txtLastName.Text = PortalAntiXSS.DecodeOld(user.LastName); txtEmail.Text = user.Email; txtSecondaryEmail.Text = user.SecondaryEmail; ddlMailFormat.SelectedIndex = user.HtmlMail ? 1 : 0; @@ -189,8 +188,8 @@ namespace WebsitePanel.Portal user.IsPeer = true; // account info - user.FirstName = Server.HtmlEncode(txtFirstName.Text); - user.LastName = Server.HtmlEncode(txtLastName.Text); + user.FirstName = txtFirstName.Text; + user.LastName = txtLastName.Text; user.Email = txtEmail.Text; user.SecondaryEmail = txtSecondaryEmail.Text; user.HtmlMail = ddlMailFormat.SelectedIndex == 1; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/SmarterMail60_EditList.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/SmarterMail60_EditList.ascx.cs index eeba8b82..1a8f0c85 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/SmarterMail60_EditList.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/SmarterMail60_EditList.ascx.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2012, Outercurve Foundation. +// Copyright (c) 2012, Outercurve Foundation. // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, @@ -30,7 +30,6 @@ using System.Web.UI.WebControls; using WebsitePanel.Providers.Mail; using WebsitePanel.WebPortal.Code.Controls; -using Microsoft.Security.Application; namespace WebsitePanel.Portal.ProviderControls { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/SmarterMail_EditList.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/SmarterMail_EditList.ascx.cs index e6abdf3d..a4daba42 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/SmarterMail_EditList.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/SmarterMail_EditList.ascx.cs @@ -30,7 +30,6 @@ using System; using System.Web.UI.WebControls; using WebsitePanel.Providers.Mail; using WebsitePanel.WebPortal.Code.Controls; -using Microsoft.Security.Application; namespace WebsitePanel.Portal.ProviderControls { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Schedules.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Schedules.ascx index aaaa709c..7e6c19f5 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Schedules.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Schedules.ascx @@ -3,6 +3,7 @@ <%@ Register Src="UserControls/UserDetails.ascx" TagName="UserDetails" TagPrefix="uc2" %> <%@ Register Src="UserControls/SearchBox.ascx" TagName="SearchBox" TagPrefix="uc1" %> <%@ Register Src="UserControls/Quota.ascx" TagName="Quota" TagPrefix="uc4" %> +<%@ Import Namespace="WebsitePanel.Portal" %>
@@ -24,7 +25,7 @@ - <%# Eval("ScheduleName") %> + <%# PortalAntiXSS.Encode((string)Eval("ScheduleName")) %> diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Schedules.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Schedules.ascx.designer.cs index 59223c06..93e0d3c0 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Schedules.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Schedules.ascx.designer.cs @@ -1,10 +1,37 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.1434 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SchedulesEditSchedule.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SchedulesEditSchedule.ascx.cs index 31ce11ba..bd2b1e62 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SchedulesEditSchedule.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SchedulesEditSchedule.ascx.cs @@ -34,7 +34,6 @@ using System.Web.UI.WebControls; using WebsitePanel.EnterpriseServer; using WebsitePanel.EnterpriseServer.Base.Scheduling; using WebsitePanel.Portal.Code.Framework; -using Microsoft.Security.Application; namespace WebsitePanel.Portal { @@ -151,7 +150,7 @@ namespace WebsitePanel.Portal // The view does not provide ability to set and get parameters. return null; } - view.ID = Microsoft.Security.Application.Encoder.HtmlEncode(taskId); + view.ID = taskId; view.Visible = visible; view.EnableTheming = true; this.TaskParametersPlaceHolder.Controls.Add(view); @@ -198,7 +197,7 @@ namespace WebsitePanel.Portal ApplyPackageContextRestrictions(sc.PackageId); PackageId = sc.PackageId; - txtTaskName.Text = Server.HtmlDecode(sc.ScheduleName); + txtTaskName.Text = sc.ScheduleName; Utils.SelectListItem(ddlTaskType, sc.TaskId); @@ -310,7 +309,7 @@ namespace WebsitePanel.Portal // gather form parameters ScheduleInfo sc = new ScheduleInfo(); sc.ScheduleId = PanelRequest.ScheduleID; - sc.ScheduleName = Server.HtmlEncode(txtTaskName.Text.Trim()); + sc.ScheduleName = txtTaskName.Text.Trim(); sc.TaskId = ddlTaskType.SelectedValue; sc.PackageId = PanelSecurity.PackageId; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Servers.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Servers.ascx index 7e176050..0c30fcfd 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Servers.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Servers.ascx @@ -1,4 +1,5 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Servers.ascx.cs" Inherits="WebsitePanel.Portal.Servers" %> +<%@ Import Namespace="WebsitePanel.Portal" %>
@@ -11,13 +12,13 @@ - <%# Eval("ServerName") %> + <%# PortalAntiXSS.EncodeOld((string)Eval("ServerName")) %> - <%# Eval("Comments") %> + <%# PortalAntiXSS.EncodeOld((string)Eval("Comments")) %> diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Servers.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Servers.ascx.designer.cs index 18984eae..f0608ed1 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Servers.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Servers.ascx.designer.cs @@ -1,19 +1,79 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.42 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace WebsitePanel.Portal { + public partial class Servers { - protected System.Web.UI.WebControls.Button btnAddItem; - protected System.Web.UI.WebControls.DataList dlServers; - protected System.Web.UI.HtmlControls.HtmlTable tblEmptyList; - protected System.Web.UI.WebControls.Label lblEmptyList; + + /// + /// btnAddItem control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnAddItem; + + /// + /// dlServers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DataList dlServers; + + /// + /// tblEmptyList control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTable tblEmptyList; + + /// + /// lblEmptyList control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblEmptyList; } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ServersAddServer.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ServersAddServer.ascx.cs index 688890c3..8a3ffd40 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ServersAddServer.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ServersAddServer.ascx.cs @@ -54,7 +54,7 @@ namespace WebsitePanel.Portal return; ServerInfo server = new ServerInfo(); - server.ServerName = Server.HtmlEncode(txtName.Text.Trim()); + server.ServerName = txtName.Text.Trim(); server.ServerUrl = txtUrl.Text.Trim(); server.Password = serverPassword.Password; server.Comments = ""; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ServersEditServer.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ServersEditServer.ascx.cs index 79a93995..893671c8 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ServersEditServer.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ServersEditServer.ascx.cs @@ -84,8 +84,8 @@ namespace WebsitePanel.Portal RedirectToBrowsePage(); // header - txtName.Text = Server.HtmlDecode(server.ServerName); - txtComments.Text = Server.HtmlDecode(server.Comments); + txtName.Text = PortalAntiXSS.DecodeOld(server.ServerName); + txtComments.Text = PortalAntiXSS.DecodeOld(server.Comments); // connection @@ -122,8 +122,8 @@ namespace WebsitePanel.Portal // header server.ServerId = PanelRequest.ServerId; - server.ServerName = Server.HtmlEncode(txtName.Text); - server.Comments = Server.HtmlEncode(txtComments.Text); + server.ServerName = txtName.Text; + server.Comments = txtComments.Text; // connection server.ServerUrl = txtUrl.Text; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx index ef531784..e5a6f9dc 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx @@ -4,6 +4,7 @@ <%@ Register Src="UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" TagPrefix="wsp" %> <%@ Register Src="UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> <%@ Register Src="UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> +<%@ Import Namespace="WebsitePanel.Portal" %> @@ -23,7 +24,7 @@ - <%# Eval("MailboxPlan")%> + <%# PortalAntiXSS.Encode((string)Eval("MailboxPlan"))%> diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.cs index 0fff13a0..c4041b0a 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.cs @@ -56,7 +56,7 @@ namespace WebsitePanel.Portal public void BindSettings(UserSettings settings) { BindMailboxPlans(); - + txtStatus.Visible = false; } @@ -473,8 +473,5 @@ namespace WebsitePanel.Portal BindMailboxPlans(); } - - } - } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.designer.cs index 60ddc584..6ee96139 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.designer.cs @@ -26,7 +26,6 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - //------------------------------------------------------------------------------ // // This code was generated by a tool. diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SkinControls/UserSpaceBreadcrumb.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SkinControls/UserSpaceBreadcrumb.ascx.cs index bd49a4f3..2c747fc5 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SkinControls/UserSpaceBreadcrumb.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SkinControls/UserSpaceBreadcrumb.ascx.cs @@ -78,11 +78,11 @@ namespace WebsitePanel.Portal.SkinControls spanSpace.Visible = true; pnlViewSpace.Visible = true; - lnkSpace.Text = package.PackageName; + lnkSpace.Text = PortalAntiXSS.EncodeOld(package.PackageName); lnkSpace.NavigateUrl = PortalUtils.GetSpaceHomePageUrl(package.PackageId); - cmdSpaceName.Text = package.PackageName; - lblSpaceDescription.Text = package.PackageComments; + cmdSpaceName.Text = PortalAntiXSS.EncodeOld(package.PackageName); + lblSpaceDescription.Text = PortalAntiXSS.EncodeOld(package.PackageComments); lnkCurrentPage.NavigateUrl = PortalUtils.NavigatePageURL( PortalUtils.GetCurrentPageId(), "SpaceID", PanelSecurity.PackageId.ToString()); @@ -134,7 +134,7 @@ namespace WebsitePanel.Portal.SkinControls { // update space int result = ES.Services.Packages.UpdatePackageName(PanelSecurity.PackageId, - Server.HtmlEncode(txtName.Text), lblSpaceDescription.Text); + txtName.Text, lblSpaceDescription.Text); if (result < 0) { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceDetails.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceDetails.ascx.cs index b4ea5185..2f9fec9d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceDetails.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceDetails.ascx.cs @@ -54,7 +54,7 @@ namespace WebsitePanel.Portal PackageInfo package = ES.Services.Packages.GetPackage(PanelSecurity.PackageId); if (package != null) { - litSpaceName.Text = package.PackageName; + litSpaceName.Text = PortalAntiXSS.EncodeOld(package.PackageName); // bind space status PackageStatus status = (PackageStatus)package.StatusId; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceEditAddon.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceEditAddon.ascx.cs index e1404595..95374009 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceEditAddon.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceEditAddon.ascx.cs @@ -29,7 +29,6 @@ using System; using System.Web.UI.WebControls; using WebsitePanel.EnterpriseServer; -using Microsoft.Security.Application; namespace WebsitePanel.Portal { @@ -55,7 +54,16 @@ namespace WebsitePanel.Portal private void BindAddons(int userId) { - ddlPlan.DataSource = ES.Services.Packages.GetUserAvailableHostingAddons(userId); + HostingPlanInfo[] hpi = ES.Services.Packages.GetUserAvailableHostingAddons(userId); + + // Next code is user for decoding incorectly stored plan names and descriptions with pre 1.2.2 installations + for (int i = 0; i < hpi.Length; i++) + { + hpi[i].PlanDescription = PortalAntiXSS.DecodeOld(hpi[i].PlanDescription); + hpi[i].PlanName = PortalAntiXSS.DecodeOld(hpi[i].PlanName); + } + + ddlPlan.DataSource = hpi; ddlPlan.DataBind(); ddlPlan.Items.Insert(0, new ListItem(GetLocalizedString("SelectHostingPlan.Text"), "")); @@ -137,7 +145,7 @@ namespace WebsitePanel.Portal if (result.Result < 0) { ShowResultMessage(result.Result); - lblMessage.Text = Microsoft.Security.Application.Encoder.HtmlEncode(GetExceedingQuotasMessage(result.ExceedingQuotas)); + lblMessage.Text = PortalAntiXSS.Encode(GetExceedingQuotasMessage(result.ExceedingQuotas)); return; } } @@ -156,7 +164,7 @@ namespace WebsitePanel.Portal if (result.Result < 0) { ShowResultMessage(result.Result); - lblMessage.Text = Microsoft.Security.Application.Encoder.HtmlEncode(GetExceedingQuotasMessage(result.ExceedingQuotas)); + lblMessage.Text = PortalAntiXSS.Encode(GetExceedingQuotasMessage(result.ExceedingQuotas)); return; } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceEditAddon.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceEditAddon.ascx.designer.cs index 0cc22e8e..a9de9f09 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceEditAddon.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceEditAddon.ascx.designer.cs @@ -1,31 +1,187 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.42 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace WebsitePanel.Portal { + public partial class SpaceEditAddon { - protected System.Web.UI.WebControls.Label lblMessage; - protected System.Web.UI.WebControls.Label lblAddon; - protected System.Web.UI.WebControls.DropDownList ddlPlan; - protected System.Web.UI.WebControls.RequiredFieldValidator planValidator; - protected System.Web.UI.WebControls.Label lblQuantity; - protected System.Web.UI.WebControls.TextBox txtQuantity; - protected System.Web.UI.WebControls.RequiredFieldValidator valQuantity; - protected System.Web.UI.WebControls.Label lblStatus; - protected System.Web.UI.WebControls.DropDownList ddlStatus; - protected System.Web.UI.WebControls.Label lblCreationDate; - protected WebsitePanel.Portal.CalendarControl PurchaseDate; - protected System.Web.UI.WebControls.Label lblComments; - protected System.Web.UI.WebControls.TextBox txtComments; - protected System.Web.UI.WebControls.Button btnSave; - protected System.Web.UI.WebControls.Button btnCancel; - protected System.Web.UI.WebControls.Button btnDelete; + + /// + /// lblMessage control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblMessage; + + /// + /// lblAddon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblAddon; + + /// + /// ddlPlan control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlPlan; + + /// + /// planValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator planValidator; + + /// + /// lblQuantity control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblQuantity; + + /// + /// txtQuantity control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtQuantity; + + /// + /// valQuantity control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valQuantity; + + /// + /// lblStatus control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblStatus; + + /// + /// ddlStatus control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlStatus; + + /// + /// lblCreationDate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblCreationDate; + + /// + /// PurchaseDate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CalendarControl PurchaseDate; + + /// + /// lblComments control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblComments; + + /// + /// txtComments control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtComments; + + /// + /// btnSave control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnSave; + + /// + /// btnCancel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCancel; + + /// + /// btnDelete control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnDelete; } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceEditDetails.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceEditDetails.ascx.cs index 43fc8c38..a6aa62dc 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceEditDetails.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceEditDetails.ascx.cs @@ -29,7 +29,6 @@ using System; using System.Web.UI.WebControls; using WebsitePanel.EnterpriseServer; -using Microsoft.Security.Application; namespace WebsitePanel.Portal { @@ -53,8 +52,8 @@ namespace WebsitePanel.Portal BindHostingPlans(); // bind space - txtName.Text = Server.HtmlDecode(package.PackageName); - txtComments.Text = Server.HtmlDecode(package.PackageComments); + txtName.Text = PortalAntiXSS.DecodeOld(package.PackageName); + txtComments.Text = PortalAntiXSS.DecodeOld(package.PackageComments); PurchaseDate.SelectedDate = package.PurchaseDate; serverDetails.ServerId = package.ServerId; Utils.SelectListItem(ddlPlan, package.PlanId); @@ -110,8 +109,8 @@ namespace WebsitePanel.Portal package = ES.Services.Packages.GetPackage(PanelSecurity.PackageId); package.PackageId = PanelSecurity.PackageId; - package.PackageName = Server.HtmlEncode(txtName.Text); - package.PackageComments = Server.HtmlEncode(txtComments.Text); + package.PackageName = txtName.Text; + package.PackageComments = txtComments.Text; package.PlanId = Utils.ParseInt(ddlPlan.SelectedValue, 0); package.PurchaseDate = PurchaseDate.SelectedDate; @@ -129,7 +128,7 @@ namespace WebsitePanel.Portal if (result.Result < 0) { ShowResultMessage(result.Result); - lblMessage.Text = Microsoft.Security.Application.Encoder.HtmlEncode(GetExceedingQuotasMessage(result.ExceedingQuotas)); + lblMessage.Text = PortalAntiXSS.Encode(GetExceedingQuotasMessage(result.ExceedingQuotas)); return; } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceNestedSpacesSummary.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceNestedSpacesSummary.ascx.cs index 704920e9..2badcff7 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceNestedSpacesSummary.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceNestedSpacesSummary.ascx.cs @@ -38,7 +38,6 @@ using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using WebsitePanel.EnterpriseServer; -using Microsoft.Security.Application; namespace WebsitePanel.Portal { @@ -60,7 +59,7 @@ namespace WebsitePanel.Portal DataSet dsSpaces = ES.Services.Packages.GetNestedPackagesSummary(PanelSecurity.PackageId); // all customers - lnkAllSpaces.Text = Microsoft.Security.Application.Encoder.HtmlEncode(String.Format("All Spaces ({0})", dsSpaces.Tables[0].Rows[0]["PackagesNumber"])); + lnkAllSpaces.Text = String.Format("All Spaces ({0})", dsSpaces.Tables[0].Rows[0]["PackagesNumber"]); // by status repSpaceStatuses.DataSource = dsSpaces.Tables[1]; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountDetails.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountDetails.ascx.cs index f77f13a9..e5f5fa7f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountDetails.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountDetails.ascx.cs @@ -60,8 +60,8 @@ namespace WebsitePanel.Portal // bind account details litUsername.Text = user.Username; - litFullName.Text = Utils.EllipsisString(user.FirstName + " " + user.LastName, 25); - litSubscriberNumber.Text = Server.HtmlDecode(user.SubscriberNumber); + litFullName.Text = Utils.EllipsisString(PortalAntiXSS.Encode(user.FirstName) + " " + PortalAntiXSS.Encode(user.LastName), 25); + litSubscriberNumber.Text = PortalAntiXSS.Encode(user.SubscriberNumber); litRole.Text = PanelFormatter.GetUserRoleName(user.RoleId); litCreated.Text = user.Created.ToString(); litUpdated.Text = user.Changed.ToString(); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountEditDetails.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountEditDetails.ascx.cs index f0a48873..07c4bbb5 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountEditDetails.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountEditDetails.ascx.cs @@ -75,9 +75,9 @@ namespace WebsitePanel.Portal rowDemo.Visible = !editAdminAccount; // account info - txtFirstName.Text = Server.HtmlDecode(user.FirstName); - txtLastName.Text = Server.HtmlDecode(user.LastName); - txtSubscriberNumber.Text = Server.HtmlDecode(user.SubscriberNumber); + txtFirstName.Text = PortalAntiXSS.DecodeOld(user.FirstName); + txtLastName.Text = PortalAntiXSS.DecodeOld(user.LastName); + txtSubscriberNumber.Text = PortalAntiXSS.DecodeOld(user.SubscriberNumber); txtEmail.Text = user.Email; txtSecondaryEmail.Text = user.SecondaryEmail; ddlMailFormat.SelectedIndex = user.HtmlMail ? 1 : 0; @@ -127,9 +127,9 @@ namespace WebsitePanel.Portal user.LoginStatusId = loginStatus.SelectedIndex; // account info - user.FirstName = Server.HtmlEncode(txtFirstName.Text); - user.LastName = Server.HtmlEncode(txtLastName.Text); - user.SubscriberNumber = Server.HtmlEncode(txtSubscriberNumber.Text); + user.FirstName = txtFirstName.Text; + user.LastName = txtLastName.Text; + user.SubscriberNumber = txtSubscriberNumber.Text; user.Email = txtEmail.Text; user.SecondaryEmail = txtSecondaryEmail.Text; user.HtmlMail = ddlMailFormat.SelectedIndex == 1; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/AuditLogControl.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/AuditLogControl.ascx index 2fff1339..ea9cb947 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/AuditLogControl.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/AuditLogControl.ascx @@ -1,5 +1,6 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="AuditLogControl.ascx.cs" Inherits="WebsitePanel.Portal.UserControls.AuditLogControl" %> <%@ Register Src="PopupHeader.ascx" TagName="PopupHeader" TagPrefix="wsp" %> +<%@ Import Namespace="WebsitePanel.Portal" %> @@ -136,10 +137,10 @@ - + - <%# Eval("ItemName")%> + <%# PortalAntiXSS.Encode((string)Eval("ItemName"))%> diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/AuditLogControl.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/AuditLogControl.ascx.cs index e1f11697..7216e7fa 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/AuditLogControl.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/AuditLogControl.ascx.cs @@ -32,7 +32,7 @@ using System.Text; using System.Web.UI.WebControls; using System.Xml; using WebsitePanel.EnterpriseServer; -using Microsoft.Security.Application; +using WebsitePanel.Portal; namespace WebsitePanel.Portal.UserControls { @@ -185,9 +185,9 @@ namespace WebsitePanel.Portal.UserControls GetAuditLogSourceName((string)dr["SourceName"])); // Task sb.AppendFormat("\"{0}\",", - Microsoft.Security.Application.Encoder.HtmlEncode(GetAuditLogTaskName((string)dr["SourceName"], (string)dr["TaskName"]))); + PortalAntiXSS.Encode(GetAuditLogTaskName((string)dr["SourceName"], (string)dr["TaskName"]))); // Item-Name - sb.AppendFormat("\"{0}\",", Microsoft.Security.Application.Encoder.HtmlEncode(dr["ItemName"].ToString())); + sb.AppendFormat("\"{0}\",", PortalAntiXSS.Encode(dr["ItemName"].ToString())); // Execution-Log string executionLog = FormatPlainTextExecutionLog( dr["ExecutionLog"].ToString(), DateTime.Parse(dr["StartDate"].ToString())); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/AuditLogControl.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/AuditLogControl.ascx.designer.cs index ac60f77e..789eb48e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/AuditLogControl.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/AuditLogControl.ascx.designer.cs @@ -1,10 +1,37 @@ -//------------------------------------------------------------------------------ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +//------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.3053 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/EditItemComments.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/EditItemComments.ascx.cs index a4599c63..4fa5a9ee 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/EditItemComments.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/EditItemComments.ascx.cs @@ -103,7 +103,7 @@ namespace WebsitePanel.Portal try { - int result = ES.Services.Comments.AddComment(ItemTypeId, ItemId, Server.HtmlEncode(txtComments.Text), 2); + int result = ES.Services.Comments.AddComment(ItemTypeId, ItemId, txtComments.Text, 2); if (result < 0) { HostModule.ShowResultMessage(result); @@ -125,7 +125,7 @@ namespace WebsitePanel.Portal public string WrapComment(string text) { - return (text != null) ? text.Replace("\n", "
") : text; + return (text != null) ? PortalAntiXSS.EncodeOld(text.Replace("\n", "
")) : text; } protected void gvComments_RowDeleting(object sender, GridViewDeleteEventArgs e) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/MessageBox.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/MessageBox.ascx.cs index a3ff3ac2..923b07e9 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/MessageBox.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/MessageBox.ascx.cs @@ -39,7 +39,6 @@ using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using System.Web.Services.Protocols; -using Microsoft.Security.Application; namespace WebsitePanel.Portal { @@ -81,7 +80,7 @@ namespace WebsitePanel.Portal try { // technical details - litPageUrl.Text = Microsoft.Security.Application.Encoder.HtmlEncode(Request.Url.ToString()); + litPageUrl.Text = PortalAntiXSS.Encode(Request.Url.ToString()); litLoggedUser.Text = PanelSecurity.LoggedUser.Username; litSelectedUser.Text = PanelSecurity.SelectedUser.Username; litPackageName.Text = PanelSecurity.PackageId.ToString(); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/PasswordControl.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/PasswordControl.ascx.cs index 378718dd..b61b2e70 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/PasswordControl.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/PasswordControl.ascx.cs @@ -41,7 +41,6 @@ using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using WebsitePanel.EnterpriseServer; -using Microsoft.Security.Application; namespace WebsitePanel.Portal { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/UsernameControl.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/UsernameControl.ascx.cs index d7c51f25..b3259708 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/UsernameControl.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/UsernameControl.ascx.cs @@ -30,7 +30,6 @@ using System; using System.Text; using System.Web.UI.WebControls; using WebsitePanel.EnterpriseServer; -using Microsoft.Security.Application; namespace WebsitePanel.Portal { @@ -71,7 +70,7 @@ namespace WebsitePanel.Portal public string Text { get { return EditMode ? txtName.Text.Trim() : litPrefix.Text + txtName.Text.Trim() + litSuffix.Text; } - set { txtName.Text = value; lblName.Text = Microsoft.Security.Application.Encoder.HtmlEncode(value); } + set { txtName.Text = value; lblName.Text = PortalAntiXSS.Encode(value); } } private UserInfo PolicyUser diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx.cs index 85aad4b9..38026cac 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx.cs @@ -29,7 +29,6 @@ using System; using System.Web.UI.WebControls; using WebsitePanel.EnterpriseServer; -using Microsoft.Security.Application; namespace WebsitePanel.Portal { @@ -136,7 +135,7 @@ namespace WebsitePanel.Portal if (result.Result < 0) { ShowResultMessage(result.Result); - lblMessage.Text = Microsoft.Security.Application.Encoder.HtmlEncode(GetExceedingQuotasMessage(result.ExceedingQuotas)); + lblMessage.Text = PortalAntiXSS.Encode(GetExceedingQuotasMessage(result.ExceedingQuotas)); return; } else diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCustomers.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCustomers.ascx index e3b1cb3d..de1241dc 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCustomers.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCustomers.ascx @@ -63,7 +63,7 @@
- + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCustomersSummary.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCustomersSummary.ascx.cs index c545be87..95f1afe8 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCustomersSummary.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCustomersSummary.ascx.cs @@ -30,7 +30,6 @@ using System; using System.Data; using System.Web.UI; using WebsitePanel.EnterpriseServer; -using Microsoft.Security.Application; namespace WebsitePanel.Portal { @@ -52,7 +51,7 @@ namespace WebsitePanel.Portal DataSet dsUsers = ES.Services.Users.GetUsersSummary(PanelSecurity.SelectedUserId); // all customers - lnkAllCustomers.Text = Microsoft.Security.Application.Encoder.HtmlEncode(String.Format(GetLocalizedString("AllCustomers.Text"), + lnkAllCustomers.Text = PortalAntiXSS.Encode(String.Format(GetLocalizedString("AllCustomers.Text"), dsUsers.Tables[0].Rows[0]["UsersNumber"])); // by status diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserSpaces.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserSpaces.ascx index cea44934..32be20c8 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserSpaces.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserSpaces.ascx @@ -2,6 +2,7 @@ <%@ Import Namespace="WebsitePanel.Portal" %> <%@ Register Src="UserControls/ServerDetails.ascx" TagName="ServerDetails" TagPrefix="uc3" %> <%@ Register Src="UserControls/Comments.ascx" TagName="Comments" TagPrefix="uc4" %> +<%@ Import Namespace="WebsitePanel.Portal" %> @@ -62,7 +63,7 @@ - <%# Eval("PackageName") %> + <%# PortalAntiXSS.EncodeOld((string) Eval("PackageName")) %>
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserSpaces.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserSpaces.ascx.designer.cs index 72f123f2..b00d223f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserSpaces.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserSpaces.ascx.designer.cs @@ -1,10 +1,37 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.3074 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/RemoteDesktop/Connect.aspx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/RemoteDesktop/Connect.aspx.cs index d0f660cb..351ea63d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/RemoteDesktop/Connect.aspx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/RemoteDesktop/Connect.aspx.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2012, Outercurve Foundation. +// Copyright (c) 2012, Outercurve Foundation. // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, @@ -29,7 +29,6 @@ using System; using WebsitePanel.Providers.Virtualization; using WebsitePanel.EnterpriseServer; -using Microsoft.Security.Application; namespace WebsitePanel.Portal.VPS.RemoteDesktop { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/VdcCreateServer.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/VdcCreateServer.ascx.cs index 7ef86290..a39b27d8 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/VdcCreateServer.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/VdcCreateServer.ascx.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2012, Outercurve Foundation. +// Copyright (c) 2012, Outercurve Foundation. // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, @@ -35,7 +35,6 @@ using WebsitePanel.EnterpriseServer; using WebsitePanel.Providers.Virtualization; using WebsitePanel.Providers.Common; using WebsitePanel.Providers.ResultObjects; -using Microsoft.Security.Application; namespace WebsitePanel.Portal.VPS { @@ -239,17 +238,17 @@ namespace WebsitePanel.Portal.VPS private void BindSummary() { // general - litHostname.Text = Microsoft.Security.Application.Encoder.HtmlEncode(String.Format("{0}.{1}", txtHostname.Text.Trim(), txtDomain.Text.Trim())); + litHostname.Text = PortalAntiXSS.Encode(String.Format("{0}.{1}", txtHostname.Text.Trim(), txtDomain.Text.Trim())); litOperatingSystem.Text = listOperatingSystems.SelectedItem.Text; - litSummaryEmail.Text = Microsoft.Security.Application.Encoder.HtmlEncode(txtSummaryEmail.Text.Trim()); + litSummaryEmail.Text = PortalAntiXSS.Encode(txtSummaryEmail.Text.Trim()); SummSummaryEmailRow.Visible = chkSendSummary.Checked; // config - litCpu.Text = Microsoft.Security.Application.Encoder.HtmlEncode(ddlCpu.SelectedValue); - litRam.Text = Microsoft.Security.Application.Encoder.HtmlEncode(txtRam.Text.Trim()); - litHdd.Text = Microsoft.Security.Application.Encoder.HtmlEncode(txtHdd.Text.Trim()); - litSnapshots.Text = Microsoft.Security.Application.Encoder.HtmlEncode(txtSnapshots.Text.Trim()); + litCpu.Text = PortalAntiXSS.Encode(ddlCpu.SelectedValue); + litRam.Text = PortalAntiXSS.Encode(txtRam.Text.Trim()); + litHdd.Text = PortalAntiXSS.Encode(txtHdd.Text.Trim()); + litSnapshots.Text = PortalAntiXSS.Encode(txtSnapshots.Text.Trim()); optionDvdInstalled.Value = chkDvdInstalled.Checked; optionBootFromCd.Value = chkBootFromCd.Checked; optionNumLock.Value = chkNumLock.Checked; @@ -262,23 +261,23 @@ namespace WebsitePanel.Portal.VPS // external network optionExternalNetwork.Value = chkExternalNetworkEnabled.Checked; SummExternalAddressesNumberRow.Visible = radioExternalRandom.Checked && chkExternalNetworkEnabled.Checked; - litExternalAddressesNumber.Text = Microsoft.Security.Application.Encoder.HtmlEncode(txtExternalAddressesNumber.Text.Trim()); + litExternalAddressesNumber.Text = PortalAntiXSS.Encode(txtExternalAddressesNumber.Text.Trim()); SummExternalAddressesListRow.Visible = radioExternalSelected.Checked && chkExternalNetworkEnabled.Checked; List ipAddresses = new List(); foreach (ListItem li in listExternalAddresses.Items) if (li.Selected) ipAddresses.Add(li.Text); - litExternalAddresses.Text = Microsoft.Security.Application.Encoder.HtmlEncode(String.Join(", ", ipAddresses.ToArray())); + litExternalAddresses.Text = PortalAntiXSS.Encode(String.Join(", ", ipAddresses.ToArray())); // private network optionPrivateNetwork.Value = chkPrivateNetworkEnabled.Checked; SummPrivateAddressesNumberRow.Visible = radioPrivateRandom.Checked && chkPrivateNetworkEnabled.Checked && (ViewState["DHCP"] == null); - litPrivateAddressesNumber.Text = Microsoft.Security.Application.Encoder.HtmlEncode(txtPrivateAddressesNumber.Text.Trim()); + litPrivateAddressesNumber.Text = PortalAntiXSS.Encode(txtPrivateAddressesNumber.Text.Trim()); SummPrivateAddressesListRow.Visible = radioPrivateSelected.Checked && chkPrivateNetworkEnabled.Checked && (ViewState["DHCP"] == null); string[] privIps = Utils.ParseDelimitedString(txtPrivateAddressesList.Text, '\n', '\r', ' ', '\t'); - litPrivateAddressesList.Text = Microsoft.Security.Application.Encoder.HtmlEncode(String.Join(", ", privIps)); + litPrivateAddressesList.Text = PortalAntiXSS.Encode(String.Join(", ", privIps)); } protected void wizard_FinishButtonClick(object sender, WizardNavigationEventArgs e) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPSForPC/RemoteDesktop/Connect.aspx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPSForPC/RemoteDesktop/Connect.aspx.cs index 6dfa1150..efa20f47 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPSForPC/RemoteDesktop/Connect.aspx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPSForPC/RemoteDesktop/Connect.aspx.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2012, Outercurve Foundation. +// Copyright (c) 2012, Outercurve Foundation. // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, @@ -29,7 +29,6 @@ using System; using WebsitePanel.Providers.Virtualization; using WebsitePanel.EnterpriseServer; -using Microsoft.Security.Application; namespace WebsitePanel.Portal.VPSForPC.RemoteDesktop { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPSForPC/VdcCreateServer.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPSForPC/VdcCreateServer.ascx.cs index 3d76e977..913848c6 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPSForPC/VdcCreateServer.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPSForPC/VdcCreateServer.ascx.cs @@ -35,7 +35,6 @@ using WebsitePanel.EnterpriseServer; using WebsitePanel.Providers.Virtualization; using WebsitePanel.Providers.Common; using WebsitePanel.Providers.ResultObjects; -using Microsoft.Security.Application; using System.Resources; namespace WebsitePanel.Portal.VPSForPC @@ -264,17 +263,17 @@ namespace WebsitePanel.Portal.VPSForPC { // general litHostname.Text = txtVmName.Text.Trim(); - // litHostname.Text = Microsoft.Security.Application.Encoder.HtmlEncode(String.Format("{0}.{1}", txtHostname.Text.Trim(), txtDomain.Text.Trim())); + // litHostname.Text = PortalAntiXSS.Decode(String.Format("{0}.{1}", txtHostname.Text.Trim(), txtDomain.Text.Trim())); litOperatingSystem.Text = listOperatingSystems.SelectedItem.Text; - litSummaryEmail.Text = Microsoft.Security.Application.Encoder.HtmlEncode(txtSummaryEmail.Text.Trim()); + litSummaryEmail.Text = PortalAntiXSS.Encode(txtSummaryEmail.Text.Trim()); SummSummaryEmailRow.Visible = chkSendSummary.Checked; // config - litCpu.Text = Microsoft.Security.Application.Encoder.HtmlEncode(ddlCpu.SelectedValue); - litRam.Text = Microsoft.Security.Application.Encoder.HtmlEncode(txtRam.Text.Trim()); - litHdd.Text = Microsoft.Security.Application.Encoder.HtmlEncode(txtHdd.Text.Trim()); - //litSnapshots.Text = Microsoft.Security.Application.Encoder.HtmlEncode(txtSnapshots.Text.Trim()); + litCpu.Text = PortalAntiXSS.Encode(ddlCpu.SelectedValue); + litRam.Text = PortalAntiXSS.Encode(txtRam.Text.Trim()); + litHdd.Text = PortalAntiXSS.Encode(txtHdd.Text.Trim()); + //litSnapshots.Text = PortalAntiXSS.Decode(txtSnapshots.Text.Trim()); //optionDvdInstalled.Value = chkDvdInstalled.Checked; //optionBootFromCd.Value = chkBootFromCd.Checked; //optionNumLock.Value = chkNumLock.Checked; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VirtualServers.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VirtualServers.ascx index 77f6ddc5..743b2282 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VirtualServers.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VirtualServers.ascx @@ -1,4 +1,5 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VirtualServers.ascx.cs" Inherits="WebsitePanel.Portal.VirtualServers" %> +<%@ Import Namespace="WebsitePanel.Portal" %>
@@ -11,13 +12,13 @@
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VirtualServers.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VirtualServers.ascx.designer.cs index 61b06bdb..19bbca8d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VirtualServers.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VirtualServers.ascx.designer.cs @@ -1,19 +1,79 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.42 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace WebsitePanel.Portal { + public partial class VirtualServers { - protected System.Web.UI.WebControls.Button btnAddItem; - protected System.Web.UI.WebControls.DataList dlServers; - protected System.Web.UI.HtmlControls.HtmlTable tblEmptyList; - protected System.Web.UI.WebControls.Label lblEmptyList; + + /// + /// btnAddItem control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnAddItem; + + /// + /// dlServers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DataList dlServers; + + /// + /// tblEmptyList control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTable tblEmptyList; + + /// + /// lblEmptyList control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblEmptyList; } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VirtualServersAddServer.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VirtualServersAddServer.ascx.cs index 41bee131..6644094d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VirtualServersAddServer.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VirtualServersAddServer.ascx.cs @@ -54,8 +54,8 @@ namespace WebsitePanel.Portal return; ServerInfo server = new ServerInfo(); - server.ServerName = Server.HtmlEncode(txtName.Text.Trim()); - server.Comments = Server.HtmlEncode(txtComments.Text); + server.ServerName = txtName.Text.Trim(); + server.Comments = txtComments.Text; server.VirtualServer = true; int serverId = 0; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VirtualServersEditServer.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VirtualServersEditServer.ascx.cs index 7a8788bb..333bbc9a 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VirtualServersEditServer.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VirtualServersEditServer.ascx.cs @@ -75,8 +75,8 @@ namespace WebsitePanel.Portal RedirectToBrowsePage(); // header - txtName.Text = Server.HtmlDecode(server.ServerName); - txtComments.Text = Server.HtmlDecode(server.Comments); + txtName.Text = PortalAntiXSS.DecodeOld(server.ServerName); + txtComments.Text = PortalAntiXSS.DecodeOld(server.Comments); Utils.SelectListItem(ddlPrimaryGroup, server.PrimaryGroupId); @@ -175,8 +175,8 @@ namespace WebsitePanel.Portal // header server.ServerId = PanelRequest.ServerId; - server.ServerName = Server.HtmlEncode(txtName.Text); - server.Comments = Server.HtmlEncode(txtComments.Text); + server.ServerName = txtName.Text; + server.Comments = txtComments.Text; server.PrimaryGroupId = Utils.ParseInt(ddlPrimaryGroup.SelectedValue, 0); // instant alias diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/WebsitePanel.WebPortal.csproj b/WebsitePanel/Sources/WebsitePanel.WebPortal/WebsitePanel.WebPortal.csproj index cb1aa317..c93b1a73 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/WebsitePanel.WebPortal.csproj +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/WebsitePanel.WebPortal.csproj @@ -172,6 +172,7 @@ +
- <%# Eval("ServerName") %> + <%# PortalAntiXSS.EncodeOld((string)Eval("ServerName")) %>
- <%# Eval("Comments") %> + <%# PortalAntiXSS.EncodeOld((string)Eval("Comments")) %>