merge commit

This commit is contained in:
robvde 2013-01-04 17:04:17 +04:00
commit 2af7c5a820
25 changed files with 564 additions and 178 deletions

View file

@ -54,6 +54,11 @@ function websitepanel_addons_AddonActivation($params)
// Retrieve the WebsitePanel Addons module settings // Retrieve the WebsitePanel Addons module settings
$modSettings = websitepanel_addons_GetSettings(); $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 // Get the associated WebsitePanel username from WHMCS
$results = select_query('tblhosting', 'username', array('id' => $params['serviceid'])); $results = select_query('tblhosting', 'username', array('id' => $params['serviceid']));

View file

@ -53,6 +53,11 @@ function websitepanel_sync_ClientEdit($params)
// Retrieve the WebsitePanel Addons module settings // Retrieve the WebsitePanel Addons module settings
$modSettings = websitepanel_sync_GetSettings(); $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 // Create the WebsitePanel object instance
$wsp = new WebsitePanel($modSettings['username'], $modSettings['password'], $modSettings['serverhost'], $modSettings['serverport'], (($modSettings['serversecured']) == 'on' ? TRUE : FALSE)); $wsp = new WebsitePanel($modSettings['username'], $modSettings['password'], $modSettings['serverhost'], $modSettings['serverport'], (($modSettings['serversecured']) == 'on' ? TRUE : FALSE));
@ -74,9 +79,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 // 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; $currentRoot = $rootPath->Table1->$i;
$userDetails = (array)$wsp->get_user_by_username($currentRoot->Username); $userDetails = (array)$wsp->get_user_by_username($currentRoot->Username);
// Update the current user // 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 // Add log entry to client log
logactivity("WebsitePanel Sync - Account {$currentRoot->Username} contact details updated successfully", $params['userid']); logactivity("WebsitePanel Sync - Account {$currentRoot->Username} contact details updated successfully", $params['userid']);

View file

@ -164,6 +164,10 @@ namespace WebsitePanel.EnterpriseServer {
private System.Threading.SendOrPostCallback DisableHeliconApeOperationCompleted; private System.Threading.SendOrPostCallback DisableHeliconApeOperationCompleted;
private System.Threading.SendOrPostCallback EnableHeliconApeGloballyOperationCompleted;
private System.Threading.SendOrPostCallback DisableHeliconApeGloballyOperationCompleted;
private System.Threading.SendOrPostCallback GetHeliconApeFoldersOperationCompleted; private System.Threading.SendOrPostCallback GetHeliconApeFoldersOperationCompleted;
private System.Threading.SendOrPostCallback GetHeliconApeHttpdFolderOperationCompleted; private System.Threading.SendOrPostCallback GetHeliconApeHttpdFolderOperationCompleted;
@ -384,6 +388,12 @@ namespace WebsitePanel.EnterpriseServer {
/// <remarks/> /// <remarks/>
public event DisableHeliconApeCompletedEventHandler DisableHeliconApeCompleted; public event DisableHeliconApeCompletedEventHandler DisableHeliconApeCompleted;
/// <remarks/>
public event EnableHeliconApeGloballyCompletedEventHandler EnableHeliconApeGloballyCompleted;
/// <remarks/>
public event DisableHeliconApeGloballyCompletedEventHandler DisableHeliconApeGloballyCompleted;
/// <remarks/> /// <remarks/>
public event GetHeliconApeFoldersCompletedEventHandler GetHeliconApeFoldersCompleted; public event GetHeliconApeFoldersCompletedEventHandler GetHeliconApeFoldersCompleted;
@ -2705,6 +2715,88 @@ namespace WebsitePanel.EnterpriseServer {
} }
} }
/// <remarks/>
[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]));
}
/// <remarks/>
public System.IAsyncResult BeginEnableHeliconApeGlobally(int serviceId, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("EnableHeliconApeGlobally", new object[] {
serviceId}, callback, asyncState);
}
/// <remarks/>
public int EndEnableHeliconApeGlobally(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((int)(results[0]));
}
/// <remarks/>
public void EnableHeliconApeGloballyAsync(int serviceId) {
this.EnableHeliconApeGloballyAsync(serviceId, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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]));
}
/// <remarks/>
public System.IAsyncResult BeginDisableHeliconApeGlobally(int serviceId, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("DisableHeliconApeGlobally", new object[] {
serviceId}, callback, asyncState);
}
/// <remarks/>
public int EndDisableHeliconApeGlobally(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((int)(results[0]));
}
/// <remarks/>
public void DisableHeliconApeGloballyAsync(int serviceId) {
this.DisableHeliconApeGloballyAsync(serviceId, null);
}
/// <remarks/>
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));
}
}
/// <remarks/> /// <remarks/>
[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)] [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) { public HtaccessFolder[] GetHeliconApeFolders(int siteItemId) {
@ -5332,6 +5424,58 @@ namespace WebsitePanel.EnterpriseServer {
} }
} }
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void EnableHeliconApeGloballyCompletedEventHandler(object sender, EnableHeliconApeGloballyCompletedEventArgs e);
/// <remarks/>
[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;
}
/// <remarks/>
public int Result {
get {
this.RaiseExceptionIfNecessary();
return ((int)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void DisableHeliconApeGloballyCompletedEventHandler(object sender, DisableHeliconApeGloballyCompletedEventArgs e);
/// <remarks/>
[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;
}
/// <remarks/>
public int Result {
get {
this.RaiseExceptionIfNecessary();
return ((int)(this.results[0]));
}
}
}
/// <remarks/> /// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void GetHeliconApeFoldersCompletedEventHandler(object sender, GetHeliconApeFoldersCompletedEventArgs e); public delegate void GetHeliconApeFoldersCompletedEventHandler(object sender, GetHeliconApeFoldersCompletedEventArgs e);

View file

@ -2869,7 +2869,6 @@ namespace WebsitePanel.EnterpriseServer
#endregion #endregion
#region Helicon Ape #region Helicon Ape
public static int EnableHeliconApe(int siteItemId) public static int EnableHeliconApe(int siteItemId)
{ {
@ -2939,7 +2938,48 @@ namespace WebsitePanel.EnterpriseServer
} }
} }
/// <summary> /// <summary>
/// Enables Helicon Ape on the server globally. Requires Administrator role to execute.
/// </summary>
/// <param name="ServiceId"></param>
/// <returns></returns>
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;
}
/// <summary>
/// Disables Helicon Ape on the server globally. Requires Administrator role to execute.
/// </summary>
/// <param name="ServiceId"></param>
/// <returns></returns>
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;
}
/// <summary>
/// Retrieves Helicon Ape extension status from the server. Requires Administrator role to execute. /// Retrieves Helicon Ape extension status from the server. Requires Administrator role to execute.
/// </summary> /// </summary>
/// <param name="ServiceId"></param> /// <param name="ServiceId"></param>

