RDS user sessions added
This commit is contained in:
parent
07a68d5ba1
commit
128fdaaa0b
20 changed files with 922 additions and 4 deletions
|
@ -103,6 +103,11 @@ namespace WebsitePanel.EnterpriseServer
|
|||
return GetRdsServersPagedInternal(filterColumn, filterValue, sortColumn, startRow, maximumRows);
|
||||
}
|
||||
|
||||
public static List<RdsUserSession> GetRdsUserSessions(int collectionId)
|
||||
{
|
||||
return GetRdsUserSessionsInternal(collectionId);
|
||||
}
|
||||
|
||||
public static RdsServersPaged GetFreeRdsServersPaged(int packageId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows)
|
||||
{
|
||||
return GetFreeRdsServersPagedInternal(packageId, filterColumn, filterValue, sortColumn, startRow, maximumRows);
|
||||
|
@ -233,6 +238,11 @@ namespace WebsitePanel.EnterpriseServer
|
|||
return SetApplicationUsersInternal(itemId, collectionId, remoteApp, users);
|
||||
}
|
||||
|
||||
public static ResultObject LogOffRdsUser(int itemId, string unifiedSessionId, string hostServer)
|
||||
{
|
||||
return LogOffRdsUserInternal(itemId, unifiedSessionId, hostServer);
|
||||
}
|
||||
|
||||
private static RdsCollection GetRdsCollectionInternal(int collectionId)
|
||||
{
|
||||
var collection = ObjectUtils.FillObjectFromDataReader<RdsCollection>(DataProvider.GetRDSCollectionById(collectionId));
|
||||
|
@ -579,6 +589,22 @@ namespace WebsitePanel.EnterpriseServer
|
|||
return result;
|
||||
}
|
||||
|
||||
private static List<RdsUserSession> GetRdsUserSessionsInternal(int collectionId)
|
||||
{
|
||||
var result = new List<RdsUserSession>();
|
||||
var collection = ObjectUtils.FillObjectFromDataReader<RdsCollection>(DataProvider.GetRDSCollectionById(collectionId));
|
||||
var organization = OrganizationController.GetOrganization(collection.ItemId);
|
||||
|
||||
if (organization == null)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
|
||||
var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(organization.PackageId));
|
||||
|
||||
return rds.GetRdsUserSessions(collection.Name).ToList();
|
||||
}
|
||||
|
||||
private static RdsServersPaged GetFreeRdsServersPagedInternal(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows)
|
||||
{
|
||||
RdsServersPaged result = new RdsServersPaged();
|
||||
|
@ -1105,6 +1131,44 @@ namespace WebsitePanel.EnterpriseServer
|
|||
return result;
|
||||
}
|
||||
|
||||
private static ResultObject LogOffRdsUserInternal(int itemId, string unifiedSessionId, string hostServer)
|
||||
{
|
||||
var result = TaskManager.StartResultTask<ResultObject>("REMOTE_DESKTOP_SERVICES", "LOG_OFF_RDS_USER");
|
||||
|
||||
try
|
||||
{
|
||||
Organization org = OrganizationController.GetOrganization(itemId);
|
||||
|
||||
if (org == null)
|
||||
{
|
||||
result.IsSuccess = false;
|
||||
result.AddError("LOG_OFF_RDS_USER", new NullReferenceException("Organization not found"));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
|
||||
rds.LogOffRdsUser(unifiedSessionId, hostServer);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
result.AddError("REMOTE_DESKTOP_SERVICES_LOG_OFF_RDS_USER", ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (!result.IsSuccess)
|
||||
{
|
||||
TaskManager.CompleteResultTask(result);
|
||||
}
|
||||
else
|
||||
{
|
||||
TaskManager.CompleteResultTask();
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
private static ResultObject AddRemoteApplicationToCollectionInternal(int itemId, RdsCollection collection, RemoteApplication remoteApp)
|
||||
{
|
||||
var result = TaskManager.StartResultTask<ResultObject>("REMOTE_DESKTOP_SERVICES", "ADD_REMOTE_APP_TO_COLLECTION");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue