diff --git a/WebsitePanel.Installer/Sources/WebsitePanel.SchedulerServiceInstaller/CustomAction.cs b/WebsitePanel.Installer/Sources/WebsitePanel.SchedulerServiceInstaller/CustomAction.cs index 01549e05..99e36879 100644 --- a/WebsitePanel.Installer/Sources/WebsitePanel.SchedulerServiceInstaller/CustomAction.cs +++ b/WebsitePanel.Installer/Sources/WebsitePanel.SchedulerServiceInstaller/CustomAction.cs @@ -53,6 +53,8 @@ namespace WebsitePanel.SchedulerServiceInstaller { string testConnectionString = session["AUTHENTICATIONTYPE"].Equals("Windows Authentication") ? GetConnectionString(session["SERVERNAME"], "master") : GetConnectionString(session["SERVERNAME"], "master", session["LOGIN"], session["PASSWORD"]); + testConnectionString = testConnectionString.Replace(CustomDataDelimiter, ";"); + if (CheckConnection(testConnectionString)) { session["CORRECTCONNECTION"] = "1"; diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/RemoteDesktopServicesProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/RemoteDesktopServicesProxy.cs index 5b87a4eb..aa2f44e7 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/RemoteDesktopServicesProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/RemoteDesktopServicesProxy.cs @@ -100,6 +100,10 @@ namespace WebsitePanel.EnterpriseServer { private System.Threading.SendOrPostCallback SetApplicationUsersOperationCompleted; + private System.Threading.SendOrPostCallback GetRdsUserSessionsOperationCompleted; + + private System.Threading.SendOrPostCallback LogOffRdsUserOperationCompleted; + /// public esRemoteDesktopServices() { this.Url = "http://localhost:9002/esRemoteDesktopServices.asmx"; @@ -210,6 +214,12 @@ namespace WebsitePanel.EnterpriseServer { /// public event SetApplicationUsersCompletedEventHandler SetApplicationUsersCompleted; + /// + public event GetRdsUserSessionsCompletedEventHandler GetRdsUserSessionsCompleted; + + /// + public event LogOffRdsUserCompletedEventHandler LogOffRdsUserCompleted; + /// [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 { } } + /// + [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])); + } + + /// + public System.IAsyncResult BeginGetRdsUserSessions(int collectionId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetRdsUserSessions", new object[] { + collectionId}, callback, asyncState); + } + + /// + public RdsUserSession[] EndGetRdsUserSessions(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((RdsUserSession[])(results[0])); + } + + /// + public void GetRdsUserSessionsAsync(int collectionId) { + this.GetRdsUserSessionsAsync(collectionId, null); + } + + /// + 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)); + } + } + + /// + [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])); + } + + /// + 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); + } + + /// + public ResultObject EndLogOffRdsUser(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void LogOffRdsUserAsync(int itemId, string unifiedSessionId, string hostServer) { + this.LogOffRdsUserAsync(itemId, unifiedSessionId, hostServer, null); + } + + /// + 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)); + } + } + /// public new void CancelAsync(object userState) { base.CancelAsync(userState); @@ -2715,4 +2813,56 @@ namespace WebsitePanel.EnterpriseServer { } } } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void GetRdsUserSessionsCompletedEventHandler(object sender, GetRdsUserSessionsCompletedEventArgs e); + + /// + [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; + } + + /// + public RdsUserSession[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((RdsUserSession[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void LogOffRdsUserCompletedEventHandler(object sender, LogOffRdsUserCompletedEventArgs e); + + /// + [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; + } + + /// + public ResultObject Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(this.results[0])); + } + } + } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/DnsServers/DnsServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/DnsServers/DnsServerController.cs index 039c3473..d659f9aa 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/DnsServers/DnsServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/DnsServers/DnsServerController.cs @@ -272,6 +272,14 @@ namespace WebsitePanel.EnterpriseServer // delete service item PackageController.DeletePackageItem(zoneItemId); + + // Delete also all seconday service items + var zoneItems = PackageController.GetPackageItemsByType(zoneItem.PackageId, ResourceGroups.Dns, typeof (SecondaryDnsZone)); + + foreach (var item in zoneItems.Where(z => z.Name == zoneItem.Name)) + { + PackageController.DeletePackageItem(item.Id); + } } catch (Exception ex) { diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs index be688d18..f8698cf5 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs @@ -31,6 +31,7 @@ using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.Data; +using System.Linq; using System.Net.Mail; using System.Threading; using WebsitePanel.EnterpriseServer.Code.HostedSolution; @@ -2919,23 +2920,18 @@ namespace WebsitePanel.EnterpriseServer try { List mailboxPlans = new List(); + int? defaultPlanId = null; UserInfo user = ObjectUtils.FillObjectFromDataReader(DataProvider.GetUserByExchangeOrganizationIdInternally(itemId)); if (user.Role == UserRole.User) - ExchangeServerController.GetExchangeMailboxPlansByUser(itemId, user, ref mailboxPlans, archiving); + GetExchangeMailboxPlansByUser(itemId, user, ref mailboxPlans, ref defaultPlanId, archiving); else - ExchangeServerController.GetExchangeMailboxPlansByUser(0, user, ref mailboxPlans, archiving); + GetExchangeMailboxPlansByUser(0, user, ref mailboxPlans, ref defaultPlanId, archiving); - - ExchangeOrganization ExchangeOrg = ObjectUtils.FillObjectFromDataReader(DataProvider.GetExchangeOrganization(itemId)); - - if (ExchangeOrg != null) + if (defaultPlanId.HasValue) { - foreach (ExchangeMailboxPlan p in mailboxPlans) - { - p.IsDefault = (p.MailboxPlanId == ExchangeOrg.ExchangeMailboxPlanID); - } + mailboxPlans.ForEach(p => p.IsDefault = (p.MailboxPlanId == defaultPlanId.Value)); } return mailboxPlans; @@ -2950,7 +2946,7 @@ namespace WebsitePanel.EnterpriseServer } } - private static void GetExchangeMailboxPlansByUser(int itemId, UserInfo user, ref List mailboxPlans, bool archiving) + private static void GetExchangeMailboxPlansByUser(int itemId, UserInfo user, ref List mailboxPlans, ref int? defaultPlanId, bool archiving) { if ((user != null)) { @@ -2983,11 +2979,20 @@ namespace WebsitePanel.EnterpriseServer { mailboxPlans.Add(p); } + + // Set default plan + ExchangeOrganization exchangeOrg = ObjectUtils.FillObjectFromDataReader(DataProvider.GetExchangeOrganization(OrgId)); + + // If the default plan has not been set by the setting of higher priority + if (!defaultPlanId.HasValue && exchangeOrg != null && exchangeOrg.ExchangeMailboxPlanID > 0) + { + defaultPlanId = exchangeOrg.ExchangeMailboxPlanID; + } } UserInfo owner = UserController.GetUserInternally(user.OwnerId); - GetExchangeMailboxPlansByUser(0, owner, ref mailboxPlans, archiving); + GetExchangeMailboxPlansByUser(0, owner, ref mailboxPlans, ref defaultPlanId, archiving); } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs index 67ab6ab2..8a9f9136 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs @@ -103,6 +103,11 @@ namespace WebsitePanel.EnterpriseServer return GetRdsServersPagedInternal(filterColumn, filterValue, sortColumn, startRow, maximumRows); } + public static List 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(DataProvider.GetRDSCollectionById(collectionId)); @@ -579,6 +589,22 @@ namespace WebsitePanel.EnterpriseServer return result; } + private static List GetRdsUserSessionsInternal(int collectionId) + { + var result = new List(); + var collection = ObjectUtils.FillObjectFromDataReader(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("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("REMOTE_DESKTOP_SERVICES", "ADD_REMOTE_APP_TO_COLLECTION"); @@ -1236,6 +1300,11 @@ namespace WebsitePanel.EnterpriseServer List remoteAppsToAdd = remoteApps.Where(x => !existingCollectionApps.Select(p => p.DisplayName).Contains(x.DisplayName)).ToList(); foreach (var app in remoteAppsToAdd) { + if (!string.IsNullOrEmpty(app.RequiredCommandLine)) + { + app.RequiredCommandLine = string.Format("/v:{0}", collection.Servers.First().FqdName); + } + AddRemoteApplicationToCollection(itemId, collection, app); } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/WebServers/WebServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/WebServers/WebServerController.cs index 98f22ef1..266fdf3c 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/WebServers/WebServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/WebServers/WebServerController.cs @@ -3633,6 +3633,17 @@ namespace WebsitePanel.EnterpriseServer WebServer server = GetWebServer(item.ServiceId); // server.RevokeWebManagementAccess(item.SiteId, accountName); + + // Cleanup web site properties if the web management and web deploy user are the same + if (GetNonQualifiedAccountName(accountName) == item.WebDeployPublishingAccount) + { + item.WebDeployPublishingAccount = String.Empty; + item.WebDeploySitePublishingEnabled = false; + item.WebDeploySitePublishingProfile = String.Empty; + item.WebDeployPublishingPassword = String.Empty; + // Put changes into effect + PackageController.UpdatePackageItem(item); + } } catch (Exception ex) { @@ -3644,6 +3655,12 @@ namespace WebsitePanel.EnterpriseServer } } + protected static string GetNonQualifiedAccountName(string accountName) + { + int idx = accountName.LastIndexOf("\\"); + return (idx != -1) ? accountName.Substring(idx + 1) : accountName; + } + public static ResultObject ChangeWebManagementAccessPassword(int siteItemId, string accountPassword) { ResultObject result = new ResultObject { IsSuccess = true }; diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esRemoteDesktopServices.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esRemoteDesktopServices.asmx.cs index 3aed999a..de7dfb0f 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esRemoteDesktopServices.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esRemoteDesktopServices.asmx.cs @@ -271,5 +271,17 @@ namespace WebsitePanel.EnterpriseServer { return RemoteDesktopServicesController.SetApplicationUsers(itemId, collectionId, remoteApp, users); } + + [WebMethod] + public List GetRdsUserSessions(int collectionId) + { + return RemoteDesktopServicesController.GetRdsUserSessions(collectionId); + } + + [WebMethod] + public ResultObject LogOffRdsUser(int itemId, string unifiedSessionId, string hostServer) + { + return RemoteDesktopServicesController.LogOffRdsUser(itemId, unifiedSessionId, hostServer); + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/IRemoteDesktopServices.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/IRemoteDesktopServices.cs index 343baa96..942d0ced 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/IRemoteDesktopServices.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/IRemoteDesktopServices.cs @@ -66,5 +66,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices bool CheckRDSServerAvaliable(string hostname); List GetServersExistingInCollections(); void EditRdsCollectionSettings(RdsCollection collection); + List GetRdsUserSessions(string collectionName); + void LogOffRdsUser(string unifiedSessionId, string hostServer); } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsUserSession.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsUserSession.cs new file mode 100644 index 00000000..8c3e9729 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsUserSession.cs @@ -0,0 +1,17 @@ +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; } + public string DomainName { get; set; } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RemoteApplication.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RemoteApplication.cs index f15a5fe1..300f8b47 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RemoteApplication.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RemoteApplication.cs @@ -35,5 +35,6 @@ namespace WebsitePanel.Providers.RemoteDesktopServices public string FilePath { get; set; } public string FileVirtualPath { get; set; } public bool ShowInWebAccess { get; set; } + public string RequiredCommandLine { get; set; } } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/StartMenuApp.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/StartMenuApp.cs index b6195e49..afdee244 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/StartMenuApp.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/StartMenuApp.cs @@ -33,5 +33,6 @@ namespace WebsitePanel.Providers.RemoteDesktopServices public string DisplayName { get; set; } public string FilePath { get; set; } public string FileVirtualPath { get; set; } + public string RequiredCommandLine { get; set; } } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj index e3d9ff2b..6e8b7bd8 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj @@ -136,6 +136,7 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Mail.IceWarp/IceWarp.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Mail.IceWarp/IceWarp.cs index f0538c23..caafd49c 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Mail.IceWarp/IceWarp.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Mail.IceWarp/IceWarp.cs @@ -836,7 +836,7 @@ namespace WebsitePanel.Providers.Mail Enabled = Convert.ToInt32((object) accountObject.GetProperty("U_AccountDisabled")) == 0, ForwardingEnabled = !string.IsNullOrWhiteSpace(accountObject.GetProperty("U_ForwardTo")) || string.IsNullOrWhiteSpace(accountObject.GetProperty("U_RemoteAddress")) && Convert.ToBoolean((object) accountObject.GetProperty("U_UseRemoteAddress")), IsDomainAdmin = Convert.ToBoolean((object) accountObject.GetProperty("U_DomainAdmin")), - MaxMailboxSize = Convert.ToInt32((object) accountObject.GetProperty("U_MaxBoxSize"))/1024, + MaxMailboxSize = Convert.ToBoolean((object) accountObject.GetProperty("U_MaxBox")) ? Convert.ToInt32((object) accountObject.GetProperty("U_MaxBoxSize"))/1024 : 0, Password = accountObject.GetProperty("U_Password"), ResponderEnabled = Convert.ToInt32((object) accountObject.GetProperty("U_Respond")) > 0, QuotaUsed = Convert.ToInt64((object) accountObject.GetProperty("U_MailBoxSize")), @@ -923,7 +923,8 @@ namespace WebsitePanel.Providers.Mail accountObject.SetProperty("U_AccountDisabled", mailbox.IceWarpAccountState); accountObject.SetProperty("U_DomainAdmin", mailbox.IsDomainAdmin); accountObject.SetProperty("U_Password", mailbox.Password); - accountObject.SetProperty("U_MaxBoxSize", mailbox.MaxMailboxSize); + accountObject.SetProperty("U_MaxBoxSize", mailbox.MaxMailboxSize*1024); + accountObject.SetProperty("U_MaxBox", mailbox.MaxMailboxSize > 0 ? "1" : "0"); accountObject.SetProperty("U_MaxMessageSize", mailbox.MaxMessageSizeMegaByte*1024); accountObject.SetProperty("U_MegabyteSendLimit", mailbox.MegaByteSendLimit); accountObject.SetProperty("U_NumberSendLimit", mailbox.NumberSendLimit); diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs index 05a2dc37..15cadff0 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs @@ -336,6 +336,50 @@ namespace WebsitePanel.Providers.RemoteDesktopServices } } + public List GetRdsUserSessions(string collectionName) + { + Runspace runSpace = null; + var result = new List(); + + 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 GetServersExistingInCollections() { Runspace runSpace = null; @@ -698,6 +742,12 @@ namespace WebsitePanel.Providers.RemoteDesktopServices cmd.Parameters.Add("FilePath", remoteApp.FilePath); cmd.Parameters.Add("ShowInWebAccess", remoteApp.ShowInWebAccess); + if (!string.IsNullOrEmpty(remoteApp.RequiredCommandLine)) + { + cmd.Parameters.Add("CommandLineSetting", "Require"); + cmd.Parameters.Add("RequiredCommandLine", remoteApp.RequiredCommandLine); + } + ExecuteShellCommand(runSpace, cmd, false); result = true; @@ -1113,6 +1163,9 @@ namespace WebsitePanel.Providers.RemoteDesktopServices ShowInWebAccess = Convert.ToBoolean(GetPSObjectProperty(psObject, "ShowInWebAccess")) }; + var requiredCommandLine = GetPSObjectProperty(psObject, "RequiredCommandLine"); + remoteApp.RequiredCommandLine = requiredCommandLine == null ? null : requiredCommandLine.ToString(); + return remoteApp; } @@ -1676,6 +1729,33 @@ namespace WebsitePanel.Providers.RemoteDesktopServices return new List(); } + internal List GetRdsUserSessionsInternal(string collectionName, Runspace runSpace) + { + var result = new List(); + var scripts = new List(); + 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 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 } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs index 163eb5c9..4ecb9320 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIS70/IIs70.cs @@ -881,7 +881,7 @@ namespace WebsitePanel.Providers.Web #endregion #region PHP 5 script mappings - if (virtualDir.PhpInstalled.StartsWith(PHP_5)) + if (!string.IsNullOrEmpty(virtualDir.PhpInstalled) && virtualDir.PhpInstalled.StartsWith(PHP_5)) { if (PhpMode == Constants.PhpMode.FastCGI && virtualDir.PhpInstalled.Contains('|')) { @@ -4133,6 +4133,9 @@ namespace WebsitePanel.Providers.Web // Restore setting back ServerSettings.ADEnabled = adEnabled; } + + // + RemoveDelegationRulesRestrictions(siteName, accountName); } private void ReadWebDeployPublishingAccessDetails(WebVirtualDirectory iisObject) diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/RemoteDesktopServicesProxy.cs b/WebsitePanel/Sources/WebsitePanel.Server.Client/RemoteDesktopServicesProxy.cs index 772de6e9..3f06e32a 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.Client/RemoteDesktopServicesProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/RemoteDesktopServicesProxy.cs @@ -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; + /// public RemoteDesktopServices() { this.Url = "http://localhost:9003/RemoteDesktopServices.asmx"; @@ -86,6 +90,9 @@ namespace WebsitePanel.Providers.RemoteDesktopServices { /// public event EditRdsCollectionSettingsCompletedEventHandler EditRdsCollectionSettingsCompleted; + /// + public event GetRdsUserSessionsCompletedEventHandler GetRdsUserSessionsCompleted; + /// public event AddRdsServersToDeploymentCompletedEventHandler AddRdsServersToDeploymentCompleted; @@ -149,6 +156,9 @@ namespace WebsitePanel.Providers.RemoteDesktopServices { /// public event GetServersExistingInCollectionsCompletedEventHandler GetServersExistingInCollectionsCompleted; + /// + public event LogOffRdsUserCompletedEventHandler LogOffRdsUserCompleted; + /// [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 { } } + /// + [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])); + } + + /// + public System.IAsyncResult BeginGetRdsUserSessions(string collectionName, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetRdsUserSessions", new object[] { + collectionName}, callback, asyncState); + } + + /// + public RdsUserSession[] EndGetRdsUserSessions(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((RdsUserSession[])(results[0])); + } + + /// + public void GetRdsUserSessionsAsync(string collectionName) { + this.GetRdsUserSessionsAsync(collectionName, null); + } + + /// + 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)); + } + } + /// [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 { } } + /// + [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}); + } + + /// + public System.IAsyncResult BeginLogOffRdsUser(string unifiedSessionId, string hostServer, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("LogOffRdsUser", new object[] { + unifiedSessionId, + hostServer}, callback, asyncState); + } + + /// + public void EndLogOffRdsUser(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void LogOffRdsUserAsync(string unifiedSessionId, string hostServer) { + this.LogOffRdsUserAsync(unifiedSessionId, hostServer, null); + } + + /// + 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)); + } + } + /// 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); + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void GetRdsUserSessionsCompletedEventHandler(object sender, GetRdsUserSessionsCompletedEventArgs e); + + /// + [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; + } + + /// + public RdsUserSession[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((RdsUserSession[])(this.results[0])); + } + } + } + /// [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 { } } } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void LogOffRdsUserCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); } diff --git a/WebsitePanel/Sources/WebsitePanel.Server/RemoteDesktopServices.asmx.cs b/WebsitePanel/Sources/WebsitePanel.Server/RemoteDesktopServices.asmx.cs index 1dd8b6e6..796a6448 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/RemoteDesktopServices.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server/RemoteDesktopServices.asmx.cs @@ -92,6 +92,24 @@ namespace WebsitePanel.Server } } + [WebMethod, SoapHeader("settings")] + public List 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; + } + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/ESModule_ControlsHierarchy.config b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/ESModule_ControlsHierarchy.config index 29dde726..beadb444 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/ESModule_ControlsHierarchy.config +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/ESModule_ControlsHierarchy.config @@ -150,4 +150,5 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config index 885e8b53..80078941 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config @@ -581,6 +581,7 @@ + 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 3d851e29..049d2b3d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx @@ -5335,6 +5335,9 @@ Mailbox plan updated + + Succesfully set default mailbox plan. + Lync plan update failed @@ -5641,4 +5644,10 @@ RDS Collection settings not updated + + RDS User logging off error + + + GEtting RDS User sessions error + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SettingsExchangeMailboxPlansPolicy.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SettingsExchangeMailboxPlansPolicy.ascx.resx index 220a268c..d35a7610 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SettingsExchangeMailboxPlansPolicy.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SettingsExchangeMailboxPlansPolicy.ascx.resx @@ -249,4 +249,7 @@ Retention policy + + Default + \ 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 new file mode 100644 index 00000000..e8f7f85d --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSUserSessions.ascx.resx @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Host Server + + + No user sessions. + + + Session State + + + User Name + + + Edit RDS Collection + + + RDS User Sessions + + + RDS User Sessions + + + if(!confirm('Are you sure you want to log off user?')) return false; else ShowProgressDialog('Logging off user...'); + + + Log Off + + + Log Off + + + Refresh + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx new file mode 100644 index 00000000..33aab7ff --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx @@ -0,0 +1,81 @@ +<%@ 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" %> + + + + +
+
+
+
+
+
+
+ + + - + +
+
+ + + + +
+
+ +
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx.cs new file mode 100644 index 00000000..79e37ea8 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx.cs @@ -0,0 +1,105 @@ +using AjaxControlToolkit; +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.DisplayName; + 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(); + ((ModalPopupExtender)asyncTasks.FindControl("ModalPopupProperties")).Hide(); + } + catch (Exception ex) + { + ShowErrorMessage("REMOTE_DESKTOP_SERVICES_LOG_OFF_USER", ex); + } + } + } + + protected void btnSave_Click(object sender, EventArgs e) + { + if (!Page.IsValid) + { + return; + } + + BindGrid(); + } + + protected void btnSaveExit_Click(object sender, EventArgs e) + { + if (!Page.IsValid) + { + return; + } + + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "rds_collections", "SpaceID=" + PanelSecurity.PackageId)); + } + + protected void btnRefresh_Click(object sender, EventArgs e) + { + if (!Page.IsValid) + { + return; + } + + BindGrid(); + ((ModalPopupExtender)asyncTasks.FindControl("ModalPopupProperties")).Hide(); + } + + private void BindGrid() + { + var userSessions = new List(); + + try + { + userSessions = ES.Services.RDS.GetRdsUserSessions(PanelRequest.CollectionID).ToList(); + } + catch(Exception ex) + { + ShowErrorMessage("REMOTE_DESKTOP_SERVICES_USER_SESSIONS", ex); + } + + foreach(var userSession in userSessions) + { + var states = userSession.SessionState.Split('_'); + + if (states.Length == 2) + { + userSession.SessionState = states[1]; + } + } + + gvRDSUserSessions.DataSource = userSessions; + gvRDSUserSessions.DataBind(); + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx.designer.cs new file mode 100644 index 00000000..e9944d67 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSUserSessions.ascx.designer.cs @@ -0,0 +1,123 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.RDS { + + + public partial class RDSUserSessions { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// imgEditRDSCollection control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgEditRDSCollection; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// litCollectionName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litCollectionName; + + /// + /// tabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.RDS.UserControls.RdsServerTabs tabs; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// RDAppsUpdatePanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UpdatePanel RDAppsUpdatePanel; + + /// + /// btnRefresh control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnRefresh; + + /// + /// secRdsUserSessions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secRdsUserSessions; + + /// + /// panelRdsUserSessions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel panelRdsUserSessions; + + /// + /// gvRDSUserSessions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvRDSUserSessions; + + /// + /// buttonPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ItemButtonPanel buttonPanel; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/App_LocalResources/RDSCollectionTabs.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/App_LocalResources/RDSCollectionTabs.ascx.resx index 288b1145..afb4730a 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/App_LocalResources/RDSCollectionTabs.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/App_LocalResources/RDSCollectionTabs.ascx.resx @@ -129,4 +129,7 @@ Settings + + User Sessions + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx index ecae4947..088d5153 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx @@ -5,7 +5,7 @@
- +
+ @@ -74,6 +75,7 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx.cs index 2bcf719d..403eea17 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionApps.ascx.cs @@ -50,7 +50,7 @@ namespace WebsitePanel.Portal.RDS.UserControls } public void SetApps(RemoteApplication[] apps) - { + { BindApps(apps, false); } @@ -104,30 +104,52 @@ namespace WebsitePanel.Portal.RDS.UserControls List selectedApps = GetPopUpGridViewApps(); BindApps(selectedApps.ToArray(), true); - - } + } protected void BindPopupApps() { RdsCollection collection = ES.Services.RDS.GetRdsCollection(PanelRequest.CollectionID); - StartMenuApp[] apps = ES.Services.RDS.GetAvailableRemoteApplications(PanelRequest.ItemID, collection.Name); + List apps = ES.Services.RDS.GetAvailableRemoteApplications(PanelRequest.ItemID, collection.Name).ToList(); + + var fullRemote = new StartMenuApp + { + DisplayName = "Session Host", + FilePath = "%SystemRoot%\\system32\\mstsc.exe", + RequiredCommandLine = string.Format("/v:{0}", collection.Servers.First().FqdName) + }; + + var displayNames = GetApps().Select(p => p.DisplayName); + apps = apps.Where(x => !displayNames.Contains(x.DisplayName)).ToList(); - apps = apps.Where(x => !GetApps().Select(p => p.DisplayName).Contains(x.DisplayName)).ToArray(); - Array.Sort(apps, CompareAccount); if (Direction == SortDirection.Ascending) { - Array.Reverse(apps); + apps = apps.OrderBy(a => a.DisplayName).ToList(); Direction = SortDirection.Descending; } else + { + apps = apps.OrderByDescending(a => a.DisplayName).ToList(); Direction = SortDirection.Ascending; + } + + if (!displayNames.Contains(fullRemote.DisplayName)) + { + if (apps.Count > 0) + { + apps.Insert(0, fullRemote); + } + else + { + apps.Add(fullRemote); + } + } gvPopupApps.DataSource = apps; gvPopupApps.DataBind(); } protected void BindApps(RemoteApplication[] newApps, bool preserveExisting) - { + { // get binded addresses List apps = new List(); if(preserveExisting) @@ -154,7 +176,7 @@ namespace WebsitePanel.Portal.RDS.UserControls apps.Add(newApp); } - } + } gvApps.DataSource = apps; gvApps.DataBind(); @@ -174,6 +196,7 @@ namespace WebsitePanel.Portal.RDS.UserControls app.Alias = (string)gvApps.DataKeys[i][0]; app.DisplayName = ((Literal)row.FindControl("litDisplayName")).Text; app.FilePath = ((HiddenField)row.FindControl("hfFilePath")).Value; + app.RequiredCommandLine = ((HiddenField)row.FindControl("hfRequiredCommandLine")).Value; if (state == SelectedState.All || (state == SelectedState.Selected && chkSelect.Checked) || @@ -200,7 +223,8 @@ namespace WebsitePanel.Portal.RDS.UserControls { Alias = (string)gvPopupApps.DataKeys[i][0], DisplayName = ((Literal)row.FindControl("litName")).Text, - FilePath = ((HiddenField)row.FindControl("hfFilePathPopup")).Value + FilePath = ((HiddenField)row.FindControl("hfFilePathPopup")).Value, + RequiredCommandLine = ((HiddenField)row.FindControl("hfRequiredCommandLinePopup")).Value }); } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionTabs.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionTabs.ascx index 06dc8446..35aa06a7 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionTabs.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionTabs.ascx @@ -5,13 +5,13 @@ - + <%# Eval("Name") %> - + <%# Eval("Name") %> @@ -19,4 +19,12 @@ -
\ No newline at end of file +
+ + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionTabs.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionTabs.ascx.cs index 7c99c275..00fab605 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionTabs.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionTabs.ascx.cs @@ -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; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionUsers.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionUsers.ascx index b2dc9efc..8f2bbf36 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionUsers.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionUsers.ascx @@ -21,7 +21,7 @@ - + @@ -75,14 +75,14 @@ - + - + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx index a9a75838..e08d5b60 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx @@ -28,6 +28,15 @@ <%# PortalAntiXSS.Encode((string)Eval("MailboxPlan"))%> + + + +   + +  
-
+
+
+ +
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.cs index 04ff1c50..21988009 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.cs @@ -36,7 +36,7 @@ using System.Xml.Serialization; using System.Collections.Generic; using System.Collections.ObjectModel; - +using System.Linq; using System.Web; using System.Web.Security; using System.Web.UI; @@ -99,21 +99,7 @@ namespace WebsitePanel.Portal private void BindMailboxPlans() { - Providers.HostedSolution.Organization[] orgs = null; - - if (PanelSecurity.SelectedUserId != 1) - { - PackageInfo[] Packages = ES.Services.Packages.GetPackages(PanelSecurity.SelectedUserId); - - if ((Packages != null) & (Packages.GetLength(0) > 0)) - { - orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(Packages[0].PackageId, false); - } - } - else - { - orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(1, false); - } + Providers.HostedSolution.Organization[] orgs = GetOrganizations(); if ((orgs != null) & (orgs.GetLength(0) > 0)) { @@ -123,6 +109,9 @@ namespace WebsitePanel.Portal gvMailboxPlans.DataBind(); } + // enable set default plan button if organization has two or more plans + btnSetDefaultMailboxPlan.Enabled = gvMailboxPlans.Rows.Count > 1; + btnUpdateMailboxPlan.Enabled = (string.IsNullOrEmpty(txtMailboxPlan.Text)) ? false : true; } @@ -185,21 +174,7 @@ namespace WebsitePanel.Portal if (PanelSecurity.SelectedUser.Role == UserRole.Reseller) plan.MailboxPlanType = (int)ExchangeMailboxPlanType.Reseller; - Providers.HostedSolution.Organization[] orgs = null; - - if (PanelSecurity.SelectedUserId != 1) - { - PackageInfo[] Packages = ES.Services.Packages.GetPackages(PanelSecurity.SelectedUserId); - - if ((Packages != null) & (Packages.GetLength(0) > 0)) - { - orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(Packages[0].PackageId, false); - } - } - else - { - orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(1, false); - } + Providers.HostedSolution.Organization[] orgs = GetOrganizations(); if ((orgs != null) & (orgs.GetLength(0) > 0)) @@ -231,20 +206,7 @@ namespace WebsitePanel.Portal case "DeleteItem": try { - - if (PanelSecurity.SelectedUserId != 1) - { - PackageInfo[] Packages = ES.Services.Packages.GetPackages(PanelSecurity.SelectedUserId); - - if ((Packages != null) & (Packages.GetLength(0) > 0)) - { - orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(Packages[0].PackageId, false); - } - } - else - { - orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(1, false); - } + orgs = GetOrganizations(); plan = ES.Services.ExchangeServer.GetExchangeMailboxPlan(orgs[0].Id, mailboxPlanId); @@ -308,20 +270,7 @@ namespace WebsitePanel.Portal case "EditItem": ViewState["MailboxPlanID"] = mailboxPlanId; - if (PanelSecurity.SelectedUserId != 1) - { - PackageInfo[] Packages = ES.Services.Packages.GetPackages(PanelSecurity.SelectedUserId); - - if ((Packages != null) & (Packages.GetLength(0) > 0)) - { - orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(Packages[0].PackageId, false); - } - } - else - { - orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(1, false); - } - + orgs = GetOrganizations(); plan = ES.Services.ExchangeServer.GetExchangeMailboxPlan(orgs[0].Id, mailboxPlanId); txtMailboxPlan.Text = plan.MailboxPlan; @@ -421,24 +370,9 @@ namespace WebsitePanel.Portal return; int mailboxPlanId = (int)ViewState["MailboxPlanID"]; - Providers.HostedSolution.Organization[] orgs = null; + Providers.HostedSolution.Organization[] orgs = GetOrganizations(); Providers.HostedSolution.ExchangeMailboxPlan plan; - - if (PanelSecurity.SelectedUserId != 1) - { - PackageInfo[] Packages = ES.Services.Packages.GetPackages(PanelSecurity.SelectedUserId); - - if ((Packages != null) & (Packages.GetLength(0) > 0)) - { - orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(Packages[0].PackageId, false); - } - } - else - { - orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(1, false); - } - plan = ES.Services.ExchangeServer.GetExchangeMailboxPlan(orgs[0].Id, mailboxPlanId); if (plan.ItemId != orgs[0].Id) @@ -668,36 +602,22 @@ namespace WebsitePanel.Portal { ddTags.Items.Clear(); - Providers.HostedSolution.Organization[] orgs = null; + Organization[] orgs = GetOrganizations(); - if (PanelSecurity.SelectedUserId != 1) - { - PackageInfo[] Packages = ES.Services.Packages.GetPackages(PanelSecurity.SelectedUserId); - - if ((Packages != null) & (Packages.GetLength(0) > 0)) + if ((orgs != null) && (orgs.GetLength(0) > 0)) { - orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(Packages[0].PackageId, false); - } - } - else - { - orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(1, false); - } + Providers.HostedSolution.ExchangeRetentionPolicyTag[] allTags = ES.Services.ExchangeServer.GetExchangeRetentionPolicyTags(orgs[0].Id); + List selectedTags = ViewState["Tags"] as List; - if ((orgs != null) & (orgs.GetLength(0) > 0)) - { - Providers.HostedSolution.ExchangeRetentionPolicyTag[] allTags = ES.Services.ExchangeServer.GetExchangeRetentionPolicyTags(orgs[0].Id); - List selectedTags = ViewState["Tags"] as List; - - foreach (Providers.HostedSolution.ExchangeRetentionPolicyTag tag in allTags) - { - if (selectedTags != null) + foreach (Providers.HostedSolution.ExchangeRetentionPolicyTag tag in allTags) { - if (selectedTags.Find(x => x.TagID == tag.TagID) != null) - continue; - } + if (selectedTags != null) + { + if (selectedTags.Find(x => x.TagID == tag.TagID) != null) + continue; + } - ddTags.Items.Add(new System.Web.UI.WebControls.ListItem(tag.TagName, tag.TagID.ToString())); + ddTags.Items.Add(new System.Web.UI.WebControls.ListItem(tag.TagName, tag.TagID.ToString())); } } @@ -737,5 +657,55 @@ namespace WebsitePanel.Portal } + protected Organization[] GetOrganizations() + { + Organization[] orgs = null; + + if (PanelSecurity.SelectedUserId != 1) + { + PackageInfo[] Packages = ES.Services.Packages.GetPackages(PanelSecurity.SelectedUserId); + + if ((Packages != null) & (Packages.GetLength(0) > 0)) + { + orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(Packages[0].PackageId, false); + } + } + else + { + orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(1, false); + } + + return orgs; + } + + protected void btnSetDefaultMailboxPlan_Click(object sender, EventArgs e) + { + // get domain + int mailboxPlanId = Utils.ParseInt(Request.Form["DefaultMailboxPlan"], 0); + + try + { + var orgs = GetOrganizations(); + + if ((orgs != null) && (orgs.GetLength(0) > 0)) + { + ES.Services.ExchangeServer.SetOrganizationDefaultExchangeMailboxPlan(orgs[0].Id, mailboxPlanId); + + messageBox.ShowSuccessMessage("EXCHANGE_SET_DEFAULT_MAILBOXPLAN"); + + // rebind domains + BindMailboxPlans(); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("EXCHANGE_SET_DEFAULT_MAILBOXPLAN", ex); + } + } + + protected string IsChecked(bool val) + { + return val ? "checked" : ""; + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.designer.cs index 84de2aeb..1c07cbce 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.designer.cs @@ -35,11 +35,13 @@ // //------------------------------------------------------------------------------ -namespace WebsitePanel.Portal { - - - public partial class SettingsExchangeMailboxPlansPolicy { - +namespace WebsitePanel.Portal +{ + + + public partial class SettingsExchangeMailboxPlansPolicy + { + /// /// asyncTasks control. /// @@ -48,7 +50,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; - + /// /// messageBox control. /// @@ -57,7 +59,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; - + /// /// gvMailboxPlans control. /// @@ -66,7 +68,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::System.Web.UI.WebControls.GridView gvMailboxPlans; - + /// /// secMailboxPlan control. /// @@ -75,7 +77,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::WebsitePanel.Portal.CollapsiblePanel secMailboxPlan; - + /// /// MailboxPlan control. /// @@ -84,7 +86,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::System.Web.UI.WebControls.Panel MailboxPlan; - + /// /// txtMailboxPlan control. /// @@ -93,7 +95,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::System.Web.UI.WebControls.TextBox txtMailboxPlan; - + /// /// valRequireMailboxPlan control. /// @@ -102,7 +104,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireMailboxPlan; - + /// /// secMailboxFeatures control. /// @@ -111,7 +113,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::WebsitePanel.Portal.CollapsiblePanel secMailboxFeatures; - + /// /// MailboxFeatures control. /// @@ -120,7 +122,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::System.Web.UI.WebControls.Panel MailboxFeatures; - + /// /// chkPOP3 control. /// @@ -129,7 +131,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::System.Web.UI.WebControls.CheckBox chkPOP3; - + /// /// chkIMAP control. /// @@ -138,7 +140,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::System.Web.UI.WebControls.CheckBox chkIMAP; - + /// /// chkOWA control. /// @@ -147,7 +149,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::System.Web.UI.WebControls.CheckBox chkOWA; - + /// /// chkMAPI control. /// @@ -156,7 +158,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::System.Web.UI.WebControls.CheckBox chkMAPI; - + /// /// chkActiveSync control. /// @@ -165,7 +167,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::System.Web.UI.WebControls.CheckBox chkActiveSync; - + /// /// secMailboxGeneral control. /// @@ -174,7 +176,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::WebsitePanel.Portal.CollapsiblePanel secMailboxGeneral; - + /// /// MailboxGeneral control. /// @@ -183,7 +185,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::System.Web.UI.WebControls.Panel MailboxGeneral; - + /// /// chkHideFromAddressBook control. /// @@ -192,7 +194,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::System.Web.UI.WebControls.CheckBox chkHideFromAddressBook; - + /// /// secStorageQuotas control. /// @@ -201,7 +203,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::WebsitePanel.Portal.CollapsiblePanel secStorageQuotas; - + /// /// StorageQuotas control. /// @@ -210,7 +212,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::System.Web.UI.WebControls.Panel StorageQuotas; - + /// /// locMailboxSize control. /// @@ -219,7 +221,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::System.Web.UI.WebControls.Localize locMailboxSize; - + /// /// mailboxSize control. /// @@ -228,7 +230,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::WebsitePanel.Portal.QuotaEditor mailboxSize; - + /// /// locMaxRecipients control. /// @@ -237,7 +239,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::System.Web.UI.WebControls.Localize locMaxRecipients; - + /// /// maxRecipients control. /// @@ -246,7 +248,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::WebsitePanel.Portal.QuotaEditor maxRecipients; - + /// /// locMaxSendMessageSizeKB control. /// @@ -255,7 +257,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::System.Web.UI.WebControls.Localize locMaxSendMessageSizeKB; - + /// /// maxSendMessageSizeKB control. /// @@ -264,7 +266,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::WebsitePanel.Portal.QuotaEditor maxSendMessageSizeKB; - + /// /// locMaxReceiveMessageSizeKB control. /// @@ -273,7 +275,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::System.Web.UI.WebControls.Localize locMaxReceiveMessageSizeKB; - + /// /// maxReceiveMessageSizeKB control. /// @@ -282,7 +284,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::WebsitePanel.Portal.QuotaEditor maxReceiveMessageSizeKB; - + /// /// locWhenSizeExceeds control. /// @@ -291,7 +293,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::System.Web.UI.WebControls.Localize locWhenSizeExceeds; - + /// /// locIssueWarning control. /// @@ -300,7 +302,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::System.Web.UI.WebControls.Localize locIssueWarning; - + /// /// sizeIssueWarning control. /// @@ -309,7 +311,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.SizeBox sizeIssueWarning; - + /// /// locProhibitSend control. /// @@ -318,7 +320,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::System.Web.UI.WebControls.Localize locProhibitSend; - + /// /// sizeProhibitSend control. /// @@ -327,7 +329,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.SizeBox sizeProhibitSend; - + /// /// locProhibitSendReceive control. /// @@ -336,7 +338,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::System.Web.UI.WebControls.Localize locProhibitSendReceive; - + /// /// sizeProhibitSendReceive control. /// @@ -345,7 +347,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.SizeBox sizeProhibitSendReceive; - + /// /// secDeleteRetention control. /// @@ -354,7 +356,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::WebsitePanel.Portal.CollapsiblePanel secDeleteRetention; - + /// /// DeleteRetention control. /// @@ -363,7 +365,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::System.Web.UI.WebControls.Panel DeleteRetention; - + /// /// locKeepDeletedItems control. /// @@ -372,7 +374,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::System.Web.UI.WebControls.Localize locKeepDeletedItems; - + /// /// daysKeepDeletedItems control. /// @@ -381,7 +383,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.DaysBox daysKeepDeletedItems; - + /// /// secLitigationHold control. /// @@ -390,7 +392,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::WebsitePanel.Portal.CollapsiblePanel secLitigationHold; - + /// /// LitigationHold control. /// @@ -399,7 +401,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::System.Web.UI.WebControls.Panel LitigationHold; - + /// /// chkEnableLitigationHold control. /// @@ -408,7 +410,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::System.Web.UI.WebControls.CheckBox chkEnableLitigationHold; - + /// /// locRecoverableItemsSpace control. /// @@ -417,7 +419,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::System.Web.UI.WebControls.Localize locRecoverableItemsSpace; - + /// /// recoverableItemsSpace control. /// @@ -426,7 +428,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::WebsitePanel.Portal.QuotaEditor recoverableItemsSpace; - + /// /// locRecoverableItemsWarning control. /// @@ -435,7 +437,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::System.Web.UI.WebControls.Localize locRecoverableItemsWarning; - + /// /// recoverableItemsWarning control. /// @@ -444,7 +446,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.SizeBox recoverableItemsWarning; - + /// /// lblLitigationHoldUrl control. /// @@ -453,7 +455,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. ///
protected global::System.Web.UI.WebControls.Label lblLitigationHoldUrl; - + /// /// txtLitigationHoldUrl control. /// @@ -462,7 +464,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.TextBox txtLitigationHoldUrl; - + /// /// lblLitigationHoldMsg control. /// @@ -471,7 +473,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Label lblLitigationHoldMsg; - + /// /// txtLitigationHoldMsg control. /// @@ -480,7 +482,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.TextBox txtLitigationHoldMsg; - + /// /// secArchiving control. /// @@ -489,7 +491,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::WebsitePanel.Portal.CollapsiblePanel secArchiving; - + /// /// Archiving control. /// @@ -498,7 +500,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Panel Archiving; - + /// /// chkEnableArchiving control. /// @@ -507,7 +509,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.CheckBox chkEnableArchiving; - + /// /// locArchiveQuota control. /// @@ -516,7 +518,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Localize locArchiveQuota; - + /// /// archiveQuota control. /// @@ -525,7 +527,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::WebsitePanel.Portal.QuotaEditor archiveQuota; - + /// /// locArchiveWarningQuota control. /// @@ -534,7 +536,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Localize locArchiveWarningQuota; - + /// /// archiveWarningQuota control. /// @@ -543,7 +545,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::WebsitePanel.Portal.ExchangeServer.UserControls.SizeBox archiveWarningQuota; - + /// /// secRetentionPolicyTags control. /// @@ -552,7 +554,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::WebsitePanel.Portal.CollapsiblePanel secRetentionPolicyTags; - + /// /// RetentionPolicyTags control. /// @@ -561,7 +563,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Panel RetentionPolicyTags; - + /// /// GeneralUpdatePanel control. /// @@ -570,7 +572,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.UpdatePanel GeneralUpdatePanel; - + /// /// gvPolicy control. /// @@ -579,7 +581,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.GridView gvPolicy; - + /// /// ddTags control. /// @@ -588,7 +590,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.DropDownList ddTags; - + /// /// bntAddTag control. /// @@ -597,7 +599,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Button bntAddTag; - + /// /// btnAddMailboxPlan control. /// @@ -606,7 +608,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Button btnAddMailboxPlan; - + /// /// btnUpdateMailboxPlan control. /// @@ -615,7 +617,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Button btnUpdateMailboxPlan; - + /// /// txtStatus control. /// @@ -624,5 +626,7 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.TextBox txtStatus; + + protected global::System.Web.UI.WebControls.Button btnSetDefaultMailboxPlan; } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx.cs index be04563f..125c354c 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx.cs @@ -546,7 +546,7 @@ namespace WebsitePanel.Portal WDeployPublishingConfirmPasswordTextBox, WDeployPublishingAccountRequiredFieldValidator); - WDeployPublishingAccountTextBox.Text = AutoSuggestWmSvcAccontName(item, "_deploy"); + WDeployPublishingAccountTextBox.Text = AutoSuggestWmSvcAccontName(item, "_dploy"); // WDeployPublishingAccountRequiredFieldValidator.Enabled = true; // diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj index 0156e3bd..046875ad 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj @@ -330,6 +330,13 @@ RDSCollections.ascx + + RDSUserSessions.ascx + ASPXCodeBehind + + + RDSUserSessions.ascx + RDSCollectionApps.ascx ASPXCodeBehind @@ -4365,6 +4372,7 @@ + @@ -4386,6 +4394,7 @@ Designer + ResXFileCodeGenerator DomainLookupView.ascx.Designer.cs @@ -5702,7 +5711,9 @@ Designer - + + Designer +