View file

@ -378,6 +378,18 @@ namespace WebsitePanel.EnterpriseServer
return WebServerController.DisableHeliconApe(siteItemId); 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] [WebMethod]
public HtaccessFolder[] GetHeliconApeFolders(int siteItemId) public HtaccessFolder[] GetHeliconApeFolders(int siteItemId)
{ {

View file

@ -51,7 +51,7 @@ namespace WebsitePanel.Providers.Web
#endregion #endregion
#region parsing regexps #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_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_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); protected static readonly Regex RE_AUTH_PROVIDER = new Regex(@"^\s*Auth(Basic|Digest)Provider\s+(file)\s*$", RegexOptions.IgnoreCase | RegexOptions.Multiline | RegexOptions.Compiled);

View file

@ -30,6 +30,7 @@ using System;
using System.ComponentModel; using System.ComponentModel;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.Specialized; using System.Collections.Specialized;
using WebsitePanel.Providers.ResultObjects;
namespace WebsitePanel.Providers.Web namespace WebsitePanel.Providers.Web
{ {
@ -61,6 +62,7 @@ namespace WebsitePanel.Providers.Web
private bool securedFoldersInstalled; private bool securedFoldersInstalled;
private bool heliconApeInstalled; private bool heliconApeInstalled;
private bool heliconApeEnabled; private bool heliconApeEnabled;
private HeliconApeStatus heliconApeStatus;
public WebSite() public WebSite()
{ {
@ -179,6 +181,12 @@ namespace WebsitePanel.Providers.Web
get { return this.heliconApeEnabled; } get { return this.heliconApeEnabled; }
set { this.heliconApeEnabled = value; } set { this.heliconApeEnabled = value; }
} }
public HeliconApeStatus HeliconApeStatus
{
get { return this.heliconApeStatus; }
set { this.heliconApeStatus = value; }
}
} }
[Flags] [Flags]

View file

@ -39,7 +39,7 @@ using WebsitePanel.Server.Utils;
using WebsitePanel.Providers.Utils; using WebsitePanel.Providers.Utils;
using WebsitePanel.Providers; using WebsitePanel.Providers;
using System.Reflection; using System.Reflection;
using System.Data.Common;
namespace WebsitePanel.Providers.Database namespace WebsitePanel.Providers.Database
{ {
@ -129,49 +129,36 @@ namespace WebsitePanel.Providers.Database
static System.Reflection.Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) static System.Reflection.Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
{ {
//
//
if (!args.Name.Contains("MySql.Data")) if (!args.Name.Contains("MySql.Data"))
return null; return null;
if (args.Name.Contains("MySql.Data.resources"))
return null;
// //
string connectorKeyName = "SOFTWARE\\MySQL AB\\MySQL Connector/Net"; string connectorKeyName = "SOFTWARE\\MySQL AB\\MySQL Connector/Net";
string connectorLocation = String.Empty;
string connectorVersion = String.Empty; string connectorVersion = String.Empty;
// //
if (PInvoke.RegistryHive.HKLM.SubKeyExists_x86(connectorKeyName)) if (PInvoke.RegistryHive.HKLM.SubKeyExists_x86(connectorKeyName))
{ {
connectorLocation = PInvoke.RegistryHive.HKLM.GetSubKeyValue_x86(connectorKeyName, "Location");
connectorVersion = PInvoke.RegistryHive.HKLM.GetSubKeyValue_x86(connectorKeyName, "Version"); 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 return null; //avoid of stack overflow
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 Assembly.LoadFrom(assemblyPath);
return Assembly.Load(assemblyFullName);
} }
#endregion #endregion
@ -185,8 +172,14 @@ namespace WebsitePanel.Providers.Database
public virtual bool CheckConnectivity(string databaseName, string username, string password) 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}", MySqlConnection conn = new MySqlConnection(
ServerName, ServerPort, databaseName, username, password)); String.Format("server={0};port={1};database={2};uid={3};password={4}",
ServerName,
ServerPort,
databaseName,
username,
password)
);
try try
{ {
conn.Open(); conn.Open();

View file

@ -32,7 +32,7 @@ using System.Text;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Data; using System.Data;
using Microsoft.Win32; using Microsoft.Win32;
using MySql.Data.MySqlClient; //using MySql.Data.MySqlClient;
using System.IO; using System.IO;
using WebsitePanel.Server.Utils; using WebsitePanel.Server.Utils;

View file

@ -101,7 +101,11 @@ namespace WebsitePanel.Providers.Web
public const string DOTNETPANEL_IISMODULES = "DotNetPanel.IIsModules"; 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 HeliconApeHandlerPath = "*.apehandler";
public const string IsapiModule = "IsapiModule"; public const string IsapiModule = "IsapiModule";
@ -1165,6 +1169,7 @@ namespace WebsitePanel.Providers.Web
HeliconApeStatus heliconApeStatus = GetHeliconApeStatus(srvman, siteId); HeliconApeStatus heliconApeStatus = GetHeliconApeStatus(srvman, siteId);
site.HeliconApeInstalled = heliconApeStatus.IsInstalled; site.HeliconApeInstalled = heliconApeStatus.IsInstalled;
site.HeliconApeEnabled = heliconApeStatus.IsEnabled; site.HeliconApeEnabled = heliconApeStatus.IsEnabled;
site.HeliconApeStatus = heliconApeStatus;
// //
site.SiteState = GetSiteState(srvman, siteId); site.SiteState = GetSiteState(srvman, siteId);
@ -1860,6 +1865,9 @@ namespace WebsitePanel.Providers.Web
#endregion #endregion
#region Helicon Ape #region Helicon Ape
public override HeliconApeStatus GetHeliconApeStatus(string siteId) public override HeliconApeStatus GetHeliconApeStatus(string siteId)
@ -1894,7 +1902,11 @@ namespace WebsitePanel.Providers.Web
foreach (var moduleEntry in modulesCollection) 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; return true;
} }
// //
@ -1986,7 +1998,13 @@ namespace WebsitePanel.Providers.Web
private string GetHeliconApeInstallDir(string siteId) private string GetHeliconApeInstallDir(string siteId)
{ {
//Check global registration //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) private bool IsHeliconApeInstalled(ServerManager srvman, string siteId, string installDir)
@ -2013,7 +2031,26 @@ namespace WebsitePanel.Providers.Web
if (string.IsNullOrEmpty(installDir)) if (string.IsNullOrEmpty(installDir))
return HELICON_APE_NOT_REGISTERED; 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;
}
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;
} }
private string GetHeliconApeModuleType(string siteId) private string GetHeliconApeModuleType(string siteId)
@ -2147,120 +2184,150 @@ namespace WebsitePanel.Providers.Web
return registrationInfo.StartsWith("Registered to:"); return registrationInfo.StartsWith("Registered to:");
} }
/// <summary>
/// Enables Helicon Ape module & handler on the web site or server globally.
/// </summary>
/// <param name="siteId">
/// Web site id or empty string ("") for server-wide enabling
/// </param>
public override void EnableHeliconApe(string siteId) public override void EnableHeliconApe(string siteId)
{ {
WebSite webSite = null; if (null == siteId)
using (ServerManager srvman = webObjectsSvc.GetServerManager())
{ {
// throw new ArgumentNullException("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);
} }
// if ("" != 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)
{ {
// Lookup for the opposite pool matching the criteria // prepare enabling Ape for web site
var oppositePool = Array.Find<WebAppPool>(aphl.SupportedAppPools.ToArray(),
x => aphl.dotNetVersion(x.Mode) == dotNetVersion && aphl.isolation(x.Mode) == sisMode WebSite webSite = null;
&& aphl.pipeline(x.Mode) == SiteAppPoolMode.Integrated); using (ServerManager srvman = webObjectsSvc.GetServerManager())
// {
webSite.AspNetInstalled = oppositePool.AspNetInstalled; // Helicon.Ape.ApeModule works for apps working in Integrated Pipeline mode
// // Switch automatically to the app pool with Integrated Pipeline enabled
SetWebSiteApplicationPool(webSite, false); 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<WebAppPool>(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()) using (var srvman = webObjectsSvc.GetServerManager())
{ {
var iisSiteObject = srvman.Sites[siteId]; PropertyBag winAuthBag = winAuthSvc.GetAuthenticationSettings(srvman, siteId);
iisSiteObject.Applications["/"].ApplicationPoolName = webSite.ApplicationPool;
// //
srvman.CommitChanges(); if ((bool) winAuthBag[AuthenticationGlobals.Enabled])
} {
} Configuration config = srvman.GetApplicationHostConfiguration();
#region Disable automatically Integrated Windows Authentication ConfigurationSection windowsAuthenticationSection = config.GetSection(
using (var srvman = webObjectsSvc.GetServerManager()) "system.webServer/security/authentication/windowsAuthentication",
{ siteId);
PropertyBag winAuthBag = winAuthSvc.GetAuthenticationSettings(srvman, siteId); //
// windowsAuthenticationSection["enabled"] = false;
if ((bool)winAuthBag[AuthenticationGlobals.Enabled]) //
srvman.CommitChanges();
}
}
#endregion
#region Disable automatically Secured Folders
if (IsSecuredFoldersInstalled(siteId))
{ {
Configuration config = srvman.GetApplicationHostConfiguration(); UninstallSecuredFolders(siteId);
ConfigurationSection windowsAuthenticationSection = config.GetSection(
"system.webServer/security/authentication/windowsAuthentication",
siteId);
//
windowsAuthenticationSection["enabled"] = false;
//
srvman.CommitChanges();
} }
#endregion
} }
#endregion
#region Disable automatically Secured Folders
if (IsSecuredFoldersInstalled(siteId))
{
UninstallSecuredFolders(siteId);
}
#endregion
//
using (var srvman = webObjectsSvc.GetServerManager()) using (var srvman = webObjectsSvc.GetServerManager())
{ {
//
Configuration appConfig = srvman.GetApplicationHostConfiguration(); Configuration appConfig = srvman.GetApplicationHostConfiguration();
// add Helicon.Ape module // add Helicon.Ape module
ConfigurationSection modulesSection = appConfig.GetSection(Constants.ModulesSection, siteId); ConfigurationSection modulesSection = appConfig.GetSection(Constants.ModulesSection, siteId);
ConfigurationElementCollection modulesCollection = modulesSection.GetCollection(); ConfigurationElementCollection modulesCollection = modulesSection.GetCollection();
ConfigurationElement moduleAdd = modulesCollection.CreateElement("add");
moduleAdd["name"] = Constants.HeliconApeModule;
moduleAdd["type"] = GetHeliconApeModuleType(siteId);
//
modulesCollection.Add(moduleAdd);
// <add name="Helicon.Ape" />
ConfigurationElement heliconApeModuleEntry = modulesCollection.CreateElement("add");
heliconApeModuleEntry["name"] = Constants.HeliconApeModule;
heliconApeModuleEntry["type"] = GetHeliconApeModuleType(siteId);
// this way make <clear/> 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 // add Helicon.Ape handler
ConfigurationSection handlersSection = appConfig.GetSection(Constants.HandlersSection, siteId); ConfigurationSection handlersSection = appConfig.GetSection(Constants.HandlersSection, siteId);
ConfigurationElementCollection handlersCollection = handlersSection.GetCollection(); ConfigurationElementCollection handlersCollection = handlersSection.GetCollection();
ConfigurationElement handlerAdd = handlersCollection.CreateElement("add");
handlerAdd["name"] = Constants.HeliconApeModule; // <add name="Helicon.Ape" />
handlerAdd["type"] = GetHeliconApeHandlerType(siteId); ConfigurationElement heliconApeHandlerEntry = handlersCollection.CreateElement("add");
handlerAdd["path"] = Constants.HeliconApeHandlerPath; heliconApeHandlerEntry["name"] = Constants.HeliconApeHandler;
handlerAdd["verb"] = "*"; heliconApeHandlerEntry["type"] = GetHeliconApeHandlerType(siteId);
handlerAdd["resourceType"] = "Unspecified"; heliconApeHandlerEntry["path"] = Constants.HeliconApeHandlerPath;
// heliconApeHandlerEntry["verb"] = "*";
handlersCollection.Add(handlerAdd); heliconApeHandlerEntry["resourceType"] = "Unspecified";
//
handlersCollection.AddAt(0, heliconApeHandlerEntry);
srvman.CommitChanges(); srvman.CommitChanges();
} }
} }
/// <summary>
/// Disables Helicon Ape module & handler on the web site or server globally.
/// </summary>
/// <param name="siteId">
/// Web site id or empty string ("") for server-wide disabling
/// </param>
public override void DisableHeliconApe(string siteId) public override void DisableHeliconApe(string siteId)
{ {
// if (null == siteId)
if (String.IsNullOrEmpty(siteId))
throw new ArgumentNullException("siteId"); throw new ArgumentNullException("siteId");
//
using (var srvman = webObjectsSvc.GetServerManager()) using (var srvman = webObjectsSvc.GetServerManager())
{ {
// //
@ -2269,40 +2336,48 @@ namespace WebsitePanel.Providers.Web
// remove Helicon.Ape module // remove Helicon.Ape module
ConfigurationSection modulesSection = appConfig.GetSection(Constants.ModulesSection, siteId); ConfigurationSection modulesSection = appConfig.GetSection(Constants.ModulesSection, siteId);
ConfigurationElementCollection modulesCollection = modulesSection.GetCollection(); ConfigurationElementCollection modulesCollection = modulesSection.GetCollection();
ConfigurationElement htaccessModuleEntry = null; List<ConfigurationElement> heliconApeModuleEntriesList = new List<ConfigurationElement>();
foreach (ConfigurationElement moduleEntry in modulesCollection) 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)
)
{ {
htaccessModuleEntry = moduleEntry; heliconApeModuleEntriesList.Add(moduleEntry);
break;
} }
} }
if (htaccessModuleEntry != null) foreach (ConfigurationElement heliconApeElement in heliconApeModuleEntriesList)
{ {
modulesCollection.Remove(htaccessModuleEntry); modulesCollection.Remove(heliconApeElement);
} }
// remove Helicon.Ape handler // remove Helicon.Ape handler
ConfigurationSection handlersSection = appConfig.GetSection(Constants.HandlersSection, siteId); ConfigurationSection handlersSection = appConfig.GetSection(Constants.HandlersSection, siteId);
ConfigurationElementCollection handlersCollection = handlersSection.GetCollection(); ConfigurationElementCollection handlersCollection = handlersSection.GetCollection();
ConfigurationElement htaccessHandlerEntry = null; List<ConfigurationElement> heliconApeHandlerEntriesList = new List<ConfigurationElement>();
foreach (ConfigurationElement handlerEntry in handlersCollection) 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)
)
{ {
htaccessHandlerEntry = handlerEntry; heliconApeHandlerEntriesList.Add(handlerEntry);
break;
} }
} }
// //
if (htaccessHandlerEntry != null) foreach (ConfigurationElement heliconApeHandlerEntry in heliconApeHandlerEntriesList)
{ {
handlersCollection.Remove(htaccessHandlerEntry); handlersCollection.Remove(heliconApeHandlerEntry);
} }
// commit changes to metabase // commit changes to metabase
if (htaccessModuleEntry != null || htaccessHandlerEntry != null) if (heliconApeModuleEntriesList.Count > 0 || heliconApeHandlerEntriesList.Count > 0)
{ {
srvman.CommitChanges(); srvman.CommitChanges();
} }

View file

@ -219,6 +219,12 @@ namespace WebsitePanel.Server.Code
continue; continue;
} }
if (product.GetAttributeValue("searchExclude") != null)
{
// skip it, this is internal not visible product
continue;
}
if (string.IsNullOrEmpty(filter)) if (string.IsNullOrEmpty(filter))
{ {
products.Add(product); products.Add(product);

View file

@ -163,10 +163,10 @@
<value>Provisioning Options</value> <value>Provisioning Options</value>
</data> </data>
<data name="PointMailDomain.Text" xml:space="preserve"> <data name="PointMailDomain.Text" xml:space="preserve">
<value>Point to existing Mail Domain</value> <value>Assign to existing Mail Domain</value>
</data> </data>
<data name="PointWebSite.Text" xml:space="preserve"> <data name="PointWebSite.Text" xml:space="preserve">
<value>Point to existing Web Site</value> <value>Assign to existing Web Site</value>
</data> </data>
<data name="SubDomainFormatValidator.ErrorMessage" xml:space="preserve"> <data name="SubDomainFormatValidator.ErrorMessage" xml:space="preserve">
<value>Please, enter correct sub-domain name, for example "subdomain" or "sub.subdomain".</value> <value>Please, enter correct sub-domain name, for example "subdomain" or "sub.subdomain".</value>

View file

@ -121,13 +121,13 @@
<value>Cancel</value> <value>Cancel</value>
</data> </data>
<data name="DomainDescription.Text" xml:space="preserve"> <data name="DomainDescription.Text" xml:space="preserve">
<value>Create a Top-Level Domain (TLD).</value> <value>Create a Top-Level Domain (TLD). You can create a new web site for domain or assign it to an existing web site.</value>
</data> </data>
<data name="DomainLink.Text" xml:space="preserve"> <data name="DomainLink.Text" xml:space="preserve">
<value>Domain</value> <value>Domain</value>
</data> </data>
<data name="DomainPointerDescription.Text" xml:space="preserve"> <data name="DomainPointerDescription.Text" xml:space="preserve">
<value>Create a Top-Level Domain (TLD) or sub-domain that could point to the existing web site only.</value> <value>Create a Top-Level Domain (TLD) or sub-domain that can point to the existing web site only.</value>
</data> </data>
<data name="DomainPointerLink.Text" xml:space="preserve"> <data name="DomainPointerLink.Text" xml:space="preserve">
<value>Domain Alias</value> <value>Domain Alias</value>
@ -136,13 +136,13 @@
<value>Please choose what type of domain you would like to add:</value> <value>Please choose what type of domain you would like to add:</value>
</data> </data>
<data name="ProviderSubDomainDescription.Text" xml:space="preserve"> <data name="ProviderSubDomainDescription.Text" xml:space="preserve">
<value>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.</value> <value>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.</value>
</data> </data>
<data name="ProviderSubDomainLink.Text" xml:space="preserve"> <data name="ProviderSubDomainLink.Text" xml:space="preserve">
<value>Provider Sub-domain</value> <value>Provider Sub-domain</value>
</data> </data>
<data name="SubDomainDescription.Text" xml:space="preserve"> <data name="SubDomainDescription.Text" xml:space="preserve">
<value>Create a sub-domain for already added top-level domain. You could create a new web site for sub-domain.</value> <value>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.</value>
</data> </data>
<data name="SubDomainLink.Text" xml:space="preserve"> <data name="SubDomainLink.Text" xml:space="preserve">
<value>Sub-domain</value> <value>Sub-domain</value>

View file

@ -252,4 +252,7 @@
<data name="ServerNameValidator.Text" xml:space="preserve"> <data name="ServerNameValidator.Text" xml:space="preserve">
<value>*</value> <value>*</value>
</data> </data>
<data name="lnkPlatformInstaller.Text">
<value xml:space="preserve">Web Platform Installer</value>
</data>
</root> </root>

View file

@ -132,6 +132,9 @@
<data name="EnableHeliconApe.Text" xml:space="preserve"> <data name="EnableHeliconApe.Text" xml:space="preserve">
<value>Enable Helicon Ape</value> <value>Enable Helicon Ape</value>
</data> </data>
<data name="EnableHeliconApeTrial.Text" xml:space="preserve">
<value>Enable Helicon Ape (45 days trial)</value>
</data>
<data name="gvHeliconApeFolders.Empty" xml:space="preserve"> <data name="gvHeliconApeFolders.Empty" xml:space="preserve">
<value>Click "Add Folder" button to add .htaccess folder</value> <value>Click "Add Folder" button to add .htaccess folder</value>
</data> </data>

View file

@ -47,7 +47,7 @@
</asp:Panel> </asp:Panel>
<asp:Panel id="PointWebSitePanel" runat="server" style="padding-bottom: 15px;"> <asp:Panel id="PointWebSitePanel" runat="server" style="padding-bottom: 15px;">
<asp:CheckBox ID="PointWebSite" runat="server" meta:resourcekey="PointWebSite" Text="Point to Web Site" CssClass="Checkbox Bold" <asp:CheckBox ID="PointWebSite" runat="server" meta:resourcekey="PointWebSite" Text="Assign to Web Site" CssClass="Checkbox Bold"
AutoPostBack="true" /><br /> AutoPostBack="true" /><br />
<div style="padding-left: 20px;"> <div style="padding-left: 20px;">
<asp:DropDownList ID="WebSitesList" Runat="server" CssClass="NormalTextBox" DataTextField="Name" DataValueField="ID"></asp:DropDownList> <asp:DropDownList ID="WebSitesList" Runat="server" CssClass="NormalTextBox" DataTextField="Name" DataValueField="ID"></asp:DropDownList>
@ -55,7 +55,7 @@
</asp:Panel> </asp:Panel>
<asp:Panel id="PointMailDomainPanel" runat="server" style="padding-bottom: 15px;"> <asp:Panel id="PointMailDomainPanel" runat="server" style="padding-bottom: 15px;">
<asp:CheckBox ID="PointMailDomain" runat="server" meta:resourcekey="PointMailDomain" Text="Point to Mail Domain" CssClass="Checkbox Bold" <asp:CheckBox ID="PointMailDomain" runat="server" meta:resourcekey="PointMailDomain" Text="Assign to Mail Domain" CssClass="Checkbox Bold"
AutoPostBack="true" /><br /> AutoPostBack="true" /><br />
<div style="padding-left: 20px;"> <div style="padding-left: 20px;">
<asp:DropDownList ID="MailDomainsList" Runat="server" CssClass="NormalTextBox" DataTextField="Name" DataValueField="ID"></asp:DropDownList> <asp:DropDownList ID="MailDomainsList" Runat="server" CssClass="NormalTextBox" DataTextField="Name" DataValueField="ID"></asp:DropDownList>

View file

@ -99,14 +99,14 @@ namespace WebsitePanel.Portal
// load package context // load package context
PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); 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 // bind web sites
WebSitesList.DataSource = ES.Services.WebServers.GetWebSites(PanelSecurity.PackageId, false); WebSitesList.DataSource = ES.Services.WebServers.GetWebSites(PanelSecurity.PackageId, false);
WebSitesList.DataBind(); 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 // bind mail domains
MailDomainsList.DataSource = ES.Services.MailServers.GetMailDomains(PanelSecurity.PackageId, false); MailDomainsList.DataSource = ES.Services.MailServers.GetMailDomains(PanelSecurity.PackageId, false);
@ -130,12 +130,12 @@ namespace WebsitePanel.Portal
} }
// point Web site // 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; && cntx.Groups.ContainsKey(ResourceGroups.Web) && WebSitesList.Items.Count > 0;
WebSitesList.Enabled = PointWebSite.Checked; WebSitesList.Enabled = PointWebSite.Checked;
// point mail domain // 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; && cntx.Groups.ContainsKey(ResourceGroups.Mail) && MailDomainsList.Items.Count > 0;
MailDomainsList.Enabled = PointMailDomain.Checked; MailDomainsList.Enabled = PointMailDomain.Checked;
@ -205,14 +205,14 @@ namespace WebsitePanel.Portal
// load package context // load package context
PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); 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) if (PointWebSite.Checked && WebSitesList.Items.Count > 0)
pointWebSiteId = Utils.ParseInt(WebSitesList.SelectedValue, 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) if (PointMailDomain.Checked && MailDomainsList.Items.Count > 0)
pointMailDomainId = Utils.ParseInt(MailDomainsList.SelectedValue, 0); pointMailDomainId = Utils.ParseInt(MailDomainsList.SelectedValue, 0);

View file

@ -1,4 +1,4 @@
// Copyright (c) 2011, Outercurve Foundation. // Copyright (c) 2012, Outercurve Foundation.
// All rights reserved. // All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without modification, // Redistribution and use in source and binary forms, with or without modification,

View file

@ -151,6 +151,9 @@ namespace WebsitePanel.Portal
ddlTheme.Visible = false; ddlTheme.Visible = false;
lblTheme.Visible = false; lblTheme.Visible = false;
} }
// set focus on username field
txtUsername.Focus();
} }
protected void cmdForgotPassword_Click(object sender, EventArgs e) protected void cmdForgotPassword_Click(object sender, EventArgs e)

View file

@ -202,7 +202,11 @@
<value>.htaccess</value> <value>.htaccess</value>
</data> </data>
<data name="lclHeliconApeInstallNote.Text" xml:space="preserve"> <data name="lclHeliconApeInstallNote.Text" xml:space="preserve">
<value>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. &lt;br/&gt;&lt;br/&gt;Please &lt;a href="http://www.helicontech.com/ape/doc/wsp_install.htm" target="_blank"&gt;download and install&lt;/a&gt; Helicon Ape to activate this feature.</value> <value>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.
&lt;br/&gt;
Click on the link below to install Helicon Ape on the server:</value>
</data> </data>
<data name="lblHtaccessAssembly.Text" xml:space="preserve"> <data name="lblHtaccessAssembly.Text" xml:space="preserve">
<value>Module Assembly:</value> <value>Module Assembly:</value>
@ -252,4 +256,7 @@
<data name="txtPublicSharedIP.Text" xml:space="preserve"> <data name="txtPublicSharedIP.Text" xml:space="preserve">
<value>Web Sites Public Shared Address:</value> <value>Web Sites Public Shared Address:</value>
</data> </data>
<data name="chkHeliconApeGlobalRegistration.Text">
<value xml:space="preserve">Register Helicon Ape module globally:</value>
</data>
</root> </root>

View file

@ -427,6 +427,8 @@
</td> </td>
<td class="Normal" valign="top"> <td class="Normal" valign="top">
<asp:Localize ID="Localize1" runat="server" meta:resourcekey="lclHeliconApeInstallNote" /> <asp:Localize ID="Localize1" runat="server" meta:resourcekey="lclHeliconApeInstallNote" />
<br/><br/>
<asp:LinkButton runat="server" ID="InstallHeliconApeLink" Text="Install Helicon Ape" />
</td> </td>
</tr> </tr>
</table> </table>
@ -458,9 +460,18 @@
</td> </td>
<td class="Normal" valign="top"> <td class="Normal" valign="top">
<asp:Button ID="EditHeliconApeConfButton" runat="server" class="Button2" <asp:Button ID="EditHeliconApeConfButton" runat="server" class="Button2"
Text="Edit httpd.conf (server config)" onclick="EditHeliconApeConfButton_Click" Text="Edit httpd.conf (server config)" onclick="EditHeliconApeConfButton_Click" />
/></td> </td>
</tr> </tr>
<tr>
<td valign="top">
<asp:Label runat="server" AssociatedControlID="chkHeliconApeGlobalRegistration" meta:resourcekey="chkHeliconApeGlobalRegistration">Register Helicon Ape module globally:</asp:Label>
</td>
<td>
<asp:CheckBox ID="chkHeliconApeGlobalRegistration" runat="server" style="margin-left: -4px;"/>
(<asp:Label runat="server" AssociatedControlID="chkHeliconApeGlobalRegistration">Uncheck this box to enable managing Helicon Ape using hosting plan policies.</asp:Label>)
</td>
</tr>
</table> </table>
</asp:Panel> </asp:Panel>
</fieldset> </fieldset>

