-
+
|
|
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.cs
index 026d6995..ba2707f3 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.cs
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.cs
@@ -271,41 +271,5 @@ namespace WebsitePanel.Portal.ExchangeServer
odsAccountsPaged.SelectParameters["accountTypes"].DefaultValue = string.Join(",", accountTypes);
}
-
- protected void userActions_OnExecutingUserAction(object sender, EventArgs e)
- {
- // Get checked users
- var userIds = Utils.GetCheckboxValuesFromGrid(gvMailboxes, "chkSelectedUsersIds");
-
- if (userActions.SelectedAction != UserActionTypes.None)
- {
- if (userIds.Count > 0)
- {
- try
- {
- var result = userActions.DoUserActions(userIds);
-
- if (result < 0)
- {
- messageBox.ShowResultMessage(result);
- return;
- }
-
- messageBox.ShowSuccessMessage("ORGANIZATION_USERS_ACTIONS");
- }
- catch (Exception ex)
- {
- messageBox.ShowErrorMessage("ORGANIZATION_USERS_ACTIONS", ex);
- }
-
- // Refresh users grid
- gvMailboxes.DataBind();
- }
- else
- {
- messageBox.ShowWarningMessage("ORGANIZATION_USERS_ACTIONS");
- }
- }
- }
}
}
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx
index f3c60beb..b83fb036 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx
@@ -38,7 +38,7 @@
-
+
|
|
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx.cs
index aff68bb0..4b80cb1a 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx.cs
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx.cs
@@ -389,41 +389,5 @@ namespace WebsitePanel.Portal.HostedSolution
}
}
-
- protected void userActions_OnExecutingUserAction(object sender, EventArgs e)
- {
- // Get checked users
- var userIds = Utils.GetCheckboxValuesFromGrid(gvUsers, "chkSelectedUsersIds");
-
- if (userActions.SelectedAction != UserActionTypes.None)
- {
- if (userIds.Count > 0)
- {
- try
- {
- var result = userActions.DoUserActions(userIds);
-
- if (result < 0)
- {
- messageBox.ShowResultMessage(result);
- return;
- }
-
- messageBox.ShowSuccessMessage("ORGANIZATION_USERS_ACTIONS");
- }
- catch (Exception ex)
- {
- messageBox.ShowErrorMessage("ORGANIZATION_USERS_ACTIONS", ex);
- }
-
- // Refresh users grid
- gvUsers.DataBind();
- }
- else
- {
- messageBox.ShowWarningMessage("ORGANIZATION_USERS_ACTIONS");
- }
- }
- }
}
}
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx.designer.cs
index 17643c1b..668d3539 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx.designer.cs
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx.designer.cs
@@ -1,31 +1,3 @@
-// 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.
-
//------------------------------------------------------------------------------
//
// This code was generated by a tool.
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/ActionListControlBase.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/ActionListControlBase.cs
new file mode 100644
index 00000000..09414ad8
--- /dev/null
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/ActionListControlBase.cs
@@ -0,0 +1,144 @@
+// 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.Collections;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Globalization;
+using System.Linq;
+using System.Web.UI.WebControls;
+
+
+namespace WebsitePanel.Portal.UserControls
+{
+ public abstract class ActionListControlBase : WebsitePanelControlBase
+ {
+ public event CancelEventHandler ExecutingAction;
+
+ public event EventHandler ExecutedAction;
+
+ #region Properties
+
+ public string GridViewID { get; set; }
+
+ public string CheckboxesName { get; set; }
+
+ private string _message = "ACTIONS_MESSAGE";
+ public string Message
+ {
+ get { return _message; }
+ set { _message = value; }
+ }
+
+ #endregion
+
+ protected abstract DropDownList ActionsList { get; }
+
+ protected abstract int DoAction(List ids);
+
+ public TEnum SelectedAction
+ {
+ get
+ {
+ return (TEnum)(object)Convert.ToInt32(ActionsList.SelectedValue);
+ }
+ }
+
+ protected GridView GridView
+ {
+ get { return Parent.FindControl(GridViewID) as GridView; }
+ }
+
+ public void ResetSelection()
+ {
+ ActionsList.ClearSelection();
+ }
+ public void RemoveActionItem(TNum value)
+ {
+ ActionsList.Items.Remove(ActionsList.Items.FindByValue(((int)(object)value).ToString()));
+ }
+
+ protected void FireExecuteAction()
+ {
+ if (ExecutingAction != null)
+ {
+ var e = new CancelEventArgs();
+ ExecutingAction(this, e);
+
+ if (e.Cancel)
+ return;
+ }
+
+ DoAction();
+
+ if (ExecutedAction != null)
+ ExecutedAction(this, new EventArgs());
+ }
+
+ protected void DoAction()
+ {
+ if (GridView == null || String.IsNullOrWhiteSpace(CheckboxesName))
+ return;
+
+ // Get checked users
+ var ids = Utils.GetCheckboxValuesFromGrid(GridView, CheckboxesName);
+
+ if ((int)(object)SelectedAction != 0)
+ {
+ if (ids.Count > 0)
+ {
+ try
+ {
+ var result = DoAction(ids);
+
+ if (result < 0)
+ {
+ HostModule.ShowResultMessage(result);
+ return;
+ }
+
+ HostModule.ShowSuccessMessage(Message);
+ }
+ catch (Exception ex)
+ {
+ HostModule.ShowErrorMessage(Message, ex);
+ }
+
+ // Refresh users grid
+ GridView.DataBind();
+ }
+ else
+ {
+ HostModule.ShowWarningMessage(Message);
+ }
+ }
+ }
+
+ }
+}
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/App_LocalResources/DomainActions.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/App_LocalResources/DomainActions.ascx.resx
new file mode 100644
index 00000000..636571fc
--- /dev/null
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/App_LocalResources/DomainActions.ascx.resx
@@ -0,0 +1,138 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Apply
+
+
+ - Actions -
+
+
+ Create Instant Alias
+
+
+ Delete Instant Alias
+
+
+ Disable Dns
+
+
+ Enable Dns
+
+
\ No newline at end of file
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/App_LocalResources/WebsiteActions.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/App_LocalResources/WebsiteActions.ascx.resx
new file mode 100644
index 00000000..1d05ea79
--- /dev/null
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/App_LocalResources/WebsiteActions.ascx.resx
@@ -0,0 +1,135 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Apply
+
+
+ - Actions -
+
+
+ Restart App Pool
+
+
+ Start
+
+
+ Stop
+
+
\ No newline at end of file
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/DomainActions.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/DomainActions.ascx
new file mode 100644
index 00000000..8e4d30a6
--- /dev/null
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/DomainActions.ascx
@@ -0,0 +1,37 @@
+<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DomainActions.ascx.cs" Inherits="WebsitePanel.Portal.DomainActions" %>
+
+
+
+
+
+
+ Actions
+ EnableDns
+ DisableDns
+ CreateInstantAlias
+ DeleteInstantAlias
+
+
+
+
+
+
+
+
+
+
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/DomainActions.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/DomainActions.ascx.cs
new file mode 100644
index 00000000..2b1819dc
--- /dev/null
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/DomainActions.ascx.cs
@@ -0,0 +1,179 @@
+// 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 DomainActionTypes
+ {
+ None = 0,
+ EnableDns = 1,
+ DisableDns = 2,
+ CreateInstantAlias = 3,
+ DeleteInstantAlias = 4,
+ }
+
+ public partial class DomainActions : ActionListControlBase
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ // Remove DNS items if current Hosting plan does not allow it
+ if (!PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId).Groups.ContainsKey(ResourceGroups.Dns))
+ {
+ RemoveActionItem(DomainActionTypes.EnableDns);
+ RemoveActionItem(DomainActionTypes.DisableDns);
+ }
+
+ // Remove Instant Alias items if current Hosting plan does not allow it
+ PackageSettings packageSettings = ES.Services.Packages.GetPackageSettings(PanelSecurity.PackageId, PackageSettings.INSTANT_ALIAS);
+ if (packageSettings == null || String.IsNullOrEmpty(packageSettings["InstantAlias"]))
+ {
+ RemoveActionItem(DomainActionTypes.CreateInstantAlias);
+ RemoveActionItem(DomainActionTypes.DeleteInstantAlias);
+ }
+
+ // hide control if no actions allowed
+ if (ActionsList.Items.Count <= 1)
+ {
+ Visible = false;
+ }
+ }
+
+ protected override DropDownList ActionsList
+ {
+ get { return ddlDomainActions; }
+ }
+
+ protected override int DoAction(List ids)
+ {
+ switch (SelectedAction)
+ {
+ case DomainActionTypes.EnableDns:
+ return EnableDns(true, ids);
+ case DomainActionTypes.DisableDns:
+ return EnableDns(false, ids);
+ case DomainActionTypes.CreateInstantAlias:
+ return CreateInstantAlias(true, ids);
+ case DomainActionTypes.DeleteInstantAlias:
+ return CreateInstantAlias(false, ids);
+ }
+
+ return 0;
+ }
+
+ protected void btnApply_Click(object sender, EventArgs e)
+ {
+ switch (SelectedAction)
+ {
+ case DomainActionTypes.EnableDns:
+ case DomainActionTypes.DisableDns:
+ case DomainActionTypes.CreateInstantAlias:
+ case DomainActionTypes.DeleteInstantAlias:
+ FireExecuteAction();
+ break;
+ }
+ }
+
+ private int EnableDns(bool enable, List ids)
+ {
+ foreach (var id in ids)
+ {
+ // load domain
+ DomainInfo domain = ES.Services.Servers.GetDomain(id);
+ if (domain == null)
+ continue;
+
+ // load package context
+ PackageContext cntx = PackagesHelper.GetCachedPackageContext(domain.PackageId);
+ bool dnsEnabled = cntx.Groups.ContainsKey(ResourceGroups.Dns);
+ if (!dnsEnabled)
+ continue;
+
+ int result;
+
+ if (enable)
+ result = ES.Services.Servers.EnableDomainDns(id);
+ else
+ result = ES.Services.Servers.DisableDomainDns(id);
+
+
+ if (result < 0)
+ return result;
+ }
+
+ return 0;
+ }
+
+ private int CreateInstantAlias(bool enable, List ids)
+ {
+ foreach (var id in ids)
+ {
+ // load domain
+ DomainInfo domain = ES.Services.Servers.GetDomain(id);
+ if (domain == null)
+ continue;
+
+ // instant alias
+ bool instantAliasAllowed = !String.IsNullOrEmpty(domain.InstantAliasName);
+ if (!instantAliasAllowed || domain.IsDomainPointer || domain.IsInstantAlias)
+ continue;
+
+ int result;
+
+ if (enable)
+ result = ES.Services.Servers.CreateDomainInstantAlias("", id);
+ else
+ result = ES.Services.Servers.DeleteDomainInstantAlias(id);
+
+ if (result < 0)
+ return result;
+ }
+
+ return 0;
+ }
+ }
+}
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/DomainActions.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/DomainActions.ascx.designer.cs
new file mode 100644
index 00000000..9dfafc7e
--- /dev/null
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/DomainActions.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 DomainActions {
+
+ ///
+ /// tblActions control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.UpdatePanel tblActions;
+
+ ///
+ /// ddlDomainActions control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.DropDownList ddlDomainActions;
+
+ ///
+ /// 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 5f8ff48f..ec4d44cf 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SpaceServiceItems.ascx
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SpaceServiceItems.ascx
@@ -2,6 +2,16 @@
<%@ Register Src="Quota.ascx" TagName="Quota" TagPrefix="wsp" %>
<%@ Register Src="ServerDetails.ascx" TagName="ServerDetails" TagPrefix="wsp" %>
<%@ Register Src="SearchBox.ascx" TagName="SearchBox" TagPrefix="wsp" %>
+<%@ Register Src="WebsiteActions.ascx" TagName="WebsiteActions" TagPrefix="wsp" %>
+
+
+
+
+
@@ -19,9 +39,17 @@
+
+
+
+
+
+
+
+
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 a98eef00..3a55d3e5 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SpaceServiceItems.ascx.cs
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SpaceServiceItems.ascx.cs
@@ -108,11 +108,11 @@ namespace WebsitePanel.Portal.UserControls
// visibility
chkRecursive.Visible = (PanelSecurity.SelectedUser.Role != UserRole.User);
- gvItems.Columns[1].Visible = !String.IsNullOrEmpty(ViewLinkText);
- gvItems.Columns[2].Visible = gvItems.Columns[3].Visible =
+ gvItems.Columns[2].Visible = !String.IsNullOrEmpty(ViewLinkText);
+ gvItems.Columns[3].Visible = gvItems.Columns[4].Visible =
(PanelSecurity.SelectedUser.Role != UserRole.User) && chkRecursive.Checked;
- gvItems.Columns[4].Visible = (PanelSecurity.SelectedUser.Role == UserRole.Administrator);
- gvItems.Columns[5].Visible = (PanelSecurity.EffectiveUser.Role == UserRole.Administrator);
+ gvItems.Columns[5].Visible = (PanelSecurity.SelectedUser.Role == UserRole.Administrator);
+ gvItems.Columns[6].Visible = (PanelSecurity.EffectiveUser.Role == UserRole.Administrator);
if (!IsPostBack)
{
@@ -206,5 +206,6 @@ namespace WebsitePanel.Portal.UserControls
string localizedLinkText = HostModule.GetLocalizedString(ViewLinkText + ".Text");
lnkView.Text = localizedLinkText != null ? localizedLinkText : ViewLinkText;
}
+
}
}
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 31363f1d..5dfd3221 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
@@ -1,31 +1,3 @@
-// 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.
-
//------------------------------------------------------------------------------
//
// This code was generated by a tool.
@@ -58,6 +30,15 @@ namespace WebsitePanel.Portal.UserControls {
///
protected global::System.Web.UI.WebControls.CheckBox chkRecursive;
+ ///
+ /// websiteActions control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::WebsitePanel.Portal.WebsiteActions websiteActions;
+
///
/// searchBox control.
///
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/UserActions.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/UserActions.ascx.cs
index b202ca35..8525040c 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/UserActions.ascx.cs
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/UserActions.ascx.cs
@@ -42,6 +42,7 @@ 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.HostedSolution;
namespace WebsitePanel.Portal
@@ -57,40 +58,30 @@ namespace WebsitePanel.Portal
SetMailboxPlan = 6
}
- public partial class UserActions : WebsitePanelControlBase
+ public partial class UserActions : ActionListControlBase
{
- public event EventHandler ExecutingUserAction;
-
- private bool showSetMailboxPlan = false;
- public bool ShowSetMailboxPlan
- {
- get { return showSetMailboxPlan; }
- set { showSetMailboxPlan = value; }
- }
+ public bool ShowSetMailboxPlan { get; set; }
protected void Page_Load(object sender, EventArgs e)
{
// Remove Service Level item and VIP item from Action List if current Hosting plan does not allow Service Levels
if (!PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId).Groups.ContainsKey(ResourceGroups.ServiceLevels))
{
- ddlUserActions.Items.Remove(ddlUserActions.Items.FindByValue(((int)UserActionTypes.SetServiceLevel).ToString()));
- ddlUserActions.Items.Remove(ddlUserActions.Items.FindByValue(((int)UserActionTypes.SetVIP).ToString()));
- ddlUserActions.Items.Remove(ddlUserActions.Items.FindByValue(((int)UserActionTypes.UnsetVIP).ToString()));
+ RemoveActionItem(UserActionTypes.SetServiceLevel);
+ RemoveActionItem(UserActionTypes.SetVIP);
+ RemoveActionItem(UserActionTypes.UnsetVIP);
}
if (!ShowSetMailboxPlan)
- ddlUserActions.Items.Remove(ddlUserActions.Items.FindByValue(((int)UserActionTypes.SetMailboxPlan).ToString()));
+ RemoveActionItem(UserActionTypes.SetMailboxPlan);
}
- public UserActionTypes SelectedAction
+ protected override DropDownList ActionsList
{
- get
- {
- return (UserActionTypes)Convert.ToInt32(ddlUserActions.SelectedValue);
- }
+ get { return ddlUserActions; }
}
- public int DoUserActions(List userIds)
+ protected override int DoAction(List userIds)
{
switch (SelectedAction)
{
@@ -111,15 +102,9 @@ namespace WebsitePanel.Portal
return 0;
}
- protected void DoExecutingUserAction()
- {
- if (ExecutingUserAction != null)
- ExecutingUserAction(this, new EventArgs());
- }
-
protected void btnModalOk_Click(object sender, EventArgs e)
{
- DoExecutingUserAction();
+ FireExecuteAction();
}
protected void btnModalCancel_OnClick(object sender, EventArgs e)
@@ -127,11 +112,6 @@ namespace WebsitePanel.Portal
ResetSelection();
}
- public void ResetSelection()
- {
- ddlUserActions.ClearSelection();
- }
-
protected int ChangeUsersSettings(List userIds, bool? disable, int? serviceLevelId, bool? isVIP)
{
foreach (var userId in userIds)
@@ -270,7 +250,7 @@ namespace WebsitePanel.Portal
case UserActionTypes.Enable:
case UserActionTypes.SetVIP:
case UserActionTypes.UnsetVIP:
- DoExecutingUserAction();
+ FireExecuteAction();
break;
case UserActionTypes.SetServiceLevel:
FillServiceLevelsList();
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/WebsiteActions.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/WebsiteActions.ascx
new file mode 100644
index 00000000..4c1aa7cf
--- /dev/null
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/WebsiteActions.ascx
@@ -0,0 +1,34 @@
+<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WebsiteActions.ascx.cs" Inherits="WebsitePanel.Portal.WebsiteActions" %>
+
+
+
+
+
+
+ Actions
+ Stop
+ Start
+ RestartAppPool
+
+
+
+
+
+
+
+
+
+
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/WebsiteActions.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/WebsiteActions.ascx.cs
new file mode 100644
index 00000000..2229ae83
--- /dev/null
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/WebsiteActions.ascx.cs
@@ -0,0 +1,125 @@
+// 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 WebsiteActionTypes
+ {
+ None = 0,
+ Stop = 1,
+ Start = 2,
+ RestartAppPool = 3,
+ }
+
+ public partial class WebsiteActions : ActionListControlBase
+ {
+ protected void Page_Load(object sender, EventArgs e)
+ {
+
+ }
+
+ protected override DropDownList ActionsList
+ {
+ get { return ddlWebsiteActions; }
+ }
+
+ protected override int DoAction(List ids)
+ {
+ switch (SelectedAction)
+ {
+ case WebsiteActionTypes.Stop:
+ return ChangeWebsiteState(false, ids);
+ case WebsiteActionTypes.Start:
+ return ChangeWebsiteState(true, ids);
+ case WebsiteActionTypes.RestartAppPool:
+ return RestartAppPool(ids);
+ }
+
+ return 0;
+ }
+
+ protected void btnApply_Click(object sender, EventArgs e)
+ {
+ switch (SelectedAction)
+ {
+ case WebsiteActionTypes.Stop:
+ case WebsiteActionTypes.Start:
+ case WebsiteActionTypes.RestartAppPool:
+ FireExecuteAction();
+ break;
+ }
+ }
+
+ private int ChangeWebsiteState(bool enable, List ids)
+ {
+ foreach (var id in ids)
+ {
+ var state = enable ? ServerState.Started : ServerState.Paused;
+ int result = ES.Services.WebServers.ChangeSiteState(id, state);
+
+ if (result < 0)
+ return result;
+ }
+
+ return 0;
+ }
+
+ private int RestartAppPool(List ids)
+ {
+ foreach (var id in ids)
+ {
+ int result = ES.Services.WebServers.ChangeAppPoolState(id, AppPoolState.Recycle);
+
+ if (result < 0)
+ return result;
+ }
+
+ return 0;
+ }
+ }
+}
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/WebsiteActions.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/WebsiteActions.ascx.designer.cs
new file mode 100644
index 00000000..10d598a0
--- /dev/null
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/WebsiteActions.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 WebsiteActions {
+
+ ///
+ /// tblActions control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.UpdatePanel tblActions;
+
+ ///
+ /// ddlWebsiteActions control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.DropDownList ddlWebsiteActions;
+
+ ///
+ /// 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/WebsitePanel.Portal.Modules.csproj b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj
index eee8579f..ba34a5f0 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj
@@ -843,6 +843,9 @@
DomainControl.ascx
+
+ ASPXCodeBehind
+
ASPXCodeBehind
@@ -891,6 +894,20 @@
ItemButtonPanel.ascx
+
+ DomainActions.ascx
+ ASPXCodeBehind
+
+
+ DomainActions.ascx
+
+
+ WebsiteActions.ascx
+ ASPXCodeBehind
+
+
+ WebsiteActions.ascx
+
UserActions.ascx
ASPXCodeBehind
@@ -4480,6 +4497,8 @@
+
+
@@ -4550,6 +4569,8 @@
+
+
| |