This commit is contained in:
Christiaan Swiers 2015-02-02 13:22:03 +01:00
commit c975b86f26
36 changed files with 1244 additions and 204 deletions

View file

@ -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";

View file

@ -100,6 +100,10 @@ namespace WebsitePanel.EnterpriseServer {
private System.Threading.SendOrPostCallback SetApplicationUsersOperationCompleted;
private System.Threading.SendOrPostCallback GetRdsUserSessionsOperationCompleted;
private System.Threading.SendOrPostCallback LogOffRdsUserOperationCompleted;
/// <remarks/>
public esRemoteDesktopServices() {
this.Url = "http://localhost:9002/esRemoteDesktopServices.asmx";
@ -210,6 +214,12 @@ namespace WebsitePanel.EnterpriseServer {
/// <remarks/>
public event SetApplicationUsersCompletedEventHandler SetApplicationUsersCompleted;
/// <remarks/>
public event GetRdsUserSessionsCompletedEventHandler GetRdsUserSessionsCompleted;
/// <remarks/>
public event LogOffRdsUserCompletedEventHandler LogOffRdsUserCompleted;
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetRdsCollection", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public RdsCollection GetRdsCollection(int collectionId) {
@ -1800,6 +1810,94 @@ namespace WebsitePanel.EnterpriseServer {
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetRdsUserSessions", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public RdsUserSession[] GetRdsUserSessions(int collectionId) {
object[] results = this.Invoke("GetRdsUserSessions", new object[] {
collectionId});
return ((RdsUserSession[])(results[0]));
}
/// <remarks/>
public System.IAsyncResult BeginGetRdsUserSessions(int collectionId, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("GetRdsUserSessions", new object[] {
collectionId}, callback, asyncState);
}
/// <remarks/>
public RdsUserSession[] EndGetRdsUserSessions(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((RdsUserSession[])(results[0]));
}
/// <remarks/>
public void GetRdsUserSessionsAsync(int collectionId) {
this.GetRdsUserSessionsAsync(collectionId, null);
}
/// <remarks/>
public void GetRdsUserSessionsAsync(int collectionId, object userState) {
if ((this.GetRdsUserSessionsOperationCompleted == null)) {
this.GetRdsUserSessionsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRdsUserSessionsOperationCompleted);
}
this.InvokeAsync("GetRdsUserSessions", new object[] {
collectionId}, this.GetRdsUserSessionsOperationCompleted, userState);
}
private void OnGetRdsUserSessionsOperationCompleted(object arg) {
if ((this.GetRdsUserSessionsCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.GetRdsUserSessionsCompleted(this, new GetRdsUserSessionsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/LogOffRdsUser", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public ResultObject LogOffRdsUser(int itemId, string unifiedSessionId, string hostServer) {
object[] results = this.Invoke("LogOffRdsUser", new object[] {
itemId,
unifiedSessionId,
hostServer});
return ((ResultObject)(results[0]));
}
/// <remarks/>
public System.IAsyncResult BeginLogOffRdsUser(int itemId, string unifiedSessionId, string hostServer, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("LogOffRdsUser", new object[] {
itemId,
unifiedSessionId,
hostServer}, callback, asyncState);
}
/// <remarks/>
public ResultObject EndLogOffRdsUser(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((ResultObject)(results[0]));
}
/// <remarks/>
public void LogOffRdsUserAsync(int itemId, string unifiedSessionId, string hostServer) {
this.LogOffRdsUserAsync(itemId, unifiedSessionId, hostServer, null);
}
/// <remarks/>
public void LogOffRdsUserAsync(int itemId, string unifiedSessionId, string hostServer, object userState) {
if ((this.LogOffRdsUserOperationCompleted == null)) {
this.LogOffRdsUserOperationCompleted = new System.Threading.SendOrPostCallback(this.OnLogOffRdsUserOperationCompleted);
}
this.InvokeAsync("LogOffRdsUser", new object[] {
itemId,
unifiedSessionId,
hostServer}, this.LogOffRdsUserOperationCompleted, userState);
}
private void OnLogOffRdsUserOperationCompleted(object arg) {
if ((this.LogOffRdsUserCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.LogOffRdsUserCompleted(this, new LogOffRdsUserCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
public new void CancelAsync(object userState) {
base.CancelAsync(userState);
@ -2715,4 +2813,56 @@ namespace WebsitePanel.EnterpriseServer {
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void GetRdsUserSessionsCompletedEventHandler(object sender, GetRdsUserSessionsCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class GetRdsUserSessionsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal GetRdsUserSessionsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public RdsUserSession[] Result {
get {
this.RaiseExceptionIfNecessary();
return ((RdsUserSession[])(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void LogOffRdsUserCompletedEventHandler(object sender, LogOffRdsUserCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class LogOffRdsUserCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal LogOffRdsUserCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public ResultObject Result {
get {
this.RaiseExceptionIfNecessary();
return ((ResultObject)(this.results[0]));
}
}
}
}

View file

@ -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)
{

View file

@ -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<ExchangeMailboxPlan> mailboxPlans = new List<ExchangeMailboxPlan>();
int? defaultPlanId = null;
UserInfo user = ObjectUtils.FillObjectFromDataReader<UserInfo>(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<ExchangeOrganization>(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<ExchangeMailboxPlan> mailboxPlans, bool archiving)
private static void GetExchangeMailboxPlansByUser(int itemId, UserInfo user, ref List<ExchangeMailboxPlan> 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<ExchangeOrganization>(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);
}
}

View file

@ -103,6 +103,11 @@ namespace WebsitePanel.EnterpriseServer
return GetRdsServersPagedInternal(filterColumn, filterValue, sortColumn, startRow, maximumRows);
}
public static List<RdsUserSession> GetRdsUserSessions(int collectionId)
{
return GetRdsUserSessionsInternal(collectionId);
}
public static RdsServersPaged GetFreeRdsServersPaged(int packageId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows)
{
return GetFreeRdsServersPagedInternal(packageId, filterColumn, filterValue, sortColumn, startRow, maximumRows);
@ -233,6 +238,11 @@ namespace WebsitePanel.EnterpriseServer
return SetApplicationUsersInternal(itemId, collectionId, remoteApp, users);
}
public static ResultObject LogOffRdsUser(int itemId, string unifiedSessionId, string hostServer)
{
return LogOffRdsUserInternal(itemId, unifiedSessionId, hostServer);
}
private static RdsCollection GetRdsCollectionInternal(int collectionId)
{
var collection = ObjectUtils.FillObjectFromDataReader<RdsCollection>(DataProvider.GetRDSCollectionById(collectionId));
@ -579,6 +589,22 @@ namespace WebsitePanel.EnterpriseServer
return result;
}
private static List<RdsUserSession> GetRdsUserSessionsInternal(int collectionId)
{
var result = new List<RdsUserSession>();
var collection = ObjectUtils.FillObjectFromDataReader<RdsCollection>(DataProvider.GetRDSCollectionById(collectionId));
var organization = OrganizationController.GetOrganization(collection.ItemId);
if (organization == null)
{
return result;
}
var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(organization.PackageId));
return rds.GetRdsUserSessions(collection.Name).ToList();
}
private static RdsServersPaged GetFreeRdsServersPagedInternal(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows)
{
RdsServersPaged result = new RdsServersPaged();
@ -1105,6 +1131,44 @@ namespace WebsitePanel.EnterpriseServer
return result;
}
private static ResultObject LogOffRdsUserInternal(int itemId, string unifiedSessionId, string hostServer)
{
var result = TaskManager.StartResultTask<ResultObject>("REMOTE_DESKTOP_SERVICES", "LOG_OFF_RDS_USER");
try
{
Organization org = OrganizationController.GetOrganization(itemId);
if (org == null)
{
result.IsSuccess = false;
result.AddError("LOG_OFF_RDS_USER", new NullReferenceException("Organization not found"));
return result;
}
var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
rds.LogOffRdsUser(unifiedSessionId, hostServer);
}
catch (Exception ex)
{
result.AddError("REMOTE_DESKTOP_SERVICES_LOG_OFF_RDS_USER", ex);
}
finally
{
if (!result.IsSuccess)
{
TaskManager.CompleteResultTask(result);
}
else
{
TaskManager.CompleteResultTask();
}
}
return result;
}
private static ResultObject AddRemoteApplicationToCollectionInternal(int itemId, RdsCollection collection, RemoteApplication remoteApp)
{
var result = TaskManager.StartResultTask<ResultObject>("REMOTE_DESKTOP_SERVICES", "ADD_REMOTE_APP_TO_COLLECTION");
@ -1236,6 +1300,11 @@ namespace WebsitePanel.EnterpriseServer
List<RemoteApplication> 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);
}

View file

@ -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 };

View file

@ -271,5 +271,17 @@ namespace WebsitePanel.EnterpriseServer
{
return RemoteDesktopServicesController.SetApplicationUsers(itemId, collectionId, remoteApp, users);
}
[WebMethod]
public List<RdsUserSession> GetRdsUserSessions(int collectionId)
{
return RemoteDesktopServicesController.GetRdsUserSessions(collectionId);
}
[WebMethod]
public ResultObject LogOffRdsUser(int itemId, string unifiedSessionId, string hostServer)
{
return RemoteDesktopServicesController.LogOffRdsUser(itemId, unifiedSessionId, hostServer);
}
}
}

View file

@ -66,5 +66,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
bool CheckRDSServerAvaliable(string hostname);
List<string> GetServersExistingInCollections();
void EditRdsCollectionSettings(RdsCollection collection);
List<RdsUserSession> GetRdsUserSessions(string collectionName);
void LogOffRdsUser(string unifiedSessionId, string hostServer);
}
}

View file

@ -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; }
}
}

View file

@ -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; }
}
}

View file

@ -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; }
}
}

View file

@ -136,6 +136,7 @@
<Compile Include="RemoteDesktopServices\RdsPolicyTypes.cs" />
<Compile Include="RemoteDesktopServices\RdsServer.cs" />
<Compile Include="RemoteDesktopServices\RdsServersPaged.cs" />
<Compile Include="RemoteDesktopServices\RdsUserSession.cs" />
<Compile Include="RemoteDesktopServices\RemoteApplication.cs" />
<Compile Include="RemoteDesktopServices\SessionHostServer.cs" />
<Compile Include="RemoteDesktopServices\StartMenuApp.cs" />

View file

@ -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);

View file

@ -336,6 +336,50 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
}
}
public List<RdsUserSession> GetRdsUserSessions(string collectionName)
{
Runspace runSpace = null;
var result = new List<RdsUserSession>();
try
{
runSpace = OpenRunspace();
result = GetRdsUserSessionsInternal(collectionName, runSpace);
}
finally
{
CloseRunspace(runSpace);
}
return result;
}
public void LogOffRdsUser(string unifiedSessionId, string hostServer)
{
Runspace runSpace = null;
try
{
runSpace = OpenRunspace();
object[] errors;
Command cmd = new Command("Invoke-RDUserLogoff");
cmd.Parameters.Add("HostServer", hostServer);
cmd.Parameters.Add("UnifiedSessionID", unifiedSessionId);
cmd.Parameters.Add("Force", true);
ExecuteShellCommand(runSpace, cmd, false, out errors);
if (errors != null && errors.Length > 0)
{
throw new Exception(string.Join("r\\n\\", errors.Select(e => e.ToString()).ToArray()));
}
}
finally
{
CloseRunspace(runSpace);
}
}
public List<string> GetServersExistingInCollections()
{
Runspace runSpace = null;
@ -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<string>();
}
internal List<RdsUserSession> GetRdsUserSessionsInternal(string collectionName, Runspace runSpace)
{
var result = new List<RdsUserSession>();
var scripts = new List<string>();
scripts.Add(string.Format("Get-RDUserSession -ConnectionBroker {0} - CollectionName {1} | ft CollectionName, Username, UnifiedSessionId, SessionState, HostServer", ConnectionBroker, collectionName));
object[] errors;
Command cmd = new Command("Get-RDUserSession");
cmd.Parameters.Add("CollectionName", collectionName);
cmd.Parameters.Add("ConnectionBroker", ConnectionBroker);
var userSessions = ExecuteShellCommand(runSpace, cmd, false, out errors);
var 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
}
}

View file

@ -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)

View file

@ -33,6 +33,8 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
private System.Threading.SendOrPostCallback EditRdsCollectionSettingsOperationCompleted;
private System.Threading.SendOrPostCallback GetRdsUserSessionsOperationCompleted;
private System.Threading.SendOrPostCallback AddRdsServersToDeploymentOperationCompleted;
private System.Threading.SendOrPostCallback GetCollectionOperationCompleted;
@ -75,6 +77,8 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
private System.Threading.SendOrPostCallback GetServersExistingInCollectionsOperationCompleted;
private System.Threading.SendOrPostCallback LogOffRdsUserOperationCompleted;
/// <remarks/>
public RemoteDesktopServices() {
this.Url = "http://localhost:9003/RemoteDesktopServices.asmx";
@ -86,6 +90,9 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
/// <remarks/>
public event EditRdsCollectionSettingsCompletedEventHandler EditRdsCollectionSettingsCompleted;
/// <remarks/>
public event GetRdsUserSessionsCompletedEventHandler GetRdsUserSessionsCompleted;
/// <remarks/>
public event AddRdsServersToDeploymentCompletedEventHandler AddRdsServersToDeploymentCompleted;
@ -149,6 +156,9 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
/// <remarks/>
public event GetServersExistingInCollectionsCompletedEventHandler GetServersExistingInCollectionsCompleted;
/// <remarks/>
public event LogOffRdsUserCompletedEventHandler LogOffRdsUserCompleted;
/// <remarks/>
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateCollection", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
@ -234,6 +244,48 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetRdsUserSessions", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public RdsUserSession[] GetRdsUserSessions(string collectionName) {
object[] results = this.Invoke("GetRdsUserSessions", new object[] {
collectionName});
return ((RdsUserSession[])(results[0]));
}
/// <remarks/>
public System.IAsyncResult BeginGetRdsUserSessions(string collectionName, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("GetRdsUserSessions", new object[] {
collectionName}, callback, asyncState);
}
/// <remarks/>
public RdsUserSession[] EndGetRdsUserSessions(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((RdsUserSession[])(results[0]));
}
/// <remarks/>
public void GetRdsUserSessionsAsync(string collectionName) {
this.GetRdsUserSessionsAsync(collectionName, null);
}
/// <remarks/>
public void GetRdsUserSessionsAsync(string collectionName, object userState) {
if ((this.GetRdsUserSessionsOperationCompleted == null)) {
this.GetRdsUserSessionsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRdsUserSessionsOperationCompleted);
}
this.InvokeAsync("GetRdsUserSessions", new object[] {
collectionName}, this.GetRdsUserSessionsOperationCompleted, userState);
}
private void OnGetRdsUserSessionsOperationCompleted(object arg) {
if ((this.GetRdsUserSessionsCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.GetRdsUserSessionsCompleted(this, new GetRdsUserSessionsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/AddRdsServersToDeployment", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
@ -1157,6 +1209,49 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/LogOffRdsUser", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public void LogOffRdsUser(string unifiedSessionId, string hostServer) {
this.Invoke("LogOffRdsUser", new object[] {
unifiedSessionId,
hostServer});
}
/// <remarks/>
public System.IAsyncResult BeginLogOffRdsUser(string unifiedSessionId, string hostServer, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("LogOffRdsUser", new object[] {
unifiedSessionId,
hostServer}, callback, asyncState);
}
/// <remarks/>
public void EndLogOffRdsUser(System.IAsyncResult asyncResult) {
this.EndInvoke(asyncResult);
}
/// <remarks/>
public void LogOffRdsUserAsync(string unifiedSessionId, string hostServer) {
this.LogOffRdsUserAsync(unifiedSessionId, hostServer, null);
}
/// <remarks/>
public void LogOffRdsUserAsync(string unifiedSessionId, string hostServer, object userState) {
if ((this.LogOffRdsUserOperationCompleted == null)) {
this.LogOffRdsUserOperationCompleted = new System.Threading.SendOrPostCallback(this.OnLogOffRdsUserOperationCompleted);
}
this.InvokeAsync("LogOffRdsUser", new object[] {
unifiedSessionId,
hostServer}, this.LogOffRdsUserOperationCompleted, userState);
}
private void OnLogOffRdsUserOperationCompleted(object arg) {
if ((this.LogOffRdsUserCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.LogOffRdsUserCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
public new void CancelAsync(object userState) {
base.CancelAsync(userState);
@ -1193,6 +1288,32 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void EditRdsCollectionSettingsCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void GetRdsUserSessionsCompletedEventHandler(object sender, GetRdsUserSessionsCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class GetRdsUserSessionsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal GetRdsUserSessionsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public RdsUserSession[] Result {
get {
this.RaiseExceptionIfNecessary();
return ((RdsUserSession[])(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void AddRdsServersToDeploymentCompletedEventHandler(object sender, AddRdsServersToDeploymentCompletedEventArgs e);
@ -1628,4 +1749,8 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void LogOffRdsUserCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
}

View file

@ -92,6 +92,24 @@ namespace WebsitePanel.Server
}
}
[WebMethod, SoapHeader("settings")]
public List<RdsUserSession> GetRdsUserSessions(string collectionName)
{
try
{
Log.WriteStart("'{0}' GetRdsUserSessions", ProviderSettings.ProviderName);
var result = RDSProvider.GetRdsUserSessions(collectionName);
Log.WriteEnd("'{0}' GetRdsUserSessions", ProviderSettings.ProviderName);
return result;
}
catch (Exception ex)
{
Log.WriteError(String.Format("'{0}' GetRdsUserSessions", ProviderSettings.ProviderName), ex);
throw;
}
}
[WebMethod, SoapHeader("settings")]
public bool AddRdsServersToDeployment(RdsServer[] servers)
{
@ -443,5 +461,21 @@ namespace WebsitePanel.Server
throw;
}
}
[WebMethod, SoapHeader("settings")]
public void LogOffRdsUser(string unifiedSessionId, string hostServer)
{
try
{
Log.WriteStart("'{0}' LogOffRdsUser", ProviderSettings.ProviderName);
RDSProvider.LogOffRdsUser(unifiedSessionId, hostServer);
Log.WriteEnd("'{0}' LogOffRdsUser", ProviderSettings.ProviderName);
}
catch (Exception ex)
{
Log.WriteError(String.Format("'{0}' LogOffRdsUser", ProviderSettings.ProviderName), ex);
throw;
}
}
}
}

View file

@ -150,4 +150,5 @@
<Control key="rds_application_edit_users" general_key="rds_collections" />
<Control key="rds_edit_collection" general_key="rds_collections" />
<Control key="rds_edit_collection_settings" general_key="rds_collections" />
<Control key="rds_collection_user_sessions" general_key="rds_collections" />
</Controls>

View file

@ -581,6 +581,7 @@
<Control key="rds_application_edit_users" src="WebsitePanel/RDS/RDSEditApplicationUsers.ascx" title="RDSEditApplicationUsers" type="View" />
<Control key="rds_edit_collection" src="WebsitePanel/RDS/RDSEditCollection.ascx" title="RDSEditCollection" type="View" />
<Control key="rds_edit_collection_settings" src="WebsitePanel/RDS/RDSEditCollectionSettings.ascx" title="RDSEditCollectionSettings" type="View" />
<Control key="rds_collection_user_sessions" src="WebsitePanel/RDS/RDSUserSessions.ascx" title="RDSUserSessions" type="View" />
</Controls>
</ModuleDefinition>

View file

@ -5335,6 +5335,9 @@
<data name="Success.EXCHANGE_UPDATEPLANS" xml:space="preserve">
<value>Mailbox plan updated</value>
</data>
<data name="Success.EXCHANGE_SET_DEFAULT_MAILBOXPLAN" xml:space="preserve">
<value>Succesfully set default mailbox plan.</value>
</data>
<data name="Error.LYNC_UPDATEPLANS" xml:space="preserve">
<value>Lync plan update failed</value>
</data>
@ -5641,4 +5644,10 @@
<data name="ERROR.RDSCOLLECTIONSETTINGS_NOT_UPDATES" xml:space="preserve">
<value>RDS Collection settings not updated</value>
</data>
<data name="ERROR.REMOTE_DESKTOP_SERVICES_LOG_OFF_USER" xml:space="preserve">
<value>RDS User logging off error</value>
</data>
<data name="ERROR.REMOTE_DESKTOP_SERVICES_USER_SESSIONS" xml:space="preserve">
<value>GEtting RDS User sessions error</value>
</data>
</root>

View file

@ -249,4 +249,7 @@
<data name="secRetentionPolicy.Text" xml:space="preserve">
<value>Retention policy</value>
</data>
<data name="lblDefaultMailboxPlan.Text" xml:space="preserve">
<value>Default</value>
</data>
</root>

View file

@ -0,0 +1,153 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="gvHostServer.HeaderText" xml:space="preserve">
<value>Host Server</value>
</data>
<data name="gvRDSUserSessions.Empty" xml:space="preserve">
<value>No user sessions.</value>
</data>
<data name="gvSessionState.HeaderText" xml:space="preserve">
<value>Session State</value>
</data>
<data name="gvUserName.HeaderText" xml:space="preserve">
<value>User Name</value>
</data>
<data name="locTitle" xml:space="preserve">
<value>Edit RDS Collection</value>
</data>
<data name="secRdsUserSessions" xml:space="preserve">
<value>RDS User Sessions</value>
</data>
<data name="Text.PageName" xml:space="preserve">
<value>RDS User Sessions</value>
</data>
<data name="cmdLogOff.OnClientClick" xml:space="preserve">
<value>if(!confirm('Are you sure you want to log off user?')) return false; else ShowProgressDialog('Logging off user...');</value>
</data>
<data name="cmdLogOff.Text" xml:space="preserve">
<value>Log Off</value>
</data>
<data name="cmdLogOff.ToolTip" xml:space="preserve">
<value>Log Off</value>
</data>
<data name="btnRefresh.Text" xml:space="preserve">
<value>Refresh</value>
</data>
</root>

View file

@ -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" %>
<script type="text/javascript" src="/JavaScript/jquery.min.js?v=1.4.4"></script>
<wsp:EnableAsyncTasksSupport id="asyncTasks" runat="server"/>
<div id="ExchangeContainer">
<div class="Module">
<div class="Left">
</div>
<div class="Content">
<div class="Center">
<div class="Title">
<asp:Image ID="imgEditRDSCollection" SkinID="EnterpriseStorageSpace48" runat="server" />
<asp:Localize ID="locTitle" runat="server" meta:resourcekey="locTitle" Text="Edit RDS Collection"></asp:Localize>
-
<asp:Literal ID="litCollectionName" runat="server" Text="" />
</div>
<div class="FormBody">
<wsp:CollectionTabs id="tabs" runat="server" SelectedTab="rds_collection_user_sessions" />
<wsp:SimpleMessageBox id="messageBox" runat="server" />
<asp:UpdatePanel ID="RDAppsUpdatePanel" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
<ContentTemplate>
<div class="FormButtonsBarCleanRight">
<div class="FormButtonsBarClean">
<asp:Button ID="btnRefresh" runat="server" Text="Refresh" CssClass="Button1" OnClick="btnRefresh_Click" OnClientClick="ShowProgressDialog('Loading'); return true;" meta:resourcekey="btnRefresh" />
</div>
</div>
<wsp:CollapsiblePanel id="secRdsUserSessions" runat="server"
TargetControlID="panelRdsUserSessions" meta:resourcekey="secRdsUserSessions" Text="">
</wsp:CollapsiblePanel>
<asp:Panel runat="server" ID="panelRdsUserSessions">
<div style="padding: 10px;">
<asp:GridView ID="gvRDSUserSessions" runat="server" AutoGenerateColumns="False" EnableViewState="true"
Width="100%" EmptyDataText="gvRDSUserSessions" CssSelectorClass="NormalGridView"
OnRowCommand="gvRDSCollections_RowCommand" AllowPaging="True" AllowSorting="True">
<Columns>
<asp:TemplateField meta:resourcekey="gvUserName" HeaderText="gvUserName">
<ItemStyle Width="30%" Wrap="false"/>
<ItemTemplate>
<asp:Literal ID="litUserName" runat="server" Text='<%# string.Format("{0}\\{1}", Eval("DomainName"), Eval("UserName")) %>'/>
<asp:HiddenField ID="hfUnifiedSessionId" runat="server" Value='<%# Eval("UnifiedSessionId") %>'/>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField meta:resourcekey="gvHostServer" HeaderText="gvHostServer">
<ItemStyle Width="30%" Wrap="false"/>
<ItemTemplate>
<asp:Literal ID="litHostServer" runat="server" Text='<%# Eval("HostServer") %>'/>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField meta:resourcekey="gvSessionState" HeaderText="gvSessionState">
<ItemStyle Width="30%" Wrap="false"/>
<ItemTemplate>
<asp:Literal ID="litSessionState" runat="server" Text='<%# Eval("SessionState") %>'/>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton ID="lnkLogOff" runat="server" Text="Log Off" CommandName="LogOff" CommandArgument='<%# Eval("UnifiedSessionId") + ";" + Eval("HostServer") %>'
meta:resourcekey="cmdLogOff" OnClientClick="return confirm('Are you sure you want to log off selected user?')"></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</asp:Panel>
<div class="FormFooterClean">
<wsp:ItemButtonPanel id="buttonPanel" runat="server" ValidationGroup="SaveRDSCollection"
OnSaveClick="btnSave_Click" OnSaveExitClick="btnSaveExit_Click" />
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</div>
</div>
</div>
</div>

View file

@ -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<RdsUserSession>();
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();
}
}
}

View file

@ -0,0 +1,123 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WebsitePanel.Portal.RDS {
public partial class RDSUserSessions {
/// <summary>
/// asyncTasks control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks;
/// <summary>
/// imgEditRDSCollection control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Image imgEditRDSCollection;
/// <summary>
/// locTitle control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locTitle;
/// <summary>
/// litCollectionName control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal litCollectionName;
/// <summary>
/// tabs control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.RDS.UserControls.RdsServerTabs tabs;
/// <summary>
/// messageBox control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox;
/// <summary>
/// RDAppsUpdatePanel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.UpdatePanel RDAppsUpdatePanel;
/// <summary>
/// btnRefresh control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnRefresh;
/// <summary>
/// secRdsUserSessions control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.CollapsiblePanel secRdsUserSessions;
/// <summary>
/// panelRdsUserSessions control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Panel panelRdsUserSessions;
/// <summary>
/// gvRDSUserSessions control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.GridView gvRDSUserSessions;
/// <summary>
/// buttonPanel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ItemButtonPanel buttonPanel;
}
}

View file

@ -129,4 +129,7 @@
<data name="Tab.Settings" xml:space="preserve">
<value>Settings</value>
</data>
<data name="Tab.UserSessions" xml:space="preserve">
<value>User Sessions</value>
</data>
</root>

View file

@ -5,7 +5,7 @@
<ContentTemplate>
<div class="FormButtonsBarClean">
<asp:Button ID="btnAdd" runat="server" Text="Add..." CssClass="Button1" OnClick="btnAdd_Click" meta:resourcekey="btnAdd" />
<asp:Button ID="btnDelete" runat="server" Text="Delete" CssClass="Button1" OnClick="btnDelete_Click" meta:resourcekey="btnDelete"/>
<asp:Button ID="btnDelete" runat="server" Text="Delete" CssClass="Button1" OnClick="btnDelete_Click" meta:resourcekey="btnDelete"/>
</div>
<asp:GridView ID="gvApps" runat="server" meta:resourcekey="gvApps" AutoGenerateColumns="False"
Width="600px" CssSelectorClass="NormalGridView"
@ -26,6 +26,7 @@
<ItemTemplate>
<asp:Literal ID="litDisplayName" runat="server" Text='<%# Eval("DisplayName") %>'></asp:Literal>
<asp:HiddenField ID="hfFilePath" runat="server" Value='<%# Eval("FilePath") %>'/>
<asp:HiddenField ID="hfRequiredCommandLine" runat="server" Value='<%# Eval("RequiredCommandLine") %>'/>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
@ -74,6 +75,7 @@
<ItemTemplate>
<asp:Literal ID="litName" runat="server" Text='<%# Eval("DisplayName") %>'></asp:Literal>
<asp:HiddenField ID="hfFilePathPopup" runat="server" Value='<%# Eval("FilePath") %>'/>
<asp:HiddenField ID="hfRequiredCommandLinePopup" runat="server" Value='<%# Eval("RequiredCommandLine") %>'/>
</ItemTemplate>
</asp:TemplateField>
</Columns>

View file

@ -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<RemoteApplication> 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<StartMenuApp> 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<RemoteApplication> apps = new List<RemoteApplication>();
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
});
}
}

View file

@ -5,13 +5,13 @@
<asp:DataList ID="rdsTabs" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow" EnableViewState="false">
<ItemStyle Wrap="False" />
<ItemTemplate >
<asp:HyperLink ID="lnkTab" runat="server" CssClass="Tab" NavigateUrl='<%# Eval("Url") %>' OnClientClick="ShowProgressDialog('Adding server...'); return false;">
<asp:HyperLink ID="lnkTab" runat="server" CssClass="Tab" NavigateUrl='<%# Eval("Url") %>' OnClick="return tabClicked();">
<%# Eval("Name") %>
</asp:HyperLink>
</ItemTemplate>
<SelectedItemStyle Wrap="False" />
<SelectedItemTemplate>
<asp:HyperLink ID="lnkSelTab" runat="server" CssClass="ActiveTab" NavigateUrl='<%# Eval("Url") %>' OnClientClick="ShowProgressDialog('Adding server...'); return false;">
<asp:HyperLink ID="lnkSelTab" runat="server" CssClass="ActiveTab" NavigateUrl='<%# Eval("Url") %>' OnClick="return tabClicked;">
<%# Eval("Name") %>
</asp:HyperLink>
</SelectedItemTemplate>
@ -19,4 +19,12 @@
</td>
</tr>
</table>
<br />
<br />
<script type="text/javascript">
function tabClicked() {
ShowProgressDialog('Loading');
ShowProgressDialogInternal();
return true;
}
</script>

View file

@ -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;

View file

@ -21,7 +21,7 @@
<ItemStyle Width="10px" />
</asp:TemplateField>
<asp:TemplateField meta:resourcekey="gvUsersAccount" HeaderText="gvUsersAccount">
<ItemStyle Width="60%" Wrap="false">
<ItemStyle Width="96%" Wrap="false" HorizontalAlign="Left">
</ItemStyle>
<ItemTemplate>
<asp:Literal ID="litAccount" runat="server" Text='<%# Eval("DisplayName") %>'></asp:Literal>
@ -75,14 +75,14 @@
<ItemStyle Width="10px" />
</asp:TemplateField>
<asp:TemplateField meta:resourcekey="gvAccountsDisplayName">
<ItemStyle Width="50%"></ItemStyle>
<ItemStyle Width="50%" HorizontalAlign="Left"></ItemStyle>
<ItemTemplate>
<asp:Image ID="imgAccount" runat="server" ImageUrl='<%# GetAccountImage((int)Eval("AccountType")) %>' ImageAlign="AbsMiddle" />
<asp:Literal ID="litDisplayName" runat="server" Text='<%# Eval("DisplayName") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField meta:resourcekey="gvAccountsEmail">
<ItemStyle Width="50%"></ItemStyle>
<ItemStyle Width="50%" HorizontalAlign="Left"></ItemStyle>
<ItemTemplate>
<asp:Literal ID="litPrimaryEmailAddress" runat="server" Text='<%# Eval("PrimaryEmailAddress") %>'></asp:Literal>
</ItemTemplate>

View file

@ -28,6 +28,15 @@
<asp:Label id="lnkDisplayMailboxPlan" runat="server" EnableViewState="true" ><%# PortalAntiXSS.Encode((string)Eval("MailboxPlan"))%></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField >
<ItemStyle Width="15%"></ItemStyle>
<ItemTemplate>
&nbsp;<label>
<input type="radio" name="DefaultMailboxPlan" value='<%# Eval("MailboxPlanId") %>' <%# IsChecked((bool) Eval("IsDefault")) %>/>
<asp:Label runat="server" meta:resourcekey="lblDefaultMailboxPlan" Text="Default"></asp:Label>
</label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
&nbsp;<asp:ImageButton id="imgDelMailboxPlan" runat="server" Text="Delete" SkinID="ExchangeDelete"
@ -52,7 +61,11 @@
</Columns>
</asp:GridView>
<br />
<br />
<div style="text-align: center">
<asp:Button ID="btnSetDefaultMailboxPlan" runat="server" meta:resourcekey="btnSetDefaultMailboxPlan"
Text="Set Default Mailboxplan" CssClass="Button1" OnClick="btnSetDefaultMailboxPlan_Click" />
</div>
<wsp:CollapsiblePanel id="secMailboxPlan" runat="server"
TargetControlID="MailboxPlan" meta:resourcekey="secMailboxPlan" Text="Mailboxplan">
</wsp:CollapsiblePanel>

View file

@ -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<ExchangeMailboxPlanRetentionPolicyTag> selectedTags = ViewState["Tags"] as List<ExchangeMailboxPlanRetentionPolicyTag>;
if ((orgs != null) & (orgs.GetLength(0) > 0))
{
Providers.HostedSolution.ExchangeRetentionPolicyTag[] allTags = ES.Services.ExchangeServer.GetExchangeRetentionPolicyTags(orgs[0].Id);
List<ExchangeMailboxPlanRetentionPolicyTag> selectedTags = ViewState["Tags"] as List<ExchangeMailboxPlanRetentionPolicyTag>;
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" : "";
}
}
}

View file

@ -35,11 +35,13 @@
// </auto-generated>
//------------------------------------------------------------------------------
namespace WebsitePanel.Portal {
public partial class SettingsExchangeMailboxPlansPolicy {
namespace WebsitePanel.Portal
{
public partial class SettingsExchangeMailboxPlansPolicy
{
/// <summary>
/// asyncTasks control.
/// </summary>
@ -48,7 +50,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks;
/// <summary>
/// messageBox control.
/// </summary>
@ -57,7 +59,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox;
/// <summary>
/// gvMailboxPlans control.
/// </summary>
@ -66,7 +68,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.GridView gvMailboxPlans;
/// <summary>
/// secMailboxPlan control.
/// </summary>
@ -75,7 +77,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.CollapsiblePanel secMailboxPlan;
/// <summary>
/// MailboxPlan control.
/// </summary>
@ -84,7 +86,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Panel MailboxPlan;
/// <summary>
/// txtMailboxPlan control.
/// </summary>
@ -93,7 +95,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtMailboxPlan;
/// <summary>
/// valRequireMailboxPlan control.
/// </summary>
@ -102,7 +104,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireMailboxPlan;
/// <summary>
/// secMailboxFeatures control.
/// </summary>
@ -111,7 +113,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.CollapsiblePanel secMailboxFeatures;
/// <summary>
/// MailboxFeatures control.
/// </summary>
@ -120,7 +122,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Panel MailboxFeatures;
/// <summary>
/// chkPOP3 control.
/// </summary>
@ -129,7 +131,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.CheckBox chkPOP3;
/// <summary>
/// chkIMAP control.
/// </summary>
@ -138,7 +140,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.CheckBox chkIMAP;
/// <summary>
/// chkOWA control.
/// </summary>
@ -147,7 +149,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.CheckBox chkOWA;
/// <summary>
/// chkMAPI control.
/// </summary>
@ -156,7 +158,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.CheckBox chkMAPI;
/// <summary>
/// chkActiveSync control.
/// </summary>
@ -165,7 +167,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.CheckBox chkActiveSync;
/// <summary>
/// secMailboxGeneral control.
/// </summary>
@ -174,7 +176,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.CollapsiblePanel secMailboxGeneral;
/// <summary>
/// MailboxGeneral control.
/// </summary>
@ -183,7 +185,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Panel MailboxGeneral;
/// <summary>
/// chkHideFromAddressBook control.
/// </summary>
@ -192,7 +194,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.CheckBox chkHideFromAddressBook;
/// <summary>
/// secStorageQuotas control.
/// </summary>
@ -201,7 +203,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.CollapsiblePanel secStorageQuotas;
/// <summary>
/// StorageQuotas control.
/// </summary>
@ -210,7 +212,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Panel StorageQuotas;
/// <summary>
/// locMailboxSize control.
/// </summary>
@ -219,7 +221,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locMailboxSize;
/// <summary>
/// mailboxSize control.
/// </summary>
@ -228,7 +230,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.QuotaEditor mailboxSize;
/// <summary>
/// locMaxRecipients control.
/// </summary>
@ -237,7 +239,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locMaxRecipients;
/// <summary>
/// maxRecipients control.
/// </summary>
@ -246,7 +248,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.QuotaEditor maxRecipients;
/// <summary>
/// locMaxSendMessageSizeKB control.
/// </summary>
@ -255,7 +257,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locMaxSendMessageSizeKB;
/// <summary>
/// maxSendMessageSizeKB control.
/// </summary>
@ -264,7 +266,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.QuotaEditor maxSendMessageSizeKB;
/// <summary>
/// locMaxReceiveMessageSizeKB control.
/// </summary>
@ -273,7 +275,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locMaxReceiveMessageSizeKB;
/// <summary>
/// maxReceiveMessageSizeKB control.
/// </summary>
@ -282,7 +284,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.QuotaEditor maxReceiveMessageSizeKB;
/// <summary>
/// locWhenSizeExceeds control.
/// </summary>
@ -291,7 +293,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locWhenSizeExceeds;
/// <summary>
/// locIssueWarning control.
/// </summary>
@ -300,7 +302,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locIssueWarning;
/// <summary>
/// sizeIssueWarning control.
/// </summary>
@ -309,7 +311,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.SizeBox sizeIssueWarning;
/// <summary>
/// locProhibitSend control.
/// </summary>
@ -318,7 +320,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locProhibitSend;
/// <summary>
/// sizeProhibitSend control.
/// </summary>
@ -327,7 +329,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.SizeBox sizeProhibitSend;
/// <summary>
/// locProhibitSendReceive control.
/// </summary>
@ -336,7 +338,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locProhibitSendReceive;
/// <summary>
/// sizeProhibitSendReceive control.
/// </summary>
@ -345,7 +347,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.SizeBox sizeProhibitSendReceive;
/// <summary>
/// secDeleteRetention control.
/// </summary>
@ -354,7 +356,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.CollapsiblePanel secDeleteRetention;
/// <summary>
/// DeleteRetention control.
/// </summary>
@ -363,7 +365,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Panel DeleteRetention;
/// <summary>
/// locKeepDeletedItems control.
/// </summary>
@ -372,7 +374,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locKeepDeletedItems;
/// <summary>
/// daysKeepDeletedItems control.
/// </summary>
@ -381,7 +383,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.DaysBox daysKeepDeletedItems;
/// <summary>
/// secLitigationHold control.
/// </summary>
@ -390,7 +392,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.CollapsiblePanel secLitigationHold;
/// <summary>
/// LitigationHold control.
/// </summary>
@ -399,7 +401,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Panel LitigationHold;
/// <summary>
/// chkEnableLitigationHold control.
/// </summary>
@ -408,7 +410,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.CheckBox chkEnableLitigationHold;
/// <summary>
/// locRecoverableItemsSpace control.
/// </summary>
@ -417,7 +419,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locRecoverableItemsSpace;
/// <summary>
/// recoverableItemsSpace control.
/// </summary>
@ -426,7 +428,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.QuotaEditor recoverableItemsSpace;
/// <summary>
/// locRecoverableItemsWarning control.
/// </summary>
@ -435,7 +437,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locRecoverableItemsWarning;
/// <summary>
/// recoverableItemsWarning control.
/// </summary>
@ -444,7 +446,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.SizeBox recoverableItemsWarning;
/// <summary>
/// lblLitigationHoldUrl control.
/// </summary>
@ -453,7 +455,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblLitigationHoldUrl;
/// <summary>
/// txtLitigationHoldUrl control.
/// </summary>
@ -462,7 +464,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtLitigationHoldUrl;
/// <summary>
/// lblLitigationHoldMsg control.
/// </summary>
@ -471,7 +473,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblLitigationHoldMsg;
/// <summary>
/// txtLitigationHoldMsg control.
/// </summary>
@ -480,7 +482,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtLitigationHoldMsg;
/// <summary>
/// secArchiving control.
/// </summary>
@ -489,7 +491,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.CollapsiblePanel secArchiving;
/// <summary>
/// Archiving control.
/// </summary>
@ -498,7 +500,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Panel Archiving;
/// <summary>
/// chkEnableArchiving control.
/// </summary>
@ -507,7 +509,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.CheckBox chkEnableArchiving;
/// <summary>
/// locArchiveQuota control.
/// </summary>
@ -516,7 +518,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locArchiveQuota;
/// <summary>
/// archiveQuota control.
/// </summary>
@ -525,7 +527,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.QuotaEditor archiveQuota;
/// <summary>
/// locArchiveWarningQuota control.
/// </summary>
@ -534,7 +536,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locArchiveWarningQuota;
/// <summary>
/// archiveWarningQuota control.
/// </summary>
@ -543,7 +545,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.SizeBox archiveWarningQuota;
/// <summary>
/// secRetentionPolicyTags control.
/// </summary>
@ -552,7 +554,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.CollapsiblePanel secRetentionPolicyTags;
/// <summary>
/// RetentionPolicyTags control.
/// </summary>
@ -561,7 +563,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Panel RetentionPolicyTags;
/// <summary>
/// GeneralUpdatePanel control.
/// </summary>
@ -570,7 +572,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.UpdatePanel GeneralUpdatePanel;
/// <summary>
/// gvPolicy control.
/// </summary>
@ -579,7 +581,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.GridView gvPolicy;
/// <summary>
/// ddTags control.
/// </summary>
@ -588,7 +590,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.DropDownList ddTags;
/// <summary>
/// bntAddTag control.
/// </summary>
@ -597,7 +599,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button bntAddTag;
/// <summary>
/// btnAddMailboxPlan control.
/// </summary>
@ -606,7 +608,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnAddMailboxPlan;
/// <summary>
/// btnUpdateMailboxPlan control.
/// </summary>
@ -615,7 +617,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnUpdateMailboxPlan;
/// <summary>
/// txtStatus control.
/// </summary>
@ -624,5 +626,7 @@ namespace WebsitePanel.Portal {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtStatus;
protected global::System.Web.UI.WebControls.Button btnSetDefaultMailboxPlan;
}
}

View file

@ -546,7 +546,7 @@ namespace WebsitePanel.Portal
WDeployPublishingConfirmPasswordTextBox,
WDeployPublishingAccountRequiredFieldValidator);
WDeployPublishingAccountTextBox.Text = AutoSuggestWmSvcAccontName(item, "_deploy");
WDeployPublishingAccountTextBox.Text = AutoSuggestWmSvcAccontName(item, "_dploy");
//
WDeployPublishingAccountRequiredFieldValidator.Enabled = true;
//

View file

@ -330,6 +330,13 @@
<Compile Include="RDS\RDSCollections.ascx.designer.cs">
<DependentUpon>RDSCollections.ascx</DependentUpon>
</Compile>
<Compile Include="RDS\RDSUserSessions.ascx.cs">
<DependentUpon>RDSUserSessions.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="RDS\RDSUserSessions.ascx.designer.cs">
<DependentUpon>RDSUserSessions.ascx</DependentUpon>
</Compile>
<Compile Include="RDS\UserControls\RDSCollectionApps.ascx.cs">
<DependentUpon>RDSCollectionApps.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@ -4365,6 +4372,7 @@
<Content Include="RDS\RDSEditCollectionUsers.ascx" />
<Content Include="RDS\RDSCreateCollection.ascx" />
<Content Include="RDS\RDSCollections.ascx" />
<Content Include="RDS\RDSUserSessions.ascx" />
<Content Include="RDS\UserControls\RDSCollectionApps.ascx" />
<Content Include="RDS\UserControls\RDSCollectionServers.ascx" />
<Content Include="RDS\UserControls\RDSCollectionUsers.ascx" />
@ -4386,6 +4394,7 @@
<Content Include="RDS\UserControls\App_LocalResources\RDSCollectionTabs.ascx.resx">
<SubType>Designer</SubType>
</Content>
<Content Include="RDS\App_LocalResources\RDSUserSessions.ascx.resx" />
<EmbeddedResource Include="ScheduleTaskControls\App_LocalResources\DomainLookupView.ascx.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>DomainLookupView.ascx.Designer.cs</LastGenOutput>
@ -5702,7 +5711,9 @@
<Content Include="RDS\App_LocalResources\RDSEditCollectionUsers.ascx.resx">
<SubType>Designer</SubType>
</Content>
<Content Include="RDS\App_LocalResources\RDSEditCollectionApps.ascx.resx" />
<Content Include="RDS\App_LocalResources\RDSEditCollectionApps.ascx.resx">
<SubType>Designer</SubType>
</Content>
<Content Include="RDS\UserControls\App_LocalResources\RDSCollectionUsers.ascx.resx" />
<Content Include="RDS\UserControls\App_LocalResources\RDSCollectionServers.ascx.resx" />
<Content Include="RDS\UserControls\App_LocalResources\RDSCollectionApps.ascx.resx" />