View file

@ -150,17 +150,36 @@ namespace WebsitePanel.Portal.ProviderControls
txtSecureFoldersModuleAsm.Text = settings["SecureFoldersModuleAssembly"]; txtSecureFoldersModuleAsm.Text = settings["SecureFoldersModuleAssembly"];
//Helicon Ape //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) if (sts.IsInstalled)
{ {
downloadApePanel.Visible = false; downloadApePanel.Visible = false;
txtHeliconApeVersion.Text = sts.Version; txtHeliconApeVersion.Text = sts.Version;
lblHeliconRegistrationText.Text = sts.RegistrationInfo; lblHeliconRegistrationText.Text = sts.RegistrationInfo;
if (sts.IsEnabled)
{
chkHeliconApeGlobalRegistration.Checked = true;
}
ViewState["HeliconApeInitiallyEnabled"] = chkHeliconApeGlobalRegistration.Checked;
} }
else else
{ {
configureApePanel.Visible = false; configureApePanel.Visible = false;
// Build url manually, EditUrl throws exception: module is Null
// pid=Servers&mid=137&ctl=edit_platforminstaller&ServerID=1&Product=HeliconApe
List<string> qsParts= new List<string>();
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");
InstallHeliconApeLink.Attributes["href"] = "Default.aspx?" + String.Join("&", qsParts.ToArray());
} }
// //
@ -254,6 +273,19 @@ namespace WebsitePanel.Portal.ProviderControls
ActiveDirectoryIntegration.SaveSettings(settings); 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"]));
}
}
@ -279,6 +311,7 @@ namespace WebsitePanel.Portal.ProviderControls
settings["GalleryAppsAlwaysIgnoreDependencies"] = chkGalleryAppsAlwaysIgnoreDependencies.Checked.ToString(); settings["GalleryAppsAlwaysIgnoreDependencies"] = chkGalleryAppsAlwaysIgnoreDependencies.Checked.ToString();
} }
/*
protected void DownladAndIstallApeLinkButton_Click(object sender, EventArgs e) protected void DownladAndIstallApeLinkButton_Click(object sender, EventArgs e)
{ {
ES.Services.WebServers.InstallHeliconApe(PanelRequest.ServiceId); ES.Services.WebServers.InstallHeliconApe(PanelRequest.ServiceId);
@ -286,6 +319,7 @@ namespace WebsitePanel.Portal.ProviderControls
//Redirect to avoid 2-nd call //Redirect to avoid 2-nd call
Response.Redirect(this.Context.Request.Url.AbsoluteUri); Response.Redirect(this.Context.Request.Url.AbsoluteUri);
} }
*/
public string GetHttpdEditControlUrl(string ctrlKey, string name) public string GetHttpdEditControlUrl(string ctrlKey, string name)
{ {

View file

@ -669,6 +669,15 @@ namespace WebsitePanel.Portal.ProviderControls {
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.Localize Localize1; protected global::System.Web.UI.WebControls.Localize Localize1;
/// <summary>
/// InstallHeliconApeLink control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton InstallHeliconApeLink;
/// <summary> /// <summary>
/// configureApePanel control. /// configureApePanel control.
/// </summary> /// </summary>
@ -732,6 +741,15 @@ namespace WebsitePanel.Portal.ProviderControls {
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.Button EditHeliconApeConfButton; protected global::System.Web.UI.WebControls.Button EditHeliconApeConfButton;
/// <summary>
/// chkHeliconApeGlobalRegistration control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.CheckBox chkHeliconApeGlobalRegistration;
/// <summary> /// <summary>
/// secOther control. /// secOther control.
/// </summary> /// </summary>

View file

@ -108,6 +108,16 @@ namespace WebsitePanel.Portal
ShowProgressPanel(); ShowProgressPanel();
} }
string gotoProduct = Request.QueryString["WPIProduct"];
if (!string.IsNullOrEmpty(gotoProduct))
{
ArrayList wpiProductsForInstall = GetProductsToInstallList();
wpiProductsForInstall.Add(gotoProduct);
SetProductsToInstallList(wpiProductsForInstall);
btnInstall_Click(sender, e);
}
} }
} }

View file

@ -38,23 +38,12 @@ using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls; using System.Web.UI.HtmlControls;
using WebsitePanel.Providers.Web; using WebsitePanel.Providers.Web;
using WebsitePanel.Providers.ResultObjects;
namespace WebsitePanel.Portal namespace WebsitePanel.Portal
{ {
public partial class WebSitesHeliconApeControl : WebsitePanelControlBase 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 private bool IsSecuredFoldersInstalled
{ {
@ -62,9 +51,16 @@ namespace WebsitePanel.Portal
set { ViewState["IsSecuredFoldersInstalled"] = value; } set { ViewState["IsSecuredFoldersInstalled"] = value; }
} }
private HeliconApeStatus HeliconApeStatus
{
get { return (HeliconApeStatus)ViewState["HeliconApeStatus"]; }
set { ViewState["HeliconApeStatus"] = value; }
}
protected void Page_Load(object sender, EventArgs e) protected void Page_Load(object sender, EventArgs e)
{ {
if (IsHeliconApeInstalled) if (HeliconApeStatus.IsInstalled)
{ {
if (!IsPostBack) if (!IsPostBack)
{ {
@ -90,12 +86,12 @@ namespace WebsitePanel.Portal
public void BindHeliconApe(WebSite site) public void BindHeliconApe(WebSite site)
{ {
// save initial state // save initial state
IsHeliconApeInstalled = site.HeliconApeInstalled; this.IsSecuredFoldersInstalled = site.SecuredFoldersInstalled;
IsHeliconApeEnabled = site.HeliconApeEnabled; this.HeliconApeStatus = site.HeliconApeStatus;
IsSecuredFoldersInstalled = site.SecuredFoldersInstalled;
// Render a warning message about the automatic site's settings change // 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 // Ensure the message is displayed only when neccessary
if (site.EnableWindowsAuthentication || !site.AspNetInstalled.EndsWith("I") || site.SecuredFoldersInstalled) if (site.EnableWindowsAuthentication || !site.AspNetInstalled.EndsWith("I") || site.SecuredFoldersInstalled)
@ -113,11 +109,21 @@ namespace WebsitePanel.Portal
private void ToggleControls() private void ToggleControls()
{ {
if (IsHeliconApeInstalled) if (HeliconApeStatus.IsInstalled)
{ {
bool IsHeliconApeEnabled = HeliconApeStatus.IsEnabled;
// toggle button // toggle button
btnToggleHeliconApe.Text = GetLocalizedString( if (IsHeliconApeEnabled)
IsHeliconApeEnabled ? "DisableHeliconApe.Text" : "EnableHeliconApe.Text"); {
btnToggleHeliconApe.Text = GetLocalizedString("DisableHeliconApe.Text");
}
else
{
btnToggleHeliconApe.Text = GetLocalizedString("EnableHeliconApe.Text");
}
// toggle panels // toggle panels
HeliconApeFoldersPanel.Visible = IsHeliconApeEnabled; HeliconApeFoldersPanel.Visible = IsHeliconApeEnabled;
@ -165,7 +171,7 @@ namespace WebsitePanel.Portal
try try
{ {
int result = 0; int result = 0;
if (IsHeliconApeEnabled) if (HeliconApeStatus.IsEnabled)
{ {
// uninstall folders // uninstall folders
result = ES.Services.WebServers.DisableHeliconApe(PanelRequest.ItemID); result = ES.Services.WebServers.DisableHeliconApe(PanelRequest.ItemID);
@ -189,7 +195,10 @@ namespace WebsitePanel.Portal
} }
// change state // change state
IsHeliconApeEnabled = !IsHeliconApeEnabled; HeliconApeStatus status = HeliconApeStatus;
status.IsEnabled = !status.IsEnabled;
HeliconApeStatus = status;
// bind items // bind items
ToggleControls(); ToggleControls();