RDS provider + controller
This commit is contained in:
parent
d01ec8ac44
commit
2e97811d33
21 changed files with 7552 additions and 117 deletions
|
@ -56,5 +56,6 @@ namespace WebsitePanel.EnterpriseServer
|
|||
public const string Lync = "Lync";
|
||||
public const string EnterpriseStorage = "EnterpriseStorage";
|
||||
public const string ServiceLevels = "Service Levels";
|
||||
public const string RDS = "RDS";
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -35,6 +35,7 @@ using WebsitePanel.Providers.HostedSolution;
|
|||
using Microsoft.ApplicationBlocks.Data;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.Win32;
|
||||
using WebsitePanel.Providers.RemoteDesktopServices;
|
||||
|
||||
namespace WebsitePanel.EnterpriseServer
|
||||
{
|
||||
|
@ -4435,5 +4436,287 @@ namespace WebsitePanel.EnterpriseServer
|
|||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region RDS
|
||||
|
||||
public static IDataReader GetRDSCollectionsByItemId(int itemId)
|
||||
{
|
||||
return SqlHelper.ExecuteReader(
|
||||
ConnectionString,
|
||||
CommandType.StoredProcedure,
|
||||
"GetRDSCollectionsByItemId",
|
||||
new SqlParameter("@ItemID", itemId)
|
||||
);
|
||||
}
|
||||
|
||||
public static IDataReader GetRDSCollectionByName(string name)
|
||||
{
|
||||
return SqlHelper.ExecuteReader(
|
||||
ConnectionString,
|
||||
CommandType.StoredProcedure,
|
||||
"GetRDSCollectionByName",
|
||||
new SqlParameter("@Name", name)
|
||||
);
|
||||
}
|
||||
|
||||
public static IDataReader GetRDSCollectionById(int id)
|
||||
{
|
||||
return SqlHelper.ExecuteReader(
|
||||
ConnectionString,
|
||||
CommandType.StoredProcedure,
|
||||
"GetRDSCollectionById",
|
||||
new SqlParameter("@ID", id)
|
||||
);
|
||||
}
|
||||
|
||||
public static DataSet GetRDSCollectionsPaged(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows)
|
||||
{
|
||||
return SqlHelper.ExecuteDataset(
|
||||
ConnectionString,
|
||||
CommandType.StoredProcedure,
|
||||
"GetRDSCollectionsPaged",
|
||||
new SqlParameter("@FilterColumn", VerifyColumnName(filterColumn)),
|
||||
new SqlParameter("@FilterValue", VerifyColumnValue(filterValue)),
|
||||
new SqlParameter("@itemId", itemId),
|
||||
new SqlParameter("@SortColumn", VerifyColumnName(sortColumn)),
|
||||
new SqlParameter("@startRow", startRow),
|
||||
new SqlParameter("@maximumRows", maximumRows)
|
||||
);
|
||||
}
|
||||
|
||||
public static int AddRDSCollection(int itemId, string name, string description)
|
||||
{
|
||||
SqlParameter rdsCollectionId = new SqlParameter("@RDSCollectionID", SqlDbType.Int);
|
||||
rdsCollectionId.Direction = ParameterDirection.Output;
|
||||
|
||||
SqlHelper.ExecuteNonQuery(
|
||||
ConnectionString,
|
||||
CommandType.StoredProcedure,
|
||||
"AddRDSCollection",
|
||||
rdsCollectionId,
|
||||
new SqlParameter("@ItemID", itemId),
|
||||
new SqlParameter("@Name", name),
|
||||
new SqlParameter("@Description", description)
|
||||
);
|
||||
|
||||
// read identity
|
||||
return Convert.ToInt32(rdsCollectionId.Value);
|
||||
}
|
||||
|
||||
public static int GetOrganizationRdsUsersCount(int itemId)
|
||||
{
|
||||
SqlParameter count = new SqlParameter("@TotalNumber", SqlDbType.Int);
|
||||
count.Direction = ParameterDirection.Output;
|
||||
|
||||
DataSet ds = SqlHelper.ExecuteDataset(ConnectionString, CommandType.StoredProcedure,
|
||||
ObjectQualifier + "GetOrganizationRdsUsersCount",
|
||||
count,
|
||||
new SqlParameter("@ItemId", itemId));
|
||||
|
||||
// read identity
|
||||
return Convert.ToInt32(count.Value);
|
||||
}
|
||||
|
||||
public static void UpdateRDSCollection(RdsCollection collection)
|
||||
{
|
||||
UpdateRDSCollection(collection.Id, collection.ItemId, collection.Name, collection.Description);
|
||||
}
|
||||
|
||||
public static void UpdateRDSCollection(int id, int itemId, string name, string description)
|
||||
{
|
||||
SqlHelper.ExecuteNonQuery(
|
||||
ConnectionString,
|
||||
CommandType.StoredProcedure,
|
||||
"UpdateRDSCollection",
|
||||
new SqlParameter("@Id", id),
|
||||
new SqlParameter("@ItemID", itemId),
|
||||
new SqlParameter("@Name", name),
|
||||
new SqlParameter("@Description", description)
|
||||
);
|
||||
}
|
||||
|
||||
public static void DeleteRDSCollection(int id)
|
||||
{
|
||||
SqlHelper.ExecuteNonQuery(
|
||||
ConnectionString,
|
||||
CommandType.StoredProcedure,
|
||||
"DeleteRDSCollection",
|
||||
new SqlParameter("@Id", id)
|
||||
);
|
||||
}
|
||||
|
||||
public static int AddRDSServer(string name, string fqdName, string description)
|
||||
{
|
||||
SqlParameter rdsServerId = new SqlParameter("@RDSServerID", SqlDbType.Int);
|
||||
rdsServerId.Direction = ParameterDirection.Output;
|
||||
|
||||
SqlHelper.ExecuteNonQuery(
|
||||
ConnectionString,
|
||||
CommandType.StoredProcedure,
|
||||
"AddRDSServer",
|
||||
rdsServerId,
|
||||
new SqlParameter("@FqdName", fqdName),
|
||||
new SqlParameter("@Name", name),
|
||||
new SqlParameter("@Description", description)
|
||||
);
|
||||
|
||||
// read identity
|
||||
return Convert.ToInt32(rdsServerId.Value);
|
||||
}
|
||||
|
||||
public static IDataReader GetRDSServersByItemId(int itemId)
|
||||
{
|
||||
return SqlHelper.ExecuteReader(
|
||||
ConnectionString,
|
||||
CommandType.StoredProcedure,
|
||||
"GetRDSServersByItemId",
|
||||
new SqlParameter("@ItemID", itemId)
|
||||
);
|
||||
}
|
||||
|
||||
public static DataSet GetRDSServersPaged(int? itemId, int? collectionId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, bool ignoreItemId = false, bool ignoreRdsCollectionId = false)
|
||||
{
|
||||
return SqlHelper.ExecuteDataset(
|
||||
ConnectionString,
|
||||
CommandType.StoredProcedure,
|
||||
"GetRDSServersPaged",
|
||||
new SqlParameter("@FilterColumn", VerifyColumnName(filterColumn)),
|
||||
new SqlParameter("@FilterValue", VerifyColumnValue(filterValue)),
|
||||
new SqlParameter("@SortColumn", VerifyColumnName(sortColumn)),
|
||||
new SqlParameter("@startRow", startRow),
|
||||
new SqlParameter("@ItemID", itemId),
|
||||
new SqlParameter("@RdsCollectionId", collectionId),
|
||||
new SqlParameter("@IgnoreItemId", ignoreItemId),
|
||||
new SqlParameter("@IgnoreRdsCollectionId", ignoreRdsCollectionId),
|
||||
new SqlParameter("@maximumRows", maximumRows)
|
||||
);
|
||||
}
|
||||
|
||||
public static IDataReader GetRDSServerById(int id)
|
||||
{
|
||||
return SqlHelper.ExecuteReader(
|
||||
ConnectionString,
|
||||
CommandType.StoredProcedure,
|
||||
"GetRDSServerById",
|
||||
new SqlParameter("@ID", id)
|
||||
);
|
||||
}
|
||||
|
||||
public static IDataReader GetRDSServersByCollectionId(int collectionId)
|
||||
{
|
||||
return SqlHelper.ExecuteReader(
|
||||
ConnectionString,
|
||||
CommandType.StoredProcedure,
|
||||
"GetRDSServersByCollectionId",
|
||||
new SqlParameter("@RdsCollectionId", collectionId)
|
||||
);
|
||||
}
|
||||
|
||||
public static void DeleteRDSServer(int id)
|
||||
{
|
||||
SqlHelper.ExecuteNonQuery(
|
||||
ConnectionString,
|
||||
CommandType.StoredProcedure,
|
||||
"DeleteRDSServer",
|
||||
new SqlParameter("@Id", id)
|
||||
);
|
||||
}
|
||||
|
||||
public static void UpdateRDSServer(RdsServer server)
|
||||
{
|
||||
UpdateRDSServer(server.Id, server.ItemId, server.Name, server.FqdName, server.Description,
|
||||
server.RdsCollectionId);
|
||||
}
|
||||
|
||||
public static void UpdateRDSServer(int id, int? itemId, string name, string fqdName, string description, int? rdsCollectionId)
|
||||
{
|
||||
SqlHelper.ExecuteNonQuery(
|
||||
ConnectionString,
|
||||
CommandType.StoredProcedure,
|
||||
"UpdateRDSServer",
|
||||
new SqlParameter("@Id", id),
|
||||
new SqlParameter("@ItemID", itemId),
|
||||
new SqlParameter("@Name", name),
|
||||
new SqlParameter("@FqdName", fqdName),
|
||||
new SqlParameter("@Description", description),
|
||||
new SqlParameter("@RDSCollectionId", rdsCollectionId)
|
||||
);
|
||||
}
|
||||
|
||||
public static void AddRDSServerToCollection(int serverId, int rdsCollectionId)
|
||||
{
|
||||
SqlHelper.ExecuteNonQuery(
|
||||
ConnectionString,
|
||||
CommandType.StoredProcedure,
|
||||
"AddRDSServerToCollection",
|
||||
new SqlParameter("@Id", serverId),
|
||||
new SqlParameter("@RDSCollectionId", rdsCollectionId)
|
||||
);
|
||||
}
|
||||
|
||||
public static void AddRDSServerToOrganization(int itemId, int serverId)
|
||||
{
|
||||
SqlHelper.ExecuteNonQuery(
|
||||
ConnectionString,
|
||||
CommandType.StoredProcedure,
|
||||
"AddRDSServerToOrganization",
|
||||
new SqlParameter("@Id", serverId),
|
||||
new SqlParameter("@ItemID", itemId)
|
||||
);
|
||||
}
|
||||
|
||||
public static void RemoveRDSServerFromOrganization(int serverId)
|
||||
{
|
||||
SqlHelper.ExecuteNonQuery(
|
||||
ConnectionString,
|
||||
CommandType.StoredProcedure,
|
||||
"RemoveRDSServerFromOrganization",
|
||||
new SqlParameter("@Id", serverId)
|
||||
);
|
||||
}
|
||||
|
||||
public static void RemoveRDSServerFromCollection(int serverId)
|
||||
{
|
||||
SqlHelper.ExecuteNonQuery(
|
||||
ConnectionString,
|
||||
CommandType.StoredProcedure,
|
||||
"RemoveRDSServerFromCollection",
|
||||
new SqlParameter("@Id", serverId)
|
||||
);
|
||||
}
|
||||
|
||||
public static IDataReader GetRDSCollectionUsersByRDSCollectionId(int id)
|
||||
{
|
||||
return SqlHelper.ExecuteReader(
|
||||
ConnectionString,
|
||||
CommandType.StoredProcedure,
|
||||
"GetRDSCollectionUsersByRDSCollectionId",
|
||||
new SqlParameter("@id", id)
|
||||
);
|
||||
}
|
||||
|
||||
public static void AddRDSUserToRDSCollection(int rdsCollectionId, int accountId)
|
||||
{
|
||||
SqlHelper.ExecuteNonQuery(
|
||||
ConnectionString,
|
||||
CommandType.StoredProcedure,
|
||||
"AddUserToRDSCollection",
|
||||
new SqlParameter("@RDSCollectionId", rdsCollectionId),
|
||||
new SqlParameter("@AccountID", accountId)
|
||||
);
|
||||
}
|
||||
|
||||
public static void RemoveRDSUserFromRDSCollection(int rdsCollectionId, int accountId)
|
||||
{
|
||||
SqlHelper.ExecuteNonQuery(
|
||||
ConnectionString,
|
||||
CommandType.StoredProcedure,
|
||||
"RemoveRDSUserFromRDSCollection",
|
||||
new SqlParameter("@RDSCollectionId", rdsCollectionId),
|
||||
new SqlParameter("@AccountID", accountId)
|
||||
);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -726,6 +726,13 @@ namespace WebsitePanel.EnterpriseServer
|
|||
successful = false;
|
||||
}
|
||||
|
||||
//Cleanup RDS
|
||||
|
||||
if (RemoteDesktopServicesController.DeleteRemoteDesktopService(itemId).IsSuccess == false)
|
||||
{
|
||||
successful = false;
|
||||
}
|
||||
|
||||
//Cleanup Exchange
|
||||
try
|
||||
{
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -36,7 +36,8 @@ using System.Web.Services.Protocols;
|
|||
using System.ComponentModel;
|
||||
|
||||
using Microsoft.Web.Services3;
|
||||
|
||||
using WebsitePanel.Providers.Common;
|
||||
using WebsitePanel.Providers.HostedSolution;
|
||||
using WebsitePanel.Providers.RemoteDesktopServices;
|
||||
|
||||
namespace WebsitePanel.EnterpriseServer
|
||||
|
@ -50,14 +51,178 @@ namespace WebsitePanel.EnterpriseServer
|
|||
[ToolboxItem(false)]
|
||||
public class esRemoteDesktopServices : System.Web.Services.WebService
|
||||
{
|
||||
/*
|
||||
|
||||
[WebMethod]
|
||||
public DataSet GetRawOdbcSourcesPaged(int packageId,
|
||||
string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows)
|
||||
public RdsCollection GetRdsCollection(int collectionId)
|
||||
{
|
||||
return OperatingSystemController.GetRawOdbcSourcesPaged(packageId, filterColumn,
|
||||
filterValue, sortColumn, startRow, maximumRows);
|
||||
return RemoteDesktopServicesController.GetRdsCollection(collectionId);
|
||||
}
|
||||
*/
|
||||
|
||||
[WebMethod]
|
||||
public List<RdsCollection> GetOrganizationRdsCollections(int itemId)
|
||||
{
|
||||
return RemoteDesktopServicesController.GetOrganizationRdsCollections(itemId);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public ResultObject AddRdsCollection(int itemId, RdsCollection collection)
|
||||
{
|
||||
return RemoteDesktopServicesController.AddRdsCollection(itemId, collection);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public RdsCollectionPaged GetRdsCollectionsPaged(int itemId, string filterColumn, string filterValue,
|
||||
string sortColumn, int startRow, int maximumRows)
|
||||
{
|
||||
return RemoteDesktopServicesController.GetRdsCollectionsPaged(itemId, filterColumn, filterValue, sortColumn,
|
||||
startRow, maximumRows);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public ResultObject RemoveRdsCollection(int itemId, RdsCollection collection)
|
||||
{
|
||||
return RemoteDesktopServicesController.RemoveRdsCollection(itemId, collection);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public RdsServersPaged GetRdsServersPaged(string filterColumn, string filterValue, string sortColumn,
|
||||
int startRow, int maximumRows)
|
||||
{
|
||||
return RemoteDesktopServicesController.GetRdsServersPaged(filterColumn, filterValue, sortColumn, startRow,
|
||||
maximumRows);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public RdsServersPaged GetFreeRdsServersPaged(string filterColumn, string filterValue,
|
||||
string sortColumn, int startRow, int maximumRows)
|
||||
{
|
||||
return RemoteDesktopServicesController.GetFreeRdsServersPaged(filterColumn, filterValue,
|
||||
sortColumn, startRow, maximumRows);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public RdsServersPaged GetOrganizationRdsServersPaged(int itemId, string filterColumn, string filterValue,
|
||||
string sortColumn, int startRow, int maximumRows)
|
||||
{
|
||||
return RemoteDesktopServicesController.GetOrganizationRdsServersPaged(itemId, filterColumn, filterValue,
|
||||
sortColumn, startRow, maximumRows);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public RdsServersPaged GetOrganizationFreeRdsServersPaged(int itemId, string filterColumn, string filterValue,
|
||||
string sortColumn, int startRow, int maximumRows)
|
||||
{
|
||||
return RemoteDesktopServicesController.GetOrganizationFreeRdsServersPaged(itemId, filterColumn, filterValue,
|
||||
sortColumn, startRow, maximumRows);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public RdsServer GetRdsServer(int rdsSeverId)
|
||||
{
|
||||
return RemoteDesktopServicesController.GetRdsServer(rdsSeverId);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public List<RdsServer> GetCollectionRdsServers(int collectionId)
|
||||
{
|
||||
return RemoteDesktopServicesController.GetCollectionRdsServers(collectionId);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public List<RdsServer> GetOrganizationRdsServers(int itemId)
|
||||
{
|
||||
return RemoteDesktopServicesController.GetOrganizationRdsServers(itemId);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public ResultObject AddRdsServer(RdsServer rdsServer)
|
||||
{
|
||||
return RemoteDesktopServicesController.AddRdsServer(rdsServer);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public ResultObject AddRdsServerToCollection(int itemId, RdsServer rdsServer, RdsCollection rdsCollection)
|
||||
{
|
||||
return RemoteDesktopServicesController.AddRdsServerToCollection(itemId, rdsServer, rdsCollection);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public ResultObject AddRdsServerToOrganization(int itemId, int serverId)
|
||||
{
|
||||
return RemoteDesktopServicesController.AddRdsServerToOrganization(itemId, serverId);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public ResultObject RemoveRdsServer(int rdsServerId)
|
||||
{
|
||||
return RemoteDesktopServicesController.RemoveRdsServer(rdsServerId);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public ResultObject RemoveRdsServerFromCollection(int itemId, RdsServer rdsServer, RdsCollection rdsCollection)
|
||||
{
|
||||
return RemoteDesktopServicesController.RemoveRdsServerFromCollection(itemId, rdsServer, rdsCollection);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public ResultObject RemoveRdsServerFromOrganization(int rdsServerId)
|
||||
{
|
||||
return RemoteDesktopServicesController.RemoveRdsServerFromOrganization(rdsServerId);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public ResultObject UpdateRdsServer(RdsServer rdsServer)
|
||||
{
|
||||
return RemoteDesktopServicesController.UpdateRdsServer(rdsServer);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public List<OrganizationUser> GetRdsCollectionUsers(int collectionId)
|
||||
{
|
||||
return RemoteDesktopServicesController.GetRdsCollectionUsers(collectionId);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public ResultObject SetUsersToRdsCollection(int itemId, int collectionId, List<OrganizationUser> users)
|
||||
{
|
||||
return RemoteDesktopServicesController.SetUsersToRdsCollection(itemId, collectionId, users);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public List<RemoteApplication> GetCollectionRemoteApplications(int itemId, string collectionName)
|
||||
{
|
||||
return RemoteDesktopServicesController.GetCollectionRemoteApplications(itemId, collectionName);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public List<StartMenuApp> GetAvailableRemoteApplications(int itemId, string collectionName)
|
||||
{
|
||||
return RemoteDesktopServicesController.GetAvailableRemoteApplications(itemId, collectionName);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public ResultObject AddRemoteApplicationToCollection(int itemId, RdsCollection collection, RemoteApplication application)
|
||||
{
|
||||
return RemoteDesktopServicesController.AddRemoteApplicationToCollection(itemId, collection, application);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public ResultObject RemoveRemoteApplicationFromCollection(int itemId, RdsCollection collection, RemoteApplication application)
|
||||
{
|
||||
return RemoteDesktopServicesController.RemoveRemoteApplicationFromCollection(itemId, collection, application);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public ResultObject SetRemoteApplicationsToRdsCollection(int itemId, int collectionId, List<RemoteApplication> remoteApps)
|
||||
{
|
||||
return RemoteDesktopServicesController.SetRemoteApplicationsToRdsCollection(itemId, collectionId, remoteApps);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public int GetOrganizationRdsUsersCount(int itemId)
|
||||
{
|
||||
return RemoteDesktopServicesController.GetOrganizationRdsUsersCount(itemId);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -130,6 +130,31 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
return res;
|
||||
}
|
||||
|
||||
public static bool IsComputerInGroup(string samAccountName, string group)
|
||||
{
|
||||
bool res = false;
|
||||
DirectorySearcher deSearch = new DirectorySearcher
|
||||
{
|
||||
Filter =
|
||||
("(&(objectClass=computer)(samaccountname=" + samAccountName + "))")
|
||||
};
|
||||
|
||||
//get the group result
|
||||
SearchResult results = deSearch.FindOne();
|
||||
DirectoryEntry de = results.GetDirectoryEntry();
|
||||
PropertyValueCollection props = de.Properties["memberOf"];
|
||||
|
||||
foreach (string str in props)
|
||||
{
|
||||
if (str.IndexOf(group) != -1)
|
||||
{
|
||||
res = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
public static string CreateOrganizationalUnit(string name, string parentPath)
|
||||
{
|
||||
string ret;
|
||||
|
|
|
@ -28,6 +28,9 @@
|
|||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
|
||||
namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||
{
|
||||
|
@ -36,6 +39,24 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
/// </summary>
|
||||
public interface IRemoteDesktopServices
|
||||
{
|
||||
|
||||
bool CreateCollection(string organizationId, RdsCollection collection);
|
||||
RdsCollection GetCollection(string collectionName);
|
||||
bool RemoveCollection(string organizationId, string collectionName);
|
||||
bool SetUsersInCollection(string organizationId, string collectionName, List<string> users);
|
||||
void AddSessionHostServerToCollection(string organizationId, string collectionName, RdsServer server);
|
||||
void AddSessionHostServersToCollection(string organizationId, string collectionName, List<RdsServer> servers);
|
||||
void RemoveSessionHostServerFromCollection(string organizationId, string collectionName, RdsServer server);
|
||||
void RemoveSessionHostServersFromCollection(string organizationId, string collectionName, List<RdsServer> servers);
|
||||
|
||||
List<StartMenuApp> GetAvailableRemoteApplications(string collectionName);
|
||||
List<RemoteApplication> GetCollectionRemoteApplications(string collectionName);
|
||||
bool AddRemoteApplication(string collectionName, RemoteApplication remoteApp);
|
||||
bool AddRemoteApplications(string collectionName, List<RemoteApplication> remoteApps);
|
||||
bool RemoveRemoteApplication(string collectionName, RemoteApplication remoteApp);
|
||||
|
||||
bool AddSessionHostFeatureToServer(string hostName);
|
||||
bool CheckSessionHostFeatureInstallation(string hostName);
|
||||
|
||||
bool CheckServerAvailability(string hostName);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||
{
|
||||
[Serializable]
|
||||
public class RdsCollection
|
||||
{
|
||||
public RdsCollection()
|
||||
{
|
||||
Servers = new List<RdsServer>();
|
||||
}
|
||||
|
||||
public int Id { get; set; }
|
||||
public int ItemId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Description { get; set; }
|
||||
public List<RdsServer> Servers { get; set; }
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||
{
|
||||
public class RdsCollectionPaged
|
||||
{
|
||||
public int RecordsCount { get; set; }
|
||||
public RdsCollection[] Collections { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
using System.Net;
|
||||
|
||||
namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||
{
|
||||
public class RdsServer
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int? ItemId { get; set; }
|
||||
public string Name
|
||||
{
|
||||
get
|
||||
{
|
||||
return string.IsNullOrEmpty(FqdName) ? string.Empty : FqdName.Split('.')[0];
|
||||
}
|
||||
}
|
||||
public string FqdName { get; set; }
|
||||
public string Description { get; set; }
|
||||
public string Address { get; set; }
|
||||
public string ItemName { get; set; }
|
||||
public int? RdsCollectionId { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||
{
|
||||
public class RdsServersPaged
|
||||
{
|
||||
public int RecordsCount { get; set; }
|
||||
public RdsServer[] Servers { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||
{
|
||||
public class RemoteApplication
|
||||
{
|
||||
public string Alias { get; set; }
|
||||
public string DisplayName { get; set; }
|
||||
public string FilePath { get; set; }
|
||||
public string FileVirtualPath { get; set; }
|
||||
public bool ShowInWebAccess { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
using System.Net;
|
||||
|
||||
namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||
{
|
||||
public class SessionHostServer
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string FqdName { get; set; }
|
||||
public string Address { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||
{
|
||||
public class StartMenuApp
|
||||
{
|
||||
public string DisplayName { get; set; }
|
||||
public string FilePath { get; set; }
|
||||
public string FileVirtualPath { get; set; }
|
||||
}
|
||||
}
|
|
@ -123,6 +123,13 @@
|
|||
<Compile Include="OS\QuotaType.cs" />
|
||||
<Compile Include="OS\SystemFilesPaged.cs" />
|
||||
<Compile Include="RemoteDesktopServices\IRemoteDesktopServices.cs" />
|
||||
<Compile Include="RemoteDesktopServices\RdsCollection.cs" />
|
||||
<Compile Include="RemoteDesktopServices\RdsCollectionPaged.cs" />
|
||||
<Compile Include="RemoteDesktopServices\RdsServer.cs" />
|
||||
<Compile Include="RemoteDesktopServices\RdsServersPaged.cs" />
|
||||
<Compile Include="RemoteDesktopServices\RemoteApplication.cs" />
|
||||
<Compile Include="RemoteDesktopServices\SessionHostServer.cs" />
|
||||
<Compile Include="RemoteDesktopServices\StartMenuApp.cs" />
|
||||
<Compile Include="ResultObjects\HeliconApe.cs" />
|
||||
<Compile Include="HostedSolution\ExchangeMobileDevice.cs" />
|
||||
<Compile Include="HostedSolution\IOCSEdgeServer.cs" />
|
||||
|
|
|
@ -33,6 +33,8 @@
|
|||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.DirectoryServices" />
|
||||
<Reference Include="System.Management.Automation, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" />
|
||||
<Reference Include="System.Xml" />
|
||||
<ProjectReference Include="..\WebsitePanel.Providers.Base\WebsitePanel.Providers.Base.csproj">
|
||||
<Project>{684C932A-6C75-46AC-A327-F3689D89EB42}</Project>
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -27,7 +27,10 @@
|
|||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Net;
|
||||
using System.Net.Sockets;
|
||||
using System.Web;
|
||||
using System.Collections;
|
||||
using System.Web.Services;
|
||||
|
@ -36,6 +39,7 @@ using System.ComponentModel;
|
|||
using Microsoft.Web.Services3;
|
||||
|
||||
using WebsitePanel.Providers;
|
||||
using WebsitePanel.Providers.OS;
|
||||
using WebsitePanel.Providers.RemoteDesktopServices;
|
||||
using WebsitePanel.Server.Utils;
|
||||
|
||||
|
@ -55,7 +59,273 @@ namespace WebsitePanel.Server
|
|||
get { return (IRemoteDesktopServices)Provider; }
|
||||
}
|
||||
|
||||
[WebMethod, SoapHeader("settings")]
|
||||
public bool CreateCollection(string organizationId, RdsCollection collection)
|
||||
{
|
||||
try
|
||||
{
|
||||
Log.WriteStart("'{0}' CreateCollection", ProviderSettings.ProviderName);
|
||||
var result = RDSProvider.CreateCollection(organizationId, collection);
|
||||
Log.WriteEnd("'{0}' CreateCollection", ProviderSettings.ProviderName);
|
||||
return result;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.WriteError(String.Format("'{0}' CreateCollection", ProviderSettings.ProviderName), ex);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
[WebMethod, SoapHeader("settings")]
|
||||
public RdsCollection GetCollection(string collectionName)
|
||||
{
|
||||
try
|
||||
{
|
||||
Log.WriteStart("'{0}' GetCollection", ProviderSettings.ProviderName);
|
||||
var result = RDSProvider.GetCollection(collectionName);
|
||||
Log.WriteEnd("'{0}' GetCollection", ProviderSettings.ProviderName);
|
||||
return result;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.WriteError(String.Format("'{0}' GetCollection", ProviderSettings.ProviderName), ex);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
[WebMethod, SoapHeader("settings")]
|
||||
public bool RemoveCollection(string organizationId, string collectionName)
|
||||
{
|
||||
try
|
||||
{
|
||||
Log.WriteStart("'{0}' RemoveCollection", ProviderSettings.ProviderName);
|
||||
var result = RDSProvider.RemoveCollection(organizationId,collectionName);
|
||||
Log.WriteEnd("'{0}' RemoveCollection", ProviderSettings.ProviderName);
|
||||
return result;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.WriteError(String.Format("'{0}' RemoveCollection", ProviderSettings.ProviderName), ex);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
[WebMethod, SoapHeader("settings")]
|
||||
public bool SetUsersInCollection(string organizationId, string collectionName, List<string> users)
|
||||
{
|
||||
try
|
||||
{
|
||||
Log.WriteStart("'{0}' UpdateUsersInCollection", ProviderSettings.ProviderName);
|
||||
var result = RDSProvider.SetUsersInCollection(organizationId, collectionName, users);
|
||||
Log.WriteEnd("'{0}' UpdateUsersInCollection", ProviderSettings.ProviderName);
|
||||
return result;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.WriteError(String.Format("'{0}' UpdateUsersInCollection", ProviderSettings.ProviderName), ex);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
[WebMethod, SoapHeader("settings")]
|
||||
public void AddSessionHostServerToCollection(string organizationId, string collectionName, RdsServer server)
|
||||
{
|
||||
try
|
||||
{
|
||||
Log.WriteStart("'{0}' AddSessionHostServersToCollection", ProviderSettings.ProviderName);
|
||||
RDSProvider.AddSessionHostServerToCollection(organizationId, collectionName, server);
|
||||
Log.WriteEnd("'{0}' AddSessionHostServersToCollection", ProviderSettings.ProviderName);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.WriteError(String.Format("'{0}' AddSessionHostServersToCollection", ProviderSettings.ProviderName), ex);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
[WebMethod, SoapHeader("settings")]
|
||||
public void AddSessionHostServersToCollection(string organizationId, string collectionName, List<RdsServer> servers)
|
||||
{
|
||||
try
|
||||
{
|
||||
Log.WriteStart("'{0}' AddSessionHostServersToCollection", ProviderSettings.ProviderName);
|
||||
RDSProvider.AddSessionHostServersToCollection(organizationId, collectionName, servers);
|
||||
Log.WriteEnd("'{0}' AddSessionHostServersToCollection", ProviderSettings.ProviderName);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.WriteError(String.Format("'{0}' AddSessionHostServersToCollection", ProviderSettings.ProviderName), ex);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
[WebMethod, SoapHeader("settings")]
|
||||
public void RemoveSessionHostServerFromCollection(string organizationId, string collectionName, RdsServer server)
|
||||
{
|
||||
try
|
||||
{
|
||||
Log.WriteStart("'{0}' RemoveSessionHostServerFromCollection", ProviderSettings.ProviderName);
|
||||
RDSProvider.RemoveSessionHostServerFromCollection(organizationId, collectionName, server);
|
||||
Log.WriteEnd("'{0}' RemoveSessionHostServerFromCollection", ProviderSettings.ProviderName);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.WriteError(String.Format("'{0}' RemoveSessionHostServerFromCollection", ProviderSettings.ProviderName), ex);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
[WebMethod, SoapHeader("settings")]
|
||||
public void RemoveSessionHostServersFromCollection(string organizationId, string collectionName, List<RdsServer> servers)
|
||||
{
|
||||
try
|
||||
{
|
||||
Log.WriteStart("'{0}' RemoveSessionHostServersFromCollection", ProviderSettings.ProviderName);
|
||||
RDSProvider.RemoveSessionHostServersFromCollection(organizationId, collectionName, servers);
|
||||
Log.WriteEnd("'{0}' RemoveSessionHostServersFromCollection", ProviderSettings.ProviderName);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.WriteError(String.Format("'{0}' RemoveSessionHostServersFromCollection", ProviderSettings.ProviderName), ex);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
[WebMethod, SoapHeader("settings")]
|
||||
public List<StartMenuApp> GetAvailableRemoteApplications(string collectionName)
|
||||
{
|
||||
try
|
||||
{
|
||||
Log.WriteStart("'{0}' GetAvailableRemoteApplications", ProviderSettings.ProviderName);
|
||||
var result = RDSProvider.GetAvailableRemoteApplications(collectionName);
|
||||
Log.WriteEnd("'{0}' GetAvailableRemoteApplications", ProviderSettings.ProviderName);
|
||||
return result;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.WriteError(String.Format("'{0}' UpdateUsersInCollection", ProviderSettings.ProviderName), ex);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
[WebMethod, SoapHeader("settings")]
|
||||
public List<RemoteApplication> GetCollectionRemoteApplications(string collectionName)
|
||||
{
|
||||
try
|
||||
{
|
||||
Log.WriteStart("'{0}' GetCollectionRemoteApplications", ProviderSettings.ProviderName);
|
||||
var result = RDSProvider.GetCollectionRemoteApplications(collectionName);
|
||||
Log.WriteEnd("'{0}' GetCollectionRemoteApplications", ProviderSettings.ProviderName);
|
||||
return result;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.WriteError(String.Format("'{0}' GetCollectionRemoteApplications", ProviderSettings.ProviderName), ex);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
[WebMethod, SoapHeader("settings")]
|
||||
public bool AddRemoteApplication(string collectionName, RemoteApplication remoteApp)
|
||||
{
|
||||
try
|
||||
{
|
||||
Log.WriteStart("'{0}' AddRemoteApplication", ProviderSettings.ProviderName);
|
||||
var result = RDSProvider.AddRemoteApplication(collectionName, remoteApp);
|
||||
Log.WriteEnd("'{0}' AddRemoteApplication", ProviderSettings.ProviderName);
|
||||
return result;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.WriteError(String.Format("'{0}' AddRemoteApplication", ProviderSettings.ProviderName), ex);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
[WebMethod, SoapHeader("settings")]
|
||||
public bool AddRemoteApplications(string collectionName, List<RemoteApplication> remoteApps)
|
||||
{
|
||||
try
|
||||
{
|
||||
Log.WriteStart("'{0}' AddRemoteApplications", ProviderSettings.ProviderName);
|
||||
var result = RDSProvider.AddRemoteApplications(collectionName, remoteApps);
|
||||
Log.WriteEnd("'{0}' AddRemoteApplications", ProviderSettings.ProviderName);
|
||||
return result;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.WriteError(String.Format("'{0}' AddRemoteApplications", ProviderSettings.ProviderName), ex);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
[WebMethod, SoapHeader("settings")]
|
||||
public bool RemoveRemoteApplication(string collectionName, RemoteApplication remoteApp)
|
||||
{
|
||||
try
|
||||
{
|
||||
Log.WriteStart("'{0}' RemoveRemoteApplication", ProviderSettings.ProviderName);
|
||||
var result = RDSProvider.RemoveRemoteApplication(collectionName, remoteApp);
|
||||
Log.WriteEnd("'{0}' RemoveRemoteApplication", ProviderSettings.ProviderName);
|
||||
return result;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.WriteError(String.Format("'{0}' RemoveRemoteApplication", ProviderSettings.ProviderName), ex);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
[WebMethod, SoapHeader("settings")]
|
||||
public bool AddSessionHostFeatureToServer(string hostName)
|
||||
{
|
||||
try
|
||||
{
|
||||
Log.WriteStart("'{0}' AddSessionHostFeatureToServer", ProviderSettings.ProviderName);
|
||||
var result = RDSProvider.AddSessionHostFeatureToServer(hostName);
|
||||
Log.WriteEnd("'{0}' AddSessionHostFeatureToServer", ProviderSettings.ProviderName);
|
||||
return result;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.WriteError(String.Format("'{0}' AddSessionHostServersToCollection", ProviderSettings.ProviderName), ex);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
[WebMethod, SoapHeader("settings")]
|
||||
public bool CheckSessionHostFeatureInstallation(string hostName)
|
||||
{
|
||||
try
|
||||
{
|
||||
Log.WriteStart("'{0}' CheckSessionHostFeatureInstallation", ProviderSettings.ProviderName);
|
||||
var result = RDSProvider.CheckSessionHostFeatureInstallation(hostName);
|
||||
Log.WriteEnd("'{0}' CheckSessionHostFeatureInstallation", ProviderSettings.ProviderName);
|
||||
return result;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.WriteError(String.Format("'{0}' CheckSessionHostFeatureInstallation", ProviderSettings.ProviderName), ex);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
[WebMethod, SoapHeader("settings")]
|
||||
public bool CheckServerAvailability(string hostName)
|
||||
{
|
||||
try
|
||||
{
|
||||
Log.WriteStart("'{0}' CheckServerAvailability", ProviderSettings.ProviderName);
|
||||
var result = RDSProvider.CheckServerAvailability(hostName);
|
||||
Log.WriteEnd("'{0}' CheckServerAvailability", ProviderSettings.ProviderName);
|
||||
return result;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.WriteError(String.Format("'{0}' CheckServerAvailability", ProviderSettings.ProviderName), ex);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue