GetSharedSSLDomains(int packageId)
diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/Common/AppPoolState.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Common/AppPoolState.cs
new file mode 100644
index 00000000..efac5567
--- /dev/null
+++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Common/AppPoolState.cs
@@ -0,0 +1,43 @@
+// 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;
+
+namespace WebsitePanel.Providers
+{
+ [Serializable]
+ public enum AppPoolState
+ {
+ Unknown = 0,
+ Starting = 1,
+ Started = 2,
+ Stopping = 3,
+ Stopped = 4,
+ Recycle = 5
+ }
+}
diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/Web/IWebServer.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Web/IWebServer.cs
index 03a8ee48..2f4f31ed 100644
--- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/Web/IWebServer.cs
+++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Web/IWebServer.cs
@@ -54,6 +54,10 @@ namespace WebsitePanel.Providers.Web
void UpdateSiteBindings(string siteId, ServerBinding[] bindings, bool emptyBindingsAllowed);
void DeleteSite(string siteId);
+ // AppPool
+ void ChangeAppPoolState(string siteId, AppPoolState state);
+ AppPoolState GetAppPoolState(string siteId);
+
// virtual directories
bool VirtualDirectoryExists(string siteId, string directoryName);
WebVirtualDirectory[] GetVirtualDirectories(string siteId);
diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj
index dd588836..9b6ebfe7 100644
--- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj
+++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj
@@ -72,6 +72,7 @@
VersionInfo.cs
+
diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs
index 66a0ac7e..0a0ceb6f 100644
--- a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs
+++ b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs
@@ -1524,6 +1524,27 @@ namespace WebsitePanel.Providers.Web
}
}
+ // AppPool
+ public void ChangeAppPoolState(string siteId, AppPoolState state)
+ {
+ webObjectsSvc.ChangeAppPoolState(siteId, state);
+ }
+
+ public AppPoolState GetAppPoolState(string siteId)
+ {
+ using (ServerManager srvman = webObjectsSvc.GetServerManager())
+ {
+ return GetAppPoolState(srvman, siteId);
+ }
+ }
+
+ public AppPoolState GetAppPoolState(ServerManager srvman, string siteId)
+ {
+ return webObjectsSvc.GetAppPoolState(srvman, siteId);
+ }
+
+
+
///
/// Checks whether virtual iisDirObject with supplied name under specified site exists.
///
diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/WebObjects/WebObjectsModuleService.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/WebObjects/WebObjectsModuleService.cs
index 6bd53596..21774080 100644
--- a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/WebObjects/WebObjectsModuleService.cs
+++ b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/WebObjects/WebObjectsModuleService.cs
@@ -348,6 +348,98 @@ namespace WebsitePanel.Providers.Web.Iis.WebObjects
return siteState;
}
+ // AppPool
+ public void ChangeAppPoolState(string siteId, AppPoolState state)
+ {
+ using (var srvman = GetServerManager())
+ {
+ var site = srvman.Sites[siteId];
+ //
+ if (site == null)
+ return;
+
+ foreach (Application app in site.Applications)
+ {
+ string AppPoolName = app.ApplicationPoolName;
+
+ if (string.IsNullOrEmpty(AppPoolName))
+ continue;
+
+ ApplicationPool pool = srvman.ApplicationPools[AppPoolName];
+ if (pool == null) continue;
+
+ //
+ switch (state)
+ {
+ case AppPoolState.Started:
+ case AppPoolState.Starting:
+ if ((pool.State != ObjectState.Started) && (pool.State != ObjectState.Starting))
+ {
+ pool.Start();
+ pool.AutoStart = true;
+ }
+ break;
+ case AppPoolState.Stopped:
+ case AppPoolState.Stopping:
+ if ((pool.State != ObjectState.Stopped) && (pool.State != ObjectState.Stopping))
+ {
+ pool.Stop();
+ pool.AutoStart = false;
+ }
+ break;
+ case AppPoolState.Recycle:
+ pool.Recycle();
+ pool.AutoStart = true;
+ break;
+ }
+
+ srvman.CommitChanges();
+
+ }
+ }
+ }
+
+ public AppPoolState GetAppPoolState(ServerManager srvman, string siteId)
+ {
+ Site site = srvman.Sites[siteId];
+
+ // ensure website exists
+ if (site == null)
+ return AppPoolState.Unknown;
+
+ string AppPoolName = site.ApplicationDefaults.ApplicationPoolName;
+ foreach (Application app in site.Applications)
+ AppPoolName = app.ApplicationPoolName;
+
+ if (string.IsNullOrEmpty(AppPoolName))
+ return AppPoolState.Unknown;
+
+ ApplicationPool pool = srvman.ApplicationPools[AppPoolName];
+
+ if (pool == null) return AppPoolState.Unknown;
+
+ AppPoolState state = AppPoolState.Unknown;
+
+ switch (pool.State)
+ {
+ case ObjectState.Started:
+ state = AppPoolState.Started;
+ break;
+ case ObjectState.Starting:
+ state = AppPoolState.Starting;
+ break;
+ case ObjectState.Stopped:
+ state = AppPoolState.Stopped;
+ break;
+ case ObjectState.Stopping:
+ state = AppPoolState.Stopping;
+ break;
+ }
+
+ return state;
+ }
+
+
public bool SiteExists(ServerManager srvman, string siteId)
{
return (srvman.Sites[siteId] != null);
diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIs60/IIs60.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIs60/IIs60.cs
index c7c4dccc..022627c0 100644
--- a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIs60/IIs60.cs
+++ b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIs60/IIs60.cs
@@ -849,6 +849,16 @@ namespace WebsitePanel.Providers.Web
}
}
+ // AppPool
+ public void ChangeAppPoolState(string siteId, AppPoolState state)
+ {
+ }
+
+ public AppPoolState GetAppPoolState(string siteId)
+ {
+ return AppPoolState.Unknown;
+ }
+
public virtual void UpdateSiteBindings(string siteId, ServerBinding[] bindings, bool emptyBindingsAllowed)
{
ManagementObject objSite = wmi.GetObject(String.Format("IIsWebServerSetting='{0}'", siteId));
diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/WebServerProxy.cs b/WebsitePanel/Sources/WebsitePanel.Server.Client/WebServerProxy.cs
index efa08598..afd6bed4 100644
--- a/WebsitePanel/Sources/WebsitePanel.Server.Client/WebServerProxy.cs
+++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/WebServerProxy.cs
@@ -592,7 +592,28 @@ namespace WebsitePanel.Providers.Web {
this.GetSiteStateCompleted(this, new GetSiteStateCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
+
+ ///
+ [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
+ [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/ChangeAppPoolState", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
+ public void ChangeAppPoolState(string siteId, AppPoolState state)
+ {
+ this.Invoke("ChangeAppPoolState", new object[] {
+ siteId,
+ state});
+ }
+
+ ///
+ [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
+ [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetAppPoolState", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
+ public AppPoolState GetAppPoolState(string siteId)
+ {
+ object[] results = this.Invoke("GetAppPoolState", new object[] {
+ siteId});
+ return ((AppPoolState)(results[0]));
+ }
+
///
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetSiteId", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
diff --git a/WebsitePanel/Sources/WebsitePanel.Server/WebServer.asmx.cs b/WebsitePanel/Sources/WebsitePanel.Server/WebServer.asmx.cs
index 24f75688..f1b2f5ef 100644
--- a/WebsitePanel/Sources/WebsitePanel.Server/WebServer.asmx.cs
+++ b/WebsitePanel/Sources/WebsitePanel.Server/WebServer.asmx.cs
@@ -259,6 +259,41 @@ namespace WebsitePanel.Server
throw;
}
}
+
+ // AppPool
+ [WebMethod, SoapHeader("settings")]
+ public void ChangeAppPoolState(string siteId, AppPoolState state)
+ {
+ try
+ {
+ Log.WriteStart("'{0}' ChangeAppPoolState", ProviderSettings.ProviderName);
+ WebProvider.ChangeAppPoolState(siteId, state);
+ Log.WriteEnd("'{0}' ChangeAppPoolState", ProviderSettings.ProviderName);
+ }
+ catch (Exception ex)
+ {
+ Log.WriteError(String.Format("'{0}' ChangeAppPoolState", ProviderSettings.ProviderName), ex);
+ throw;
+ }
+ }
+
+ [WebMethod, SoapHeader("settings")]
+ public AppPoolState GetAppPoolState(string siteId)
+ {
+ try
+ {
+ Log.WriteStart("'{0}' GetAppPoolState", ProviderSettings.ProviderName);
+ AppPoolState result = WebProvider.GetAppPoolState(siteId);
+ Log.WriteEnd("'{0}' GetAppPoolState", ProviderSettings.ProviderName);
+ return result;
+ }
+ catch (Exception ex)
+ {
+ Log.WriteError(String.Format("'{0}' GetAppPoolState", ProviderSettings.ProviderName), ex);
+ throw;
+ }
+ }
+
#endregion
#region Virtual Directories
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Buttons.skin b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Buttons.skin
index d371a071..516cb229 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Buttons.skin
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Buttons.skin
@@ -31,6 +31,7 @@ Default skin template. The following skins are provided as examples only.
+
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/restart_24.png b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/restart_24.png
new file mode 100644
index 00000000..6e01faab
Binary files /dev/null and b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/restart_24.png differ
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx
index 6f6e8bee..6b8e3074 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx
@@ -166,11 +166,12 @@
+
+
+ |
|
-
-
@@ -182,6 +183,22 @@
CommandName="Stopped" OnClick="cmdChangeState_Click" />
|
+
+
+
+ |
+
+
+ |
+
+
+
+
+ |
+
|
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx.cs
index 41f60173..1ffd70b7 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx.cs
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx.cs
@@ -291,6 +291,9 @@ namespace WebsitePanel.Portal
// bind state
BindSiteState(site.SiteState);
+ // AppPool
+ AppPoolState appPoolState = ES.Services.WebServers.GetAppPoolState(PanelRequest.ItemID);
+ BindAppPoolState(appPoolState);
// bind pointers
BindPointers();
@@ -988,6 +991,42 @@ namespace WebsitePanel.Portal
return;
}
}
+
+ // AppPool
+ private void BindAppPoolState(AppPoolState state)
+ {
+ litAppPoolStatus.Text = GetLocalizedString("SiteState." + state.ToString());
+
+ cmdAppPoolStart.Visible = (state == AppPoolState.Stopped || state == AppPoolState.Stopping);
+ cmdAppPoolStop.Visible = (state == AppPoolState.Started || state == AppPoolState.Starting);
+ cmdAppPoolRecycle.Visible = (state == AppPoolState.Started || state == AppPoolState.Starting);
+ }
+
+
+ protected void cmdAppPoolChangeState_Click(object sender, EventArgs e)
+ {
+ string stateName = ((ImageButton)sender).CommandName;
+ AppPoolState state = (AppPoolState)Enum.Parse(typeof(AppPoolState), stateName, true);
+
+ try
+ {
+ int result = ES.Services.WebServers.ChangeAppPoolState(PanelRequest.ItemID, state);
+ if (result < 0)
+ {
+ ShowResultMessage(result);
+ return;
+ }
+
+ state = ES.Services.WebServers.GetAppPoolState(PanelRequest.ItemID);
+ BindAppPoolState(state);
+ }
+ catch (Exception ex)
+ {
+ ShowErrorMessage("WEB_CHANGE_SITE_STATE", ex);
+ return;
+ }
+ }
+
#endregion
#region Pointers
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx.designer.cs
index 710488b3..8b8fb7dc 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx.designer.cs
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx.designer.cs
@@ -39,7 +39,7 @@ namespace WebsitePanel.Portal {
public partial class WebSitesEditSite {
-
+
///
/// asyncTasks control.
///
@@ -48,7 +48,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
///
protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks;
-
+
///
/// WDeployBuildPublishingProfileWizardPanel control.
///
@@ -57,7 +57,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
///
protected global::System.Web.UI.WebControls.Panel WDeployBuildPublishingProfileWizardPanel;
-
+
///
/// WDeployPubProfilePanel control.
///
@@ -346,6 +346,15 @@ namespace WebsitePanel.Portal {
///
protected global::System.Web.UI.WebControls.GridView gvPointers;
+ ///
+ /// lblWebsiteStatus control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Label lblWebsiteStatus;
+
///
/// litStatus control.
///
@@ -391,6 +400,51 @@ namespace WebsitePanel.Portal {
///
protected global::System.Web.UI.WebControls.ImageButton cmdStop;
+ ///
+ /// lblAppPoolStatus control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Label lblAppPoolStatus;
+
+ ///
+ /// litAppPoolStatus control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Literal litAppPoolStatus;
+
+ ///
+ /// cmdAppPoolStart control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.ImageButton cmdAppPoolStart;
+
+ ///
+ /// cmdAppPoolRecycle control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.ImageButton cmdAppPoolRecycle;
+
+ ///
+ /// cmdAppPoolStop control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.ImageButton cmdAppPoolStop;
+
///
/// dlTabs control.
///