From ec13a31c5cd7e03c31c1f95fd3de3f06aa20f968 Mon Sep 17 00:00:00 2001 From: me Date: Wed, 18 Feb 2015 16:16:24 +0400 Subject: [PATCH 1/4] fix Actions List --- .../UserControls/SpaceServiceItems.ascx.cs | 14 ++++++++------ .../DesktopModules/WebsitePanel/WebSites.ascx | 3 +-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SpaceServiceItems.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SpaceServiceItems.ascx.cs index a95ef8a9..36b6e71f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SpaceServiceItems.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SpaceServiceItems.ascx.cs @@ -91,12 +91,6 @@ namespace WebsitePanel.Portal.UserControls set { EnsureChildControls(); QuotasPanel.Visible = value; } } - public bool ShowActions - { - get { EnsureChildControls(); return QuotasPanel.Visible; } - set { EnsureChildControls(); websiteActions.Visible = value; } - } - protected void Page_Load(object sender, EventArgs e) { //HideServiceColumns(gvWebSites); @@ -119,6 +113,14 @@ namespace WebsitePanel.Portal.UserControls (PanelSecurity.SelectedUser.Role != UserRole.User) && chkRecursive.Checked; gvItems.Columns[5].Visible = (PanelSecurity.SelectedUser.Role == UserRole.Administrator); gvItems.Columns[6].Visible = (PanelSecurity.EffectiveUser.Role == UserRole.Administrator); + if (QuotaName == "Web.Sites") + { + websiteActions.Visible = true; + } + else + { + websiteActions.Visible = false; + } if (!IsPostBack) { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSites.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSites.ascx index 2da7d722..517cd7cc 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSites.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSites.ascx @@ -9,5 +9,4 @@ CreateControlID="add_site" GroupName="Web" TypeName="WebsitePanel.Providers.Web.WebSite, WebsitePanel.Providers.Base" - QuotaName="Web.Sites" - ShowActions = "True" /> \ No newline at end of file + QuotaName="Web.Sites" /> \ No newline at end of file From 4c92928e4c4ce6b8d93f1aa81101c1eba21d89be Mon Sep 17 00:00:00 2001 From: me Date: Wed, 18 Feb 2015 22:21:51 +0400 Subject: [PATCH 2/4] spelling fix --- .../WebsitePanel/UserControls/DomainActions.ascx | 4 ++-- .../DesktopModules/WebsitePanel/UserControls/UserActions.ascx | 4 ++-- .../WebsitePanel/UserControls/WebsiteActions.ascx | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/DomainActions.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/DomainActions.ascx index 8e4d30a6..e29e4367 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/DomainActions.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/DomainActions.ascx @@ -1,7 +1,7 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DomainActions.ascx.cs" Inherits="WebsitePanel.Portal.DomainActions" %> + + + + + Actions + Disable + Enable + + + + + + + + + + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/MailAccountActions.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/MailAccountActions.ascx.cs new file mode 100644 index 00000000..a8cef98f --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/MailAccountActions.ascx.cs @@ -0,0 +1,109 @@ +// Copyright (c) 2015, 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.Data; +using System.Configuration; +using System.Collections; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; +using Microsoft.Web.Services3.Referral; +using WebsitePanel.EnterpriseServer; +using WebsitePanel.EnterpriseServer.Base.HostedSolution; +using WebsitePanel.Portal.UserControls; +using WebsitePanel.Providers; +using WebsitePanel.Providers.HostedSolution; + +namespace WebsitePanel.Portal +{ + public enum MailAccountActionTypes + { + None = 0, + Disable = 1, + Enable = 2, + } + + public partial class MailAccountActions : ActionListControlBase + { + protected void Page_Load(object sender, EventArgs e) + { + + } + + protected override DropDownList ActionsList + { + get { return ddlMailAccountActions; } + } + + protected override int DoAction(List ids) + { + switch (SelectedAction) + { + case MailAccountActionTypes.Disable: + return ChangeMailAccountState(false, ids); + case MailAccountActionTypes.Enable: + return ChangeMailAccountState(true, ids); + } + + return 0; + } + + protected void btnApply_Click(object sender, EventArgs e) + { + switch (SelectedAction) + { + case MailAccountActionTypes.Disable: + case MailAccountActionTypes.Enable: + FireExecuteAction(); + break; + } + } + + private int ChangeMailAccountState(bool enable, List ids) + { + foreach (var id in ids) + { + var mailAccount = ES.Services.MailServers.GetMailAccount(id); + mailAccount.Enabled = enable; + int result = ES.Services.MailServers.UpdateMailAccount(mailAccount); + + if (result < 0) + return result; + } + + return 0; + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/MailAccountActions.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/MailAccountActions.ascx.designer.cs new file mode 100644 index 00000000..3c010fb4 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/MailAccountActions.ascx.designer.cs @@ -0,0 +1,42 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal { + + + public partial class MailAccountActions { + + /// + /// tblActions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UpdatePanel tblActions; + + /// + /// ddlMailAccountActions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlMailAccountActions; + + /// + /// btnApply control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnApply; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SpaceServiceItems.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SpaceServiceItems.ascx index 939b7ce1..9eb453b3 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SpaceServiceItems.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SpaceServiceItems.ascx @@ -3,6 +3,7 @@ <%@ Register Src="ServerDetails.ascx" TagName="ServerDetails" TagPrefix="wsp" %> <%@ Register Src="SearchBox.ascx" TagName="SearchBox" TagPrefix="wsp" %> <%@ Register Src="WebsiteActions.ascx" TagName="WebsiteActions" TagPrefix="wsp" %> +<%@ Register Src="MailAccountActions.ascx" TagName="MailAccountActions" TagPrefix="wsp" %> @@ -21,8 +22,12 @@
+ <%-- Action lists --%>
+ <%-- Web Sites --%> + <%-- Mail Accounts --%> + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SpaceServiceItems.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SpaceServiceItems.ascx.cs index 36b6e71f..c3914eee 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SpaceServiceItems.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SpaceServiceItems.ascx.cs @@ -113,14 +113,8 @@ namespace WebsitePanel.Portal.UserControls (PanelSecurity.SelectedUser.Role != UserRole.User) && chkRecursive.Checked; gvItems.Columns[5].Visible = (PanelSecurity.SelectedUser.Role == UserRole.Administrator); gvItems.Columns[6].Visible = (PanelSecurity.EffectiveUser.Role == UserRole.Administrator); - if (QuotaName == "Web.Sites") - { - websiteActions.Visible = true; - } - else - { - websiteActions.Visible = false; - } + + ShowActionList(); if (!IsPostBack) { @@ -215,5 +209,23 @@ namespace WebsitePanel.Portal.UserControls lnkView.Text = localizedLinkText != null ? localizedLinkText : ViewLinkText; } + private void ShowActionList() + { + websiteActions.Visible = false; + mailActions.Visible = false; + + switch (QuotaName) + { + case "Web.Sites": + websiteActions.Visible = true; + break; + case "Mail.Accounts": + ProviderInfo provider = ES.Services.Servers.GetPackageServiceProvider(PanelSecurity.PackageId, "Mail"); + if (provider.EditorControl == "SmarterMail100") + mailActions.Visible = true; + break; + } + } + } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SpaceServiceItems.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SpaceServiceItems.ascx.designer.cs index 5dfd3221..a7593d19 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SpaceServiceItems.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SpaceServiceItems.ascx.designer.cs @@ -39,6 +39,15 @@ namespace WebsitePanel.Portal.UserControls { /// protected global::WebsitePanel.Portal.WebsiteActions websiteActions; + /// + /// mailActions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.MailAccountActions mailActions; + /// /// searchBox control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj index c47ed2bd..e5fa35b0 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj @@ -229,6 +229,69 @@ OrganizationDeletedUserGeneralSettings.ascx ASPXCodeBehind + + SmarterMail100_EditAccount.ascx + ASPXCodeBehind + + + SmarterMail100_EditAccount.ascx + + + SmarterMail100_EditDomain.ascx + ASPXCodeBehind + + + SmarterMail100_EditDomain.ascx + + + SmarterMail100_EditDomain_Features.ascx + ASPXCodeBehind + + + SmarterMail100_EditDomain_Features.ascx + + + SmarterMail100_EditDomain_Sharing.ascx + ASPXCodeBehind + + + SmarterMail100_EditDomain_Sharing.ascx + + + SmarterMail100_EditDomain_Throttling.ascx + ASPXCodeBehind + + + SmarterMail100_EditDomain_Throttling.ascx + + + SmarterMail100_EditForwarding .ascx + ASPXCodeBehind + + + SmarterMail100_EditForwarding .ascx + + + SmarterMail100_EditGroup.ascx + ASPXCodeBehind + + + SmarterMail100_EditGroup.ascx + + + SmarterMail100_EditList.ascx + ASPXCodeBehind + + + SmarterMail100_EditList.ascx + + + SmarterMail100_Settings.ascx + ASPXCodeBehind + + + SmarterMail100_Settings.ascx + Windows2012_Settings.ascx ASPXCodeBehind @@ -908,6 +971,13 @@ DomainActions.ascx + + MailAccountActions.ascx + ASPXCodeBehind + + + MailAccountActions.ascx + WebsiteActions.ascx ASPXCodeBehind @@ -4386,6 +4456,15 @@ + + + + + + + + + @@ -4393,6 +4472,33 @@ + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + + + Designer + @@ -4507,6 +4613,7 @@ + @@ -4579,6 +4686,7 @@ +