From aa82ae02ab9d79dbd87a4a2a2e5f9eb997902644 Mon Sep 17 00:00:00 2001 From: ruslanht Date: Mon, 17 Dec 2012 15:43:39 +0200 Subject: [PATCH 01/26] Checking Ape installed fix --- .../WebsitePanel.Providers.Web.IIS70/IIs70.cs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs index 7aed795b..0a184b1c 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs @@ -101,7 +101,7 @@ namespace WebsitePanel.Providers.Web public const string DOTNETPANEL_IISMODULES = "DotNetPanel.IIsModules"; - public const string HeliconApeModule = "Helicon Ape"; + public const string HeliconApeModule = "Helicon.Ape"; public const string HeliconApeHandlerPath = "*.apehandler"; public const string IsapiModule = "IsapiModule"; @@ -1986,7 +1986,13 @@ namespace WebsitePanel.Providers.Web private string GetHeliconApeInstallDir(string siteId) { //Check global registration - return Registry.GetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Helicon\\Ape", "InstallDir", string.Empty) as string; + string installDir = Registry.GetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Helicon\\Ape", "InstallDir", string.Empty) as string; + if (string.Empty == installDir) + { + installDir = Registry.GetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Helicon\\Ape", "InstallDir", string.Empty) as string; + } + + return installDir; } private bool IsHeliconApeInstalled(ServerManager srvman, string siteId, string installDir) @@ -2013,7 +2019,13 @@ namespace WebsitePanel.Providers.Web if (string.IsNullOrEmpty(installDir)) return HELICON_APE_NOT_REGISTERED; - return System.Diagnostics.FileVersionInfo.GetVersionInfo(Path.Combine(installDir, "Helicon.Ape.Editor.dll")).FileVersion; + string apeModulePath = Path.Combine(installDir, "bin\\Helicon.Ape.dll"); + if (File.Exists(apeModulePath)) + { + return System.Diagnostics.FileVersionInfo.GetVersionInfo(apeModulePath).FileVersion; + } + + return HELICON_APE_NOT_REGISTERED; } private string GetHeliconApeModuleType(string siteId) From 202d058912c5236053fc399c20b73bc68d8e8a4e Mon Sep 17 00:00:00 2001 From: ruslanht Date: Mon, 17 Dec 2012 15:54:24 +0200 Subject: [PATCH 02/26] Dreams come true: focus username field on login form --- .../DesktopModules/WebsitePanel/Login.ascx.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Login.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Login.ascx.cs index 9d55c534..8fae6190 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Login.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Login.ascx.cs @@ -151,6 +151,9 @@ namespace WebsitePanel.Portal ddlTheme.Visible = false; lblTheme.Visible = false; } + + // set focus on username field + txtUsername.Focus(); } protected void cmdForgotPassword_Click(object sender, EventArgs e) From 2e73fd537b3a16bd37b20d7257f59e314c7b085b Mon Sep 17 00:00:00 2001 From: ruslanht Date: Tue, 18 Dec 2012 12:04:13 +0200 Subject: [PATCH 03/26] WebPI: go to product download/install page directly by 'WPIProduct' query string parameter --- .../ServersEditWebPlatformInstaller.ascx.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ServersEditWebPlatformInstaller.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ServersEditWebPlatformInstaller.ascx.cs index 8dc2f27c..3987a1b5 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ServersEditWebPlatformInstaller.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ServersEditWebPlatformInstaller.ascx.cs @@ -108,6 +108,16 @@ namespace WebsitePanel.Portal ShowProgressPanel(); } + string gotoProduct = Request.QueryString["WPIProduct"]; + if (!string.IsNullOrEmpty(gotoProduct)) + { + ArrayList wpiProductsForInstall = GetProductsToInstallList(); + wpiProductsForInstall.Add(gotoProduct); + SetProductsToInstallList(wpiProductsForInstall); + + btnInstall_Click(sender, e); + } + } } From 06fa3d494f01ea593e76e537196bd35b88a68c80 Mon Sep 17 00:00:00 2001 From: ruslanht Date: Tue, 18 Dec 2012 12:06:48 +0200 Subject: [PATCH 04/26] IIS7 settings page: install Helicon Ape link is to the corrsponding WepPI page --- .../App_LocalResources/ServersEditServer.ascx.resx | 3 +++ .../App_LocalResources/IIS70_Settings.ascx.resx | 2 +- .../ProviderControls/IIS70_Settings.ascx | 2 ++ .../ProviderControls/IIS70_Settings.ascx.cs | 14 ++++++++++++++ .../IIS70_Settings.ascx.designer.cs | 9 +++++++++ 5 files changed, 29 insertions(+), 1 deletion(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/ServersEditServer.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/ServersEditServer.ascx.resx index 06a13f06..45082191 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/ServersEditServer.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/ServersEditServer.ascx.resx @@ -252,4 +252,7 @@ * + + Web Platform Installer + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/App_LocalResources/IIS70_Settings.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/App_LocalResources/IIS70_Settings.ascx.resx index 7e0ca9e5..3e156c79 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/App_LocalResources/IIS70_Settings.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/App_LocalResources/IIS70_Settings.ascx.resx @@ -202,7 +202,7 @@ .htaccess - Helicon Ape product provides .htaccess and .htpasswd files support on IIS 7+ and includes all major Apache modules. Note that Helicon Ape is not yet installed on the server. <br/><br/>Please <a href="http://www.helicontech.com/ape/doc/wsp_install.htm" target="_blank">download and install</a> Helicon Ape to activate this feature. + Helicon Ape product provides .htaccess and .htpasswd files support on IIS 7+ and includes all major Apache modules. Note that Helicon Ape is not yet installed on the server. Module Assembly: diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IIS70_Settings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IIS70_Settings.ascx index b96c38f1..b7a95997 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IIS70_Settings.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IIS70_Settings.ascx @@ -427,6 +427,8 @@ +

+ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IIS70_Settings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IIS70_Settings.ascx.cs index 19209519..4539147d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IIS70_Settings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IIS70_Settings.ascx.cs @@ -161,6 +161,20 @@ namespace WebsitePanel.Portal.ProviderControls else { configureApePanel.Visible = false; + + // Build url manually, EditUrl throws exception: module is Null + // pid=Servers&mid=137&ctl=edit_platforminstaller&ServerID=1&Product=HeliconApe + + List qsParts= new List(); + + qsParts.Add("pid=Servers"); + qsParts.Add("ctl=edit_platforminstaller"); + qsParts.Add("mid=" + Request.QueryString["mid"]); + qsParts.Add("ServerID=" + Request.QueryString["ServerID"]); + qsParts.Add("WPIProduct=HeliconApe"); + + // TODO: make button here + InstallHeliconApeLink.Attributes["href"] = "Default.aspx?" + String.Join("&", qsParts.ToArray()); } // diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IIS70_Settings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IIS70_Settings.ascx.designer.cs index a61aab10..eff20277 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IIS70_Settings.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IIS70_Settings.ascx.designer.cs @@ -669,6 +669,15 @@ namespace WebsitePanel.Portal.ProviderControls { /// protected global::System.Web.UI.WebControls.Localize Localize1; + /// + /// InstallHeliconApeLink control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton InstallHeliconApeLink; + /// /// configureApePanel control. /// From 0817269e1b38c3ac3f69401a87033d236dc5d7bd Mon Sep 17 00:00:00 2001 From: ruslanht Date: Tue, 18 Dec 2012 12:40:06 +0200 Subject: [PATCH 05/26] WebPI: hide products with "searchExclude" attribute --- WebsitePanel/Sources/WebsitePanel.Server/Code/WPIHelper.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/WebsitePanel/Sources/WebsitePanel.Server/Code/WPIHelper.cs b/WebsitePanel/Sources/WebsitePanel.Server/Code/WPIHelper.cs index a1d56b26..09ec94c2 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/Code/WPIHelper.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server/Code/WPIHelper.cs @@ -219,6 +219,12 @@ namespace WebsitePanel.Server.Code continue; } + if (product.GetAttributeValue("searchExclude") != null) + { + // skip it, this is internal not visible product + continue; + } + if (string.IsNullOrEmpty(filter)) { products.Add(product); From a22fc06d071ef2c45ac0cedc97ac1586964e26da Mon Sep 17 00:00:00 2001 From: Sergey Date: Tue, 18 Dec 2012 13:15:05 +0200 Subject: [PATCH 06/26] HeliconApeStatus instead of several boolean variables --- .../Web/WebSite.cs | 8 +++ .../WebsitePanel.Providers.Web.IIS70/IIs70.cs | 1 + .../WebSitesHeliconApeControl.ascx.resx | 3 + .../WebSitesHeliconApeControl.ascx.cs | 55 +++++++++++-------- 4 files changed, 44 insertions(+), 23 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/Web/WebSite.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Web/WebSite.cs index f55588ea..30ba4d9f 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/Web/WebSite.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Web/WebSite.cs @@ -30,6 +30,7 @@ using System; using System.ComponentModel; using System.Collections.Generic; using System.Collections.Specialized; +using WebsitePanel.Providers.ResultObjects; namespace WebsitePanel.Providers.Web { @@ -61,6 +62,7 @@ namespace WebsitePanel.Providers.Web private bool securedFoldersInstalled; private bool heliconApeInstalled; private bool heliconApeEnabled; + private HeliconApeStatus heliconApeStatus; public WebSite() { @@ -179,6 +181,12 @@ namespace WebsitePanel.Providers.Web get { return this.heliconApeEnabled; } set { this.heliconApeEnabled = value; } } + + public HeliconApeStatus HeliconApeStatus + { + get { return this.heliconApeStatus; } + set { this.heliconApeStatus = value; } + } } [Flags] diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs index 0a184b1c..6c8b2f4e 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs @@ -1165,6 +1165,7 @@ namespace WebsitePanel.Providers.Web HeliconApeStatus heliconApeStatus = GetHeliconApeStatus(srvman, siteId); site.HeliconApeInstalled = heliconApeStatus.IsInstalled; site.HeliconApeEnabled = heliconApeStatus.IsEnabled; + site.HeliconApeStatus = heliconApeStatus; // site.SiteState = GetSiteState(srvman, siteId); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/WebSitesHeliconApeControl.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/WebSitesHeliconApeControl.ascx.resx index 7f5f0f01..7372c79d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/WebSitesHeliconApeControl.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/WebSitesHeliconApeControl.ascx.resx @@ -132,6 +132,9 @@ Enable Helicon Ape + + Enable Helicon Ape (45 days trial) + Click "Add Folder" button to add .htaccess folder diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesHeliconApeControl.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesHeliconApeControl.ascx.cs index 9477c381..d56ffa5f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesHeliconApeControl.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesHeliconApeControl.ascx.cs @@ -38,23 +38,12 @@ using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using WebsitePanel.Providers.Web; +using WebsitePanel.Providers.ResultObjects; namespace WebsitePanel.Portal { public partial class WebSitesHeliconApeControl : WebsitePanelControlBase { - private bool IsHeliconApeInstalled - { - get { return ViewState["IsHeliconApeInstalled"] != null ? (bool)ViewState["IsHeliconApeInstalled"] : false; } - set { ViewState["IsHeliconApeInstalled"] = value; } - } - - private bool IsHeliconApeEnabled - { - get { return ViewState["IsHeliconApeEnabled"] != null ? (bool)ViewState["IsHeliconApeEnabled"] : false; } - set { ViewState["IsHeliconApeEnabled"] = value; } - - } private bool IsSecuredFoldersInstalled { @@ -62,9 +51,16 @@ namespace WebsitePanel.Portal set { ViewState["IsSecuredFoldersInstalled"] = value; } } + private HeliconApeStatus HeliconApeStatus + { + get { return (HeliconApeStatus)ViewState["HeliconApeStatus"]; } + set { ViewState["HeliconApeStatus"] = value; } + + } + protected void Page_Load(object sender, EventArgs e) { - if (IsHeliconApeInstalled) + if (HeliconApeStatus.IsInstalled) { if (!IsPostBack) { @@ -90,12 +86,12 @@ namespace WebsitePanel.Portal public void BindHeliconApe(WebSite site) { // save initial state - IsHeliconApeInstalled = site.HeliconApeInstalled; - IsHeliconApeEnabled = site.HeliconApeEnabled; - IsSecuredFoldersInstalled = site.SecuredFoldersInstalled; - + this.IsSecuredFoldersInstalled = site.SecuredFoldersInstalled; + this.HeliconApeStatus = site.HeliconApeStatus; + + // Render a warning message about the automatic site's settings change - if (!IsHeliconApeEnabled && site.IIs7) + if (!HeliconApeStatus.IsEnabled && site.IIs7) { // Ensure the message is displayed only when neccessary if (site.EnableWindowsAuthentication || !site.AspNetInstalled.EndsWith("I") || site.SecuredFoldersInstalled) @@ -113,11 +109,21 @@ namespace WebsitePanel.Portal private void ToggleControls() { - if (IsHeliconApeInstalled) + if (HeliconApeStatus.IsInstalled) { + bool IsHeliconApeEnabled = HeliconApeStatus.IsEnabled; + // toggle button - btnToggleHeliconApe.Text = GetLocalizedString( - IsHeliconApeEnabled ? "DisableHeliconApe.Text" : "EnableHeliconApe.Text"); + if (IsHeliconApeEnabled) + { + btnToggleHeliconApe.Text = GetLocalizedString("DisableHeliconApe.Text"); + } + else + { + btnToggleHeliconApe.Text = GetLocalizedString("EnableHeliconApe.Text"); + } + + // toggle panels HeliconApeFoldersPanel.Visible = IsHeliconApeEnabled; @@ -165,7 +171,7 @@ namespace WebsitePanel.Portal try { int result = 0; - if (IsHeliconApeEnabled) + if (HeliconApeStatus.IsEnabled) { // uninstall folders result = ES.Services.WebServers.DisableHeliconApe(PanelRequest.ItemID); @@ -189,7 +195,10 @@ namespace WebsitePanel.Portal } // change state - IsHeliconApeEnabled = !IsHeliconApeEnabled; + HeliconApeStatus status = HeliconApeStatus; + status.IsEnabled = !status.IsEnabled; + + HeliconApeStatus = status; // bind items ToggleControls(); From deddc73f285ec0a8f0a6aaee390016f1dd949487 Mon Sep 17 00:00:00 2001 From: ruslanht Date: Tue, 18 Dec 2012 16:41:21 +0200 Subject: [PATCH 07/26] Helicon Ape: Server-wide enbaling/disabling (global registration) added --- .../WebServersProxy.cs | 144 +++++++++++++ .../Code/WebServers/WebServerController.cs | 44 +++- .../esWebServers.asmx.cs | 12 ++ .../WebsitePanel.Providers.Web.IIS70/IIs70.cs | 197 ++++++++++-------- .../IIS70_Settings.ascx.resx | 9 +- .../ProviderControls/IIS70_Settings.ascx | 14 +- .../ProviderControls/IIS70_Settings.ascx.cs | 24 ++- .../IIS70_Settings.ascx.designer.cs | 9 + 8 files changed, 361 insertions(+), 92 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/WebServersProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/WebServersProxy.cs index dfd90b61..f65d5497 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/WebServersProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/WebServersProxy.cs @@ -164,6 +164,10 @@ namespace WebsitePanel.EnterpriseServer { private System.Threading.SendOrPostCallback DisableHeliconApeOperationCompleted; + private System.Threading.SendOrPostCallback EnableHeliconApeGloballyOperationCompleted; + + private System.Threading.SendOrPostCallback DisableHeliconApeGloballyOperationCompleted; + private System.Threading.SendOrPostCallback GetHeliconApeFoldersOperationCompleted; private System.Threading.SendOrPostCallback GetHeliconApeHttpdFolderOperationCompleted; @@ -384,6 +388,12 @@ namespace WebsitePanel.EnterpriseServer { /// public event DisableHeliconApeCompletedEventHandler DisableHeliconApeCompleted; + /// + public event EnableHeliconApeGloballyCompletedEventHandler EnableHeliconApeGloballyCompleted; + + /// + public event DisableHeliconApeGloballyCompletedEventHandler DisableHeliconApeGloballyCompleted; + /// public event GetHeliconApeFoldersCompletedEventHandler GetHeliconApeFoldersCompleted; @@ -2705,6 +2715,88 @@ namespace WebsitePanel.EnterpriseServer { } } + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/EnableHeliconApeGlobally", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int EnableHeliconApeGlobally(int serviceId) { + object[] results = this.Invoke("EnableHeliconApeGlobally", new object[] { + serviceId}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginEnableHeliconApeGlobally(int serviceId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("EnableHeliconApeGlobally", new object[] { + serviceId}, callback, asyncState); + } + + /// + public int EndEnableHeliconApeGlobally(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void EnableHeliconApeGloballyAsync(int serviceId) { + this.EnableHeliconApeGloballyAsync(serviceId, null); + } + + /// + public void EnableHeliconApeGloballyAsync(int serviceId, object userState) { + if ((this.EnableHeliconApeGloballyOperationCompleted == null)) { + this.EnableHeliconApeGloballyOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnableHeliconApeGloballyOperationCompleted); + } + this.InvokeAsync("EnableHeliconApeGlobally", new object[] { + serviceId}, this.EnableHeliconApeGloballyOperationCompleted, userState); + } + + private void OnEnableHeliconApeGloballyOperationCompleted(object arg) { + if ((this.EnableHeliconApeGloballyCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.EnableHeliconApeGloballyCompleted(this, new EnableHeliconApeGloballyCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/DisableHeliconApeGlobally", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int DisableHeliconApeGlobally(int serviceId) { + object[] results = this.Invoke("DisableHeliconApeGlobally", new object[] { + serviceId}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginDisableHeliconApeGlobally(int serviceId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("DisableHeliconApeGlobally", new object[] { + serviceId}, callback, asyncState); + } + + /// + public int EndDisableHeliconApeGlobally(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void DisableHeliconApeGloballyAsync(int serviceId) { + this.DisableHeliconApeGloballyAsync(serviceId, null); + } + + /// + public void DisableHeliconApeGloballyAsync(int serviceId, object userState) { + if ((this.DisableHeliconApeGloballyOperationCompleted == null)) { + this.DisableHeliconApeGloballyOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDisableHeliconApeGloballyOperationCompleted); + } + this.InvokeAsync("DisableHeliconApeGlobally", new object[] { + serviceId}, this.DisableHeliconApeGloballyOperationCompleted, userState); + } + + private void OnDisableHeliconApeGloballyOperationCompleted(object arg) { + if ((this.DisableHeliconApeGloballyCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.DisableHeliconApeGloballyCompleted(this, new DisableHeliconApeGloballyCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetHeliconApeFolders", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] public HtaccessFolder[] GetHeliconApeFolders(int siteItemId) { @@ -5332,6 +5424,58 @@ namespace WebsitePanel.EnterpriseServer { } } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void EnableHeliconApeGloballyCompletedEventHandler(object sender, EnableHeliconApeGloballyCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class EnableHeliconApeGloballyCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal EnableHeliconApeGloballyCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public int Result { + get { + this.RaiseExceptionIfNecessary(); + return ((int)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void DisableHeliconApeGloballyCompletedEventHandler(object sender, DisableHeliconApeGloballyCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class DisableHeliconApeGloballyCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal DisableHeliconApeGloballyCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public int Result { + get { + this.RaiseExceptionIfNecessary(); + return ((int)(this.results[0])); + } + } + } + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetHeliconApeFoldersCompletedEventHandler(object sender, GetHeliconApeFoldersCompletedEventArgs e); diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebServers/WebServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebServers/WebServerController.cs index 1590849d..a0b96690 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebServers/WebServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebServers/WebServerController.cs @@ -2869,7 +2869,6 @@ namespace WebsitePanel.EnterpriseServer #endregion - #region Helicon Ape public static int EnableHeliconApe(int siteItemId) { @@ -2939,7 +2938,48 @@ namespace WebsitePanel.EnterpriseServer } } - /// + /// + /// Enables Helicon Ape on the server globally. Requires Administrator role to execute. + /// + /// + /// + public static int EnableHeliconApeGlobally(int ServiceId) + { + int accountCheck = SecurityContext.CheckAccount(DemandAccount.IsAdmin | DemandAccount.IsActive | DemandAccount.NotDemo); + if (accountCheck < 0) + { + return accountCheck; + } + + WebServer web = GetWebServer(ServiceId); + web.EnableHeliconApe(""); + + return 0; + } + + + /// + /// Disables Helicon Ape on the server globally. Requires Administrator role to execute. + /// + /// + /// + public static int DisableHeliconApeGlobally(int ServiceId) + { + int accountCheck = SecurityContext.CheckAccount(DemandAccount.IsAdmin | DemandAccount.IsActive | DemandAccount.NotDemo); + // + if (accountCheck < 0) + { + return accountCheck; + } + + WebServer web = GetWebServer(ServiceId); + web.DisableHeliconApe(""); + + return 0; + } + + + /// /// Retrieves Helicon Ape extension status from the server. Requires Administrator role to execute. /// /// diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esWebServers.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esWebServers.asmx.cs index 00dc32d0..3c1a6034 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esWebServers.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esWebServers.asmx.cs @@ -378,6 +378,18 @@ namespace WebsitePanel.EnterpriseServer return WebServerController.DisableHeliconApe(siteItemId); } + [WebMethod] + public int EnableHeliconApeGlobally(int serviceId) + { + return WebServerController.EnableHeliconApeGlobally(serviceId); + } + + [WebMethod] + public int DisableHeliconApeGlobally(int serviceId) + { + return WebServerController.DisableHeliconApeGlobally(serviceId); + } + [WebMethod] public HtaccessFolder[] GetHeliconApeFolders(int siteItemId) { diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs index 0a184b1c..17548297 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs @@ -2159,82 +2159,104 @@ namespace WebsitePanel.Providers.Web return registrationInfo.StartsWith("Registered to:"); } + /// + /// Enables Helicon Ape module & handler on the web site or server globally. + /// + /// + /// Web site id or empty string ("") for server-wide enabling + /// public override void EnableHeliconApe(string siteId) { - WebSite webSite = null; - using (ServerManager srvman = webObjectsSvc.GetServerManager()) + if (null == siteId) { - // - if (String.IsNullOrEmpty(siteId)) - throw new ArgumentNullException("siteId"); - - // Helicon.Ape.ApeModule works for apps working in Integrated Pipeline mode - // Switch automatically to the app pool with Integrated Pipeline enabled - webSite = webObjectsSvc.GetWebSiteFromIIS(srvman, siteId); - // - if (webSite == null) - throw new ApplicationException(String.Format("Could not find a web site with the following identifier: {0}.", siteId)); - - // Fill ASP.NET settings - FillAspNetSettingsFromIISObject(srvman, webSite); + throw new ArgumentNullException("siteId"); } - // - var aphl = new WebAppPoolHelper(ProviderSettings); - var currentPool = aphl.match_webapp_pool(webSite); - var dotNetVersion = aphl.dotNetVersion(currentPool.Mode); - var sisMode = aphl.isolation(currentPool.Mode); - // AT least ASP.NET 2.0 is allowed to provide such capabilities... - if (dotNetVersion == SiteAppPoolMode.dotNetFramework1) - dotNetVersion = SiteAppPoolMode.dotNetFramework2; - // and Integrated pipeline... - if (aphl.pipeline(currentPool.Mode) != SiteAppPoolMode.Integrated) + if ("" != siteId) { - // Lookup for the opposite pool matching the criteria - var oppositePool = Array.Find(aphl.SupportedAppPools.ToArray(), - x => aphl.dotNetVersion(x.Mode) == dotNetVersion && aphl.isolation(x.Mode) == sisMode - && aphl.pipeline(x.Mode) == SiteAppPoolMode.Integrated); - // - webSite.AspNetInstalled = oppositePool.AspNetInstalled; - // - SetWebSiteApplicationPool(webSite, false); + // prepare enabling Ape for web site + + WebSite webSite = null; + using (ServerManager srvman = webObjectsSvc.GetServerManager()) + { + // + if (String.IsNullOrEmpty(siteId)) + + + // Helicon.Ape.ApeModule works for apps working in Integrated Pipeline mode + // Switch automatically to the app pool with Integrated Pipeline enabled + webSite = webObjectsSvc.GetWebSiteFromIIS(srvman, siteId); + // + if (webSite == null) + throw new ApplicationException( + String.Format("Could not find a web site with the following identifier: {0}.", siteId)); + + // Fill ASP.NET settings + FillAspNetSettingsFromIISObject(srvman, webSite); + } + // + var aphl = new WebAppPoolHelper(ProviderSettings); + var currentPool = aphl.match_webapp_pool(webSite); + var dotNetVersion = aphl.dotNetVersion(currentPool.Mode); + var sisMode = aphl.isolation(currentPool.Mode); + // AT least ASP.NET 2.0 is allowed to provide such capabilities... + if (dotNetVersion == SiteAppPoolMode.dotNetFramework1) + dotNetVersion = SiteAppPoolMode.dotNetFramework2; + // and Integrated pipeline... + if (aphl.pipeline(currentPool.Mode) != SiteAppPoolMode.Integrated) + { + // Lookup for the opposite pool matching the criteria + var oppositePool = Array.Find(aphl.SupportedAppPools.ToArray(), + x => + aphl.dotNetVersion(x.Mode) == dotNetVersion && + aphl.isolation(x.Mode) == sisMode + && aphl.pipeline(x.Mode) == SiteAppPoolMode.Integrated); + // + webSite.AspNetInstalled = oppositePool.AspNetInstalled; + // + SetWebSiteApplicationPool(webSite, false); + // + using (var srvman = webObjectsSvc.GetServerManager()) + { + var iisSiteObject = srvman.Sites[siteId]; + iisSiteObject.Applications["/"].ApplicationPoolName = webSite.ApplicationPool; + // + srvman.CommitChanges(); + } + } + + #region Disable automatically Integrated Windows Authentication + using (var srvman = webObjectsSvc.GetServerManager()) { - var iisSiteObject = srvman.Sites[siteId]; - iisSiteObject.Applications["/"].ApplicationPoolName = webSite.ApplicationPool; + PropertyBag winAuthBag = winAuthSvc.GetAuthenticationSettings(srvman, siteId); // - srvman.CommitChanges(); - } - } + if ((bool) winAuthBag[AuthenticationGlobals.Enabled]) + { + Configuration config = srvman.GetApplicationHostConfiguration(); - #region Disable automatically Integrated Windows Authentication - using (var srvman = webObjectsSvc.GetServerManager()) - { - PropertyBag winAuthBag = winAuthSvc.GetAuthenticationSettings(srvman, siteId); - // - if ((bool)winAuthBag[AuthenticationGlobals.Enabled]) + ConfigurationSection windowsAuthenticationSection = config.GetSection( + "system.webServer/security/authentication/windowsAuthentication", + siteId); + // + windowsAuthenticationSection["enabled"] = false; + // + srvman.CommitChanges(); + } + } + + #endregion + + #region Disable automatically Secured Folders + + if (IsSecuredFoldersInstalled(siteId)) { - Configuration config = srvman.GetApplicationHostConfiguration(); - - ConfigurationSection windowsAuthenticationSection = config.GetSection( - "system.webServer/security/authentication/windowsAuthentication", - siteId); - // - windowsAuthenticationSection["enabled"] = false; - // - srvman.CommitChanges(); + UninstallSecuredFolders(siteId); } - } - #endregion - #region Disable automatically Secured Folders - if (IsSecuredFoldersInstalled(siteId)) - { - UninstallSecuredFolders(siteId); + #endregion } - #endregion - // using (var srvman = webObjectsSvc.GetServerManager()) @@ -2245,34 +2267,39 @@ namespace WebsitePanel.Providers.Web // add Helicon.Ape module ConfigurationSection modulesSection = appConfig.GetSection(Constants.ModulesSection, siteId); ConfigurationElementCollection modulesCollection = modulesSection.GetCollection(); - ConfigurationElement moduleAdd = modulesCollection.CreateElement("add"); - moduleAdd["name"] = Constants.HeliconApeModule; - moduleAdd["type"] = GetHeliconApeModuleType(siteId); + ConfigurationElement heliconApeModuleEntry = modulesCollection.CreateElement("add"); + heliconApeModuleEntry["name"] = Constants.HeliconApeModule; + heliconApeModuleEntry["type"] = GetHeliconApeModuleType(siteId); // - modulesCollection.Add(moduleAdd); + modulesCollection.AddAt(0, heliconApeModuleEntry); // add Helicon.Ape handler ConfigurationSection handlersSection = appConfig.GetSection(Constants.HandlersSection, siteId); ConfigurationElementCollection handlersCollection = handlersSection.GetCollection(); - ConfigurationElement handlerAdd = handlersCollection.CreateElement("add"); - handlerAdd["name"] = Constants.HeliconApeModule; - handlerAdd["type"] = GetHeliconApeHandlerType(siteId); - handlerAdd["path"] = Constants.HeliconApeHandlerPath; - handlerAdd["verb"] = "*"; - handlerAdd["resourceType"] = "Unspecified"; + ConfigurationElement heliconApeHandlerEntry = handlersCollection.CreateElement("add"); + heliconApeHandlerEntry["name"] = Constants.HeliconApeModule; + heliconApeHandlerEntry["type"] = GetHeliconApeHandlerType(siteId); + heliconApeHandlerEntry["path"] = Constants.HeliconApeHandlerPath; + heliconApeHandlerEntry["verb"] = "*"; + heliconApeHandlerEntry["resourceType"] = "Unspecified"; // - handlersCollection.Add(handlerAdd); + handlersCollection.AddAt(0, heliconApeHandlerEntry); // srvman.CommitChanges(); } } + /// + /// Disables Helicon Ape module & handler on the web site or server globally. + /// + /// + /// Web site id or empty string ("") for server-wide disabling + /// public override void DisableHeliconApe(string siteId) { - // - if (String.IsNullOrEmpty(siteId)) + if (null == siteId) throw new ArgumentNullException("siteId"); - // + using (var srvman = webObjectsSvc.GetServerManager()) { // @@ -2281,40 +2308,40 @@ namespace WebsitePanel.Providers.Web // remove Helicon.Ape module ConfigurationSection modulesSection = appConfig.GetSection(Constants.ModulesSection, siteId); ConfigurationElementCollection modulesCollection = modulesSection.GetCollection(); - ConfigurationElement htaccessModuleEntry = null; + ConfigurationElement heliconApeModuleEntry = null; foreach (ConfigurationElement moduleEntry in modulesCollection) { if (String.Equals(moduleEntry["name"].ToString(), Constants.HeliconApeModule, StringComparison.InvariantCultureIgnoreCase)) { - htaccessModuleEntry = moduleEntry; + heliconApeModuleEntry = moduleEntry; break; } } - if (htaccessModuleEntry != null) + if (heliconApeModuleEntry != null) { - modulesCollection.Remove(htaccessModuleEntry); + modulesCollection.Remove(heliconApeModuleEntry); } // remove Helicon.Ape handler ConfigurationSection handlersSection = appConfig.GetSection(Constants.HandlersSection, siteId); ConfigurationElementCollection handlersCollection = handlersSection.GetCollection(); - ConfigurationElement htaccessHandlerEntry = null; + ConfigurationElement heliconApeHandlerEntry = null; foreach (ConfigurationElement handlerEntry in handlersCollection) { - if (String.Equals(handlerEntry["name"].ToString(), Constants.HeliconApeModule, StringComparison.InvariantCultureIgnoreCase)) + if (String.Equals(handlerEntry["path"].ToString(), Constants.HeliconApeHandlerPath, StringComparison.InvariantCultureIgnoreCase)) { - htaccessHandlerEntry = handlerEntry; + heliconApeHandlerEntry = handlerEntry; break; } } // - if (htaccessHandlerEntry != null) + if (heliconApeHandlerEntry != null) { - handlersCollection.Remove(htaccessHandlerEntry); + handlersCollection.Remove(heliconApeHandlerEntry); } // commit changes to metabase - if (htaccessModuleEntry != null || htaccessHandlerEntry != null) + if (heliconApeModuleEntry != null || heliconApeHandlerEntry != null) { srvman.CommitChanges(); } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/App_LocalResources/IIS70_Settings.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/App_LocalResources/IIS70_Settings.ascx.resx index 3e156c79..8c517294 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/App_LocalResources/IIS70_Settings.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/App_LocalResources/IIS70_Settings.ascx.resx @@ -202,7 +202,11 @@ .htaccess - Helicon Ape product provides .htaccess and .htpasswd files support on IIS 7+ and includes all major Apache modules. Note that Helicon Ape is not yet installed on the server. + Helicon Ape provides .htaccess and .htpasswd files support and includes all major Apache modules. + This is essential tool to fine-tune IIS web sites, improve performance, security, + search engines rankings and for compatibility with many open source applications. + <br/> + Click on the link below to install Helicon Ape on the server: Module Assembly: @@ -252,4 +256,7 @@ Web Sites Public Shared Address: + + Register Helicon Ape module globally: + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IIS70_Settings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IIS70_Settings.ascx index b7a95997..586cacb2 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IIS70_Settings.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IIS70_Settings.ascx @@ -460,9 +460,19 @@ + Text="Edit httpd.conf (server config)" onclick="EditHeliconApeConfButton_Click" /> + + + + Register Helicon Ape module globally: + + + +
+ Uncheck this box to enable managing Helicon Ape using hosting plan policies. + + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IIS70_Settings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IIS70_Settings.ascx.cs index 4539147d..051a3e58 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IIS70_Settings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IIS70_Settings.ascx.cs @@ -150,13 +150,19 @@ namespace WebsitePanel.Portal.ProviderControls txtSecureFoldersModuleAsm.Text = settings["SecureFoldersModuleAssembly"]; //Helicon Ape - WebsitePanel.Providers.ResultObjects.HeliconApeStatus sts = ES.Services.WebServers.GetHeliconApeStatus(int.Parse(Request.QueryString["ServiceID"])); + Providers.ResultObjects.HeliconApeStatus sts = ES.Services.WebServers.GetHeliconApeStatus(int.Parse(Request.QueryString["ServiceID"])); if (sts.IsInstalled) { downloadApePanel.Visible = false; txtHeliconApeVersion.Text = sts.Version; lblHeliconRegistrationText.Text = sts.RegistrationInfo; + + if (sts.IsEnabled) + { + chkHeliconApeGlobalRegistration.Checked = true; + } + ViewState["HeliconApeInitiallyEnabled"] = chkHeliconApeGlobalRegistration.Checked; } else { @@ -173,7 +179,6 @@ namespace WebsitePanel.Portal.ProviderControls qsParts.Add("ServerID=" + Request.QueryString["ServerID"]); qsParts.Add("WPIProduct=HeliconApe"); - // TODO: make button here InstallHeliconApeLink.Attributes["href"] = "Default.aspx?" + String.Join("&", qsParts.ToArray()); } @@ -268,6 +273,19 @@ namespace WebsitePanel.Portal.ProviderControls ActiveDirectoryIntegration.SaveSettings(settings); + // Helicon Ape + bool registerHeliconApeGlobbally = chkHeliconApeGlobalRegistration.Checked; + if (registerHeliconApeGlobbally != (bool)ViewState["HeliconApeInitiallyEnabled"]) + { + if (registerHeliconApeGlobbally) + { + ES.Services.WebServers.EnableHeliconApeGlobally(int.Parse(Request.QueryString["ServiceID"])); + } + else + { + ES.Services.WebServers.DisableHeliconApeGlobally(int.Parse(Request.QueryString["ServiceID"])); + } + } @@ -293,6 +311,7 @@ namespace WebsitePanel.Portal.ProviderControls settings["GalleryAppsAlwaysIgnoreDependencies"] = chkGalleryAppsAlwaysIgnoreDependencies.Checked.ToString(); } + /* protected void DownladAndIstallApeLinkButton_Click(object sender, EventArgs e) { ES.Services.WebServers.InstallHeliconApe(PanelRequest.ServiceId); @@ -300,6 +319,7 @@ namespace WebsitePanel.Portal.ProviderControls //Redirect to avoid 2-nd call Response.Redirect(this.Context.Request.Url.AbsoluteUri); } + */ public string GetHttpdEditControlUrl(string ctrlKey, string name) { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IIS70_Settings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IIS70_Settings.ascx.designer.cs index eff20277..0b38c608 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IIS70_Settings.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IIS70_Settings.ascx.designer.cs @@ -741,6 +741,15 @@ namespace WebsitePanel.Portal.ProviderControls { /// protected global::System.Web.UI.WebControls.Button EditHeliconApeConfButton; + /// + /// chkHeliconApeGlobalRegistration control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkHeliconApeGlobalRegistration; + /// /// secOther control. /// From 71fe43a30eaeaa13595a7c6534442833c8102326 Mon Sep 17 00:00:00 2001 From: ruslanht Date: Tue, 18 Dec 2012 17:07:51 +0200 Subject: [PATCH 08/26] Helicon Ape: fix quotes processing in htaccess editor --- .../Sources/WebsitePanel.Providers.Base/Web/HtaccessFolder.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/Web/HtaccessFolder.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Web/HtaccessFolder.cs index 220da27b..05f17c7f 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/Web/HtaccessFolder.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Web/HtaccessFolder.cs @@ -51,7 +51,7 @@ namespace WebsitePanel.Providers.Web #endregion #region parsing regexps - protected static readonly Regex RE_AUTH_NAME = new Regex(@"^\s*AuthName\s+(.+)\s*$", RegexOptions.IgnoreCase | RegexOptions.Multiline | RegexOptions.Compiled); + protected static readonly Regex RE_AUTH_NAME = new Regex("^\\s*AuthName\\s+\"?([^\"]+)\"?\\s*$", RegexOptions.IgnoreCase | RegexOptions.Multiline | RegexOptions.Compiled); protected static readonly Regex RE_AUTH_TYPE = new Regex(@"^\s*AuthType\s+(basic|digest)\s*$", RegexOptions.IgnoreCase | RegexOptions.Multiline | RegexOptions.Compiled); protected static readonly Regex RE_REQUIRE = new Regex(@"^\s*Require\s+(.+)\s*$", RegexOptions.IgnoreCase | RegexOptions.Multiline | RegexOptions.Compiled); protected static readonly Regex RE_AUTH_PROVIDER = new Regex(@"^\s*Auth(Basic|Digest)Provider\s+(file)\s*$", RegexOptions.IgnoreCase | RegexOptions.Multiline | RegexOptions.Compiled); From c17529cd563f8fe4df5e6ffe1fe7ef82453df591 Mon Sep 17 00:00:00 2001 From: Sergey Date: Tue, 18 Dec 2012 17:09:50 +0200 Subject: [PATCH 09/26] Load actual version of MySql.data --- .../MySqlServer.cs | 57 ++++++++----------- .../MySqlServer55.cs | 2 +- 2 files changed, 26 insertions(+), 33 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Database.MySQL/MySqlServer.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Database.MySQL/MySqlServer.cs index d7aca68c..9dbb49b9 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Database.MySQL/MySqlServer.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Database.MySQL/MySqlServer.cs @@ -39,7 +39,7 @@ using WebsitePanel.Server.Utils; using WebsitePanel.Providers.Utils; using WebsitePanel.Providers; using System.Reflection; - +using System.Data.Common; namespace WebsitePanel.Providers.Database { @@ -129,49 +129,36 @@ namespace WebsitePanel.Providers.Database static System.Reflection.Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) { - // + + + // if (!args.Name.Contains("MySql.Data")) return null; + + if (args.Name.Contains("MySql.Data.resources")) + return null; + // string connectorKeyName = "SOFTWARE\\MySQL AB\\MySQL Connector/Net"; - string connectorLocation = String.Empty; string connectorVersion = String.Empty; // if (PInvoke.RegistryHive.HKLM.SubKeyExists_x86(connectorKeyName)) { - connectorLocation = PInvoke.RegistryHive.HKLM.GetSubKeyValue_x86(connectorKeyName, "Location"); connectorVersion = PInvoke.RegistryHive.HKLM.GetSubKeyValue_x86(connectorKeyName, "Version"); } - // - if (String.IsNullOrEmpty(connectorLocation)) - { - Log.WriteInfo("Connector location is either null or empty"); - return null; - } - - string assemblyFile = args.Name.Split(',')[0] + ".dll"; - // 1st location - string assemblyPath = Path.Combine(connectorLocation, @"Binaries\.NET 2.0\" + assemblyFile); - if (!File.Exists(assemblyPath)) + + + string assemblyFullName = string.Format("MySql.Data, Version={0}.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d", connectorVersion); + + if (assemblyFullName == args.Name) { - // 2nd location - assemblyPath = Path.Combine(connectorLocation, @"Assemblies\" + assemblyFile); - - if (!File.Exists(assemblyPath)) - { - // 3rd location - assemblyPath = Path.Combine(connectorLocation, @"Assemblies\v2.0" + assemblyFile); - - if (!File.Exists(assemblyPath)) - { - Log.WriteInfo("Connector assembly could not be found or does not exist"); - return null; // sorry, cannot find - } - } + return null; //avoid of stack overflow } - return Assembly.LoadFrom(assemblyPath); + + return Assembly.Load(assemblyFullName); + } #endregion @@ -185,8 +172,14 @@ namespace WebsitePanel.Providers.Database public virtual bool CheckConnectivity(string databaseName, string username, string password) { - MySqlConnection conn = new MySqlConnection(String.Format("server={0};port={1};database={2};uid={3};password={4}", - ServerName, ServerPort, databaseName, username, password)); + MySqlConnection conn = new MySqlConnection( + String.Format("server={0};port={1};database={2};uid={3};password={4}", + ServerName, + ServerPort, + databaseName, + username, + password) + ); try { conn.Open(); diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Database.MySQL/MySqlServer55.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Database.MySQL/MySqlServer55.cs index 8b0e740f..173441dd 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Database.MySQL/MySqlServer55.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Database.MySQL/MySqlServer55.cs @@ -32,7 +32,7 @@ using System.Text; using System.Text.RegularExpressions; using System.Data; using Microsoft.Win32; -using MySql.Data.MySqlClient; +//using MySql.Data.MySqlClient; using System.IO; using WebsitePanel.Server.Utils; From a853f0f91fdd4cbbcb0a11c36f59035ef344a1e7 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Wed, 19 Dec 2012 09:02:22 -0500 Subject: [PATCH 10/26] Added tag build-2.0.0.223 for changeset f2f3cded028e From f3932d59f5f15742c56b6df5c3ea6804c5ed21fa Mon Sep 17 00:00:00 2001 From: ruslanht Date: Thu, 20 Dec 2012 12:28:38 +0200 Subject: [PATCH 11/26] Helicon Ape: registration fix --- .../Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs | 11 +++-------- .../WebsitePanel/ProviderControls/IIS70_Settings.ascx | 3 +-- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs index ee2b6b72..e62caa88 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs @@ -2180,14 +2180,9 @@ namespace WebsitePanel.Providers.Web WebSite webSite = null; using (ServerManager srvman = webObjectsSvc.GetServerManager()) { - // - if (String.IsNullOrEmpty(siteId)) - - - // Helicon.Ape.ApeModule works for apps working in Integrated Pipeline mode - // Switch automatically to the app pool with Integrated Pipeline enabled - webSite = webObjectsSvc.GetWebSiteFromIIS(srvman, siteId); - // + // Helicon.Ape.ApeModule works for apps working in Integrated Pipeline mode + // Switch automatically to the app pool with Integrated Pipeline enabled + webSite = webObjectsSvc.GetWebSiteFromIIS(srvman, siteId); if (webSite == null) throw new ApplicationException( String.Format("Could not find a web site with the following identifier: {0}.", siteId)); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IIS70_Settings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IIS70_Settings.ascx index 586cacb2..f6ad5853 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IIS70_Settings.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/IIS70_Settings.ascx @@ -469,8 +469,7 @@ -
- Uncheck this box to enable managing Helicon Ape using hosting plan policies. + (Uncheck this box to enable managing Helicon Ape using hosting plan policies.) From 3d8a2608959b149819f166881ad95a6ce075b598 Mon Sep 17 00:00:00 2001 From: ruslanht Date: Thu, 20 Dec 2012 15:35:21 +0200 Subject: [PATCH 12/26] Helicon Ape: avoid copying handlers/modules from ancesor on registration --- .../WebsitePanel.Providers.Web.IIS70/IIs70.cs | 60 +++++++++++++------ 1 file changed, 43 insertions(+), 17 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs index e62caa88..dddd9d7e 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs @@ -2254,33 +2254,61 @@ namespace WebsitePanel.Providers.Web #endregion } - // using (var srvman = webObjectsSvc.GetServerManager()) { - // Configuration appConfig = srvman.GetApplicationHostConfiguration(); // add Helicon.Ape module ConfigurationSection modulesSection = appConfig.GetSection(Constants.ModulesSection, siteId); ConfigurationElementCollection modulesCollection = modulesSection.GetCollection(); + + /* + if ("" != siteId) + { + // + ConfigurationElement removeHeliconApeModuleEntry = modulesCollection.CreateElement("remove"); + removeHeliconApeModuleEntry["name"] = Constants.HeliconApeModule; + modulesCollection.Add(removeHeliconApeModuleEntry); + } + */ + + // add name="Helicon.Ape" /> ConfigurationElement heliconApeModuleEntry = modulesCollection.CreateElement("add"); heliconApeModuleEntry["name"] = Constants.HeliconApeModule; heliconApeModuleEntry["type"] = GetHeliconApeModuleType(siteId); - // - modulesCollection.AddAt(0, heliconApeModuleEntry); + + // this way make and copy all modules list from ancestor + //modulesCollection.AddAt(0, heliconApeModuleEntry); + // this way just insert single ape module entry + modulesCollection.Add(heliconApeModuleEntry); + + + // add Helicon.Ape handler ConfigurationSection handlersSection = appConfig.GetSection(Constants.HandlersSection, siteId); ConfigurationElementCollection handlersCollection = handlersSection.GetCollection(); + + /* + if ("" != siteId) + { + // + ConfigurationElement removeHeliconApeHandlerEntry = handlersCollection.CreateElement("remove"); + removeHeliconApeHandlerEntry["name"] = Constants.HeliconApeModule; + handlersCollection.Add(removeHeliconApeHandlerEntry); + } + */ + + // add name="Helicon.Ape" /> ConfigurationElement heliconApeHandlerEntry = handlersCollection.CreateElement("add"); heliconApeHandlerEntry["name"] = Constants.HeliconApeModule; heliconApeHandlerEntry["type"] = GetHeliconApeHandlerType(siteId); heliconApeHandlerEntry["path"] = Constants.HeliconApeHandlerPath; heliconApeHandlerEntry["verb"] = "*"; heliconApeHandlerEntry["resourceType"] = "Unspecified"; - // + handlersCollection.AddAt(0, heliconApeHandlerEntry); - // + srvman.CommitChanges(); } } @@ -2304,40 +2332,38 @@ namespace WebsitePanel.Providers.Web // remove Helicon.Ape module ConfigurationSection modulesSection = appConfig.GetSection(Constants.ModulesSection, siteId); ConfigurationElementCollection modulesCollection = modulesSection.GetCollection(); - ConfigurationElement heliconApeModuleEntry = null; + List heliconApeModuleEntriesList = new List(); foreach (ConfigurationElement moduleEntry in modulesCollection) { if (String.Equals(moduleEntry["name"].ToString(), Constants.HeliconApeModule, StringComparison.InvariantCultureIgnoreCase)) { - heliconApeModuleEntry = moduleEntry; - break; + heliconApeModuleEntriesList.Add(moduleEntry); } } - if (heliconApeModuleEntry != null) + foreach (ConfigurationElement heliconApeElement in heliconApeModuleEntriesList) { - modulesCollection.Remove(heliconApeModuleEntry); + modulesCollection.Remove(heliconApeElement); } // remove Helicon.Ape handler ConfigurationSection handlersSection = appConfig.GetSection(Constants.HandlersSection, siteId); ConfigurationElementCollection handlersCollection = handlersSection.GetCollection(); - ConfigurationElement heliconApeHandlerEntry = null; + List heliconApeHandlerEntriesList = new List(); foreach (ConfigurationElement handlerEntry in handlersCollection) { - if (String.Equals(handlerEntry["path"].ToString(), Constants.HeliconApeHandlerPath, StringComparison.InvariantCultureIgnoreCase)) + if (String.Equals(handlerEntry["name"].ToString(), Constants.HeliconApeModule, StringComparison.InvariantCultureIgnoreCase)) { - heliconApeHandlerEntry = handlerEntry; - break; + heliconApeHandlerEntriesList.Add(handlerEntry); } } // - if (heliconApeHandlerEntry != null) + foreach (ConfigurationElement heliconApeHandlerEntry in heliconApeHandlerEntriesList) { handlersCollection.Remove(heliconApeHandlerEntry); } // commit changes to metabase - if (heliconApeModuleEntry != null || heliconApeHandlerEntry != null) + if (heliconApeModuleEntriesList.Count > 0 || heliconApeHandlerEntriesList.Count > 0) { srvman.CommitChanges(); } From 1b1ec436c5c3a2c8c72cd9c02ad606e23dca200a Mon Sep 17 00:00:00 2001 From: Christopher York Date: Wed, 26 Dec 2012 09:39:13 -0600 Subject: [PATCH 13/26] Fixed: Incorrect function parameter order for "update_user_details" method --- WebsitePanel.WHMCSModule/includes/hooks/websitepanel_sync.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/WebsitePanel.WHMCSModule/includes/hooks/websitepanel_sync.php b/WebsitePanel.WHMCSModule/includes/hooks/websitepanel_sync.php index 12ff3ad0..bf3582ac 100644 --- a/WebsitePanel.WHMCSModule/includes/hooks/websitepanel_sync.php +++ b/WebsitePanel.WHMCSModule/includes/hooks/websitepanel_sync.php @@ -74,9 +74,9 @@ function websitepanel_sync_ClientEdit($params) // We cannot use the details provided by the get_users_paged_recursive method as it does not return all the required elements to fully update the user $currentRoot = $rootPath->Table1->$i; $userDetails = (array)$wsp->get_user_by_username($currentRoot->Username); - + // Update the current user - $wsp->update_user_details($userDetails['RoleId'], (($userDetails['RoleId'] == 2) ? 'Reseller' : 'User'), $userDetails['StatusId'], $userDetails['Status'], $userDetails['LoginStatusId'], $userDetails['LoginStatus'], $userDetails['FailedLogins'], $userDetails['UserId'], $userDetails['OwnerId'], $userDetails['Created'], $userDetails['Changed'], $userDetails['IsDemo'], $userDetails['IsPeer'], $currentRoot->Comments, $params['lastname'], $userDetails['Username'], $userDetails['Password'], $params['firstname'], $params['email'], $params['phonenumber'], $params['postcode'], '', '', '', '', $params['country'], $params['address1'] . (!empty($params['address2']) ? " {$params['address2']}" : ''), $params['city'], $params['state'], TRUE, $params['companyname'], (($userDetails['RoleId'] == 2) ? TRUE : FALSE)); + $wsp->update_user_details($userDetails['RoleId'], (($userDetails['RoleId'] == 2) ? 'Reseller' : 'User'), $userDetails['StatusId'], $userDetails['Status'], $userDetails['LoginStatusId'], $userDetails['LoginStatus'], $userDetails['FailedLogins'], $userDetails['UserId'], $userDetails['OwnerId'], $userDetails['Created'], $userDetails['Changed'], $userDetails['IsDemo'], $userDetails['IsPeer'], $currentRoot->Comments, $userDetails['Username'], $userDetails['Password'], $params['firstname'], $params['lastname'], $params['email'], $params['phonenumber'], $params['postcode'], '', '', '', '', $params['country'], $params['address1'] . (!empty($params['address2']) ? " {$params['address2']}" : ''), $params['city'], $params['state'], TRUE, $params['companyname'], (($userDetails['RoleId'] == 2) ? TRUE : FALSE)); // Add log entry to client log logactivity("WebsitePanel Sync - Account {$currentRoot->Username} contact details updated successfully", $params['userid']); From e2052bc29c3dc984128334f49772cfb4d081c5f5 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Wed, 26 Dec 2012 14:02:35 -0500 Subject: [PATCH 14/26] Added tag build-2.0.0.224 for changeset a0f0e8750846 From de2ad5deed4da5501df990f240bc04018849aa77 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Wed, 26 Dec 2012 14:28:46 -0500 Subject: [PATCH 15/26] Added tag build-2.0.0.225 for changeset a32aa808994d From 9810f1cd74953f11bc4a8657bffa4711105300bc Mon Sep 17 00:00:00 2001 From: ruslanht Date: Thu, 27 Dec 2012 12:52:44 +0200 Subject: [PATCH 16/26] Helicon Ape module & handler names fixed --- .../WebsitePanel.Providers.Web.IIS70/IIs70.cs | 55 ++++++++++--------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs index dddd9d7e..a9e02df8 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs @@ -101,7 +101,11 @@ namespace WebsitePanel.Providers.Web public const string DOTNETPANEL_IISMODULES = "DotNetPanel.IIsModules"; - public const string HeliconApeModule = "Helicon.Ape"; + public const string HeliconApeModulePrevName = "Helicon Ape"; + // true module name + public const string HeliconApeModule = "Helicon.Ape"; + // true handler name + public const string HeliconApeHandler = "Helicon.Ape Handler"; public const string HeliconApeHandlerPath = "*.apehandler"; public const string IsapiModule = "IsapiModule"; @@ -1861,6 +1865,9 @@ namespace WebsitePanel.Providers.Web #endregion + + + #region Helicon Ape public override HeliconApeStatus GetHeliconApeStatus(string siteId) @@ -1895,7 +1902,11 @@ namespace WebsitePanel.Providers.Web foreach (var moduleEntry in modulesCollection) { - if (String.Equals(moduleEntry["name"].ToString(), Constants.HeliconApeModule, StringComparison.InvariantCultureIgnoreCase)) + if ( + String.Equals(moduleEntry["name"].ToString(), Constants.HeliconApeModule, StringComparison.InvariantCultureIgnoreCase) + || + String.Equals(moduleEntry["name"].ToString(), Constants.HeliconApeModulePrevName, StringComparison.InvariantCultureIgnoreCase) + ) return true; } // @@ -2262,17 +2273,7 @@ namespace WebsitePanel.Providers.Web ConfigurationSection modulesSection = appConfig.GetSection(Constants.ModulesSection, siteId); ConfigurationElementCollection modulesCollection = modulesSection.GetCollection(); - /* - if ("" != siteId) - { - // - ConfigurationElement removeHeliconApeModuleEntry = modulesCollection.CreateElement("remove"); - removeHeliconApeModuleEntry["name"] = Constants.HeliconApeModule; - modulesCollection.Add(removeHeliconApeModuleEntry); - } - */ - - // add name="Helicon.Ape" /> + // ConfigurationElement heliconApeModuleEntry = modulesCollection.CreateElement("add"); heliconApeModuleEntry["name"] = Constants.HeliconApeModule; heliconApeModuleEntry["type"] = GetHeliconApeModuleType(siteId); @@ -2289,19 +2290,9 @@ namespace WebsitePanel.Providers.Web ConfigurationSection handlersSection = appConfig.GetSection(Constants.HandlersSection, siteId); ConfigurationElementCollection handlersCollection = handlersSection.GetCollection(); - /* - if ("" != siteId) - { - // - ConfigurationElement removeHeliconApeHandlerEntry = handlersCollection.CreateElement("remove"); - removeHeliconApeHandlerEntry["name"] = Constants.HeliconApeModule; - handlersCollection.Add(removeHeliconApeHandlerEntry); - } - */ - - // add name="Helicon.Ape" /> + // ConfigurationElement heliconApeHandlerEntry = handlersCollection.CreateElement("add"); - heliconApeHandlerEntry["name"] = Constants.HeliconApeModule; + heliconApeHandlerEntry["name"] = Constants.HeliconApeHandler; heliconApeHandlerEntry["type"] = GetHeliconApeHandlerType(siteId); heliconApeHandlerEntry["path"] = Constants.HeliconApeHandlerPath; heliconApeHandlerEntry["verb"] = "*"; @@ -2335,7 +2326,11 @@ namespace WebsitePanel.Providers.Web List heliconApeModuleEntriesList = new List(); foreach (ConfigurationElement moduleEntry in modulesCollection) { - if (String.Equals(moduleEntry["name"].ToString(), Constants.HeliconApeModule, StringComparison.InvariantCultureIgnoreCase)) + if ( + String.Equals(moduleEntry["name"].ToString(), Constants.HeliconApeModule, StringComparison.InvariantCultureIgnoreCase) + || + String.Equals(moduleEntry["name"].ToString(), Constants.HeliconApeModulePrevName, StringComparison.InvariantCultureIgnoreCase) + ) { heliconApeModuleEntriesList.Add(moduleEntry); } @@ -2351,7 +2346,13 @@ namespace WebsitePanel.Providers.Web List heliconApeHandlerEntriesList = new List(); foreach (ConfigurationElement handlerEntry in handlersCollection) { - if (String.Equals(handlerEntry["name"].ToString(), Constants.HeliconApeModule, StringComparison.InvariantCultureIgnoreCase)) + if ( + String.Equals(handlerEntry["name"].ToString(), Constants.HeliconApeModule, StringComparison.InvariantCultureIgnoreCase) + || + String.Equals(handlerEntry["name"].ToString(), Constants.HeliconApeModulePrevName, StringComparison.InvariantCultureIgnoreCase) + || + String.Equals(handlerEntry["name"].ToString(), Constants.HeliconApeHandler, StringComparison.InvariantCultureIgnoreCase) + ) { heliconApeHandlerEntriesList.Add(handlerEntry); } From 10d8100f8278a0925d11f1e366d7a3a80f718334 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Thu, 27 Dec 2012 11:27:49 -0500 Subject: [PATCH 17/26] Added tag build-2.0.0.226 for changeset eaaa9fcec9dc From db8630cdc676810bc13b517d3828063018ac0590 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Thu, 27 Dec 2012 11:38:34 -0500 Subject: [PATCH 18/26] Added tag build-2.0.0.227 for changeset a1c1c58ca61d From b99e9a86dddda2baa822c00ec88669ad5080c62e Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Thu, 27 Dec 2012 11:42:38 -0500 Subject: [PATCH 19/26] Added tag build-2.0.0.228 for changeset bc50d241fef8 From c5fa9db2cbce3f12a90743010a3a2041e452c44a Mon Sep 17 00:00:00 2001 From: Sergey Date: Sat, 29 Dec 2012 17:24:11 +0200 Subject: [PATCH 20/26] fix: GetHeliconApeVersion for old version of Ape --- .../WebsitePanel.Providers.Web.IIS70/IIs70.cs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs index a9e02df8..a6a5d76b 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs @@ -2037,6 +2037,19 @@ namespace WebsitePanel.Providers.Web return System.Diagnostics.FileVersionInfo.GetVersionInfo(apeModulePath).FileVersion; } + apeModulePath = Path.Combine(installDir, "ManualInstall\\bin\\Helicon.Ape.dll"); + if (File.Exists(apeModulePath)) + { + return System.Diagnostics.FileVersionInfo.GetVersionInfo(apeModulePath).FileVersion; + } + + apeModulePath = Path.Combine(installDir, "Helicon.Ape.dll"); + if (File.Exists(apeModulePath)) + { + return System.Diagnostics.FileVersionInfo.GetVersionInfo(apeModulePath).FileVersion; + } + + return HELICON_APE_NOT_REGISTERED; } From 9d705568ec1b2a73ea0df42b1bc001be5b375d12 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Sat, 29 Dec 2012 10:56:20 -0500 Subject: [PATCH 21/26] Added tag build-2.0.0.229 for changeset aba604d18820 From 56ec2b3b2051c945ec23a9149e85e098e6625d90 Mon Sep 17 00:00:00 2001 From: Christopher York Date: Sat, 29 Dec 2012 23:45:50 -0600 Subject: [PATCH 22/26] Fixed: Do not run WebsitePanel hooks / addons when not enabled or fully configured --- .../includes/hooks/websitepanel_addons.php | 5 +++++ .../includes/hooks/websitepanel_sync.php | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/WebsitePanel.WHMCSModule/includes/hooks/websitepanel_addons.php b/WebsitePanel.WHMCSModule/includes/hooks/websitepanel_addons.php index 25de3672..4666d0e4 100644 --- a/WebsitePanel.WHMCSModule/includes/hooks/websitepanel_addons.php +++ b/WebsitePanel.WHMCSModule/includes/hooks/websitepanel_addons.php @@ -54,6 +54,11 @@ function websitepanel_addons_AddonActivation($params) // Retrieve the WebsitePanel Addons module settings $modSettings = websitepanel_addons_GetSettings(); + if (empty($modSettings['username']) || empty($modSettings['password'])) || empty($modSettings['serverhost'])) || empty($modSettings['serverport']))) + { + // The module is disabled or has not yet been configured - stop + return; + } // Get the associated WebsitePanel username from WHMCS $results = select_query('tblhosting', 'username', array('id' => $params['serviceid'])); diff --git a/WebsitePanel.WHMCSModule/includes/hooks/websitepanel_sync.php b/WebsitePanel.WHMCSModule/includes/hooks/websitepanel_sync.php index bf3582ac..1487b98e 100644 --- a/WebsitePanel.WHMCSModule/includes/hooks/websitepanel_sync.php +++ b/WebsitePanel.WHMCSModule/includes/hooks/websitepanel_sync.php @@ -53,6 +53,11 @@ function websitepanel_sync_ClientEdit($params) // Retrieve the WebsitePanel Addons module settings $modSettings = websitepanel_sync_GetSettings(); + if (empty($modSettings['username']) || empty($modSettings['password'])) || empty($modSettings['serverhost'])) || empty($modSettings['serverport']))) + { + // The module is disabled or has not yet been configured - stop + return; + } // Create the WebsitePanel object instance $wsp = new WebsitePanel($modSettings['username'], $modSettings['password'], $modSettings['serverhost'], $modSettings['serverport'], (($modSettings['serversecured']) == 'on' ? TRUE : FALSE)); From 4e0d1d209bfbd8139e4865208f5148b6051cf205 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Tue, 1 Jan 2013 18:29:00 -0500 Subject: [PATCH 23/26] Remove dependence to Domain Alias Quota on Add a Domain Page. This Quota has been removed. Update Text on Domain Type page and Domain Add Page to reduce confusion on elimination of Aliases --- .../App_LocalResources/DomainsAddDomain.ascx.resx | 4 ++-- .../DomainsAddDomainSelectType.ascx.resx | 8 ++++---- .../DesktopModules/WebsitePanel/DomainsAddDomain.ascx | 4 ++-- .../DesktopModules/WebsitePanel/DomainsAddDomain.ascx.cs | 4 ++-- .../WebsitePanel/DomainsAddDomain.ascx.designer.cs | 2 +- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/DomainsAddDomain.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/DomainsAddDomain.ascx.resx index 49b87726..2389512c 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/DomainsAddDomain.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/DomainsAddDomain.ascx.resx @@ -163,10 +163,10 @@ Provisioning Options
- Point to existing Mail Domain + Assign to existing Mail Domain - Point to existing Web Site + Assign to existing Web Site Please, enter correct sub-domain name, for example "subdomain" or "sub.subdomain". diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/DomainsAddDomainSelectType.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/DomainsAddDomainSelectType.ascx.resx index 0a0fbe79..007137a7 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/DomainsAddDomainSelectType.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/DomainsAddDomainSelectType.ascx.resx @@ -121,13 +121,13 @@ Cancel - Create a Top-Level Domain (TLD). + Create a Top-Level Domain (TLD). You can create a new web site for domain or assign it to an existing web site. Domain - Create a Top-Level Domain (TLD) or sub-domain that could point to the existing web site only. + Create a Top-Level Domain (TLD) or sub-domain that can point to the existing web site only. Domain Alias @@ -136,13 +136,13 @@ Please choose what type of domain you would like to add: - Create a sub-domain under domains allowed by your hosting provider. You could create a new web site for sub-domain or point it to existing one. + Create a sub-domain under domains allowed by your hosting provider. You can create a new web site for sub-domain or assign it to an existing web site. Provider Sub-domain - Create a sub-domain for already added top-level domain. You could create a new web site for sub-domain. + Create a sub-domain for already added top-level domain. You can create a new web site for sub-domain or assign it to an existing web site. Sub-domain diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsAddDomain.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsAddDomain.ascx index b84c69b0..2f5a009f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsAddDomain.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsAddDomain.ascx @@ -47,7 +47,7 @@ -
@@ -55,7 +55,7 @@ -
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsAddDomain.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsAddDomain.ascx.cs index 9fe39c8f..09bfaa8f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsAddDomain.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsAddDomain.ascx.cs @@ -130,12 +130,12 @@ namespace WebsitePanel.Portal } // point Web site - PointWebSitePanel.Visible = (type == DomainType.DomainPointer || (type == DomainType.Domain && !cntx.Quotas[Quotas.OS_DOMAINPOINTERS].QuotaExhausted)) + PointWebSitePanel.Visible = (type == DomainType.DomainPointer || (type == DomainType.Domain)) && cntx.Groups.ContainsKey(ResourceGroups.Web) && WebSitesList.Items.Count > 0; WebSitesList.Enabled = PointWebSite.Checked; // point mail domain - PointMailDomainPanel.Visible = (type == DomainType.DomainPointer || (type == DomainType.Domain && !cntx.Quotas[Quotas.OS_DOMAINPOINTERS].QuotaExhausted)) + PointMailDomainPanel.Visible = (type == DomainType.DomainPointer || (type == DomainType.Domain)) && cntx.Groups.ContainsKey(ResourceGroups.Mail) && MailDomainsList.Items.Count > 0; MailDomainsList.Enabled = PointMailDomain.Checked; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsAddDomain.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsAddDomain.ascx.designer.cs index da29aa39..835fabf2 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsAddDomain.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsAddDomain.ascx.designer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2011, Outercurve Foundation. +// Copyright (c) 2012, Outercurve Foundation. // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, From 7629c11dcf2f85069283d8407139183971701437 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Tue, 1 Jan 2013 18:36:47 -0500 Subject: [PATCH 24/26] Added tag build-2.0.0.230 for changeset b52536485514 From ae52fd23a56a4ff582c076bbe4674e28c74e6c46 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Tue, 1 Jan 2013 18:45:38 -0500 Subject: [PATCH 25/26] Further Changes to Domain Add Page --- .../DesktopModules/WebsitePanel/DomainsAddDomain.ascx.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsAddDomain.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsAddDomain.ascx.cs index 09bfaa8f..f9761a23 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsAddDomain.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsAddDomain.ascx.cs @@ -99,14 +99,14 @@ namespace WebsitePanel.Portal // load package context PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); - if ((type == DomainType.DomainPointer || (type == DomainType.Domain && !cntx.Quotas[Quotas.OS_DOMAINPOINTERS].QuotaExhausted)) && !IsPostBack) + if ((type == DomainType.DomainPointer || (type == DomainType.Domain)) && !IsPostBack) { // bind web sites WebSitesList.DataSource = ES.Services.WebServers.GetWebSites(PanelSecurity.PackageId, false); WebSitesList.DataBind(); } - if ((type == DomainType.DomainPointer || (type == DomainType.Domain && !cntx.Quotas[Quotas.OS_DOMAINPOINTERS].QuotaExhausted)) && !IsPostBack) + if ((type == DomainType.DomainPointer || (type == DomainType.Domain)) && !IsPostBack) { // bind mail domains MailDomainsList.DataSource = ES.Services.MailServers.GetMailDomains(PanelSecurity.PackageId, false); @@ -205,14 +205,14 @@ namespace WebsitePanel.Portal // load package context PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); - if (type == DomainType.DomainPointer || (type == DomainType.Domain && !cntx.Quotas[Quotas.OS_DOMAINPOINTERS].QuotaExhausted)) + if (type == DomainType.DomainPointer || (type == DomainType.Domain)) { if (PointWebSite.Checked && WebSitesList.Items.Count > 0) pointWebSiteId = Utils.ParseInt(WebSitesList.SelectedValue, 0); } - if (type == DomainType.DomainPointer || (type == DomainType.Domain && !cntx.Quotas[Quotas.OS_DOMAINPOINTERS].QuotaExhausted)) + if (type == DomainType.DomainPointer || (type == DomainType.Domain)) { if (PointMailDomain.Checked && MailDomainsList.Items.Count > 0) pointMailDomainId = Utils.ParseInt(MailDomainsList.SelectedValue, 0); From ad9da816b845055446d919115e582b8318e0a86f Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Tue, 1 Jan 2013 18:51:16 -0500 Subject: [PATCH 26/26] Added tag build-2.0.0.231 for changeset 632f2638fb11