Session Host certificates
This commit is contained in:
parent
789cd6ca11
commit
1969cd398c
45 changed files with 1196 additions and 377 deletions
|
@ -5508,6 +5508,23 @@ CREATE TABLE [dbo].[RDSCollectionSettings](
|
||||||
|
|
||||||
GO
|
GO
|
||||||
|
|
||||||
|
IF NOT EXISTS(SELECT * FROM SYS.TABLES WHERE name = 'RDSCertificates')
|
||||||
|
CREATE TABLE [dbo].[RDSCertificates](
|
||||||
|
[ID] [int] IDENTITY(1,1) NOT NULL,
|
||||||
|
[ServiceId] [int] NOT NULL,
|
||||||
|
[Content] [ntext] NOT NULL,
|
||||||
|
[Hash] [nvarchar](255) NOT NULL,
|
||||||
|
[FileName] [nvarchar](255) NOT NULL,
|
||||||
|
[ValidFrom] [datetime] NULL,
|
||||||
|
[ExpiryDate] [datetime] NULL
|
||||||
|
CONSTRAINT [PK_RDSCertificates] PRIMARY KEY CLUSTERED
|
||||||
|
(
|
||||||
|
[ID] ASC
|
||||||
|
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||||
|
) ON [PRIMARY]
|
||||||
|
|
||||||
|
GO
|
||||||
|
|
||||||
|
|
||||||
ALTER TABLE [dbo].[RDSCollectionUsers]
|
ALTER TABLE [dbo].[RDSCollectionUsers]
|
||||||
DROP CONSTRAINT [FK_RDSCollectionUsers_RDSCollectionId]
|
DROP CONSTRAINT [FK_RDSCollectionUsers_RDSCollectionId]
|
||||||
|
@ -5548,6 +5565,66 @@ GO
|
||||||
|
|
||||||
/*Remote Desktop Services Procedures*/
|
/*Remote Desktop Services Procedures*/
|
||||||
|
|
||||||
|
IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'AddRDSCertificate')
|
||||||
|
DROP PROCEDURE AddRDSCertificate
|
||||||
|
GO
|
||||||
|
CREATE PROCEDURE [dbo].[AddRDSCertificate]
|
||||||
|
(
|
||||||
|
@RDSCertificateId INT OUTPUT,
|
||||||
|
@ServiceId INT,
|
||||||
|
@Content NTEXT,
|
||||||
|
@Hash NVARCHAR(255),
|
||||||
|
@FileName NVARCHAR(255),
|
||||||
|
@ValidFrom DATETIME,
|
||||||
|
@ExpiryDate DATETIME
|
||||||
|
)
|
||||||
|
AS
|
||||||
|
INSERT INTO RDSCertificates
|
||||||
|
(
|
||||||
|
ServiceId,
|
||||||
|
Content,
|
||||||
|
Hash,
|
||||||
|
FileName,
|
||||||
|
ValidFrom,
|
||||||
|
ExpiryDate
|
||||||
|
)
|
||||||
|
VALUES
|
||||||
|
(
|
||||||
|
@ServiceId,
|
||||||
|
@Content,
|
||||||
|
@Hash,
|
||||||
|
@FileName,
|
||||||
|
@ValidFrom,
|
||||||
|
@ExpiryDate
|
||||||
|
)
|
||||||
|
|
||||||
|
SET @RDSCertificateId = SCOPE_IDENTITY()
|
||||||
|
|
||||||
|
RETURN
|
||||||
|
GO
|
||||||
|
|
||||||
|
|
||||||
|
IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetRDSCertificateByServiceId')
|
||||||
|
DROP PROCEDURE GetRDSCertificateByServiceId
|
||||||
|
GO
|
||||||
|
CREATE PROCEDURE [dbo].[GetRDSCertificateByServiceId]
|
||||||
|
(
|
||||||
|
@ServiceId INT
|
||||||
|
)
|
||||||
|
AS
|
||||||
|
SELECT TOP 1
|
||||||
|
Id,
|
||||||
|
ServiceId,
|
||||||
|
Content,
|
||||||
|
Hash,
|
||||||
|
FileName,
|
||||||
|
ValidFrom,
|
||||||
|
ExpiryDate
|
||||||
|
FROM RDSCertificates
|
||||||
|
WHERE ServiceId = @ServiceId
|
||||||
|
ORDER BY Id DESC
|
||||||
|
GO
|
||||||
|
|
||||||
IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'AddRDSServer')
|
IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'AddRDSServer')
|
||||||
DROP PROCEDURE AddRDSServer
|
DROP PROCEDURE AddRDSServer
|
||||||
GO
|
GO
|
||||||
|
@ -6042,7 +6119,7 @@ CREATE PROCEDURE [dbo].GetOrganizationRdsUsersCount
|
||||||
)
|
)
|
||||||
AS
|
AS
|
||||||
SELECT
|
SELECT
|
||||||
@TotalNumber = Count([RDSCollectionId])
|
@TotalNumber = Count(DISTINCT([AccountId]))
|
||||||
FROM [dbo].[RDSCollectionUsers]
|
FROM [dbo].[RDSCollectionUsers]
|
||||||
WHERE [RDSCollectionId] in (SELECT [ID] FROM [RDSCollections] where [ItemId] = @ItemId )
|
WHERE [RDSCollectionId] in (SELECT [ID] FROM [RDSCollections] where [ItemId] = @ItemId )
|
||||||
RETURN
|
RETURN
|
||||||
|
@ -8192,6 +8269,22 @@ AS
|
||||||
INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID
|
INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID
|
||||||
INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID
|
INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID
|
||||||
WHERE pt.ParentPackageID = @PackageID AND ea.AccountType = 11)
|
WHERE pt.ParentPackageID = @PackageID AND ea.AccountType = 11)
|
||||||
|
ELSE IF @QuotaID = 450
|
||||||
|
SET @Result = (SELECT COUNT(DISTINCT(RCU.[AccountId])) FROM [dbo].[RDSCollectionUsers] RCU
|
||||||
|
INNER JOIN ExchangeAccounts EA ON EA.AccountId = RCU.AccountId
|
||||||
|
INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID
|
||||||
|
INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID
|
||||||
|
WHERE PT.ParentPackageID = @PackageID)
|
||||||
|
ELSE IF @QuotaID = 451
|
||||||
|
SET @Result = (SELECT COUNT(RS.[ID]) FROM [dbo].[RDSServers] RS
|
||||||
|
INNER JOIN ServiceItems si ON RS.ItemID = si.ItemID
|
||||||
|
INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID
|
||||||
|
WHERE PT.ParentPackageID = @PackageID)
|
||||||
|
ELSE IF @QuotaID = 491
|
||||||
|
SET @Result = (SELECT COUNT(RC.[ID]) FROM [dbo].[RDSCollections] RC
|
||||||
|
INNER JOIN ServiceItems si ON RC.ItemID = si.ItemID
|
||||||
|
INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID
|
||||||
|
WHERE PT.ParentPackageID = @PackageID)
|
||||||
ELSE IF @QuotaName like 'ServiceLevel.%' -- Support Service Level Quota
|
ELSE IF @QuotaName like 'ServiceLevel.%' -- Support Service Level Quota
|
||||||
BEGIN
|
BEGIN
|
||||||
DECLARE @LevelID int
|
DECLARE @LevelID int
|
||||||
|
|
|
@ -120,6 +120,10 @@ namespace WebsitePanel.EnterpriseServer {
|
||||||
|
|
||||||
private System.Threading.SendOrPostCallback InstallSessionHostsCertificateOperationCompleted;
|
private System.Threading.SendOrPostCallback InstallSessionHostsCertificateOperationCompleted;
|
||||||
|
|
||||||
|
private System.Threading.SendOrPostCallback GetRdsCertificateByServiceIdOperationCompleted;
|
||||||
|
|
||||||
|
private System.Threading.SendOrPostCallback AddRdsCertificateOperationCompleted;
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public esRemoteDesktopServices() {
|
public esRemoteDesktopServices() {
|
||||||
this.Url = "http://localhost:9002/esRemoteDesktopServices.asmx";
|
this.Url = "http://localhost:9002/esRemoteDesktopServices.asmx";
|
||||||
|
@ -260,6 +264,12 @@ namespace WebsitePanel.EnterpriseServer {
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public event InstallSessionHostsCertificateCompletedEventHandler InstallSessionHostsCertificateCompleted;
|
public event InstallSessionHostsCertificateCompletedEventHandler InstallSessionHostsCertificateCompleted;
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public event GetRdsCertificateByServiceIdCompletedEventHandler GetRdsCertificateByServiceIdCompleted;
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public event AddRdsCertificateCompletedEventHandler AddRdsCertificateCompleted;
|
||||||
|
|
||||||
/// <remarks/>
|
/// <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)]
|
[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) {
|
public RdsCollection GetRdsCollection(int collectionId) {
|
||||||
|
@ -2245,20 +2255,16 @@ namespace WebsitePanel.EnterpriseServer {
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/InstallSessionHostsCertificate", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/InstallSessionHostsCertificate", 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 InstallSessionHostsCertificate(int collectionId, [System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary")] byte[] certificate, string password) {
|
public ResultObject InstallSessionHostsCertificate(RdsServer rdsServer) {
|
||||||
object[] results = this.Invoke("InstallSessionHostsCertificate", new object[] {
|
object[] results = this.Invoke("InstallSessionHostsCertificate", new object[] {
|
||||||
collectionId,
|
rdsServer});
|
||||||
certificate,
|
|
||||||
password});
|
|
||||||
return ((ResultObject)(results[0]));
|
return ((ResultObject)(results[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public System.IAsyncResult BeginInstallSessionHostsCertificate(int collectionId, byte[] certificate, string password, System.AsyncCallback callback, object asyncState) {
|
public System.IAsyncResult BeginInstallSessionHostsCertificate(RdsServer rdsServer, System.AsyncCallback callback, object asyncState) {
|
||||||
return this.BeginInvoke("InstallSessionHostsCertificate", new object[] {
|
return this.BeginInvoke("InstallSessionHostsCertificate", new object[] {
|
||||||
collectionId,
|
rdsServer}, callback, asyncState);
|
||||||
certificate,
|
|
||||||
password}, callback, asyncState);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
|
@ -2268,19 +2274,17 @@ namespace WebsitePanel.EnterpriseServer {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public void InstallSessionHostsCertificateAsync(int collectionId, byte[] certificate, string password) {
|
public void InstallSessionHostsCertificateAsync(RdsServer rdsServer) {
|
||||||
this.InstallSessionHostsCertificateAsync(collectionId, certificate, password, null);
|
this.InstallSessionHostsCertificateAsync(rdsServer, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public void InstallSessionHostsCertificateAsync(int collectionId, byte[] certificate, string password, object userState) {
|
public void InstallSessionHostsCertificateAsync(RdsServer rdsServer, object userState) {
|
||||||
if ((this.InstallSessionHostsCertificateOperationCompleted == null)) {
|
if ((this.InstallSessionHostsCertificateOperationCompleted == null)) {
|
||||||
this.InstallSessionHostsCertificateOperationCompleted = new System.Threading.SendOrPostCallback(this.OnInstallSessionHostsCertificateOperationCompleted);
|
this.InstallSessionHostsCertificateOperationCompleted = new System.Threading.SendOrPostCallback(this.OnInstallSessionHostsCertificateOperationCompleted);
|
||||||
}
|
}
|
||||||
this.InvokeAsync("InstallSessionHostsCertificate", new object[] {
|
this.InvokeAsync("InstallSessionHostsCertificate", new object[] {
|
||||||
collectionId,
|
rdsServer}, this.InstallSessionHostsCertificateOperationCompleted, userState);
|
||||||
certificate,
|
|
||||||
password}, this.InstallSessionHostsCertificateOperationCompleted, userState);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnInstallSessionHostsCertificateOperationCompleted(object arg) {
|
private void OnInstallSessionHostsCertificateOperationCompleted(object arg) {
|
||||||
|
@ -2290,6 +2294,88 @@ namespace WebsitePanel.EnterpriseServer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetRdsCertificateByServiceId", 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 GetRdsCertificateByServiceId(int serviceId) {
|
||||||
|
object[] results = this.Invoke("GetRdsCertificateByServiceId", new object[] {
|
||||||
|
serviceId});
|
||||||
|
return ((RdsCertificate)(results[0]));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public System.IAsyncResult BeginGetRdsCertificateByServiceId(int serviceId, System.AsyncCallback callback, object asyncState) {
|
||||||
|
return this.BeginInvoke("GetRdsCertificateByServiceId", new object[] {
|
||||||
|
serviceId}, callback, asyncState);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public RdsCertificate EndGetRdsCertificateByServiceId(System.IAsyncResult asyncResult) {
|
||||||
|
object[] results = this.EndInvoke(asyncResult);
|
||||||
|
return ((RdsCertificate)(results[0]));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public void GetRdsCertificateByServiceIdAsync(int serviceId) {
|
||||||
|
this.GetRdsCertificateByServiceIdAsync(serviceId, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public void GetRdsCertificateByServiceIdAsync(int serviceId, object userState) {
|
||||||
|
if ((this.GetRdsCertificateByServiceIdOperationCompleted == null)) {
|
||||||
|
this.GetRdsCertificateByServiceIdOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRdsCertificateByServiceIdOperationCompleted);
|
||||||
|
}
|
||||||
|
this.InvokeAsync("GetRdsCertificateByServiceId", new object[] {
|
||||||
|
serviceId}, this.GetRdsCertificateByServiceIdOperationCompleted, userState);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnGetRdsCertificateByServiceIdOperationCompleted(object arg) {
|
||||||
|
if ((this.GetRdsCertificateByServiceIdCompleted != null)) {
|
||||||
|
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
|
||||||
|
this.GetRdsCertificateByServiceIdCompleted(this, new GetRdsCertificateByServiceIdCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/AddRdsCertificate", 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 AddRdsCertificate(RdsCertificate certificate) {
|
||||||
|
object[] results = this.Invoke("AddRdsCertificate", new object[] {
|
||||||
|
certificate});
|
||||||
|
return ((ResultObject)(results[0]));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public System.IAsyncResult BeginAddRdsCertificate(RdsCertificate certificate, System.AsyncCallback callback, object asyncState) {
|
||||||
|
return this.BeginInvoke("AddRdsCertificate", new object[] {
|
||||||
|
certificate}, callback, asyncState);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public ResultObject EndAddRdsCertificate(System.IAsyncResult asyncResult) {
|
||||||
|
object[] results = this.EndInvoke(asyncResult);
|
||||||
|
return ((ResultObject)(results[0]));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public void AddRdsCertificateAsync(RdsCertificate certificate) {
|
||||||
|
this.AddRdsCertificateAsync(certificate, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public void AddRdsCertificateAsync(RdsCertificate certificate, object userState) {
|
||||||
|
if ((this.AddRdsCertificateOperationCompleted == null)) {
|
||||||
|
this.AddRdsCertificateOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddRdsCertificateOperationCompleted);
|
||||||
|
}
|
||||||
|
this.InvokeAsync("AddRdsCertificate", new object[] {
|
||||||
|
certificate}, this.AddRdsCertificateOperationCompleted, userState);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnAddRdsCertificateOperationCompleted(object arg) {
|
||||||
|
if ((this.AddRdsCertificateCompleted != null)) {
|
||||||
|
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
|
||||||
|
this.AddRdsCertificateCompleted(this, new AddRdsCertificateCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public new void CancelAsync(object userState) {
|
public new void CancelAsync(object userState) {
|
||||||
base.CancelAsync(userState);
|
base.CancelAsync(userState);
|
||||||
|
@ -3465,4 +3551,56 @@ namespace WebsitePanel.EnterpriseServer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||||
|
public delegate void GetRdsCertificateByServiceIdCompletedEventHandler(object sender, GetRdsCertificateByServiceIdCompletedEventArgs e);
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||||
|
[System.Diagnostics.DebuggerStepThroughAttribute()]
|
||||||
|
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||||
|
public partial class GetRdsCertificateByServiceIdCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
|
||||||
|
|
||||||
|
private object[] results;
|
||||||
|
|
||||||
|
internal GetRdsCertificateByServiceIdCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
|
||||||
|
base(exception, cancelled, userState) {
|
||||||
|
this.results = results;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public RdsCertificate Result {
|
||||||
|
get {
|
||||||
|
this.RaiseExceptionIfNecessary();
|
||||||
|
return ((RdsCertificate)(this.results[0]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||||
|
public delegate void AddRdsCertificateCompletedEventHandler(object sender, AddRdsCertificateCompletedEventArgs e);
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||||
|
[System.Diagnostics.DebuggerStepThroughAttribute()]
|
||||||
|
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||||
|
public partial class AddRdsCertificateCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
|
||||||
|
|
||||||
|
private object[] results;
|
||||||
|
|
||||||
|
internal AddRdsCertificateCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
|
||||||
|
base(exception, cancelled, userState) {
|
||||||
|
this.results = results;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public ResultObject Result {
|
||||||
|
get {
|
||||||
|
this.RaiseExceptionIfNecessary();
|
||||||
|
return ((ResultObject)(this.results[0]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4613,6 +4613,37 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
|
|
||||||
#region RDS
|
#region RDS
|
||||||
|
|
||||||
|
public static int AddRdsCertificate(int serviceId, string content, byte[] hash, string fileName, DateTime? validFrom, DateTime? expiryDate)
|
||||||
|
{
|
||||||
|
SqlParameter rdsCertificateId = new SqlParameter("@RDSCertificateID", SqlDbType.Int);
|
||||||
|
rdsCertificateId.Direction = ParameterDirection.Output;
|
||||||
|
|
||||||
|
SqlHelper.ExecuteNonQuery(
|
||||||
|
ConnectionString,
|
||||||
|
CommandType.StoredProcedure,
|
||||||
|
"AddRDSCertificate",
|
||||||
|
rdsCertificateId,
|
||||||
|
new SqlParameter("@ServiceId", serviceId),
|
||||||
|
new SqlParameter("@Content", content),
|
||||||
|
new SqlParameter("@Hash", Convert.ToBase64String(hash)),
|
||||||
|
new SqlParameter("@FileName", fileName),
|
||||||
|
new SqlParameter("@ValidFrom", validFrom),
|
||||||
|
new SqlParameter("@ExpiryDate", expiryDate)
|
||||||
|
);
|
||||||
|
|
||||||
|
return Convert.ToInt32(rdsCertificateId.Value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IDataReader GetRdsCertificateByServiceId(int serviceId)
|
||||||
|
{
|
||||||
|
return SqlHelper.ExecuteReader(
|
||||||
|
ConnectionString,
|
||||||
|
CommandType.StoredProcedure,
|
||||||
|
"GetRDSCertificateByServiceId",
|
||||||
|
new SqlParameter("@ServiceId", serviceId)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
public static IDataReader GetRdsCollectionSettingsByCollectionId(int collectionId)
|
public static IDataReader GetRdsCollectionSettingsByCollectionId(int collectionId)
|
||||||
{
|
{
|
||||||
return SqlHelper.ExecuteReader(
|
return SqlHelper.ExecuteReader(
|
||||||
|
|
|
@ -278,19 +278,28 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
return SaveRdsCollectionLocalAdminsInternal(users, collectionId);
|
return SaveRdsCollectionLocalAdminsInternal(users, collectionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ResultObject InstallSessionHostsCertificate(int collectionId, byte[] certificate, string password)
|
public static ResultObject InstallSessionHostsCertificate(RdsServer rdsServer)
|
||||||
{
|
{
|
||||||
return InstallSessionHostsCertificateInternal(collectionId, certificate, password);
|
return InstallSessionHostsCertificateInternal(rdsServer);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ResultObject InstallSessionHostsCertificateInternal(int collectionId, byte[] certificate, string password)
|
public static RdsCertificate GetRdsCertificateByServiceId(int serviceId)
|
||||||
|
{
|
||||||
|
return GetRdsCertificateByServiceIdInternal(serviceId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ResultObject AddRdsCertificate(RdsCertificate certificate)
|
||||||
|
{
|
||||||
|
return AddRdsCertificateInternal(certificate);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static ResultObject InstallSessionHostsCertificateInternal(RdsServer rdsServer)
|
||||||
{
|
{
|
||||||
var result = TaskManager.StartResultTask<ResultObject>("REMOTE_DESKTOP_SERVICES", "INSTALL_CERTIFICATE");
|
var result = TaskManager.StartResultTask<ResultObject>("REMOTE_DESKTOP_SERVICES", "INSTALL_CERTIFICATE");
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var collection = ObjectUtils.FillObjectFromDataReader<RdsCollection>(DataProvider.GetRDSCollectionById(collectionId));
|
Organization org = OrganizationController.GetOrganization(rdsServer.ItemId.Value);
|
||||||
Organization org = OrganizationController.GetOrganization(collection.ItemId);
|
|
||||||
|
|
||||||
if (org == null)
|
if (org == null)
|
||||||
{
|
{
|
||||||
|
@ -299,10 +308,17 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
|
int serviceId = GetRemoteDesktopServiceID(org.PackageId);
|
||||||
var servers = ObjectUtils.CreateListFromDataReader<RdsServer>(DataProvider.GetRDSServersByCollectionId(collection.Id)).ToList();
|
var rds = GetRemoteDesktopServices(serviceId);
|
||||||
|
var certificate = GetRdsCertificateByServiceIdInternal(serviceId);
|
||||||
|
|
||||||
rds.InstallCertificate(certificate, password, servers.Select(s => s.FqdName).ToArray());
|
var array = Convert.FromBase64String(certificate.Hash);
|
||||||
|
char[] chars = new char[array.Length / sizeof(char)];
|
||||||
|
System.Buffer.BlockCopy(array, 0, chars, 0, array.Length);
|
||||||
|
string password = new string(chars);
|
||||||
|
byte[] content = Convert.FromBase64String(certificate.Content);
|
||||||
|
|
||||||
|
rds.InstallCertificate(content, password, new string[] {rdsServer.FqdName});
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
@ -323,6 +339,49 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static RdsCertificate GetRdsCertificateByServiceIdInternal(int serviceId)
|
||||||
|
{
|
||||||
|
var result = ObjectUtils.FillObjectFromDataReader<RdsCertificate>(DataProvider.GetRdsCertificateByServiceId(serviceId));
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static ResultObject AddRdsCertificateInternal(RdsCertificate certificate)
|
||||||
|
{
|
||||||
|
var result = TaskManager.StartResultTask<ResultObject>("REMOTE_DESKTOP_SERVICES", "ADD_RDS_SERVER");
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
byte[] hash = new byte[certificate.Hash.Length * sizeof(char)];
|
||||||
|
System.Buffer.BlockCopy(certificate.Hash.ToCharArray(), 0, hash, 0, hash.Length);
|
||||||
|
certificate.Id = DataProvider.AddRdsCertificate(certificate.ServiceId, certificate.Content, hash, certificate.FileName, certificate.ValidFrom, certificate.ExpiryDate);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (ex.InnerException != null)
|
||||||
|
{
|
||||||
|
result.AddError("Unable to add RDS Certificate", ex.InnerException);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
result.AddError("Unable to add RDS Certificate", ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
if (!result.IsSuccess)
|
||||||
|
{
|
||||||
|
TaskManager.CompleteResultTask(result);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TaskManager.CompleteResultTask();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
private static RdsCollection GetRdsCollectionInternal(int collectionId)
|
private static RdsCollection GetRdsCollectionInternal(int collectionId)
|
||||||
{
|
{
|
||||||
var collection = ObjectUtils.FillObjectFromDataReader<RdsCollection>(DataProvider.GetRDSCollectionById(collectionId));
|
var collection = ObjectUtils.FillObjectFromDataReader<RdsCollection>(DataProvider.GetRDSCollectionById(collectionId));
|
||||||
|
@ -370,7 +429,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
|
var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
|
||||||
|
|
||||||
var organizationUsers = OrganizationController.GetOrganizationUsersPaged(collection.ItemId, null, null, null, 0, Int32.MaxValue).PageUsers;
|
var organizationUsers = OrganizationController.GetOrganizationUsersPaged(collection.ItemId, null, null, null, 0, Int32.MaxValue).PageUsers;
|
||||||
var organizationAdmins = rds.GetRdsCollectionLocalAdmins(servers.First().FqdName);
|
var organizationAdmins = rds.GetRdsCollectionLocalAdmins(org.OrganizationId, collection.Name);
|
||||||
|
|
||||||
return organizationUsers.Where(o => organizationAdmins.Select(a => a.ToLower()).Contains(o.DomainUserName.ToLower())).ToList();
|
return organizationUsers.Where(o => organizationAdmins.Select(a => a.ToLower()).Contains(o.DomainUserName.ToLower())).ToList();
|
||||||
}
|
}
|
||||||
|
@ -394,7 +453,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
|
var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
|
||||||
var servers = ObjectUtils.CreateListFromDataReader<RdsServer>(DataProvider.GetRDSServersByCollectionId(collection.Id)).ToList();
|
var servers = ObjectUtils.CreateListFromDataReader<RdsServer>(DataProvider.GetRDSServersByCollectionId(collection.Id)).ToList();
|
||||||
|
|
||||||
rds.SaveRdsCollectionLocalAdmins(users, servers.Select(s => s.FqdName).ToArray());
|
rds.SaveRdsCollectionLocalAdmins(users.Select(u => u.AccountName).ToArray(), servers.Select(s => s.FqdName).ToArray(), org.OrganizationId, collection.Name);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
@ -760,8 +819,21 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
}
|
}
|
||||||
|
|
||||||
var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(organization.PackageId));
|
var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(organization.PackageId));
|
||||||
|
var userSessions = rds.GetRdsUserSessions(collection.Name).ToList();
|
||||||
|
var organizationUsers = OrganizationController.GetOrganizationUsersPaged(collection.ItemId, null, null, null, 0, Int32.MaxValue).PageUsers;
|
||||||
|
|
||||||
return rds.GetRdsUserSessions(collection.Name).ToList();
|
foreach(var userSession in userSessions)
|
||||||
|
{
|
||||||
|
var organizationUser = organizationUsers.FirstOrDefault(o => o.SamAccountName.Equals(userSession.SamAccountName, StringComparison.CurrentCultureIgnoreCase));
|
||||||
|
|
||||||
|
if (organizationUser != null)
|
||||||
|
{
|
||||||
|
userSession.IsVip = organizationUser.IsVIP;
|
||||||
|
result.Add(userSession);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static RdsServersPaged GetFreeRdsServersPagedInternal(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows)
|
private static RdsServersPaged GetFreeRdsServersPagedInternal(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows)
|
||||||
|
|
|
@ -327,9 +327,21 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
}
|
}
|
||||||
|
|
||||||
[WebMethod]
|
[WebMethod]
|
||||||
public ResultObject InstallSessionHostsCertificate(int collectionId, byte[] certificate, string password)
|
public ResultObject InstallSessionHostsCertificate(RdsServer rdsServer)
|
||||||
{
|
{
|
||||||
return RemoteDesktopServicesController.InstallSessionHostsCertificate(collectionId, certificate, password);
|
return RemoteDesktopServicesController.InstallSessionHostsCertificate(rdsServer);
|
||||||
|
}
|
||||||
|
|
||||||
|
[WebMethod]
|
||||||
|
public RdsCertificate GetRdsCertificateByServiceId(int serviceId)
|
||||||
|
{
|
||||||
|
return RemoteDesktopServicesController.GetRdsCertificateByServiceId(serviceId);
|
||||||
|
}
|
||||||
|
|
||||||
|
[WebMethod]
|
||||||
|
public ResultObject AddRdsCertificate(RdsCertificate certificate)
|
||||||
|
{
|
||||||
|
return RemoteDesktopServicesController.AddRdsCertificate(certificate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,8 +74,8 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
string GetRdsServerStatus(string serverName);
|
string GetRdsServerStatus(string serverName);
|
||||||
void ShutDownRdsServer(string serverName);
|
void ShutDownRdsServer(string serverName);
|
||||||
void RestartRdsServer(string serverName);
|
void RestartRdsServer(string serverName);
|
||||||
void SaveRdsCollectionLocalAdmins(List<OrganizationUser> users, List<string> hosts);
|
void SaveRdsCollectionLocalAdmins(List<string> users, List<string> hosts, string collectionName, string organizationId);
|
||||||
List<string> GetRdsCollectionLocalAdmins(string hostName);
|
List<string> GetRdsCollectionLocalAdmins(string organizationId, string collectionName);
|
||||||
void MoveRdsServerToTenantOU(string hostName, string organizationId);
|
void MoveRdsServerToTenantOU(string hostName, string organizationId);
|
||||||
void RemoveRdsServerFromTenantOU(string hostName, string organizationId);
|
void RemoveRdsServerFromTenantOU(string hostName, string organizationId);
|
||||||
void InstallCertificate(byte[] certificate, string password, List<string> hostNames);
|
void InstallCertificate(byte[] certificate, string password, List<string> hostNames);
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
|
{
|
||||||
|
public class RdsCertificate
|
||||||
|
{
|
||||||
|
public int Id { get; set; }
|
||||||
|
public int ServiceId { get; set; }
|
||||||
|
public string FileName { get; set; }
|
||||||
|
public string Content { get; set; }
|
||||||
|
public string Hash { get; set; }
|
||||||
|
public DateTime? ValidFrom { get; set; }
|
||||||
|
public DateTime? ExpiryDate { get; set; }
|
||||||
|
}
|
||||||
|
}
|
|
@ -13,5 +13,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
public string SessionState { get; set; }
|
public string SessionState { get; set; }
|
||||||
public string HostServer { get; set; }
|
public string HostServer { get; set; }
|
||||||
public string DomainName { get; set; }
|
public string DomainName { get; set; }
|
||||||
|
public bool IsVip { get; set; }
|
||||||
|
public string SamAccountName { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -129,6 +129,7 @@
|
||||||
<Compile Include="OS\QuotaType.cs" />
|
<Compile Include="OS\QuotaType.cs" />
|
||||||
<Compile Include="OS\SystemFilesPaged.cs" />
|
<Compile Include="OS\SystemFilesPaged.cs" />
|
||||||
<Compile Include="RemoteDesktopServices\IRemoteDesktopServices.cs" />
|
<Compile Include="RemoteDesktopServices\IRemoteDesktopServices.cs" />
|
||||||
|
<Compile Include="RemoteDesktopServices\RdsCertificate.cs" />
|
||||||
<Compile Include="RemoteDesktopServices\RdsCollection.cs" />
|
<Compile Include="RemoteDesktopServices\RdsCollection.cs" />
|
||||||
<Compile Include="RemoteDesktopServices\RdsCollectionPaged.cs" />
|
<Compile Include="RemoteDesktopServices\RdsCollectionPaged.cs" />
|
||||||
<Compile Include="RemoteDesktopServices\RdsCollectionSettings.cs" />
|
<Compile Include="RemoteDesktopServices\RdsCollectionSettings.cs" />
|
||||||
|
|
|
@ -64,6 +64,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
private const string Computers = "Computers";
|
private const string Computers = "Computers";
|
||||||
private const string AdDcComputers = "Domain Controllers";
|
private const string AdDcComputers = "Domain Controllers";
|
||||||
private const string Users = "users";
|
private const string Users = "users";
|
||||||
|
private const string Admins = "Admins";
|
||||||
private const string RdsGroupFormat = "rds-{0}-{1}";
|
private const string RdsGroupFormat = "rds-{0}-{1}";
|
||||||
private const string RdsModuleName = "RemoteDesktopServices";
|
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 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\"";
|
||||||
|
@ -311,6 +312,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
}
|
}
|
||||||
|
|
||||||
CheckOrCreateHelpDeskComputerGroup();
|
CheckOrCreateHelpDeskComputerGroup();
|
||||||
|
string helpDeskGroupSamAccountName = CheckOrCreateAdGroup(GetHelpDeskGroupPath(RDSHelpDeskGroup), GetRootOUPath(), RDSHelpDeskGroup, RDSHelpDeskGroupDescription);
|
||||||
|
|
||||||
if (!ActiveDirectoryUtils.AdObjectExists(GetUsersGroupPath(organizationId, collection.Name)))
|
if (!ActiveDirectoryUtils.AdObjectExists(GetUsersGroupPath(organizationId, collection.Name)))
|
||||||
{
|
{
|
||||||
|
@ -347,7 +349,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
CreateLocalAdministratorsGroup(rdsServer.FqdName, runSpace);
|
CreateLocalAdministratorsGroup(rdsServer.FqdName, runSpace);
|
||||||
}
|
}
|
||||||
|
|
||||||
AddHelpDeskAdminsGroupToLocalAdmins(runSpace, rdsServer.FqdName);
|
AddAdGroupToLocalAdmins(runSpace, rdsServer.FqdName, helpDeskGroupSamAccountName);
|
||||||
AddComputerToCollectionAdComputerGroup(organizationId, collection.Name, rdsServer);
|
AddComputerToCollectionAdComputerGroup(organizationId, collection.Name, rdsServer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -513,11 +515,13 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
|
|
||||||
foreach(var server in servers)
|
foreach(var server in servers)
|
||||||
{
|
{
|
||||||
|
RemoveGroupFromLocalAdmin(server.FqdName, server.Name, GetLocalAdminsGroupName(collectionName), runSpace);
|
||||||
RemoveComputerFromCollectionAdComputerGroup(organizationId, collectionName, server);
|
RemoveComputerFromCollectionAdComputerGroup(organizationId, collectionName, server);
|
||||||
}
|
}
|
||||||
|
|
||||||
ActiveDirectoryUtils.DeleteADObject(GetComputerGroupPath(organizationId, collectionName));
|
ActiveDirectoryUtils.DeleteADObject(GetComputerGroupPath(organizationId, collectionName));
|
||||||
ActiveDirectoryUtils.DeleteADObject(GetUsersGroupPath(organizationId, collectionName));
|
ActiveDirectoryUtils.DeleteADObject(GetUsersGroupPath(organizationId, collectionName));
|
||||||
|
ActiveDirectoryUtils.DeleteADObject(GetGroupPath(organizationId, collectionName, GetLocalAdminsGroupName(collectionName)));
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -531,18 +535,15 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<string> GetCollectionUsers(string collectionName)
|
|
||||||
{
|
|
||||||
return GetUsersToCollectionAdGroup(collectionName);
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool SetUsersInCollection(string organizationId, string collectionName, List<string> users)
|
public bool SetUsersInCollection(string organizationId, string collectionName, List<string> users)
|
||||||
{
|
{
|
||||||
var result = true;
|
var result = true;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
SetUsersToCollectionAdGroup(collectionName, organizationId, users);
|
var usersGroupName = GetUsersGroupName(collectionName);
|
||||||
|
var usersGroupPath = GetUsersGroupPath(organizationId, collectionName);
|
||||||
|
SetUsersToCollectionAdGroup(collectionName, organizationId, users, usersGroupName, usersGroupPath);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -574,13 +575,14 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
ExecuteShellCommand(runSpace, cmd, false);
|
ExecuteShellCommand(runSpace, cmd, false);
|
||||||
|
|
||||||
CheckOrCreateHelpDeskComputerGroup();
|
CheckOrCreateHelpDeskComputerGroup();
|
||||||
|
string helpDeskGroupSamAccountName = CheckOrCreateAdGroup(GetHelpDeskGroupPath(RDSHelpDeskGroup), GetRootOUPath(), RDSHelpDeskGroup, RDSHelpDeskGroupDescription);
|
||||||
|
|
||||||
if (!CheckLocalAdminsGroupExists(server.FqdName, runSpace))
|
if (!CheckLocalAdminsGroupExists(server.FqdName, runSpace))
|
||||||
{
|
{
|
||||||
CreateLocalAdministratorsGroup(server.FqdName, runSpace);
|
CreateLocalAdministratorsGroup(server.FqdName, runSpace);
|
||||||
}
|
}
|
||||||
|
|
||||||
AddHelpDeskAdminsGroupToLocalAdmins(runSpace, server.FqdName);
|
AddAdGroupToLocalAdmins(runSpace, server.FqdName, helpDeskGroupSamAccountName);
|
||||||
AddComputerToCollectionAdComputerGroup(organizationId, collectionName, server);
|
AddComputerToCollectionAdComputerGroup(organizationId, collectionName, server);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
@ -616,6 +618,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
|
|
||||||
ExecuteShellCommand(runSpace, cmd, false);
|
ExecuteShellCommand(runSpace, cmd, false);
|
||||||
|
|
||||||
|
RemoveGroupFromLocalAdmin(server.FqdName, server.Name, GetLocalAdminsGroupName(collectionName), runSpace);
|
||||||
RemoveComputerFromCollectionAdComputerGroup(organizationId, collectionName, server);
|
RemoveComputerFromCollectionAdComputerGroup(organizationId, collectionName, server);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
@ -978,7 +981,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
|
|
||||||
#region Local Admins
|
#region Local Admins
|
||||||
|
|
||||||
public void SaveRdsCollectionLocalAdmins(List<OrganizationUser> users, List<string> hosts)
|
public void SaveRdsCollectionLocalAdmins(List<string> users, List<string> hosts, string collectionName, string organizationId)
|
||||||
{
|
{
|
||||||
Runspace runspace = null;
|
Runspace runspace = null;
|
||||||
|
|
||||||
|
@ -987,6 +990,10 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
runspace = OpenRunspace();
|
runspace = OpenRunspace();
|
||||||
var index = ServerSettings.ADRootDomain.LastIndexOf(".");
|
var index = ServerSettings.ADRootDomain.LastIndexOf(".");
|
||||||
var domainName = ServerSettings.ADRootDomain;
|
var domainName = ServerSettings.ADRootDomain;
|
||||||
|
string groupName = GetLocalAdminsGroupName(collectionName);
|
||||||
|
string groupPath = GetGroupPath(organizationId, collectionName, groupName);
|
||||||
|
string helpDeskGroupSamAccountName = CheckOrCreateAdGroup(GetHelpDeskGroupPath(RDSHelpDeskGroup), GetRootOUPath(), RDSHelpDeskGroup, RDSHelpDeskGroupDescription);
|
||||||
|
string localAdminsGroupSamAccountName = CheckOrCreateAdGroup(groupPath, GetOrganizationPath(organizationId), groupName, WspAdministratorsGroupDescription);
|
||||||
|
|
||||||
if (index > 0)
|
if (index > 0)
|
||||||
{
|
{
|
||||||
|
@ -1006,22 +1013,10 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var existingAdmins = GetExistingLocalAdmins(hostName, runspace).Select(e => e.ToLower());
|
AddAdGroupToLocalAdmins(runspace, hostName, helpDeskGroupSamAccountName);
|
||||||
var formUsers = users.Select(u => string.Format("{0}\\{1}", domainName, u.SamAccountName).ToLower());
|
AddAdGroupToLocalAdmins(runspace, hostName, localAdminsGroupSamAccountName);
|
||||||
var newUsers = users.Where(u => !existingAdmins.Contains(string.Format("{0}\\{1}", domainName, u.SamAccountName).ToLower()));
|
|
||||||
var removedUsers = existingAdmins.Where(e => !formUsers.Contains(e));
|
|
||||||
|
|
||||||
foreach (var user in newUsers)
|
SetUsersToCollectionAdGroup(collectionName, organizationId, users, GetLocalAdminsGroupName(collectionName), groupPath);
|
||||||
{
|
|
||||||
AddNewLocalAdmin(hostName, user.SamAccountName, runspace);
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var user in removedUsers)
|
|
||||||
{
|
|
||||||
RemoveLocalAdmin(hostName, user, runspace);
|
|
||||||
}
|
|
||||||
|
|
||||||
AddHelpDeskAdminsGroupToLocalAdmins(runspace, hostName);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
@ -1030,26 +1025,10 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<string> GetRdsCollectionLocalAdmins(string hostName)
|
public List<string> GetRdsCollectionLocalAdmins(string organizationId, string collectionName)
|
||||||
{
|
{
|
||||||
Runspace runspace = null;
|
string groupName = GetLocalAdminsGroupName(collectionName);
|
||||||
var result = new List<string>();
|
return GetUsersToCollectionAdGroup(collectionName, groupName, organizationId);
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
runspace = OpenRunspace();
|
|
||||||
|
|
||||||
if (CheckLocalAdminsGroupExists(hostName, runspace))
|
|
||||||
{
|
|
||||||
result = GetExistingLocalAdmins(hostName, runspace);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
finally
|
|
||||||
{
|
|
||||||
CloseRunspace(runspace);
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool CheckLocalAdminsGroupExists(string hostName, Runspace runspace)
|
private bool CheckLocalAdminsGroupExists(string hostName, Runspace runspace)
|
||||||
|
@ -1099,57 +1078,17 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
return errors;
|
return errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<string> GetExistingLocalAdmins(string hostName, Runspace runspace)
|
private void RemoveGroupFromLocalAdmin(string fqdnName, string hostName, string groupName, Runspace runspace)
|
||||||
{
|
|
||||||
var result = new List<string>();
|
|
||||||
|
|
||||||
var scripts = new List<string>
|
|
||||||
{
|
|
||||||
string.Format("net localgroup {0} | select -skip 6", WspAdministratorsGroupName)
|
|
||||||
};
|
|
||||||
|
|
||||||
object[] errors = null;
|
|
||||||
var exitingAdmins = ExecuteRemoteShellCommand(runspace, hostName, scripts, out errors);
|
|
||||||
|
|
||||||
if (!errors.Any())
|
|
||||||
{
|
|
||||||
foreach(var user in exitingAdmins.Take(exitingAdmins.Count - 2))
|
|
||||||
{
|
|
||||||
result.Add(user.ToString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
private object[] AddNewLocalAdmin(string hostName, string samAccountName, Runspace runspace)
|
|
||||||
{
|
{
|
||||||
var scripts = new List<string>
|
var scripts = new List<string>
|
||||||
{
|
{
|
||||||
string.Format("$GroupObj = [ADSI]\"WinNT://{0}/{1}\"", hostName, WspAdministratorsGroupName),
|
string.Format("$GroupObj = [ADSI]\"WinNT://{0}/{1}\"", hostName, WspAdministratorsGroupName),
|
||||||
string.Format("$GroupObj.Add(\"WinNT://{0}/{1}\")", ServerSettings.ADRootDomain, samAccountName)
|
string.Format("$GroupObj.Remove(\"WinNT://{0}/{1}\")", ServerSettings.ADRootDomain, RDSHelpDeskGroup),
|
||||||
|
string.Format("$GroupObj.Remove(\"WinNT://{0}/{1}\")", ServerSettings.ADRootDomain, groupName)
|
||||||
};
|
};
|
||||||
|
|
||||||
object[] errors = null;
|
object[] errors = null;
|
||||||
ExecuteRemoteShellCommand(runspace, hostName, scripts, out errors);
|
ExecuteRemoteShellCommand(runspace, fqdnName, scripts, out errors);
|
||||||
|
|
||||||
return errors;
|
|
||||||
}
|
|
||||||
|
|
||||||
private object[] RemoveLocalAdmin(string hostName, string user, Runspace runspace)
|
|
||||||
{
|
|
||||||
var userObject = user.Split('\\');
|
|
||||||
|
|
||||||
var scripts = new List<string>
|
|
||||||
{
|
|
||||||
string.Format("$GroupObj = [ADSI]\"WinNT://{0}/{1}\"", hostName, WspAdministratorsGroupName),
|
|
||||||
string.Format("$GroupObj.Remove(\"WinNT://{0}/{1}\")", userObject[0], userObject[1])
|
|
||||||
};
|
|
||||||
|
|
||||||
object[] errors = null;
|
|
||||||
ExecuteRemoteShellCommand(runspace, hostName, scripts, out errors);
|
|
||||||
|
|
||||||
return errors;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -1177,23 +1116,22 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddHelpDeskAdminsGroupToLocalAdmins(Runspace runspace, string hostName)
|
private string CheckOrCreateAdGroup(string groupPath, string rootPath, string groupName, string description)
|
||||||
{
|
{
|
||||||
var helpDeskAdminsGroupPath = GetHelpDeskGroupPath(RDSHelpDeskGroup);
|
|
||||||
DirectoryEntry groupEntry = null;
|
DirectoryEntry groupEntry = null;
|
||||||
|
|
||||||
if (!ActiveDirectoryUtils.AdObjectExists(helpDeskAdminsGroupPath))
|
if (!ActiveDirectoryUtils.AdObjectExists(groupPath))
|
||||||
{
|
{
|
||||||
ActiveDirectoryUtils.CreateGroup(GetRootOUPath(), RDSHelpDeskGroup);
|
ActiveDirectoryUtils.CreateGroup(rootPath, groupName);
|
||||||
groupEntry = ActiveDirectoryUtils.GetADObject(helpDeskAdminsGroupPath);
|
groupEntry = ActiveDirectoryUtils.GetADObject(groupPath);
|
||||||
|
|
||||||
if (groupEntry.Properties.Contains("Description"))
|
if (groupEntry.Properties.Contains("Description"))
|
||||||
{
|
{
|
||||||
groupEntry.Properties["Description"][0] = RDSHelpDeskGroupDescription;
|
groupEntry.Properties["Description"][0] = description;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
groupEntry.Properties["Description"].Add(RDSHelpDeskGroupDescription);
|
groupEntry.Properties["Description"].Add(description);
|
||||||
}
|
}
|
||||||
|
|
||||||
groupEntry.CommitChanges();
|
groupEntry.CommitChanges();
|
||||||
|
@ -1201,11 +1139,14 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
|
|
||||||
if (groupEntry == null)
|
if (groupEntry == null)
|
||||||
{
|
{
|
||||||
groupEntry = ActiveDirectoryUtils.GetADObject(helpDeskAdminsGroupPath);
|
groupEntry = ActiveDirectoryUtils.GetADObject(groupPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
var samAccountName = ActiveDirectoryUtils.GetADObjectProperty(groupEntry, "sAMAccountName");
|
return ActiveDirectoryUtils.GetADObjectProperty(groupEntry, "sAMAccountName").ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AddAdGroupToLocalAdmins(Runspace runspace, string hostName, string samAccountName)
|
||||||
|
{
|
||||||
var scripts = new List<string>
|
var scripts = new List<string>
|
||||||
{
|
{
|
||||||
string.Format("$GroupObj = [ADSI]\"WinNT://{0}/{1}\"", hostName, WspAdministratorsGroupName),
|
string.Format("$GroupObj = [ADSI]\"WinNT://{0}/{1}\"", hostName, WspAdministratorsGroupName),
|
||||||
|
@ -1355,21 +1296,17 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SetUsersToCollectionAdGroup(string collectionName, string organizationId, IEnumerable<string> users)
|
private void SetUsersToCollectionAdGroup(string collectionName, string organizationId, IEnumerable<string> users, string groupName, string groupPath)
|
||||||
{
|
{
|
||||||
var usersGroupName = GetUsersGroupName(collectionName);
|
|
||||||
var usersGroupPath = GetUsersGroupPath(organizationId, collectionName);
|
|
||||||
var orgPath = GetOrganizationPath(organizationId);
|
var orgPath = GetOrganizationPath(organizationId);
|
||||||
var orgEntry = ActiveDirectoryUtils.GetADObject(orgPath);
|
var orgEntry = ActiveDirectoryUtils.GetADObject(orgPath);
|
||||||
var groupUsers = ActiveDirectoryUtils.GetGroupObjects(usersGroupName, "user", orgEntry);
|
var groupUsers = ActiveDirectoryUtils.GetGroupObjects(groupName, "user", orgEntry);
|
||||||
|
|
||||||
//remove all users from group
|
|
||||||
foreach (string userPath in groupUsers)
|
foreach (string userPath in groupUsers)
|
||||||
{
|
{
|
||||||
ActiveDirectoryUtils.RemoveObjectFromGroup(userPath, usersGroupPath);
|
ActiveDirectoryUtils.RemoveObjectFromGroup(userPath, groupPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
//adding users to group
|
|
||||||
foreach (var user in users)
|
foreach (var user in users)
|
||||||
{
|
{
|
||||||
var userPath = GetUserPath(organizationId, user);
|
var userPath = GetUserPath(organizationId, user);
|
||||||
|
@ -1378,19 +1315,18 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
{
|
{
|
||||||
var userObject = ActiveDirectoryUtils.GetADObject(userPath);
|
var userObject = ActiveDirectoryUtils.GetADObject(userPath);
|
||||||
var samName = (string)ActiveDirectoryUtils.GetADObjectProperty(userObject, "sAMAccountName");
|
var samName = (string)ActiveDirectoryUtils.GetADObjectProperty(userObject, "sAMAccountName");
|
||||||
var userGroupsPath = GetUsersGroupPath(organizationId, collectionName);
|
ActiveDirectoryUtils.AddObjectToGroup(userPath, groupPath);
|
||||||
ActiveDirectoryUtils.AddObjectToGroup(userPath, userGroupsPath);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<string> GetUsersToCollectionAdGroup(string collectionName)
|
private List<string> GetUsersToCollectionAdGroup(string collectionName, string groupName, string organizationId)
|
||||||
{
|
{
|
||||||
var users = new List<string>();
|
var users = new List<string>();
|
||||||
|
var orgPath = GetOrganizationPath(organizationId);
|
||||||
|
var orgEntry = ActiveDirectoryUtils.GetADObject(orgPath);
|
||||||
|
|
||||||
var usersGroupName = GetUsersGroupName(collectionName);
|
foreach (string userPath in ActiveDirectoryUtils.GetGroupObjects(groupName, "user", orgEntry))
|
||||||
|
|
||||||
foreach (string userPath in ActiveDirectoryUtils.GetGroupObjects(usersGroupName, "user"))
|
|
||||||
{
|
{
|
||||||
var userObject = ActiveDirectoryUtils.GetADObject(userPath);
|
var userObject = ActiveDirectoryUtils.GetADObject(userPath);
|
||||||
var samName = (string)ActiveDirectoryUtils.GetADObjectProperty(userObject, "sAMAccountName");
|
var samName = (string)ActiveDirectoryUtils.GetADObjectProperty(userObject, "sAMAccountName");
|
||||||
|
@ -1738,6 +1674,11 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
return string.Format(RdsGroupFormat, collectionName, Users.ToLowerInvariant());
|
return string.Format(RdsGroupFormat, collectionName, Users.ToLowerInvariant());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string GetLocalAdminsGroupName(string collectionName)
|
||||||
|
{
|
||||||
|
return string.Format(RdsGroupFormat, collectionName, Admins.ToLowerInvariant());
|
||||||
|
}
|
||||||
|
|
||||||
internal string GetComputerGroupPath(string organizationId, string collection)
|
internal string GetComputerGroupPath(string organizationId, string collection)
|
||||||
{
|
{
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
@ -1766,6 +1707,20 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string GetGroupPath(string organizationId, string collectionName, string groupName)
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
|
AppendProtocol(sb);
|
||||||
|
AppendDomainController(sb);
|
||||||
|
AppendCNPath(sb, groupName);
|
||||||
|
AppendOUPath(sb, organizationId);
|
||||||
|
AppendOUPath(sb, RootOU);
|
||||||
|
AppendDomainPath(sb, RootDomain);
|
||||||
|
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
private string GetUserPath(string organizationId, string loginName)
|
private string GetUserPath(string organizationId, string loginName)
|
||||||
{
|
{
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
@ -2294,14 +2249,18 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
|
|
||||||
foreach(var userSession in userSessions)
|
foreach(var userSession in userSessions)
|
||||||
{
|
{
|
||||||
var session = new RdsUserSession();
|
var session = new RdsUserSession
|
||||||
|
|
||||||
foreach(var prop in properties)
|
|
||||||
{
|
{
|
||||||
prop.SetValue(session, GetPSObjectProperty(userSession, prop.Name).ToString(), null);
|
CollectionName = GetPSObjectProperty(userSession, "CollectionName").ToString(),
|
||||||
}
|
DomainName = GetPSObjectProperty(userSession, "DomainName").ToString(),
|
||||||
|
HostServer = GetPSObjectProperty(userSession, "HostServer").ToString(),
|
||||||
|
SessionState = GetPSObjectProperty(userSession, "SessionState").ToString(),
|
||||||
|
UnifiedSessionId = GetPSObjectProperty(userSession, "UnifiedSessionId").ToString(),
|
||||||
|
SamAccountName = GetPSObjectProperty(userSession, "UserName").ToString(),
|
||||||
|
};
|
||||||
|
|
||||||
session.UserName = GetUserFullName(session.DomainName, session.UserName, runSpace);
|
session.IsVip = false;
|
||||||
|
session.UserName = GetUserFullName(session.DomainName, session.SamAccountName, runSpace);
|
||||||
result.Add(session);
|
result.Add(session);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,6 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
|
||||||
using System.Web.Services.Protocols;
|
using System.Web.Services.Protocols;
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using WebsitePanel.Providers.HostedSolution;
|
|
||||||
|
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
|
@ -1515,17 +1514,21 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
|
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
|
||||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SaveRdsCollectionLocalAdmins", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SaveRdsCollectionLocalAdmins", 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 SaveRdsCollectionLocalAdmins(OrganizationUser[] users, string[] hosts) {
|
public void SaveRdsCollectionLocalAdmins(string[] users, string[] hosts, string organizationId, string collectionName) {
|
||||||
this.Invoke("SaveRdsCollectionLocalAdmins", new object[] {
|
this.Invoke("SaveRdsCollectionLocalAdmins", new object[] {
|
||||||
users,
|
users,
|
||||||
hosts});
|
hosts,
|
||||||
|
organizationId,
|
||||||
|
collectionName});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public System.IAsyncResult BeginSaveRdsCollectionLocalAdmins(OrganizationUser[] users, string[] hosts, System.AsyncCallback callback, object asyncState) {
|
public System.IAsyncResult BeginSaveRdsCollectionLocalAdmins(string[] users, string[] hosts, string organizationId, string collectionName, System.AsyncCallback callback, object asyncState) {
|
||||||
return this.BeginInvoke("SaveRdsCollectionLocalAdmins", new object[] {
|
return this.BeginInvoke("SaveRdsCollectionLocalAdmins", new object[] {
|
||||||
users,
|
users,
|
||||||
hosts}, callback, asyncState);
|
hosts,
|
||||||
|
organizationId,
|
||||||
|
collectionName}, callback, asyncState);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
|
@ -1534,18 +1537,20 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public void SaveRdsCollectionLocalAdminsAsync(OrganizationUser[] users, string[] hosts) {
|
public void SaveRdsCollectionLocalAdminsAsync(string[] users, string[] hosts, string organizationId, string collectionName) {
|
||||||
this.SaveRdsCollectionLocalAdminsAsync(users, hosts, null);
|
this.SaveRdsCollectionLocalAdminsAsync(users, hosts, organizationId, collectionName, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public void SaveRdsCollectionLocalAdminsAsync(OrganizationUser[] users, string[] hosts, object userState) {
|
public void SaveRdsCollectionLocalAdminsAsync(string[] users, string[] hosts, string organizationId, string collectionName, object userState) {
|
||||||
if ((this.SaveRdsCollectionLocalAdminsOperationCompleted == null)) {
|
if ((this.SaveRdsCollectionLocalAdminsOperationCompleted == null)) {
|
||||||
this.SaveRdsCollectionLocalAdminsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSaveRdsCollectionLocalAdminsOperationCompleted);
|
this.SaveRdsCollectionLocalAdminsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSaveRdsCollectionLocalAdminsOperationCompleted);
|
||||||
}
|
}
|
||||||
this.InvokeAsync("SaveRdsCollectionLocalAdmins", new object[] {
|
this.InvokeAsync("SaveRdsCollectionLocalAdmins", new object[] {
|
||||||
users,
|
users,
|
||||||
hosts}, this.SaveRdsCollectionLocalAdminsOperationCompleted, userState);
|
hosts,
|
||||||
|
organizationId,
|
||||||
|
collectionName}, this.SaveRdsCollectionLocalAdminsOperationCompleted, userState);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnSaveRdsCollectionLocalAdminsOperationCompleted(object arg) {
|
private void OnSaveRdsCollectionLocalAdminsOperationCompleted(object arg) {
|
||||||
|
@ -1558,16 +1563,18 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
|
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
|
||||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetRdsCollectionLocalAdmins", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetRdsCollectionLocalAdmins", 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 string[] GetRdsCollectionLocalAdmins(string hostName) {
|
public string[] GetRdsCollectionLocalAdmins(string organizationId, string collectionName) {
|
||||||
object[] results = this.Invoke("GetRdsCollectionLocalAdmins", new object[] {
|
object[] results = this.Invoke("GetRdsCollectionLocalAdmins", new object[] {
|
||||||
hostName});
|
organizationId,
|
||||||
|
collectionName});
|
||||||
return ((string[])(results[0]));
|
return ((string[])(results[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public System.IAsyncResult BeginGetRdsCollectionLocalAdmins(string hostName, System.AsyncCallback callback, object asyncState) {
|
public System.IAsyncResult BeginGetRdsCollectionLocalAdmins(string organizationId, string collectionName, System.AsyncCallback callback, object asyncState) {
|
||||||
return this.BeginInvoke("GetRdsCollectionLocalAdmins", new object[] {
|
return this.BeginInvoke("GetRdsCollectionLocalAdmins", new object[] {
|
||||||
hostName}, callback, asyncState);
|
organizationId,
|
||||||
|
collectionName}, callback, asyncState);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
|
@ -1577,17 +1584,18 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public void GetRdsCollectionLocalAdminsAsync(string hostName) {
|
public void GetRdsCollectionLocalAdminsAsync(string organizationId, string collectionName) {
|
||||||
this.GetRdsCollectionLocalAdminsAsync(hostName, null);
|
this.GetRdsCollectionLocalAdminsAsync(organizationId, collectionName, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public void GetRdsCollectionLocalAdminsAsync(string hostName, object userState) {
|
public void GetRdsCollectionLocalAdminsAsync(string organizationId, string collectionName, object userState) {
|
||||||
if ((this.GetRdsCollectionLocalAdminsOperationCompleted == null)) {
|
if ((this.GetRdsCollectionLocalAdminsOperationCompleted == null)) {
|
||||||
this.GetRdsCollectionLocalAdminsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRdsCollectionLocalAdminsOperationCompleted);
|
this.GetRdsCollectionLocalAdminsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRdsCollectionLocalAdminsOperationCompleted);
|
||||||
}
|
}
|
||||||
this.InvokeAsync("GetRdsCollectionLocalAdmins", new object[] {
|
this.InvokeAsync("GetRdsCollectionLocalAdmins", new object[] {
|
||||||
hostName}, this.GetRdsCollectionLocalAdminsOperationCompleted, userState);
|
organizationId,
|
||||||
|
collectionName}, this.GetRdsCollectionLocalAdminsOperationCompleted, userState);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnGetRdsCollectionLocalAdminsOperationCompleted(object arg) {
|
private void OnGetRdsCollectionLocalAdminsOperationCompleted(object arg) {
|
||||||
|
|
|
@ -566,12 +566,12 @@ namespace WebsitePanel.Server
|
||||||
}
|
}
|
||||||
|
|
||||||
[WebMethod, SoapHeader("settings")]
|
[WebMethod, SoapHeader("settings")]
|
||||||
public void SaveRdsCollectionLocalAdmins(List<OrganizationUser> users, List<string> hosts)
|
public void SaveRdsCollectionLocalAdmins(List<string> users, List<string> hosts, string organizationId, string collectionName)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Log.WriteStart("'{0}' SaveRdsCollectionLocalAdmins", ProviderSettings.ProviderName);
|
Log.WriteStart("'{0}' SaveRdsCollectionLocalAdmins", ProviderSettings.ProviderName);
|
||||||
RDSProvider.SaveRdsCollectionLocalAdmins(users, hosts);
|
RDSProvider.SaveRdsCollectionLocalAdmins(users, hosts, collectionName, organizationId);
|
||||||
Log.WriteEnd("'{0}' SaveRdsCollectionLocalAdmins", ProviderSettings.ProviderName);
|
Log.WriteEnd("'{0}' SaveRdsCollectionLocalAdmins", ProviderSettings.ProviderName);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
@ -582,12 +582,12 @@ namespace WebsitePanel.Server
|
||||||
}
|
}
|
||||||
|
|
||||||
[WebMethod, SoapHeader("settings")]
|
[WebMethod, SoapHeader("settings")]
|
||||||
public List<string> GetRdsCollectionLocalAdmins(string hostName)
|
public List<string> GetRdsCollectionLocalAdmins(string organizationId, string collectionName)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Log.WriteStart("'{0}' GetRdsCollectionLocalAdmins", ProviderSettings.ProviderName);
|
Log.WriteStart("'{0}' GetRdsCollectionLocalAdmins", ProviderSettings.ProviderName);
|
||||||
var result = RDSProvider.GetRdsCollectionLocalAdmins(hostName);
|
var result = RDSProvider.GetRdsCollectionLocalAdmins(organizationId, collectionName);
|
||||||
Log.WriteEnd("'{0}' GetRdsCollectionLocalAdmins", ProviderSettings.ProviderName);
|
Log.WriteEnd("'{0}' GetRdsCollectionLocalAdmins", ProviderSettings.ProviderName);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|
|
@ -5656,6 +5656,9 @@
|
||||||
<data name="ERROR.RDSSESSIONHOST_CERTIFICATE_NOT_INSTALLED" xml:space="preserve">
|
<data name="ERROR.RDSSESSIONHOST_CERTIFICATE_NOT_INSTALLED" xml:space="preserve">
|
||||||
<value>Session host certificate not installed</value>
|
<value>Session host certificate not installed</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Success.RDSSESSIONHOST_CERTIFICATE_INSTALLED" xml:space="preserve">
|
||||||
|
<value>Session host certificate has been installed</value>
|
||||||
|
</data>
|
||||||
<data name="ERROR.RDSCOLLECTIONSETTINGS_NOT_UPDATES" xml:space="preserve">
|
<data name="ERROR.RDSCOLLECTIONSETTINGS_NOT_UPDATES" xml:space="preserve">
|
||||||
<value>RDS Collection settings not updated</value>
|
<value>RDS Collection settings not updated</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
|
@ -120,6 +120,9 @@
|
||||||
<data name="btnAddRDSServer.Text" xml:space="preserve">
|
<data name="btnAddRDSServer.Text" xml:space="preserve">
|
||||||
<value>Add RDS Server</value>
|
<value>Add RDS Server</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="gvPopupStatus.HeaderText" xml:space="preserve">
|
||||||
|
<value>Status</value>
|
||||||
|
</data>
|
||||||
<data name="gvRDSServers.Empty" xml:space="preserve">
|
<data name="gvRDSServers.Empty" xml:space="preserve">
|
||||||
<value>The list of RDS Servers is empty.<br><br>To add a new Server click "Add RDS Sever" button.</value>
|
<value>The list of RDS Servers is empty.<br><br>To add a new Server click "Add RDS Sever" button.</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
|
@ -52,11 +52,15 @@ namespace WebsitePanel.Portal
|
||||||
{
|
{
|
||||||
rdsServers = ES.Services.RDS.GetRdsServersPaged("", filterValue, sortColumn, startRowIndex, maximumRows);
|
rdsServers = ES.Services.RDS.GetRdsServersPaged("", filterValue, sortColumn, startRowIndex, maximumRows);
|
||||||
|
|
||||||
|
foreach (var rdsServer in rdsServers.Servers)
|
||||||
|
{
|
||||||
|
if (rdsServer.ItemId.HasValue)
|
||||||
|
{
|
||||||
|
rdsServer.Status = ES.Services.RDS.GetRdsServerStatus(rdsServer.ItemId.Value, rdsServer.FqdName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return rdsServers.Servers;
|
return rdsServers.Servers;
|
||||||
//return new RdsServer[] { new RdsServer { Name = "rds.1.server", FqdName = "", Address = "127.0.0.1" },
|
|
||||||
// new RdsServer { Name = "rds.2.server", FqdName = "", Address = "127.0.0.2" },
|
|
||||||
// new RdsServer { Name = "rds.3.server", FqdName = "", Address = "127.0.0.3" },
|
|
||||||
// new RdsServer { Name = "rds.4.server", FqdName = "", Address = "127.0.0.4" }};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int GetOrganizationRdsServersPagedCount(int itemId, string filterValue)
|
public int GetOrganizationRdsServersPagedCount(int itemId, string filterValue)
|
||||||
|
|
|
@ -126,4 +126,7 @@
|
||||||
<data name="ServerNameColumn.HeaderText" xml:space="preserve">
|
<data name="ServerNameColumn.HeaderText" xml:space="preserve">
|
||||||
<value>Server Name</value>
|
<value>Server Name</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="lblPFXInstallPassword.Text" xml:space="preserve">
|
||||||
|
<value>Certificate Password:</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
|
@ -1,5 +1,17 @@
|
||||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="RDS_Settings.ascx.cs" Inherits="WebsitePanel.Portal.ProviderControls.RDS_Settings" %>
|
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="RDS_Settings.ascx.cs" Inherits="WebsitePanel.Portal.ProviderControls.RDS_Settings" %>
|
||||||
<table>
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td colspan ="2" style="padding: 10px 0 10px 0;"><asp:FileUpload ID="upPFX" runat="server"/></td>
|
||||||
|
</tr>
|
||||||
|
<tr><td></td></tr>
|
||||||
|
<tr>
|
||||||
|
<td class="SubHead" style="width:200px" nowrap>
|
||||||
|
<asp:Localize runat="server" meta:resourcekey="lblPFXInstallPassword" />
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<asp:TextBox ID="txtPFXInstallPassword" runat="server" TextMode="Password" Width="200px" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="SubHead" width="200" nowrap>
|
<td class="SubHead" width="200" nowrap>
|
||||||
<asp:Label runat="server" ID="lblConnectionBroker" meta:resourcekey="lblConnectionBroker" Text="Connection Broker:"/>
|
<asp:Label runat="server" ID="lblConnectionBroker" meta:resourcekey="lblConnectionBroker" Text="Connection Broker:"/>
|
||||||
|
|
|
@ -31,6 +31,7 @@ using System.Collections.Generic;
|
||||||
using System.Web.UI.WebControls;
|
using System.Web.UI.WebControls;
|
||||||
using WebsitePanel.EnterpriseServer;
|
using WebsitePanel.EnterpriseServer;
|
||||||
using WebsitePanel.Providers.Common;
|
using WebsitePanel.Providers.Common;
|
||||||
|
using WebsitePanel.Providers.RemoteDesktopServices;
|
||||||
|
|
||||||
namespace WebsitePanel.Portal.ProviderControls
|
namespace WebsitePanel.Portal.ProviderControls
|
||||||
{
|
{
|
||||||
|
@ -58,7 +59,6 @@ namespace WebsitePanel.Portal.ProviderControls
|
||||||
txtConnectionBroker.Text = settings["ConnectionBroker"];
|
txtConnectionBroker.Text = settings["ConnectionBroker"];
|
||||||
|
|
||||||
GWServers = settings["GWServrsList"];
|
GWServers = settings["GWServrsList"];
|
||||||
|
|
||||||
UpdateLyncServersGrid();
|
UpdateLyncServersGrid();
|
||||||
|
|
||||||
txtRootOU.Text = settings["RootOU"];
|
txtRootOU.Text = settings["RootOU"];
|
||||||
|
@ -87,6 +87,25 @@ namespace WebsitePanel.Portal.ProviderControls
|
||||||
settings["CentralNPS"] = chkUseCentralNPS.Checked ? txtCentralNPS.Text : string.Empty;
|
settings["CentralNPS"] = chkUseCentralNPS.Checked ? txtCentralNPS.Text : string.Empty;
|
||||||
|
|
||||||
settings["GWServrsList"] = GWServers;
|
settings["GWServrsList"] = GWServers;
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (upPFX.HasFile.Equals(true))
|
||||||
|
{
|
||||||
|
var certificate = new RdsCertificate
|
||||||
|
{
|
||||||
|
ServiceId = PanelRequest.ServiceId,
|
||||||
|
Content = Convert.ToBase64String(upPFX.FileBytes),
|
||||||
|
FileName = upPFX.FileName,
|
||||||
|
Hash = txtPFXInstallPassword.Text
|
||||||
|
};
|
||||||
|
|
||||||
|
ES.Services.RDS.AddRdsCertificate(certificate);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void chkUseCentralNPS_CheckedChanged(object sender, EventArgs e)
|
protected void chkUseCentralNPS_CheckedChanged(object sender, EventArgs e)
|
||||||
|
|
|
@ -1,31 +1,3 @@
|
||||||
// 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.
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
|
@ -40,6 +12,24 @@ namespace WebsitePanel.Portal.ProviderControls {
|
||||||
|
|
||||||
public partial class RDS_Settings {
|
public partial class RDS_Settings {
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// upPFX 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.FileUpload upPFX;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// txtPFXInstallPassword 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 txtPFXInstallPassword;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// lblConnectionBroker control.
|
/// lblConnectionBroker control.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -145,7 +145,7 @@
|
||||||
<value>Assigned RDS Servers</value>
|
<value>Assigned RDS Servers</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="locQuota.Text" xml:space="preserve">
|
<data name="locQuota.Text" xml:space="preserve">
|
||||||
<value>Total RDS Servers Allocated:</value>
|
<value>Total Remote Desktop Servers Allocated:</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="cmdDisable.Text" xml:space="preserve">
|
<data name="cmdDisable.Text" xml:space="preserve">
|
||||||
<value>Disable</value>
|
<value>Disable</value>
|
||||||
|
|
|
@ -147,4 +147,7 @@
|
||||||
<data name="gvServer.Header" xml:space="preserve">
|
<data name="gvServer.Header" xml:space="preserve">
|
||||||
<value>RDS Server</value>
|
<value>RDS Server</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="locQuota.Text" xml:space="preserve">
|
||||||
|
<value>Total Remote Desktop Collections Created:</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
|
@ -153,4 +153,10 @@
|
||||||
<data name="locLblApplicationName" xml:space="preserve">
|
<data name="locLblApplicationName" xml:space="preserve">
|
||||||
<value>Application Name</value>
|
<value>Application Name</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="btnExit.Text" xml:space="preserve">
|
||||||
|
<value>Back to Applications List</value>
|
||||||
|
</data>
|
||||||
|
<data name="btnSaveExit.Text" xml:space="preserve">
|
||||||
|
<value>Save Changes and Exit</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
|
@ -144,4 +144,7 @@
|
||||||
<data name="secRdsUsers.Text" xml:space="preserve">
|
<data name="secRdsUsers.Text" xml:space="preserve">
|
||||||
<value>RDS Users</value>
|
<value>RDS Users</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="locQuota.Text" xml:space="preserve">
|
||||||
|
<value>Total RDS Users Assigned:</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
|
@ -72,6 +72,11 @@
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
</Columns>
|
</Columns>
|
||||||
</asp:GridView>
|
</asp:GridView>
|
||||||
|
<div>
|
||||||
|
<asp:Localize ID="locQuota" runat="server" meta:resourcekey="locQuota" Text="RDS Servers:"></asp:Localize>
|
||||||
|
|
||||||
|
<wsp:QuotaViewer ID="rdsServersQuota" runat="server" QuotaTypeId="2" DisplayGauge="true"/>
|
||||||
|
</div>
|
||||||
<asp:ObjectDataSource ID="odsRDSAssignedServersPaged" runat="server" EnablePaging="True"
|
<asp:ObjectDataSource ID="odsRDSAssignedServersPaged" runat="server" EnablePaging="True"
|
||||||
SelectCountMethod="GetOrganizationRdsServersPagedCount"
|
SelectCountMethod="GetOrganizationRdsServersPagedCount"
|
||||||
SelectMethod="GetOrganizationRdsServersPaged"
|
SelectMethod="GetOrganizationRdsServersPaged"
|
||||||
|
|
|
@ -41,18 +41,32 @@ namespace WebsitePanel.Portal.RDS
|
||||||
{
|
{
|
||||||
protected void Page_Load(object sender, EventArgs e)
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId);
|
||||||
|
|
||||||
if (!IsPostBack)
|
if (!IsPostBack)
|
||||||
{
|
{
|
||||||
|
BindQuota(cntx);
|
||||||
}
|
}
|
||||||
|
|
||||||
PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId);
|
|
||||||
if (cntx.Quotas.ContainsKey(Quotas.RDS_SERVERS))
|
if (cntx.Quotas.ContainsKey(Quotas.RDS_SERVERS))
|
||||||
{
|
{
|
||||||
btnAddServerToOrg.Enabled = (!(cntx.Quotas[Quotas.RDS_SERVERS].QuotaAllocatedValue <= gvRDSAssignedServers.Rows.Count) || (cntx.Quotas[Quotas.RDS_SERVERS].QuotaAllocatedValue == -1));
|
btnAddServerToOrg.Enabled = (!(cntx.Quotas[Quotas.RDS_SERVERS].QuotaAllocatedValue <= gvRDSAssignedServers.Rows.Count) || (cntx.Quotas[Quotas.RDS_SERVERS].QuotaAllocatedValue == -1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void BindQuota(PackageContext cntx)
|
||||||
|
{
|
||||||
|
OrganizationStatistics stats = ES.Services.Organizations.GetOrganizationStatisticsByOrganization(PanelRequest.ItemID);
|
||||||
|
OrganizationStatistics tenantStats = ES.Services.Organizations.GetOrganizationStatistics(PanelRequest.ItemID);
|
||||||
|
rdsServersQuota.QuotaUsedValue = stats.CreatedRdsServers;
|
||||||
|
rdsServersQuota.QuotaValue = stats.AllocatedRdsServers;
|
||||||
|
|
||||||
|
if (stats.AllocatedUsers != -1)
|
||||||
|
{
|
||||||
|
rdsServersQuota.QuotaAvailable = tenantStats.AllocatedRdsServers - tenantStats.CreatedRdsServers;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected void btnAddServerToOrg_Click(object sender, EventArgs e)
|
protected void btnAddServerToOrg_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "rds_add_server",
|
Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "rds_add_server",
|
||||||
|
|
|
@ -1,31 +1,3 @@
|
||||||
// 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.
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
|
@ -139,6 +111,24 @@ namespace WebsitePanel.Portal.RDS {
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::System.Web.UI.WebControls.GridView gvRDSAssignedServers;
|
protected global::System.Web.UI.WebControls.GridView gvRDSAssignedServers;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// locQuota 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.Localize locQuota;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// rdsServersQuota control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::WebsitePanel.Portal.QuotaViewer rdsServersQuota;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// odsRDSAssignedServersPaged control.
|
/// odsRDSAssignedServersPaged control.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -66,6 +66,11 @@
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
</Columns>
|
</Columns>
|
||||||
</asp:GridView>
|
</asp:GridView>
|
||||||
|
<div>
|
||||||
|
<asp:Localize ID="locQuota" runat="server" meta:resourcekey="locQuota" Text="Collections Created:"></asp:Localize>
|
||||||
|
|
||||||
|
<wsp:QuotaViewer ID="collectionsQuota" runat="server" QuotaTypeId="2" DisplayGauge="true" />
|
||||||
|
</div>
|
||||||
<asp:ObjectDataSource ID="odsRDSCollectionsPaged" runat="server" EnablePaging="True"
|
<asp:ObjectDataSource ID="odsRDSCollectionsPaged" runat="server" EnablePaging="True"
|
||||||
SelectCountMethod="GetRDSCollectonsPagedCount"
|
SelectCountMethod="GetRDSCollectonsPagedCount"
|
||||||
SelectMethod="GetRDSCollectonsPaged"
|
SelectMethod="GetRDSCollectonsPaged"
|
||||||
|
|
|
@ -42,17 +42,32 @@ namespace WebsitePanel.Portal.RDS
|
||||||
{
|
{
|
||||||
protected void Page_Load(object sender, EventArgs e)
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId);
|
||||||
|
|
||||||
if (!IsPostBack)
|
if (!IsPostBack)
|
||||||
{
|
{
|
||||||
|
BindQuota(cntx);
|
||||||
}
|
}
|
||||||
|
|
||||||
PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId);
|
|
||||||
if (cntx.Quotas.ContainsKey(Quotas.RDS_COLLECTIONS))
|
if (cntx.Quotas.ContainsKey(Quotas.RDS_COLLECTIONS))
|
||||||
{
|
{
|
||||||
btnAddCollection.Enabled = (!(cntx.Quotas[Quotas.RDS_COLLECTIONS].QuotaAllocatedValue <= gvRDSCollections.Rows.Count) || (cntx.Quotas[Quotas.RDS_COLLECTIONS].QuotaAllocatedValue == -1));
|
btnAddCollection.Enabled = (!(cntx.Quotas[Quotas.RDS_COLLECTIONS].QuotaAllocatedValue <= gvRDSCollections.Rows.Count) || (cntx.Quotas[Quotas.RDS_COLLECTIONS].QuotaAllocatedValue == -1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void BindQuota(PackageContext cntx)
|
||||||
|
{
|
||||||
|
OrganizationStatistics stats = ES.Services.Organizations.GetOrganizationStatisticsByOrganization(PanelRequest.ItemID);
|
||||||
|
OrganizationStatistics tenantStats = ES.Services.Organizations.GetOrganizationStatistics(PanelRequest.ItemID);
|
||||||
|
collectionsQuota.QuotaUsedValue = stats.CreatedRdsCollections;
|
||||||
|
collectionsQuota.QuotaValue = stats.AllocatedRdsCollections;
|
||||||
|
|
||||||
|
if (stats.AllocatedUsers != -1)
|
||||||
|
{
|
||||||
|
collectionsQuota.QuotaAvailable = tenantStats.AllocatedRdsCollections - tenantStats.CreatedRdsCollections;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public string GetServerName(string collectionId)
|
public string GetServerName(string collectionId)
|
||||||
{
|
{
|
||||||
int id = int.Parse(collectionId);
|
int id = int.Parse(collectionId);
|
||||||
|
|
|
@ -111,6 +111,24 @@ namespace WebsitePanel.Portal.RDS {
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::System.Web.UI.WebControls.GridView gvRDSCollections;
|
protected global::System.Web.UI.WebControls.GridView gvRDSCollections;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// locQuota 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.Localize locQuota;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// collectionsQuota control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::WebsitePanel.Portal.QuotaViewer collectionsQuota;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// odsRDSCollectionsPaged control.
|
/// odsRDSCollectionsPaged control.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -30,26 +30,6 @@
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<wsp:CollapsiblePanel id="secSelectSertificate" runat="server"
|
|
||||||
TargetControlID="panelSelectSertificate" meta:resourcekey="secSelectSertificate" Text="">
|
|
||||||
</wsp:CollapsiblePanel>
|
|
||||||
|
|
||||||
<asp:Panel runat="server" ID="panelSelectSertificate">
|
|
||||||
<div style="padding: 10px;">
|
|
||||||
<div class="FormBody">
|
|
||||||
<div class="FormField">
|
|
||||||
<asp:FileUpload ID="upPFX" runat="server"/>
|
|
||||||
</div>
|
|
||||||
<div class="FormFieldDescription">
|
|
||||||
<asp:Localize runat="server" meta:resourcekey="lblPFXInstallPassword" />
|
|
||||||
</div>
|
|
||||||
<div class="FormField">
|
|
||||||
<asp:TextBox ID="txtPFXInstallPassword" runat="server" TextMode="Password" CssClass="NormalTextBox" />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</asp:Panel>
|
|
||||||
|
|
||||||
<fieldset id="RDSServersPanel" runat="server">
|
<fieldset id="RDSServersPanel" runat="server">
|
||||||
<legend><asp:Localize ID="locRDSServersSection" runat="server" meta:resourcekey="locRDSServersSection" Text="RDS Servers"></asp:Localize></legend>
|
<legend><asp:Localize ID="locRDSServersSection" runat="server" meta:resourcekey="locRDSServersSection" Text="RDS Servers"></asp:Localize></legend>
|
||||||
<div style="padding: 10px;">
|
<div style="padding: 10px;">
|
||||||
|
|
|
@ -65,20 +65,6 @@ namespace WebsitePanel.Portal.RDS
|
||||||
RdsCollection collection = new RdsCollection{ Name = txtCollectionName.Text, DisplayName = txtCollectionName.Text, Servers = servers.GetServers(), Description = "" };
|
RdsCollection collection = new RdsCollection{ Name = txtCollectionName.Text, DisplayName = txtCollectionName.Text, Servers = servers.GetServers(), Description = "" };
|
||||||
int collectionId = ES.Services.RDS.AddRdsCollection(PanelRequest.ItemID, collection);
|
int collectionId = ES.Services.RDS.AddRdsCollection(PanelRequest.ItemID, collection);
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (upPFX.HasFile.Equals(true))
|
|
||||||
{
|
|
||||||
byte[] pfx = upPFX.FileBytes;
|
|
||||||
string certPassword = txtPFXInstallPassword.Text;
|
|
||||||
//ES.Services.RDS.InstallSessionHostsCertificate(collectionId, pfx, certPassword);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch(Exception ex)
|
|
||||||
{
|
|
||||||
messageBox.ShowErrorMessage("RDSSESSIONHOST_CERTIFICATE_NOT_INSTALLED", ex);
|
|
||||||
}
|
|
||||||
|
|
||||||
Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "rds_edit_collection", "CollectionId=" + collectionId, "ItemID=" + PanelRequest.ItemID));
|
Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "rds_edit_collection", "CollectionId=" + collectionId, "ItemID=" + PanelRequest.ItemID));
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
|
|
@ -75,42 +75,6 @@ namespace WebsitePanel.Portal.RDS {
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::System.Web.UI.WebControls.RequiredFieldValidator valCollectionName;
|
protected global::System.Web.UI.WebControls.RequiredFieldValidator valCollectionName;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// secSelectSertificate control.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// Auto-generated field.
|
|
||||||
/// To modify move field declaration from designer file to code-behind file.
|
|
||||||
/// </remarks>
|
|
||||||
protected global::WebsitePanel.Portal.CollapsiblePanel secSelectSertificate;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// panelSelectSertificate control.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// Auto-generated field.
|
|
||||||
/// To modify move field declaration from designer file to code-behind file.
|
|
||||||
/// </remarks>
|
|
||||||
protected global::System.Web.UI.WebControls.Panel panelSelectSertificate;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// upPFX 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.FileUpload upPFX;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// txtPFXInstallPassword 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 txtPFXInstallPassword;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// RDSServersPanel control.
|
/// RDSServersPanel control.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -55,8 +55,12 @@
|
||||||
</div>
|
</div>
|
||||||
</asp:Panel>
|
</asp:Panel>
|
||||||
<div class="FormFooterClean">
|
<div class="FormFooterClean">
|
||||||
<wsp:ItemButtonPanel id="buttonPanel" runat="server" ValidationGroup="SaveRDSCollection"
|
<asp:Button id="btnSave" runat="server" Text="Save Changes" CssClass="Button1" meta:resourcekey="btnSave"
|
||||||
OnSaveClick="btnSave_Click" OnSaveExitClick="btnSaveExit_Click" />
|
OnClick="btnSave_Click" OnClientClick="ShowProgressDialog('Updating ...');"></asp:Button>
|
||||||
|
<asp:Button id="btnSaveExit" runat="server" Text="Save Changes and Exit" CssClass="Button1" meta:resourcekey="btnSaveExit"
|
||||||
|
OnClick="btnSaveExit_Click" OnClientClick="ShowProgressDialog('Updating ...');"></asp:Button>
|
||||||
|
<asp:Button id="btnExit" runat="server" Text="Back to Applications List" CssClass="Button1" meta:resourcekey="btnExit"
|
||||||
|
OnClick="btnExit_Click" OnClientClick="ShowProgressDialog('Loading ...');"></asp:Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -100,5 +100,10 @@ namespace WebsitePanel.Portal.RDS
|
||||||
Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "rds_collection_edit_apps", "CollectionId=" + PanelRequest.CollectionID, "ItemID=" + PanelRequest.ItemID));
|
Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "rds_collection_edit_apps", "CollectionId=" + PanelRequest.CollectionID, "ItemID=" + PanelRequest.ItemID));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void btnExit_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "rds_collection_edit_apps", "CollectionId=" + PanelRequest.CollectionID, "ItemID=" + PanelRequest.ItemID));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -139,12 +139,30 @@ namespace WebsitePanel.Portal.RDS {
|
||||||
protected global::WebsitePanel.Portal.RDS.UserControls.RDSCollectionUsers users;
|
protected global::WebsitePanel.Portal.RDS.UserControls.RDSCollectionUsers users;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// buttonPanel control.
|
/// btnSave control.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Auto-generated field.
|
/// Auto-generated field.
|
||||||
/// To modify move field declaration from designer file to code-behind file.
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::WebsitePanel.Portal.ItemButtonPanel buttonPanel;
|
protected global::System.Web.UI.WebControls.Button btnSave;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// btnSaveExit 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.Button btnSaveExit;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// btnExit 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.Button btnExit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="RDSEditCollectionUsers.ascx.cs" Inherits="WebsitePanel.Portal.RDS.RDSEditCollectionUsers" %>
|
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="RDSEditCollectionUsers.ascx.cs" Inherits="WebsitePanel.Portal.RDS.RDSEditCollectionUsers" %>
|
||||||
<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %>
|
<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %>
|
||||||
<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %>
|
<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %>
|
||||||
|
<%@ Register Src="../UserControls/QuotaViewer.ascx" TagName="QuotaViewer" TagPrefix="wsp" %>
|
||||||
<%@ Register Src="UserControls/RDSCollectionUsers.ascx" TagName="CollectionUsers" TagPrefix="wsp"%>
|
<%@ Register Src="UserControls/RDSCollectionUsers.ascx" TagName="CollectionUsers" TagPrefix="wsp"%>
|
||||||
<%@ Register Src="UserControls/RDSCollectionTabs.ascx" TagName="CollectionTabs" TagPrefix="wsp" %>
|
<%@ Register Src="UserControls/RDSCollectionTabs.ascx" TagName="CollectionTabs" TagPrefix="wsp" %>
|
||||||
<%@ Register TagPrefix="wsp" TagName="CollapsiblePanel" Src="../UserControls/CollapsiblePanel.ascx" %>
|
<%@ Register TagPrefix="wsp" TagName="CollapsiblePanel" Src="../UserControls/CollapsiblePanel.ascx" %>
|
||||||
|
@ -34,6 +35,11 @@
|
||||||
<wsp:CollectionUsers id="users" runat="server" />
|
<wsp:CollectionUsers id="users" runat="server" />
|
||||||
</div>
|
</div>
|
||||||
</asp:Panel>
|
</asp:Panel>
|
||||||
|
<div>
|
||||||
|
<asp:Localize ID="locQuota" runat="server" meta:resourcekey="locQuota" Text="Users Created:"></asp:Localize>
|
||||||
|
|
||||||
|
<wsp:QuotaViewer ID="usersQuota" runat="server" QuotaTypeId="2" DisplayGauge="true" />
|
||||||
|
</div>
|
||||||
<div class="FormFooterClean">
|
<div class="FormFooterClean">
|
||||||
<wsp:ItemButtonPanel id="buttonPanel" runat="server" ValidationGroup="SaveRDSCollection"
|
<wsp:ItemButtonPanel id="buttonPanel" runat="server" ValidationGroup="SaveRDSCollection"
|
||||||
OnSaveClick="btnSave_Click" OnSaveExitClick="btnSaveExit_Click" />
|
OnSaveClick="btnSave_Click" OnSaveExitClick="btnSaveExit_Click" />
|
||||||
|
|
|
@ -42,6 +42,7 @@ namespace WebsitePanel.Portal.RDS
|
||||||
{
|
{
|
||||||
if (!IsPostBack)
|
if (!IsPostBack)
|
||||||
{
|
{
|
||||||
|
BindQuota();
|
||||||
var collectionUsers = ES.Services.RDS.GetRdsCollectionUsers(PanelRequest.CollectionID);
|
var collectionUsers = ES.Services.RDS.GetRdsCollectionUsers(PanelRequest.CollectionID);
|
||||||
var collection = ES.Services.RDS.GetRdsCollection(PanelRequest.CollectionID);
|
var collection = ES.Services.RDS.GetRdsCollection(PanelRequest.CollectionID);
|
||||||
|
|
||||||
|
@ -50,6 +51,20 @@ namespace WebsitePanel.Portal.RDS
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void BindQuota()
|
||||||
|
{
|
||||||
|
PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId);
|
||||||
|
OrganizationStatistics stats = ES.Services.Organizations.GetOrganizationStatisticsByOrganization(PanelRequest.ItemID);
|
||||||
|
OrganizationStatistics tenantStats = ES.Services.Organizations.GetOrganizationStatistics(PanelRequest.ItemID);
|
||||||
|
usersQuota.QuotaUsedValue = stats.CreatedRdsUsers;
|
||||||
|
usersQuota.QuotaValue = stats.AllocatedRdsUsers;
|
||||||
|
|
||||||
|
if (stats.AllocatedUsers != -1)
|
||||||
|
{
|
||||||
|
usersQuota.QuotaAvailable = tenantStats.AllocatedRdsUsers - tenantStats.CreatedRdsUsers;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private bool SaveRdsUsers()
|
private bool SaveRdsUsers()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
@ -73,6 +88,7 @@ namespace WebsitePanel.Portal.RDS
|
||||||
}
|
}
|
||||||
|
|
||||||
SaveRdsUsers();
|
SaveRdsUsers();
|
||||||
|
BindQuota();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void btnSaveExit_Click(object sender, EventArgs e)
|
protected void btnSaveExit_Click(object sender, EventArgs e)
|
||||||
|
|
|
@ -93,6 +93,24 @@ namespace WebsitePanel.Portal.RDS {
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::WebsitePanel.Portal.RDS.UserControls.RDSCollectionUsers users;
|
protected global::WebsitePanel.Portal.RDS.UserControls.RDSCollectionUsers users;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// locQuota 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.Localize locQuota;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// usersQuota control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::WebsitePanel.Portal.QuotaViewer usersQuota;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// buttonPanel control.
|
/// buttonPanel control.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -42,6 +42,7 @@
|
||||||
<asp:TemplateField meta:resourcekey="gvUserName" HeaderText="gvUserName">
|
<asp:TemplateField meta:resourcekey="gvUserName" HeaderText="gvUserName">
|
||||||
<ItemStyle Width="30%" Wrap="false"/>
|
<ItemStyle Width="30%" Wrap="false"/>
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
|
<asp:Image ID="vipImage" runat="server" ImageUrl='<%# GetAccountImage(Convert.ToBoolean(Eval("IsVip"))) %>' ImageAlign="AbsMiddle"/>
|
||||||
<asp:Literal ID="litUserName" runat="server" Text='<%# Eval("UserName") %>'/>
|
<asp:Literal ID="litUserName" runat="server" Text='<%# Eval("UserName") %>'/>
|
||||||
<asp:HiddenField ID="hfUnifiedSessionId" runat="server" Value='<%# Eval("UnifiedSessionId") %>'/>
|
<asp:HiddenField ID="hfUnifiedSessionId" runat="server" Value='<%# Eval("UnifiedSessionId") %>'/>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
|
|
|
@ -5,6 +5,8 @@ using System.Linq;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
using System.Web.UI;
|
using System.Web.UI;
|
||||||
using System.Web.UI.WebControls;
|
using System.Web.UI.WebControls;
|
||||||
|
using WebsitePanel.EnterpriseServer;
|
||||||
|
using WebsitePanel.Providers.HostedSolution;
|
||||||
using WebsitePanel.Providers.RemoteDesktopServices;
|
using WebsitePanel.Providers.RemoteDesktopServices;
|
||||||
|
|
||||||
namespace WebsitePanel.Portal.RDS
|
namespace WebsitePanel.Portal.RDS
|
||||||
|
@ -101,5 +103,15 @@ namespace WebsitePanel.Portal.RDS
|
||||||
gvRDSUserSessions.DataSource = userSessions;
|
gvRDSUserSessions.DataSource = userSessions;
|
||||||
gvRDSUserSessions.DataBind();
|
gvRDSUserSessions.DataBind();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string GetAccountImage(bool vip)
|
||||||
|
{
|
||||||
|
if (vip)
|
||||||
|
{
|
||||||
|
return GetThemedImage("Exchange/vip_user_16.png");
|
||||||
|
}
|
||||||
|
|
||||||
|
return GetThemedImage("Exchange/accounting_mail_16.png");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -210,7 +210,7 @@ namespace WebsitePanel.Portal.RDS.UserControls
|
||||||
|
|
||||||
RemoteApplication app = new RemoteApplication();
|
RemoteApplication app = new RemoteApplication();
|
||||||
app.Alias = (string)gvApps.DataKeys[i][0];
|
app.Alias = (string)gvApps.DataKeys[i][0];
|
||||||
app.DisplayName = ((HyperLink)row.FindControl("lnkDisplayName")).Text;
|
app.DisplayName = ((LinkButton)row.FindControl("lnkDisplayName")).Text;
|
||||||
app.FilePath = ((HiddenField)row.FindControl("hfFilePath")).Value;
|
app.FilePath = ((HiddenField)row.FindControl("hfFilePath")).Value;
|
||||||
app.RequiredCommandLine = ((HiddenField)row.FindControl("hfRequiredCommandLine")).Value;
|
app.RequiredCommandLine = ((HiddenField)row.FindControl("hfRequiredCommandLine")).Value;
|
||||||
|
|
||||||
|
|
|
@ -5,12 +5,19 @@
|
||||||
<%@ Register Src="UserControls/UserDetails.ascx" TagName="UserDetails" TagPrefix="uc2" %>
|
<%@ Register Src="UserControls/UserDetails.ascx" TagName="UserDetails" TagPrefix="uc2" %>
|
||||||
<%@ Register Src="UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" TagPrefix="wsp" %>
|
<%@ Register Src="UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" TagPrefix="wsp" %>
|
||||||
<%@ Register Src="UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %>
|
<%@ Register Src="UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %>
|
||||||
|
<%@ Register Src="UserControls/PopupHeader.ascx" TagName="PopupHeader" TagPrefix="wsp" %>
|
||||||
|
<%@ Register Src="UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %>
|
||||||
|
|
||||||
|
<wsp:EnableAsyncTasksSupport id="asyncTasks" runat="server"/>
|
||||||
|
|
||||||
|
<asp:UpdatePanel runat="server" ID="messageBoxPanel" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
<wsp:SimpleMessageBox id="messageBox" runat="server" />
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
<asp:UpdatePanel runat="server" ID="updatePanelUsers">
|
<asp:UpdatePanel runat="server" ID="updatePanelUsers">
|
||||||
<ContentTemplate>
|
<ContentTemplate>
|
||||||
|
|
||||||
<wsp:SimpleMessageBox id="messageBox" runat="server" />
|
|
||||||
|
|
||||||
<div class="FormButtonsBar">
|
<div class="FormButtonsBar">
|
||||||
<div class="Left">
|
<div class="Left">
|
||||||
<asp:Button ID="btnAddRDSServer" runat="server"
|
<asp:Button ID="btnAddRDSServer" runat="server"
|
||||||
|
@ -43,11 +50,45 @@
|
||||||
<Columns>
|
<Columns>
|
||||||
<asp:BoundField DataField="Name" HtmlEncode="true" SortExpression="Name" HeaderText="Server name">
|
<asp:BoundField DataField="Name" HtmlEncode="true" SortExpression="Name" HeaderText="Server name">
|
||||||
<HeaderStyle Wrap="false" />
|
<HeaderStyle Wrap="false" />
|
||||||
<ItemStyle Wrap="False" Width="25%"/>
|
<ItemStyle Wrap="False" Width="15%"/>
|
||||||
</asp:BoundField>
|
</asp:BoundField>
|
||||||
<asp:BoundField DataField="Address" HeaderText="IP Address"><ItemStyle Width="15%"/></asp:BoundField>
|
<asp:BoundField DataField="Address" HeaderText="IP Address"><ItemStyle Width="10%"/></asp:BoundField>
|
||||||
<asp:BoundField DataField="ItemName" HeaderText="Organization"><ItemStyle Width="20%"/></asp:BoundField>
|
<asp:BoundField DataField="ItemName" HeaderText="Organization"><ItemStyle Width="10%"/></asp:BoundField>
|
||||||
<asp:BoundField DataField="Description" HeaderText="Comments"><ItemStyle Width="30%"/></asp:BoundField>
|
<asp:BoundField DataField="Description" HeaderText="Comments"><ItemStyle Width="20%"/></asp:BoundField>
|
||||||
|
<asp:TemplateField meta:resourcekey="gvPopupStatus">
|
||||||
|
<ItemStyle Width="20%" HorizontalAlign="Left" />
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Literal ID="litStatus" runat="server" Text='<%# Eval("Status") %>'></asp:Literal>
|
||||||
|
<asp:HiddenField ID="hdnRdsCollectionId" runat="server" Value='<%# Eval("RdsCollectionId") %>' />
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
<asp:TemplateField meta:resourcekey="gvViewInfo">
|
||||||
|
<ItemStyle Width="8%" HorizontalAlign="Right"/>
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:LinkButton OnClientClick="ShowProgressDialog('Getting Server Info ...');return true;" Visible='<%# Eval("Status") != null && Eval("Status").ToString().StartsWith("Online") %>' CommandName="ViewInfo" CommandArgument='<%# Eval("Id")%>' ID="lbViewInfo" runat="server" Text="View Info"/>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
<asp:TemplateField meta:resourcekey="gvRestart">
|
||||||
|
<ItemStyle HorizontalAlign="Right"/>
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:LinkButton ID="lbRestart" CommandName="Restart" CommandArgument='<%# Eval("Id")%>' Visible='<%# Eval("Status") != null && Eval("Status").ToString().StartsWith("Online") %>'
|
||||||
|
runat="server" Text="Restart" OnClientClick="if(confirm('Are you sure you want to restart selected server?')) ShowProgressDialog('Loading...'); else return false;"/>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
<asp:TemplateField meta:resourcekey="gvShutdown">
|
||||||
|
<ItemStyle Width="9%" HorizontalAlign="Right"/>
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:LinkButton ID="lbShutdown" CommandName="ShutDown" CommandArgument='<%# Eval("Id")%>' Visible='<%# Eval("Status") != null && Eval("Status").ToString().StartsWith("Online") %>'
|
||||||
|
runat="server" Text="Shut Down" OnClientClick="if(confirm('Are you sure you want to shut down selected server?')) ShowProgressDialog('Loading...'); else return false;"/>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
<asp:TemplateField>
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:LinkButton ID="lnkInstallCertificate" runat="server" Text="Certificate" Visible='<%# Eval("ItemId") != null && Eval("Status") != null && Eval("Status").ToString().StartsWith("Online") %>'
|
||||||
|
CommandName="InstallCertificate" CommandArgument='<%# Eval("Id") %>' ToolTip="Repair Certificate"
|
||||||
|
OnClientClick="if(confirm('Are you sure you want to install certificate?')) ShowProgressDialog('Installing certificate...'); else return false;"></asp:LinkButton>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
<asp:TemplateField>
|
<asp:TemplateField>
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:LinkButton ID="lnkRemove" runat="server" Text="Remove" Visible='<%# Eval("ItemId") == null %>'
|
<asp:LinkButton ID="lnkRemove" runat="server" Text="Remove" Visible='<%# Eval("ItemId") == null %>'
|
||||||
|
@ -63,5 +104,104 @@
|
||||||
<asp:ControlParameter Name="filterValue" ControlID="txtSearchValue" PropertyName="Text" />
|
<asp:ControlParameter Name="filterValue" ControlID="txtSearchValue" PropertyName="Text" />
|
||||||
</SelectParameters>
|
</SelectParameters>
|
||||||
</asp:ObjectDataSource>
|
</asp:ObjectDataSource>
|
||||||
|
|
||||||
|
<asp:Panel ID="ServerInfoPanel" runat="server" CssClass="Popup" style="display:none">
|
||||||
|
<table class="Popup-Header" cellpadding="0" cellspacing="0">
|
||||||
|
<tr>
|
||||||
|
<td class="Popup-HeaderLeft"/>
|
||||||
|
<td class="Popup-HeaderTitle">
|
||||||
|
<asp:Localize ID="Localize1" runat="server" meta:resourcekey="headerServerInfo"/>
|
||||||
|
</td>
|
||||||
|
<td class="Popup-HeaderRight"/>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<div class="Popup-Content">
|
||||||
|
<div class="Popup-Body">
|
||||||
|
<br />
|
||||||
|
<asp:UpdatePanel ID="serverInfoUpdatePanel" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
|
||||||
|
<ContentTemplate>
|
||||||
|
<div class="Popup-Scroll" style="height:auto;">
|
||||||
|
<wsp:CollapsiblePanel id="secServerInfo" runat="server" TargetControlID="panelHardwareInfo" meta:resourcekey="secRdsApplicationEdit" Text=""/>
|
||||||
|
<asp:Panel runat="server" ID="panelHardwareInfo">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td class="FormLabel150" style="width: 150px;">
|
||||||
|
<asp:Literal ID="locProcessor" runat="server" Text="Processor:"/>
|
||||||
|
</td>
|
||||||
|
<td class="FormLabel150" style="width: 150px;">
|
||||||
|
<asp:Literal ID="litProcessor" runat="server"/>
|
||||||
|
</td>
|
||||||
|
<td class="FormLabel150" style="width: 150px;">
|
||||||
|
<asp:Literal ID="locLoadPercentage" Text="Load Percentage:" runat="server"/>
|
||||||
|
</td>
|
||||||
|
<td class="FormLabel150" style="width: 150px;">
|
||||||
|
<asp:Literal ID="litLoadPercentage" runat="server"/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="FormLabel150" style="width: 150px;">
|
||||||
|
<asp:Literal ID="locMemoryAllocated" runat="server" Text="Allocated Memory:"/>
|
||||||
|
</td>
|
||||||
|
<td class="FormLabel150" style="width: 150px;">
|
||||||
|
<asp:Literal ID="litMemoryAllocated" runat="server"/>
|
||||||
|
</td>
|
||||||
|
<td class="FormLabel150" style="width: 150px;">
|
||||||
|
<asp:Literal ID="locFreeMemory" Text="Free Memory:" runat="server"/>
|
||||||
|
</td>
|
||||||
|
<td class="FormLabel150" style="width: 150px;">
|
||||||
|
<asp:Literal ID="litFreeMemory" runat="server"/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</asp:Panel>
|
||||||
|
<wsp:CollapsiblePanel id="secRdsApplicationEdit" runat="server" TargetControlID="panelDiskDrives" meta:resourcekey="secRdsApplicationEdit" Text="Disk Drives"/>
|
||||||
|
<asp:Panel runat="server" ID="panelDiskDrives">
|
||||||
|
<table>
|
||||||
|
<asp:Repeater ID="rpServerDrives" runat="server" EnableViewState="false">
|
||||||
|
<ItemTemplate>
|
||||||
|
<tr>
|
||||||
|
<td class="FormLabel150" style="width: 150px;">
|
||||||
|
<asp:Literal ID="litDeviceId" runat="server" Text='<%# Eval("DeviceId") %>'/>
|
||||||
|
</td>
|
||||||
|
<td class="FormLabel150" style="width: 150px;"/>
|
||||||
|
<td class="FormLabel150" style="width: 150px;">
|
||||||
|
<asp:Literal ID="locVolumeName" Text="Volume Name:" runat="server"/>
|
||||||
|
</td>
|
||||||
|
<td class="FormLabel150" style="width: 150px;">
|
||||||
|
<asp:Literal ID="litVolumeName" Text='<%# Eval("VolumeName") %>' runat="server"/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="FormLabel150" style="width: 150px;">
|
||||||
|
<asp:Literal ID="locSize" Text="Size:" runat="server"/>
|
||||||
|
</td>
|
||||||
|
<td class="FormLabel150" style="width: 150px;">
|
||||||
|
<asp:Literal ID="litSize" Text='<%# Eval("SizeMb") + " MB" %>' runat="server"/>
|
||||||
|
</td>
|
||||||
|
<td class="FormLabel150" style="width: 150px;">
|
||||||
|
<asp:Literal ID="locFreeSpace" Text="Free Space:" runat="server"/>
|
||||||
|
</td>
|
||||||
|
<td class="FormLabel150" style="width: 150px;">
|
||||||
|
<asp:Literal ID="litFreeSpace" Text='<%# Eval("FreeSpaceMb") + " MB" %>' runat="server"/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:Repeater>
|
||||||
|
</table>
|
||||||
|
</asp:Panel>
|
||||||
|
</div>
|
||||||
|
</ContentTemplate>
|
||||||
|
</asp:UpdatePanel>
|
||||||
|
<br />
|
||||||
|
</div>
|
||||||
|
<div class="FormFooter">
|
||||||
|
<asp:Button ID="btnCancelServerInfo" runat="server" CssClass="Button1" meta:resourcekey="btnServerInfoCancel" Text="Cancel" CausesValidation="false" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</asp:Panel>
|
||||||
|
|
||||||
|
<asp:Button ID="btnViewInfoFake" runat="server" style="display:none;" />
|
||||||
|
<ajaxToolkit:ModalPopupExtender ID="ViewInfoModal" runat="server" TargetControlID="btnViewInfoFake" PopupControlID="ServerInfoPanel"
|
||||||
|
BackgroundCssClass="modalBackground" DropShadow="false" CancelControlID="btnCancelServerInfo"/>
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
|
|
|
@ -31,6 +31,7 @@ using System.Data;
|
||||||
using System.Configuration;
|
using System.Configuration;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
|
using System.Linq;
|
||||||
using System.Web.Security;
|
using System.Web.Security;
|
||||||
using System.Web.UI;
|
using System.Web.UI;
|
||||||
using System.Web.UI.WebControls;
|
using System.Web.UI.WebControls;
|
||||||
|
@ -39,6 +40,7 @@ using System.Web.UI.HtmlControls;
|
||||||
|
|
||||||
using WebsitePanel.EnterpriseServer;
|
using WebsitePanel.EnterpriseServer;
|
||||||
using WebsitePanel.Providers.Common;
|
using WebsitePanel.Providers.Common;
|
||||||
|
using AjaxControlToolkit;
|
||||||
|
|
||||||
namespace WebsitePanel.Portal
|
namespace WebsitePanel.Portal
|
||||||
{
|
{
|
||||||
|
@ -99,6 +101,28 @@ namespace WebsitePanel.Portal
|
||||||
ShowErrorMessage("REMOTE_DESKTOP_SERVICES_REMOVE_RDSSERVER", ex);
|
ShowErrorMessage("REMOTE_DESKTOP_SERVICES_REMOVE_RDSSERVER", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (e.CommandName == "ViewInfo")
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ShowInfo(e.CommandArgument.ToString());
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (e.CommandName == "Restart")
|
||||||
|
{
|
||||||
|
Restart(e.CommandArgument.ToString());
|
||||||
|
}
|
||||||
|
else if (e.CommandName == "ShutDown")
|
||||||
|
{
|
||||||
|
ShutDown(e.CommandArgument.ToString());
|
||||||
|
}
|
||||||
|
else if (e.CommandName == "InstallCertificate")
|
||||||
|
{
|
||||||
|
InstallCertificate(e.CommandArgument.ToString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
@ -107,5 +131,60 @@ namespace WebsitePanel.Portal
|
||||||
|
|
||||||
gvRDSServers.DataBind();
|
gvRDSServers.DataBind();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ShowInfo(string serverId)
|
||||||
|
{
|
||||||
|
ViewInfoModal.Show();
|
||||||
|
var rdsServer = ES.Services.RDS.GetRdsServer(Convert.ToInt32(serverId));
|
||||||
|
var serverInfo = ES.Services.RDS.GetRdsServerInfo(rdsServer.ItemId.Value, rdsServer.FqdName);
|
||||||
|
litProcessor.Text = string.Format("{0}x{1} MHz", serverInfo.NumberOfCores, serverInfo.MaxClockSpeed);
|
||||||
|
litLoadPercentage.Text = string.Format("{0}%", serverInfo.LoadPercentage);
|
||||||
|
litMemoryAllocated.Text = string.Format("{0} MB", serverInfo.MemoryAllocatedMb);
|
||||||
|
litFreeMemory.Text = string.Format("{0} MB", serverInfo.FreeMemoryMb);
|
||||||
|
rpServerDrives.DataSource = serverInfo.Drives;
|
||||||
|
rpServerDrives.DataBind();
|
||||||
|
((ModalPopupExtender)asyncTasks.FindControl("ModalPopupProperties")).Hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void Restart(string serverId)
|
||||||
|
{
|
||||||
|
var rdsServer = ES.Services.RDS.GetRdsServer(Convert.ToInt32(serverId));
|
||||||
|
ES.Services.RDS.RestartRdsServer(rdsServer.ItemId.Value, rdsServer.FqdName);
|
||||||
|
Response.Redirect(Request.Url.ToString(), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ShutDown(string serverId)
|
||||||
|
{
|
||||||
|
var rdsServer = ES.Services.RDS.GetRdsServer(Convert.ToInt32(serverId));
|
||||||
|
ES.Services.RDS.ShutDownRdsServer(rdsServer.ItemId.Value, rdsServer.FqdName);
|
||||||
|
Response.Redirect(Request.Url.ToString(), true);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RefreshServerInfo()
|
||||||
|
{
|
||||||
|
var servers = odsRDSServersPaged.Select();
|
||||||
|
gvRDSServers.DataSource = servers;
|
||||||
|
gvRDSServers.DataBind();
|
||||||
|
((ModalPopupExtender)asyncTasks.FindControl("ModalPopupProperties")).Hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void InstallCertificate(string serverId)
|
||||||
|
{
|
||||||
|
var rdsServer = ES.Services.RDS.GetRdsServer(Convert.ToInt32(serverId));
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
ES.Services.RDS.InstallSessionHostsCertificate(rdsServer);
|
||||||
|
((ModalPopupExtender)asyncTasks.FindControl("ModalPopupProperties")).Hide();
|
||||||
|
ShowSuccessMessage("RDSSESSIONHOST_CERTIFICATE_INSTALLED");
|
||||||
|
}
|
||||||
|
catch(Exception ex)
|
||||||
|
{
|
||||||
|
ShowErrorMessage("RDSSESSIONHOST_CERTIFICATE_NOT_INSTALLED", ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
messageBoxPanel.Update();
|
||||||
|
// Response.Redirect(Request.Url.ToString(), true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,31 +1,3 @@
|
||||||
// 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.
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
// <auto-generated>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
|
@ -41,13 +13,22 @@ namespace WebsitePanel.Portal {
|
||||||
public partial class RDSServers {
|
public partial class RDSServers {
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// updatePanelUsers control.
|
/// asyncTasks control.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Auto-generated field.
|
/// Auto-generated field.
|
||||||
/// To modify move field declaration from designer file to code-behind file.
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::System.Web.UI.UpdatePanel updatePanelUsers;
|
protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// messageBoxPanel control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.UpdatePanel messageBoxPanel;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// messageBox control.
|
/// messageBox control.
|
||||||
|
@ -58,6 +39,15 @@ namespace WebsitePanel.Portal {
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox;
|
protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// updatePanelUsers control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.UpdatePanel updatePanelUsers;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// btnAddRDSServer control.
|
/// btnAddRDSServer control.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -129,5 +119,176 @@ namespace WebsitePanel.Portal {
|
||||||
/// To modify move field declaration from designer file to code-behind file.
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::System.Web.UI.WebControls.ObjectDataSource odsRDSServersPaged;
|
protected global::System.Web.UI.WebControls.ObjectDataSource odsRDSServersPaged;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ServerInfoPanel control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.Panel ServerInfoPanel;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Localize1 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.Localize Localize1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// serverInfoUpdatePanel control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.UpdatePanel serverInfoUpdatePanel;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// secServerInfo control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::WebsitePanel.Portal.CollapsiblePanel secServerInfo;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// panelHardwareInfo control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.Panel panelHardwareInfo;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// locProcessor 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.Literal locProcessor;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// litProcessor 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.Literal litProcessor;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// locLoadPercentage 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.Literal locLoadPercentage;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// litLoadPercentage 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.Literal litLoadPercentage;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// locMemoryAllocated 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.Literal locMemoryAllocated;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// litMemoryAllocated 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.Literal litMemoryAllocated;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// locFreeMemory 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.Literal locFreeMemory;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// litFreeMemory 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.Literal litFreeMemory;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// secRdsApplicationEdit control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::WebsitePanel.Portal.CollapsiblePanel secRdsApplicationEdit;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// panelDiskDrives control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.WebControls.Panel panelDiskDrives;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// rpServerDrives 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.Repeater rpServerDrives;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// btnCancelServerInfo 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.Button btnCancelServerInfo;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// btnViewInfoFake 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.Button btnViewInfoFake;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ViewInfoModal control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::AjaxControlToolkit.ModalPopupExtender ViewInfoModal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5678,7 +5678,9 @@
|
||||||
<Content Include="VPSForPC\App_LocalResources\VpsDetailsGeneral.ascx.resx">
|
<Content Include="VPSForPC\App_LocalResources\VpsDetailsGeneral.ascx.resx">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Content>
|
</Content>
|
||||||
<Content Include="App_LocalResources\WebsitesSSL.ascx.resx" />
|
<Content Include="App_LocalResources\WebsitesSSL.ascx.resx">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Content>
|
||||||
<Content Include="VPSForPC\App_LocalResources\VpsDetailsHelp.ascx.resx">
|
<Content Include="VPSForPC\App_LocalResources\VpsDetailsHelp.ascx.resx">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Content>
|
</Content>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue