diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index 8829cb8d..228701b7 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -9459,4 +9459,6 @@ BEGIN (SELECT TOP 1 @item_type_id, @group_id, 'SharePointSiteCollection', TypeName, 100, CalculateDiskSpace, CalculateBandwidth, Suspendable, Disposable, Searchable, Importable, Backupable FROM [dbo].[ServiceItemTypes] WHERE DisplayName = 'SharePointFoundationSiteCollection') END -GO \ No newline at end of file +GO + +UPDATE [dbo].[Quotas] SET GroupID = 45 WHERE QuotaName = 'EnterpriseStorage.DriveMaps' \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/RemoteDesktopServicesProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/RemoteDesktopServicesProxy.cs index d5b90304..f15a1b1c 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/RemoteDesktopServicesProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/RemoteDesktopServicesProxy.cs @@ -20,8 +20,8 @@ namespace WebsitePanel.EnterpriseServer { using System.Diagnostics; using WebsitePanel.Providers.RemoteDesktopServices; using WebsitePanel.Providers.Common; - using WebsitePanel.Providers.HostedSolution; using WebsitePanel.EnterpriseServer.Base.RDS; + using WebsitePanel.Providers.HostedSolution; /// @@ -137,6 +137,8 @@ namespace WebsitePanel.EnterpriseServer { private System.Threading.SendOrPostCallback UpdateRdsServerSettingsOperationCompleted; + private System.Threading.SendOrPostCallback ShadowSessionOperationCompleted; + /// public esRemoteDesktopServices() { this.Url = "http://localhost:9002/esRemoteDesktopServices.asmx"; @@ -301,6 +303,9 @@ namespace WebsitePanel.EnterpriseServer { /// public event UpdateRdsServerSettingsCompletedEventHandler UpdateRdsServerSettingsCompleted; + /// + public event ShadowSessionCompletedEventHandler ShadowSessionCompleted; + /// [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) { @@ -2671,6 +2676,53 @@ namespace WebsitePanel.EnterpriseServer { } } + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/ShadowSession", 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 ShadowSession(int itemId, string sessionId, bool control) { + object[] results = this.Invoke("ShadowSession", new object[] { + itemId, + sessionId, + control}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginShadowSession(int itemId, string sessionId, bool control, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("ShadowSession", new object[] { + itemId, + sessionId, + control}, callback, asyncState); + } + + /// + public ResultObject EndShadowSession(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void ShadowSessionAsync(int itemId, string sessionId, bool control) { + this.ShadowSessionAsync(itemId, sessionId, control, null); + } + + /// + public void ShadowSessionAsync(int itemId, string sessionId, bool control, object userState) { + if ((this.ShadowSessionOperationCompleted == null)) { + this.ShadowSessionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnShadowSessionOperationCompleted); + } + this.InvokeAsync("ShadowSession", new object[] { + itemId, + sessionId, + control}, this.ShadowSessionOperationCompleted, userState); + } + + private void OnShadowSessionOperationCompleted(object arg) { + if ((this.ShadowSessionCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ShadowSessionCompleted(this, new ShadowSessionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + /// public new void CancelAsync(object userState) { base.CancelAsync(userState); @@ -4054,4 +4106,30 @@ namespace WebsitePanel.EnterpriseServer { } } } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void ShadowSessionCompletedEventHandler(object sender, ShadowSessionCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class ShadowSessionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal ShadowSessionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ResultObject Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(this.results[0])); + } + } + } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/EnterpriseStorage/EnterpriseStorageController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/EnterpriseStorage/EnterpriseStorageController.cs index 7398203b..200a52fb 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/EnterpriseStorage/EnterpriseStorageController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/EnterpriseStorage/EnterpriseStorageController.cs @@ -586,7 +586,7 @@ namespace WebsitePanel.EnterpriseServer var userGroups = OrganizationController.GetSecurityGroupsByMember(itemId, accountId); - foreach (var folder in es.GetFolders(org.OrganizationId, webDavSettings)) + foreach (var folder in es.GetFoldersWithoutFrsm(org.OrganizationId, webDavSettings)) { var permissions = ConvertToESPermission(itemId,folder.Rules); diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs index 7d585e28..9595fbab 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs @@ -331,6 +331,49 @@ namespace WebsitePanel.EnterpriseServer return UpdateRdsServerSettingsInternal(serverId, settingsName, settings); } + public static ResultObject ShadowSession(int itemId, string sessionId, bool control) + { + return ShadowSessionInternal(itemId, sessionId, control); + } + + private static ResultObject ShadowSessionInternal(int itemId, string sessionId, bool control) + { + var result = TaskManager.StartResultTask("REMOTE_DESKTOP_SERVICES", "SHADOW_RDS_SESSION"); + + try + { + Organization org = OrganizationController.GetOrganization(itemId); + + if (org == null) + { + result.IsSuccess = false; + result.AddError("SHADOW_RDS_SESSION", new NullReferenceException("Organization not found")); + + return result; + } + + var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId)); + rds.ShadowSession(sessionId, control); + } + catch (Exception ex) + { + result.AddError("REMOTE_DESKTOP_SERVICES_SHADOW_RDS_SESSION", ex); + } + finally + { + if (!result.IsSuccess) + { + TaskManager.CompleteResultTask(result); + } + else + { + TaskManager.CompleteResultTask(); + } + } + + return result; + } + private static RdsServerSettings GetRdsServerSettingsInternal(int serverId, string settingsName) { IDataReader reader = DataProvider.GetRdsServerSettings(serverId, settingsName); @@ -363,7 +406,8 @@ namespace WebsitePanel.EnterpriseServer { var collection = ObjectUtils.FillObjectFromDataReader(DataProvider.GetRDSCollectionById(serverId)); var rds = GetRemoteDesktopServices(GetRdsServiceId(collection.ItemId)); - rds.ApplyGPO(collection.Name, settings); + Organization org = OrganizationController.GetOrganization(collection.ItemId); + rds.ApplyGPO(org.OrganizationId, collection.Name, settings); XmlDocument doc = new XmlDocument(); XmlElement nodeProps = doc.CreateElement("properties"); @@ -748,7 +792,7 @@ namespace WebsitePanel.EnterpriseServer }; rds.CreateCollection(org.OrganizationId, collection); - rds.ApplyGPO(collection.Name, GetDefaultGpoSettings()); + rds.ApplyGPO(org.OrganizationId, collection.Name, GetDefaultGpoSettings()); collection.Id = DataProvider.AddRDSCollection(itemId, collection.Name, collection.Description, collection.DisplayName); collection.Settings.RdsCollectionId = collection.Id; diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Virtualization/VirtualizationServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Virtualization/VirtualizationServerController.cs index 254ff3e9..4dfe23b5 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Virtualization/VirtualizationServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Virtualization/VirtualizationServerController.cs @@ -612,6 +612,7 @@ namespace WebsitePanel.EnterpriseServer #region Setup External network TaskManager.Write("VPS_CREATE_SETUP_EXTERNAL_NETWORK"); + TaskManager.IndicatorCurrent = -1; // Some providers (for example HyperV2012R2) could not provide progress try { @@ -644,6 +645,7 @@ namespace WebsitePanel.EnterpriseServer #region Setup Management network TaskManager.Write("VPS_CREATE_SETUP_MANAGEMENT_NETWORK"); + TaskManager.IndicatorCurrent = -1; // Some providers (for example HyperV2012R2) could not provide progress try { @@ -704,6 +706,7 @@ namespace WebsitePanel.EnterpriseServer #region Setup Private network TaskManager.Write("VPS_CREATE_SETUP_PRIVATE_NETWORK"); + TaskManager.IndicatorCurrent = -1; // Some providers (for example HyperV2012R2) could not provide progress try { @@ -759,6 +762,7 @@ namespace WebsitePanel.EnterpriseServer TaskManager.Write("VPS_CREATE_CONVERT_VHD"); TaskManager.Write("VPS_CREATE_CONVERT_SOURCE_VHD", vm.OperatingSystemTemplatePath); TaskManager.Write("VPS_CREATE_CONVERT_DEST_VHD", vm.VirtualHardDrivePath); + TaskManager.IndicatorCurrent = -1; // Some providers (for example HyperV2012R2) could not provide progress try { // convert VHD @@ -817,6 +821,7 @@ namespace WebsitePanel.EnterpriseServer if (vm.HddSize > hddSizeGB) { TaskManager.Write("VPS_CREATE_EXPAND_VHD"); + TaskManager.IndicatorCurrent = -1; // Some providers (for example HyperV2012R2) could not provide progress // expand VHD try @@ -958,6 +963,7 @@ namespace WebsitePanel.EnterpriseServer TaskManager.Write("VPS_CREATE_CPU_CORES", vm.CpuCores.ToString()); TaskManager.Write("VPS_CREATE_RAM_SIZE", vm.RamSize.ToString()); TaskManager.Write("VPS_CREATE_CREATE_VM"); + TaskManager.IndicatorCurrent = -1; // Some providers (for example HyperV2012R2) could not provide progress // create virtual machine try { @@ -1031,6 +1037,7 @@ namespace WebsitePanel.EnterpriseServer #region Start VPS TaskManager.Write("VPS_CREATE_START_VPS"); + TaskManager.IndicatorCurrent = -1; // Some providers (for example HyperV2012R2) could not provide progress try { diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esRemoteDesktopServices.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esRemoteDesktopServices.asmx.cs index 7b977052..b99ea321 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esRemoteDesktopServices.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esRemoteDesktopServices.asmx.cs @@ -380,5 +380,11 @@ namespace WebsitePanel.EnterpriseServer { return RemoteDesktopServicesController.UpdateRdsServerSettings(serverId, settingsName, settings); } + + [WebMethod] + public ResultObject ShadowSession(int itemId, string sessionId, bool control) + { + return RemoteDesktopServicesController.ShadowSession(itemId, sessionId, control); + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/EnterpriseStorage/IEnterpriseStorage.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/EnterpriseStorage/IEnterpriseStorage.cs index 892864a9..ae907208 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/EnterpriseStorage/IEnterpriseStorage.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/EnterpriseStorage/IEnterpriseStorage.cs @@ -39,6 +39,7 @@ namespace WebsitePanel.Providers.EnterpriseStorage public interface IEnterpriseStorage { SystemFile[] GetFolders(string organizationId, WebDavSetting[] settings); + SystemFile[] GetFoldersWithoutFrsm(string organizationId, WebDavSetting[] settings); SystemFile GetFolder(string organizationId, string folderName, WebDavSetting setting); void CreateFolder(string organizationId, string folder, WebDavSetting setting); SystemFile RenameFolder(string organizationId, string originalFolder, string newFolder, WebDavSetting setting); diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/IRemoteDesktopServices.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/IRemoteDesktopServices.cs index 1d5b04b4..a2113c2e 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/IRemoteDesktopServices.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/IRemoteDesktopServices.cs @@ -81,6 +81,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices void RemoveRdsServerFromTenantOU(string hostName, string organizationId); void InstallCertificate(byte[] certificate, string password, List hostNames); void MoveSessionHostToRdsOU(string hostName); - void ApplyGPO(string collectionName, RdsServerSettings serverSettings); + void ApplyGPO(string organizationId, string collectionName, RdsServerSettings serverSettings); + void ShadowSession(string sessionId, bool control); } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsServerSettings.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsServerSettings.cs index 1c347305..beddb245 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsServerSettings.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsServerSettings.cs @@ -39,6 +39,12 @@ namespace WebsitePanel.EnterpriseServer.Base.RDS public const string SCREEN_SAVER_DISABLED_ADMINISTRATORS = "ScreenSaverDisabledAdministrators"; public const string SCREEN_SAVER_DISABLED_USERS = "ScreenSaverDisabledUsers"; public const string DRIVE_SPACE_THRESHOLD_VALUE = "DriveSpaceThresholdValue"; + public const string RDS_VIEW_WITHOUT_PERMISSION = "RDSViewWithoutPermission"; + public const string RDS_VIEW_WITHOUT_PERMISSION_ADMINISTRATORS = "RDSViewWithoutPermissionAdministrators"; + public const string RDS_VIEW_WITHOUT_PERMISSION_Users = "RDSViewWithoutPermissionUsers"; + public const string RDS_CONTROL_WITHOUT_PERMISSION = "RDSControlWithoutPermission"; + public const string RDS_CONTROL_WITHOUT_PERMISSION_ADMINISTRATORS = "RDSControlWithoutPermissionAdministrators"; + public const string RDS_CONTROL_WITHOUT_PERMISSION_Users = "RDSControlWithoutPermissionUsers"; public string SettingsName { get; set; } public int ServerId { get; set; } @@ -58,5 +64,21 @@ namespace WebsitePanel.EnterpriseServer.Base.RDS settings = value; } } + + public static List> ScreenSaverTimeOuts + { + get + { + return new List> { + new KeyValuePair("", "None"), + new KeyValuePair("10", "10"), + new KeyValuePair("20", "20"), + new KeyValuePair("30", "30"), + new KeyValuePair("40", "40"), + new KeyValuePair("50", "50"), + new KeyValuePair("60", "60") + }; + } + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.EnterpriseStorage.Windows2012/Windows2012.cs b/WebsitePanel/Sources/WebsitePanel.Providers.EnterpriseStorage.Windows2012/Windows2012.cs index f0a8caf3..67b2d1ff 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.EnterpriseStorage.Windows2012/Windows2012.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.EnterpriseStorage.Windows2012/Windows2012.cs @@ -122,6 +122,49 @@ namespace WebsitePanel.Providers.EnterpriseStorage return (SystemFile[]) items.ToArray(typeof (SystemFile)); } + public SystemFile[] GetFoldersWithoutFrsm(string organizationId, WebDavSetting[] settings) + { + ArrayList items = new ArrayList(); + + var webDavSettings = GetWebDavSettings(settings); + + foreach (var setting in webDavSettings) + { + string rootPath = string.Format("{0}:\\{1}\\{2}", setting.LocationDrive, setting.HomeFolder, + organizationId); + + if (Directory.Exists(rootPath)) + { + DirectoryInfo root = new DirectoryInfo(rootPath); + IWebDav webdav = new Web.WebDav(setting); + + // get directories + DirectoryInfo[] dirs = root.GetDirectories(); + + foreach (DirectoryInfo dir in dirs) + { + SystemFile folder = new SystemFile(); + + folder.Name = dir.Name; + folder.FullName = dir.FullName; + folder.IsDirectory = true; + + if (folder.Size == -1) + { + folder.Size = FileUtils.BytesToMb(FileUtils.CalculateFolderSize(dir.FullName)); + } + + folder.Url = string.Format("https://{0}/{1}/{2}", setting.Domain, organizationId, dir.Name); + folder.Rules = webdav.GetFolderWebDavRules(organizationId, dir.Name); + + items.Add(folder); + } + } + } + + return (SystemFile[])items.ToArray(typeof(SystemFile)); + } + public SystemFile GetFolder(string organizationId, string folderName, WebDavSetting setting) { var webDavSetting = GetWebDavSetting(setting); diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs index 44ee8db4..a39ff22d 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs @@ -1792,7 +1792,7 @@ namespace WebsitePanel.Providers.HostedSolution uidAttr.Value = Guid.NewGuid().ToString("B"); bypassErrorsAttr.Value = (1).ToString(); - actionPropAttr.Value = "R"; + actionPropAttr.Value = "C"; thisDrivePropAttr.Value = "NOCHANGE"; allDrivesPropAttr.Value = "NOCHANGE"; userNamePropAttr.Value = string.Empty; diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Mail.MailEnable/MailEnable.vb b/WebsitePanel/Sources/WebsitePanel.Providers.Mail.MailEnable/MailEnable.vb index 9439198a..c067d2d8 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Mail.MailEnable/MailEnable.vb +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Mail.MailEnable/MailEnable.vb @@ -2034,8 +2034,9 @@ Public Class MailEnable End If If [String].IsNullOrEmpty(version) = False Then - Dim split As String() = version.Split(New [Char]() {"."c}) - Return split(0).Equals("1") Or split(0).Equals("2") Or split(0).Equals("3") Or split(0).Equals("4") Or split(0).Equals("5") Or split(0).Equals("6") Or split(0).Equals("7") + 'all versions of MailEnable will be compatible with this, so we are just checking to see if there is a version number + 'future versions aim to retain compatibility + Return True Else Return False End If diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs index 58bc5ab0..1f3b46ce 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs @@ -93,6 +93,8 @@ namespace WebsitePanel.Providers.RemoteDesktopServices private const string DisableTaskManagerGpoValueName = "DisableTaskMgr"; private const string HideCDriveGpoKey = @"HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer"; private const string HideCDriveGpoValueName = "NoDrives"; + private const string RDSSessionGpoKey = @"HKCU\Software\Policies\Microsoft\Windows NT\Terminal Services"; + private const string RDSSessionGpoValueName = "Shadow"; #endregion @@ -371,6 +373,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices CreatePolicy(runSpace, organizationId, string.Format("{0}-administrators", collection.Name), new DirectoryEntry(GetGroupPath(organizationId, collection.Name, GetLocalAdminsGroupName(collection.Name))), collection.Name); CreatePolicy(runSpace, organizationId, string.Format("{0}-users", collection.Name), new DirectoryEntry(GetUsersGroupPath(organizationId, collection.Name)), collection.Name); + CreateHelpDeskPolicy(runSpace, new DirectoryEntry(GetHelpDeskGroupPath(RDSHelpDeskGroup)), organizationId, collection.Name); } finally { @@ -516,6 +519,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices DeleteGpo(runSpace, string.Format("{0}-administrators", collectionName)); DeleteGpo(runSpace, string.Format("{0}-users", collectionName)); + DeleteHelpDeskPolicy(runSpace, collectionName); var capPolicyName = GetPolicyName(organizationId, collectionName, RdsPolicyTypes.RdCap); var rapPolicyName = GetPolicyName(organizationId, collectionName, RdsPolicyTypes.RdRap); @@ -1116,7 +1120,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices #region GPO - public void ApplyGPO(string collectionName, RdsServerSettings serverSettings) + public void ApplyGPO(string organizationId, string collectionName, RdsServerSettings serverSettings) { string administratorsGpo = string.Format("{0}-administrators", collectionName); string usersGpo = string.Format("{0}-users", collectionName); @@ -1126,6 +1130,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices { runspace = OpenRunspace(); + CreateHelpDeskPolicy(runspace, new DirectoryEntry(GetHelpDeskGroupPath(RDSHelpDeskGroup)), organizationId, collectionName); RemoveRegistryValue(runspace, ScreenSaverGpoKey, administratorsGpo); RemoveRegistryValue(runspace, ScreenSaverGpoKey, usersGpo); RemoveRegistryValue(runspace, RemoveRestartGpoKey, administratorsGpo); @@ -1133,34 +1138,73 @@ namespace WebsitePanel.Providers.RemoteDesktopServices RemoveRegistryValue(runspace, DisableTaskManagerGpoKey, administratorsGpo); RemoveRegistryValue(runspace, DisableTaskManagerGpoKey, usersGpo); - var setting = serverSettings.Settings.First(s => s.PropertyName.Equals(RdsServerSettings.SCREEN_SAVER_DISABLED)); - SetRegistryValue(setting, runspace, ScreenSaverGpoKey, administratorsGpo, usersGpo, ScreenSaverValueName, "0", "string"); + var setting = serverSettings.Settings.FirstOrDefault(s => s.PropertyName.Equals(RdsServerSettings.SCREEN_SAVER_DISABLED)); + SetRegistryValue(setting, runspace, ScreenSaverGpoKey, administratorsGpo, usersGpo, ScreenSaverValueName, "0", "string"); - setting = serverSettings.Settings.First(s => s.PropertyName.Equals(RdsServerSettings.REMOVE_SHUTDOWN_RESTART)); - SetRegistryValue(setting, runspace, RemoveRestartGpoKey, administratorsGpo, usersGpo, RemoveRestartGpoValueName, "1", "DWord"); + setting = serverSettings.Settings.FirstOrDefault(s => s.PropertyName.Equals(RdsServerSettings.REMOVE_SHUTDOWN_RESTART)); + SetRegistryValue(setting, runspace, RemoveRestartGpoKey, administratorsGpo, usersGpo, RemoveRestartGpoValueName, "1", "DWord"); - setting = serverSettings.Settings.First(s => s.PropertyName.Equals(RdsServerSettings.REMOVE_RUN_COMMAND)); + setting = serverSettings.Settings.FirstOrDefault(s => s.PropertyName.Equals(RdsServerSettings.REMOVE_RUN_COMMAND)); SetRegistryValue(setting, runspace, RemoveRunGpoKey, administratorsGpo, usersGpo, RemoveRunGpoValueName, "1", "DWord"); - setting = serverSettings.Settings.First(s => s.PropertyName.Equals(RdsServerSettings.DISABLE_TASK_MANAGER)); + setting = serverSettings.Settings.FirstOrDefault(s => s.PropertyName.Equals(RdsServerSettings.DISABLE_TASK_MANAGER)); SetRegistryValue(setting, runspace, DisableTaskManagerGpoKey, administratorsGpo, usersGpo, DisableTaskManagerGpoValueName, "1", "DWord"); - setting = serverSettings.Settings.First(s => s.PropertyName.Equals(RdsServerSettings.HIDE_C_DRIVE)); - SetRegistryValue(setting, runspace, HideCDriveGpoKey, administratorsGpo, usersGpo, HideCDriveGpoValueName, "4", "DWord"); - - setting = serverSettings.Settings.First(s => s.PropertyName.Equals(RdsServerSettings.LOCK_SCREEN_TIMEOUT)); + setting = serverSettings.Settings.FirstOrDefault(s => s.PropertyName.Equals(RdsServerSettings.HIDE_C_DRIVE)); + SetRegistryValue(setting, runspace, HideCDriveGpoKey, administratorsGpo, usersGpo, HideCDriveGpoValueName, "4", "DWord"); + + setting = serverSettings.Settings.FirstOrDefault(s => s.PropertyName.Equals(RdsServerSettings.LOCK_SCREEN_TIMEOUT)); double result; - if (!string.IsNullOrEmpty(setting.PropertyValue) && double.TryParse(setting.PropertyValue, out result)) + if (setting != null && !string.IsNullOrEmpty(setting.PropertyValue) && double.TryParse(setting.PropertyValue, out result)) { SetRegistryValue(setting, runspace, ScreenSaverTimeoutGpoKey, administratorsGpo, usersGpo, ScreenSaverTimeoutValueName, setting.PropertyValue, "string"); } + + SetRdsSessionHostPermissions(runspace, serverSettings, usersGpo, administratorsGpo); } finally { CloseRunspace(runspace); } - } + } + + private void SetRdsSessionHostPermissions(Runspace runspace, RdsServerSettings settings, string usersGpo, string administratorsGpo) + { + var viewSetting = settings.Settings.FirstOrDefault(s => s.PropertyName.Equals(RdsServerSettings.RDS_VIEW_WITHOUT_PERMISSION)); + var controlSetting = settings.Settings.FirstOrDefault(s => s.PropertyName.Equals(RdsServerSettings.RDS_CONTROL_WITHOUT_PERMISSION)); + + if (viewSetting == null || controlSetting == null) + { + return; + } + + if (controlSetting.ApplyUsers) + { + SetRegistryValue(runspace, RDSSessionGpoKey, usersGpo, "2", RDSSessionGpoValueName, "DWord"); + } + else if (viewSetting.ApplyUsers) + { + SetRegistryValue(runspace, RDSSessionGpoKey, usersGpo, "4", RDSSessionGpoValueName, "DWord"); + } + else + { + SetRegistryValue(runspace, RDSSessionGpoKey, usersGpo, "3", RDSSessionGpoValueName, "DWord"); + } + + if (controlSetting.ApplyAdministrators) + { + SetRegistryValue(runspace, RDSSessionGpoKey, administratorsGpo, "2", RDSSessionGpoValueName, "DWord"); + } + else if (viewSetting.ApplyAdministrators) + { + SetRegistryValue(runspace, RDSSessionGpoKey, administratorsGpo, "4", RDSSessionGpoValueName, "DWord"); + } + else + { + SetRegistryValue(runspace, RDSSessionGpoKey, administratorsGpo, "3", RDSSessionGpoValueName, "DWord"); + } + } private void RemoveRegistryValue(Runspace runspace, string key, string gpoName) { @@ -1173,6 +1217,11 @@ namespace WebsitePanel.Providers.RemoteDesktopServices private void SetRegistryValue(RdsServerSetting setting, Runspace runspace, string key, string administratorsGpo, string usersGpo, string valueName, string value, string type) { + if (setting == null) + { + return; + } + if (setting.ApplyAdministrators) { SetRegistryValue(runspace, key, administratorsGpo, value, valueName, type); @@ -1196,6 +1245,19 @@ namespace WebsitePanel.Providers.RemoteDesktopServices Collection result = ExecuteRemoteShellCommand(runspace, PrimaryDomainController, cmd); } + private void CreateHelpDeskPolicy(Runspace runspace, DirectoryEntry entry, string organizationId, string collectionName) + { + string gpoName = string.Format("{0}-HelpDesk", collectionName); + string gpoId = GetPolicyId(runspace, gpoName); + + if (string.IsNullOrEmpty(gpoId)) + { + gpoId = CreateAndLinkPolicy(runspace, gpoName, organizationId, collectionName); + SetPolicyPermissions(runspace, gpoName, entry); + SetRegistryValue(runspace, RDSSessionGpoKey, gpoName, "2", RDSSessionGpoValueName, "DWord"); + } + } + private string CreatePolicy(Runspace runspace, string organizationId, string gpoName, DirectoryEntry entry, string collectionName) { string gpoId = GetPolicyId(runspace, gpoName); @@ -1209,6 +1271,12 @@ namespace WebsitePanel.Providers.RemoteDesktopServices return gpoId; } + private void DeleteHelpDeskPolicy(Runspace runspace, string collectionName) + { + string gpoName = string.Format("{0}-HelpDesk", collectionName); + DeleteGpo(runspace, gpoName); + } + private void DeleteGpo(Runspace runspace, string gpoName) { Command cmd = new Command("Remove-GPO"); @@ -1235,7 +1303,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices try { - var entry = new DirectoryEntry(GetCollectionOUPath(organizationId, string.Format("{0}-OU", collectionName))); + var entry = new DirectoryEntry(GetOrganizationPath(organizationId)); var distinguishedName = string.Format("\"{0}\"", ActiveDirectoryUtils.GetADObjectProperty(entry, "DistinguishedName")); Command cmd = new Command("New-GPO"); @@ -1294,6 +1362,32 @@ namespace WebsitePanel.Providers.RemoteDesktopServices #endregion + #region Shadow Session + + public void ShadowSession(string sessionId, bool control) + { + Runspace runspace = null; + + try + { + runspace = OpenRunspace(); + + var scripts = new List + { + string.Format("mstsc /Shadow:{0}{1}", sessionId, control ? " /Control" : "") + }; + + object[] errors = null; + ExecuteShellCommand(runspace, scripts, out errors); + } + finally + { + CloseRunspace(runspace); + } + } + + #endregion + #region RDS Help Desk private string GetHelpDeskGroupPath(string groupName) diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/EnterpriseStorageProxy.cs b/WebsitePanel/Sources/WebsitePanel.Server.Client/EnterpriseStorageProxy.cs index f43357e6..2fd82337 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.Client/EnterpriseStorageProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/EnterpriseStorageProxy.cs @@ -11,10 +11,6 @@ // // This source code was auto-generated by wsdl, Version=2.0.50727.3038. // - -using WebsitePanel.Providers.OS; -using WebsitePanel.Providers.Web; - namespace WebsitePanel.Providers.EnterpriseStorage { using System.Xml.Serialization; using System.Web.Services; @@ -22,6 +18,8 @@ namespace WebsitePanel.Providers.EnterpriseStorage { using System.Web.Services.Protocols; using System; using System.Diagnostics; + using WebsitePanel.Providers.OS; + using WebsitePanel.Providers.Web; /// @@ -36,6 +34,8 @@ namespace WebsitePanel.Providers.EnterpriseStorage { private System.Threading.SendOrPostCallback GetFoldersOperationCompleted; + private System.Threading.SendOrPostCallback GetFoldersWithoutFrsmOperationCompleted; + private System.Threading.SendOrPostCallback GetFolderOperationCompleted; private System.Threading.SendOrPostCallback CreateFolderOperationCompleted; @@ -60,6 +60,9 @@ namespace WebsitePanel.Providers.EnterpriseStorage { /// public event GetFoldersCompletedEventHandler GetFoldersCompleted; + /// + public event GetFoldersWithoutFrsmCompletedEventHandler GetFoldersWithoutFrsmCompleted; + /// public event GetFolderCompletedEventHandler GetFolderCompleted; @@ -129,6 +132,51 @@ namespace WebsitePanel.Providers.EnterpriseStorage { } } + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetFoldersWithoutFrsm", 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 SystemFile[] GetFoldersWithoutFrsm(string organizationId, WebDavSetting[] settings) { + object[] results = this.Invoke("GetFoldersWithoutFrsm", new object[] { + organizationId, + settings}); + return ((SystemFile[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetFoldersWithoutFrsm(string organizationId, WebDavSetting[] settings, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetFoldersWithoutFrsm", new object[] { + organizationId, + settings}, callback, asyncState); + } + + /// + public SystemFile[] EndGetFoldersWithoutFrsm(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((SystemFile[])(results[0])); + } + + /// + public void GetFoldersWithoutFrsmAsync(string organizationId, WebDavSetting[] settings) { + this.GetFoldersWithoutFrsmAsync(organizationId, settings, null); + } + + /// + public void GetFoldersWithoutFrsmAsync(string organizationId, WebDavSetting[] settings, object userState) { + if ((this.GetFoldersWithoutFrsmOperationCompleted == null)) { + this.GetFoldersWithoutFrsmOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetFoldersWithoutFrsmOperationCompleted); + } + this.InvokeAsync("GetFoldersWithoutFrsm", new object[] { + organizationId, + settings}, this.GetFoldersWithoutFrsmOperationCompleted, userState); + } + + private void OnGetFoldersWithoutFrsmOperationCompleted(object arg) { + if ((this.GetFoldersWithoutFrsmCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetFoldersWithoutFrsmCompleted(this, new GetFoldersWithoutFrsmCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetFolder", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] @@ -544,6 +592,32 @@ namespace WebsitePanel.Providers.EnterpriseStorage { } } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void GetFoldersWithoutFrsmCompletedEventHandler(object sender, GetFoldersWithoutFrsmCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetFoldersWithoutFrsmCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetFoldersWithoutFrsmCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public SystemFile[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((SystemFile[])(this.results[0])); + } + } + } + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetFolderCompletedEventHandler(object sender, GetFolderCompletedEventArgs e); diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/RemoteDesktopServicesProxy.cs b/WebsitePanel/Sources/WebsitePanel.Server.Client/RemoteDesktopServicesProxy.cs index fbb586a2..924cfa7d 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.Client/RemoteDesktopServicesProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/RemoteDesktopServicesProxy.cs @@ -104,6 +104,8 @@ namespace WebsitePanel.Providers.RemoteDesktopServices { private System.Threading.SendOrPostCallback ApplyGPOOperationCompleted; + private System.Threading.SendOrPostCallback ShadowSessionOperationCompleted; + /// public RemoteDesktopServices() { this.Url = "http://localhost:9003/RemoteDesktopServices.asmx"; @@ -220,6 +222,9 @@ namespace WebsitePanel.Providers.RemoteDesktopServices { /// public event ApplyGPOCompletedEventHandler ApplyGPOCompleted; + /// + public event ShadowSessionCompletedEventHandler ShadowSessionCompleted; + /// [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)] @@ -1791,15 +1796,17 @@ namespace WebsitePanel.Providers.RemoteDesktopServices { /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/ApplyGPO", 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 ApplyGPO(string collectionName, RdsServerSettings serverSettings) { + public void ApplyGPO(string organizationId, string collectionName, RdsServerSettings serverSettings) { this.Invoke("ApplyGPO", new object[] { + organizationId, collectionName, serverSettings}); } /// - public System.IAsyncResult BeginApplyGPO(string collectionName, RdsServerSettings serverSettings, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginApplyGPO(string organizationId, string collectionName, RdsServerSettings serverSettings, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("ApplyGPO", new object[] { + organizationId, collectionName, serverSettings}, callback, asyncState); } @@ -1810,16 +1817,17 @@ namespace WebsitePanel.Providers.RemoteDesktopServices { } /// - public void ApplyGPOAsync(string collectionName, RdsServerSettings serverSettings) { - this.ApplyGPOAsync(collectionName, serverSettings, null); + public void ApplyGPOAsync(string organizationId, string collectionName, RdsServerSettings serverSettings) { + this.ApplyGPOAsync(organizationId, collectionName, serverSettings, null); } /// - public void ApplyGPOAsync(string collectionName, RdsServerSettings serverSettings, object userState) { + public void ApplyGPOAsync(string organizationId, string collectionName, RdsServerSettings serverSettings, object userState) { if ((this.ApplyGPOOperationCompleted == null)) { this.ApplyGPOOperationCompleted = new System.Threading.SendOrPostCallback(this.OnApplyGPOOperationCompleted); } this.InvokeAsync("ApplyGPO", new object[] { + organizationId, collectionName, serverSettings}, this.ApplyGPOOperationCompleted, userState); } @@ -1831,6 +1839,49 @@ namespace WebsitePanel.Providers.RemoteDesktopServices { } } + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/ShadowSession", 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 ShadowSession(string sessionId, bool control) { + this.Invoke("ShadowSession", new object[] { + sessionId, + control}); + } + + /// + public System.IAsyncResult BeginShadowSession(string sessionId, bool control, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("ShadowSession", new object[] { + sessionId, + control}, callback, asyncState); + } + + /// + public void EndShadowSession(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void ShadowSessionAsync(string sessionId, bool control) { + this.ShadowSessionAsync(sessionId, control, null); + } + + /// + public void ShadowSessionAsync(string sessionId, bool control, object userState) { + if ((this.ShadowSessionOperationCompleted == null)) { + this.ShadowSessionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnShadowSessionOperationCompleted); + } + this.InvokeAsync("ShadowSession", new object[] { + sessionId, + control}, this.ShadowSessionOperationCompleted, userState); + } + + private void OnShadowSessionOperationCompleted(object arg) { + if ((this.ShadowSessionCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ShadowSessionCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + /// public new void CancelAsync(object userState) { base.CancelAsync(userState); @@ -2468,4 +2519,8 @@ namespace WebsitePanel.Providers.RemoteDesktopServices { /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void ApplyGPOCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void ShadowSessionCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); } diff --git a/WebsitePanel/Sources/WebsitePanel.Server/EnterpriseStorage.asmx.cs b/WebsitePanel/Sources/WebsitePanel.Server/EnterpriseStorage.asmx.cs index ecd4878c..6a27c78a 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/EnterpriseStorage.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server/EnterpriseStorage.asmx.cs @@ -75,6 +75,23 @@ namespace WebsitePanel.Server } } + [WebMethod, SoapHeader("settings")] + public SystemFile[] GetFoldersWithoutFrsm(string organizationId, WebDavSetting[] settings) + { + try + { + Log.WriteStart("'{0}' GetFolders", ProviderSettings.ProviderName); + SystemFile[] result = EnterpriseStorageProvider.GetFoldersWithoutFrsm(organizationId, settings); + Log.WriteEnd("'{0}' GetFolders", ProviderSettings.ProviderName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' GetFolders", ProviderSettings.ProviderName), ex); + throw; + } + } + [WebMethod, SoapHeader("settings")] public SystemFile GetFolder(string organizationId, string folder, WebDavSetting setting) { diff --git a/WebsitePanel/Sources/WebsitePanel.Server/RemoteDesktopServices.asmx.cs b/WebsitePanel/Sources/WebsitePanel.Server/RemoteDesktopServices.asmx.cs index ff949699..c246e544 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/RemoteDesktopServices.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server/RemoteDesktopServices.asmx.cs @@ -665,12 +665,12 @@ namespace WebsitePanel.Server } [WebMethod, SoapHeader("settings")] - public void ApplyGPO(string collectionName, RdsServerSettings serverSettings) + public void ApplyGPO(string organizationId, string collectionName, RdsServerSettings serverSettings) { try { Log.WriteStart("'{0}' ApplyGPO", ProviderSettings.ProviderName); - RDSProvider.ApplyGPO(collectionName, serverSettings); + RDSProvider.ApplyGPO(organizationId, collectionName, serverSettings); Log.WriteEnd("'{0}' ApplyGPO", ProviderSettings.ProviderName); } catch (Exception ex) @@ -679,5 +679,21 @@ namespace WebsitePanel.Server throw; } } + + [WebMethod, SoapHeader("settings")] + public void ShadowSession(string sessionId, bool control) + { + try + { + Log.WriteStart("'{0}' ShadowSession", ProviderSettings.ProviderName); + RDSProvider.ShadowSession(sessionId, control); + Log.WriteEnd("'{0}' ShadowSession", ProviderSettings.ProviderName); + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' ShadowSession", ProviderSettings.ProviderName), ex); + throw; + } + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx index cbff0b24..937e6e43 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx @@ -5702,6 +5702,12 @@ RDS User logging off error + + View session error + + + Control session error + Getting RDS User sessions error diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SettingsRdsPolicy.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SettingsRdsPolicy.ascx.resx index 91b50033..837eae3e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SettingsRdsPolicy.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SettingsRdsPolicy.ascx.resx @@ -123,6 +123,12 @@ Users + + Changing Desktop Disabled + + + Control RDS Session without Users's Permission + Drive Space Threshold @@ -145,9 +151,9 @@ Disable Task Manager - Lock Screen Timeout + Lock Screen Timeout (sec.) - - Changing Desktop Disabled + + View RDS Session without Users's Permission \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Framework/Utils.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Framework/Utils.cs index fccbcbb2..8e745c8f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Framework/Utils.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Framework/Utils.cs @@ -337,7 +337,7 @@ namespace WebsitePanel.Portal { if (((CheckBox)gvr.FindControl(checkboxName)).Checked) { - string userId = gridView.DataKeys[gvr.DataItemIndex].Value.ToString(); + string userId = gridView.DataKeys[gvr.DataItemIndex % gridView.PageSize].Value.ToString(); userIds.Add((T)Convert.ChangeType(userId, typeof(T))); } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSEditUserExperience.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSEditUserExperience.ascx.resx index 91b50033..a6355f92 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSEditUserExperience.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSEditUserExperience.ascx.resx @@ -123,6 +123,12 @@ Users + + Changing Desktop Disabled + + + Control RDS Session without Users's Permission + Drive Space Threshold @@ -147,7 +153,7 @@ Lock Screen Timeout - - Changing Desktop Disabled + + View RDS Session without Users's Permission \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSUserSessions.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSUserSessions.ascx.resx index e8f7f85d..54e311d7 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSUserSessions.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSUserSessions.ascx.resx @@ -150,4 +150,16 @@ Refresh + + Control + + + Control Session + + + View + + + View Session + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditUserExperience.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditUserExperience.ascx index cb177a39..44b5384b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditUserExperience.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditUserExperience.ascx @@ -29,7 +29,7 @@ @@ -145,13 +145,51 @@
- +
-
- + + + + + + + + + + + +

+ + + + + + + +
+ + + +
+
+
+ + + + + + + +
+ + + +
+
+
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditUserExperience.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditUserExperience.ascx.cs index 4d5ee15a..6fc1f396 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditUserExperience.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditUserExperience.ascx.cs @@ -15,6 +15,12 @@ namespace WebsitePanel.Portal.RDS { if (!IsPostBack) { + var timeouts = RdsServerSettings.ScreenSaverTimeOuts; + ddTimeout.DataSource = timeouts; + ddTimeout.DataTextField = "Value"; + ddTimeout.DataValueField = "Key"; + ddTimeout.DataBind(); + var collection = ES.Services.RDS.GetRdsCollection(PanelRequest.CollectionID); litCollectionName.Text = collection.DisplayName; BindSettings(); @@ -39,45 +45,97 @@ namespace WebsitePanel.Portal.RDS private void BindSettings(RdsServerSettings settings) { var setting = GetServerSetting(settings, RdsServerSettings.LOCK_SCREEN_TIMEOUT); - txtTimeout.Text = setting.PropertyValue; - cbTimeoutAdministrators.Checked = setting.ApplyAdministrators; - cbTimeoutUsers.Checked = setting.ApplyUsers; + + if (setting != null) + { + ddTimeout.SelectedValue = setting.PropertyValue; + cbTimeoutAdministrators.Checked = setting.ApplyAdministrators; + cbTimeoutUsers.Checked = setting.ApplyUsers; + } setting = GetServerSetting(settings, RdsServerSettings.REMOVE_RUN_COMMAND); - cbRunCommandAdministrators.Checked = setting.ApplyAdministrators; - cbRunCommandUsers.Checked = setting.ApplyUsers; + + if (setting != null) + { + cbRunCommandAdministrators.Checked = setting.ApplyAdministrators; + cbRunCommandUsers.Checked = setting.ApplyUsers; + } setting = GetServerSetting(settings, RdsServerSettings.REMOVE_POWERSHELL_COMMAND); - cbPowershellAdministrators.Checked = setting.ApplyAdministrators; - cbPowershellUsers.Checked = setting.ApplyUsers; + + if (setting != null) + { + cbPowershellAdministrators.Checked = setting.ApplyAdministrators; + cbPowershellUsers.Checked = setting.ApplyUsers; + } setting = GetServerSetting(settings, RdsServerSettings.HIDE_C_DRIVE); - cbHideCDriveAdministrators.Checked = setting.ApplyAdministrators; - cbHideCDriveUsers.Checked = setting.ApplyUsers; + if (setting != null) + { + cbHideCDriveAdministrators.Checked = setting.ApplyAdministrators; + cbHideCDriveUsers.Checked = setting.ApplyUsers; + } + setting = GetServerSetting(settings, RdsServerSettings.REMOVE_SHUTDOWN_RESTART); - cbShutdownAdministrators.Checked = setting.ApplyAdministrators; - cbShutdownUsers.Checked = setting.ApplyUsers; + + if (setting != null) + { + cbShutdownAdministrators.Checked = setting.ApplyAdministrators; + cbShutdownUsers.Checked = setting.ApplyUsers; + } setting = GetServerSetting(settings, RdsServerSettings.DISABLE_TASK_MANAGER); - cbTaskManagerAdministrators.Checked = setting.ApplyAdministrators; - cbTaskManagerUsers.Checked = setting.ApplyUsers; + + if (setting != null) + { + cbTaskManagerAdministrators.Checked = setting.ApplyAdministrators; + cbTaskManagerUsers.Checked = setting.ApplyUsers; + } setting = GetServerSetting(settings, RdsServerSettings.CHANGE_DESKTOP_DISABLED); - cbDesktopAdministrators.Checked = setting.ApplyAdministrators; - cbDesktopUsers.Checked = setting.ApplyUsers; + + if (setting != null) + { + cbDesktopAdministrators.Checked = setting.ApplyAdministrators; + cbDesktopUsers.Checked = setting.ApplyUsers; + } setting = GetServerSetting(settings, RdsServerSettings.SCREEN_SAVER_DISABLED); - cbScreenSaverAdministrators.Checked = setting.ApplyAdministrators; - cbScreenSaverUsers.Checked = setting.ApplyUsers; + + if (setting != null) + { + cbScreenSaverAdministrators.Checked = setting.ApplyAdministrators; + cbViewSessionUsers.Checked = setting.ApplyUsers; + } + + setting = GetServerSetting(settings, RdsServerSettings.RDS_VIEW_WITHOUT_PERMISSION); + + if (setting != null) + { + cbViewSessionAdministrators.Checked = setting.ApplyAdministrators; + cbScreenSaverUsers.Checked = setting.ApplyUsers; + } + + setting = GetServerSetting(settings, RdsServerSettings.RDS_CONTROL_WITHOUT_PERMISSION); + + if (setting != null) + { + cbControlSessionAdministrators.Checked = setting.ApplyAdministrators; + cbControlSessionUsers.Checked = setting.ApplyUsers; + } setting = GetServerSetting(settings, RdsServerSettings.DRIVE_SPACE_THRESHOLD); - txtThreshold.Text = setting.PropertyValue; + + if (setting != null) + { + ddTreshold.SelectedValue = setting.PropertyValue; + } } private RdsServerSetting GetServerSetting(RdsServerSettings settings, string propertyName) { - return settings.Settings.First(s => s.PropertyName.Equals(propertyName)); + return settings.Settings.FirstOrDefault(s => s.PropertyName.Equals(propertyName)); } private RdsServerSettings GetSettings() @@ -87,7 +145,7 @@ namespace WebsitePanel.Portal.RDS settings.Settings.Add(new RdsServerSetting { PropertyName = RdsServerSettings.LOCK_SCREEN_TIMEOUT, - PropertyValue = txtTimeout.Text, + PropertyValue = ddTimeout.SelectedValue, ApplyAdministrators = cbTimeoutAdministrators.Checked, ApplyUsers = cbTimeoutUsers.Checked }); @@ -151,17 +209,33 @@ namespace WebsitePanel.Portal.RDS settings.Settings.Add(new RdsServerSetting { PropertyName = RdsServerSettings.DRIVE_SPACE_THRESHOLD, - PropertyValue = txtThreshold.Text, + PropertyValue = ddTreshold.SelectedValue, ApplyAdministrators = true, ApplyUsers = true }); + settings.Settings.Add(new RdsServerSetting + { + PropertyName = RdsServerSettings.RDS_VIEW_WITHOUT_PERMISSION, + PropertyValue = "", + ApplyAdministrators = cbViewSessionAdministrators.Checked, + ApplyUsers = cbViewSessionUsers.Checked + }); + + settings.Settings.Add(new RdsServerSetting + { + PropertyName = RdsServerSettings.RDS_CONTROL_WITHOUT_PERMISSION, + PropertyValue = "", + ApplyAdministrators = cbControlSessionAdministrators.Checked, + ApplyUsers = cbControlSessionUsers.Checked + }); + return settings; } private void BindDefaultSettings(UserSettings settings) { - txtTimeout.Text = settings[RdsServerSettings.LOCK_SCREEN_TIMEOUT_VALUE]; + ddTimeout.SelectedValue = settings[RdsServerSettings.LOCK_SCREEN_TIMEOUT_VALUE]; cbTimeoutAdministrators.Checked = Convert.ToBoolean(settings[RdsServerSettings.LOCK_SCREEN_TIMEOUT_ADMINISTRATORS]); cbTimeoutUsers.Checked = Convert.ToBoolean(settings[RdsServerSettings.LOCK_SCREEN_TIMEOUT_USERS]); @@ -186,7 +260,12 @@ namespace WebsitePanel.Portal.RDS cbScreenSaverAdministrators.Checked = Convert.ToBoolean(settings[RdsServerSettings.SCREEN_SAVER_DISABLED_ADMINISTRATORS]); cbScreenSaverUsers.Checked = Convert.ToBoolean(settings[RdsServerSettings.SCREEN_SAVER_DISABLED_USERS]); - txtThreshold.Text = settings[RdsServerSettings.DRIVE_SPACE_THRESHOLD_VALUE]; + cbViewSessionAdministrators.Checked = Convert.ToBoolean(settings[RdsServerSettings.RDS_VIEW_WITHOUT_PERMISSION_ADMINISTRATORS]); + cbViewSessionUsers.Checked = Convert.ToBoolean(settings[RdsServerSettings.RDS_VIEW_WITHOUT_PERMISSION_Users]); + cbControlSessionAdministrators.Checked = Convert.ToBoolean(settings[RdsServerSettings.RDS_CONTROL_WITHOUT_PERMISSION_ADMINISTRATORS]); + cbControlSessionUsers.Checked = Convert.ToBoolean(settings[RdsServerSettings.RDS_CONTROL_WITHOUT_PERMISSION_Users]); + + ddTreshold.SelectedValue = settings[RdsServerSettings.DRIVE_SPACE_THRESHOLD_VALUE]; } private bool SaveServerSettings() diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditUserExperience.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditUserExperience.ascx.designer.cs index a743b041..953e340e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditUserExperience.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditUserExperience.ascx.designer.cs @@ -85,13 +85,13 @@ namespace WebsitePanel.Portal.RDS { protected global::System.Web.UI.WebControls.Panel timeoutPanel; /// - /// txtTimeout control. + /// ddTimeout control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.TextBox txtTimeout; + protected global::System.Web.UI.WebControls.DropDownList ddTimeout; /// /// cbTimeoutUsers control. @@ -382,13 +382,85 @@ namespace WebsitePanel.Portal.RDS { protected global::System.Web.UI.WebControls.Panel driveSpacePanel; /// - /// txtThreshold control. + /// ddTreshold control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.TextBox txtThreshold; + protected global::System.Web.UI.WebControls.DropDownList ddTreshold; + + /// + /// secViewSession control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secViewSession; + + /// + /// viewSessionPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel viewSessionPanel; + + /// + /// cbViewSessionUsers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox cbViewSessionUsers; + + /// + /// cbViewSessionAdministrators control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox cbViewSessionAdministrators; + + /// + /// secControlSession control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secControlSession; + + /// + /// controlSessionPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel controlSessionPanel; + + /// + /// cbControlSessionUsers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox cbControlSessionUsers; + + /// + /// cbControlSessionAdministrators control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox cbControlSessionAdministrators; /// /// buttonPanel control. diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx index 9afc8a5b..15d0ef9e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx @@ -40,7 +40,7 @@ OnRowCommand="gvRDSCollections_RowCommand" AllowPaging="True" AllowSorting="True"> - + @@ -48,17 +48,29 @@ - + - + + + + + + + + + + + - + @@ -122,8 +122,46 @@ - + +
- + + + + + + + + + + + + +
+
+
+ + + + + + + +
+ + + +
+
+
+ + + + + +
+ + +
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsRdsPolicy.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsRdsPolicy.ascx.cs index c7cc46ff..ed9bab8c 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsRdsPolicy.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsRdsPolicy.ascx.cs @@ -13,7 +13,13 @@ namespace WebsitePanel.Portal { public void BindSettings(UserSettings settings) { - txtTimeout.Text = settings[RdsServerSettings.LOCK_SCREEN_TIMEOUT_VALUE]; + var timeouts = RdsServerSettings.ScreenSaverTimeOuts; + ddTimeout.DataSource = timeouts; + ddTimeout.DataTextField = "Value"; + ddTimeout.DataValueField = "Key"; + ddTimeout.DataBind(); + + ddTimeout.SelectedValue = settings[RdsServerSettings.LOCK_SCREEN_TIMEOUT_VALUE]; cbTimeoutAdministrators.Checked = Convert.ToBoolean(settings[RdsServerSettings.LOCK_SCREEN_TIMEOUT_ADMINISTRATORS]); cbTimeoutUsers.Checked = Convert.ToBoolean(settings[RdsServerSettings.LOCK_SCREEN_TIMEOUT_USERS]); @@ -38,12 +44,17 @@ namespace WebsitePanel.Portal cbScreenSaverAdministrators.Checked = Convert.ToBoolean(settings[RdsServerSettings.SCREEN_SAVER_DISABLED_ADMINISTRATORS]); cbScreenSaverUsers.Checked = Convert.ToBoolean(settings[RdsServerSettings.SCREEN_SAVER_DISABLED_USERS]); - txtThreshold.Text = settings[RdsServerSettings.DRIVE_SPACE_THRESHOLD_VALUE]; + cbViewSessionAdministrators.Checked = Convert.ToBoolean(settings[RdsServerSettings.RDS_VIEW_WITHOUT_PERMISSION_ADMINISTRATORS]); + cbViewSessionUsers.Checked = Convert.ToBoolean(settings[RdsServerSettings.RDS_VIEW_WITHOUT_PERMISSION_Users]); + cbControlSessionAdministrators.Checked = Convert.ToBoolean(settings[RdsServerSettings.RDS_CONTROL_WITHOUT_PERMISSION_ADMINISTRATORS]); + cbControlSessionUsers.Checked = Convert.ToBoolean(settings[RdsServerSettings.RDS_CONTROL_WITHOUT_PERMISSION_Users]); + + ddTreshold.SelectedValue = settings[RdsServerSettings.DRIVE_SPACE_THRESHOLD_VALUE]; } public void SaveSettings(UserSettings settings) { - settings[RdsServerSettings.LOCK_SCREEN_TIMEOUT_VALUE] = txtTimeout.Text; + settings[RdsServerSettings.LOCK_SCREEN_TIMEOUT_VALUE] = ddTimeout.SelectedValue; settings[RdsServerSettings.LOCK_SCREEN_TIMEOUT_ADMINISTRATORS] = cbTimeoutAdministrators.Checked.ToString(); settings[RdsServerSettings.LOCK_SCREEN_TIMEOUT_USERS] = cbTimeoutUsers.Checked.ToString(); settings[RdsServerSettings.REMOVE_RUN_COMMAND_ADMINISTRATORS] = cbRunCommandAdministrators.Checked.ToString(); @@ -60,7 +71,7 @@ namespace WebsitePanel.Portal settings[RdsServerSettings.CHANGE_DESKTOP_DISABLED_USERS] = cbDesktopUsers.Checked.ToString(); settings[RdsServerSettings.SCREEN_SAVER_DISABLED_ADMINISTRATORS] = cbScreenSaverAdministrators.Checked.ToString(); settings[RdsServerSettings.SCREEN_SAVER_DISABLED_USERS] = cbScreenSaverUsers.Checked.ToString(); - settings[RdsServerSettings.DRIVE_SPACE_THRESHOLD_VALUE] = txtThreshold.Text; + settings[RdsServerSettings.DRIVE_SPACE_THRESHOLD_VALUE] = ddTreshold.SelectedValue; } } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsRdsPolicy.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsRdsPolicy.ascx.designer.cs index ab5d3f15..2b120670 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsRdsPolicy.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsRdsPolicy.ascx.designer.cs @@ -31,13 +31,13 @@ namespace WebsitePanel.Portal { protected global::System.Web.UI.WebControls.Panel timeoutPanel; /// - /// txtTimeout control. + /// ddTimeout control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.TextBox txtTimeout; + protected global::System.Web.UI.WebControls.DropDownList ddTimeout; /// /// cbTimeoutUsers control. @@ -328,12 +328,84 @@ namespace WebsitePanel.Portal { protected global::System.Web.UI.WebControls.Panel driveSpacePanel; /// - /// txtThreshold control. + /// ddTreshold control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.TextBox txtThreshold; + protected global::System.Web.UI.WebControls.DropDownList ddTreshold; + + /// + /// secViewSession control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secViewSession; + + /// + /// viewSessionPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel viewSessionPanel; + + /// + /// cbViewSessionUsers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox cbViewSessionUsers; + + /// + /// cbViewSessionAdministrators control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox cbViewSessionAdministrators; + + /// + /// secControlSession control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secControlSession; + + /// + /// controlSessionPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel controlSessionPanel; + + /// + /// cbControlSessionUsers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox cbControlSessionUsers; + + /// + /// cbControlSessionAdministrators control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox cbControlSessionAdministrators; } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/UserControls/ServerTabs.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/UserControls/ServerTabs.ascx.cs index c1c05f80..bbcd3638 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/UserControls/ServerTabs.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS/UserControls/ServerTabs.ascx.cs @@ -215,9 +215,14 @@ namespace WebsitePanel.Portal.VPS.UserControls gauge.Visible = false; if (e.Item.ItemIndex == task.GetLogs().Count - 1) { - gauge.Visible = true; - gauge.Total = task.IndicatorMaximum; - gauge.Progress = task.IndicatorCurrent; + if (task.IndicatorCurrent == -1) + litRecord.Text += "..."; + else + { + gauge.Visible = true; + gauge.Total = task.IndicatorMaximum; + gauge.Progress = task.IndicatorCurrent; + } } } }