Web Console integration
This commit is contained in:
parent
d933862a05
commit
440af2bf77
25 changed files with 2260 additions and 409 deletions
|
@ -29,19 +29,18 @@
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
// Runtime Version:2.0.50727.5456
|
// Runtime Version:2.0.50727.5466
|
||||||
//
|
//
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
// the code is regenerated.
|
// the code is regenerated.
|
||||||
// </auto-generated>
|
// </auto-generated>
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
using WebsitePanel.Providers.HeliconZoo;
|
||||||
|
|
||||||
//
|
//
|
||||||
// This source code was auto-generated by wsdl, Version=2.0.50727.42.
|
// This source code was auto-generated by wsdl, Version=2.0.50727.42.
|
||||||
//
|
//
|
||||||
|
|
||||||
using WebsitePanel.Providers.HeliconZoo;
|
|
||||||
|
|
||||||
namespace WebsitePanel.EnterpriseServer {
|
namespace WebsitePanel.EnterpriseServer {
|
||||||
using System.Xml.Serialization;
|
using System.Xml.Serialization;
|
||||||
using System.Web.Services;
|
using System.Web.Services;
|
||||||
|
@ -72,9 +71,13 @@ namespace WebsitePanel.EnterpriseServer {
|
||||||
|
|
||||||
private System.Threading.SendOrPostCallback SetEnabledEnginesForSiteOperationCompleted;
|
private System.Threading.SendOrPostCallback SetEnabledEnginesForSiteOperationCompleted;
|
||||||
|
|
||||||
|
private System.Threading.SendOrPostCallback IsWebCosoleEnabledOperationCompleted;
|
||||||
|
|
||||||
|
private System.Threading.SendOrPostCallback SetWebCosoleEnabledOperationCompleted;
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public esHeliconZoo() {
|
public esHeliconZoo() {
|
||||||
this.Url = "http://localhost:9005/esHeliconZoo.asmx";
|
this.Url = "http://localhost:9002/esHeliconZoo.asmx";
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
|
@ -98,6 +101,12 @@ namespace WebsitePanel.EnterpriseServer {
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public event SetEnabledEnginesForSiteCompletedEventHandler SetEnabledEnginesForSiteCompleted;
|
public event SetEnabledEnginesForSiteCompletedEventHandler SetEnabledEnginesForSiteCompleted;
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public event IsWebCosoleEnabledCompletedEventHandler IsWebCosoleEnabledCompleted;
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public event SetWebCosoleEnabledCompletedEventHandler SetWebCosoleEnabledCompleted;
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetEngines", 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/GetEngines", 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 HeliconZooEngine[] GetEngines(int serviceId) {
|
public HeliconZooEngine[] GetEngines(int serviceId) {
|
||||||
|
@ -395,6 +404,89 @@ namespace WebsitePanel.EnterpriseServer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/IsWebCosoleEnabled", 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 bool IsWebCosoleEnabled(int serviceId) {
|
||||||
|
object[] results = this.Invoke("IsWebCosoleEnabled", new object[] {
|
||||||
|
serviceId});
|
||||||
|
return ((bool)(results[0]));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public System.IAsyncResult BeginIsWebCosoleEnabled(int serviceId, System.AsyncCallback callback, object asyncState) {
|
||||||
|
return this.BeginInvoke("IsWebCosoleEnabled", new object[] {
|
||||||
|
serviceId}, callback, asyncState);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public bool EndIsWebCosoleEnabled(System.IAsyncResult asyncResult) {
|
||||||
|
object[] results = this.EndInvoke(asyncResult);
|
||||||
|
return ((bool)(results[0]));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public void IsWebCosoleEnabledAsync(int serviceId) {
|
||||||
|
this.IsWebCosoleEnabledAsync(serviceId, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public void IsWebCosoleEnabledAsync(int serviceId, object userState) {
|
||||||
|
if ((this.IsWebCosoleEnabledOperationCompleted == null)) {
|
||||||
|
this.IsWebCosoleEnabledOperationCompleted = new System.Threading.SendOrPostCallback(this.OnIsWebCosoleEnabledOperationCompleted);
|
||||||
|
}
|
||||||
|
this.InvokeAsync("IsWebCosoleEnabled", new object[] {
|
||||||
|
serviceId}, this.IsWebCosoleEnabledOperationCompleted, userState);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnIsWebCosoleEnabledOperationCompleted(object arg) {
|
||||||
|
if ((this.IsWebCosoleEnabledCompleted != null)) {
|
||||||
|
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
|
||||||
|
this.IsWebCosoleEnabledCompleted(this, new IsWebCosoleEnabledCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SetWebCosoleEnabled", 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 void SetWebCosoleEnabled(int serviceId, bool enabled) {
|
||||||
|
this.Invoke("SetWebCosoleEnabled", new object[] {
|
||||||
|
serviceId,
|
||||||
|
enabled});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public System.IAsyncResult BeginSetWebCosoleEnabled(int serviceId, bool enabled, System.AsyncCallback callback, object asyncState) {
|
||||||
|
return this.BeginInvoke("SetWebCosoleEnabled", new object[] {
|
||||||
|
serviceId,
|
||||||
|
enabled}, callback, asyncState);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public void EndSetWebCosoleEnabled(System.IAsyncResult asyncResult) {
|
||||||
|
this.EndInvoke(asyncResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public void SetWebCosoleEnabledAsync(int serviceId, bool enabled) {
|
||||||
|
this.SetWebCosoleEnabledAsync(serviceId, enabled, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public void SetWebCosoleEnabledAsync(int serviceId, bool enabled, object userState) {
|
||||||
|
if ((this.SetWebCosoleEnabledOperationCompleted == null)) {
|
||||||
|
this.SetWebCosoleEnabledOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetWebCosoleEnabledOperationCompleted);
|
||||||
|
}
|
||||||
|
this.InvokeAsync("SetWebCosoleEnabled", new object[] {
|
||||||
|
serviceId,
|
||||||
|
enabled}, this.SetWebCosoleEnabledOperationCompleted, userState);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnSetWebCosoleEnabledOperationCompleted(object arg) {
|
||||||
|
if ((this.SetWebCosoleEnabledCompleted != null)) {
|
||||||
|
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
|
||||||
|
this.SetWebCosoleEnabledCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public new void CancelAsync(object userState) {
|
public new void CancelAsync(object userState) {
|
||||||
base.CancelAsync(userState);
|
base.CancelAsync(userState);
|
||||||
|
@ -516,4 +608,34 @@ namespace WebsitePanel.EnterpriseServer {
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
|
||||||
public delegate void SetEnabledEnginesForSiteCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
|
public delegate void SetEnabledEnginesForSiteCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
|
||||||
|
public delegate void IsWebCosoleEnabledCompletedEventHandler(object sender, IsWebCosoleEnabledCompletedEventArgs e);
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
|
||||||
|
[System.Diagnostics.DebuggerStepThroughAttribute()]
|
||||||
|
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||||
|
public partial class IsWebCosoleEnabledCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
|
||||||
|
|
||||||
|
private object[] results;
|
||||||
|
|
||||||
|
internal IsWebCosoleEnabledCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
|
||||||
|
base(exception, cancelled, userState) {
|
||||||
|
this.results = results;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public bool Result {
|
||||||
|
get {
|
||||||
|
this.RaiseExceptionIfNecessary();
|
||||||
|
return ((bool)(this.results[0]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
|
||||||
|
public delegate void SetWebCosoleEnabledCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -85,6 +85,8 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
allowedEngines.Add( new ShortHeliconZooEngine(){
|
allowedEngines.Add( new ShortHeliconZooEngine(){
|
||||||
Name = (string)reader["QuotaName"],
|
Name = (string)reader["QuotaName"],
|
||||||
DisplayName= (string)reader["QuotaDescription"],
|
DisplayName= (string)reader["QuotaDescription"],
|
||||||
|
Enabled = true
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,6 +122,21 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static bool IsWebCosoleEnabled(int serviceId)
|
||||||
|
{
|
||||||
|
HeliconZoo zooServer = new HeliconZoo();
|
||||||
|
ServiceProviderProxy.Init(zooServer, serviceId);
|
||||||
|
return zooServer.IsWebCosoleEnabled();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SetWebCosoleEnabled(int serviceId, bool enabled)
|
||||||
|
{
|
||||||
|
HeliconZoo zooServer = new HeliconZoo();
|
||||||
|
ServiceProviderProxy.Init(zooServer, serviceId);
|
||||||
|
zooServer.SetWebCosoleEnabled(enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#region private helpers
|
#region private helpers
|
||||||
private static void UpdateQuotas(int serviceId, HeliconZooEngine[] userEngines)
|
private static void UpdateQuotas(int serviceId, HeliconZooEngine[] userEngines)
|
||||||
{
|
{
|
||||||
|
@ -183,7 +200,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
DataProvider.AddHeliconZooQuota(groupId, quotaId,
|
DataProvider.AddHeliconZooQuota(groupId, quotaId,
|
||||||
HeliconZooQuotaPrefix+engine.name,
|
HeliconZooQuotaPrefix+engine.name,
|
||||||
engine.displayName,
|
engine.displayName,
|
||||||
order++);
|
existingQuotas.Count + order++);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3404,7 +3404,83 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Helicon Zoo
|
||||||
|
|
||||||
|
public static List<WebVirtualDirectory> GetZooApplications(int siteItemId)
|
||||||
|
{
|
||||||
|
List<WebVirtualDirectory> dirs = new List<WebVirtualDirectory>();
|
||||||
|
|
||||||
|
// load site item
|
||||||
|
WebSite siteItem = (WebSite)PackageController.GetPackageItem(siteItemId);
|
||||||
|
if (siteItem == null)
|
||||||
|
return dirs;
|
||||||
|
|
||||||
|
// truncate home folders
|
||||||
|
WebServer web = new WebServer();
|
||||||
|
ServiceProviderProxy.Init(web, siteItem.ServiceId);
|
||||||
|
WebVirtualDirectory[] vdirs = web.GetZooApplications(siteItem.SiteId);
|
||||||
|
|
||||||
|
foreach (WebVirtualDirectory vdir in vdirs)
|
||||||
|
{
|
||||||
|
vdir.ContentPath = FilesController.GetVirtualPackagePath(siteItem.PackageId, vdir.ContentPath);
|
||||||
|
dirs.Add(vdir);
|
||||||
|
}
|
||||||
|
|
||||||
|
return dirs;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static StringResultObject SetZooEnvironmentVariable(int siteItemId, string appName, string envName, string envValue)
|
||||||
|
{
|
||||||
|
StringResultObject result = new StringResultObject {IsSuccess = false};
|
||||||
|
|
||||||
|
|
||||||
|
// load site item
|
||||||
|
WebSite siteItem = (WebSite)PackageController.GetPackageItem(siteItemId);
|
||||||
|
if (siteItem == null)
|
||||||
|
return result;
|
||||||
|
|
||||||
|
|
||||||
|
WebServer web = new WebServer();
|
||||||
|
ServiceProviderProxy.Init(web, siteItem.ServiceId);
|
||||||
|
return web.SetZooEnvironmentVariable(siteItem.SiteId, appName, envName, envValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static StringResultObject SetZooConsoleEnabled(int siteItemId, string appName)
|
||||||
|
{
|
||||||
|
StringResultObject result = new StringResultObject { IsSuccess = false };
|
||||||
|
|
||||||
|
|
||||||
|
// load site item
|
||||||
|
WebSite siteItem = (WebSite)PackageController.GetPackageItem(siteItemId);
|
||||||
|
if (siteItem == null)
|
||||||
|
return result;
|
||||||
|
|
||||||
|
|
||||||
|
WebServer web = new WebServer();
|
||||||
|
ServiceProviderProxy.Init(web, siteItem.ServiceId);
|
||||||
|
return web.SetZooConsoleEnabled(siteItem.SiteId, appName);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static StringResultObject SetZooConsoleDisabled(int siteItemId, string appName)
|
||||||
|
{
|
||||||
|
StringResultObject result = new StringResultObject { IsSuccess = false };
|
||||||
|
|
||||||
|
|
||||||
|
// load site item
|
||||||
|
WebSite siteItem = (WebSite)PackageController.GetPackageItem(siteItemId);
|
||||||
|
if (siteItem == null)
|
||||||
|
return result;
|
||||||
|
|
||||||
|
|
||||||
|
WebServer web = new WebServer();
|
||||||
|
ServiceProviderProxy.Init(web, siteItem.ServiceId);
|
||||||
|
return web.SetZooConsoleDisabled(siteItem.SiteId, appName);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
#region WebManagement Access
|
#region WebManagement Access
|
||||||
|
|
||||||
public static ResultObject GrantWebManagementAccess(int siteItemId, string accountName, string accountPassword)
|
public static ResultObject GrantWebManagementAccess(int siteItemId, string accountName, string accountPassword)
|
||||||
|
|
|
@ -97,5 +97,17 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
{
|
{
|
||||||
HeliconZooController.SetEnabledEnginesForSite(siteId, packageId, engines);
|
HeliconZooController.SetEnabledEnginesForSite(siteId, packageId, engines);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[WebMethod]
|
||||||
|
public bool IsWebCosoleEnabled(int serviceId)
|
||||||
|
{
|
||||||
|
return HeliconZooController.IsWebCosoleEnabled(serviceId);
|
||||||
|
}
|
||||||
|
|
||||||
|
[WebMethod]
|
||||||
|
public void SetWebCosoleEnabled(int serviceId, bool enabled)
|
||||||
|
{
|
||||||
|
HeliconZooController.SetWebCosoleEnabled(serviceId, enabled);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,6 +79,14 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
return WebAppGalleryController.GetGalleryApplications(packageId, categoryId);
|
return WebAppGalleryController.GetGalleryApplications(packageId, categoryId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[WebMethod]
|
||||||
|
public GalleryApplicationsResult GetInstaledApplications(int packageId, string categoryId)
|
||||||
|
{
|
||||||
|
WebAppGalleryController.InitFeeds(SecurityContext.User.UserId, packageId);
|
||||||
|
return WebAppGalleryController.GetGalleryApplications(packageId, categoryId);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
[WebMethod]
|
[WebMethod]
|
||||||
public GalleryApplicationsResult GetGalleryApplicationsFiltered(int packageId, string pattern)
|
public GalleryApplicationsResult GetGalleryApplicationsFiltered(int packageId, string pattern)
|
||||||
{
|
{
|
||||||
|
|
|
@ -443,6 +443,8 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#region Helicon Ape Users
|
#region Helicon Ape Users
|
||||||
[WebMethod]
|
[WebMethod]
|
||||||
public HtaccessUser[] GetHeliconApeUsers(int siteItemId)
|
public HtaccessUser[] GetHeliconApeUsers(int siteItemId)
|
||||||
|
@ -495,6 +497,38 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region Helicon Zoo
|
||||||
|
|
||||||
|
[WebMethod]
|
||||||
|
public List<WebVirtualDirectory> GetZooApplications(int siteItemId)
|
||||||
|
{
|
||||||
|
return WebServerController.GetZooApplications(siteItemId);
|
||||||
|
}
|
||||||
|
|
||||||
|
[WebMethod]
|
||||||
|
public StringResultObject SetZooEnvironmentVariable(int siteItemId, string appName, string envName, string envValue)
|
||||||
|
{
|
||||||
|
return WebServerController.SetZooEnvironmentVariable(siteItemId, appName, envName, envValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[WebMethod]
|
||||||
|
public StringResultObject SetZooConsoleEnabled(int siteItemId, string appName)
|
||||||
|
{
|
||||||
|
return WebServerController.SetZooConsoleEnabled(siteItemId, appName);
|
||||||
|
}
|
||||||
|
|
||||||
|
[WebMethod]
|
||||||
|
public StringResultObject SetZooConsoleDisabled(int siteItemId, string appName)
|
||||||
|
{
|
||||||
|
return WebServerController.SetZooConsoleDisabled(siteItemId, appName);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#region WebManagement Access
|
#region WebManagement Access
|
||||||
|
|
||||||
|
|
|
@ -92,5 +92,7 @@ namespace WebsitePanel.Providers.HeliconZoo
|
||||||
void SwithEnginesEnabled(bool enabled);
|
void SwithEnginesEnabled(bool enabled);
|
||||||
string[] GetEnabledEnginesForSite(string siteId);
|
string[] GetEnabledEnginesForSite(string siteId);
|
||||||
void SetEnabledEnginesForSite(string siteId, string[] engineNames);
|
void SetEnabledEnginesForSite(string siteId, string[] engineNames);
|
||||||
|
bool IsWebCosoleEnabled();
|
||||||
|
void SetWebCosoleEnabled(bool enabled);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,6 +121,12 @@ namespace WebsitePanel.Providers.Web
|
||||||
void UpdateHeliconApeGroup(string siteId, WebGroup group);
|
void UpdateHeliconApeGroup(string siteId, WebGroup group);
|
||||||
void DeleteHeliconApeGroup(string siteId, string groupName);
|
void DeleteHeliconApeGroup(string siteId, string groupName);
|
||||||
|
|
||||||
|
// Helicon Zoo
|
||||||
|
WebVirtualDirectory[] GetZooApplications(string siteId);
|
||||||
|
StringResultObject SetZooEnvironmentVariable(string siteId, string appName, string envName, string envValue);
|
||||||
|
StringResultObject SetZooConsoleEnabled(string siteId, string appName);
|
||||||
|
StringResultObject SetZooConsoleDisabled(string siteId, string appName);
|
||||||
|
|
||||||
|
|
||||||
// web app gallery
|
// web app gallery
|
||||||
bool CheckLoadUserProfile();
|
bool CheckLoadUserProfile();
|
||||||
|
|
|
@ -78,6 +78,7 @@ namespace WebsitePanel.Providers.Web
|
||||||
private bool redirectPermanent;
|
private bool redirectPermanent;
|
||||||
private bool sharePointInstalled;
|
private bool sharePointInstalled;
|
||||||
private bool iis7;
|
private bool iis7;
|
||||||
|
private string consoleUrl;
|
||||||
|
|
||||||
public string AnonymousUsername
|
public string AnonymousUsername
|
||||||
{
|
{
|
||||||
|
@ -263,6 +264,12 @@ namespace WebsitePanel.Providers.Web
|
||||||
get { return this.iis7; }
|
get { return this.iis7; }
|
||||||
set { this.iis7 = value; }
|
set { this.iis7 = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string ConsoleUrl
|
||||||
|
{
|
||||||
|
get { return consoleUrl; }
|
||||||
|
set { consoleUrl = value; }
|
||||||
|
}
|
||||||
|
|
||||||
#region Web Deploy Publishing Properties
|
#region Web Deploy Publishing Properties
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -100,6 +100,8 @@ namespace WebsitePanel.Providers.Web.HeliconZoo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//main engines
|
||||||
|
|
||||||
foreach (ConfigurationElement item in enginesCollection)
|
foreach (ConfigurationElement item in enginesCollection)
|
||||||
{
|
{
|
||||||
HeliconZooEngine newItem = ConvertElementToHeliconZooEngine(item);
|
HeliconZooEngine newItem = ConvertElementToHeliconZooEngine(item);
|
||||||
|
@ -107,6 +109,9 @@ namespace WebsitePanel.Providers.Web.HeliconZoo
|
||||||
result.Add(newItem);
|
result.Add(newItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//userEngines
|
||||||
|
|
||||||
ConfigurationElement userEngines = heliconZooServer.GetChildElement("userEngines");
|
ConfigurationElement userEngines = heliconZooServer.GetChildElement("userEngines");
|
||||||
ConfigurationElementCollection userEnginesCollection = userEngines.GetCollection();
|
ConfigurationElementCollection userEnginesCollection = userEngines.GetCollection();
|
||||||
foreach (ConfigurationElement item in userEnginesCollection)
|
foreach (ConfigurationElement item in userEnginesCollection)
|
||||||
|
@ -126,6 +131,17 @@ namespace WebsitePanel.Providers.Web.HeliconZoo
|
||||||
result.Add(newItem);
|
result.Add(newItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//Web console
|
||||||
|
HeliconZooEngine webConsole = new HeliconZooEngine
|
||||||
|
{
|
||||||
|
displayName = "Web console",
|
||||||
|
name = "console"
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
result.Add(webConsole);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
foreach (ConfigurationElement switchboardElement in switchboardCollection)
|
foreach (ConfigurationElement switchboardElement in switchboardCollection)
|
||||||
|
@ -352,6 +368,69 @@ namespace WebsitePanel.Providers.Web.HeliconZoo
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public bool IsWebCosoleEnabled()
|
||||||
|
{
|
||||||
|
bool isEnginesEnabled = true;
|
||||||
|
|
||||||
|
using (var srvman = new ServerManager())
|
||||||
|
{
|
||||||
|
Configuration appConfig = srvman.GetApplicationHostConfiguration();
|
||||||
|
|
||||||
|
ConfigurationSection heliconZooServer = appConfig.GetSection("system.webServer/heliconZooServer");
|
||||||
|
|
||||||
|
//switchboard
|
||||||
|
ConfigurationElement switchboard = heliconZooServer.GetChildElement("switchboard");
|
||||||
|
ConfigurationElementCollection switchboardCollection = switchboard.GetCollection();
|
||||||
|
|
||||||
|
|
||||||
|
foreach (ConfigurationElement switchboardElement in switchboardCollection)
|
||||||
|
{
|
||||||
|
if ((string)switchboardElement.GetAttributeValue("name") == "console")
|
||||||
|
{
|
||||||
|
isEnginesEnabled = (bool)switchboardElement.GetAttributeValue("enabled");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return isEnginesEnabled;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetWebCosoleEnabled(bool enabled)
|
||||||
|
{
|
||||||
|
using (var srvman = new ServerManager())
|
||||||
|
{
|
||||||
|
Configuration appConfig = srvman.GetApplicationHostConfiguration();
|
||||||
|
|
||||||
|
ConfigurationSection heliconZooServer = appConfig.GetSection("system.webServer/heliconZooServer");
|
||||||
|
|
||||||
|
ConfigurationElement switchboard = heliconZooServer.GetChildElement("switchboard");
|
||||||
|
ConfigurationElementCollection switchboardCollection = switchboard.GetCollection();
|
||||||
|
|
||||||
|
bool found = false;
|
||||||
|
foreach (ConfigurationElement switchboardElement in switchboardCollection)
|
||||||
|
{
|
||||||
|
if ((string)switchboardElement.GetAttributeValue("name") == "console")
|
||||||
|
{
|
||||||
|
switchboardElement.SetAttributeValue("enabled", enabled ? "true" : "false");
|
||||||
|
found = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
ConfigurationElement element = switchboardCollection.CreateElement();
|
||||||
|
element.SetAttributeValue("name", "console");
|
||||||
|
element.SetAttributeValue("enabled", enabled ? "true" : "false");
|
||||||
|
switchboardCollection.Add(element);
|
||||||
|
}
|
||||||
|
|
||||||
|
srvman.CommitChanges();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#region private methods
|
#region private methods
|
||||||
|
|
||||||
private void ConvertHeliconZooEngineToElement(HeliconZooEngine item, ConfigurationElement engine)
|
private void ConvertHeliconZooEngineToElement(HeliconZooEngine item, ConfigurationElement engine)
|
||||||
|
|
|
@ -1563,12 +1563,18 @@ namespace WebsitePanel.Providers.Web
|
||||||
/// <returns>virtual directories that belong to site with supplied id.</returns>
|
/// <returns>virtual directories that belong to site with supplied id.</returns>
|
||||||
public override WebVirtualDirectory[] GetVirtualDirectories(string siteId)
|
public override WebVirtualDirectory[] GetVirtualDirectories(string siteId)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
using (ServerManager srvman = webObjectsSvc.GetServerManager())
|
using (ServerManager srvman = webObjectsSvc.GetServerManager())
|
||||||
{
|
{
|
||||||
return GetVirtualDirectories(srvman, siteId);
|
return GetVirtualDirectories(srvman, siteId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private WebVirtualDirectory[] GetVirtualDirectories(ServerManager srvman, string siteId)
|
private WebVirtualDirectory[] GetVirtualDirectories(ServerManager srvman, string siteId)
|
||||||
{
|
{
|
||||||
// get all virt dirs
|
// get all virt dirs
|
||||||
|
@ -1938,7 +1944,6 @@ namespace WebsitePanel.Providers.Web
|
||||||
if (!string.IsNullOrEmpty(siteId))
|
if (!string.IsNullOrEmpty(siteId))
|
||||||
{
|
{
|
||||||
// Check the web site app pool in integrated pipeline mode
|
// Check the web site app pool in integrated pipeline mode
|
||||||
|
|
||||||
WebSite webSite = null;
|
WebSite webSite = null;
|
||||||
webSite = webObjectsSvc.GetWebSiteFromIIS(srvman, siteId);
|
webSite = webObjectsSvc.GetWebSiteFromIIS(srvman, siteId);
|
||||||
if (webSite == null)
|
if (webSite == null)
|
||||||
|
@ -2585,11 +2590,90 @@ namespace WebsitePanel.Providers.Web
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Helicon Zoo
|
||||||
|
|
||||||
|
public override WebVirtualDirectory[] GetZooApplications(string siteId)
|
||||||
|
{
|
||||||
|
using (ServerManager srvman = webObjectsSvc.GetServerManager())
|
||||||
|
{
|
||||||
|
return webObjectsSvc.GetZooApplications(srvman, siteId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override StringResultObject SetZooEnvironmentVariable(string siteId, string appName, string envName, string envValue)
|
||||||
|
{
|
||||||
|
StringResultObject result = new StringResultObject();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (ServerManager srvman = webObjectsSvc.GetServerManager())
|
||||||
|
{
|
||||||
|
webObjectsSvc.SetZooEnvironmentVariable(srvman, siteId, appName, envName, envValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
result.IsSuccess = true;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
result.AddError("Exception", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public override StringResultObject SetZooConsoleEnabled(string siteId, string appName)
|
||||||
|
{
|
||||||
|
StringResultObject result = new StringResultObject();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (ServerManager srvman = webObjectsSvc.GetServerManager())
|
||||||
|
{
|
||||||
|
webObjectsSvc.SetZooConsoleEnabled(srvman, siteId, appName);
|
||||||
|
}
|
||||||
|
|
||||||
|
result.IsSuccess = true;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
result.AddError("Exception", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override StringResultObject SetZooConsoleDisabled(string siteId, string appName)
|
||||||
|
{
|
||||||
|
StringResultObject result = new StringResultObject();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (ServerManager srvman = webObjectsSvc.GetServerManager())
|
||||||
|
{
|
||||||
|
webObjectsSvc.SetZooConsoleDisabled(srvman, siteId, appName);
|
||||||
|
}
|
||||||
|
|
||||||
|
result.IsSuccess = true;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
result.AddError("Exception", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Secured Helicon Ape Users
|
#region Secured Helicon Ape Users
|
||||||
|
|
||||||
public static string GeneratePasswordHash(HtaccessUser user)
|
public static string GeneratePasswordHash(HtaccessUser user)
|
||||||
{
|
{
|
||||||
if (HtaccessFolder.AUTH_TYPE_BASIC == user.AuthType)
|
if (HtaccessFolder.AUTH_TYPE_BASIC == user.AuthType)
|
||||||
{
|
{
|
||||||
|
|
|
@ -26,6 +26,10 @@
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Security.Permissions;
|
||||||
|
|
||||||
namespace WebsitePanel.Providers.Web.Iis.WebObjects
|
namespace WebsitePanel.Providers.Web.Iis.WebObjects
|
||||||
{
|
{
|
||||||
using System;
|
using System;
|
||||||
|
@ -661,6 +665,171 @@ namespace WebsitePanel.Providers.Web.Iis.WebObjects
|
||||||
return vdirs.ToArray();
|
return vdirs.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public WebVirtualDirectory[] GetZooApplications(ServerManager srvman, string siteId)
|
||||||
|
{
|
||||||
|
if (!SiteExists(srvman, siteId))
|
||||||
|
return new WebVirtualDirectory[] { };
|
||||||
|
|
||||||
|
var vdirs = new List<WebVirtualDirectory>();
|
||||||
|
var iisObject = srvman.Sites[siteId];
|
||||||
|
//
|
||||||
|
foreach (var item in iisObject.Applications)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
|
||||||
|
Configuration cfg = item.GetWebConfiguration();
|
||||||
|
string location = siteId + ConfigurationUtility.GetQualifiedVirtualPath(item.Path);
|
||||||
|
ConfigurationSection section = cfg.GetSection("system.webServer/heliconZoo", location);
|
||||||
|
|
||||||
|
if (section.GetCollection().Count > 0)
|
||||||
|
{
|
||||||
|
WebVirtualDirectory vdir = new WebVirtualDirectory
|
||||||
|
{
|
||||||
|
Name = ConfigurationUtility.GetNonQualifiedVirtualPath(item.Path),
|
||||||
|
ContentPath = item.VirtualDirectories[0].PhysicalPath
|
||||||
|
};
|
||||||
|
|
||||||
|
ConfigurationElement zooAppElement = section.GetCollection()[0];
|
||||||
|
ConfigurationElementCollection envColl = zooAppElement.GetChildElement("environmentVariables").GetCollection();
|
||||||
|
|
||||||
|
foreach (ConfigurationElement env in envColl)
|
||||||
|
{
|
||||||
|
if ((string) env.GetAttributeValue("name") == "CONSOLE_URL")
|
||||||
|
{
|
||||||
|
vdir.ConsoleUrl = ConfigurationUtility.GetQualifiedVirtualPath(item.Path);
|
||||||
|
if (!vdir.ConsoleUrl.EndsWith("/"))
|
||||||
|
{
|
||||||
|
vdir.ConsoleUrl += "/";
|
||||||
|
}
|
||||||
|
vdir.ConsoleUrl += (string)env.GetAttributeValue("value");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
vdirs.Add(vdir);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
//there is no zoo
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
return vdirs.ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetZooConsoleEnabled(ServerManager srvman, string siteId, string appName)
|
||||||
|
{
|
||||||
|
|
||||||
|
UInt32 hwidlow = (UInt32)GetVolumeSerial();
|
||||||
|
UInt64 hwidhi = ((UInt64) hwidlow) << 32;
|
||||||
|
|
||||||
|
|
||||||
|
//try
|
||||||
|
//{
|
||||||
|
// hwid = GetVolumeSerial();
|
||||||
|
//}
|
||||||
|
//catch (Exception)
|
||||||
|
//{
|
||||||
|
// hwid = 0x27356246; //magic
|
||||||
|
//}
|
||||||
|
|
||||||
|
|
||||||
|
UInt64 secret = (ulong) DateTime.Now.ToFileTime();
|
||||||
|
UInt64 hw = hwidhi | hwidlow;
|
||||||
|
|
||||||
|
secret ^= hw;
|
||||||
|
|
||||||
|
|
||||||
|
string consoleUrl = "console_" + secret.ToString();
|
||||||
|
SetZooEnvironmentVariable(srvman, siteId, appName, "CONSOLE_URL", consoleUrl);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetZooConsoleDisabled(ServerManager srvman, string siteId, string appName)
|
||||||
|
{
|
||||||
|
SetZooEnvironmentVariable(srvman, siteId, appName, "CONSOLE_URL", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void SetZooEnvironmentVariable(ServerManager srvman, string siteId, string appName, string envName, string envValue)
|
||||||
|
{
|
||||||
|
if (!SiteExists(srvman, siteId))
|
||||||
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
var iisObject = srvman.Sites[siteId];
|
||||||
|
//
|
||||||
|
foreach (var item in iisObject.Applications)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
if (appName == ConfigurationUtility.GetNonQualifiedVirtualPath(item.Path))
|
||||||
|
{
|
||||||
|
Configuration cfg = item.GetWebConfiguration();
|
||||||
|
ConfigurationSection section = cfg.GetSection("system.webServer/heliconZoo");
|
||||||
|
ConfigurationElement zooAppElement = section.GetCollection()[0];
|
||||||
|
ConfigurationElementCollection envColl = zooAppElement.GetChildElement("environmentVariables").GetCollection();
|
||||||
|
|
||||||
|
//remove all CONSOLE_URLs
|
||||||
|
for (int i = 0; i < envColl.Count; )
|
||||||
|
{
|
||||||
|
if (String.Compare(envColl[i].GetAttributeValue("name").ToString(), envName, StringComparison.OrdinalIgnoreCase) == 0)
|
||||||
|
{
|
||||||
|
envColl.RemoveAt(i);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
++i;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// do not set empty value
|
||||||
|
if (!string.IsNullOrEmpty(envValue))
|
||||||
|
{
|
||||||
|
ConfigurationElement el = envColl.CreateElement();
|
||||||
|
el.SetAttributeValue("name", envName);
|
||||||
|
el.SetAttributeValue("value", envValue);
|
||||||
|
envColl.Add(el);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
srvman.CommitChanges();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
[DllImport("kernel32.dll")]
|
||||||
|
private static extern long GetVolumeInformation(string PathName, StringBuilder VolumeNameBuffer, UInt32 VolumeNameSize, ref UInt32 VolumeSerialNumber, ref UInt32 MaximumComponentLength, ref UInt32 FileSystemFlags, StringBuilder FileSystemNameBuffer, UInt32 FileSystemNameSize);
|
||||||
|
|
||||||
|
private static int GetVolumeSerial()
|
||||||
|
{
|
||||||
|
new FileIOPermission(PermissionState.Unrestricted).Assert();
|
||||||
|
string strDriveLetter = new string(Environment.SystemDirectory[0], 1);
|
||||||
|
|
||||||
|
|
||||||
|
uint serNum = 0;
|
||||||
|
uint maxCompLen = 0;
|
||||||
|
StringBuilder VolLabel = new StringBuilder(256); // Label
|
||||||
|
UInt32 VolFlags = new UInt32();
|
||||||
|
StringBuilder FSName = new StringBuilder(256); // File System Name
|
||||||
|
strDriveLetter += ":\\";
|
||||||
|
long Ret = GetVolumeInformation(strDriveLetter, VolLabel, (UInt32)VolLabel.Capacity, ref serNum, ref maxCompLen, ref VolFlags, FSName, (UInt32)FSName.Capacity);
|
||||||
|
|
||||||
|
return (int)serNum;
|
||||||
|
}
|
||||||
|
|
||||||
public WebVirtualDirectory GetVirtualDirectory(string siteId, string directoryName)
|
public WebVirtualDirectory GetVirtualDirectory(string siteId, string directoryName)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
|
@ -737,4 +906,6 @@ namespace WebsitePanel.Providers.Web.Iis.WebObjects
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2455,10 +2455,37 @@ namespace WebsitePanel.Providers.Web
|
||||||
throw new NotImplementedException();
|
throw new NotImplementedException();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
#region Private Helper Methods
|
#endregion
|
||||||
protected string GetVirtualDirectoryPath(string siteId, string directoryName)
|
|
||||||
|
#region Helicon Zoo
|
||||||
|
public virtual WebVirtualDirectory[] GetZooApplications(string siteId)
|
||||||
|
{
|
||||||
|
return new WebVirtualDirectory[] { };
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual StringResultObject SetZooEnvironmentVariable(string siteId, string appName, string envName, string envValue)
|
||||||
|
{
|
||||||
|
//pass
|
||||||
|
return new StringResultObject();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual StringResultObject SetZooConsoleEnabled(string siteId, string appName)
|
||||||
|
{
|
||||||
|
return new StringResultObject();
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual StringResultObject SetZooConsoleDisabled(string siteId, string appName)
|
||||||
|
{
|
||||||
|
return new StringResultObject();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Private Helper Methods
|
||||||
|
protected string GetVirtualDirectoryPath(string siteId, string directoryName)
|
||||||
{
|
{
|
||||||
string path = siteId + "/ROOT";
|
string path = siteId + "/ROOT";
|
||||||
if (!String.IsNullOrEmpty(directoryName))
|
if (!String.IsNullOrEmpty(directoryName))
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
// Runtime Version:2.0.50727.5456
|
// Runtime Version:2.0.50727.5466
|
||||||
//
|
//
|
||||||
// Changes to this file may cause incorrect behavior and will be lost if
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
// the code is regenerated.
|
// the code is regenerated.
|
||||||
|
@ -41,6 +41,10 @@ namespace WebsitePanel.Providers.HeliconZoo {
|
||||||
|
|
||||||
private System.Threading.SendOrPostCallback SetEnabledEnginesForSiteOperationCompleted;
|
private System.Threading.SendOrPostCallback SetEnabledEnginesForSiteOperationCompleted;
|
||||||
|
|
||||||
|
private System.Threading.SendOrPostCallback IsWebCosoleEnabledOperationCompleted;
|
||||||
|
|
||||||
|
private System.Threading.SendOrPostCallback SetWebCosoleEnabledOperationCompleted;
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public HeliconZoo() {
|
public HeliconZoo() {
|
||||||
this.Url = "http://localhost:9003/HeliconZoo.asmx";
|
this.Url = "http://localhost:9003/HeliconZoo.asmx";
|
||||||
|
@ -64,6 +68,12 @@ namespace WebsitePanel.Providers.HeliconZoo {
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public event SetEnabledEnginesForSiteCompletedEventHandler SetEnabledEnginesForSiteCompleted;
|
public event SetEnabledEnginesForSiteCompletedEventHandler SetEnabledEnginesForSiteCompleted;
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public event IsWebCosoleEnabledCompletedEventHandler IsWebCosoleEnabledCompleted;
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public event SetWebCosoleEnabledCompletedEventHandler SetWebCosoleEnabledCompleted;
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
|
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
|
||||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetEngines", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetEngines", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
||||||
|
@ -307,6 +317,85 @@ namespace WebsitePanel.Providers.HeliconZoo {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
|
||||||
|
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/IsWebCosoleEnabled", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
||||||
|
public bool IsWebCosoleEnabled() {
|
||||||
|
object[] results = this.Invoke("IsWebCosoleEnabled", new object[0]);
|
||||||
|
return ((bool)(results[0]));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public System.IAsyncResult BeginIsWebCosoleEnabled(System.AsyncCallback callback, object asyncState) {
|
||||||
|
return this.BeginInvoke("IsWebCosoleEnabled", new object[0], callback, asyncState);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public bool EndIsWebCosoleEnabled(System.IAsyncResult asyncResult) {
|
||||||
|
object[] results = this.EndInvoke(asyncResult);
|
||||||
|
return ((bool)(results[0]));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public void IsWebCosoleEnabledAsync() {
|
||||||
|
this.IsWebCosoleEnabledAsync(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public void IsWebCosoleEnabledAsync(object userState) {
|
||||||
|
if ((this.IsWebCosoleEnabledOperationCompleted == null)) {
|
||||||
|
this.IsWebCosoleEnabledOperationCompleted = new System.Threading.SendOrPostCallback(this.OnIsWebCosoleEnabledOperationCompleted);
|
||||||
|
}
|
||||||
|
this.InvokeAsync("IsWebCosoleEnabled", new object[0], this.IsWebCosoleEnabledOperationCompleted, userState);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnIsWebCosoleEnabledOperationCompleted(object arg) {
|
||||||
|
if ((this.IsWebCosoleEnabledCompleted != null)) {
|
||||||
|
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
|
||||||
|
this.IsWebCosoleEnabledCompleted(this, new IsWebCosoleEnabledCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
|
||||||
|
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SetWebCosoleEnabled", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
||||||
|
public void SetWebCosoleEnabled(bool enabled) {
|
||||||
|
this.Invoke("SetWebCosoleEnabled", new object[] {
|
||||||
|
enabled});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public System.IAsyncResult BeginSetWebCosoleEnabled(bool enabled, System.AsyncCallback callback, object asyncState) {
|
||||||
|
return this.BeginInvoke("SetWebCosoleEnabled", new object[] {
|
||||||
|
enabled}, callback, asyncState);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public void EndSetWebCosoleEnabled(System.IAsyncResult asyncResult) {
|
||||||
|
this.EndInvoke(asyncResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public void SetWebCosoleEnabledAsync(bool enabled) {
|
||||||
|
this.SetWebCosoleEnabledAsync(enabled, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public void SetWebCosoleEnabledAsync(bool enabled, object userState) {
|
||||||
|
if ((this.SetWebCosoleEnabledOperationCompleted == null)) {
|
||||||
|
this.SetWebCosoleEnabledOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetWebCosoleEnabledOperationCompleted);
|
||||||
|
}
|
||||||
|
this.InvokeAsync("SetWebCosoleEnabled", new object[] {
|
||||||
|
enabled}, this.SetWebCosoleEnabledOperationCompleted, userState);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnSetWebCosoleEnabledOperationCompleted(object arg) {
|
||||||
|
if ((this.SetWebCosoleEnabledCompleted != null)) {
|
||||||
|
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
|
||||||
|
this.SetWebCosoleEnabledCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public new void CancelAsync(object userState) {
|
public new void CancelAsync(object userState) {
|
||||||
base.CancelAsync(userState);
|
base.CancelAsync(userState);
|
||||||
|
@ -402,4 +491,34 @@ namespace WebsitePanel.Providers.HeliconZoo {
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
|
||||||
public delegate void SetEnabledEnginesForSiteCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
|
public delegate void SetEnabledEnginesForSiteCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
|
||||||
|
public delegate void IsWebCosoleEnabledCompletedEventHandler(object sender, IsWebCosoleEnabledCompletedEventArgs e);
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
|
||||||
|
[System.Diagnostics.DebuggerStepThroughAttribute()]
|
||||||
|
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||||
|
public partial class IsWebCosoleEnabledCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
|
||||||
|
|
||||||
|
private object[] results;
|
||||||
|
|
||||||
|
internal IsWebCosoleEnabledCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
|
||||||
|
base(exception, cancelled, userState) {
|
||||||
|
this.results = results;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public bool Result {
|
||||||
|
get {
|
||||||
|
this.RaiseExceptionIfNecessary();
|
||||||
|
return ((bool)(this.results[0]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
|
||||||
|
public delegate void SetWebCosoleEnabledCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -101,5 +101,17 @@ namespace WebsitePanel.Server
|
||||||
{
|
{
|
||||||
ZooProvider.SetEnabledEnginesForSite(siteId, engineNames);
|
ZooProvider.SetEnabledEnginesForSite(siteId, engineNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[WebMethod, SoapHeader("settings")]
|
||||||
|
public bool IsWebCosoleEnabled()
|
||||||
|
{
|
||||||
|
return ZooProvider.IsWebCosoleEnabled();
|
||||||
|
}
|
||||||
|
|
||||||
|
[WebMethod, SoapHeader("settings")]
|
||||||
|
public void SetWebCosoleEnabled(bool enabled)
|
||||||
|
{
|
||||||
|
ZooProvider.SetWebCosoleEnabled(enabled);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1093,6 +1093,82 @@ namespace WebsitePanel.Server
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Helicon Zoo
|
||||||
|
|
||||||
|
[WebMethod, SoapHeader("settings")]
|
||||||
|
public WebVirtualDirectory[] GetZooApplications(string siteId)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Log.WriteStart("'{0}' GetZooApplications", ProviderSettings.ProviderName);
|
||||||
|
WebVirtualDirectory[] result = WebProvider.GetZooApplications(siteId);
|
||||||
|
Log.WriteEnd("'{0}' GetZooApplications", ProviderSettings.ProviderName);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Log.WriteError(String.Format("'{0}' GetZooApplications", ProviderSettings.ProviderName), ex);
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[WebMethod, SoapHeader("settings")]
|
||||||
|
public StringResultObject SetZooEnvironmentVariable(string siteId, string appName, string envName, string envValue)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Log.WriteStart("'{0}' SetZooEnvironmentVariable", ProviderSettings.ProviderName);
|
||||||
|
StringResultObject result = WebProvider.SetZooEnvironmentVariable(siteId, appName, envName, envValue);
|
||||||
|
Log.WriteEnd("'{0}' SetZooEnvironmentVariable", ProviderSettings.ProviderName);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Log.WriteError(String.Format("'{0}' SetZooEnvironmentVariable", ProviderSettings.ProviderName), ex);
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[WebMethod, SoapHeader("settings")]
|
||||||
|
public StringResultObject SetZooConsoleEnabled(string siteId, string appName)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Log.WriteStart("'{0}' SetZooConsoleEnabled", ProviderSettings.ProviderName);
|
||||||
|
StringResultObject result = WebProvider.SetZooConsoleEnabled(siteId, appName);
|
||||||
|
Log.WriteEnd("'{0}' SetZooConsoleEnabled", ProviderSettings.ProviderName);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Log.WriteError(String.Format("'{0}' SetZooConsoleEnabled", ProviderSettings.ProviderName), ex);
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
[WebMethod, SoapHeader("settings")]
|
||||||
|
public StringResultObject SetZooConsoleDisabled(string siteId, string appName)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Log.WriteStart("'{0}' SetZooConsoleDisabled", ProviderSettings.ProviderName);
|
||||||
|
StringResultObject result = WebProvider.SetZooConsoleDisabled(siteId, appName);
|
||||||
|
Log.WriteEnd("'{0}' SetZooConsoleDisabled", ProviderSettings.ProviderName);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Log.WriteError(String.Format("'{0}' SetZooConsoleDisabled", ProviderSettings.ProviderName), ex);
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Web Application Gallery
|
#region Web Application Gallery
|
||||||
|
|
|
@ -123,4 +123,20 @@
|
||||||
<data name="SelectWebEngine.Text" xml:space="preserve">
|
<data name="SelectWebEngine.Text" xml:space="preserve">
|
||||||
<value>Select web application engine to set up</value>
|
<value>Select web application engine to set up</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="gvInstalledApplicationsEnableConsole.Header" xml:space="preserve">
|
||||||
|
<value>Web console</value>
|
||||||
|
</data>
|
||||||
|
<data name="gvInstalledApplicationsConsoleUrl.Header" xml:space="preserve">
|
||||||
|
<value>Web console url</value>
|
||||||
|
</data>
|
||||||
|
<data name="btnEnable.Text" xml:space="preserve">
|
||||||
|
<value>Enable console for 1 day</value>
|
||||||
|
</data>
|
||||||
|
<data name="btnDisable.Text" xml:space="preserve">
|
||||||
|
<value>Disable</value>
|
||||||
|
</data>
|
||||||
|
<data name="EnableWebConsole.Text" xml:space="preserve">
|
||||||
|
<value>Enable web console</value>
|
||||||
|
</data>
|
||||||
|
|
||||||
</root>
|
</root>
|
|
@ -89,10 +89,12 @@ span.ValidationMessageBlock {
|
||||||
|
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend>
|
<legend>
|
||||||
<span>Helicon Zoo engine quotas settings</span>
|
<span>Helicon Zoo settings</span>
|
||||||
</legend>
|
</legend>
|
||||||
<div class="FormBody">
|
<div class="FormBody">
|
||||||
<asp:CheckBox runat="server" ID="QuotasEnabled" Text="Enable Quotas"/>
|
<asp:CheckBox runat="server" ID="QuotasEnabled" Text="Enable hosting plan controls for web engines."/>
|
||||||
|
<br />
|
||||||
|
<asp:CheckBox runat="server" ID="WebCosoleEnabled" Text="Enable web console."/>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
|
|
|
@ -114,6 +114,8 @@ public partial class HeliconZoo_Settings : WebsitePanelControlBase, IHostingServ
|
||||||
// bind 'Enable quotas' checkbox
|
// bind 'Enable quotas' checkbox
|
||||||
bool enabled = ES.Services.HeliconZoo.IsEnginesEnabled(PanelRequest.ServiceId);
|
bool enabled = ES.Services.HeliconZoo.IsEnginesEnabled(PanelRequest.ServiceId);
|
||||||
QuotasEnabled.Checked = !enabled;
|
QuotasEnabled.Checked = !enabled;
|
||||||
|
|
||||||
|
WebCosoleEnabled.Checked = ES.Services.HeliconZoo.IsWebCosoleEnabled(PanelRequest.ServiceId);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -139,6 +141,8 @@ public partial class HeliconZoo_Settings : WebsitePanelControlBase, IHostingServ
|
||||||
|
|
||||||
// save switcher
|
// save switcher
|
||||||
ES.Services.HeliconZoo.SwithEnginesEnabled(PanelRequest.ServiceId, !QuotasEnabled.Checked);
|
ES.Services.HeliconZoo.SwithEnginesEnabled(PanelRequest.ServiceId, !QuotasEnabled.Checked);
|
||||||
|
|
||||||
|
ES.Services.HeliconZoo.SetWebCosoleEnabled(PanelRequest.ServiceId, WebCosoleEnabled.Checked);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void ClearEngineForm()
|
protected void ClearEngineForm()
|
||||||
|
|
|
@ -1,32 +1,4 @@
|
||||||
// Copyright (c) 2012, Outercurve Foundation.
|
//------------------------------------------------------------------------------
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// Redistribution and use in source and binary forms, with or without modification,
|
|
||||||
// are permitted provided that the following conditions are met:
|
|
||||||
//
|
|
||||||
// - Redistributions of source code must retain the above copyright notice, this
|
|
||||||
// list of conditions and the following disclaimer.
|
|
||||||
//
|
|
||||||
// - Redistributions in binary form must reproduce the above copyright notice,
|
|
||||||
// this list of conditions and the following disclaimer in the documentation
|
|
||||||
// and/or other materials provided with the distribution.
|
|
||||||
//
|
|
||||||
// - Neither the name of the Outercurve Foundation nor the names of its
|
|
||||||
// contributors may be used to endorse or promote products derived from this
|
|
||||||
// software without specific prior written permission.
|
|
||||||
//
|
|
||||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
||||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
||||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
|
||||||
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
||||||
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
||||||
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
||||||
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
||||||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
//
|
//
|
||||||
|
@ -84,6 +56,15 @@ public partial class HeliconZoo_Settings {
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::System.Web.UI.WebControls.Label HostingPackagesLoadingError;
|
protected global::System.Web.UI.WebControls.Label HostingPackagesLoadingError;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// EnginesPanel 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.Panel EnginesPanel;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// QuotasEnabled control.
|
/// QuotasEnabled control.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -94,13 +75,13 @@ public partial class HeliconZoo_Settings {
|
||||||
protected global::System.Web.UI.WebControls.CheckBox QuotasEnabled;
|
protected global::System.Web.UI.WebControls.CheckBox QuotasEnabled;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// EnginesPanel control.
|
/// WebCosoleEnabled control.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Auto-generated field.
|
/// Auto-generated field.
|
||||||
/// To modify move field declaration from designer file to code-behind file.
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::System.Web.UI.WebControls.Panel EnginesPanel;
|
protected global::System.Web.UI.WebControls.CheckBox WebCosoleEnabled;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ButtonAddEngine control.
|
/// ButtonAddEngine control.
|
||||||
|
|
|
@ -28,12 +28,68 @@
|
||||||
--%>
|
--%>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<asp:Label runat="server" meta:resourcekey="SelectWebEngine" CssClass="NormalBold"></asp:Label>
|
<asp:Label ID="lblConsole" runat="server" meta:resourcekey="EnableWebConsole" CssClass="NormalBold"></asp:Label>
|
||||||
</p>
|
</p>
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
|
<%--<asp:GridView id="gvInstalledApplications" runat="server" AutoGenerateColumns="True" AllowPaging="true"
|
||||||
|
ShowHeader="false" CssSelectorClass="LightGridView" EmptyDataText="gvInstalledApplications.Empty"
|
||||||
|
>
|
||||||
|
</asp:GridView>--%>
|
||||||
|
|
||||||
|
<asp:GridView ID="gvInstalledApplications" runat="server"
|
||||||
|
EnableViewState="True" AutoGenerateColumns="false"
|
||||||
|
ShowHeader="true" CssSelectorClass="NormalGridView"
|
||||||
|
EmptyDataText="gvVirtualDirectories"
|
||||||
|
onrowcommand="gvInstalledApplications_RowCommand">
|
||||||
|
<Columns>
|
||||||
|
<asp:BoundField DataField="Name" HeaderText="Name">
|
||||||
|
<ItemStyle Width="60%" />
|
||||||
|
</asp:BoundField>
|
||||||
|
|
||||||
|
<asp:TemplateField HeaderText="gvInstalledApplicationsEnableConsole">
|
||||||
|
<ItemStyle HorizontalAlign="Center" />
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Button ID="btnEnable" runat="server"
|
||||||
|
Text='<%# GetLocalizedString("btnEnable.Text") %>' CssClass="Button1"
|
||||||
|
CommandArgument='<%# Eval("Name") %>'
|
||||||
|
CommandName="EnableConsole"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<asp:Button ID="btnDisable" runat="server"
|
||||||
|
Text='<%# GetLocalizedString("btnDisable.Text") %>' CssClass="Button1"
|
||||||
|
CommandArgument='<%# Eval("Name") %>'
|
||||||
|
CommandName="DisableConsole"
|
||||||
|
Visible= '<%# !IsNullOrEmpty( (string)Eval("ConsoleUrl")) %>'
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
|
||||||
|
<asp:TemplateField HeaderText="gvInstalledApplicationsConsoleUrl">
|
||||||
|
<ItemStyle HorizontalAlign="Center" />
|
||||||
|
<ItemTemplate>
|
||||||
|
|
||||||
|
|
||||||
|
<asp:hyperlink CssClass="MediumBold" NavigateUrl='<%# GetConsoleFullUrl((string)Eval("ConsoleUrl")) %>' runat="server" ID="lnkAppDetails" ToolTip='<%# Eval("ConsoleUrl") %>' Target="_blank">
|
||||||
|
<%# Eval("ConsoleUrl") %>
|
||||||
|
</asp:hyperlink>
|
||||||
|
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
</Columns>
|
||||||
|
</asp:GridView>
|
||||||
|
|
||||||
|
|
||||||
|
<p>
|
||||||
|
<asp:Label runat="server" meta:resourcekey="SelectWebEngine" CssClass="NormalBold"></asp:Label>
|
||||||
|
</p>
|
||||||
|
<br />
|
||||||
|
|
||||||
|
|
||||||
<asp:GridView id="gvApplications" runat="server" AutoGenerateColumns="False" AllowPaging="true"
|
<asp:GridView id="gvApplications" runat="server" AutoGenerateColumns="False" AllowPaging="true"
|
||||||
ShowHeader="false" CssSelectorClass="LightGridView" EmptyDataText="gvApplications" OnRowCommand="gvApplications_RowCommand"
|
ShowHeader="false" CssSelectorClass="LightGridView" EmptyDataText="There are no applications" OnRowCommand="gvApplications_RowCommand"
|
||||||
OnPageIndexChanging="gvApplications_PageIndexChanging">
|
OnPageIndexChanging="gvApplications_PageIndexChanging">
|
||||||
<Columns>
|
<Columns>
|
||||||
<asp:TemplateField HeaderText="gvApplicationsApplication">
|
<asp:TemplateField HeaderText="gvApplicationsApplication">
|
||||||
|
|
|
@ -32,6 +32,7 @@ namespace WebsitePanel.Portal
|
||||||
ViewState["WebSitePackageId"] = site.PackageId;
|
ViewState["WebSitePackageId"] = site.PackageId;
|
||||||
|
|
||||||
BindEngines(site);
|
BindEngines(site);
|
||||||
|
BindInstalledApplications();
|
||||||
BindApplications();
|
BindApplications();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -42,12 +43,17 @@ namespace WebsitePanel.Portal
|
||||||
ES.Services.HeliconZoo.GetAllowedHeliconZooQuotasForPackage(site.PackageId);
|
ES.Services.HeliconZoo.GetAllowedHeliconZooQuotasForPackage(site.PackageId);
|
||||||
Array.Sort(allowedEngineArray, new ShortHeliconZooEngineComparer());
|
Array.Sort(allowedEngineArray, new ShortHeliconZooEngineComparer());
|
||||||
|
|
||||||
// get enabled engines for this site
|
|
||||||
|
|
||||||
|
|
||||||
|
// get enabled engines for this site from applicationHost.config
|
||||||
string[] enabledEngineNames = ES.Services.HeliconZoo.GetEnabledEnginesForSite(site.SiteId, site.PackageId);
|
string[] enabledEngineNames = ES.Services.HeliconZoo.GetEnabledEnginesForSite(site.SiteId, site.PackageId);
|
||||||
ViewState["EnabledEnginesNames"] = enabledEngineNames;
|
ViewState["EnabledEnginesNames"] = enabledEngineNames;
|
||||||
|
|
||||||
|
//console allowed in applicationHost.config
|
||||||
|
ViewState["IsZooWebConsoleEnabled"] = enabledEngineNames.Contains("console", StringComparer.OrdinalIgnoreCase);
|
||||||
|
|
||||||
|
|
||||||
//EnabledEnginesList.DataSource = enabledEngineNames;
|
|
||||||
//EnabledEnginesList.DataBind();
|
|
||||||
|
|
||||||
|
|
||||||
List<ShortHeliconZooEngine> allowedEngines = new List<ShortHeliconZooEngine>(allowedEngineArray);
|
List<ShortHeliconZooEngine> allowedEngines = new List<ShortHeliconZooEngine>(allowedEngineArray);
|
||||||
|
@ -55,18 +61,41 @@ namespace WebsitePanel.Portal
|
||||||
foreach (ShortHeliconZooEngine engine in allowedEngines)
|
foreach (ShortHeliconZooEngine engine in allowedEngines)
|
||||||
{
|
{
|
||||||
engine.Name = engine.Name.Replace("HeliconZoo.", "");
|
engine.Name = engine.Name.Replace("HeliconZoo.", "");
|
||||||
engine.Enabled = enabledEngineNames.Contains(engine.Name, StringComparer.OrdinalIgnoreCase);
|
//engine.Enabled = enabledEngineNames.Contains(engine.Name, StringComparer.OrdinalIgnoreCase);
|
||||||
|
|
||||||
|
if (engine.Name == "console")
|
||||||
|
{
|
||||||
|
//console allowed in hosting plan
|
||||||
|
ViewState["IsZooWebConsoleEnabled"] = engine.Enabled;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ViewState["AllowedEngines"] = allowedEngines;
|
ViewState["AllowedEngines"] = allowedEngines;
|
||||||
|
|
||||||
//AllowedEnginesList.DataSource = allowedEngines;
|
}
|
||||||
//AllowedEnginesList.DataBind();
|
|
||||||
|
private void BindInstalledApplications()
|
||||||
|
{
|
||||||
|
if ((bool) ViewState["IsZooWebConsoleEnabled"])
|
||||||
|
{
|
||||||
|
gvInstalledApplications.DataSource = ES.Services.WebServers.GetZooApplications(PanelRequest.ItemID);
|
||||||
|
gvInstalledApplications.DataBind();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gvInstalledApplications.Visible = false;
|
||||||
|
lblConsole.Visible = false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BindApplications()
|
private void BindApplications()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
WebAppGalleryHelpers helper = new WebAppGalleryHelpers();
|
WebAppGalleryHelpers helper = new WebAppGalleryHelpers();
|
||||||
|
|
||||||
GalleryApplicationsResult result = helper.GetGalleryApplications("ZooTemplate", PanelSecurity.PackageId);
|
GalleryApplicationsResult result = helper.GetGalleryApplications("ZooTemplate", PanelSecurity.PackageId);
|
||||||
|
|
||||||
List<GalleryApplication> applications = result.Value as List<GalleryApplication>;
|
List<GalleryApplication> applications = result.Value as List<GalleryApplication>;
|
||||||
|
@ -77,19 +106,34 @@ namespace WebsitePanel.Portal
|
||||||
{
|
{
|
||||||
foreach (GalleryApplication application in applications)
|
foreach (GalleryApplication application in applications)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
foreach (string keyword in application.Keywords)
|
foreach (string keyword in application.Keywords)
|
||||||
{
|
{
|
||||||
|
bool appAlreadyAdded = false;
|
||||||
if (keyword.StartsWith("ZooEngine", StringComparison.OrdinalIgnoreCase))
|
if (keyword.StartsWith("ZooEngine", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
string appEngine = keyword.Substring("ZooEngine".Length);
|
string appEngine = keyword.Substring("ZooEngine".Length);
|
||||||
|
|
||||||
foreach (ShortHeliconZooEngine engine in allowedEngines)
|
foreach (ShortHeliconZooEngine engine in allowedEngines)
|
||||||
{
|
{
|
||||||
|
if (!engine.Enabled)
|
||||||
|
{
|
||||||
|
continue; //skip
|
||||||
|
}
|
||||||
|
|
||||||
if (string.Equals(appEngine, engine.KeywordedName, StringComparison.OrdinalIgnoreCase))
|
if (string.Equals(appEngine, engine.KeywordedName, StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
|
|
||||||
filteredApplications.Add(application);
|
filteredApplications.Add(application);
|
||||||
|
appAlreadyAdded = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (appAlreadyAdded)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -195,5 +239,44 @@ namespace WebsitePanel.Portal
|
||||||
|
|
||||||
return "~/Default.aspx?" + String.Join("&", url.ToArray());
|
return "~/Default.aspx?" + String.Join("&", url.ToArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void gvInstalledApplications_RowCommand(object sender, GridViewCommandEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.CommandName == "EnableConsole")
|
||||||
|
{
|
||||||
|
UpdatedAllowedEngines();
|
||||||
|
|
||||||
|
string appName = e.CommandArgument.ToString();
|
||||||
|
|
||||||
|
ES.Services.WebServers.SetZooConsoleEnabled(PanelRequest.ItemID, appName);
|
||||||
|
|
||||||
|
BindInstalledApplications();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (e.CommandName == "DisableConsole")
|
||||||
|
{
|
||||||
|
UpdatedAllowedEngines();
|
||||||
|
|
||||||
|
string appName = e.CommandArgument.ToString();
|
||||||
|
|
||||||
|
ES.Services.WebServers.SetZooConsoleDisabled(PanelRequest.ItemID, appName);
|
||||||
|
|
||||||
|
BindInstalledApplications();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
protected bool IsNullOrEmpty(string value)
|
||||||
|
{
|
||||||
|
return string.IsNullOrEmpty(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected string GetConsoleFullUrl(string consoleUrl)
|
||||||
|
{
|
||||||
|
WebSite site = ES.Services.WebServers.GetWebSite(PanelRequest.ItemID);
|
||||||
|
return "http://" + site.Name + consoleUrl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -26,6 +26,7 @@
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
|
@ -40,6 +41,24 @@ namespace WebsitePanel.Portal {
|
||||||
|
|
||||||
public partial class WebSitesHeliconZooControl {
|
public partial class WebSitesHeliconZooControl {
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// lblConsole 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.Label lblConsole;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gvInstalledApplications 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.GridView gvInstalledApplications;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// gvApplications control.
|
/// gvApplications control.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue