RDS user sessions added
This commit is contained in:
parent
07a68d5ba1
commit
128fdaaa0b
20 changed files with 922 additions and 4 deletions
|
@ -100,6 +100,10 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
|
||||
private System.Threading.SendOrPostCallback SetApplicationUsersOperationCompleted;
|
||||
|
||||
private System.Threading.SendOrPostCallback GetRdsUserSessionsOperationCompleted;
|
||||
|
||||
private System.Threading.SendOrPostCallback LogOffRdsUserOperationCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
public esRemoteDesktopServices() {
|
||||
this.Url = "http://localhost:9002/esRemoteDesktopServices.asmx";
|
||||
|
@ -210,6 +214,12 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
/// <remarks/>
|
||||
public event SetApplicationUsersCompletedEventHandler SetApplicationUsersCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
public event GetRdsUserSessionsCompletedEventHandler GetRdsUserSessionsCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
public event LogOffRdsUserCompletedEventHandler LogOffRdsUserCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetRdsCollection", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
||||
public RdsCollection GetRdsCollection(int collectionId) {
|
||||
|
@ -1800,6 +1810,94 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetRdsUserSessions", 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 RdsUserSession[] GetRdsUserSessions(int collectionId) {
|
||||
object[] results = this.Invoke("GetRdsUserSessions", new object[] {
|
||||
collectionId});
|
||||
return ((RdsUserSession[])(results[0]));
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public System.IAsyncResult BeginGetRdsUserSessions(int collectionId, System.AsyncCallback callback, object asyncState) {
|
||||
return this.BeginInvoke("GetRdsUserSessions", new object[] {
|
||||
collectionId}, callback, asyncState);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public RdsUserSession[] EndGetRdsUserSessions(System.IAsyncResult asyncResult) {
|
||||
object[] results = this.EndInvoke(asyncResult);
|
||||
return ((RdsUserSession[])(results[0]));
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void GetRdsUserSessionsAsync(int collectionId) {
|
||||
this.GetRdsUserSessionsAsync(collectionId, null);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void GetRdsUserSessionsAsync(int collectionId, object userState) {
|
||||
if ((this.GetRdsUserSessionsOperationCompleted == null)) {
|
||||
this.GetRdsUserSessionsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRdsUserSessionsOperationCompleted);
|
||||
}
|
||||
this.InvokeAsync("GetRdsUserSessions", new object[] {
|
||||
collectionId}, this.GetRdsUserSessionsOperationCompleted, userState);
|
||||
}
|
||||
|
||||
private void OnGetRdsUserSessionsOperationCompleted(object arg) {
|
||||
if ((this.GetRdsUserSessionsCompleted != null)) {
|
||||
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
|
||||
this.GetRdsUserSessionsCompleted(this, new GetRdsUserSessionsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/LogOffRdsUser", 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 LogOffRdsUser(int itemId, string unifiedSessionId, string hostServer) {
|
||||
object[] results = this.Invoke("LogOffRdsUser", new object[] {
|
||||
itemId,
|
||||
unifiedSessionId,
|
||||
hostServer});
|
||||
return ((ResultObject)(results[0]));
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public System.IAsyncResult BeginLogOffRdsUser(int itemId, string unifiedSessionId, string hostServer, System.AsyncCallback callback, object asyncState) {
|
||||
return this.BeginInvoke("LogOffRdsUser", new object[] {
|
||||
itemId,
|
||||
unifiedSessionId,
|
||||
hostServer}, callback, asyncState);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public ResultObject EndLogOffRdsUser(System.IAsyncResult asyncResult) {
|
||||
object[] results = this.EndInvoke(asyncResult);
|
||||
return ((ResultObject)(results[0]));
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void LogOffRdsUserAsync(int itemId, string unifiedSessionId, string hostServer) {
|
||||
this.LogOffRdsUserAsync(itemId, unifiedSessionId, hostServer, null);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void LogOffRdsUserAsync(int itemId, string unifiedSessionId, string hostServer, object userState) {
|
||||
if ((this.LogOffRdsUserOperationCompleted == null)) {
|
||||
this.LogOffRdsUserOperationCompleted = new System.Threading.SendOrPostCallback(this.OnLogOffRdsUserOperationCompleted);
|
||||
}
|
||||
this.InvokeAsync("LogOffRdsUser", new object[] {
|
||||
itemId,
|
||||
unifiedSessionId,
|
||||
hostServer}, this.LogOffRdsUserOperationCompleted, userState);
|
||||
}
|
||||
|
||||
private void OnLogOffRdsUserOperationCompleted(object arg) {
|
||||
if ((this.LogOffRdsUserCompleted != null)) {
|
||||
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
|
||||
this.LogOffRdsUserCompleted(this, new LogOffRdsUserCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public new void CancelAsync(object userState) {
|
||||
base.CancelAsync(userState);
|
||||
|
@ -2715,4 +2813,56 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||
public delegate void GetRdsUserSessionsCompletedEventHandler(object sender, GetRdsUserSessionsCompletedEventArgs e);
|
||||
|
||||
/// <remarks/>
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||
[System.Diagnostics.DebuggerStepThroughAttribute()]
|
||||
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||
public partial class GetRdsUserSessionsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
|
||||
|
||||
private object[] results;
|
||||
|
||||
internal GetRdsUserSessionsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
|
||||
base(exception, cancelled, userState) {
|
||||
this.results = results;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public RdsUserSession[] Result {
|
||||
get {
|
||||
this.RaiseExceptionIfNecessary();
|
||||
return ((RdsUserSession[])(this.results[0]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||
public delegate void LogOffRdsUserCompletedEventHandler(object sender, LogOffRdsUserCompletedEventArgs e);
|
||||
|
||||
/// <remarks/>
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||
[System.Diagnostics.DebuggerStepThroughAttribute()]
|
||||
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||
public partial class LogOffRdsUserCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
|
||||
|
||||
private object[] results;
|
||||
|
||||
internal LogOffRdsUserCompletedEventArgs(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]));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -271,5 +271,17 @@ namespace WebsitePanel.EnterpriseServer
|
|||
{
|
||||
return RemoteDesktopServicesController.SetApplicationUsers(itemId, collectionId, remoteApp, users);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public List<RdsUserSession> GetRdsUserSessions(int collectionId)
|
||||
{
|
||||
return RemoteDesktopServicesController.GetRdsUserSessions(collectionId);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public ResultObject LogOffRdsUser(int itemId, string unifiedSessionId, string hostServer)
|
||||
{
|
||||
return RemoteDesktopServicesController.LogOffRdsUser(itemId, unifiedSessionId, hostServer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -66,5 +66,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
bool CheckRDSServerAvaliable(string hostname);
|
||||
List<string> GetServersExistingInCollections();
|
||||
void EditRdsCollectionSettings(RdsCollection collection);
|
||||
List<RdsUserSession> GetRdsUserSessions(string collectionName);
|
||||
void LogOffRdsUser(string unifiedSessionId, string hostServer);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||
{
|
||||
public class RdsUserSession
|
||||
{
|
||||
public string CollectionName { get; set; }
|
||||
public string UserName { get; set; }
|
||||
public string UnifiedSessionId { get; set; }
|
||||
public string SessionState { get; set; }
|
||||
public string HostServer { get; set; }
|
||||
}
|
||||
}
|
|
@ -136,6 +136,7 @@
|
|||
<Compile Include="RemoteDesktopServices\RdsPolicyTypes.cs" />
|
||||
<Compile Include="RemoteDesktopServices\RdsServer.cs" />
|
||||
<Compile Include="RemoteDesktopServices\RdsServersPaged.cs" />
|
||||
<Compile Include="RemoteDesktopServices\RdsUserSession.cs" />
|
||||
<Compile Include="RemoteDesktopServices\RemoteApplication.cs" />
|
||||
<Compile Include="RemoteDesktopServices\SessionHostServer.cs" />
|
||||
<Compile Include="RemoteDesktopServices\StartMenuApp.cs" />
|
||||
|
|
|
@ -336,6 +336,50 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
}
|
||||
}
|
||||
|
||||
public List<RdsUserSession> GetRdsUserSessions(string collectionName)
|
||||
{
|
||||
Runspace runSpace = null;
|
||||
var result = new List<RdsUserSession>();
|
||||
|
||||
try
|
||||
{
|
||||
runSpace = OpenRunspace();
|
||||
result = GetRdsUserSessionsInternal(collectionName, runSpace);
|
||||
}
|
||||
finally
|
||||
{
|
||||
CloseRunspace(runSpace);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public void LogOffRdsUser(string unifiedSessionId, string hostServer)
|
||||
{
|
||||
Runspace runSpace = null;
|
||||
|
||||
try
|
||||
{
|
||||
runSpace = OpenRunspace();
|
||||
object[] errors;
|
||||
Command cmd = new Command("Invoke-RDUserLogoff");
|
||||
cmd.Parameters.Add("HostServer", hostServer);
|
||||
cmd.Parameters.Add("UnifiedSessionID", unifiedSessionId);
|
||||
cmd.Parameters.Add("Force", true);
|
||||
|
||||
ExecuteShellCommand(runSpace, cmd, false, out errors);
|
||||
|
||||
if (errors != null && errors.Length > 0)
|
||||
{
|
||||
throw new Exception(string.Join("r\\n\\", errors.Select(e => e.ToString()).ToArray()));
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
CloseRunspace(runSpace);
|
||||
}
|
||||
}
|
||||
|
||||
public List<string> GetServersExistingInCollections()
|
||||
{
|
||||
Runspace runSpace = null;
|
||||
|
@ -1676,6 +1720,35 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
return new List<string>();
|
||||
}
|
||||
|
||||
internal List<RdsUserSession> GetRdsUserSessionsInternal(string collectionName, Runspace runSpace)
|
||||
{
|
||||
var result = new List<RdsUserSession>();
|
||||
var scripts = new List<string>();
|
||||
scripts.Add(string.Format("Get-RDUserSession -ConnectionBroker {0} - CollectionName {1} | ft CollectionName, Username, UnifiedSessionId, SessionState, HostServer", ConnectionBroker, collectionName));
|
||||
object[] errors;
|
||||
Command cmd = new Command("Get-RDUserSession");
|
||||
cmd.Parameters.Add("CollectionName", collectionName);
|
||||
cmd.Parameters.Add("ConnectionBroker", ConnectionBroker);
|
||||
var userSessions = ExecuteShellCommand(runSpace, cmd, false, out errors);
|
||||
|
||||
//var userSessions = ExecuteShellCommand(runSpace, scripts, out errors);
|
||||
var properties = typeof(RdsUserSession).GetProperties();
|
||||
|
||||
foreach(var userSession in userSessions)
|
||||
{
|
||||
var session = new RdsUserSession();
|
||||
|
||||
foreach(var prop in properties)
|
||||
{
|
||||
prop.SetValue(session, GetPSObjectProperty(userSession, prop.Name).ToString(), null);
|
||||
}
|
||||
|
||||
result.Add(session);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,6 +33,8 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
|
|||
|
||||
private System.Threading.SendOrPostCallback EditRdsCollectionSettingsOperationCompleted;
|
||||
|
||||
private System.Threading.SendOrPostCallback GetRdsUserSessionsOperationCompleted;
|
||||
|
||||
private System.Threading.SendOrPostCallback AddRdsServersToDeploymentOperationCompleted;
|
||||
|
||||
private System.Threading.SendOrPostCallback GetCollectionOperationCompleted;
|
||||
|
@ -75,6 +77,8 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
|
|||
|
||||
private System.Threading.SendOrPostCallback GetServersExistingInCollectionsOperationCompleted;
|
||||
|
||||
private System.Threading.SendOrPostCallback LogOffRdsUserOperationCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
public RemoteDesktopServices() {
|
||||
this.Url = "http://localhost:9003/RemoteDesktopServices.asmx";
|
||||
|
@ -86,6 +90,9 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
|
|||
/// <remarks/>
|
||||
public event EditRdsCollectionSettingsCompletedEventHandler EditRdsCollectionSettingsCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
public event GetRdsUserSessionsCompletedEventHandler GetRdsUserSessionsCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
public event AddRdsServersToDeploymentCompletedEventHandler AddRdsServersToDeploymentCompleted;
|
||||
|
||||
|
@ -149,6 +156,9 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
|
|||
/// <remarks/>
|
||||
public event GetServersExistingInCollectionsCompletedEventHandler GetServersExistingInCollectionsCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
public event LogOffRdsUserCompletedEventHandler LogOffRdsUserCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
|
||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateCollection", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
||||
|
@ -234,6 +244,48 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
|
|||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
|
||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetRdsUserSessions", 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 RdsUserSession[] GetRdsUserSessions(string collectionName) {
|
||||
object[] results = this.Invoke("GetRdsUserSessions", new object[] {
|
||||
collectionName});
|
||||
return ((RdsUserSession[])(results[0]));
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public System.IAsyncResult BeginGetRdsUserSessions(string collectionName, System.AsyncCallback callback, object asyncState) {
|
||||
return this.BeginInvoke("GetRdsUserSessions", new object[] {
|
||||
collectionName}, callback, asyncState);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public RdsUserSession[] EndGetRdsUserSessions(System.IAsyncResult asyncResult) {
|
||||
object[] results = this.EndInvoke(asyncResult);
|
||||
return ((RdsUserSession[])(results[0]));
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void GetRdsUserSessionsAsync(string collectionName) {
|
||||
this.GetRdsUserSessionsAsync(collectionName, null);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void GetRdsUserSessionsAsync(string collectionName, object userState) {
|
||||
if ((this.GetRdsUserSessionsOperationCompleted == null)) {
|
||||
this.GetRdsUserSessionsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRdsUserSessionsOperationCompleted);
|
||||
}
|
||||
this.InvokeAsync("GetRdsUserSessions", new object[] {
|
||||
collectionName}, this.GetRdsUserSessionsOperationCompleted, userState);
|
||||
}
|
||||
|
||||
private void OnGetRdsUserSessionsOperationCompleted(object arg) {
|
||||
if ((this.GetRdsUserSessionsCompleted != null)) {
|
||||
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
|
||||
this.GetRdsUserSessionsCompleted(this, new GetRdsUserSessionsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
|
||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/AddRdsServersToDeployment", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
||||
|
@ -1157,6 +1209,49 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
|
|||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
|
||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/LogOffRdsUser", 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 LogOffRdsUser(string unifiedSessionId, string hostServer) {
|
||||
this.Invoke("LogOffRdsUser", new object[] {
|
||||
unifiedSessionId,
|
||||
hostServer});
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public System.IAsyncResult BeginLogOffRdsUser(string unifiedSessionId, string hostServer, System.AsyncCallback callback, object asyncState) {
|
||||
return this.BeginInvoke("LogOffRdsUser", new object[] {
|
||||
unifiedSessionId,
|
||||
hostServer}, callback, asyncState);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void EndLogOffRdsUser(System.IAsyncResult asyncResult) {
|
||||
this.EndInvoke(asyncResult);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void LogOffRdsUserAsync(string unifiedSessionId, string hostServer) {
|
||||
this.LogOffRdsUserAsync(unifiedSessionId, hostServer, null);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void LogOffRdsUserAsync(string unifiedSessionId, string hostServer, object userState) {
|
||||
if ((this.LogOffRdsUserOperationCompleted == null)) {
|
||||
this.LogOffRdsUserOperationCompleted = new System.Threading.SendOrPostCallback(this.OnLogOffRdsUserOperationCompleted);
|
||||
}
|
||||
this.InvokeAsync("LogOffRdsUser", new object[] {
|
||||
unifiedSessionId,
|
||||
hostServer}, this.LogOffRdsUserOperationCompleted, userState);
|
||||
}
|
||||
|
||||
private void OnLogOffRdsUserOperationCompleted(object arg) {
|
||||
if ((this.LogOffRdsUserCompleted != null)) {
|
||||
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
|
||||
this.LogOffRdsUserCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public new void CancelAsync(object userState) {
|
||||
base.CancelAsync(userState);
|
||||
|
@ -1193,6 +1288,32 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
|
|||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||
public delegate void EditRdsCollectionSettingsCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
|
||||
|
||||
/// <remarks/>
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||
public delegate void GetRdsUserSessionsCompletedEventHandler(object sender, GetRdsUserSessionsCompletedEventArgs e);
|
||||
|
||||
/// <remarks/>
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||
[System.Diagnostics.DebuggerStepThroughAttribute()]
|
||||
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||
public partial class GetRdsUserSessionsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
|
||||
|
||||
private object[] results;
|
||||
|
||||
internal GetRdsUserSessionsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
|
||||
base(exception, cancelled, userState) {
|
||||
this.results = results;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public RdsUserSession[] Result {
|
||||
get {
|
||||
this.RaiseExceptionIfNecessary();
|
||||
return ((RdsUserSession[])(this.results[0]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||
public delegate void AddRdsServersToDeploymentCompletedEventHandler(object sender, AddRdsServersToDeploymentCompletedEventArgs e);
|
||||
|
@ -1628,4 +1749,8 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||
public delegate void LogOffRdsUserCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
|
||||
}
|
||||
|
|
|
@ -92,6 +92,24 @@ namespace WebsitePanel.Server
|
|||
}
|
||||
}
|
||||
|
||||
[WebMethod, SoapHeader("settings")]
|
||||
public List<RdsUserSession> GetRdsUserSessions(string collectionName)
|
||||
{
|
||||
try
|
||||
{
|
||||
Log.WriteStart("'{0}' GetRdsUserSessions", ProviderSettings.ProviderName);
|
||||
var result = RDSProvider.GetRdsUserSessions(collectionName);
|
||||
Log.WriteEnd("'{0}' GetRdsUserSessions", ProviderSettings.ProviderName);
|
||||
|
||||
return result;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.WriteError(String.Format("'{0}' GetRdsUserSessions", ProviderSettings.ProviderName), ex);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
[WebMethod, SoapHeader("settings")]
|
||||
public bool AddRdsServersToDeployment(RdsServer[] servers)
|
||||
{
|
||||
|
@ -443,5 +461,21 @@ namespace WebsitePanel.Server
|
|||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
[WebMethod, SoapHeader("settings")]
|
||||
public void LogOffRdsUser(string unifiedSessionId, string hostServer)
|
||||
{
|
||||
try
|
||||
{
|
||||
Log.WriteStart("'{0}' LogOffRdsUser", ProviderSettings.ProviderName);
|
||||
RDSProvider.LogOffRdsUser(unifiedSessionId, hostServer);
|
||||
Log.WriteEnd("'{0}' LogOffRdsUser", ProviderSettings.ProviderName);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Log.WriteError(String.Format("'{0}' LogOffRdsUser", ProviderSettings.ProviderName), ex);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -150,4 +150,5 @@
|
|||
<Control key="rds_application_edit_users" general_key="rds_collections" />
|
||||
<Control key="rds_edit_collection" general_key="rds_collections" />
|
||||
<Control key="rds_edit_collection_settings" general_key="rds_collections" />
|
||||
<Control key="rds_collection_user_sessions" general_key="rds_collections" />
|
||||
</Controls>
|
||||
|
|
|
@ -581,6 +581,7 @@
|
|||
<Control key="rds_application_edit_users" src="WebsitePanel/RDS/RDSEditApplicationUsers.ascx" title="RDSEditApplicationUsers" type="View" />
|
||||
<Control key="rds_edit_collection" src="WebsitePanel/RDS/RDSEditCollection.ascx" title="RDSEditCollection" type="View" />
|
||||
<Control key="rds_edit_collection_settings" src="WebsitePanel/RDS/RDSEditCollectionSettings.ascx" title="RDSEditCollectionSettings" type="View" />
|
||||
<Control key="rds_collection_user_sessions" src="WebsitePanel/RDS/RDSUserSessions.ascx" title="RDSUserSessions" type="View" />
|
||||
</Controls>
|
||||
</ModuleDefinition>
|
||||
|
||||
|
|
|
@ -5641,4 +5641,10 @@
|
|||
<data name="ERROR.RDSCOLLECTIONSETTINGS_NOT_UPDATES" xml:space="preserve">
|
||||
<value>RDS Collection settings not updated</value>
|
||||
</data>
|
||||
<data name="ERROR.REMOTE_DESKTOP_SERVICES_LOG_OFF_USER" xml:space="preserve">
|
||||
<value>RDS User logging off error</value>
|
||||
</data>
|
||||
<data name="ERROR.REMOTE_DESKTOP_SERVICES_USER_SESSIONS" xml:space="preserve">
|
||||
<value>GEtting RDS User sessions error</value>
|
||||
</data>
|
||||
</root>
|
|
@ -0,0 +1,150 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="gvHostServer.HeaderText" xml:space="preserve">
|
||||
<value>Host Server</value>
|
||||
</data>
|
||||
<data name="gvRDSUserSessions.Empty" xml:space="preserve">
|
||||
<value>No user sessions.</value>
|
||||
</data>
|
||||
<data name="gvSessionState.HeaderText" xml:space="preserve">
|
||||
<value>Session State</value>
|
||||
</data>
|
||||
<data name="gvUserName.HeaderText" xml:space="preserve">
|
||||
<value>User Name</value>
|
||||
</data>
|
||||
<data name="locTitle" xml:space="preserve">
|
||||
<value>Edit RDS Collection</value>
|
||||
</data>
|
||||
<data name="secRdsUserSessions" xml:space="preserve">
|
||||
<value>RDS User Sessions</value>
|
||||
</data>
|
||||
<data name="Text.PageName" xml:space="preserve">
|
||||
<value>RDS User Sessions</value>
|
||||
</data>
|
||||
<data name="cmdLogOff.OnClientClick" xml:space="preserve">
|
||||
<value>if(!confirm('Are you sure you want to log off user?')) return false; else ShowProgressDialog('Logging off user...');</value>
|
||||
</data>
|
||||
<data name="cmdLogOff.Text" xml:space="preserve">
|
||||
<value>Log Off</value>
|
||||
</data>
|
||||
<data name="cmdLogOff.ToolTip" xml:space="preserve">
|
||||
<value>Log Off</value>
|
||||
</data>
|
||||
</root>
|
|
@ -0,0 +1,74 @@
|
|||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="RDSUserSessions.ascx.cs" Inherits="WebsitePanel.Portal.RDS.RDSUserSessions" %>
|
||||
<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %>
|
||||
<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %>
|
||||
<%@ Register Src="UserControls/RDSCollectionTabs.ascx" TagName="CollectionTabs" TagPrefix="wsp" %>
|
||||
<%@ Register TagPrefix="wsp" TagName="CollapsiblePanel" Src="../UserControls/CollapsiblePanel.ascx" %>
|
||||
<%@ Register Src="../UserControls/ItemButtonPanel.ascx" TagName="ItemButtonPanel" TagPrefix="wsp" %>
|
||||
<script type="text/javascript" src="/JavaScript/jquery.min.js?v=1.4.4"></script>
|
||||
|
||||
<wsp:EnableAsyncTasksSupport id="asyncTasks" runat="server"/>
|
||||
|
||||
<div id="ExchangeContainer">
|
||||
<div class="Module">
|
||||
<div class="Left">
|
||||
</div>
|
||||
<div class="Content">
|
||||
<div class="Center">
|
||||
<div class="Title">
|
||||
<asp:Image ID="imgEditRDSCollection" SkinID="EnterpriseStorageSpace48" runat="server" />
|
||||
<asp:Localize ID="locTitle" runat="server" meta:resourcekey="locTitle" Text="Edit RDS Collection"></asp:Localize>
|
||||
-
|
||||
<asp:Literal ID="litCollectionName" runat="server" Text="" />
|
||||
</div>
|
||||
<div class="FormBody">
|
||||
<wsp:CollectionTabs id="tabs" runat="server" SelectedTab="rds_collection_user_sessions" />
|
||||
<wsp:SimpleMessageBox id="messageBox" runat="server" />
|
||||
|
||||
<wsp:CollapsiblePanel id="secRdsUserSessions" runat="server"
|
||||
TargetControlID="panelRdsUserSessions" meta:resourcekey="secRdsUserSessions" Text="">
|
||||
</wsp:CollapsiblePanel>
|
||||
|
||||
<asp:Panel runat="server" ID="panelRdsUserSessions">
|
||||
<div style="padding: 10px;">
|
||||
<asp:GridView ID="gvRDSUserSessions" runat="server" AutoGenerateColumns="False" EnableViewState="true"
|
||||
Width="100%" EmptyDataText="gvRDSUserSessions" CssSelectorClass="NormalGridView"
|
||||
OnRowCommand="gvRDSCollections_RowCommand" AllowPaging="True" AllowSorting="True">
|
||||
<Columns>
|
||||
<asp:TemplateField meta:resourcekey="gvUserName" HeaderText="gvUserName">
|
||||
<ItemStyle Width="30%" Wrap="false"/>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="litUserName" runat="server" Text='<%# Eval("UserName") %>'/>
|
||||
<asp:HiddenField ID="hfUnifiedSessionId" runat="server" Value='<%# Eval("UnifiedSessionId") %>'/>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField meta:resourcekey="gvHostServer" HeaderText="gvHostServer">
|
||||
<ItemStyle Width="30%" Wrap="false"/>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="litHostServer" runat="server" Text='<%# Eval("HostServer") %>'/>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField meta:resourcekey="gvSessionState" HeaderText="gvSessionState">
|
||||
<ItemStyle Width="30%" Wrap="false"/>
|
||||
<ItemTemplate>
|
||||
<asp:Literal ID="litSessionState" runat="server" Text='<%# Eval("SessionState") %>'/>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="lnkLogOff" runat="server" Text="Log Off" CommandName="LogOff" CommandArgument='<%# Eval("UnifiedSessionId") + ";" + Eval("HostServer") %>'
|
||||
meta:resourcekey="cmdLogOff" OnClientClick="return confirm('Are you sure you want to log off selected user?')"></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
</Columns>
|
||||
</asp:GridView>
|
||||
</div>
|
||||
</asp:Panel>
|
||||
<div class="FormFooterClean">
|
||||
<wsp:ItemButtonPanel id="buttonPanel" runat="server" ValidationGroup="SaveRDSCollection"
|
||||
OnSaveClick="btnSave_Click" OnSaveExitClick="btnSaveExit_Click" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -0,0 +1,81 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using WebsitePanel.Providers.RemoteDesktopServices;
|
||||
|
||||
namespace WebsitePanel.Portal.RDS
|
||||
{
|
||||
public partial class RDSUserSessions : WebsitePanelModuleBase
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
buttonPanel.ButtonSaveVisible = false;
|
||||
|
||||
if (!IsPostBack)
|
||||
{
|
||||
var collection = ES.Services.RDS.GetRdsCollection(PanelRequest.CollectionID);
|
||||
litCollectionName.Text = collection.Name;
|
||||
BindGrid();
|
||||
}
|
||||
}
|
||||
|
||||
protected void gvRDSCollections_RowCommand(object sender, GridViewCommandEventArgs e)
|
||||
{
|
||||
if (e.CommandName == "LogOff")
|
||||
{
|
||||
var arguments = e.CommandArgument.ToString().Split(';');
|
||||
string unifiedSessionId = arguments[0];
|
||||
string hostServer = arguments[1];
|
||||
|
||||
try
|
||||
{
|
||||
ES.Services.RDS.LogOffRdsUser(PanelRequest.ItemID, unifiedSessionId, hostServer);
|
||||
BindGrid();
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ShowErrorMessage("REMOTE_DESKTOP_SERVICES_LOG_OFF_USER", ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!Page.IsValid)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
protected void btnSaveExit_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!Page.IsValid)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "rds_collections", "SpaceID=" + PanelSecurity.PackageId));
|
||||
}
|
||||
|
||||
private void BindGrid()
|
||||
{
|
||||
var userSessions = new List<RdsUserSession>();
|
||||
|
||||
try
|
||||
{
|
||||
userSessions = ES.Services.RDS.GetRdsUserSessions(PanelRequest.CollectionID).ToList();
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
ShowErrorMessage("REMOTE_DESKTOP_SERVICES_USER_SESSIONS", ex);
|
||||
}
|
||||
|
||||
gvRDSUserSessions.DataSource = userSessions;
|
||||
gvRDSUserSessions.DataBind();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,105 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace WebsitePanel.Portal.RDS {
|
||||
|
||||
|
||||
public partial class RDSUserSessions {
|
||||
|
||||
/// <summary>
|
||||
/// asyncTasks control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks;
|
||||
|
||||
/// <summary>
|
||||
/// imgEditRDSCollection 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.Image imgEditRDSCollection;
|
||||
|
||||
/// <summary>
|
||||
/// locTitle 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 locTitle;
|
||||
|
||||
/// <summary>
|
||||
/// litCollectionName 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 litCollectionName;
|
||||
|
||||
/// <summary>
|
||||
/// tabs control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::WebsitePanel.Portal.RDS.UserControls.RdsServerTabs tabs;
|
||||
|
||||
/// <summary>
|
||||
/// messageBox control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox;
|
||||
|
||||
/// <summary>
|
||||
/// secRdsUserSessions control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::WebsitePanel.Portal.CollapsiblePanel secRdsUserSessions;
|
||||
|
||||
/// <summary>
|
||||
/// panelRdsUserSessions 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 panelRdsUserSessions;
|
||||
|
||||
/// <summary>
|
||||
/// gvRDSUserSessions control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.GridView gvRDSUserSessions;
|
||||
|
||||
/// <summary>
|
||||
/// buttonPanel control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::WebsitePanel.Portal.ItemButtonPanel buttonPanel;
|
||||
}
|
||||
}
|
|
@ -129,4 +129,7 @@
|
|||
<data name="Tab.Settings" xml:space="preserve">
|
||||
<value>Settings</value>
|
||||
</data>
|
||||
<data name="Tab.UserSessions" xml:space="preserve">
|
||||
<value>User Sessions</value>
|
||||
</data>
|
||||
</root>
|
|
@ -5,13 +5,13 @@
|
|||
<asp:DataList ID="rdsTabs" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow" EnableViewState="false">
|
||||
<ItemStyle Wrap="False" />
|
||||
<ItemTemplate >
|
||||
<asp:HyperLink ID="lnkTab" runat="server" CssClass="Tab" NavigateUrl='<%# Eval("Url") %>' OnClientClick="ShowProgressDialog('Adding server...'); return false;">
|
||||
<asp:HyperLink ID="lnkTab" runat="server" CssClass="Tab" NavigateUrl='<%# Eval("Url") %>' OnClick="return tabClicked();">
|
||||
<%# Eval("Name") %>
|
||||
</asp:HyperLink>
|
||||
</ItemTemplate>
|
||||
<SelectedItemStyle Wrap="False" />
|
||||
<SelectedItemTemplate>
|
||||
<asp:HyperLink ID="lnkSelTab" runat="server" CssClass="ActiveTab" NavigateUrl='<%# Eval("Url") %>' OnClientClick="ShowProgressDialog('Adding server...'); return false;">
|
||||
<asp:HyperLink ID="lnkSelTab" runat="server" CssClass="ActiveTab" NavigateUrl='<%# Eval("Url") %>' OnClick="return tabClicked;">
|
||||
<%# Eval("Name") %>
|
||||
</asp:HyperLink>
|
||||
</SelectedItemTemplate>
|
||||
|
@ -20,3 +20,11 @@
|
|||
</tr>
|
||||
</table>
|
||||
<br />
|
||||
|
||||
<script type="text/javascript">
|
||||
function tabClicked() {
|
||||
ShowProgressDialog('Loading');
|
||||
ShowProgressDialogInternal();
|
||||
return true;
|
||||
}
|
||||
</script>
|
|
@ -24,6 +24,7 @@ namespace WebsitePanel.Portal.RDS.UserControls
|
|||
tabsList.Add(CreateTab("rds_edit_collection_settings", "Tab.Settings"));
|
||||
tabsList.Add(CreateTab("rds_collection_edit_apps", "Tab.RdsApplications"));
|
||||
tabsList.Add(CreateTab("rds_collection_edit_users", "Tab.RdsUsers"));
|
||||
tabsList.Add(CreateTab("rds_collection_user_sessions", "Tab.UserSessions"));
|
||||
|
||||
int idx = 0;
|
||||
|
||||
|
|
|
@ -330,6 +330,13 @@
|
|||
<Compile Include="RDS\RDSCollections.ascx.designer.cs">
|
||||
<DependentUpon>RDSCollections.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="RDS\RDSUserSessions.ascx.cs">
|
||||
<DependentUpon>RDSUserSessions.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="RDS\RDSUserSessions.ascx.designer.cs">
|
||||
<DependentUpon>RDSUserSessions.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="RDS\UserControls\RDSCollectionApps.ascx.cs">
|
||||
<DependentUpon>RDSCollectionApps.ascx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
|
@ -4365,6 +4372,7 @@
|
|||
<Content Include="RDS\RDSEditCollectionUsers.ascx" />
|
||||
<Content Include="RDS\RDSCreateCollection.ascx" />
|
||||
<Content Include="RDS\RDSCollections.ascx" />
|
||||
<Content Include="RDS\RDSUserSessions.ascx" />
|
||||
<Content Include="RDS\UserControls\RDSCollectionApps.ascx" />
|
||||
<Content Include="RDS\UserControls\RDSCollectionServers.ascx" />
|
||||
<Content Include="RDS\UserControls\RDSCollectionUsers.ascx" />
|
||||
|
@ -4386,6 +4394,7 @@
|
|||
<Content Include="RDS\UserControls\App_LocalResources\RDSCollectionTabs.ascx.resx">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
<Content Include="RDS\App_LocalResources\RDSUserSessions.ascx.resx" />
|
||||
<EmbeddedResource Include="ScheduleTaskControls\App_LocalResources\DomainLookupView.ascx.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>DomainLookupView.ascx.Designer.cs</LastGenOutput>
|
||||
|
@ -5702,7 +5711,9 @@
|
|||
<Content Include="RDS\App_LocalResources\RDSEditCollectionUsers.ascx.resx">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
<Content Include="RDS\App_LocalResources\RDSEditCollectionApps.ascx.resx" />
|
||||
<Content Include="RDS\App_LocalResources\RDSEditCollectionApps.ascx.resx">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
<Content Include="RDS\UserControls\App_LocalResources\RDSCollectionUsers.ascx.resx" />
|
||||
<Content Include="RDS\UserControls\App_LocalResources\RDSCollectionServers.ascx.resx" />
|
||||
<Content Include="RDS\UserControls\App_LocalResources\RDSCollectionApps.ascx.resx" />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue