Merge Commit
This commit is contained in:
commit
f968209010
145 changed files with 220103 additions and 1156 deletions
|
@ -41,7 +41,7 @@ namespace WebsitePanel.EnterpriseServer
|
|||
public const int LIMITED = 2;
|
||||
public const int ESS = 22;
|
||||
|
||||
// CRM 2013
|
||||
// CRM 2013/2015
|
||||
public const int PROFESSIONAL = 0;
|
||||
public const int BASIC = 2;
|
||||
public const int ESSENTIAL = 5;
|
||||
|
|
|
@ -44,11 +44,12 @@ namespace WebsitePanel.EnterpriseServer
|
|||
public const string Dns = "DNS";
|
||||
public const string Statistics = "Statistics";
|
||||
public const string SharePoint = "SharePoint";
|
||||
public const string HostedSharePoint = "Hosted SharePoint";
|
||||
public const string SharepointFoundationServer = "Sharepoint Foundation Server";
|
||||
public const string SharepointServer = "Sharepoint Server";
|
||||
public const string Exchange = "Exchange";
|
||||
public const string HostedOrganizations = "Hosted Organizations";
|
||||
public const string HostedCRM = "Hosted CRM";
|
||||
public const string HostedCRM2013 = "Hosted CRM2013";
|
||||
public const string HostedCRM2013 = "Hosted CRM2013"; // CRM 2013/2015
|
||||
public const string VPS = "VPS";
|
||||
public const string BlackBerry = "BlackBerry";
|
||||
public const string OCS = "OCS";
|
||||
|
|
|
@ -44,6 +44,7 @@ namespace WebsitePanel.EnterpriseServer
|
|||
public const string WPI_SETTINGS = "WpiSettings";
|
||||
public const string FILEMANAGER_SETTINGS = "FileManagerSettings";
|
||||
public const string PACKAGE_DISPLAY_SETTINGS = "PackageDisplaySettings";
|
||||
public const string RDS_SETTINGS = "RdsSettings";
|
||||
|
||||
// key to access to wpi main & custom feed in wpi settings
|
||||
public const string WPI_MAIN_FEED_KEY = "WpiMainFeedUrl";
|
||||
|
|
|
@ -63,6 +63,7 @@ namespace WebsitePanel.EnterpriseServer
|
|||
|
||||
public const string DEFAULT_MAILBOXPLANS = "DefaultMailboxPlans";
|
||||
public const string DEFAULT_LYNCUSERPLANS = "DefaultLyncUserPlans";
|
||||
public const string RDS_SETUP_LETTER = "RDSSetupLetter";
|
||||
|
||||
public int UserId;
|
||||
public string SettingsName;
|
||||
|
|
|
@ -18,9 +18,9 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
using System.Web.Services.Protocols;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using WebsitePanel.Providers.HostedSolution;
|
||||
using WebsitePanel.Providers.RemoteDesktopServices;
|
||||
using WebsitePanel.Providers.Common;
|
||||
using WebsitePanel.Providers.HostedSolution;
|
||||
|
||||
|
||||
/// <remarks/>
|
||||
|
@ -126,6 +126,12 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
|
||||
private System.Threading.SendOrPostCallback AddRdsCertificateOperationCompleted;
|
||||
|
||||
private System.Threading.SendOrPostCallback GetRdsServicesOperationCompleted;
|
||||
|
||||
private System.Threading.SendOrPostCallback GetRdsSetupLetterOperationCompleted;
|
||||
|
||||
private System.Threading.SendOrPostCallback SendRdsSetupLetterOperationCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
public esRemoteDesktopServices() {
|
||||
this.Url = "http://localhost:9002/esRemoteDesktopServices.asmx";
|
||||
|
@ -275,6 +281,15 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
/// <remarks/>
|
||||
public event AddRdsCertificateCompletedEventHandler AddRdsCertificateCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
public event GetRdsServicesCompletedEventHandler GetRdsServicesCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
public event GetRdsSetupLetterCompletedEventHandler GetRdsSetupLetterCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
public event SendRdsSetupLetterCompletedEventHandler SendRdsSetupLetterCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetRdsCollection", 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 RdsCollection GetRdsCollection(int collectionId) {
|
||||
|
@ -1999,7 +2014,7 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
|
||||
/// <remarks/>
|
||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetRdsServerInfo", 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 RdsServerInfo GetRdsServerInfo(int itemId, string fqdnName) {
|
||||
public RdsServerInfo GetRdsServerInfo([System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] System.Nullable<int> itemId, string fqdnName) {
|
||||
object[] results = this.Invoke("GetRdsServerInfo", new object[] {
|
||||
itemId,
|
||||
fqdnName});
|
||||
|
@ -2007,7 +2022,7 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
}
|
||||
|
||||
/// <remarks/>
|
||||
public System.IAsyncResult BeginGetRdsServerInfo(int itemId, string fqdnName, System.AsyncCallback callback, object asyncState) {
|
||||
public System.IAsyncResult BeginGetRdsServerInfo(System.Nullable<int> itemId, string fqdnName, System.AsyncCallback callback, object asyncState) {
|
||||
return this.BeginInvoke("GetRdsServerInfo", new object[] {
|
||||
itemId,
|
||||
fqdnName}, callback, asyncState);
|
||||
|
@ -2020,12 +2035,12 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void GetRdsServerInfoAsync(int itemId, string fqdnName) {
|
||||
public void GetRdsServerInfoAsync(System.Nullable<int> itemId, string fqdnName) {
|
||||
this.GetRdsServerInfoAsync(itemId, fqdnName, null);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void GetRdsServerInfoAsync(int itemId, string fqdnName, object userState) {
|
||||
public void GetRdsServerInfoAsync(System.Nullable<int> itemId, string fqdnName, object userState) {
|
||||
if ((this.GetRdsServerInfoOperationCompleted == null)) {
|
||||
this.GetRdsServerInfoOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRdsServerInfoOperationCompleted);
|
||||
}
|
||||
|
@ -2043,7 +2058,7 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
|
||||
/// <remarks/>
|
||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetRdsServerStatus", 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 string GetRdsServerStatus(int itemId, string fqdnName) {
|
||||
public string GetRdsServerStatus([System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] System.Nullable<int> itemId, string fqdnName) {
|
||||
object[] results = this.Invoke("GetRdsServerStatus", new object[] {
|
||||
itemId,
|
||||
fqdnName});
|
||||
|
@ -2051,7 +2066,7 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
}
|
||||
|
||||
/// <remarks/>
|
||||
public System.IAsyncResult BeginGetRdsServerStatus(int itemId, string fqdnName, System.AsyncCallback callback, object asyncState) {
|
||||
public System.IAsyncResult BeginGetRdsServerStatus(System.Nullable<int> itemId, string fqdnName, System.AsyncCallback callback, object asyncState) {
|
||||
return this.BeginInvoke("GetRdsServerStatus", new object[] {
|
||||
itemId,
|
||||
fqdnName}, callback, asyncState);
|
||||
|
@ -2064,12 +2079,12 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void GetRdsServerStatusAsync(int itemId, string fqdnName) {
|
||||
public void GetRdsServerStatusAsync(System.Nullable<int> itemId, string fqdnName) {
|
||||
this.GetRdsServerStatusAsync(itemId, fqdnName, null);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void GetRdsServerStatusAsync(int itemId, string fqdnName, object userState) {
|
||||
public void GetRdsServerStatusAsync(System.Nullable<int> itemId, string fqdnName, object userState) {
|
||||
if ((this.GetRdsServerStatusOperationCompleted == null)) {
|
||||
this.GetRdsServerStatusOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRdsServerStatusOperationCompleted);
|
||||
}
|
||||
|
@ -2087,7 +2102,7 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
|
||||
/// <remarks/>
|
||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/ShutDownRdsServer", 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 ResultObject ShutDownRdsServer(int itemId, string fqdnName) {
|
||||
public ResultObject ShutDownRdsServer([System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] System.Nullable<int> itemId, string fqdnName) {
|
||||
object[] results = this.Invoke("ShutDownRdsServer", new object[] {
|
||||
itemId,
|
||||
fqdnName});
|
||||
|
@ -2095,7 +2110,7 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
}
|
||||
|
||||
/// <remarks/>
|
||||
public System.IAsyncResult BeginShutDownRdsServer(int itemId, string fqdnName, System.AsyncCallback callback, object asyncState) {
|
||||
public System.IAsyncResult BeginShutDownRdsServer(System.Nullable<int> itemId, string fqdnName, System.AsyncCallback callback, object asyncState) {
|
||||
return this.BeginInvoke("ShutDownRdsServer", new object[] {
|
||||
itemId,
|
||||
fqdnName}, callback, asyncState);
|
||||
|
@ -2108,12 +2123,12 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void ShutDownRdsServerAsync(int itemId, string fqdnName) {
|
||||
public void ShutDownRdsServerAsync(System.Nullable<int> itemId, string fqdnName) {
|
||||
this.ShutDownRdsServerAsync(itemId, fqdnName, null);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void ShutDownRdsServerAsync(int itemId, string fqdnName, object userState) {
|
||||
public void ShutDownRdsServerAsync(System.Nullable<int> itemId, string fqdnName, object userState) {
|
||||
if ((this.ShutDownRdsServerOperationCompleted == null)) {
|
||||
this.ShutDownRdsServerOperationCompleted = new System.Threading.SendOrPostCallback(this.OnShutDownRdsServerOperationCompleted);
|
||||
}
|
||||
|
@ -2131,7 +2146,7 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
|
||||
/// <remarks/>
|
||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/RestartRdsServer", 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 ResultObject RestartRdsServer(int itemId, string fqdnName) {
|
||||
public ResultObject RestartRdsServer([System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] System.Nullable<int> itemId, string fqdnName) {
|
||||
object[] results = this.Invoke("RestartRdsServer", new object[] {
|
||||
itemId,
|
||||
fqdnName});
|
||||
|
@ -2139,7 +2154,7 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
}
|
||||
|
||||
/// <remarks/>
|
||||
public System.IAsyncResult BeginRestartRdsServer(int itemId, string fqdnName, System.AsyncCallback callback, object asyncState) {
|
||||
public System.IAsyncResult BeginRestartRdsServer(System.Nullable<int> itemId, string fqdnName, System.AsyncCallback callback, object asyncState) {
|
||||
return this.BeginInvoke("RestartRdsServer", new object[] {
|
||||
itemId,
|
||||
fqdnName}, callback, asyncState);
|
||||
|
@ -2152,12 +2167,12 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void RestartRdsServerAsync(int itemId, string fqdnName) {
|
||||
public void RestartRdsServerAsync(System.Nullable<int> itemId, string fqdnName) {
|
||||
this.RestartRdsServerAsync(itemId, fqdnName, null);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void RestartRdsServerAsync(int itemId, string fqdnName, object userState) {
|
||||
public void RestartRdsServerAsync(System.Nullable<int> itemId, string fqdnName, object userState) {
|
||||
if ((this.RestartRdsServerOperationCompleted == null)) {
|
||||
this.RestartRdsServerOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRestartRdsServerOperationCompleted);
|
||||
}
|
||||
|
@ -2342,14 +2357,14 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
|
||||
/// <remarks/>
|
||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetRdsCertificateByItemId", 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 RdsCertificate GetRdsCertificateByItemId(int itemId) {
|
||||
public RdsCertificate GetRdsCertificateByItemId([System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] System.Nullable<int> itemId) {
|
||||
object[] results = this.Invoke("GetRdsCertificateByItemId", new object[] {
|
||||
itemId});
|
||||
return ((RdsCertificate)(results[0]));
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public System.IAsyncResult BeginGetRdsCertificateByItemId(int itemId, System.AsyncCallback callback, object asyncState) {
|
||||
public System.IAsyncResult BeginGetRdsCertificateByItemId(System.Nullable<int> itemId, System.AsyncCallback callback, object asyncState) {
|
||||
return this.BeginInvoke("GetRdsCertificateByItemId", new object[] {
|
||||
itemId}, callback, asyncState);
|
||||
}
|
||||
|
@ -2361,12 +2376,12 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void GetRdsCertificateByItemIdAsync(int itemId) {
|
||||
public void GetRdsCertificateByItemIdAsync(System.Nullable<int> itemId) {
|
||||
this.GetRdsCertificateByItemIdAsync(itemId, null);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void GetRdsCertificateByItemIdAsync(int itemId, object userState) {
|
||||
public void GetRdsCertificateByItemIdAsync(System.Nullable<int> itemId, object userState) {
|
||||
if ((this.GetRdsCertificateByItemIdOperationCompleted == null)) {
|
||||
this.GetRdsCertificateByItemIdOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRdsCertificateByItemIdOperationCompleted);
|
||||
}
|
||||
|
@ -2422,6 +2437,138 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetRdsServices", 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 ServiceInfo[] GetRdsServices() {
|
||||
object[] results = this.Invoke("GetRdsServices", new object[0]);
|
||||
return ((ServiceInfo[])(results[0]));
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public System.IAsyncResult BeginGetRdsServices(System.AsyncCallback callback, object asyncState) {
|
||||
return this.BeginInvoke("GetRdsServices", new object[0], callback, asyncState);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public ServiceInfo[] EndGetRdsServices(System.IAsyncResult asyncResult) {
|
||||
object[] results = this.EndInvoke(asyncResult);
|
||||
return ((ServiceInfo[])(results[0]));
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void GetRdsServicesAsync() {
|
||||
this.GetRdsServicesAsync(null);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void GetRdsServicesAsync(object userState) {
|
||||
if ((this.GetRdsServicesOperationCompleted == null)) {
|
||||
this.GetRdsServicesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRdsServicesOperationCompleted);
|
||||
}
|
||||
this.InvokeAsync("GetRdsServices", new object[0], this.GetRdsServicesOperationCompleted, userState);
|
||||
}
|
||||
|
||||
private void OnGetRdsServicesOperationCompleted(object arg) {
|
||||
if ((this.GetRdsServicesCompleted != null)) {
|
||||
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
|
||||
this.GetRdsServicesCompleted(this, new GetRdsServicesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetRdsSetupLetter", 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 string GetRdsSetupLetter(int itemId, [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] System.Nullable<int> accountId) {
|
||||
object[] results = this.Invoke("GetRdsSetupLetter", new object[] {
|
||||
itemId,
|
||||
accountId});
|
||||
return ((string)(results[0]));
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public System.IAsyncResult BeginGetRdsSetupLetter(int itemId, System.Nullable<int> accountId, System.AsyncCallback callback, object asyncState) {
|
||||
return this.BeginInvoke("GetRdsSetupLetter", new object[] {
|
||||
itemId,
|
||||
accountId}, callback, asyncState);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public string EndGetRdsSetupLetter(System.IAsyncResult asyncResult) {
|
||||
object[] results = this.EndInvoke(asyncResult);
|
||||
return ((string)(results[0]));
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void GetRdsSetupLetterAsync(int itemId, System.Nullable<int> accountId) {
|
||||
this.GetRdsSetupLetterAsync(itemId, accountId, null);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void GetRdsSetupLetterAsync(int itemId, System.Nullable<int> accountId, object userState) {
|
||||
if ((this.GetRdsSetupLetterOperationCompleted == null)) {
|
||||
this.GetRdsSetupLetterOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRdsSetupLetterOperationCompleted);
|
||||
}
|
||||
this.InvokeAsync("GetRdsSetupLetter", new object[] {
|
||||
itemId,
|
||||
accountId}, this.GetRdsSetupLetterOperationCompleted, userState);
|
||||
}
|
||||
|
||||
private void OnGetRdsSetupLetterOperationCompleted(object arg) {
|
||||
if ((this.GetRdsSetupLetterCompleted != null)) {
|
||||
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
|
||||
this.GetRdsSetupLetterCompleted(this, new GetRdsSetupLetterCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SendRdsSetupLetter", 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 SendRdsSetupLetter(int itemId, [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] System.Nullable<int> accountId, string to, string cc) {
|
||||
object[] results = this.Invoke("SendRdsSetupLetter", new object[] {
|
||||
itemId,
|
||||
accountId,
|
||||
to,
|
||||
cc});
|
||||
return ((int)(results[0]));
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public System.IAsyncResult BeginSendRdsSetupLetter(int itemId, System.Nullable<int> accountId, string to, string cc, System.AsyncCallback callback, object asyncState) {
|
||||
return this.BeginInvoke("SendRdsSetupLetter", new object[] {
|
||||
itemId,
|
||||
accountId,
|
||||
to,
|
||||
cc}, callback, asyncState);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public int EndSendRdsSetupLetter(System.IAsyncResult asyncResult) {
|
||||
object[] results = this.EndInvoke(asyncResult);
|
||||
return ((int)(results[0]));
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void SendRdsSetupLetterAsync(int itemId, System.Nullable<int> accountId, string to, string cc) {
|
||||
this.SendRdsSetupLetterAsync(itemId, accountId, to, cc, null);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void SendRdsSetupLetterAsync(int itemId, System.Nullable<int> accountId, string to, string cc, object userState) {
|
||||
if ((this.SendRdsSetupLetterOperationCompleted == null)) {
|
||||
this.SendRdsSetupLetterOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSendRdsSetupLetterOperationCompleted);
|
||||
}
|
||||
this.InvokeAsync("SendRdsSetupLetter", new object[] {
|
||||
itemId,
|
||||
accountId,
|
||||
to,
|
||||
cc}, this.SendRdsSetupLetterOperationCompleted, userState);
|
||||
}
|
||||
|
||||
private void OnSendRdsSetupLetterOperationCompleted(object arg) {
|
||||
if ((this.SendRdsSetupLetterCompleted != null)) {
|
||||
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
|
||||
this.SendRdsSetupLetterCompleted(this, new SendRdsSetupLetterCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public new void CancelAsync(object userState) {
|
||||
base.CancelAsync(userState);
|
||||
|
@ -3675,4 +3822,82 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||
public delegate void GetRdsServicesCompletedEventHandler(object sender, GetRdsServicesCompletedEventArgs e);
|
||||
|
||||
/// <remarks/>
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||
[System.Diagnostics.DebuggerStepThroughAttribute()]
|
||||
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||
public partial class GetRdsServicesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
|
||||
|
||||
private object[] results;
|
||||
|
||||
internal GetRdsServicesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
|
||||
base(exception, cancelled, userState) {
|
||||
this.results = results;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public ServiceInfo[] Result {
|
||||
get {
|
||||
this.RaiseExceptionIfNecessary();
|
||||
return ((ServiceInfo[])(this.results[0]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||
public delegate void GetRdsSetupLetterCompletedEventHandler(object sender, GetRdsSetupLetterCompletedEventArgs e);
|
||||
|
||||
/// <remarks/>
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||
[System.Diagnostics.DebuggerStepThroughAttribute()]
|
||||
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||
public partial class GetRdsSetupLetterCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
|
||||
|
||||
private object[] results;
|
||||
|
||||
internal GetRdsSetupLetterCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
|
||||
base(exception, cancelled, userState) {
|
||||
this.results = results;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public string Result {
|
||||
get {
|
||||
this.RaiseExceptionIfNecessary();
|
||||
return ((string)(this.results[0]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||
public delegate void SendRdsSetupLetterCompletedEventHandler(object sender, SendRdsSetupLetterCompletedEventArgs e);
|
||||
|
||||
/// <remarks/>
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||
[System.Diagnostics.DebuggerStepThroughAttribute()]
|
||||
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||
public partial class SendRdsSetupLetterCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
|
||||
|
||||
private object[] results;
|
||||
|
||||
internal SendRdsSetupLetterCompletedEventArgs(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]));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -963,7 +963,7 @@ namespace WebsitePanel.EnterpriseServer
|
|||
|
||||
PackageContext cntxTmp = PackageController.GetPackageContext(org.PackageId);
|
||||
|
||||
if (cntxTmp.Groups.ContainsKey(ResourceGroups.HostedSharePoint))
|
||||
if (cntxTmp.Groups.ContainsKey(ResourceGroups.SharepointFoundationServer))
|
||||
{
|
||||
SharePointSiteCollectionListPaged sharePointStats = HostedSharePointServerController.GetSiteCollectionsPaged(org.PackageId, org.Id, string.Empty, string.Empty, string.Empty, 0, 0);
|
||||
stats.CreatedSharePointSiteCollections = sharePointStats.TotalRowCount;
|
||||
|
@ -1044,11 +1044,11 @@ namespace WebsitePanel.EnterpriseServer
|
|||
|
||||
PackageContext cntxTmp = PackageController.GetPackageContext(org.PackageId);
|
||||
|
||||
if (cntxTmp.Groups.ContainsKey(ResourceGroups.HostedSharePoint))
|
||||
if (cntxTmp.Groups.ContainsKey(ResourceGroups.SharepointFoundationServer))
|
||||
{
|
||||
SharePointSiteCollectionListPaged sharePointStats = HostedSharePointServerController.GetSiteCollectionsPaged(org.PackageId, o.Id, string.Empty, string.Empty, string.Empty, 0, 0);
|
||||
stats.CreatedSharePointSiteCollections += sharePointStats.TotalRowCount;
|
||||
}
|
||||
}
|
||||
|
||||
if (cntxTmp.Groups.ContainsKey(ResourceGroups.HostedCRM))
|
||||
{
|
||||
|
@ -1112,7 +1112,7 @@ namespace WebsitePanel.EnterpriseServer
|
|||
stats.AllocatedDomains = cntx.Quotas[Quotas.ORGANIZATION_DOMAINS].QuotaAllocatedValue;
|
||||
stats.AllocatedGroups = cntx.Quotas[Quotas.ORGANIZATION_SECURITYGROUPS].QuotaAllocatedValue;
|
||||
|
||||
if (cntx.Groups.ContainsKey(ResourceGroups.HostedSharePoint))
|
||||
if (cntx.Groups.ContainsKey(ResourceGroups.SharepointFoundationServer))
|
||||
{
|
||||
stats.AllocatedSharePointSiteCollections = cntx.Quotas[Quotas.HOSTED_SHAREPOINT_SITES].QuotaAllocatedValue;
|
||||
}
|
||||
|
|
|
@ -155,7 +155,7 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution
|
|||
|
||||
private static int GetHostedSharePointServiceId(int packageId)
|
||||
{
|
||||
return PackageController.GetPackageServiceId(packageId, ResourceGroups.HostedSharePoint);
|
||||
return PackageController.GetPackageServiceId(packageId, ResourceGroups.SharepointFoundationServer);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -43,6 +43,8 @@ using WebsitePanel.Providers.HostedSolution;
|
|||
using WebsitePanel.Providers.OS;
|
||||
using WebsitePanel.Providers.RemoteDesktopServices;
|
||||
using WebsitePanel.Providers.Web;
|
||||
using System.Net.Mail;
|
||||
using System.Collections;
|
||||
|
||||
namespace WebsitePanel.EnterpriseServer
|
||||
{
|
||||
|
@ -248,22 +250,22 @@ namespace WebsitePanel.EnterpriseServer
|
|||
return GetRdsCollectionSessionHostsInternal(collectionId);
|
||||
}
|
||||
|
||||
public static RdsServerInfo GetRdsServerInfo(int itemId, string fqdnName)
|
||||
public static RdsServerInfo GetRdsServerInfo(int? itemId, string fqdnName)
|
||||
{
|
||||
return GetRdsServerInfoInternal(itemId, fqdnName);
|
||||
}
|
||||
|
||||
public static string GetRdsServerStatus(int itemId, string fqdnName)
|
||||
public static string GetRdsServerStatus(int? itemId, string fqdnName)
|
||||
{
|
||||
return GetRdsServerStatusInternal(itemId, fqdnName);
|
||||
}
|
||||
|
||||
public static ResultObject ShutDownRdsServer(int itemId, string fqdnName)
|
||||
public static ResultObject ShutDownRdsServer(int? itemId, string fqdnName)
|
||||
{
|
||||
return ShutDownRdsServerInternal(itemId, fqdnName);
|
||||
}
|
||||
|
||||
public static ResultObject RestartRdsServer(int itemId, string fqdnName)
|
||||
public static ResultObject RestartRdsServer(int? itemId, string fqdnName)
|
||||
{
|
||||
return RestartRdsServerInternal(itemId, fqdnName);
|
||||
}
|
||||
|
@ -288,7 +290,7 @@ namespace WebsitePanel.EnterpriseServer
|
|||
return GetRdsCertificateByServiceIdInternal(serviceId);
|
||||
}
|
||||
|
||||
public static RdsCertificate GetRdsCertificateByItemId(int itemId)
|
||||
public static RdsCertificate GetRdsCertificateByItemId(int? itemId)
|
||||
{
|
||||
return GetRdsCertificateByItemIdInternal(itemId);
|
||||
}
|
||||
|
@ -298,22 +300,108 @@ namespace WebsitePanel.EnterpriseServer
|
|||
return AddRdsCertificateInternal(certificate);
|
||||
}
|
||||
|
||||
public static List<ServiceInfo> GetRdsServices()
|
||||
{
|
||||
return GetRdsServicesInternal();
|
||||
}
|
||||
|
||||
private static List<ServiceInfo> GetRdsServicesInternal()
|
||||
{
|
||||
return ObjectUtils.CreateListFromDataSet<ServiceInfo>(DataProvider.GetServicesByGroupName(SecurityContext.User.UserId, ResourceGroups.RDS));
|
||||
}
|
||||
|
||||
public static string GetRdsSetupLetter(int itemId, int? accountId)
|
||||
{
|
||||
return GetRdsSetupLetterInternal(itemId, accountId);
|
||||
}
|
||||
|
||||
public static int SendRdsSetupLetter(int itemId, int? accountId, string to, string cc)
|
||||
{
|
||||
return SendRdsSetupLetterInternal(itemId, accountId, to, cc);
|
||||
}
|
||||
|
||||
private static string GetRdsSetupLetterInternal(int itemId, int? accountId)
|
||||
{
|
||||
Organization org = OrganizationController.GetOrganization(itemId);
|
||||
|
||||
if (org == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
UserInfo user = PackageController.GetPackageOwner(org.PackageId);
|
||||
UserSettings settings = UserController.GetUserSettings(user.UserId, UserSettings.RDS_SETUP_LETTER);
|
||||
string settingName = user.HtmlMail ? "HtmlBody" : "TextBody";
|
||||
string body = settings[settingName];
|
||||
|
||||
if (String.IsNullOrEmpty(body))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
string result = EvaluateMailboxTemplate(body, org, accountId, itemId);
|
||||
|
||||
return user.HtmlMail ? result : result.Replace("\n", "<br/>");
|
||||
}
|
||||
|
||||
private static int SendRdsSetupLetterInternal(int itemId, int? accountId, string to, string cc)
|
||||
{
|
||||
int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo);
|
||||
|
||||
if (accountCheck < 0)
|
||||
{
|
||||
return accountCheck;
|
||||
}
|
||||
|
||||
Organization org = OrganizationController.GetOrganization(itemId);
|
||||
|
||||
if (org == null)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
UserInfo user = PackageController.GetPackageOwner(org.PackageId);
|
||||
UserSettings settings = UserController.GetUserSettings(user.UserId, UserSettings.RDS_SETUP_LETTER);
|
||||
string from = settings["From"];
|
||||
|
||||
if (cc == null)
|
||||
{
|
||||
cc = settings["CC"];
|
||||
}
|
||||
|
||||
string subject = settings["Subject"];
|
||||
string body = user.HtmlMail ? settings["HtmlBody"] : settings["TextBody"];
|
||||
bool isHtml = user.HtmlMail;
|
||||
MailPriority priority = MailPriority.Normal;
|
||||
|
||||
if (!String.IsNullOrEmpty(settings["Priority"]))
|
||||
{
|
||||
priority = (MailPriority)Enum.Parse(typeof(MailPriority), settings["Priority"], true);
|
||||
}
|
||||
|
||||
if (String.IsNullOrEmpty(body))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (to == null)
|
||||
{
|
||||
to = user.Email;
|
||||
}
|
||||
|
||||
subject = EvaluateMailboxTemplate(subject, org, accountId, itemId);
|
||||
body = EvaluateMailboxTemplate(body, org, accountId, itemId);
|
||||
|
||||
return MailHelper.SendMessage(from, to, cc, subject, body, priority, isHtml);
|
||||
}
|
||||
|
||||
private static ResultObject InstallSessionHostsCertificateInternal(RdsServer rdsServer)
|
||||
{
|
||||
var result = TaskManager.StartResultTask<ResultObject>("REMOTE_DESKTOP_SERVICES", "INSTALL_CERTIFICATE");
|
||||
|
||||
try
|
||||
{
|
||||
Organization org = OrganizationController.GetOrganization(rdsServer.ItemId.Value);
|
||||
|
||||
if (org == null)
|
||||
{
|
||||
result.IsSuccess = false;
|
||||
result.AddError("", new NullReferenceException("Organization not found"));
|
||||
return result;
|
||||
}
|
||||
|
||||
int serviceId = GetRemoteDesktopServiceID(org.PackageId);
|
||||
{
|
||||
int serviceId = GetRdsServiceId(rdsServer.ItemId);
|
||||
var rds = GetRemoteDesktopServices(serviceId);
|
||||
var certificate = GetRdsCertificateByServiceIdInternal(serviceId);
|
||||
|
||||
|
@ -351,16 +439,9 @@ namespace WebsitePanel.EnterpriseServer
|
|||
return result;
|
||||
}
|
||||
|
||||
private static RdsCertificate GetRdsCertificateByItemIdInternal(int itemId)
|
||||
{
|
||||
Organization org = OrganizationController.GetOrganization(itemId);
|
||||
|
||||
if (org == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
int serviceId = GetRemoteDesktopServiceID(org.PackageId);
|
||||
private static RdsCertificate GetRdsCertificateByItemIdInternal(int? itemId)
|
||||
{
|
||||
int serviceId = GetRdsServiceId(itemId);
|
||||
var result = ObjectUtils.FillObjectFromDataReader<RdsCertificate>(DataProvider.GetRdsCertificateByServiceId(serviceId));
|
||||
|
||||
return result;
|
||||
|
@ -539,6 +620,14 @@ namespace WebsitePanel.EnterpriseServer
|
|||
|
||||
try
|
||||
{
|
||||
Organization org = OrganizationController.GetOrganization(itemId);
|
||||
if (org == null)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
|
||||
|
||||
foreach(var server in collection.Servers)
|
||||
{
|
||||
if (!server.FqdName.EndsWith(domainName, StringComparison.CurrentCultureIgnoreCase))
|
||||
|
@ -546,20 +635,12 @@ namespace WebsitePanel.EnterpriseServer
|
|||
throw TaskManager.WriteError(new Exception("Fully Qualified Domain Name not valid."));
|
||||
}
|
||||
|
||||
if (!CheckRDSServerAvaliable(server.FqdName))
|
||||
if (!rds.CheckRDSServerAvaliable(server.FqdName))
|
||||
{
|
||||
throw TaskManager.WriteError(new Exception(string.Format("Unable to connect to {0} server.", server.FqdName)));
|
||||
}
|
||||
}
|
||||
|
||||
// load organization
|
||||
Organization org = OrganizationController.GetOrganization(itemId);
|
||||
if (org == null)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
|
||||
|
||||
collection.Name = GetFormattedCollectionName(collection.DisplayName, org.OrganizationId);
|
||||
|
||||
collection.Settings = new RdsCollectionSettings
|
||||
|
@ -1031,12 +1112,17 @@ namespace WebsitePanel.EnterpriseServer
|
|||
|
||||
try
|
||||
{
|
||||
if (CheckRDSServerAvaliable(rdsServer.FqdName))
|
||||
int serviceId = GetRdsMainServiceId();
|
||||
var rds = GetRemoteDesktopServices(serviceId);
|
||||
|
||||
if (rds.CheckRDSServerAvaliable(rdsServer.FqdName))
|
||||
{
|
||||
var domainName = IPGlobalProperties.GetIPGlobalProperties().DomainName;
|
||||
|
||||
if (rdsServer.FqdName.EndsWith(domainName, StringComparison.CurrentCultureIgnoreCase))
|
||||
{
|
||||
{
|
||||
rds.AddSessionHostFeatureToServer(rdsServer.FqdName);
|
||||
rds.MoveSessionHostToRdsOU(rdsServer.Name);
|
||||
rdsServer.Id = DataProvider.AddRDSServer(rdsServer.Name, rdsServer.FqdName, rdsServer.Description);
|
||||
}
|
||||
else
|
||||
|
@ -1194,12 +1280,6 @@ namespace WebsitePanel.EnterpriseServer
|
|||
var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
|
||||
|
||||
RdsServer rdsServer = GetRdsServer(serverId);
|
||||
|
||||
//if (!rds.CheckSessionHostFeatureInstallation(rdsServer.FqdName))
|
||||
{
|
||||
rds.AddSessionHostFeatureToServer(rdsServer.FqdName);
|
||||
}
|
||||
|
||||
rds.MoveRdsServerToTenantOU(rdsServer.FqdName, org.OrganizationId);
|
||||
DataProvider.AddRDSServerToOrganization(itemId, serverId);
|
||||
}
|
||||
|
@ -1508,36 +1588,32 @@ namespace WebsitePanel.EnterpriseServer
|
|||
return result;
|
||||
}
|
||||
|
||||
private static RdsServerInfo GetRdsServerInfoInternal(int itemId, string fqdnName)
|
||||
private static RdsServerInfo GetRdsServerInfoInternal(int? itemId, string fqdnName)
|
||||
{
|
||||
Organization org = OrganizationController.GetOrganization(itemId);
|
||||
int serviceId = GetRdsServiceId(itemId);
|
||||
var result = new RdsServerInfo();
|
||||
|
||||
if (org == null)
|
||||
if (serviceId != -1)
|
||||
{
|
||||
return new RdsServerInfo();
|
||||
var rds = GetRemoteDesktopServices(serviceId);
|
||||
result = rds.GetRdsServerInfo(fqdnName);
|
||||
}
|
||||
|
||||
var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
|
||||
var result = rds.GetRdsServerInfo(fqdnName);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private static string GetRdsServerStatusInternal(int itemId, string fqdnName)
|
||||
{
|
||||
Organization org = OrganizationController.GetOrganization(itemId);
|
||||
private static string GetRdsServerStatusInternal(int? itemId, string fqdnName)
|
||||
{
|
||||
var result = "Unavailable";
|
||||
|
||||
if (org == null)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
|
||||
var serviceId = GetRdsServiceId(itemId);
|
||||
|
||||
try
|
||||
{
|
||||
result = rds.GetRdsServerStatus(fqdnName);
|
||||
if (serviceId != -1)
|
||||
{
|
||||
var rds = GetRemoteDesktopServices(serviceId);
|
||||
result = rds.GetRdsServerStatus(fqdnName);
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
@ -1546,23 +1622,19 @@ namespace WebsitePanel.EnterpriseServer
|
|||
return result;
|
||||
}
|
||||
|
||||
private static ResultObject ShutDownRdsServerInternal(int itemId, string fqdnName)
|
||||
private static ResultObject ShutDownRdsServerInternal(int? itemId, string fqdnName)
|
||||
{
|
||||
var result = TaskManager.StartResultTask<ResultObject>("REMOTE_DESKTOP_SERVICES", "SHUTDOWN_RDS_SERVER");
|
||||
|
||||
try
|
||||
{
|
||||
Organization org = OrganizationController.GetOrganization(itemId);
|
||||
{
|
||||
int serviceId = GetRdsServiceId(itemId);
|
||||
|
||||
if (org == null)
|
||||
if (serviceId != -1)
|
||||
{
|
||||
result.IsSuccess = false;
|
||||
result.AddError("", new NullReferenceException("Organization not found"));
|
||||
return result;
|
||||
var rds = GetRemoteDesktopServices(serviceId);
|
||||
rds.ShutDownRdsServer(fqdnName);
|
||||
}
|
||||
|
||||
var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
|
||||
rds.ShutDownRdsServer(fqdnName);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -1583,23 +1655,19 @@ namespace WebsitePanel.EnterpriseServer
|
|||
return result;
|
||||
}
|
||||
|
||||
private static ResultObject RestartRdsServerInternal(int itemId, string fqdnName)
|
||||
private static ResultObject RestartRdsServerInternal(int? itemId, string fqdnName)
|
||||
{
|
||||
var result = TaskManager.StartResultTask<ResultObject>("REMOTE_DESKTOP_SERVICES", "RESTART_RDS_SERVER");
|
||||
var result = TaskManager.StartResultTask<ResultObject>("REMOTE_DESKTOP_SERVICES", "RESTART_RDS_SERVER");
|
||||
|
||||
try
|
||||
{
|
||||
Organization org = OrganizationController.GetOrganization(itemId);
|
||||
int serviceId = GetRdsServiceId(itemId);
|
||||
|
||||
if (org == null)
|
||||
if (serviceId != -1)
|
||||
{
|
||||
result.IsSuccess = false;
|
||||
result.AddError("", new NullReferenceException("Organization not found"));
|
||||
return result;
|
||||
var rds = GetRemoteDesktopServices(serviceId);
|
||||
rds.RestartRdsServer(fqdnName);
|
||||
}
|
||||
|
||||
var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
|
||||
rds.RestartRdsServer(fqdnName);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -1761,20 +1829,6 @@ namespace WebsitePanel.EnterpriseServer
|
|||
var address = Dns.GetHostAddresses(hostname);
|
||||
|
||||
return address;
|
||||
}
|
||||
|
||||
private static bool CheckRDSServerAvaliable(string hostname)
|
||||
{
|
||||
bool result = false;
|
||||
var ping = new Ping();
|
||||
var reply = ping.Send(hostname, 1000);
|
||||
|
||||
if (reply.Status == IPStatus.Success)
|
||||
{
|
||||
result = true;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private static ResultObject DeleteRemoteDesktopServiceInternal(int itemId)
|
||||
|
@ -1819,6 +1873,29 @@ namespace WebsitePanel.EnterpriseServer
|
|||
private static int GetRemoteDesktopServiceID(int packageId)
|
||||
{
|
||||
return PackageController.GetPackageServiceId(packageId, ResourceGroups.RDS);
|
||||
}
|
||||
|
||||
private static int GetRdsServiceId(int? itemId)
|
||||
{
|
||||
int serviceId = -1;
|
||||
|
||||
if (itemId.HasValue)
|
||||
{
|
||||
Organization org = OrganizationController.GetOrganization(itemId.Value);
|
||||
|
||||
if (org == null)
|
||||
{
|
||||
return serviceId;
|
||||
}
|
||||
|
||||
serviceId = GetRemoteDesktopServiceID(org.PackageId);
|
||||
}
|
||||
else
|
||||
{
|
||||
serviceId = GetRdsMainServiceId();
|
||||
}
|
||||
|
||||
return serviceId;
|
||||
}
|
||||
|
||||
private static RemoteDesktopServices GetRemoteDesktopServices(int serviceId)
|
||||
|
@ -1829,9 +1906,48 @@ namespace WebsitePanel.EnterpriseServer
|
|||
return rds;
|
||||
}
|
||||
|
||||
private static int GetRdsMainServiceId()
|
||||
{
|
||||
var settings = SystemController.GetSystemSettings(WebsitePanel.EnterpriseServer.SystemSettings.RDS_SETTINGS);
|
||||
|
||||
if (!string.IsNullOrEmpty(settings["RdsMainController"]))
|
||||
{
|
||||
return Convert.ToInt32(settings["RdsMainController"]);
|
||||
}
|
||||
|
||||
var rdsServices = GetRdsServicesInternal();
|
||||
|
||||
if (rdsServices.Any())
|
||||
{
|
||||
return rdsServices.First().ServiceId;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
private static string GetFormattedCollectionName(string displayName, string organizationId)
|
||||
{
|
||||
return string.Format("{0}-{1}", organizationId, displayName.Replace(" ", "_"));
|
||||
}
|
||||
|
||||
private static string EvaluateMailboxTemplate(string template, Organization org, int? accountId, int itemId)
|
||||
{
|
||||
OrganizationUser user = null;
|
||||
|
||||
if (accountId.HasValue)
|
||||
{
|
||||
user = OrganizationController.GetAccount(itemId, accountId.Value);
|
||||
}
|
||||
|
||||
Hashtable items = new Hashtable();
|
||||
items["Organization"] = org;
|
||||
|
||||
if (user != null)
|
||||
{
|
||||
items["account"] = user;
|
||||
}
|
||||
|
||||
return PackageController.EvaluateTemplate(template, items);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -167,7 +167,7 @@ namespace WebsitePanel.EnterpriseServer
|
|||
|
||||
PackageContext cntx = PackageController.GetPackageContext(org.PackageId);
|
||||
|
||||
if (cntx.Groups.ContainsKey(ResourceGroups.HostedSharePoint))
|
||||
if (cntx.Groups.ContainsKey(ResourceGroups.SharepointFoundationServer))
|
||||
{
|
||||
SharePointSiteDiskSpace[] sharePointSiteDiskSpaces =
|
||||
HostedSharePointServerController.CalculateSharePointSitesDiskSpace(org.Id, out res);
|
||||
|
|
|
@ -122,7 +122,7 @@ namespace WebsitePanel.EnterpriseServer.Code.SharePoint
|
|||
// Log operation.
|
||||
TaskManager.StartTask("HOSTEDSHAREPOINT", "GET_LANGUAGES");
|
||||
|
||||
int serviceId = PackageController.GetPackageServiceId(packageId, ResourceGroups.HostedSharePoint);
|
||||
int serviceId = PackageController.GetPackageServiceId(packageId, ResourceGroups.SharepointFoundationServer);
|
||||
if (serviceId == 0)
|
||||
{
|
||||
return new int[] { };
|
||||
|
@ -236,7 +236,7 @@ namespace WebsitePanel.EnterpriseServer.Code.SharePoint
|
|||
}
|
||||
|
||||
// Check if stats resource is available
|
||||
int serviceId = PackageController.GetPackageServiceId(item.PackageId, ResourceGroups.HostedSharePoint);
|
||||
int serviceId = PackageController.GetPackageServiceId(item.PackageId, ResourceGroups.SharepointFoundationServer);
|
||||
if (serviceId == 0)
|
||||
{
|
||||
return BusinessErrorCodes.ERROR_SHAREPOINT_RESOURCE_UNAVAILABLE;
|
||||
|
@ -790,7 +790,7 @@ namespace WebsitePanel.EnterpriseServer.Code.SharePoint
|
|||
|
||||
private static int GetHostedSharePointServiceId(int packageId)
|
||||
{
|
||||
return PackageController.GetPackageServiceId(packageId, ResourceGroups.HostedSharePoint);
|
||||
return PackageController.GetPackageServiceId(packageId, ResourceGroups.SharepointFoundationServer);
|
||||
}
|
||||
|
||||
private static List<SharePointSiteCollection> GetOrganizationSharePointSiteCollections(int orgId)
|
||||
|
|
|
@ -291,25 +291,25 @@ namespace WebsitePanel.EnterpriseServer
|
|||
}
|
||||
|
||||
[WebMethod]
|
||||
public RdsServerInfo GetRdsServerInfo(int itemId, string fqdnName)
|
||||
public RdsServerInfo GetRdsServerInfo(int? itemId, string fqdnName)
|
||||
{
|
||||
return RemoteDesktopServicesController.GetRdsServerInfo(itemId, fqdnName);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public string GetRdsServerStatus(int itemId, string fqdnName)
|
||||
public string GetRdsServerStatus(int? itemId, string fqdnName)
|
||||
{
|
||||
return RemoteDesktopServicesController.GetRdsServerStatus(itemId, fqdnName);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public ResultObject ShutDownRdsServer(int itemId, string fqdnName)
|
||||
public ResultObject ShutDownRdsServer(int? itemId, string fqdnName)
|
||||
{
|
||||
return RemoteDesktopServicesController.ShutDownRdsServer(itemId, fqdnName);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public ResultObject RestartRdsServer(int itemId, string fqdnName)
|
||||
public ResultObject RestartRdsServer(int? itemId, string fqdnName)
|
||||
{
|
||||
return RemoteDesktopServicesController.RestartRdsServer(itemId, fqdnName);
|
||||
}
|
||||
|
@ -339,7 +339,7 @@ namespace WebsitePanel.EnterpriseServer
|
|||
}
|
||||
|
||||
[WebMethod]
|
||||
public RdsCertificate GetRdsCertificateByItemId(int itemId)
|
||||
public RdsCertificate GetRdsCertificateByItemId(int? itemId)
|
||||
{
|
||||
return RemoteDesktopServicesController.GetRdsCertificateByItemId(itemId);
|
||||
}
|
||||
|
@ -349,5 +349,23 @@ namespace WebsitePanel.EnterpriseServer
|
|||
{
|
||||
return RemoteDesktopServicesController.AddRdsCertificate(certificate);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public List<ServiceInfo> GetRdsServices()
|
||||
{
|
||||
return RemoteDesktopServicesController.GetRdsServices();
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public string GetRdsSetupLetter(int itemId, int? accountId)
|
||||
{
|
||||
return RemoteDesktopServicesController.GetRdsSetupLetter(itemId, accountId);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public int SendRdsSetupLetter(int itemId, int? accountId, string to, string cc)
|
||||
{
|
||||
return RemoteDesktopServicesController.SendRdsSetupLetter(itemId, accountId, to, cc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,5 +79,6 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
void MoveRdsServerToTenantOU(string hostName, string organizationId);
|
||||
void RemoveRdsServerFromTenantOU(string hostName, string organizationId);
|
||||
void InstallCertificate(byte[] certificate, string password, List<string> hostNames);
|
||||
void MoveSessionHostToRdsOU(string hostName);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace WebsitePanel.Providers.Virtualization
|
||||
{
|
||||
public enum AutomaticStartAction
|
||||
{
|
||||
Undefined = 100,
|
||||
Nothing = 0,
|
||||
StartIfRunning = 1,
|
||||
Start = 2,
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace WebsitePanel.Providers.Virtualization
|
||||
{
|
||||
public enum AutomaticStopAction
|
||||
{
|
||||
Undefined = 100,
|
||||
TurnOff = 0,
|
||||
Save = 1,
|
||||
ShutDown = 2,
|
||||
}
|
||||
}
|
|
@ -36,5 +36,6 @@ namespace WebsitePanel.Providers.Virtualization
|
|||
{
|
||||
public bool NumLockEnabled { get; set; }
|
||||
public string[] StartupOrder { get; set; }
|
||||
public bool BootFromCD { get; set; }
|
||||
}
|
||||
}
|
|
@ -39,5 +39,6 @@ namespace WebsitePanel.Providers.Virtualization
|
|||
public int ControllerLocation { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Id { get; set; }
|
||||
public string Path { get; set; }
|
||||
}
|
||||
}
|
|
@ -34,7 +34,7 @@ namespace WebsitePanel.Providers.Virtualization
|
|||
{
|
||||
public enum VirtualHardDiskFormat
|
||||
{
|
||||
VHD = 1,
|
||||
VHDX = 2
|
||||
VHD = 0,
|
||||
VHDX = 1
|
||||
}
|
||||
}
|
||||
|
|
|
@ -136,5 +136,11 @@ namespace WebsitePanel.Providers.Virtualization
|
|||
[Persistent]
|
||||
public int Generation { get; set; }
|
||||
|
||||
[Persistent]
|
||||
public int ProcessorCount { get; set; }
|
||||
|
||||
[Persistent]
|
||||
public string ParentSnapshotId { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@ namespace WebsitePanel.Providers.Virtualization
|
|||
public string Id { get; set; }
|
||||
public string CheckPointId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string VMName { get; set; }
|
||||
public string ParentId { get; set; }
|
||||
public DateTime Created { get; set; }
|
||||
public bool IsCurrent { get; set; }
|
||||
|
|
|
@ -49,18 +49,21 @@ namespace WebsitePanel.Providers.Virtualization
|
|||
Deleted = 32775,
|
||||
Pausing = 32776
|
||||
*/
|
||||
Snapshotting = 32771,
|
||||
Migrating = 32772,
|
||||
Deleted = 32775,
|
||||
|
||||
Unknown = 0,
|
||||
Other = 1,
|
||||
Running = 2,
|
||||
Off = 3,
|
||||
Stopping = 4,
|
||||
Saved = 6,
|
||||
Paused = 9,
|
||||
Starting = 10,
|
||||
Reset = 11,
|
||||
Saving = 32773,
|
||||
Pausing = 32776,
|
||||
Stopping = 32774, // new 4
|
||||
Saved = 32769, // new 6
|
||||
Paused = 32768, // new 9
|
||||
Starting = 32770, // new 10
|
||||
Reset = 10, // new 11
|
||||
Saving = 32773, // new 32773
|
||||
Pausing = 32776, // new 32776
|
||||
Resuming = 32777,
|
||||
FastSaved = 32779,
|
||||
FastSaving = 32780,
|
||||
|
|
|
@ -288,6 +288,8 @@
|
|||
<Compile Include="Statistics\StatsServer.cs" />
|
||||
<Compile Include="Statistics\StatsSite.cs" />
|
||||
<Compile Include="Statistics\StatsUser.cs" />
|
||||
<Compile Include="Virtualization\AutomaticStopAction.cs" />
|
||||
<Compile Include="Virtualization\AutomaticStartAction.cs" />
|
||||
<Compile Include="Virtualization\BiosInfo.cs" />
|
||||
<Compile Include="Virtualization\ChangeJobStateReturnCode.cs" />
|
||||
<Compile Include="Virtualization\ConcreteJob.cs">
|
||||
|
|
|
@ -342,7 +342,7 @@ namespace WebsitePanel.Providers.EnterpriseStorage
|
|||
}
|
||||
}
|
||||
|
||||
file.Summary = reader[6] as string;
|
||||
file.Summary = SanitizeXmlString(reader[6] as string);
|
||||
|
||||
result.Add(file);
|
||||
}
|
||||
|
@ -354,6 +354,36 @@ namespace WebsitePanel.Providers.EnterpriseStorage
|
|||
}
|
||||
|
||||
|
||||
public string SanitizeXmlString(string xml)
|
||||
{
|
||||
if (xml == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var buffer = new StringBuilder(xml.Length);
|
||||
|
||||
foreach (char c in xml.Where(c => IsLegalXmlChar(c)))
|
||||
{
|
||||
buffer.Append(c);
|
||||
}
|
||||
|
||||
return buffer.ToString();
|
||||
}
|
||||
|
||||
public bool IsLegalXmlChar(int character)
|
||||
{
|
||||
return
|
||||
(
|
||||
character == 0x9 /* == '\t' == 9 */ ||
|
||||
character == 0xA /* == '\n' == 10 */ ||
|
||||
character == 0xD /* == '\r' == 13 */ ||
|
||||
(character >= 0x20 && character <= 0xD7FF) ||
|
||||
(character >= 0xE000 && character <= 0xFFFD) ||
|
||||
(character >= 0x10000 && character <= 0x10FFFF)
|
||||
);
|
||||
}
|
||||
|
||||
#region HostingServiceProvider methods
|
||||
|
||||
public override string[] Install()
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,46 @@
|
|||
// Copyright (c) 2015, Outercurve Foundation.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
//
|
||||
// - Redistributions of source code must retain the above copyright notice, this
|
||||
// list of conditions and the following disclaimer.
|
||||
//
|
||||
// - Redistributions in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
//
|
||||
// - Neither the name of the Outercurve Foundation nor the names of its
|
||||
// contributors may be used to endorse or promote products derived from this
|
||||
// software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
using System;
|
||||
using WebsitePanel.Providers.HostedSolution;
|
||||
|
||||
|
||||
namespace WebsitePanel.Providers.HostedSolution
|
||||
{
|
||||
public class CRMProvider2015 : CRMBase
|
||||
{
|
||||
|
||||
public override bool IsInstalled()
|
||||
{
|
||||
|
||||
return CRMServerVersion.StartsWith("7.");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,152 @@
|
|||
// Copyright (c) 2015, Outercurve Foundation.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
//
|
||||
// - Redistributions of source code must retain the above copyright notice, this
|
||||
// list of conditions and the following disclaimer.
|
||||
//
|
||||
// - Redistributions in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
//
|
||||
// - Neither the name of the Outercurve Foundation nor the names of its
|
||||
// contributors may be used to endorse or promote products derived from this
|
||||
// software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
using System;
|
||||
using WebsitePanel.Providers.Common;
|
||||
using WebsitePanel.Server.Utils;
|
||||
using System.Text;
|
||||
using System.Management.Automation.Runspaces;
|
||||
|
||||
namespace WebsitePanel.Providers.HostedSolution
|
||||
{
|
||||
public class HostedSolutionLog
|
||||
{
|
||||
public static string LogPrefix = "HostedSolution";
|
||||
|
||||
public static void LogStart(string message, params object[] args)
|
||||
{
|
||||
string text = String.Format(message, args);
|
||||
Log.WriteStart("{0} {1}", LogPrefix, text);
|
||||
}
|
||||
|
||||
public static void LogEnd(string message, params object[] args)
|
||||
{
|
||||
string text = String.Format(message, args);
|
||||
Log.WriteEnd("{0} {1}", LogPrefix, text);
|
||||
}
|
||||
|
||||
public static void LogInfo(string message)
|
||||
{
|
||||
Log.WriteInfo("{0} {1}", LogPrefix, message);
|
||||
}
|
||||
|
||||
public static void LogInfo(string message, params object[] args)
|
||||
{
|
||||
string text = String.Format(message, args);
|
||||
Log.WriteInfo("{0} {1}", LogPrefix, text);
|
||||
}
|
||||
|
||||
public static void LogWarning(string message)
|
||||
{
|
||||
Log.WriteWarning("{0} {1}", LogPrefix, message);
|
||||
}
|
||||
|
||||
public static void LogWarning(string message, params object[] args)
|
||||
{
|
||||
string text = String.Format(message, args);
|
||||
Log.WriteWarning("{0} {1}", LogPrefix, text);
|
||||
}
|
||||
|
||||
public static void LogError(Exception ex)
|
||||
{
|
||||
Log.WriteError(LogPrefix, ex);
|
||||
}
|
||||
|
||||
public static void LogError(string message, Exception ex)
|
||||
{
|
||||
string text = String.Format("{0} {1}", LogPrefix, message);
|
||||
Log.WriteError(text, ex);
|
||||
}
|
||||
|
||||
public static void DebugInfo(string message, params object[] args)
|
||||
{
|
||||
string text = String.Format(message, args);
|
||||
Log.WriteInfo("{0} {1}", LogPrefix, text);
|
||||
}
|
||||
|
||||
public static void EndLog(string message, ResultObject res, string errorCode, Exception ex)
|
||||
{
|
||||
if (res != null)
|
||||
{
|
||||
res.IsSuccess = false;
|
||||
|
||||
if (!string.IsNullOrEmpty(errorCode))
|
||||
res.ErrorCodes.Add(errorCode);
|
||||
}
|
||||
|
||||
if (ex != null)
|
||||
LogError(ex);
|
||||
|
||||
|
||||
//LogRecord.
|
||||
LogEnd(message);
|
||||
|
||||
|
||||
}
|
||||
|
||||
public static void EndLog(string message, ResultObject res, string errorCode)
|
||||
{
|
||||
EndLog(message, res, errorCode, null);
|
||||
}
|
||||
|
||||
public static void EndLog(string message, ResultObject res)
|
||||
{
|
||||
EndLog(message, res, null);
|
||||
}
|
||||
|
||||
public static void EndLog(string message)
|
||||
{
|
||||
EndLog(message, null);
|
||||
}
|
||||
|
||||
internal static T StartLog<T>(string message) where T : ResultObject, new()
|
||||
{
|
||||
LogStart(message);
|
||||
T res = new T();
|
||||
res.IsSuccess = true;
|
||||
return res;
|
||||
}
|
||||
|
||||
public static void DebugCommand(Command cmd)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder(cmd.CommandText);
|
||||
foreach (CommandParameter parameter in cmd.Parameters)
|
||||
{
|
||||
string formatString = " -{0} {1}";
|
||||
if (parameter.Value is string)
|
||||
formatString = " -{0} '{1}'";
|
||||
else if (parameter.Value is bool)
|
||||
formatString = " -{0} ${1}";
|
||||
sb.AppendFormat(formatString, parameter.Name, parameter.Value);
|
||||
}
|
||||
Log.WriteInfo("{0} {1}", LogPrefix, sb.ToString());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,64 @@
|
|||
// Copyright (c) 2015, Outercurve Foundation.
|
||||
// All rights reserved.
|
||||
//
|
||||
// Redistribution and use in source and binary forms, with or without modification,
|
||||
// are permitted provided that the following conditions are met:
|
||||
//
|
||||
// - Redistributions of source code must retain the above copyright notice, this
|
||||
// list of conditions and the following disclaimer.
|
||||
//
|
||||
// - Redistributions in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other materials provided with the distribution.
|
||||
//
|
||||
// - Neither the name of the Outercurve Foundation nor the names of its
|
||||
// contributors may be used to endorse or promote products derived from this
|
||||
// software without specific prior written permission.
|
||||
//
|
||||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("WebsitePanel.Providers.HostedSolution.Crm2013")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("WebsitePanel.Providers.HostedSolution.Crm2013")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2013")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("111E4961-46B0-4323-9EEB-8FE1DD1D48F6")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
|
@ -0,0 +1,105 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{96EC3A56-5598-4B2D-A1F2-2E0DB6BA2AB6}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>WebsitePanel.Providers.HostedSolution.Crm2015</RootNamespace>
|
||||
<AssemblyName>WebsitePanel.Providers.HostedSolution.Crm2015</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\WebsitePanel.Server\bin\Crm2015\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\WebsitePanel.Server\bin\Crm2015\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.Crm.Sdk.Proxy, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\Lib\References\Microsoft\CRM2015\Microsoft.Crm.Sdk.Proxy.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Xrm.Client">
|
||||
<HintPath>..\..\Lib\References\Microsoft\CRM2015\Microsoft.Xrm.Client.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Xrm.Client.CodeGeneration">
|
||||
<HintPath>..\..\Lib\References\Microsoft\CRM2015\Microsoft.Xrm.Client.CodeGeneration.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Xrm.Portal">
|
||||
<HintPath>..\..\Lib\References\Microsoft\CRM2015\Microsoft.Xrm.Portal.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Xrm.Portal.Files">
|
||||
<HintPath>..\..\Lib\References\Microsoft\CRM2015\Microsoft.Xrm.Portal.Files.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Xrm.Sdk, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\Lib\References\Microsoft\CRM2015\Microsoft.Xrm.Sdk.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Xrm.Sdk.Deployment, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\Lib\References\Microsoft\CRM2015\Microsoft.Xrm.Sdk.Deployment.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Xrm.Sdk.Workflow">
|
||||
<HintPath>..\..\Lib\References\Microsoft\CRM2015\Microsoft.Xrm.Sdk.Workflow.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\Lib\System.Management.Automation.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.ServiceModel" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="CRMBase.cs" />
|
||||
<Compile Include="CRMProvider2015.cs" />
|
||||
<Compile Include="HostedSolutionLog.cs" />
|
||||
<Compile Include="MyOrganizationCrmSdkTypes.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\WebsitePanel.Providers.Base\WebsitePanel.Providers.Base.csproj">
|
||||
<Project>{684C932A-6C75-46AC-A327-F3689D89EB42}</Project>
|
||||
<Name>WebsitePanel.Providers.Base</Name>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\WebsitePanel.Server.Utils\WebsitePanel.Server.Utils.csproj">
|
||||
<Project>{E91E52F3-9555-4D00-B577-2B1DBDD87CA7}</Project>
|
||||
<Name>WebsitePanel.Server.Utils</Name>
|
||||
<Private>False</Private>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
|
@ -67,13 +67,18 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
private const string Admins = "Admins";
|
||||
private const string RdsGroupFormat = "rds-{0}-{1}";
|
||||
private const string RdsModuleName = "RemoteDesktopServices";
|
||||
private const string AddNpsString = "netsh nps add np name=\"\"{0}\"\" policysource=\"1\" processingorder=\"{1}\" conditionid=\"0x3d\" conditiondata=\"^5$\" conditionid=\"0x1fb5\" conditiondata=\"{2}\" conditionid=\"0x1e\" conditiondata=\"UserAuthType:(PW|CA)\" profileid=\"0x1005\" profiledata=\"TRUE\" profileid=\"0x100f\" profiledata=\"TRUE\" profileid=\"0x1009\" profiledata=\"0x7\" profileid=\"0x1fe6\" profiledata=\"0x40000000\"";
|
||||
private const string WspAdministratorsGroupDescription = "WSP Org Administrators";
|
||||
private const string RdsServersOU = "RDSServers";
|
||||
private const string RDSHelpDeskComputerGroup = "Websitepanel-RDSHelpDesk-Computer";
|
||||
private const string AddNpsString = "netsh nps add np name=\"\"{0}\"\" policysource=\"1\" processingorder=\"{1}\" conditionid=\"0x3d\" conditiondata=\"^5$\" conditionid=\"0x1fb5\" conditiondata=\"{2}\" conditionid=\"0x1e\" conditiondata=\"UserAuthType:(PW|CA)\" profileid=\"0x1005\" profiledata=\"TRUE\" profileid=\"0x100f\" profiledata=\"TRUE\" profileid=\"0x1009\" profiledata=\"0x7\" profileid=\"0x1fe6\" profiledata=\"0x40000000\"";
|
||||
private const string WspAdministratorsGroupDescription = "WSP RDS Collection Adminstrators";
|
||||
private const string RdsCollectionUsersGroupDescription = "WSP RDS Collection Users";
|
||||
private const string RdsCollectionComputersGroupDescription = "WSP RDS Collection Computers";
|
||||
private const string RdsServersOU = "RDSServersOU";
|
||||
private const string RdsServersRootOU = "RDSRootServersOU";
|
||||
private const string RDSHelpDeskComputerGroup = "Websitepanel-RDSHelpDesk-Computer";
|
||||
private const string RDSHelpDeskGroup = "WSP-HelpDeskAdministrators";
|
||||
private const string RDSHelpDeskGroupDescription = "WSP Help Desk Administrators";
|
||||
private const string LocalAdministratorsGroupName = "Administrators";
|
||||
private const string RDSHelpDeskRdRapPolicyName = "RDS-HelpDesk-RDRAP";
|
||||
private const string RDSHelpDeskRdCapPolicyName = "RDS-HelpDesk-RDCAP";
|
||||
|
||||
#endregion
|
||||
|
||||
|
@ -95,6 +100,14 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
}
|
||||
}
|
||||
|
||||
private string ComputersRootOU
|
||||
{
|
||||
get
|
||||
{
|
||||
return ProviderSettings["ComputersRootOU"];
|
||||
}
|
||||
}
|
||||
|
||||
private string CentralNpsHost
|
||||
{
|
||||
get
|
||||
|
@ -301,30 +314,22 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
|
||||
EditRdsCollectionSettingsInternal(collection, runSpace);
|
||||
var orgPath = GetOrganizationPath(organizationId);
|
||||
|
||||
if (!ActiveDirectoryUtils.AdObjectExists(GetComputerGroupPath(organizationId, collection.Name)))
|
||||
{
|
||||
//Create computer group
|
||||
ActiveDirectoryUtils.CreateGroup(orgPath, GetComputersGroupName(collection.Name));
|
||||
|
||||
//todo Connection broker server must be added by default ???
|
||||
//ActiveDirectoryUtils.AddObjectToGroup(GetComputerPath(ConnectionBroker), GetComputerGroupPath(organizationId, collection.Name));
|
||||
}
|
||||
|
||||
CheckOrCreateAdGroup(GetComputerGroupPath(organizationId, collection.Name), orgPath, GetComputersGroupName(collection.Name), RdsCollectionComputersGroupDescription);
|
||||
CheckOrCreateHelpDeskComputerGroup();
|
||||
string helpDeskGroupSamAccountName = CheckOrCreateAdGroup(GetHelpDeskGroupPath(RDSHelpDeskGroup), GetRootOUPath(), RDSHelpDeskGroup, RDSHelpDeskGroupDescription);
|
||||
|
||||
if (!ActiveDirectoryUtils.AdObjectExists(GetUsersGroupPath(organizationId, collection.Name)))
|
||||
{
|
||||
//Create user group
|
||||
ActiveDirectoryUtils.CreateGroup(orgPath, GetUsersGroupName(collection.Name));
|
||||
}
|
||||
string groupName = GetLocalAdminsGroupName(collection.Name);
|
||||
string groupPath = GetGroupPath(organizationId, collection.Name, groupName);
|
||||
string localAdminsGroupSamAccountName = CheckOrCreateAdGroup(groupPath, GetOrganizationPath(organizationId), groupName, WspAdministratorsGroupDescription);
|
||||
CheckOrCreateAdGroup(GetUsersGroupPath(organizationId, collection.Name), orgPath, GetUsersGroupName(collection.Name), RdsCollectionUsersGroupDescription);
|
||||
|
||||
var capPolicyName = GetPolicyName(organizationId, collection.Name, RdsPolicyTypes.RdCap);
|
||||
var rapPolicyName = GetPolicyName(organizationId, collection.Name, RdsPolicyTypes.RdRap);
|
||||
|
||||
foreach (var gateway in Gateways)
|
||||
{
|
||||
CreateHelpDeskRdCapForce(runSpace, gateway);
|
||||
CreateHelpDeskRdRapForce(runSpace, gateway);
|
||||
|
||||
if (!CentralNps)
|
||||
{
|
||||
CreateRdCapForce(runSpace, gateway, capPolicyName, collection.Name, new List<string> { GetUsersGroupName(collection.Name) });
|
||||
|
@ -339,12 +344,14 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
}
|
||||
|
||||
//add user group to collection
|
||||
AddUserGroupsToCollection(runSpace, collection.Name, new List<string> { GetUsersGroupName(collection.Name) });
|
||||
AddUserGroupsToCollection(runSpace, collection.Name, new List<string> { GetUsersGroupName(collection.Name) });
|
||||
|
||||
//add session servers to group
|
||||
foreach (var rdsServer in collection.Servers)
|
||||
{
|
||||
AddAdGroupToLocalAdmins(runSpace, rdsServer.FqdName, helpDeskGroupSamAccountName);
|
||||
{
|
||||
MoveRdsServerToTenantOU(rdsServer.Name, organizationId);
|
||||
AddAdGroupToLocalAdmins(runSpace, rdsServer.FqdName, helpDeskGroupSamAccountName);
|
||||
AddAdGroupToLocalAdmins(runSpace, rdsServer.FqdName, localAdminsGroupSamAccountName);
|
||||
AddComputerToCollectionAdComputerGroup(organizationId, collection.Name, rdsServer);
|
||||
}
|
||||
}
|
||||
|
@ -570,8 +577,19 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
ExecuteShellCommand(runSpace, cmd, false);
|
||||
|
||||
CheckOrCreateHelpDeskComputerGroup();
|
||||
string helpDeskGroupSamAccountName = CheckOrCreateAdGroup(GetHelpDeskGroupPath(RDSHelpDeskGroup), GetRootOUPath(), RDSHelpDeskGroup, RDSHelpDeskGroupDescription);
|
||||
|
||||
foreach(var gateway in Gateways)
|
||||
{
|
||||
CreateHelpDeskRdCapForce(runSpace, gateway);
|
||||
CreateHelpDeskRdRapForce(runSpace, gateway);
|
||||
}
|
||||
|
||||
string helpDeskGroupSamAccountName = CheckOrCreateAdGroup(GetHelpDeskGroupPath(RDSHelpDeskGroup), GetRootOUPath(), RDSHelpDeskGroup, RDSHelpDeskGroupDescription);
|
||||
string groupName = GetLocalAdminsGroupName(collectionName);
|
||||
string groupPath = GetGroupPath(organizationId, collectionName, groupName);
|
||||
string localAdminsGroupSamAccountName = CheckOrCreateAdGroup(groupPath, GetOrganizationPath(organizationId), groupName, WspAdministratorsGroupDescription);
|
||||
|
||||
AddAdGroupToLocalAdmins(runSpace, server.FqdName, LocalAdministratorsGroupName);
|
||||
AddAdGroupToLocalAdmins(runSpace, server.FqdName, helpDeskGroupSamAccountName);
|
||||
AddComputerToCollectionAdComputerGroup(organizationId, collectionName, server);
|
||||
}
|
||||
|
@ -914,6 +932,59 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
ExecuteRemoteShellCommand(runSpace, gatewayHost, rdCapCommand, RdsModuleName);
|
||||
}
|
||||
|
||||
private void CreateHelpDeskRdCapForce(Runspace runSpace, string gatewayHost)
|
||||
{
|
||||
if (ItemExistsRemote(runSpace, gatewayHost, Path.Combine(CapPath, RDSHelpDeskRdCapPolicyName)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var userGroupParameter = string.Format("@({0})", string.Format("\"{0}@{1}\"", RDSHelpDeskGroup, RootDomain));
|
||||
|
||||
Command rdCapCommand = new Command("New-Item");
|
||||
rdCapCommand.Parameters.Add("Path", string.Format("\"{0}\"", CapPath));
|
||||
rdCapCommand.Parameters.Add("Name", string.Format("\"{0}\"", RDSHelpDeskRdCapPolicyName));
|
||||
rdCapCommand.Parameters.Add("UserGroups", userGroupParameter);
|
||||
rdCapCommand.Parameters.Add("AuthMethod", 1);
|
||||
|
||||
ExecuteRemoteShellCommand(runSpace, gatewayHost, rdCapCommand, RdsModuleName);
|
||||
}
|
||||
|
||||
private void CreateHelpDeskRdRapForce(Runspace runSpace, string gatewayHost)
|
||||
{
|
||||
if (ItemExistsRemote(runSpace, gatewayHost, Path.Combine(RapPath, RDSHelpDeskRdRapPolicyName)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var userGroupParameter = string.Format("@({0})", string.Format("\"{0}@{1}\"", RDSHelpDeskGroup, RootDomain));
|
||||
var computerGroupParameter = string.Format("\"{0}@{1}\"", RDSHelpDeskComputerGroup, RootDomain);
|
||||
|
||||
Command rdRapCommand = new Command("New-Item");
|
||||
rdRapCommand.Parameters.Add("Path", string.Format("\"{0}\"", RapPath));
|
||||
rdRapCommand.Parameters.Add("Name", string.Format("\"{0}\"", RDSHelpDeskRdRapPolicyName));
|
||||
rdRapCommand.Parameters.Add("UserGroups", userGroupParameter);
|
||||
rdRapCommand.Parameters.Add("ComputerGroupType", 1);
|
||||
rdRapCommand.Parameters.Add("ComputerGroup", computerGroupParameter);
|
||||
|
||||
object[] errors;
|
||||
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
ExecuteRemoteShellCommand(runSpace, gatewayHost, rdRapCommand, out errors, RdsModuleName);
|
||||
|
||||
if (errors == null || !errors.Any())
|
||||
{
|
||||
Log.WriteWarning("RD RAP Added Successfully");
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.WriteWarning(string.Join("\r\n", errors.Select(e => e.ToString()).ToArray()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal void RemoveRdCap(Runspace runSpace, string gatewayHost, string name)
|
||||
{
|
||||
RemoveItemRemote(runSpace, gatewayHost, string.Format(@"{0}\{1}", CapPath, name), RdsModuleName);
|
||||
|
@ -956,7 +1027,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
Log.WriteWarning(string.Join("\r\n", errors.Select(e => e.ToString()).ToArray()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal void RemoveRdRap(Runspace runSpace, string gatewayHost, string name)
|
||||
{
|
||||
|
@ -1096,8 +1167,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
try
|
||||
{
|
||||
var guid = Guid.NewGuid();
|
||||
var x509Cert = new X509Certificate2(certificate, password, X509KeyStorageFlags.Exportable);
|
||||
//var content = x509Cert.Export(X509ContentType.Pfx);
|
||||
var x509Cert = new X509Certificate2(certificate, password, X509KeyStorageFlags.Exportable);
|
||||
var filePath = SaveCertificate(certificate, guid);
|
||||
runspace = OpenRunspace();
|
||||
|
||||
|
@ -1108,6 +1178,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
|
||||
if (!errors.Any())
|
||||
{
|
||||
RemoveCertificate(runspace, hostName, x509Cert.Thumbprint);
|
||||
errors = ImportCertificate(runspace, hostName, password, string.Format("c:\\{0}.pfx", guid), x509Cert.Thumbprint);
|
||||
}
|
||||
|
||||
|
@ -1129,12 +1200,23 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
{
|
||||
CloseRunspace(runspace);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void RemoveCertificate(Runspace runspace, string hostName, string thumbprint)
|
||||
{
|
||||
var scripts = new List<string>
|
||||
{
|
||||
string.Format("Remove-Item -Path cert:\\LocalMachine\\My\\{0}", thumbprint)
|
||||
};
|
||||
|
||||
object[] errors = null;
|
||||
ExecuteRemoteShellCommand(runspace, hostName, scripts, out errors);
|
||||
}
|
||||
|
||||
private object[] ImportCertificate(Runspace runspace, string hostName, string password, string certificatePath, string thumbprint)
|
||||
{
|
||||
var scripts = new List<string>
|
||||
{
|
||||
{
|
||||
string.Format("$mypwd = ConvertTo-SecureString -String {0} -Force –AsPlainText", password),
|
||||
string.Format("Import-PfxCertificate –FilePath \"{0}\" cert:\\localMachine\\my -Password $mypwd", certificatePath),
|
||||
string.Format("$cert = Get-Item cert:\\LocalMachine\\My\\{0}", thumbprint),
|
||||
|
@ -1276,28 +1358,22 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
}
|
||||
|
||||
private void AddComputerToCollectionAdComputerGroup(string organizationId, string collectionName, RdsServer server)
|
||||
{
|
||||
var computerPath = GetComputerPath(server.Name, false);
|
||||
var computerGroupName = GetComputersGroupName( collectionName);
|
||||
{
|
||||
var computerGroupName = GetComputersGroupName( collectionName);
|
||||
var computerObject = GetComputerObject(server.Name);
|
||||
|
||||
if (!ActiveDirectoryUtils.AdObjectExists(computerPath))
|
||||
{
|
||||
computerPath = GetComputerPath(server.Name, true);
|
||||
}
|
||||
|
||||
if (ActiveDirectoryUtils.AdObjectExists(computerPath))
|
||||
{
|
||||
var computerObject = ActiveDirectoryUtils.GetADObject(computerPath);
|
||||
if (computerObject != null)
|
||||
{
|
||||
var samName = (string)ActiveDirectoryUtils.GetADObjectProperty(computerObject, "sAMAccountName");
|
||||
|
||||
if (!ActiveDirectoryUtils.IsComputerInGroup(samName, computerGroupName))
|
||||
{
|
||||
ActiveDirectoryUtils.AddObjectToGroup(computerPath, GetComputerGroupPath(organizationId, collectionName));
|
||||
ActiveDirectoryUtils.AddObjectToGroup(computerObject.Path, GetComputerGroupPath(organizationId, collectionName));
|
||||
}
|
||||
|
||||
if (!ActiveDirectoryUtils.IsComputerInGroup(samName, RDSHelpDeskComputerGroup))
|
||||
{
|
||||
ActiveDirectoryUtils.AddObjectToGroup(computerPath, GetHelpDeskGroupPath(RDSHelpDeskComputerGroup));
|
||||
ActiveDirectoryUtils.AddObjectToGroup(computerObject.Path, GetHelpDeskGroupPath(RDSHelpDeskComputerGroup));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1305,30 +1381,24 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
}
|
||||
|
||||
private void RemoveComputerFromCollectionAdComputerGroup(string organizationId, string collectionName, RdsServer server)
|
||||
{
|
||||
var computerPath = GetComputerPath(server.Name, false);
|
||||
{
|
||||
var computerGroupName = GetComputersGroupName(collectionName);
|
||||
var computerObject = GetComputerObject(server.Name);
|
||||
|
||||
if (!ActiveDirectoryUtils.AdObjectExists(computerPath))
|
||||
{
|
||||
computerPath = GetComputerPath(server.Name, true);
|
||||
}
|
||||
|
||||
if (ActiveDirectoryUtils.AdObjectExists(computerPath))
|
||||
{
|
||||
var computerObject = ActiveDirectoryUtils.GetADObject(computerPath);
|
||||
if (computerObject != null)
|
||||
{
|
||||
var samName = (string)ActiveDirectoryUtils.GetADObjectProperty(computerObject, "sAMAccountName");
|
||||
|
||||
if (ActiveDirectoryUtils.IsComputerInGroup(samName, computerGroupName))
|
||||
{
|
||||
ActiveDirectoryUtils.RemoveObjectFromGroup(computerPath, GetComputerGroupPath(organizationId, collectionName));
|
||||
ActiveDirectoryUtils.RemoveObjectFromGroup(computerObject.Path, GetComputerGroupPath(organizationId, collectionName));
|
||||
}
|
||||
|
||||
if (ActiveDirectoryUtils.AdObjectExists(GetHelpDeskGroupPath(RDSHelpDeskComputerGroup)))
|
||||
{
|
||||
if (ActiveDirectoryUtils.IsComputerInGroup(samName, RDSHelpDeskComputerGroup))
|
||||
{
|
||||
ActiveDirectoryUtils.RemoveObjectFromGroup(computerPath, GetHelpDeskGroupPath(RDSHelpDeskComputerGroup));
|
||||
ActiveDirectoryUtils.RemoveObjectFromGroup(computerObject.Path, GetHelpDeskGroupPath(RDSHelpDeskComputerGroup));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1363,59 +1433,93 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
return installationResult;
|
||||
}
|
||||
|
||||
private void CheckOrCreateComputersRoot(string computersRootPath)
|
||||
{
|
||||
if (ActiveDirectoryUtils.AdObjectExists(computersRootPath) && !ActiveDirectoryUtils.AdObjectExists(GetRdsServersGroupPath()))
|
||||
{
|
||||
//ActiveDirectoryUtils.CreateGroup(computersRootPath, RdsServersRootOU);
|
||||
ActiveDirectoryUtils.CreateOrganizationalUnit(RdsServersRootOU, computersRootPath);
|
||||
}
|
||||
}
|
||||
|
||||
public void MoveSessionHostToRdsOU(string hostName)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(ComputersRootOU))
|
||||
{
|
||||
CheckOrCreateComputersRoot(GetComputersRootPath());
|
||||
}
|
||||
|
||||
var computerObject = GetComputerObject(hostName);
|
||||
|
||||
if (computerObject != null)
|
||||
{
|
||||
var samName = (string)ActiveDirectoryUtils.GetADObjectProperty(computerObject, "sAMAccountName");
|
||||
|
||||
if (!ActiveDirectoryUtils.IsComputerInGroup(samName, RdsServersRootOU))
|
||||
{
|
||||
DirectoryEntry group = new DirectoryEntry(GetRdsServersGroupPath());
|
||||
computerObject.MoveTo(group);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void MoveRdsServerToTenantOU(string hostName, string organizationId)
|
||||
{
|
||||
var tenantComputerGroupPath = GetTenantComputerGroupPath(organizationId);
|
||||
|
||||
if (!ActiveDirectoryUtils.AdObjectExists(tenantComputerGroupPath))
|
||||
{
|
||||
ActiveDirectoryUtils.CreateGroup(GetOrganizationPath(organizationId), RdsServersOU);
|
||||
ActiveDirectoryUtils.CreateOrganizationalUnit(RdsServersOU, GetOrganizationPath(organizationId));
|
||||
}
|
||||
|
||||
hostName = hostName.ToLower().Replace(string.Format(".{0}", ServerSettings.ADRootDomain.ToLower()), "");
|
||||
var computerPath = GetComputerPath(hostName, true);
|
||||
hostName = hostName.ToLower().Replace(string.Format(".{0}", ServerSettings.ADRootDomain.ToLower()), "");
|
||||
var rootComputerPath = GetRdsServerPath(hostName);
|
||||
var tenantComputerPath = GetTenantComputerPath(hostName, organizationId);
|
||||
|
||||
if(!ActiveDirectoryUtils.AdObjectExists(computerPath))
|
||||
{
|
||||
computerPath = GetComputerPath(hostName, false);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(ComputersRootOU))
|
||||
{
|
||||
CheckOrCreateComputersRoot(GetComputersRootPath());
|
||||
}
|
||||
|
||||
var computerObject = GetComputerObject(hostName);
|
||||
|
||||
if (ActiveDirectoryUtils.AdObjectExists(computerPath))
|
||||
if (computerObject != null)
|
||||
{
|
||||
var computerObject = ActiveDirectoryUtils.GetADObject(computerPath);
|
||||
var samName = (string)ActiveDirectoryUtils.GetADObjectProperty(computerObject, "sAMAccountName");
|
||||
|
||||
if (!ActiveDirectoryUtils.IsComputerInGroup(samName, RdsServersOU))
|
||||
{
|
||||
{
|
||||
DirectoryEntry group = new DirectoryEntry(tenantComputerGroupPath);
|
||||
group.Invoke("Add", computerObject.Path);
|
||||
|
||||
group.CommitChanges();
|
||||
computerObject.MoveTo(group);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveRdsServerFromTenantOU(string hostName, string organizationId)
|
||||
{
|
||||
var tenantComputerGroupPath = GetTenantComputerGroupPath(organizationId);
|
||||
hostName = hostName.ToLower().Replace(string.Format(".{0}", ServerSettings.ADRootDomain.ToLower()), "");
|
||||
var tenantComputerPath = GetTenantComputerPath(hostName, organizationId);
|
||||
hostName = hostName.ToLower().Replace(string.Format(".{0}", ServerSettings.ADRootDomain.ToLower()), "");
|
||||
|
||||
var computerPath = GetComputerPath(hostName, true);
|
||||
|
||||
if (!ActiveDirectoryUtils.AdObjectExists(computerPath))
|
||||
if (!string.IsNullOrEmpty(ComputersRootOU))
|
||||
{
|
||||
computerPath = GetComputerPath(hostName, false);
|
||||
CheckOrCreateComputersRoot(GetComputersRootPath());
|
||||
}
|
||||
|
||||
if (!ActiveDirectoryUtils.AdObjectExists(tenantComputerGroupPath))
|
||||
{
|
||||
ActiveDirectoryUtils.CreateOrganizationalUnit(RdsServersOU, GetOrganizationPath(organizationId));
|
||||
}
|
||||
|
||||
if (ActiveDirectoryUtils.AdObjectExists(computerPath))
|
||||
|
||||
var computerObject = GetComputerObject(hostName);
|
||||
|
||||
if (computerObject != null)
|
||||
{
|
||||
var computerObject = ActiveDirectoryUtils.GetADObject(computerPath);
|
||||
var samName = (string)ActiveDirectoryUtils.GetADObjectProperty(computerObject, "sAMAccountName");
|
||||
|
||||
if (ActiveDirectoryUtils.IsComputerInGroup(samName, RdsServersOU))
|
||||
|
||||
if (ActiveDirectoryUtils.AdObjectExists(GetComputersRootPath()) && !string.IsNullOrEmpty(ComputersRootOU) && !ActiveDirectoryUtils.IsComputerInGroup(samName, RdsServersRootOU))
|
||||
{
|
||||
ActiveDirectoryUtils.RemoveObjectFromGroup(computerPath, tenantComputerGroupPath);
|
||||
DirectoryEntry group = new DirectoryEntry(GetRdsServersGroupPath());
|
||||
computerObject.MoveTo(group);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1543,6 +1647,10 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
{
|
||||
remoteApp.Users = users;
|
||||
}
|
||||
else
|
||||
{
|
||||
remoteApp.Users = null;
|
||||
}
|
||||
|
||||
return remoteApp;
|
||||
}
|
||||
|
@ -1698,26 +1806,17 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
return sb.ToString();
|
||||
}
|
||||
|
||||
private string GetComputerPath(string objName, bool domainController)
|
||||
private DirectoryEntry GetComputerObject(string computerName)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
// append provider
|
||||
AppendProtocol(sb);
|
||||
AppendDomainController(sb);
|
||||
AppendCNPath(sb, objName);
|
||||
if (domainController)
|
||||
DirectorySearcher deSearch = new DirectorySearcher
|
||||
{
|
||||
AppendOUPath(sb, AdDcComputers);
|
||||
}
|
||||
else
|
||||
{
|
||||
AppendCNPath(sb, Computers);
|
||||
|
||||
}
|
||||
AppendDomainPath(sb, RootDomain);
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
Filter = string.Format("(&(objectCategory=computer)(name={0}))", computerName)
|
||||
};
|
||||
|
||||
SearchResult results = deSearch.FindOne();
|
||||
|
||||
return results.GetDirectoryEntry();
|
||||
}
|
||||
|
||||
private string GetTenantComputerPath(string objName, string organizationId)
|
||||
{
|
||||
|
@ -1726,7 +1825,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
AppendProtocol(sb);
|
||||
AppendDomainController(sb);
|
||||
AppendCNPath(sb, objName);
|
||||
AppendCNPath(sb, RdsServersOU);
|
||||
AppendOUPath(sb, RdsServersOU);
|
||||
AppendOUPath(sb, organizationId);
|
||||
AppendOUPath(sb, RootOU);
|
||||
AppendDomainPath(sb, RootDomain);
|
||||
|
@ -1734,13 +1833,63 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
return sb.ToString();
|
||||
}
|
||||
|
||||
private string GetComputersRootPath()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
AppendProtocol(sb);
|
||||
AppendDomainController(sb);
|
||||
AppendOUPath(sb, ComputersRootOU);
|
||||
AppendDomainPath(sb, RootDomain);
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
private string GetRdsServersGroupPath()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
AppendProtocol(sb);
|
||||
AppendDomainController(sb);
|
||||
AppendOUPath(sb, RdsServersRootOU);
|
||||
AppendOUPath(sb, ComputersRootOU);
|
||||
AppendDomainPath(sb, RootDomain);
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
private string GetRdsServerPath(string name)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
AppendProtocol(sb);
|
||||
AppendDomainController(sb);
|
||||
AppendCNPath(sb, name);
|
||||
AppendOUPath(sb, RdsServersRootOU);
|
||||
AppendOUPath(sb, ComputersRootOU);
|
||||
AppendDomainPath(sb, RootDomain);
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
private string GetRootPath()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
AppendProtocol(sb);
|
||||
AppendDomainController(sb);
|
||||
AppendDomainPath(sb, RootDomain);
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
internal string GetTenantComputerGroupPath(string organizationId)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
AppendProtocol(sb);
|
||||
AppendDomainController(sb);
|
||||
AppendCNPath(sb, RdsServersOU);
|
||||
AppendOUPath(sb, RdsServersOU);
|
||||
AppendOUPath(sb, organizationId);
|
||||
AppendOUPath(sb, RootOU);
|
||||
AppendDomainPath(sb, RootDomain);
|
||||
|
@ -1977,7 +2126,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
{
|
||||
pipeLine.Commands.AddScript(script);
|
||||
}
|
||||
|
||||
|
||||
results = pipeLine.Invoke();
|
||||
|
||||
if (pipeLine.Error != null && pipeLine.Error.Count > 0)
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WebsitePanel.Providers.Virtualization
|
||||
{
|
||||
public static class Constants
|
||||
{
|
||||
public const Int64 Size1G = 0x40000000;
|
||||
public const Int64 Size1M = 0x100000;
|
||||
}
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Management;
|
||||
using System.Management.Automation;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
@ -9,6 +10,8 @@ namespace WebsitePanel.Providers.Virtualization
|
|||
{
|
||||
static class PSObjectExtension
|
||||
{
|
||||
#region Properties
|
||||
|
||||
public static object GetProperty(this PSObject obj, string name)
|
||||
{
|
||||
return obj.Members[name].Value;
|
||||
|
@ -33,5 +36,27 @@ namespace WebsitePanel.Providers.Virtualization
|
|||
{
|
||||
return obj.Members[name].Value == null ? "" : obj.Members[name].Value.ToString();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Methods
|
||||
|
||||
public static ManagementObject Invoke(this PSObject obj, string name, object argument)
|
||||
{
|
||||
return obj.Invoke(name, new[] {argument});
|
||||
}
|
||||
public static ManagementObject Invoke(this PSObject obj, string name, params object[] arguments)
|
||||
{
|
||||
var results = (ManagementObjectCollection)obj.Methods[name].Invoke(arguments);
|
||||
|
||||
foreach (var result in results)
|
||||
{
|
||||
return (ManagementObject) result;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,109 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Management.Automation;
|
||||
using System.Management.Automation.Runspaces;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WebsitePanel.Providers.Virtualization
|
||||
{
|
||||
public static class BiosHelper
|
||||
{
|
||||
public static BiosInfo Get(PowerShellManager powerShell, string name, int generation)
|
||||
{
|
||||
BiosInfo info = new BiosInfo();
|
||||
|
||||
// for Win2012R2+ and Win8.1+
|
||||
if (generation == 2)
|
||||
{
|
||||
Command cmd = new Command("Get-VMFirmware");
|
||||
|
||||
cmd.Parameters.Add("VMName", name);
|
||||
|
||||
Collection<PSObject> result = powerShell.Execute(cmd, false);
|
||||
if (result != null && result.Count > 0)
|
||||
{
|
||||
info.NumLockEnabled = true;
|
||||
|
||||
List<string> startupOrders = new List<string>();
|
||||
info.BootFromCD = false;
|
||||
|
||||
foreach (dynamic item in (IEnumerable)result[0].GetProperty("BootOrder"))
|
||||
{
|
||||
string bootType = item.BootType.ToString();
|
||||
|
||||
// bootFromCD
|
||||
if (!startupOrders.Any() && bootType == "Drive")
|
||||
{
|
||||
var device = item.Device;
|
||||
info.BootFromCD = device.GetType().Name == "DvdDrive";
|
||||
}
|
||||
|
||||
// startupOrders
|
||||
startupOrders.Add(bootType);
|
||||
}
|
||||
|
||||
info.StartupOrder = startupOrders.ToArray();
|
||||
}
|
||||
}
|
||||
// for others win and linux
|
||||
else
|
||||
{
|
||||
Command cmd = new Command("Get-VMBios");
|
||||
|
||||
cmd.Parameters.Add("VMName", name);
|
||||
|
||||
Collection<PSObject> result = powerShell.Execute(cmd, false);
|
||||
if (result != null && result.Count > 0)
|
||||
{
|
||||
info.NumLockEnabled = Convert.ToBoolean(result[0].GetProperty("NumLockEnabled"));
|
||||
|
||||
List<string> startupOrders = new List<string>();
|
||||
|
||||
foreach (var item in (IEnumerable)result[0].GetProperty("StartupOrder"))
|
||||
startupOrders.Add(item.ToString());
|
||||
|
||||
info.StartupOrder = startupOrders.ToArray();
|
||||
info.BootFromCD = false;
|
||||
if (info.StartupOrder != null && info.StartupOrder.Length > 0)
|
||||
info.BootFromCD = info.StartupOrder[0] == "CD";
|
||||
}
|
||||
}
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
public static void Update(PowerShellManager powerShell, VirtualMachine vm, bool bootFromCD, bool numLockEnabled)
|
||||
{
|
||||
// for Win2012R2+ and Win8.1+
|
||||
if (vm.Generation == 2)
|
||||
{
|
||||
Command cmd = new Command("Set-VMFirmware");
|
||||
|
||||
cmd.Parameters.Add("VMName", vm.Name);
|
||||
if (bootFromCD)
|
||||
cmd.Parameters.Add("FirstBootDevice", DvdDriveHelper.GetPS(powerShell, vm.Name));
|
||||
else
|
||||
cmd.Parameters.Add("FirstBootDevice", HardDriveHelper.GetPS(powerShell, vm.Name).FirstOrDefault());
|
||||
|
||||
powerShell.Execute(cmd, false);
|
||||
}
|
||||
// for others win and linux
|
||||
else
|
||||
{
|
||||
Command cmd = new Command("Set-VMBios");
|
||||
|
||||
cmd.Parameters.Add("VMName", vm.Name);
|
||||
var bootOrder = bootFromCD
|
||||
? new[] { "CD", "IDE", "LegacyNetworkAdapter", "Floppy" }
|
||||
: new[] { "IDE", "CD", "LegacyNetworkAdapter", "Floppy" };
|
||||
cmd.Parameters.Add("StartupOrder", bootOrder);
|
||||
|
||||
powerShell.Execute(cmd, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -13,8 +13,25 @@ namespace WebsitePanel.Providers.Virtualization
|
|||
{
|
||||
public static DvdDriveInfo Get(PowerShellManager powerShell, string vmName)
|
||||
{
|
||||
DvdDriveInfo info = new DvdDriveInfo();
|
||||
DvdDriveInfo info = null;
|
||||
|
||||
PSObject result = GetPS(powerShell, vmName);
|
||||
|
||||
if (result != null)
|
||||
{
|
||||
info = new DvdDriveInfo();
|
||||
info.Id = result.GetString("Id");
|
||||
info.Name = result.GetString("Name");
|
||||
info.ControllerType = result.GetEnum<ControllerType>("ControllerType");
|
||||
info.ControllerNumber = result.GetInt("ControllerNumber");
|
||||
info.ControllerLocation = result.GetInt("ControllerLocation");
|
||||
info.Path = result.GetString("Path");
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
public static PSObject GetPS(PowerShellManager powerShell, string vmName)
|
||||
{
|
||||
Command cmd = new Command("Get-VMDvdDrive");
|
||||
|
||||
cmd.Parameters.Add("VMName", vmName);
|
||||
|
@ -23,13 +40,10 @@ namespace WebsitePanel.Providers.Virtualization
|
|||
|
||||
if (result != null && result.Count > 0)
|
||||
{
|
||||
info.Id = result[0].GetString("Id");
|
||||
info.Name = result[0].GetString("Name");
|
||||
info.ControllerType = result[0].GetEnum<ControllerType>("ControllerType");
|
||||
info.ControllerNumber = result[0].GetInt("ControllerNumber");
|
||||
info.ControllerLocation = result[0].GetInt("ControllerLocation");
|
||||
return result[0];
|
||||
}
|
||||
return info;
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void Set(PowerShellManager powerShell, string vmName, string path)
|
||||
|
@ -56,13 +70,9 @@ namespace WebsitePanel.Providers.Virtualization
|
|||
|
||||
public static void Add(PowerShellManager powerShell, string vmName)
|
||||
{
|
||||
var dvd = Get(powerShell, vmName);
|
||||
|
||||
Command cmd = new Command("Add-VMDvdDrive");
|
||||
|
||||
cmd.Parameters.Add("VMName", vmName);
|
||||
cmd.Parameters.Add("ControllerNumber", dvd.ControllerNumber);
|
||||
cmd.Parameters.Add("ControllerLocation", dvd.ControllerLocation);
|
||||
|
||||
powerShell.Execute(cmd, false);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,89 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Management.Automation;
|
||||
using System.Management.Automation.Runspaces;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WebsitePanel.Providers.Virtualization
|
||||
{
|
||||
public static class HardDriveHelper
|
||||
{
|
||||
public static VirtualHardDiskInfo[] Get(PowerShellManager powerShell, string vmname)
|
||||
{
|
||||
List<VirtualHardDiskInfo> disks = new List<VirtualHardDiskInfo>();
|
||||
|
||||
Collection<PSObject> result = GetPS(powerShell, vmname);
|
||||
|
||||
if (result != null && result.Count > 0)
|
||||
{
|
||||
foreach (PSObject d in result)
|
||||
{
|
||||
VirtualHardDiskInfo disk = new VirtualHardDiskInfo();
|
||||
|
||||
disk.SupportPersistentReservations = Convert.ToBoolean(d.GetProperty("SupportPersistentReservations"));
|
||||
disk.MaximumIOPS = Convert.ToUInt64(d.GetProperty("MaximumIOPS"));
|
||||
disk.MinimumIOPS = Convert.ToUInt64(d.GetProperty("MinimumIOPS"));
|
||||
disk.VHDControllerType = d.GetEnum<ControllerType>("ControllerType");
|
||||
disk.ControllerNumber = Convert.ToInt32(d.GetProperty("ControllerNumber"));
|
||||
disk.ControllerLocation = Convert.ToInt32(d.GetProperty("ControllerLocation"));
|
||||
disk.Path = d.GetProperty("Path").ToString();
|
||||
disk.Name = d.GetProperty("Name").ToString();
|
||||
|
||||
GetVirtualHardDiskDetail(powerShell, disk.Path, ref disk);
|
||||
|
||||
disks.Add(disk);
|
||||
}
|
||||
}
|
||||
return disks.ToArray();
|
||||
}
|
||||
|
||||
//public static VirtualHardDiskInfo GetByPath(PowerShellManager powerShell, string vhdPath)
|
||||
//{
|
||||
// VirtualHardDiskInfo info = null;
|
||||
// var vmNames = new List<string>();
|
||||
|
||||
// Command cmd = new Command("Get-VM");
|
||||
|
||||
// Collection<PSObject> result = powerShell.Execute(cmd, false);
|
||||
|
||||
// if (result == null || result.Count == 0)
|
||||
// return null;
|
||||
|
||||
// vmNames = result.Select(r => r.GetString("Name")).ToList();
|
||||
// var drives = vmNames.SelectMany(n => Get(powerShell, n));
|
||||
|
||||
// return drives.FirstOrDefault(d=>d.Path == vhdPath);
|
||||
//}
|
||||
|
||||
public static Collection<PSObject> GetPS(PowerShellManager powerShell, string vmname)
|
||||
{
|
||||
Command cmd = new Command("Get-VMHardDiskDrive");
|
||||
cmd.Parameters.Add("VMName", vmname);
|
||||
|
||||
return powerShell.Execute(cmd, false);
|
||||
}
|
||||
|
||||
public static void GetVirtualHardDiskDetail(PowerShellManager powerShell, string path, ref VirtualHardDiskInfo disk)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(path))
|
||||
{
|
||||
Command cmd = new Command("Get-VHD");
|
||||
cmd.Parameters.Add("Path", path);
|
||||
Collection<PSObject> result = powerShell.Execute(cmd, false);
|
||||
if (result != null && result.Count > 0)
|
||||
{
|
||||
disk.DiskFormat = result[0].GetEnum<VirtualHardDiskFormat>("VhdFormat");
|
||||
disk.DiskType = result[0].GetEnum<VirtualHardDiskType>("VhdType");
|
||||
disk.ParentPath = result[0].GetProperty<string>("ParentPath");
|
||||
disk.MaxInternalSize = Convert.ToInt64(result[0].GetProperty("Size"));
|
||||
disk.FileSize = Convert.ToInt64(result[0].GetProperty("FileSize"));
|
||||
disk.Attached = disk.InUse = Convert.ToBoolean(result[0].GetProperty("Attached"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Management.Automation;
|
||||
using System.Management.Automation.Runspaces;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WebsitePanel.Providers.Virtualization
|
||||
{
|
||||
public static class JobHelper
|
||||
{
|
||||
public static JobResult CreateSuccessResult(ReturnCode returnCode = ReturnCode.OK)
|
||||
{
|
||||
return new JobResult
|
||||
{
|
||||
Job = new ConcreteJob {JobState = ConcreteJobState.Completed},
|
||||
ReturnValue = returnCode
|
||||
};
|
||||
}
|
||||
|
||||
public static JobResult CreateResultFromPSResults(Collection<PSObject> objJob)
|
||||
{
|
||||
if (objJob == null || objJob.Count == 0)
|
||||
return null;
|
||||
|
||||
JobResult result = new JobResult();
|
||||
|
||||
result.Job = CreateFromPSObject(objJob);
|
||||
result.ReturnValue = ReturnCode.JobStarted;
|
||||
|
||||
switch (result.Job.JobState)
|
||||
{
|
||||
case ConcreteJobState.Failed:
|
||||
result.ReturnValue = ReturnCode.Failed;
|
||||
break;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static ConcreteJob CreateFromPSObject(Collection<PSObject> objJob)
|
||||
{
|
||||
if (objJob == null || objJob.Count == 0)
|
||||
return null;
|
||||
|
||||
ConcreteJob job = new ConcreteJob();
|
||||
job.Id = objJob[0].GetProperty<int>("Id").ToString();
|
||||
job.JobState = objJob[0].GetEnum<ConcreteJobState>("JobStateInfo");
|
||||
job.Caption = objJob[0].GetProperty<string>("Name");
|
||||
job.Description = objJob[0].GetProperty<string>("Command");
|
||||
job.StartTime = objJob[0].GetProperty<DateTime>("PSBeginTime");
|
||||
job.ElapsedTime = objJob[0].GetProperty<DateTime?>("PSEndTime") ?? DateTime.Now;
|
||||
|
||||
// PercentComplete
|
||||
job.PercentComplete = 0;
|
||||
var progress = (PSDataCollection<ProgressRecord>)objJob[0].GetProperty("Progress");
|
||||
if (progress != null && progress.Count > 0)
|
||||
job.PercentComplete = progress[0].PercentComplete;
|
||||
|
||||
// Errors
|
||||
var errors = (PSDataCollection<ErrorRecord>)objJob[0].GetProperty("Error");
|
||||
if (errors != null && errors.Count > 0)
|
||||
{
|
||||
job.ErrorDescription = errors[0].ErrorDetails.Message + ". " + errors[0].ErrorDetails.RecommendedAction;
|
||||
job.ErrorCode = errors[0].Exception != null ? -1 : 0;
|
||||
}
|
||||
|
||||
return job;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -49,18 +49,17 @@ namespace WebsitePanel.Providers.Virtualization
|
|||
return adapters.FirstOrDefault(a => a.MacAddress == macAddress);
|
||||
}
|
||||
|
||||
public static void Update(PowerShellManager powerShell, VirtualMachine vm, string switchId, string portName, string macAddress, string adapterName, bool legacyAdapter)
|
||||
public static void Update(PowerShellManager powerShell, VirtualMachine vm)
|
||||
{
|
||||
// External NIC
|
||||
if (!vm.ExternalNetworkEnabled && !String.IsNullOrEmpty(vm.ExternalNicMacAddress))
|
||||
{
|
||||
// delete adapter
|
||||
Delete(powerShell, vm.Name, vm.ExternalNicMacAddress);
|
||||
vm.ExternalNicMacAddress = null; // reset MAC
|
||||
}
|
||||
else if (vm.ExternalNetworkEnabled && !String.IsNullOrEmpty(vm.ExternalNicMacAddress))
|
||||
else if (vm.ExternalNetworkEnabled && !String.IsNullOrEmpty(vm.ExternalNicMacAddress)
|
||||
&& Get(powerShell,vm.Name,vm.ExternalNicMacAddress) == null)
|
||||
{
|
||||
// add external adapter
|
||||
Add(powerShell, vm.Name, vm.ExternalSwitchId, vm.ExternalNicMacAddress, EXTERNAL_NETWORK_ADAPTER_NAME, vm.LegacyNetworkAdapter);
|
||||
}
|
||||
|
||||
|
@ -70,35 +69,41 @@ namespace WebsitePanel.Providers.Virtualization
|
|||
Delete(powerShell, vm.Name, vm.PrivateNicMacAddress);
|
||||
vm.PrivateNicMacAddress = null; // reset MAC
|
||||
}
|
||||
else if (vm.PrivateNetworkEnabled && !String.IsNullOrEmpty(vm.PrivateNicMacAddress))
|
||||
else if (vm.PrivateNetworkEnabled && !String.IsNullOrEmpty(vm.PrivateNicMacAddress)
|
||||
&& Get(powerShell, vm.Name, vm.PrivateNicMacAddress) == null)
|
||||
{
|
||||
Add(powerShell, vm.Name, vm.ExternalSwitchId, vm.ExternalNicMacAddress, PRIVATE_NETWORK_ADAPTER_NAME, vm.LegacyNetworkAdapter);
|
||||
Add(powerShell, vm.Name, vm.PrivateSwitchId, vm.PrivateNicMacAddress, PRIVATE_NETWORK_ADAPTER_NAME, vm.LegacyNetworkAdapter);
|
||||
}
|
||||
}
|
||||
|
||||
public static void Add(PowerShellManager powerShell, string vmName, string switchId, string macAddress, string adapterName, bool legacyAdapter)
|
||||
{
|
||||
//var dvd = Get(powerShell, vmName);
|
||||
Command cmd = new Command("Add-VMNetworkAdapter");
|
||||
|
||||
//Command cmd = new Command("Add-VMDvdDrive");
|
||||
cmd.Parameters.Add("VMName", vmName);
|
||||
cmd.Parameters.Add("Name", adapterName);
|
||||
cmd.Parameters.Add("SwitchName", switchId);
|
||||
|
||||
//cmd.Parameters.Add("VMName", vmName);
|
||||
//cmd.Parameters.Add("ControllerNumber", dvd.ControllerNumber);
|
||||
//cmd.Parameters.Add("ControllerLocation", dvd.ControllerLocation);
|
||||
if (String.IsNullOrEmpty(macAddress))
|
||||
cmd.Parameters.Add("DynamicMacAddress");
|
||||
else
|
||||
cmd.Parameters.Add("StaticMacAddress", macAddress);
|
||||
|
||||
//powerShell.Execute(cmd, false);
|
||||
powerShell.Execute(cmd, false);
|
||||
}
|
||||
public static void Delete(PowerShellManager powerShell, string vmName, string macAddress)
|
||||
{
|
||||
//var dvd = Get(powerShell, vmName);
|
||||
var networkAdapter = Get(powerShell, vmName, macAddress);
|
||||
|
||||
//Command cmd = new Command("Add-VMDvdDrive");
|
||||
if (networkAdapter == null)
|
||||
return;
|
||||
|
||||
//cmd.Parameters.Add("VMName", vmName);
|
||||
//cmd.Parameters.Add("ControllerNumber", dvd.ControllerNumber);
|
||||
//cmd.Parameters.Add("ControllerLocation", dvd.ControllerLocation);
|
||||
Command cmd = new Command("Remove-VMNetworkAdapter");
|
||||
|
||||
//powerShell.Execute(cmd, false);
|
||||
cmd.Parameters.Add("VMName", vmName);
|
||||
cmd.Parameters.Add("Name", networkAdapter.Name);
|
||||
|
||||
powerShell.Execute(cmd, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Management;
|
||||
using System.Management.Automation;
|
||||
using System.Management.Automation.Runspaces;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace WebsitePanel.Providers.Virtualization
|
||||
{
|
||||
public static class SnapshotHelper
|
||||
{
|
||||
public static VirtualMachineSnapshot GetFromPS(PSObject psObject, string runningSnapshotId = null)
|
||||
{
|
||||
var snapshot = new VirtualMachineSnapshot
|
||||
{
|
||||
Id = psObject.GetString("Id"),
|
||||
Name = psObject.GetString("Name"),
|
||||
VMName = psObject.GetString("VMName"),
|
||||
ParentId = psObject.GetString("ParentSnapshotId"),
|
||||
Created = psObject.GetProperty<DateTime>("CreationTime")
|
||||
};
|
||||
|
||||
if (string.IsNullOrEmpty(snapshot.ParentId))
|
||||
snapshot.ParentId = null; // for capability
|
||||
|
||||
if (!String.IsNullOrEmpty(runningSnapshotId))
|
||||
snapshot.IsCurrent = snapshot.Id == runningSnapshotId;
|
||||
|
||||
return snapshot;
|
||||
}
|
||||
|
||||
public static VirtualMachineSnapshot GetFromWmi(ManagementBaseObject objSnapshot)
|
||||
{
|
||||
if (objSnapshot == null || objSnapshot.Properties.Count == 0)
|
||||
return null;
|
||||
|
||||
VirtualMachineSnapshot snapshot = new VirtualMachineSnapshot();
|
||||
snapshot.Id = (string)objSnapshot["InstanceID"];
|
||||
snapshot.Name = (string)objSnapshot["ElementName"];
|
||||
|
||||
string parentId = (string)objSnapshot["Parent"];
|
||||
if (!String.IsNullOrEmpty(parentId))
|
||||
{
|
||||
int idx = parentId.IndexOf("Microsoft:");
|
||||
snapshot.ParentId = parentId.Substring(idx, parentId.Length - idx - 1);
|
||||
snapshot.ParentId = snapshot.ParentId.ToLower().Replace("microsoft:", "");
|
||||
}
|
||||
if (!String.IsNullOrEmpty(snapshot.Id))
|
||||
{
|
||||
snapshot.Id = snapshot.Id.ToLower().Replace("microsoft:", "");
|
||||
}
|
||||
snapshot.Created = Wmi.ToDateTime((string)objSnapshot["CreationTime"]);
|
||||
|
||||
if (string.IsNullOrEmpty(snapshot.ParentId))
|
||||
snapshot.ParentId = null; // for capability
|
||||
|
||||
return snapshot;
|
||||
}
|
||||
|
||||
public static void Delete(PowerShellManager powerShell, VirtualMachineSnapshot snapshot, bool includeChilds)
|
||||
{
|
||||
Command cmd = new Command("Remove-VMSnapshot");
|
||||
cmd.Parameters.Add("VMName", snapshot.VMName);
|
||||
cmd.Parameters.Add("Name", snapshot.Name);
|
||||
if (includeChilds) cmd.Parameters.Add("IncludeAllChildSnapshots", true);
|
||||
|
||||
powerShell.Execute(cmd, false);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -12,16 +12,8 @@ namespace WebsitePanel.Providers.Virtualization
|
|||
{
|
||||
public static class VirtualMachineHelper
|
||||
{
|
||||
#region Constants
|
||||
|
||||
private const Int64 Size1G = 0x40000000;
|
||||
private const Int64 Size1M = 0x100000;
|
||||
|
||||
#endregion
|
||||
|
||||
public static OperationalStatus GetVMHeartBeatStatus(PowerShellManager powerShell, string name)
|
||||
{
|
||||
|
||||
OperationalStatus status = OperationalStatus.None;
|
||||
|
||||
Command cmd = new Command("Get-VMIntegrationService");
|
||||
|
@ -40,7 +32,6 @@ namespace WebsitePanel.Providers.Virtualization
|
|||
return status;
|
||||
}
|
||||
|
||||
|
||||
public static int GetVMProcessors(PowerShellManager powerShell, string name)
|
||||
{
|
||||
|
||||
|
@ -71,105 +62,15 @@ namespace WebsitePanel.Providers.Virtualization
|
|||
if (result != null && result.Count > 0)
|
||||
{
|
||||
info.DynamicMemoryEnabled = Convert.ToBoolean(result[0].GetProperty("DynamicMemoryEnabled"));
|
||||
info.Startup = Convert.ToInt64(result[0].GetProperty("Startup"));
|
||||
info.Minimum = Convert.ToInt64(result[0].GetProperty("Minimum"));
|
||||
info.Maximum = Convert.ToInt64(result[0].GetProperty("Maximum"));
|
||||
info.Startup = Convert.ToInt64(result[0].GetProperty("Startup")) / Constants.Size1M;
|
||||
info.Minimum = Convert.ToInt64(result[0].GetProperty("Minimum")) / Constants.Size1M;
|
||||
info.Maximum = Convert.ToInt64(result[0].GetProperty("Maximum")) / Constants.Size1M;
|
||||
info.Buffer = Convert.ToInt32(result[0].GetProperty("Buffer"));
|
||||
info.Priority = Convert.ToInt32(result[0].GetProperty("Priority"));
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
public static BiosInfo GetVMBios(PowerShellManager powerShell, string name)
|
||||
{
|
||||
BiosInfo info = new BiosInfo();
|
||||
|
||||
Command cmd = new Command("Get-VMBios");
|
||||
|
||||
cmd.Parameters.Add("VMName", name);
|
||||
|
||||
Collection<PSObject> result = powerShell.Execute(cmd, false);
|
||||
if (result != null && result.Count > 0)
|
||||
{
|
||||
info.NumLockEnabled = Convert.ToBoolean(result[0].GetProperty("NumLockEnabled"));
|
||||
|
||||
List<string> startupOrders = new List<string>();
|
||||
|
||||
foreach (var item in (IEnumerable)result[0].GetProperty("StartupOrder"))
|
||||
startupOrders.Add(item.ToString());
|
||||
|
||||
info.StartupOrder = startupOrders.ToArray();
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
public static VirtualHardDiskInfo[] GetVirtualHardDisks(PowerShellManager powerShell, string name)
|
||||
{
|
||||
|
||||
List<VirtualHardDiskInfo> disks = new List<VirtualHardDiskInfo>();
|
||||
|
||||
Command cmd = new Command("Get-VMHardDiskDrive");
|
||||
cmd.Parameters.Add("VMName", name);
|
||||
|
||||
Collection<PSObject> result = powerShell.Execute(cmd, false);
|
||||
if (result != null && result.Count > 0)
|
||||
{
|
||||
foreach (PSObject d in result)
|
||||
{
|
||||
VirtualHardDiskInfo disk = new VirtualHardDiskInfo();
|
||||
|
||||
disk.SupportPersistentReservations = Convert.ToBoolean(d.GetProperty("SupportPersistentReservations"));
|
||||
disk.MaximumIOPS = Convert.ToUInt64(d.GetProperty("MaximumIOPS"));
|
||||
disk.MinimumIOPS = Convert.ToUInt64(d.GetProperty("MinimumIOPS"));
|
||||
disk.VHDControllerType = d.GetEnum<ControllerType>("ControllerType");
|
||||
disk.ControllerNumber = Convert.ToInt32(d.GetProperty("ControllerNumber"));
|
||||
disk.ControllerLocation = Convert.ToInt32(d.GetProperty("ControllerLocation"));
|
||||
disk.Path = d.GetProperty("Path").ToString();
|
||||
disk.Name = d.GetProperty("Name").ToString();
|
||||
|
||||
GetVirtualHardDiskDetail(powerShell, disk.Path, ref disk);
|
||||
|
||||
disks.Add(disk);
|
||||
}
|
||||
}
|
||||
return disks.ToArray();
|
||||
}
|
||||
|
||||
public static void GetVirtualHardDiskDetail(PowerShellManager powerShell, string path, ref VirtualHardDiskInfo disk)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(path))
|
||||
{
|
||||
Command cmd = new Command("Get-VHD");
|
||||
cmd.Parameters.Add("Path", path);
|
||||
Collection<PSObject> result = powerShell.Execute(cmd, false);
|
||||
if (result != null && result.Count > 0)
|
||||
{
|
||||
disk.DiskFormat = result[0].GetEnum<VirtualHardDiskFormat>("VhdFormat");
|
||||
disk.DiskType = result[0].GetEnum<VirtualHardDiskType>("VhdType");
|
||||
disk.ParentPath = result[0].GetProperty<string>("ParentPath");
|
||||
disk.MaxInternalSize = Convert.ToInt64(result[0].GetProperty("Size")) / Size1G;
|
||||
disk.FileSize = Convert.ToInt64(result[0].GetProperty("FileSize")) / Size1G;
|
||||
disk.Attached = Convert.ToBoolean(result[0].GetProperty("Attached"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public static void UpdateBios(PowerShellManager powerShell, VirtualMachine vm, bool bootFromCD, bool numLockEnabled)
|
||||
{
|
||||
Command cmd = new Command("Set-VMBios");
|
||||
|
||||
cmd.Parameters.Add("VMName", vm.Name);
|
||||
cmd.Parameters.Add(numLockEnabled ? "EnableNumLock" : "DisableNumLock");
|
||||
var bootOrder = bootFromCD
|
||||
? new[] { "CD", "IDE", "LegacyNetworkAdapter", "Floppy" }
|
||||
: new[] { "IDE", "CD", "LegacyNetworkAdapter", "Floppy" };
|
||||
cmd.Parameters.Add("StartupOrder", bootOrder);
|
||||
|
||||
powerShell.Execute(cmd, false);
|
||||
}
|
||||
public static void UpdateProcessors(PowerShellManager powerShell, VirtualMachine vm, int cpuCores, int cpuLimitSettings, int cpuReserveSettings, int cpuWeightSettings)
|
||||
{
|
||||
Command cmd = new Command("Set-VMProcessor");
|
||||
|
@ -182,12 +83,13 @@ namespace WebsitePanel.Providers.Virtualization
|
|||
|
||||
powerShell.Execute(cmd, false);
|
||||
}
|
||||
|
||||
public static void UpdateMemory(PowerShellManager powerShell, VirtualMachine vm, long ramMB)
|
||||
{
|
||||
Command cmd = new Command("Set-VMMemory");
|
||||
|
||||
cmd.Parameters.Add("VMName", vm.Name);
|
||||
cmd.Parameters.Add("StartupBytes", ramMB);
|
||||
cmd.Parameters.Add("StartupBytes", ramMB * Constants.Size1M);
|
||||
|
||||
powerShell.Execute(cmd, false);
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -17,7 +17,7 @@
|
|||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\WebsitePanel.Server\bin\</OutputPath>
|
||||
<OutputPath>..\WebsitePanel.Server\bin\HyperV2012R2\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
|
@ -53,9 +53,14 @@
|
|||
<Compile Include="..\VersionInfo.cs">
|
||||
<Link>VersionInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Constants.cs" />
|
||||
<Compile Include="Extensions\PSObjectExtension.cs" />
|
||||
<Compile Include="Helpers\BiosHelper.cs" />
|
||||
<Compile Include="Helpers\HardDriveHelper.cs" />
|
||||
<Compile Include="Helpers\NetworkAdapterHelper.cs" />
|
||||
<Compile Include="Helpers\DvdDriveHelper.cs" />
|
||||
<Compile Include="Helpers\JobHelper.cs" />
|
||||
<Compile Include="Helpers\SnapshotHelper.cs" />
|
||||
<Compile Include="PowerShellManager.cs" />
|
||||
<Compile Include="HyperV2012R2.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
|
|
|
@ -115,7 +115,7 @@ namespace WebsitePanel.Providers.Virtualization
|
|||
}
|
||||
|
||||
// Converts a given datetime in DMTF format to System.DateTime object.
|
||||
internal System.DateTime ToDateTime(string dmtfDate)
|
||||
internal static System.DateTime ToDateTime(string dmtfDate)
|
||||
{
|
||||
System.DateTime initializer = System.DateTime.MinValue;
|
||||
int year = initializer.Year;
|
||||
|
|
|
@ -99,6 +99,8 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
|
|||
|
||||
private System.Threading.SendOrPostCallback InstallCertificateOperationCompleted;
|
||||
|
||||
private System.Threading.SendOrPostCallback MoveSessionHostToRdsOUOperationCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
public RemoteDesktopServices() {
|
||||
this.Url = "http://localhost:9003/RemoteDesktopServices.asmx";
|
||||
|
@ -209,6 +211,9 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
|
|||
/// <remarks/>
|
||||
public event InstallCertificateCompletedEventHandler InstallCertificateCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
public event MoveSessionHostToRdsOUCompletedEventHandler MoveSessionHostToRdsOUCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
|
||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateCollection", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
||||
|
@ -1737,6 +1742,46 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
|
|||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
|
||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/MoveSessionHostToRdsOU", 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 MoveSessionHostToRdsOU(string hostName) {
|
||||
this.Invoke("MoveSessionHostToRdsOU", new object[] {
|
||||
hostName});
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public System.IAsyncResult BeginMoveSessionHostToRdsOU(string hostName, System.AsyncCallback callback, object asyncState) {
|
||||
return this.BeginInvoke("MoveSessionHostToRdsOU", new object[] {
|
||||
hostName}, callback, asyncState);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void EndMoveSessionHostToRdsOU(System.IAsyncResult asyncResult) {
|
||||
this.EndInvoke(asyncResult);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void MoveSessionHostToRdsOUAsync(string hostName) {
|
||||
this.MoveSessionHostToRdsOUAsync(hostName, null);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void MoveSessionHostToRdsOUAsync(string hostName, object userState) {
|
||||
if ((this.MoveSessionHostToRdsOUOperationCompleted == null)) {
|
||||
this.MoveSessionHostToRdsOUOperationCompleted = new System.Threading.SendOrPostCallback(this.OnMoveSessionHostToRdsOUOperationCompleted);
|
||||
}
|
||||
this.InvokeAsync("MoveSessionHostToRdsOU", new object[] {
|
||||
hostName}, this.MoveSessionHostToRdsOUOperationCompleted, userState);
|
||||
}
|
||||
|
||||
private void OnMoveSessionHostToRdsOUOperationCompleted(object arg) {
|
||||
if ((this.MoveSessionHostToRdsOUCompleted != null)) {
|
||||
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
|
||||
this.MoveSessionHostToRdsOUCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public new void CancelAsync(object userState) {
|
||||
base.CancelAsync(userState);
|
||||
|
@ -2366,4 +2411,8 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
|
|||
/// <remarks/>
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||
public delegate void InstallCertificateCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
|
||||
|
||||
/// <remarks/>
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||
public delegate void MoveSessionHostToRdsOUCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
|
||||
}
|
||||
|
|
|
@ -646,5 +646,21 @@ namespace WebsitePanel.Server
|
|||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
[WebMethod, SoapHeader("settings")]
|
||||
public void MoveSessionHostToRdsOU(string hostName)
|
||||
{
|
||||
try
|
||||
{
|
||||
Log.WriteStart("'{0}' MoveSessionHostToRdsOU", ProviderSettings.ProviderName);
|
||||
RDSProvider.MoveSessionHostToRdsOU(hostName);
|
||||
Log.WriteEnd("'{0}' MoveSessionHostToRdsOU", ProviderSettings.ProviderName);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.WriteError(String.Format("'{0}' MoveSessionHostToRdsOU", ProviderSettings.ProviderName), ex);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<!-- Custom configuration sections -->
|
||||
<configSections>
|
||||
|
@ -7,34 +7,34 @@
|
|||
<section name="cachingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerSettings,Microsoft.Practices.EnterpriseLibrary.Caching"/>
|
||||
</configSections>
|
||||
<appSettings>
|
||||
<add key="WebsitePanel.HyperV.UseDiskPartClearReadOnlyFlag" value="false"/>
|
||||
<add key="WebsitePanel.Exchange.ClearQueryBaseDN" value="false"/>
|
||||
<add key="WebsitePanel.Exchange.enableSP2abp" value="false"/>
|
||||
<add key="SCVMMServerName" value=""/>
|
||||
<add key="SCVMMServerPort" value=""/>
|
||||
<add key="WebsitePanel.HyperV.UseDiskPartClearReadOnlyFlag" value="false" />
|
||||
<add key="WebsitePanel.Exchange.ClearQueryBaseDN" value="false" />
|
||||
<add key="WebsitePanel.Exchange.enableSP2abp" value="false" />
|
||||
<add key="SCVMMServerName" value="" />
|
||||
<add key="SCVMMServerPort" value="" />
|
||||
</appSettings>
|
||||
<system.diagnostics>
|
||||
<switches>
|
||||
<add name="Log" value="2"/>
|
||||
<add name="Log" value="2" />
|
||||
<!-- 0 - Off, 1 - Error, 2 - Warning, 3 - Info, 4 - Verbose -->
|
||||
</switches>
|
||||
<trace autoflush="true">
|
||||
<listeners>
|
||||
<add name="DefaultListener" type="WebsitePanel.Server.Utils.EventLogTraceListener, WebsitePanel.Server.Utils" initializeData="WebsitePanel"/>
|
||||
<add name="DefaultListener" type="WebsitePanel.Server.Utils.EventLogTraceListener, WebsitePanel.Server.Utils" initializeData="WebsitePanel" />
|
||||
<!-- Writes log to the file
|
||||
<add name="DefaultListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="WebsitePanel.Server.log" />
|
||||
-->
|
||||
<remove name="Default"/>
|
||||
<remove name="Default" />
|
||||
</listeners>
|
||||
</trace>
|
||||
</system.diagnostics>
|
||||
<!-- Caching Configuration -->
|
||||
<cachingConfiguration defaultCacheManager="Default Cache Manager">
|
||||
<backingStores>
|
||||
<add name="inMemory" type="Microsoft.Practices.EnterpriseLibrary.Caching.BackingStoreImplementations.NullBackingStore, Microsoft.Practices.EnterpriseLibrary.Caching"/>
|
||||
<add name="inMemory" type="Microsoft.Practices.EnterpriseLibrary.Caching.BackingStoreImplementations.NullBackingStore, Microsoft.Practices.EnterpriseLibrary.Caching" />
|
||||
</backingStores>
|
||||
<cacheManagers>
|
||||
<add name="Default Cache Manager" expirationPollFrequencyInSeconds="43200" maximumElementsInCacheBeforeScavenging="1000" numberToRemoveWhenScavenging="10" backingStoreName="inMemory"/>
|
||||
<add name="Default Cache Manager" expirationPollFrequencyInSeconds="43200" maximumElementsInCacheBeforeScavenging="1000" numberToRemoveWhenScavenging="10" backingStoreName="inMemory" />
|
||||
</cacheManagers>
|
||||
</cachingConfiguration>
|
||||
<!-- WebsitePanel Configuration -->
|
||||
|
@ -42,85 +42,85 @@
|
|||
<!-- Security settings -->
|
||||
<security>
|
||||
<!-- Perform security check -->
|
||||
<enabled value="true"/>
|
||||
<enabled value="true" />
|
||||
<!-- Server password -->
|
||||
<password value="+uxnDOdf55yuH6iZYXgYAxsfIBw="/>
|
||||
<password value="+uxnDOdf55yuH6iZYXgYAxsfIBw=" />
|
||||
</security>
|
||||
</websitepanel.server>
|
||||
<system.web>
|
||||
<!-- Disable any authentication -->
|
||||
<authentication mode="None"/>
|
||||
<authentication mode="None" />
|
||||
<!-- Correct HTTP runtime settings -->
|
||||
<httpRuntime executionTimeout="3600" maxRequestLength="16384"/>
|
||||
<httpRuntime executionTimeout="3600" maxRequestLength="16384" />
|
||||
<!-- Set globalization settings -->
|
||||
<globalization culture="en-US" uiCulture="en" requestEncoding="UTF-8" responseEncoding="UTF-8" fileEncoding="UTF-8"/>
|
||||
<globalization culture="en-US" uiCulture="en" requestEncoding="UTF-8" responseEncoding="UTF-8" fileEncoding="UTF-8" />
|
||||
<!-- Web Services settings -->
|
||||
<webServices>
|
||||
<protocols>
|
||||
<remove name="HttpPost"/>
|
||||
<remove name="HttpPostLocalhost"/>
|
||||
<remove name="HttpGet"/>
|
||||
<remove name="HttpPost" />
|
||||
<remove name="HttpPostLocalhost" />
|
||||
<remove name="HttpGet" />
|
||||
</protocols>
|
||||
<soapServerProtocolFactory type="Microsoft.Web.Services3.WseProtocolFactory, Microsoft.Web.Services3"/>
|
||||
<soapServerProtocolFactory type="Microsoft.Web.Services3.WseProtocolFactory, Microsoft.Web.Services3" />
|
||||
</webServices>
|
||||
<compilation debug="true">
|
||||
<assemblies>
|
||||
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
|
||||
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
|
||||
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
|
||||
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
|
||||
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
|
||||
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
<add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
|
||||
<add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
|
||||
</assemblies>
|
||||
</compilation>
|
||||
<pages>
|
||||
<controls>
|
||||
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
|
||||
<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
|
||||
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
<add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
</controls>
|
||||
</pages>
|
||||
<httpHandlers>
|
||||
<remove verb="*" path="*.asmx"/>
|
||||
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
|
||||
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
|
||||
<add verb="GET,HEAD" path="ScriptResource.axd" validate="false" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
|
||||
<remove verb="*" path="*.asmx" />
|
||||
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
<add verb="GET,HEAD" path="ScriptResource.axd" validate="false" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
</httpHandlers>
|
||||
<httpModules>
|
||||
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
|
||||
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
</httpModules>
|
||||
</system.web>
|
||||
<!-- WSE 3.0 settings -->
|
||||
<microsoft.web.services3>
|
||||
<diagnostics>
|
||||
<trace enabled="false" input="InputTrace.webinfo" output="OutputTrace.webinfo"/>
|
||||
<trace enabled="false" input="InputTrace.webinfo" output="OutputTrace.webinfo" />
|
||||
</diagnostics>
|
||||
<messaging>
|
||||
<maxMessageLength value="-1"/>
|
||||
<mtom serverMode="optional" clientMode="On"/>
|
||||
<maxMessageLength value="-1" />
|
||||
<mtom serverMode="optional" clientMode="On" />
|
||||
</messaging>
|
||||
<security>
|
||||
<securityTokenManager>
|
||||
<add type="WebsitePanel.Server.ServerUsernameTokenManager, WebsitePanel.Server" namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" localName="UsernameToken"/>
|
||||
<add type="WebsitePanel.Server.ServerUsernameTokenManager, WebsitePanel.Server" namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" localName="UsernameToken" />
|
||||
</securityTokenManager>
|
||||
<timeToleranceInSeconds value="86400"/>
|
||||
<timeToleranceInSeconds value="86400" />
|
||||
</security>
|
||||
<policy fileName="WsePolicyCache.Config"/>
|
||||
<policy fileName="WsePolicyCache.Config" />
|
||||
</microsoft.web.services3>
|
||||
<system.serviceModel>
|
||||
<bindings>
|
||||
<wsHttpBinding>
|
||||
<binding name="WSHttpBinding_IVirtualMachineManagementService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="10485760" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
|
||||
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
|
||||
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/>
|
||||
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
|
||||
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
|
||||
<security mode="Message">
|
||||
<transport clientCredentialType="Windows" proxyCredentialType="None" realm=""/>
|
||||
<message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default"/>
|
||||
<transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
|
||||
<message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" />
|
||||
</security>
|
||||
</binding>
|
||||
<binding name="WSHttpBinding_IMonitoringService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="10485760" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
|
||||
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
|
||||
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false"/>
|
||||
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
|
||||
<reliableSession ordered="true" inactivityTimeout="00:10:00" enabled="false" />
|
||||
<security mode="Message">
|
||||
<transport clientCredentialType="Windows" proxyCredentialType="None" realm=""/>
|
||||
<message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default"/>
|
||||
<transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
|
||||
<message clientCredentialType="Windows" negotiateServiceCredential="true" algorithmSuite="Default" />
|
||||
</security>
|
||||
</binding>
|
||||
</wsHttpBinding>
|
||||
|
@ -129,40 +129,40 @@
|
|||
<system.codedom>
|
||||
<compilers>
|
||||
<compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4">
|
||||
<providerOption name="CompilerVersion" value="v3.5"/>
|
||||
<providerOption name="WarnAsError" value="false"/>
|
||||
<providerOption name="CompilerVersion" value="v3.5" />
|
||||
<providerOption name="WarnAsError" value="false" />
|
||||
</compiler>
|
||||
</compilers>
|
||||
</system.codedom>
|
||||
<system.webServer>
|
||||
<validation validateIntegratedModeConfiguration="false"/>
|
||||
<validation validateIntegratedModeConfiguration="false" />
|
||||
<modules>
|
||||
<remove name="ScriptModule"/>
|
||||
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
|
||||
<remove name="ScriptModule" />
|
||||
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
</modules>
|
||||
<handlers>
|
||||
<remove name="WebServiceHandlerFactory-Integrated"/>
|
||||
<remove name="ScriptHandlerFactory"/>
|
||||
<remove name="ScriptHandlerFactoryAppServices"/>
|
||||
<remove name="ScriptResource"/>
|
||||
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
|
||||
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
|
||||
<add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" preCondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
|
||||
<remove name="WebServiceHandlerFactory-Integrated" />
|
||||
<remove name="ScriptHandlerFactory" />
|
||||
<remove name="ScriptHandlerFactoryAppServices" />
|
||||
<remove name="ScriptResource" />
|
||||
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
<add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" preCondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
|
||||
</handlers>
|
||||
</system.webServer>
|
||||
<runtime>
|
||||
<assemblyBinding appliesTo="v2.0.50727" xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
|
||||
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
|
||||
<assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
|
||||
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
|
||||
<assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<probing privatePath="bin/Crm2011;bin/Crm2013;bin/Exchange2013;bin/Sharepoint2013;bin/Lync2013;bin/Lync2013HP;bin/Dns2012;bin/IceWarp;bin/IIs80"/>
|
||||
<probing privatePath="bin/Crm2011;bin/Crm2013;bin/Exchange2013;bin/Sharepoint2013;bin/Lync2013;bin/Lync2013HP;bin/Dns2012;bin/IceWarp;bin/IIs80;bin/HyperV2012R2" />
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
|
@ -13,12 +13,14 @@ namespace WebsitePanel.WebDav.Core.Config.Entities
|
|||
{
|
||||
IsEnabled = ConfigSection.OfficeOnline.IsEnabled;
|
||||
Url = ConfigSection.OfficeOnline.Url;
|
||||
NewFilePath = ConfigSection.OfficeOnline.CobaltNewFilePath;
|
||||
CobaltFileTtl = ConfigSection.OfficeOnline.CobaltFileTtl;
|
||||
_officeExtensions = ConfigSection.OfficeOnline.Cast<OfficeOnlineElement>().ToList();
|
||||
}
|
||||
|
||||
public bool IsEnabled { get; private set; }
|
||||
public string Url { get; private set; }
|
||||
public string NewFilePath { get; private set; }
|
||||
public int CobaltFileTtl { get; private set; }
|
||||
|
||||
public IEnumerator<OfficeOnlineElement> GetEnumerator()
|
||||
|
|
|
@ -8,6 +8,7 @@ namespace WebsitePanel.WebDavPortal.WebConfigSections
|
|||
private const string OwaViewKey = "OwaView";
|
||||
private const string OwaEditorKey = "OwaEditor";
|
||||
private const string OwaMobileViewKey = "OwaMobileView";
|
||||
private const string OwaNewFileViewKey = "OwaNewFileView";
|
||||
|
||||
[ConfigurationProperty(ExtensionKey, IsKey = true, IsRequired = true)]
|
||||
public string Extension
|
||||
|
@ -37,5 +38,12 @@ namespace WebsitePanel.WebDavPortal.WebConfigSections
|
|||
get { return this[OwaMobileViewKey].ToString(); }
|
||||
set { this[OwaMobileViewKey] = value; }
|
||||
}
|
||||
|
||||
[ConfigurationProperty(OwaNewFileViewKey, IsKey = true, IsRequired = true)]
|
||||
public string OwaNewFileView
|
||||
{
|
||||
get { return this[OwaNewFileViewKey].ToString(); }
|
||||
set { this[OwaNewFileViewKey] = value; }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -9,6 +9,7 @@ namespace WebsitePanel.WebDavPortal.WebConfigSections
|
|||
private const string UrlKey = "url";
|
||||
private const string IsEnabledKey = "isEnabled";
|
||||
private const string CobaltFileTtlKey = "cobaltFileTtl";
|
||||
private const string CobaltNewFilePathKey = "cobaltNewFilePath";
|
||||
|
||||
[ConfigurationProperty(UrlKey, IsKey = true, IsRequired = true)]
|
||||
public string Url
|
||||
|
@ -24,6 +25,13 @@ namespace WebsitePanel.WebDavPortal.WebConfigSections
|
|||
set { this[IsEnabledKey] = value; }
|
||||
}
|
||||
|
||||
[ConfigurationProperty(CobaltNewFilePathKey, IsKey = true, IsRequired = true)]
|
||||
public string CobaltNewFilePath
|
||||
{
|
||||
get { return this[CobaltNewFilePathKey].ToString(); }
|
||||
set { this[CobaltNewFilePathKey] = value; }
|
||||
}
|
||||
|
||||
[ConfigurationProperty(CobaltFileTtlKey, IsKey = true, IsRequired = true)]
|
||||
public int CobaltFileTtl
|
||||
{
|
||||
|
|
|
@ -37,6 +37,10 @@ namespace WebsitePanel.WebDav.Core.Entities.Owa
|
|||
public bool RestrictedWebViewOnly { get; set; }
|
||||
[DataMember]
|
||||
public string ClientUrl { get; set; }
|
||||
[DataMember]
|
||||
public bool CloseButtonClosesWindow { get; set; }
|
||||
//[DataMember]
|
||||
//public string CloseUrl { get; set; }
|
||||
//[DataMember]
|
||||
//public bool UserCanNotWriteRelative { get; set; }
|
||||
|
||||
|
@ -59,8 +63,7 @@ namespace WebsitePanel.WebDav.Core.Entities.Owa
|
|||
//public string BreadcrumbFolderUrl { get; set; }
|
||||
//[DataMember]
|
||||
//public string ClientUrl { get; set; }
|
||||
//[DataMember]
|
||||
//public bool CloseButtonClosesWindow { get; set; }
|
||||
|
||||
//[DataMember]
|
||||
//public string CloseUrl { get; set; }
|
||||
//[DataMember]
|
||||
|
|
|
@ -9,5 +9,13 @@ namespace WebsitePanel.WebDav.Core.Extensions
|
|||
{
|
||||
return new Uri(paths.Aggregate(uri.AbsoluteUri, (current, path) => string.Format("{0}/{1}", current.TrimEnd('/'), path.TrimStart('/'))));
|
||||
}
|
||||
|
||||
public static string ToStringPath(this Uri uri)
|
||||
{
|
||||
var hostStart = uri.ToString().IndexOf(uri.Host, System.StringComparison.Ordinal);
|
||||
var hostLength = uri.Host.Length;
|
||||
|
||||
return uri.ToString().Substring(hostStart + hostLength, uri.ToString().Length - hostStart - hostLength);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -148,7 +148,7 @@ namespace WebsitePanel.WebDav.Core
|
|||
public IResource GetResource(string name)
|
||||
{
|
||||
IHierarchyItem item =
|
||||
_children.Single(i => i.DisplayName.Trim('/') == name.Trim('/'));
|
||||
_children.Single(i => i.DisplayName.ToLowerInvariant().Trim('/') == name.ToLowerInvariant().Trim('/'));
|
||||
var resource = new WebDavResource();
|
||||
resource.SetCredentials(_credentials);
|
||||
resource.SetHierarchyItem(item);
|
||||
|
|
|
@ -260,7 +260,7 @@ namespace WebsitePanel.WebDav.Core
|
|||
{
|
||||
get
|
||||
{
|
||||
string displayName = _href.AbsoluteUri.Trim('/').Replace(_baseUri.AbsoluteUri.Trim('/'), "");
|
||||
string displayName = _href.ToString().Trim('/').Replace(_baseUri.ToString().Trim('/'), "");
|
||||
displayName = Regex.Replace(displayName, "\\/$", "");
|
||||
Match displayNameMatch = Regex.Match(displayName, "([\\/]+)$");
|
||||
if (displayNameMatch.Success)
|
||||
|
@ -483,7 +483,7 @@ namespace WebsitePanel.WebDav.Core
|
|||
{
|
||||
_href = href;
|
||||
|
||||
var baseUrl = href.AbsoluteUri.Remove(href.AbsoluteUri.Length - href.Segments.Last().Length);
|
||||
var baseUrl = href.ToString().Remove(href.ToString().Length - href.ToString().Trim('/').Split('/').Last().Length);
|
||||
|
||||
_baseUri = new Uri(baseUrl);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using System.Web.Mvc;
|
||||
using WebsitePanel.EnterpriseServer.Base.HostedSolution;
|
||||
using WebsitePanel.WebDav.Core.Client;
|
||||
using WebsitePanel.WebDav.Core.Entities.Owa;
|
||||
|
||||
|
@ -6,7 +6,7 @@ namespace WebsitePanel.WebDav.Core.Interfaces.Owa
|
|||
{
|
||||
public interface IWopiServer
|
||||
{
|
||||
CheckFileInfo GetCheckFileInfo(string path);
|
||||
FileResult GetFile(string path);
|
||||
CheckFileInfo GetCheckFileInfo(WebDavAccessToken token);
|
||||
byte[] GetFileBytes(int accessTokenId);
|
||||
}
|
||||
}
|
|
@ -52,7 +52,7 @@ namespace WebsitePanel.WebDav.Core.Managers
|
|||
Href = new Uri(x.Url),
|
||||
ItemType = ItemType.Folder,
|
||||
ContentLength = x.Size * 1024 * 1024,
|
||||
AllocatedSpace = x.FRSMQuotaMB * 1024 * 1024,
|
||||
AllocatedSpace = (long)x.FRSMQuotaMB * 1024 * 1024,
|
||||
IsRootItem = true
|
||||
}).ToArray();
|
||||
}
|
||||
|
@ -240,9 +240,9 @@ namespace WebsitePanel.WebDav.Core.Managers
|
|||
|
||||
return _currentFolder.GetResource(resourceName);
|
||||
}
|
||||
catch (InvalidOperationException exception)
|
||||
catch (Exception)
|
||||
{
|
||||
throw new ResourceNotFoundException("Resource not found", exception);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -2,8 +2,10 @@
|
|||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.Caching;
|
||||
using System.Web;
|
||||
using Cobalt;
|
||||
using WebsitePanel.WebDav.Core.Client;
|
||||
using WebsitePanel.WebDav.Core.Config;
|
||||
|
@ -72,9 +74,20 @@ namespace WebsitePanel.WebDav.Core.Owa
|
|||
|
||||
var token = _tokenManager.GetToken(accessTokenId);
|
||||
|
||||
var fileBytes = _webDavManager.GetFileBytes(token.FilePath);
|
||||
Atom atom;
|
||||
|
||||
var atom = new AtomFromByteArray(fileBytes);
|
||||
if (_webDavManager.FileExist(token.FilePath))
|
||||
{
|
||||
var fileBytes = _webDavManager.GetFileBytes(token.FilePath);
|
||||
|
||||
atom = new AtomFromByteArray(fileBytes);
|
||||
}
|
||||
else
|
||||
{
|
||||
var filePath = HttpContext.Current.Server.MapPath(WebDavAppConfigManager.Instance.OfficeOnline.NewFilePath + Path.GetExtension(token.FilePath));
|
||||
|
||||
atom = new AtomFromByteArray(File.ReadAllBytes(filePath));
|
||||
}
|
||||
|
||||
Cobalt.Metrics o1;
|
||||
cobaltFile.GetCobaltFilePartition(FilePartitionId.Content).SetStream(RootId.Default.Value, atom, out o1);
|
||||
|
|
|
@ -6,6 +6,8 @@ using System.Runtime.Serialization.Json;
|
|||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
using Cobalt;
|
||||
using WebsitePanel.EnterpriseServer.Base.HostedSolution;
|
||||
using WebsitePanel.WebDav.Core.Client;
|
||||
using WebsitePanel.WebDav.Core.Config;
|
||||
using WebsitePanel.WebDav.Core.Entities.Owa;
|
||||
|
@ -22,27 +24,30 @@ namespace WebsitePanel.WebDav.Core.Owa
|
|||
private readonly IWebDavManager _webDavManager;
|
||||
private readonly IAccessTokenManager _tokenManager;
|
||||
private readonly IWebDavAuthorizationService _webDavAuthorizationService;
|
||||
private readonly IWopiFileManager _fileManager;
|
||||
|
||||
public WopiServer(IWebDavManager webDavManager, IAccessTokenManager tokenManager, IWebDavAuthorizationService webDavAuthorizationService)
|
||||
|
||||
public WopiServer(IWebDavManager webDavManager, IAccessTokenManager tokenManager, IWebDavAuthorizationService webDavAuthorizationService, IWopiFileManager fileManager)
|
||||
{
|
||||
_webDavManager = webDavManager;
|
||||
_tokenManager = tokenManager;
|
||||
_webDavAuthorizationService = webDavAuthorizationService;
|
||||
_fileManager = fileManager;
|
||||
}
|
||||
|
||||
public CheckFileInfo GetCheckFileInfo(string path)
|
||||
public CheckFileInfo GetCheckFileInfo(WebDavAccessToken token)
|
||||
{
|
||||
var resource = _webDavManager.GetResource(path);
|
||||
var resource = _webDavManager.GetResource(token.FilePath);
|
||||
|
||||
var permissions = _webDavAuthorizationService.GetPermissions(WspContext.User, path);
|
||||
var permissions = _webDavAuthorizationService.GetPermissions(WspContext.User, token.FilePath);
|
||||
|
||||
var readOnly = permissions.HasFlag(WebDavPermissions.Write) == false || permissions.HasFlag(WebDavPermissions.OwaEdit) == false;
|
||||
|
||||
var cFileInfo = new CheckFileInfo
|
||||
{
|
||||
BaseFileName = resource.DisplayName.Split(new []{'/'},StringSplitOptions.RemoveEmptyEntries).LastOrDefault(),
|
||||
BaseFileName = resource == null ? token.FilePath.Split('/').Last() : resource.DisplayName.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries).LastOrDefault(),
|
||||
OwnerId = WspContext.User.Login,
|
||||
Size = resource.ContentLength,
|
||||
Size = resource == null ? 0 : resource.ContentLength,
|
||||
Version = DateTime.Now.ToString("s"),
|
||||
SupportsCoauth = true,
|
||||
SupportsCobalt = true,
|
||||
|
@ -53,17 +58,34 @@ namespace WebsitePanel.WebDav.Core.Owa
|
|||
SupportsUpdate = true,
|
||||
UserCanWrite = !readOnly,
|
||||
ReadOnly = readOnly,
|
||||
RestrictedWebViewOnly = false
|
||||
RestrictedWebViewOnly = false,
|
||||
CloseButtonClosesWindow = true
|
||||
};
|
||||
|
||||
if (resource != null)
|
||||
{
|
||||
cFileInfo.ClientUrl = _webDavManager.GetFileUrl(token.FilePath);
|
||||
}
|
||||
|
||||
return cFileInfo;
|
||||
}
|
||||
|
||||
public FileResult GetFile(string path)
|
||||
public byte[] GetFileBytes(int accessTokenId)
|
||||
{
|
||||
var fileBytes = _webDavManager.GetFileBytes(path);
|
||||
var token = _tokenManager.GetToken(accessTokenId);
|
||||
|
||||
return new FileContentResult(fileBytes, MediaTypeNames.Application.Octet);
|
||||
if (_webDavManager.FileExist(token.FilePath))
|
||||
{
|
||||
return _webDavManager.GetFileBytes(token.FilePath);
|
||||
}
|
||||
|
||||
var cobaltFile = _fileManager.Get(token.FilePath) ?? _fileManager.Create(accessTokenId);
|
||||
|
||||
var stream = new MemoryStream();
|
||||
|
||||
new GenericFda(cobaltFile.CobaltEndpoint, null).GetContentStream().CopyTo(stream);
|
||||
|
||||
return stream.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -35,6 +35,10 @@ namespace WebsitePanel.WebDavPortal
|
|||
"~/Scripts/appScripts/wsp.js"
|
||||
));
|
||||
|
||||
bundles.Add(new ScriptBundle("~/bundles/appScripts-webdav").Include(
|
||||
"~/Scripts/appScripts/wsp-webdav.js"
|
||||
));
|
||||
|
||||
bundles.Add(new ScriptBundle("~/bundles/bigIconsScripts").Include(
|
||||
"~/Scripts/appScripts/recalculateResourseHeight.js"
|
||||
));
|
||||
|
|
|
@ -46,6 +46,20 @@ namespace WebsitePanel.WebDavPortal
|
|||
|
||||
#region Enterprise storage
|
||||
|
||||
routes.MapRoute(
|
||||
name: FileSystemRouteNames.ItemExist,
|
||||
url: "storage/item-exist/{org}/{*pathPart}",
|
||||
defaults:
|
||||
new { controller = "FileSystem", action = "ItemExist", pathPart = UrlParameter.Optional }
|
||||
);
|
||||
|
||||
routes.MapRoute(
|
||||
name: FileSystemRouteNames.NewWebDavItem,
|
||||
url: "storage/new/{org}/{*pathPart}",
|
||||
defaults:
|
||||
new { controller = "FileSystem", action = "NewWebDavItem", pathPart = UrlParameter.Optional }
|
||||
);
|
||||
|
||||
routes.MapRoute(
|
||||
name: FileSystemRouteNames.SearchFiles,
|
||||
url: "storage/search/{org}/{*pathPart}",
|
||||
|
|
|
@ -12,6 +12,9 @@ namespace WebsitePanel.WebDavPortal.UI.Routes
|
|||
public const string ShowContentDetails = "ShowContentDetailsRoute";
|
||||
public const string ShowOfficeOnlinePath_ = "ShowOfficeOnlineRoute";
|
||||
public const string ViewOfficeOnline = "ViewOfficeOnlineRoute";
|
||||
public const string NewFileOfficeOnline = "NewFileOfficeOnlineRoute";
|
||||
public const string NewWebDavItem = "NewWebDavItemRoute";
|
||||
public const string ItemExist = "ItemExistRoute";
|
||||
public const string EditOfficeOnline = "EditOfficeOnlineRoute";
|
||||
|
||||
public const string ShowAdditionalContent = "ShowAdditionalContentRoute";
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
namespace WebsitePanel.WebDavPortal.Constants
|
||||
{
|
||||
public class Formtas
|
||||
{
|
||||
public const string DateFormatWithTime = "MM/dd/yyyy hh:mm tt";
|
||||
}
|
||||
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -102,6 +102,7 @@ tr.selected-file {
|
|||
#summary.summary {
|
||||
font-size: 11px;
|
||||
color: rgb(152, 152, 152);
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.drag-and-drop-area input {
|
||||
|
@ -251,17 +252,22 @@ tr.selected-file {
|
|||
|
||||
.file-actions-menu .file-deletion {
|
||||
display: none;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.file-actions-menu .file-upload {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.create-new-item {
|
||||
margin-top: -2px;
|
||||
}
|
||||
|
||||
#message-area {
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
#processDialog .dialog-text {
|
||||
#processDialog .dialog-text, .container .dialog-text{
|
||||
display: inline-block;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
@ -270,6 +276,18 @@ tr.selected-file {
|
|||
width: 200px;
|
||||
}
|
||||
|
||||
.dataTables_processing {
|
||||
width: 185px !important;
|
||||
margin: 0 !important;
|
||||
padding: 0 !important;
|
||||
left: 43% !important;
|
||||
background: initial !important;
|
||||
background-color: #FFFFFF !important;
|
||||
border: 1px solid #CDCDCD;
|
||||
height: 44px !important;
|
||||
z-index: 30;
|
||||
}
|
||||
|
||||
.breadcrumb-wsp {
|
||||
display: inline-block;
|
||||
padding-top: 5px;
|
||||
|
@ -336,6 +354,15 @@ tr.selected-file {
|
|||
top: 20%;
|
||||
}
|
||||
|
||||
|
||||
.small-processing {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#filenameForm input {
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
/* Theme Mods */
|
||||
|
||||
input,div{border-radius:0px!important;}
|
||||
|
|
|
@ -54,22 +54,24 @@ namespace WebsitePanel.WebDavPortal.Controllers.Api
|
|||
{
|
||||
var token = _tokenManager.GetToken(accessTokenId);
|
||||
|
||||
var fileInfo = _wopiServer.GetCheckFileInfo(token.FilePath);
|
||||
var fileInfo = _wopiServer.GetCheckFileInfo(token);
|
||||
|
||||
var urlPart = Url.Route(FileSystemRouteNames.ShowContentPath, new { org = WspContext.User.OrganizationId, pathPart = token.FilePath });
|
||||
if (fileInfo.Size <= 1)
|
||||
{
|
||||
return fileInfo;
|
||||
}
|
||||
|
||||
var urlPart = Url.Route(FileSystemRouteNames.ShowContentPath, new {org = WspContext.User.OrganizationId, pathPart = token.FilePath});
|
||||
var url = new Uri(Request.RequestUri, urlPart).ToString();
|
||||
|
||||
fileInfo.DownloadUrl = url;
|
||||
fileInfo.ClientUrl = _webDavManager.GetFileUrl(token.FilePath);
|
||||
|
||||
return fileInfo;
|
||||
}
|
||||
|
||||
public HttpResponseMessage GetFile(int accessTokenId)
|
||||
{
|
||||
var token = _tokenManager.GetToken(accessTokenId);
|
||||
|
||||
var bytes = _webDavManager.GetFileBytes(token.FilePath);
|
||||
var bytes = _wopiServer.GetFileBytes(accessTokenId);
|
||||
|
||||
var result = new HttpResponseMessage(HttpStatusCode.OK);
|
||||
|
||||
|
|
|
@ -303,6 +303,36 @@ namespace WebsitePanel.WebDavPortal.Controllers
|
|||
return Json(model);
|
||||
}
|
||||
|
||||
public ActionResult NewWebDavItem(string org, string pathPart)
|
||||
{
|
||||
var permissions = _webDavAuthorizationService.GetPermissions(WspContext.User, pathPart);
|
||||
|
||||
var owaOpener = WebDavAppConfigManager.Instance.OfficeOnline.FirstOrDefault(x => x.Extension == Path.GetExtension(pathPart));
|
||||
|
||||
if (permissions.HasFlag(WebDavPermissions.Write) == false || (owaOpener != null && permissions.HasFlag(WebDavPermissions.OwaEdit) == false))
|
||||
{
|
||||
return new RedirectToRouteResult(FileSystemRouteNames.ShowContentPath, null);
|
||||
}
|
||||
|
||||
if (owaOpener != null)
|
||||
{
|
||||
return ShowOfficeDocument(org, pathPart, owaOpener.OwaNewFileView);
|
||||
}
|
||||
|
||||
return new RedirectToRouteResult(FileSystemRouteNames.ShowContentPath, null);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public JsonResult ItemExist(string org, string pathPart, string newItemName)
|
||||
{
|
||||
var exist = _webdavManager.FileExist(string.Format("{0}/{1}", pathPart.TrimEnd('/'), newItemName.Trim('/')));
|
||||
|
||||
return new JsonResult()
|
||||
{
|
||||
Data = !exist
|
||||
};
|
||||
}
|
||||
|
||||
#region Owa Actions
|
||||
|
||||
public ActionResult ShowOfficeDocument(string org, string pathPart, string owaOpenerUri)
|
||||
|
@ -345,6 +375,7 @@ namespace WebsitePanel.WebDavPortal.Controllers
|
|||
|
||||
return ShowOfficeDocument(org, pathPart, owaOpener.OwaEditor);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private void FillContentModel(IEnumerable<ResourceTableItemModel> items, string organizationId)
|
||||
|
@ -352,7 +383,8 @@ namespace WebsitePanel.WebDavPortal.Controllers
|
|||
foreach (var item in items)
|
||||
{
|
||||
var opener = _openerManager[Path.GetExtension(item.DisplayName)];
|
||||
var pathPart = item.Href.AbsolutePath.Replace("/" + WspContext.User.OrganizationId, "").TrimStart('/');
|
||||
//var pathPart = item.Href.ToString().Replace("/" + WspContext.User.OrganizationId, "").TrimStart('/');
|
||||
var pathPart = item.Href.ToStringPath().Replace("/" + WspContext.User.OrganizationId, "").TrimStart('/');
|
||||
|
||||
switch (opener)
|
||||
{
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
using System;
|
||||
|
||||
namespace WebsitePanel.WebDavPortal.Helpers
|
||||
{
|
||||
public class ViewDataHelper
|
||||
{
|
||||
public static string BytesToSize(long bytes)
|
||||
{
|
||||
if (bytes == 0)
|
||||
{
|
||||
return string.Format("0 {0}", Resources.UI.Byte);
|
||||
}
|
||||
|
||||
var k = 1024;
|
||||
|
||||
var sizes = new[]
|
||||
{
|
||||
Resources.UI.Bytes,
|
||||
Resources.UI.KilobyteShort,
|
||||
Resources.UI.MegabyteShort,
|
||||
Resources.UI.GigabyteShort,
|
||||
Resources.UI.TerabyteShort,
|
||||
Resources.UI.PetabyteShort,
|
||||
Resources.UI.ExabyteShort
|
||||
};
|
||||
|
||||
var i = (int) Math.Floor(Math.Log(bytes)/Math.Log(k));
|
||||
return string.Format("{0} {1}", Math.Round(bytes/Math.Pow(k, i), 3), sizes[i]);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -7,6 +7,7 @@ using AutoMapper;
|
|||
using WebsitePanel.WebDav.Core.Client;
|
||||
using WebsitePanel.WebDav.Core.Config;
|
||||
using WebsitePanel.WebDav.Core.Extensions;
|
||||
using WebsitePanel.WebDavPortal.Constants;
|
||||
using WebsitePanel.WebDavPortal.FileOperations;
|
||||
using WebsitePanel.WebDavPortal.Models.FileSystem;
|
||||
|
||||
|
@ -43,7 +44,7 @@ namespace WebsitePanel.WebDavPortal.Mapping.Profiles.Webdav
|
|||
.ForMember(ti => ti.IconHref, x => x.MapFrom(hi => hi.ItemType == ItemType.Folder ? WebDavAppConfigManager.Instance.FileIcons.FolderPath.Trim('~') : WebDavAppConfigManager.Instance.FileIcons[Path.GetExtension(hi.DisplayName.Trim('/'))].Trim('~')))
|
||||
.ForMember(ti => ti.IsTargetBlank, x => x.MapFrom(hi => openerManager.GetIsTargetBlank(hi)))
|
||||
.ForMember(ti => ti.LastModified, x => x.MapFrom(hi => hi.LastModified))
|
||||
.ForMember(ti => ti.LastModifiedFormated, x => x.MapFrom(hi => hi.LastModified == DateTime.MinValue ? "--" : (new WebDavResource(null, hi)).LastModified.ToString("dd/MM/yyyy hh:mm tt")))
|
||||
.ForMember(ti => ti.LastModifiedFormated, x => x.MapFrom(hi => hi.LastModified == DateTime.MinValue ? "--" : (new WebDavResource(null, hi)).LastModified.ToString(Formtas.DateFormatWithTime)))
|
||||
|
||||
.ForMember(ti => ti.Summary, x => x.MapFrom(hi => hi.Summary))
|
||||
.ForMember(ti => ti.IsRoot, x => x.MapFrom(hi => hi.IsRootItem))
|
||||
|
|
|
@ -69,6 +69,24 @@ namespace WebsitePanel.WebDavPortal.Resources {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Byte.
|
||||
/// </summary>
|
||||
public static string Byte {
|
||||
get {
|
||||
return ResourceManager.GetString("Byte", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Bytes.
|
||||
/// </summary>
|
||||
public static string Bytes {
|
||||
get {
|
||||
return ResourceManager.GetString("Bytes", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Cancel.
|
||||
/// </summary>
|
||||
|
@ -105,6 +123,15 @@ namespace WebsitePanel.WebDavPortal.Resources {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Create.
|
||||
/// </summary>
|
||||
public static string Create {
|
||||
get {
|
||||
return ResourceManager.GetString("Create", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Delete.
|
||||
/// </summary>
|
||||
|
@ -141,6 +168,15 @@ namespace WebsitePanel.WebDavPortal.Resources {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Please enter file name.
|
||||
/// </summary>
|
||||
public static string EnterFileName {
|
||||
get {
|
||||
return ResourceManager.GetString("EnterFileName", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Error.
|
||||
/// </summary>
|
||||
|
@ -150,6 +186,24 @@ namespace WebsitePanel.WebDavPortal.Resources {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to EB.
|
||||
/// </summary>
|
||||
public static string ExabyteShort {
|
||||
get {
|
||||
return ResourceManager.GetString("ExabyteShort", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Excel workbook.
|
||||
/// </summary>
|
||||
public static string ExcelWorkbook {
|
||||
get {
|
||||
return ResourceManager.GetString("ExcelWorkbook", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to File.
|
||||
/// </summary>
|
||||
|
@ -159,6 +213,15 @@ namespace WebsitePanel.WebDavPortal.Resources {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to File name.
|
||||
/// </summary>
|
||||
public static string FileName {
|
||||
get {
|
||||
return ResourceManager.GetString("FileName", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to File Upload.
|
||||
/// </summary>
|
||||
|
@ -186,6 +249,15 @@ namespace WebsitePanel.WebDavPortal.Resources {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to File already exist.
|
||||
/// </summary>
|
||||
public static string ItemExist {
|
||||
get {
|
||||
return ResourceManager.GetString("ItemExist", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to {0} items was removed..
|
||||
/// </summary>
|
||||
|
@ -195,6 +267,24 @@ namespace WebsitePanel.WebDavPortal.Resources {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to KB.
|
||||
/// </summary>
|
||||
public static string KilobyteShort {
|
||||
get {
|
||||
return ResourceManager.GetString("KilobyteShort", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to MB.
|
||||
/// </summary>
|
||||
public static string MegabyteShort {
|
||||
get {
|
||||
return ResourceManager.GetString("MegabyteShort", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Modified.
|
||||
/// </summary>
|
||||
|
@ -240,6 +330,15 @@ namespace WebsitePanel.WebDavPortal.Resources {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to PB.
|
||||
/// </summary>
|
||||
public static string PetabyteShort {
|
||||
get {
|
||||
return ResourceManager.GetString("PetabyteShort", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Please wait....
|
||||
/// </summary>
|
||||
|
@ -249,6 +348,15 @@ namespace WebsitePanel.WebDavPortal.Resources {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Powerpoint presentation.
|
||||
/// </summary>
|
||||
public static string PowerPointPresentation {
|
||||
get {
|
||||
return ResourceManager.GetString("PowerPointPresentation", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Processing.
|
||||
/// </summary>
|
||||
|
@ -321,6 +429,15 @@ namespace WebsitePanel.WebDavPortal.Resources {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to TB.
|
||||
/// </summary>
|
||||
public static string TerabyteShort {
|
||||
get {
|
||||
return ResourceManager.GetString("TerabyteShort", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Type.
|
||||
/// </summary>
|
||||
|
@ -339,6 +456,15 @@ namespace WebsitePanel.WebDavPortal.Resources {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Word document.
|
||||
/// </summary>
|
||||
public static string WordDocument {
|
||||
get {
|
||||
return ResourceManager.GetString("WordDocument", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Yes.
|
||||
/// </summary>
|
||||
|
|
|
@ -120,6 +120,12 @@
|
|||
<data name="Actions" xml:space="preserve">
|
||||
<value>Actions</value>
|
||||
</data>
|
||||
<data name="Byte" xml:space="preserve">
|
||||
<value>Byte</value>
|
||||
</data>
|
||||
<data name="Bytes" xml:space="preserve">
|
||||
<value>Bytes</value>
|
||||
</data>
|
||||
<data name="Cancel" xml:space="preserve">
|
||||
<value>Cancel</value>
|
||||
</data>
|
||||
|
@ -132,6 +138,9 @@
|
|||
<data name="Confirm" xml:space="preserve">
|
||||
<value>Confirm</value>
|
||||
</data>
|
||||
<data name="Create" xml:space="preserve">
|
||||
<value>Create</value>
|
||||
</data>
|
||||
<data name="Delete" xml:space="preserve">
|
||||
<value>Delete</value>
|
||||
</data>
|
||||
|
@ -144,12 +153,24 @@
|
|||
<data name="DialogsContentConfrimFileDeletion" xml:space="preserve">
|
||||
<value>Are you sure you want to delete {0} item(s)?</value>
|
||||
</data>
|
||||
<data name="EnterFileName" xml:space="preserve">
|
||||
<value>Please enter file name</value>
|
||||
</data>
|
||||
<data name="Error" xml:space="preserve">
|
||||
<value>Error</value>
|
||||
</data>
|
||||
<data name="ExabyteShort" xml:space="preserve">
|
||||
<value>EB</value>
|
||||
</data>
|
||||
<data name="ExcelWorkbook" xml:space="preserve">
|
||||
<value>Excel workbook</value>
|
||||
</data>
|
||||
<data name="File" xml:space="preserve">
|
||||
<value>File</value>
|
||||
</data>
|
||||
<data name="FileName" xml:space="preserve">
|
||||
<value>File name</value>
|
||||
</data>
|
||||
<data name="FileUpload" xml:space="preserve">
|
||||
<value>File Upload</value>
|
||||
</data>
|
||||
|
@ -159,9 +180,18 @@
|
|||
<data name="Info" xml:space="preserve">
|
||||
<value>Info</value>
|
||||
</data>
|
||||
<data name="ItemExist" xml:space="preserve">
|
||||
<value>File already exist</value>
|
||||
</data>
|
||||
<data name="ItemsWasRemovedFormat" xml:space="preserve">
|
||||
<value>{0} items was removed.</value>
|
||||
</data>
|
||||
<data name="KilobyteShort" xml:space="preserve">
|
||||
<value>KB</value>
|
||||
</data>
|
||||
<data name="MegabyteShort" xml:space="preserve">
|
||||
<value>MB</value>
|
||||
</data>
|
||||
<data name="Modified" xml:space="preserve">
|
||||
<value>Modified</value>
|
||||
</data>
|
||||
|
@ -177,9 +207,15 @@
|
|||
<data name="OrDragAndDropFilesHere" xml:space="preserve">
|
||||
<value>or drag and drop files here.</value>
|
||||
</data>
|
||||
<data name="PetabyteShort" xml:space="preserve">
|
||||
<value>PB</value>
|
||||
</data>
|
||||
<data name="PleaseWaitWithDots" xml:space="preserve">
|
||||
<value>Please wait...</value>
|
||||
</data>
|
||||
<data name="PowerPointPresentation" xml:space="preserve">
|
||||
<value>Powerpoint presentation</value>
|
||||
</data>
|
||||
<data name="Processing" xml:space="preserve">
|
||||
<value>Processing</value>
|
||||
</data>
|
||||
|
@ -204,12 +240,18 @@
|
|||
<data name="Table" xml:space="preserve">
|
||||
<value>Table</value>
|
||||
</data>
|
||||
<data name="TerabyteShort" xml:space="preserve">
|
||||
<value>TB</value>
|
||||
</data>
|
||||
<data name="Type" xml:space="preserve">
|
||||
<value>Type</value>
|
||||
</data>
|
||||
<data name="Upload" xml:space="preserve">
|
||||
<value>Upload</value>
|
||||
</data>
|
||||
<data name="WordDocument" xml:space="preserve">
|
||||
<value>Word document</value>
|
||||
</data>
|
||||
<data name="Yes" xml:space="preserve">
|
||||
<value>Yes</value>
|
||||
</data>
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
function WspDialogs() {
|
||||
this.settings = { dialogId: "#confirm-dialog", processDialogId: "#processDialog" };
|
||||
this.settings = {
|
||||
dialogId: "#confirm-dialog",
|
||||
processDialogId: "#processDialog",
|
||||
inlineProcessDialog: '.glyphicon-refresh'
|
||||
};
|
||||
}
|
||||
|
||||
WspDialogs.prototype =
|
||||
|
@ -36,6 +40,14 @@ WspDialogs.prototype =
|
|||
|
||||
hideProcessDialog: function() {
|
||||
$(this.settings.processDialogId).modal('hide');
|
||||
}
|
||||
},
|
||||
|
||||
showInlineProcessing: function(itemId) {
|
||||
$(itemId).parent().find(this.settings.inlineProcessDialog).show();
|
||||
},
|
||||
|
||||
hideInlineProcessing: function (itemId) {
|
||||
$(itemId).parent().find(this.settings.inlineProcessDialog).hide();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -2,8 +2,17 @@
|
|||
this.settings = {
|
||||
deletionBlockSelector: ".file-actions-menu .file-deletion",
|
||||
deletionUrl: "storage/files-group-action/delete",
|
||||
fileExistUrl: "storage/fileExist",
|
||||
textDateModified: "Date modified",
|
||||
textSize: "Size"
|
||||
textSize: "Size",
|
||||
textItemExist: "File already exists",
|
||||
textItemExistFunc: function() {
|
||||
return textItemExist;
|
||||
} ,
|
||||
createNewItemDialogId: "#createNewItemDialog",
|
||||
createNewItemButtonId: "#create-button",
|
||||
createNewItemTitleId: '#create-dalog-label',
|
||||
processingDialogDom: '<div><img src="/Content/Images/indicator_medium.gif"><h4 class="dialog-text">Please wait...</h4></div>'
|
||||
};
|
||||
this.itemsTable = null;
|
||||
this.searchTable = null;
|
||||
|
@ -88,7 +97,7 @@ WspFileBrowser.prototype = {
|
|||
initDataTable: function (tableId, ajaxUrl) {
|
||||
this.itemsTable = $(tableId).dataTable({
|
||||
"ajax": ajaxUrl,
|
||||
"processing": false,
|
||||
"processing": true,
|
||||
"serverSide": true,
|
||||
"dom": 'rtlp',
|
||||
"columnDefs": [
|
||||
|
@ -123,14 +132,8 @@ WspFileBrowser.prototype = {
|
|||
"createdRow": function(row, data, index) {
|
||||
$(row).addClass('element-container');
|
||||
},
|
||||
"fnPreDrawCallback": function () {
|
||||
// gather info to compose a message
|
||||
wsp.dialogs.showProcessDialog();
|
||||
return true;
|
||||
},
|
||||
"fnDrawCallback": function () {
|
||||
// in case your overlay needs to be put away automatically you can put it here
|
||||
wsp.dialogs.hideProcessDialog();
|
||||
"oLanguage": {
|
||||
"sProcessing": this.settings.processingDialogDom
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -162,7 +165,7 @@ WspFileBrowser.prototype = {
|
|||
|
||||
this.searchTable = $(tableId).dataTable({
|
||||
"ajax": ajaxUrl,
|
||||
"processing": false,
|
||||
"processing": true,
|
||||
"serverSide": true,
|
||||
"oSearch": { "sSearch": initSearch },
|
||||
"dom": 'rtlp',
|
||||
|
@ -199,14 +202,8 @@ WspFileBrowser.prototype = {
|
|||
"createdRow": function (row, data, index) {
|
||||
$(row).addClass('element-container');
|
||||
},
|
||||
"fnPreDrawCallback": function () {
|
||||
// gather info to compose a message
|
||||
wsp.dialogs.showProcessDialog();
|
||||
return true;
|
||||
},
|
||||
"fnDrawCallback": function () {
|
||||
// in case your overlay needs to be put away automatically you can put it here
|
||||
wsp.dialogs.hideProcessDialog();
|
||||
"oLanguage": {
|
||||
"sProcessing": this.settings.processingDialogDom
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -272,6 +269,40 @@ WspFileBrowser.prototype = {
|
|||
var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
||||
var i = Math.floor(Math.log(bytes) / Math.log(k));
|
||||
return (bytes / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
|
||||
},
|
||||
|
||||
showCreateNewItemDialog: function (extension, target, title) {
|
||||
$(this.settings.createNewItemButtonId).data('extension', extension);
|
||||
$(this.settings.createNewItemButtonId).data('target', target);
|
||||
|
||||
$(this.settings.createNewItemDialogId + " input").val("");
|
||||
|
||||
$(this.settings.createNewItemTitleId).text($(this.settings.createNewItemTitleId).data('title') + " " + title);
|
||||
|
||||
$(this.settings.createNewItemDialogId).modal();
|
||||
},
|
||||
|
||||
hideCreateNewItemDialog: function () {
|
||||
$(this.settings.createNewItemDialogId).modal('hide');
|
||||
},
|
||||
|
||||
uniqueFileNameFieldRule: function(fieldId) {
|
||||
|
||||
return {
|
||||
url: this.settings.fileExistUrl,
|
||||
type: "post",
|
||||
data: {
|
||||
newItemName: function() {
|
||||
return $(fieldId).val() + $(wsp.fileBrowser.settings.createNewItemButtonId).data('extension');
|
||||
}
|
||||
},
|
||||
beforeSend: function(response) {
|
||||
wsp.dialogs.showInlineProcessing(fieldId);
|
||||
},
|
||||
complete: function() {
|
||||
wsp.dialogs.hideInlineProcessing(fieldId);
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -0,0 +1,124 @@
|
|||
//Toggle file select + Ctrl multiselect
|
||||
$(document).on('click', '.element-container', function (e) {
|
||||
if (e.ctrlKey) {
|
||||
$(this).toggleClass("selected-file");
|
||||
} else {
|
||||
|
||||
wsp.fileBrowser.clearAllSelectedItems();
|
||||
|
||||
wsp.fileBrowser.selectItem(this);
|
||||
}
|
||||
|
||||
wsp.fileBrowser.refreshDeletionBlock();
|
||||
});
|
||||
|
||||
$(document).on('touchstart', '.element-container', function (e) {
|
||||
var now = new Date().getTime();
|
||||
var lastTouch = $(this).data('lastTouch') || now + 1;
|
||||
var delta = now - lastTouch;
|
||||
|
||||
if (delta < 300 && delta > 0) {
|
||||
wsp.fileBrowser.openItem(this);
|
||||
$(this).data('lastTouch', 0);
|
||||
}
|
||||
|
||||
$(this).data('lastTouch', now);
|
||||
});
|
||||
|
||||
//Double click file open
|
||||
$(document).on('dblclick', '.element-container', function (e) {
|
||||
wsp.fileBrowser.openItem(this);
|
||||
|
||||
var links = $(this).find('.file-link');
|
||||
|
||||
if (links.length != 0 && $(links[0]).hasClass('processing-dialog')) {
|
||||
wsp.dialogs.showProcessDialog();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//Delete button click
|
||||
$(document).on('click', '.file-deletion #delete-button', function (e) {
|
||||
var dialogId = $(this).data('target');
|
||||
var buttonText = $(this).data('target-positive-button-text');
|
||||
var content = $(this).data('target-content');
|
||||
var title = $(this).data('target-title-text');
|
||||
|
||||
content = jQuery.validator.format(content, wsp.fileBrowser.getSelectedItemsCount());
|
||||
|
||||
wsp.dialogs.showConfirmDialog(title, content, buttonText, wsp.fileBrowser.deleteSelectedItems, dialogId);
|
||||
});
|
||||
|
||||
|
||||
$(document).click(function (event) {
|
||||
if (!$(event.target).closest('.element-container, .prevent-deselect').length) {
|
||||
wsp.fileBrowser.clearAllSelectedItems();
|
||||
wsp.fileBrowser.refreshDeletionBlock();
|
||||
}
|
||||
});
|
||||
|
||||
$('#drag-and-drop-area').click(function (e) {
|
||||
$('#file-input').click();
|
||||
});
|
||||
|
||||
$('#drag-and-drop-area #file-input').click(function (e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
|
||||
|
||||
|
||||
$("#create-button").click(function (e) {
|
||||
|
||||
if ($('#filenameForm').valid()) {
|
||||
|
||||
var fileName = $('#createNewItemDialog #filename').val() + $(this).data('extension');
|
||||
|
||||
$(this).attr('href', $(this).data('href') + '/' + fileName);
|
||||
|
||||
$(this).attr('target', $(this).data('target'));
|
||||
|
||||
wsp.fileBrowser.hideCreateNewItemDialog();
|
||||
//;
|
||||
} else {
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
$('#filenameForm').validate({
|
||||
onkeyup: false,
|
||||
onclick: false,
|
||||
async: false,
|
||||
rules: {
|
||||
filename: {
|
||||
required: true,
|
||||
synchronousRemote: wsp.fileBrowser.uniqueFileNameFieldRule("#filename")
|
||||
}
|
||||
},
|
||||
messages: {
|
||||
filename: {
|
||||
synchronousRemote: wsp.fileBrowser.settings.textItemExist
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$('#filename').keydown(function (event) {
|
||||
if (event.keyCode == 13) {
|
||||
event.preventDefault();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
|
||||
$(".create-new-item li a").click(function () {
|
||||
|
||||
$("#filenameForm").clearValidation();
|
||||
|
||||
wsp.fileBrowser.showCreateNewItemDialog($(this).data('extension'), $(this).data('target'), $(this).text());
|
||||
|
||||
$("#filename").focus();
|
||||
});
|
|
@ -10,72 +10,84 @@ $(document).on('click', '.processing-dialog', function (e) {
|
|||
});
|
||||
|
||||
|
||||
//Toggle file select + Ctrl multiselect
|
||||
$(document).on('click', '.element-container', function (e) {
|
||||
if (e.ctrlKey) {
|
||||
$(this).toggleClass("selected-file");
|
||||
} else {
|
||||
$(document).ready(function() {
|
||||
//bootstrap jquery validate styles fix
|
||||
$.validator.setDefaults({
|
||||
highlight: function(element) {
|
||||
$(element).closest('.form-group').addClass('has-error');
|
||||
},
|
||||
unhighlight: function(element) {
|
||||
$(element).closest('.form-group').removeClass('has-error');
|
||||
},
|
||||
errorElement: 'span',
|
||||
errorClass: 'help-block',
|
||||
errorPlacement: function(error, element) {
|
||||
if (element.parent('.input-group').length) {
|
||||
error.insertAfter(element.parent());
|
||||
} else {
|
||||
error.insertAfter(element);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
wsp.fileBrowser.clearAllSelectedItems();
|
||||
$.validator.addMethod("synchronousRemote", function(value, element, param) {
|
||||
if (this.optional(element)) {
|
||||
return "dependency-mismatch";
|
||||
}
|
||||
|
||||
wsp.fileBrowser.selectItem(this);
|
||||
}
|
||||
var previous = this.previousValue(element);
|
||||
if (!this.settings.messages[element.name]) {
|
||||
this.settings.messages[element.name] = {};
|
||||
}
|
||||
previous.originalMessage = this.settings.messages[element.name].remote;
|
||||
this.settings.messages[element.name].remote = previous.message;
|
||||
|
||||
wsp.fileBrowser.refreshDeletionBlock();
|
||||
});
|
||||
param = typeof param === "string" && { url: param } || param;
|
||||
|
||||
$(document).on('touchstart', '.element-container', function(e) {
|
||||
var now = new Date().getTime();
|
||||
var lastTouch = $(this).data('lastTouch') || now + 1;
|
||||
var delta = now - lastTouch;
|
||||
if (previous.old === value) {
|
||||
return previous.valid;
|
||||
}
|
||||
|
||||
if (delta < 300 && delta > 0) {
|
||||
wsp.fileBrowser.openItem(this);
|
||||
$(this).data('lastTouch', 0);
|
||||
}
|
||||
|
||||
$(this).data('lastTouch', now);
|
||||
});
|
||||
|
||||
//Double click file open
|
||||
$(document).on('dblclick', '.element-container', function (e) {
|
||||
wsp.fileBrowser.openItem(this);
|
||||
|
||||
var links = $(this).find('.file-link');
|
||||
|
||||
if (links.length != 0 && $(links[0]).hasClass('processing-dialog')) {
|
||||
wsp.dialogs.showProcessDialog();
|
||||
}
|
||||
previous.old = value;
|
||||
var validator = this;
|
||||
this.startRequest(element);
|
||||
var data = {};
|
||||
data[element.name] = value;
|
||||
var valid = "pending";
|
||||
$.ajax($.extend(true, {
|
||||
url: param,
|
||||
async: false,
|
||||
mode: "abort",
|
||||
port: "validate" + element.name,
|
||||
dataType: "json",
|
||||
data: data,
|
||||
success: function(response) {
|
||||
validator.settings.messages[element.name].remote = previous.originalMessage;
|
||||
valid = response === true || response === "true";
|
||||
if (valid) {
|
||||
var submitted = validator.formSubmitted;
|
||||
validator.prepareElement(element);
|
||||
validator.formSubmitted = submitted;
|
||||
validator.successList.push(element);
|
||||
delete validator.invalid[element.name];
|
||||
validator.showErrors();
|
||||
} else {
|
||||
var errors = {};
|
||||
var message = response || validator.defaultMessage(element, "remote");
|
||||
errors[element.name] = previous.message = $.isFunction(message) ? message(value) : message;
|
||||
validator.invalid[element.name] = true;
|
||||
validator.showErrors(errors);
|
||||
}
|
||||
previous.valid = valid;
|
||||
validator.stopRequest(element, valid);
|
||||
}
|
||||
}, param));
|
||||
return valid;
|
||||
}, "Please fix this field.");
|
||||
});
|
||||
|
||||
|
||||
//Delete button click
|
||||
$(document).on('click', '.file-deletion #delete-button', function (e) {
|
||||
var dialogId = $(this).data('target');
|
||||
var buttonText = $(this).data('target-positive-button-text');
|
||||
var content = $(this).data('target-content');
|
||||
var title = $(this).data('target-title-text');
|
||||
|
||||
content = jQuery.validator.format(content, wsp.fileBrowser.getSelectedItemsCount());
|
||||
|
||||
wsp.dialogs.showConfirmDialog(title, content, buttonText, wsp.fileBrowser.deleteSelectedItems, dialogId);
|
||||
});
|
||||
|
||||
|
||||
$(document).click(function(event) {
|
||||
if (!$(event.target).closest('.element-container, .prevent-deselect').length) {
|
||||
wsp.fileBrowser.clearAllSelectedItems();
|
||||
wsp.fileBrowser.refreshDeletionBlock();
|
||||
}
|
||||
});
|
||||
|
||||
$('#drag-and-drop-area').click(function (e) {
|
||||
$('#file-input').click();
|
||||
});
|
||||
|
||||
$('#drag-and-drop-area #file-input').click(function (e) {
|
||||
e.stopPropagation();
|
||||
});
|
||||
$.fn.clearValidation = function () { var v = $(this).validate(); $('[name]', this).each(function () { v.successList.push(this); v.showErrors(); }); v.resetForm(); v.reset(); $(this).find('.form-group').removeClass('has-error'); };
|
||||
|
||||
|
||||
function isMobileDevice() {
|
||||
|
|
|
@ -25,9 +25,15 @@ else
|
|||
|
||||
|
||||
@section scripts{
|
||||
|
||||
<script>
|
||||
wsp.fileBrowser.setSettings({ deletionUrl: "@Url.RouteUrl(FileSystemRouteNames.DeleteFiles)" });
|
||||
wsp.fileBrowser.setSettings({
|
||||
deletionUrl: "@Url.RouteUrl(FileSystemRouteNames.DeleteFiles)",
|
||||
fileExistUrl: "@Url.RouteUrl(FileSystemRouteNames.ItemExist)",
|
||||
textItemExist: "@UI.ItemExist." });
|
||||
</script>
|
||||
|
||||
@Scripts.Render("~/bundles/appScripts-webdav")
|
||||
|
||||
@if (Model.UserSettings.WebDavViewType == FolderViewTypes.BigIcons)
|
||||
{
|
||||
|
@ -47,9 +53,37 @@ else
|
|||
{
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
wsp.fileBrowser.setSettings({ deletionUrl: "@Url.RouteUrl(FileSystemRouteNames.DeleteFiles)" });
|
||||
wsp.fileBrowser.initDataTable('#webdav-items-table', '@Url.RouteUrl(FileSystemRouteNames.ShowContentDetails)');
|
||||
});
|
||||
</script>
|
||||
}
|
||||
}
|
||||
|
||||
@section popups{
|
||||
<div id="createNewItemDialog" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="modal-process-dialog-title" data-backdrop="static" data-keyboard="false" aria-hidden="true" style="display: none;">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="create-dalog-label" data-title="@UI.Create">@UI.Create</h4>
|
||||
</div>
|
||||
|
||||
<div class="modal-body">
|
||||
<form id="filenameForm">
|
||||
<div class="form-group has-feedback">
|
||||
<label for="filename">@UI.FileName</label>
|
||||
<input type="text" class="form-control" id="filename" name="filename" autofocus required placeholder="@UI.EnterFileName">
|
||||
<span class="glyphicon glyphicon-refresh glyphicon-spin form-control-feedback small-processing" aria-hidden="true"></span>
|
||||
<span id="inputProcessingStatus" class="sr-only">(processing)</span>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">@UI.Cancel</button>
|
||||
<a href="@Url.RouteUrl(FileSystemRouteNames.NewWebDavItem)" data-href="@Url.RouteUrl(FileSystemRouteNames.NewWebDavItem)" id="create-button" class="btn btn-success danger">@UI.Create</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
|
@ -24,5 +24,6 @@
|
|||
wsp.fileBrowser.initSearchDataTable('#search-items-table', '@Url.RouteUrl(FileSystemRouteNames.ShowContentDetails)', '@Model.SearchValue');
|
||||
});
|
||||
</script>
|
||||
@Scripts.Render("~/bundles/appScripts-webdav")
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
@using WebsitePanel.WebDav.Core.Config
|
||||
@using WebsitePanel.WebDavPortal.FileOperations
|
||||
@using Ninject;
|
||||
@using WebsitePanel.WebDavPortal.Helpers
|
||||
@using WebsitePanel.WebDavPortal.Resources
|
||||
@using WebsitePanel.WebDavPortal.UI
|
||||
@using WebsitePanel.WebDavPortal.UI.Routes
|
||||
|
@ -63,7 +64,7 @@
|
|||
<p class="progress-text">@percent%</p>
|
||||
</div>
|
||||
</div>
|
||||
<p>@Math.Round(Convert.ToDecimal(resource.ContentLength) / 1024, 2) / @Math.Round(Convert.ToDecimal(resource.AllocatedSpace) / 1024, 2) @UI.GigabyteShort</p>
|
||||
<p>@ViewDataHelper.BytesToSize(resource.ContentLength) / @ViewDataHelper.BytesToSize(resource.AllocatedSpace)</p>
|
||||
}
|
||||
|
||||
<div class="selected-element-overlay">
|
||||
|
|
|
@ -25,7 +25,9 @@
|
|||
}
|
||||
else
|
||||
{
|
||||
<a href="@Url.RouteUrl(FileSystemRouteNames.ShowContentPath)" class="processing-dialog">@UI.SearchResults</a>
|
||||
<a href="@Url.RouteUrl(FileSystemRouteNames.ShowContentPath)" class="processing-dialog">@(elements.Any() ?elements.Last():WspContext.User.OrganizationId)</a>
|
||||
<span style="top: 2px;"> / </span>
|
||||
<span>@UI.SearchResults</span>
|
||||
}
|
||||
</div>
|
||||
|
||||
|
@ -56,6 +58,17 @@
|
|||
data-target-title-text="@UI.DeleteFileQuestion"
|
||||
data-target-content="@UI.DialogsContentConfrimFileDeletion">@UI.Delete</a>
|
||||
</div>
|
||||
<div class="dropdown create-new-item navbar-left">
|
||||
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-expanded="true">
|
||||
@UI.Create
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
|
||||
<li role="presentation"><a role="menuitem" tabindex="-1" href="#" data-extension=".docx" data-target="_blank">@UI.WordDocument</a></li>
|
||||
<li role="presentation"><a role="menuitem" tabindex="-1" href="#" data-extension=".xlsx" data-target="_blank">@UI.ExcelWorkbook</a></li>
|
||||
<li role="presentation"><a role="menuitem" tabindex="-1" href="#" data-extension=".pptx" data-target="_blank">@UI.PowerPointPresentation</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="file-upload navbar-right">
|
||||
|
@ -75,4 +88,4 @@
|
|||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
|
|
@ -85,13 +85,13 @@
|
|||
<add browser="InternetExplorer;IE" version="8" />
|
||||
<add browser="Safari" version="4" />
|
||||
</owaSupportedBrowsers>
|
||||
<officeOnline isEnabled="True" url="https://vir-owa.virtuworks.net" cobaltFileTtl="1">
|
||||
<add extension=".doc" OwaView="wv/wordviewerframe.aspx?" OwaEditor="wv/wordviewerframe.aspx?" OwaMobileView="wv/mWord.aspx?wdMobileHost=3&"/>
|
||||
<add extension=".docx" OwaView="wv/wordviewerframe.aspx?" OwaEditor="we/wordeditorframe.aspx?" OwaMobileView="wv/mWord.aspx?wdMobileHost=3&"/>
|
||||
<add extension=".xls" OwaView="x/_layouts/xlviewerinternal.aspx?" OwaEditor="x/_layouts/xlviewerinternal.aspx?edit=1&" OwaMobileView="x/_layouts/mobile/mXL.aspx?wdMobileHost=3&"/>
|
||||
<add extension=".xlsx" OwaView="x/_layouts/xlviewerinternal.aspx?" OwaEditor="x/_layouts/xlviewerinternal.aspx?edit=1&" OwaMobileView="x/_layouts/mobile/mXL.aspx?wdMobileHost=3&" />
|
||||
<add extension=".ppt" OwaView="p/PowerPointFrame.aspx?" OwaEditor="p/PowerPointFrame.aspx?" OwaMobileView="p/mPPT.aspx?wdMobileHost=3&"/>
|
||||
<add extension=".pptx" OwaView="p/PowerPointFrame.aspx?" OwaEditor="p/PowerPointFrame.aspx?PowerPointView=EditView&" OwaMobileView="p/mPPT.aspx?wdMobileHost=3&"/>
|
||||
<officeOnline isEnabled="True" url="https://vir-owa.virtuworks.net" cobaltFileTtl="1" cobaltNewFilePath="~/Content/OwaFiles/New">
|
||||
<add extension=".doc" OwaView="wv/wordviewerframe.aspx?" OwaEditor="wv/wordviewerframe.aspx?" OwaMobileView="wv/mWord.aspx?wdMobileHost=3&" OwaNewFileView="we/wordeditorframe.aspx?new=1&"/>
|
||||
<add extension=".docx" OwaView="wv/wordviewerframe.aspx?" OwaEditor="we/wordeditorframe.aspx?" OwaMobileView="wv/mWord.aspx?wdMobileHost=3&" OwaNewFileView="we/wordeditorframe.aspx?new=1&"/>
|
||||
<add extension=".xls" OwaView="x/_layouts/xlviewerinternal.aspx?" OwaEditor="x/_layouts/xlviewerinternal.aspx?edit=1&" OwaMobileView="x/_layouts/mobile/mXL.aspx?wdMobileHost=3&" OwaNewFileView="x/_layouts/xlviewerinternal.aspx?new=1&"/>
|
||||
<add extension=".xlsx" OwaView="x/_layouts/xlviewerinternal.aspx?" OwaEditor="x/_layouts/xlviewerinternal.aspx?edit=1&" OwaMobileView="x/_layouts/mobile/mXL.aspx?wdMobileHost=3&" OwaNewFileView="x/_layouts/xlviewerinternal.aspx?edit=1&"/>
|
||||
<add extension=".ppt" OwaView="p/PowerPointFrame.aspx?" OwaEditor="p/PowerPointFrame.aspx?" OwaMobileView="p/mPPT.aspx?wdMobileHost=3&" OwaNewFileView="p/PowerPointFrame.aspx?PowerPointView=EditView&New=1&"/>
|
||||
<add extension=".pptx" OwaView="p/PowerPointFrame.aspx?" OwaEditor="p/PowerPointFrame.aspx?PowerPointView=EditView&" OwaMobileView="p/mPPT.aspx?wdMobileHost=3&" OwaNewFileView="p/PowerPointFrame.aspx?PowerPointView=EditView&New=1&"/>
|
||||
</officeOnline>
|
||||
<typeOpener>
|
||||
<add extension=".jpg" mimeType="image/jpeg" isTargetBlank="true" />
|
||||
|
|
|
@ -165,6 +165,7 @@
|
|||
<Compile Include="Configurations\ActionSelectors\OwaActionSelector.cs" />
|
||||
<Compile Include="Configurations\Constraints\OrganizationRouteConstraint.cs" />
|
||||
<Compile Include="Configurations\ControllerConfigurations\OwaControllerConfiguration.cs" />
|
||||
<Compile Include="Constants\Formtas.cs" />
|
||||
<Compile Include="Controllers\AccountController.cs" />
|
||||
<Compile Include="Controllers\ErrorController.cs" />
|
||||
<Compile Include="Controllers\FileSystemController.cs" />
|
||||
|
@ -183,6 +184,7 @@
|
|||
<DependentUpon>Global.asax</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Helpers\DataTableHelper.cs" />
|
||||
<Compile Include="Helpers\ViewDataHelper.cs" />
|
||||
<Compile Include="HttpHandlers\AccessTokenHandler.cs" />
|
||||
<Compile Include="HttpHandlers\FileTransferRequestHandler.cs" />
|
||||
<Compile Include="Mapping\AutoMapperPortalConfiguration.cs" />
|
||||
|
@ -369,6 +371,8 @@
|
|||
<Content Include="Content\bootstrap.css.map" />
|
||||
<Content Include="Content\DataTables-1.10.4\css\dataTables.responsive.scss" />
|
||||
<Content Include="Content\DataTables-1.10.4\css\dataTables.jqueryui.scss" />
|
||||
<Content Include="Content\OwaFiles\Empty.docx" />
|
||||
<Content Include="Content\OwaFiles\Empty.pptx" />
|
||||
<None Include="Scripts\jquery-2.1.1.intellisense.js" />
|
||||
<Content Include="Scripts\appScripts\authentication.js" />
|
||||
<Content Include="Scripts\appScripts\dialogs.js" />
|
||||
|
@ -376,6 +380,7 @@
|
|||
<Content Include="Scripts\appScripts\messages.js" />
|
||||
<Content Include="Scripts\appScripts\recalculateResourseHeight.js" />
|
||||
<Content Include="Scripts\appScripts\uploadingData2.js" />
|
||||
<Content Include="Scripts\appScripts\wsp-webdav.js" />
|
||||
<Content Include="Scripts\appScripts\wsp.js" />
|
||||
<Content Include="Scripts\bootstrap.js" />
|
||||
<Content Include="Scripts\bootstrap.min.js" />
|
||||
|
|
|
@ -153,4 +153,5 @@
|
|||
<Control key="rds_edit_collection_settings" general_key="rds_collections" />
|
||||
<Control key="rds_collection_user_sessions" general_key="rds_collections" />
|
||||
<Control key="rds_collection_local_admins" general_key="rds_collections" />
|
||||
<Control key="rds_setup_letter" general_key="rds_collections" />
|
||||
</Controls>
|
||||
|
|
|
@ -173,6 +173,7 @@
|
|||
<Controls>
|
||||
<Control key="" src="WebsitePanel/RDSServers.ascx" title="RDSServers" type="View" />
|
||||
<Control key="add_rdsserver" src="WebsitePanel/RDSServersAddserver.ascx" title="RDSServersAddserver" type="View" icon="computer_add_48.png" />
|
||||
<Control key="edit_rdsserver" src="WebsitePanel/RDSServersEditServer.ascx" title="RDSServersEditServer" type="View" icon="computer_48.png" />
|
||||
</Controls>
|
||||
</ModuleDefinition>
|
||||
|
||||
|
@ -583,6 +584,7 @@
|
|||
<Control key="deleted_user_memberof" src="WebsitePanel/ExchangeServer/OrganizationDeletedUserMemberOf.ascx" title="DeletedUserMemberOf" type="View" />
|
||||
<Control key="rds_application_edit_users" src="WebsitePanel/RDS/RDSEditApplicationUsers.ascx" title="RDSEditApplicationUsers" type="View" />
|
||||
<Control key="rds_collection_local_admins" src="WebsitePanel/RDS/RDSLocalAdmins.ascx" title="RDSLocalAdmins" type="View" />
|
||||
<Control key="rds_setup_letter" src="WebsitePanel/RDS/RDSSetupLetter.ascx" title="RDSSetupLetter" type="View" />
|
||||
<Control key="rds_edit_collection" src="WebsitePanel/RDS/RDSEditCollection.ascx" title="RDSEditCollection" type="View" />
|
||||
<Control key="rds_edit_collection_settings" src="WebsitePanel/RDS/RDSEditCollectionSettings.ascx" title="RDSEditCollectionSettings" type="View" />
|
||||
<Control key="rds_collection_user_sessions" src="WebsitePanel/RDS/RDSUserSessions.ascx" title="RDSUserSessions" type="View" />
|
||||
|
|
|
@ -795,4 +795,7 @@
|
|||
<data name="ModuleTitle.RDSServersAddserver" xml:space="preserve">
|
||||
<value>Add New RDS Server</value>
|
||||
</data>
|
||||
<data name="ModuleTitle.RDSServersEditServer" xml:space="preserve">
|
||||
<value>Edit RDS Server</value>
|
||||
</data>
|
||||
</root>
|
|
@ -3301,6 +3301,12 @@
|
|||
<data name="Success.ORGANIZATION_LETTER_SEND" xml:space="preserve">
|
||||
<value>Organization user setup instructions have been sent</value>
|
||||
</data>
|
||||
<data name="Error.RDS_SETUP_LETTER_SEND" xml:space="preserve">
|
||||
<value>Error sending setup instructions</value>
|
||||
</data>
|
||||
<data name="Success.RDS_SETUP_LETTER_SEND" xml:space="preserve">
|
||||
<value>Setup instructions have been sent</value>
|
||||
</data>
|
||||
<data name="Quota.MsSQL2005.MaxLogSize" xml:space="preserve">
|
||||
<value>Max Log Size, MB</value>
|
||||
</data>
|
||||
|
@ -3367,6 +3373,12 @@
|
|||
<data name="ResourceGroup.Hosted SharePoint" xml:space="preserve">
|
||||
<value>Hosted SharePoint</value>
|
||||
</data>
|
||||
<data name="ResourceGroup.SharePoint Foundation Server" xml:space="preserve">
|
||||
<value>SharePoint Foundation Server</value>
|
||||
</data>
|
||||
<data name="ResourceGroup.SharePoint Server" xml:space="preserve">
|
||||
<value>SharePoint Server</value>
|
||||
</data>
|
||||
<data name="ResourceGroup.OCS" xml:space="preserve">
|
||||
<value>Office Communications Server</value>
|
||||
</data>
|
||||
|
@ -3379,6 +3391,12 @@
|
|||
<data name="Quota.HostedSharePoint.MaxStorage" xml:space="preserve">
|
||||
<value>Max site storage, MB</value>
|
||||
</data>
|
||||
<data name="Quota.HostedSharePointServer.Sites" xml:space="preserve">
|
||||
<value>SharePoint Site Collections per Organization</value>
|
||||
</data>
|
||||
<data name="Quota.HostedSharePointServer.MaxStorage" xml:space="preserve">
|
||||
<value>Max site storage, MB</value>
|
||||
</data>
|
||||
<data name="Quota.HostedCRM.Users" xml:space="preserve">
|
||||
<value>Full licenses per organization</value>
|
||||
</data>
|
||||
|
@ -5155,6 +5173,9 @@
|
|||
<data name="Quota.HostedSharePoint.UseSharedSSL" xml:space="preserve">
|
||||
<value>Use shared SSL Root</value>
|
||||
</data>
|
||||
<data name="Quota.HostedSharePointServer.UseSharedSSL" xml:space="preserve">
|
||||
<value>Use shared SSL Root</value>
|
||||
</data>
|
||||
<data name="Quota.Exchange2007.IsConsumer" xml:space="preserve">
|
||||
<value>Consumer Organization Support</value>
|
||||
</data>
|
||||
|
@ -5444,7 +5465,7 @@
|
|||
<value>ESS licenses per organization</value>
|
||||
</data>
|
||||
<data name="ResourceGroup.Hosted CRM2013" xml:space="preserve">
|
||||
<value>Hosted CRM 2013</value>
|
||||
<value>Hosted CRM 2013/2015</value>
|
||||
</data>
|
||||
<data name="HostedCRM.USER_QUOTA_HAS_BEEN_REACHED2013_0" xml:space="preserve">
|
||||
<value>CRM users quota (Professional license) has been reached.</value>
|
||||
|
@ -5659,6 +5680,9 @@
|
|||
<data name="ERROR.RDSSERVER_NOT_ADDED" xml:space="preserve">
|
||||
<value>RDS Server not added</value>
|
||||
</data>
|
||||
<data name="ERROR.RDSSERVER_NOT_UPDATED" xml:space="preserve">
|
||||
<value>RDS Server not updated</value>
|
||||
</data>
|
||||
<data name="Success.RDSSESSIONHOST_CERTIFICATE_INSTALLED" xml:space="preserve">
|
||||
<value>Session host certificate has been installed</value>
|
||||
</data>
|
||||
|
|
|
@ -54,9 +54,9 @@ legend {font-weight:700; color:#428bca; padding:0 4px;}
|
|||
legend span.NormalBold {display:inline;}
|
||||
.Tabs {width:100%;}
|
||||
.Separator {display:none;}
|
||||
.Tabs span {display:table; table-layout:fixed; width:100%; table-layout:fixed;}
|
||||
.Tabs span {display:table; table-layout:fixed; min-width:100%; table-layout:fixed;}
|
||||
.Tabs span span {display:table-cell; width:15%; text-align:center; padding:0;}
|
||||
.Tabs a {display:block; padding:10px 0; text-decoration:none; border-bottom:1px solid #ddd;}
|
||||
.Tabs a {display:block; padding:10px 5px; text-decoration:none; border-bottom:1px solid #ddd;}
|
||||
.Tabs a:Hover {background:#eee; text-decoration:none;}
|
||||
.Tabs a.ActiveTab {border:1px solid #ddd; border-bottom:none; color:#555; margin-bottom:-1px;}
|
||||
.Tabs a.ActiveTab:hover {background:none;}
|
||||
|
|
|
@ -201,8 +201,11 @@
|
|||
<data name="Text.Setup" xml:space="preserve">
|
||||
<value>Setup</value>
|
||||
</data>
|
||||
<data name="Text.SharePointGroup" xml:space="preserve">
|
||||
<value>SharePoint</value>
|
||||
<data name="Text.SharePointFoundationServerGroup" xml:space="preserve">
|
||||
<value>SharePoint Foundation Server</value>
|
||||
</data>
|
||||
<data name="Text.SharePointServerGroup" xml:space="preserve">
|
||||
<value>SharePoint Server</value>
|
||||
</data>
|
||||
<data name="Text.SiteCollections" xml:space="preserve">
|
||||
<value>Site Collections</value>
|
||||
|
@ -220,7 +223,7 @@
|
|||
<value>Organization Home</value>
|
||||
</data>
|
||||
<data name="Text.CRM2013Group" xml:space="preserve">
|
||||
<value>CRM 2013</value>
|
||||
<value>CRM 2013/2015</value>
|
||||
</data>
|
||||
<data name="Text.RetentionPolicy" xml:space="preserve">
|
||||
<value>Retention Policy</value>
|
||||
|
|
|
@ -0,0 +1,156 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="btnUpdate.Text" xml:space="preserve">
|
||||
<value>Update</value>
|
||||
</data>
|
||||
<data name="locFreeMemory.Text" xml:space="preserve">
|
||||
<value>Free Memory:</value>
|
||||
</data>
|
||||
<data name="locFreeSpace.Text" xml:space="preserve">
|
||||
<value>Free Space:</value>
|
||||
</data>
|
||||
<data name="locLoadPercentage.Text" xml:space="preserve">
|
||||
<value>Load Percentage:</value>
|
||||
</data>
|
||||
<data name="locMemoryAllocated.Text" xml:space="preserve">
|
||||
<value>Allocated Memory:</value>
|
||||
</data>
|
||||
<data name="locProcessor.Text" xml:space="preserve">
|
||||
<value>Processor:</value>
|
||||
</data>
|
||||
<data name="locServerComments.Text" xml:space="preserve">
|
||||
<value>Server Comments:</value>
|
||||
</data>
|
||||
<data name="locServerName.Text" xml:space="preserve">
|
||||
<value>Server Fully Qualified Domain Name:</value>
|
||||
</data>
|
||||
<data name="locSize.Text" xml:space="preserve">
|
||||
<value>Size:</value>
|
||||
</data>
|
||||
<data name="locStatus.Text" xml:space="preserve">
|
||||
<value>Status:</value>
|
||||
</data>
|
||||
<data name="locVolumeName.Text" xml:space="preserve">
|
||||
<value>Volume Name:</value>
|
||||
</data>
|
||||
<data name="secServerInfo.Text" xml:space="preserve">
|
||||
<value>Server Info</value>
|
||||
</data>
|
||||
</root>
|
|
@ -0,0 +1,153 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="ddlPriorityItem.High" xml:space="preserve">
|
||||
<value>High</value>
|
||||
</data>
|
||||
<data name="ddlPriorityItem.Low" xml:space="preserve">
|
||||
<value>Low</value>
|
||||
</data>
|
||||
<data name="ddlPriorityItem.Normal" xml:space="preserve">
|
||||
<value>Normal</value>
|
||||
</data>
|
||||
<data name="lblCC.Text" xml:space="preserve">
|
||||
<value>CC:</value>
|
||||
</data>
|
||||
<data name="lblFrom.Text" xml:space="preserve">
|
||||
<value>From:</value>
|
||||
</data>
|
||||
<data name="lblHtmlBody.Text" xml:space="preserve">
|
||||
<value>HTML Body:</value>
|
||||
</data>
|
||||
<data name="lblNoChangesHtmlBody" xml:space="preserve">
|
||||
<value>No Changes HTML Body:</value>
|
||||
</data>
|
||||
<data name="lblNoChangesTextBody.Text" xml:space="preserve">
|
||||
<value>No Changes Text Body:</value>
|
||||
</data>
|
||||
<data name="lblPriority.Text" xml:space="preserve">
|
||||
<value>Priority:</value>
|
||||
</data>
|
||||
<data name="lblSubject.Text" xml:space="preserve">
|
||||
<value>Subject:</value>
|
||||
</data>
|
||||
<data name="lblTextBody.Text" xml:space="preserve">
|
||||
<value>Text Body:</value>
|
||||
</data>
|
||||
</root>
|
|
@ -162,4 +162,10 @@
|
|||
<data name="litFileManagerEditableExtensions.Text" xml:space="preserve">
|
||||
<value>(One (1) extension per line)</value>
|
||||
</data>
|
||||
<data name="lblRdsController.Text" xml:space="preserve">
|
||||
<value>Main RDS Controller:</value>
|
||||
</data>
|
||||
<data name="RdsSettings.Text" xml:space="preserve">
|
||||
<value>RDS</value>
|
||||
</data>
|
||||
</root>
|
|
@ -147,4 +147,7 @@
|
|||
<data name="lnkDomainLookupLetter.Text" xml:space="preserve">
|
||||
<value>Domain MX and NS Letter</value>
|
||||
</data>
|
||||
<data name="lnkRdsSetupLetter.Text" xml:space="preserve">
|
||||
<value>RDS Setup Letter</value>
|
||||
</data>
|
||||
</root>
|
|
@ -151,7 +151,7 @@
|
|||
<value>Contacts</value>
|
||||
</data>
|
||||
<data name="Text.CRM2013Group" xml:space="preserve">
|
||||
<value>Hosted Organization - CRM 2013</value>
|
||||
<value>Hosted Organization - CRM 2013/2015</value>
|
||||
</data>
|
||||
<data name="Text.CRMGroup" xml:space="preserve">
|
||||
<value>Hosted Organization - CRM</value>
|
||||
|
@ -234,9 +234,12 @@
|
|||
<data name="Text.Setup" xml:space="preserve">
|
||||
<value>Setup</value>
|
||||
</data>
|
||||
<data name="Text.SharePointGroup" xml:space="preserve">
|
||||
<value>Hosted Organization - SharePoint</value>
|
||||
<data name="Text.SharePointFoundationServerGroup" xml:space="preserve">
|
||||
<value>Hosted Organization - SharePoint Foundation Server</value>
|
||||
</data>
|
||||
<data name="Text.SharePointServerGroup" xml:space="preserve">
|
||||
<value>Hosted Organization - SharePoint Server</value>
|
||||
</data>
|
||||
<data name="Text.SiteCollections" xml:space="preserve">
|
||||
<value>Sharepoint Sites</value>
|
||||
</data>
|
||||
|
|
|
@ -20,8 +20,10 @@
|
|||
</div>
|
||||
<div class="FormBody">
|
||||
<wsp:SimpleMessageBox id="messageBox" runat="server" />
|
||||
<div class="FormButtonsBarClean">
|
||||
<div class="FormButtonsBarCleanLeft">
|
||||
|
||||
<div>
|
||||
|
||||
<div>
|
||||
<table>
|
||||
<tr height="23">
|
||||
<td class="FormLabel150"><asp:Localize runat="server" ID="locDisplayName" meta:resourcekey="locDisplayName" /></td>
|
||||
|
@ -55,8 +57,7 @@
|
|||
<br />
|
||||
</div>
|
||||
|
||||
<div class="FormButtonsBarCleanRight">
|
||||
|
||||
<div>
|
||||
<asp:GridView ID="gvRoles" runat="server" AutoGenerateColumns="False" EnableViewState="true"
|
||||
Width="100%" CssSelectorClass="NormalGridView"
|
||||
AllowPaging="False" AllowSorting="False" DataKeyNames="RoleID" >
|
||||
|
@ -74,6 +75,7 @@
|
|||
</asp:GridView>
|
||||
</div>
|
||||
<br />
|
||||
|
||||
<asp:Button runat="server" ID="btnUpdate" Text="Save Changes" meta:resourcekey="btnUpdate" CssClass="Button1" onclick="btnUpdate_Click" />
|
||||
<asp:Button runat="server" ID="btnSaveExit" Text="Save Changes and Exit" CssClass="Button1"
|
||||
meta:resourcekey="btnSaveExit" OnClick="btnSaveExit_Click"></asp:Button>
|
||||
|
|
|
@ -54,11 +54,8 @@ namespace WebsitePanel.Portal
|
|||
|
||||
foreach (var rdsServer in rdsServers.Servers)
|
||||
{
|
||||
if (rdsServer.ItemId.HasValue)
|
||||
{
|
||||
rdsServer.Status = ES.Services.RDS.GetRdsServerStatus(rdsServer.ItemId.Value, rdsServer.FqdName);
|
||||
rdsServer.SslAvailable = ES.Services.RDS.GetRdsCertificateByItemId(rdsServer.ItemId.Value) != null;
|
||||
}
|
||||
rdsServer.Status = ES.Services.RDS.GetRdsServerStatus(null, rdsServer.FqdName);
|
||||
rdsServer.SslAvailable = ES.Services.RDS.GetRdsCertificateByItemId(rdsServer.ItemId) != null;
|
||||
}
|
||||
|
||||
return rdsServers.Servers;
|
||||
|
|
|
@ -280,7 +280,7 @@
|
|||
<tr >
|
||||
<td class="OrgStatsGroup" width="100%" colspan="2">
|
||||
<asp:Localize ID="locCRM2013" runat="server" meta:resourcekey="locCRM2013"
|
||||
Text="CRM 2013"></asp:Localize>
|
||||
Text="CRM 2013/2015"></asp:Localize>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="OrgStatsRow">
|
||||
|
|
|
@ -236,7 +236,7 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
|
||||
|
||||
//Show SharePoint statistics
|
||||
if (cntx.Groups.ContainsKey(ResourceGroups.HostedSharePoint))
|
||||
if (cntx.Groups.ContainsKey(ResourceGroups.SharepointFoundationServer))
|
||||
{
|
||||
sharePointStatsPanel.Visible = true;
|
||||
|
||||
|
|
|
@ -165,8 +165,11 @@
|
|||
<data name="Text.Setup" xml:space="preserve">
|
||||
<value>Setup</value>
|
||||
</data>
|
||||
<data name="Text.SharePointGroup" xml:space="preserve">
|
||||
<value>SharePoint</value>
|
||||
<data name="Text.SharePointFoundationServerGroup" xml:space="preserve">
|
||||
<value>SharePoint Foundation Server</value>
|
||||
</data>
|
||||
<data name="Text.SharePointServerGroup" xml:space="preserve">
|
||||
<value>SharePoint Server</value>
|
||||
</data>
|
||||
<data name="Text.OCSGroup" xml:space="preserve">
|
||||
<value>OCS</value>
|
||||
|
|
|
@ -240,10 +240,10 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls
|
|||
|
||||
}
|
||||
|
||||
private void PrepareSharePointMenu(PackageContext cntx, List<MenuGroup> groups, string imagePath)
|
||||
private void PrepareSharePointMenu(PackageContext cntx, List<MenuGroup> groups, string imagePath, string menuItemText)
|
||||
{
|
||||
MenuGroup sharepointGroup =
|
||||
new MenuGroup(GetLocalizedString("Text.SharePointGroup"), imagePath + "sharepoint24.png");
|
||||
new MenuGroup(menuItemText, imagePath + "sharepoint24.png");
|
||||
sharepointGroup.MenuItems.Add(CreateMenuItem("SiteCollections", "sharepoint_sitecollections"));
|
||||
sharepointGroup.MenuItems.Add(CreateMenuItem("StorageUsage", "sharepoint_storage_usage"));
|
||||
sharepointGroup.MenuItems.Add(CreateMenuItem("StorageLimits", "sharepoint_storage_settings"));
|
||||
|
@ -314,9 +314,14 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls
|
|||
PrepareBlackBerryMenu(cntx, groups, imagePath);
|
||||
|
||||
//SharePoint menu group;
|
||||
if (cntx.Groups.ContainsKey(ResourceGroups.HostedSharePoint))
|
||||
if (cntx.Groups.ContainsKey(ResourceGroups.SharepointFoundationServer))
|
||||
{
|
||||
PrepareSharePointMenu(cntx, groups, imagePath);
|
||||
PrepareSharePointMenu(cntx, groups, imagePath, GetLocalizedString("Text.SharePointFoundationServerGroup"));
|
||||
}
|
||||
|
||||
if (cntx.Groups.ContainsKey(ResourceGroups.SharepointServer))
|
||||
{
|
||||
PrepareSharePointMenu(cntx, groups, imagePath, GetLocalizedString("Text.SharePointServerGroup"));
|
||||
}
|
||||
|
||||
//CRM Menu
|
||||
|
|
|
@ -144,4 +144,7 @@
|
|||
<data name="lblSanName.Text" xml:space="preserve">
|
||||
<value>SAN Name:</value>
|
||||
</data>
|
||||
<data name="lblComputersRootOU.Text" xml:space="preserve">
|
||||
<value>Computers Root OU:</value>
|
||||
</data>
|
||||
</root>
|
|
@ -76,6 +76,15 @@
|
|||
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtRootOU" ErrorMessage="*" Display="Dynamic" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="SubHead" width="200" nowrap>
|
||||
<asp:Label runat="server" ID="lblComputersRootOU" meta:resourcekey="lblComputersRootOU" Text="Computers Root OU:"/>
|
||||
</td>
|
||||
<td class="Normal">
|
||||
<asp:TextBox runat="server" ID="txtComputersRootOu" MaxLength="1000" Width="200px" />
|
||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtComputersRootOu" ErrorMessage="*" Display="Dynamic" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="SubHead" width="200" nowrap>
|
||||
<asp:Label runat="server" ID="lblPrimaryDomainController" meta:resourcekey="lblPrimaryDomainController" Text="Primary Domain Controller:"/>
|
||||
|
|
|
@ -83,6 +83,7 @@ namespace WebsitePanel.Portal.ProviderControls
|
|||
UpdateLyncServersGrid();
|
||||
|
||||
txtRootOU.Text = settings["RootOU"];
|
||||
txtComputersRootOu.Text = settings["ComputersRootOU"];
|
||||
txtPrimaryDomainController.Text = settings["PrimaryDomainController"];
|
||||
|
||||
if (!string.IsNullOrEmpty(settings["UseCentralNPS"]) && bool.TrueString == settings["UseCentralNPS"])
|
||||
|
@ -103,6 +104,7 @@ namespace WebsitePanel.Portal.ProviderControls
|
|||
{
|
||||
settings["ConnectionBroker"] = txtConnectionBroker.Text;
|
||||
settings["RootOU"] = txtRootOU.Text;
|
||||
settings["ComputersRootOU"] = txtComputersRootOu.Text;
|
||||
settings["PrimaryDomainController"] = txtPrimaryDomainController.Text;
|
||||
settings["UseCentralNPS"] = chkUseCentralNPS.Checked.ToString();
|
||||
settings["CentralNPS"] = chkUseCentralNPS.Checked ? txtCentralNPS.Text : string.Empty;
|
||||
|
|
|
@ -138,6 +138,33 @@ namespace WebsitePanel.Portal.ProviderControls {
|
|||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator4;
|
||||
|
||||
/// <summary>
|
||||
/// lblComputersRootOU 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 lblComputersRootOU;
|
||||
|
||||
/// <summary>
|
||||
/// txtComputersRootOu 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.TextBox txtComputersRootOu;
|
||||
|
||||
/// <summary>
|
||||
/// RequiredFieldValidator1 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.RequiredFieldValidator RequiredFieldValidator1;
|
||||
|
||||
/// <summary>
|
||||
/// lblPrimaryDomainController control.
|
||||
/// </summary>
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue