From 82e7d0eb25bd7c7f233f645687bb322b7b6caa30 Mon Sep 17 00:00:00 2001
From: vfedosevich
Date: Fri, 8 May 2015 04:57:15 -0700
Subject: [PATCH 01/22] password request added
---
WebsitePanel/Database/update_db.sql | 126 ++++++
.../Users/UserSettings.cs | 1 +
.../OrganizationProxy.cs | 386 ++++++++++++------
.../SystemProxy.cs | 69 ++++
.../HostedSolution/OrganizationController.cs | 96 ++++-
.../System/SystemController.cs | 10 +
.../esOrganizations.asmx.cs | 12 +
.../esSystem.asmx.cs | 6 +
.../Resources/UI.Designer.cs | 6 +-
.../Resources/UI.resx | 4 +-
.../Views/Account/UserProfile.cshtml | 2 +-
...ettingsUserPasswordRequestLetter.ascx.resx | 162 ++++++++
.../UserAccountMailTemplateSettings.ascx.resx | 3 +
.../ExchangeServer/ExchangeCreateMailbox.ascx | 6 +
.../ExchangeCreateMailbox.ascx.cs | 19 +-
.../ExchangeCreateMailbox.ascx.designer.cs | 9 +
.../OrganizationCreateUser.ascx | 192 +++++----
.../OrganizationCreateUser.ascx.cs | 19 +-
.../OrganizationCreateUser.ascx.designer.cs | 18 +
.../SettingsUserPasswordRequestLetter.ascx | 55 +++
.../SettingsUserPasswordRequestLetter.ascx.cs | 37 ++
...UserPasswordRequestLetter.ascx.designer.cs | 141 +++++++
.../UserAccountMailTemplateSettings.ascx | 4 +
...countMailTemplateSettings.ascx.designer.cs | 9 +
.../SendToControl.ascx.resx | 150 +++++++
.../UserControls/SendToControl.ascx | 52 +++
.../UserControls/SendToControl.ascx.cs | 79 ++++
.../SendToControl.ascx.designer.cs | 159 ++++++++
.../WebsitePanel.Portal.Modules.csproj | 20 +
29 files changed, 1629 insertions(+), 223 deletions(-)
create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SettingsUserPasswordRequestLetter.ascx.resx
create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordRequestLetter.ascx
create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordRequestLetter.ascx.cs
create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordRequestLetter.ascx.designer.cs
create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/App_LocalResources/SendToControl.ascx.resx
create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SendToControl.ascx
create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SendToControl.ascx.cs
create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SendToControl.ascx.designer.cs
diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql
index 5126597e..4e966cf4 100644
--- a/WebsitePanel/Database/update_db.sql
+++ b/WebsitePanel/Database/update_db.sql
@@ -10176,6 +10176,132 @@ ELSE
UPDATE [dbo].[UserSettings] SET [PropertyValue] = @UserPasswordPincodeSMSBody WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetPincodeLetter' AND [PropertyName]= N'PasswordResetPincodeSmsBody'
GO
+
+-- USER PASSWORD REQUEST EMAIL TEMPLATE
+
+IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'OrganizationUserPasswordRequestLetter' AND [PropertyName]= N'From' )
+BEGIN
+INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'OrganizationUserPasswordRequestLetter', N'From', N'support@HostingCompany.com')
+END
+GO
+
+DECLARE @OrganizationUserPasswordRequestLetterHtmlBody nvarchar(2500)
+
+Set @OrganizationUserPasswordRequestLetterHtmlBody = N'
+
+ Password request notification
+
+
+
+
+
+
Password request notification
+
+
+
+Hello #user.FirstName#,
+
+
+
+
+Your account have been created. In order to create a password for your account, please follow next link:
+
+
+
#passwordResetLink#
+
+
+If you have any questions regarding your hosting account, feel free to contact our support department at any time.
+
+
+
+Best regards
+
+
+';
+
+IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'OrganizationUserPasswordRequestLetter' AND [PropertyName]= N'HtmlBody' )
+BEGIN
+INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'OrganizationUserPasswordRequestLetter', N'HtmlBody', @OrganizationUserPasswordRequestLetterHtmlBody)
+END
+ELSE
+UPDATE [dbo].[UserSettings] SET [PropertyValue] = @OrganizationUserPasswordRequestLetterHtmlBody WHERE [UserID] = 1 AND [SettingsName]= N'OrganizationUserPasswordRequestLetter' AND [PropertyName]= N'HtmlBody'
+GO
+
+
+IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'OrganizationUserPasswordRequestLetter' AND [PropertyName]= N'Priority' )
+BEGIN
+INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'OrganizationUserPasswordRequestLetter', N'Priority', N'Normal')
+END
+GO
+IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'OrganizationUserPasswordRequestLetter' AND [PropertyName]= N'Subject' )
+BEGIN
+INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'OrganizationUserPasswordRequestLetter', N'Subject', N'Password request notification')
+END
+GO
+IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'OrganizationUserPasswordRequestLetter' AND [PropertyName]= N'LogoUrl' )
+BEGIN
+INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'OrganizationUserPasswordRequestLetter', N'LogoUrl', N'https://controlpanel.virtuworks.net/App_Themes/Default/Images/logo.png')
+END
+GO
+
+
+DECLARE @OrganizationUserPasswordRequestLetterTextBody nvarchar(2500)
+
+Set @OrganizationUserPasswordRequestLetterTextBody = N'=========================================
+ Password request notification
+=========================================
+
+
+Hello #user.FirstName#,
+
+
+Your account have been created. In order to create a password for your account, please follow next link:
+
+#passwordResetLink#
+
+If you have any questions regarding your hosting account, feel free to contact our support department at any time.
+
+Best regards'
+
+IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'OrganizationUserPasswordRequestLetter' AND [PropertyName]= N'TextBody' )
+BEGIN
+INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'OrganizationUserPasswordRequestLetter', N'TextBody', @OrganizationUserPasswordRequestLetterTextBody)
+END
+ELSE
+UPDATE [dbo].[UserSettings] SET [PropertyValue] = @OrganizationUserPasswordRequestLetterTextBody WHERE [UserID] = 1 AND [SettingsName]= N'OrganizationUserPasswordRequestLetter' AND [PropertyName]= N'TextBody'
+GO
+
+DECLARE @OrganizationUserPasswordRequestLetterSMSBody nvarchar(2500)
+
+Set @OrganizationUserPasswordRequestLetterSMSBody = N'
+User have been created. Password request url:
+#passwordResetLink#'
+
+IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'OrganizationUserPasswordRequestLetter' AND [PropertyName]= N'SMSBody' )
+BEGIN
+INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'OrganizationUserPasswordRequestLetter', N'SMSBody', @OrganizationUserPasswordRequestLetterSMSBody)
+END
+ELSE
+UPDATE [dbo].[UserSettings] SET [PropertyValue] = @OrganizationUserPasswordRequestLetterSMSBody WHERE [UserID] = 1 AND [SettingsName]= N'OrganizationUserPasswordRequestLetter' AND [PropertyName]= N'SMSBody'
+GO
+
+
+
-- Exchange setup EMAIL TEMPLATE
diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Users/UserSettings.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Users/UserSettings.cs
index aeaff4d3..c4d011eb 100644
--- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Users/UserSettings.cs
+++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Users/UserSettings.cs
@@ -67,6 +67,7 @@ namespace WebsitePanel.EnterpriseServer
public const string RDS_POLICY = "RdsPolicy";
public const string USER_PASSWORD_EXPIRATION_LETTER = "UserPasswordExpirationLetter";
public const string USER_PASSWORD_RESET_LETTER = "UserPasswordResetLetter";
+ public const string USER_PASSWORD_REQUEST_LETTER = "OrganizationUserPasswordRequestLetter";
public const string USER_PASSWORD_RESET_PINCODE_LETTER = "UserPasswordResetPincodeLetter";
public const string HOSTED_ORGANIZATION_PASSWORD_POLICY = "MailboxPasswordPolicy";
diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs
index 3d729acc..33f50dec 100644
--- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs
+++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs
@@ -12,7 +12,6 @@
// This source code was auto-generated by wsdl, Version=2.0.50727.3038.
//
-
using WebsitePanel.EnterpriseServer.Base.HostedSolution;
using WebsitePanel.Providers;
using WebsitePanel.Providers.Common;
@@ -37,6 +36,10 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution {
[System.Xml.Serialization.XmlIncludeAttribute(typeof(ServiceProviderItem))]
public partial class esOrganizations : Microsoft.Web.Services3.WebServicesClientProtocol {
+ private System.Threading.SendOrPostCallback UpdateSupportServiceLevelOperationCompleted;
+
+ private System.Threading.SendOrPostCallback DeleteSupportServiceLevelOperationCompleted;
+
private System.Threading.SendOrPostCallback AddSupportServiceLevelOperationCompleted;
private System.Threading.SendOrPostCallback GetSupportServiceLevelOperationCompleted;
@@ -93,6 +96,10 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution {
private System.Threading.SendOrPostCallback SendResetUserPasswordPincodeEmailOperationCompleted;
+ private System.Threading.SendOrPostCallback SendUserPasswordRequestSmsOperationCompleted;
+
+ private System.Threading.SendOrPostCallback SendUserPasswordRequestEmailOperationCompleted;
+
private System.Threading.SendOrPostCallback AddOrganizationDomainOperationCompleted;
private System.Threading.SendOrPostCallback ChangeOrganizationDomainTypeOperationCompleted;
@@ -165,15 +172,17 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution {
private System.Threading.SendOrPostCallback GetSupportServiceLevelsOperationCompleted;
- private System.Threading.SendOrPostCallback UpdateSupportServiceLevelOperationCompleted;
-
- private System.Threading.SendOrPostCallback DeleteSupportServiceLevelOperationCompleted;
-
///
public esOrganizations() {
this.Url = "http://localhost:9002/esOrganizations.asmx";
}
+ ///
+ public event UpdateSupportServiceLevelCompletedEventHandler UpdateSupportServiceLevelCompleted;
+
+ ///
+ public event DeleteSupportServiceLevelCompletedEventHandler DeleteSupportServiceLevelCompleted;
+
///
public event AddSupportServiceLevelCompletedEventHandler AddSupportServiceLevelCompleted;
@@ -258,6 +267,12 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution {
///
public event SendResetUserPasswordPincodeEmailCompletedEventHandler SendResetUserPasswordPincodeEmailCompleted;
+ ///
+ public event SendUserPasswordRequestSmsCompletedEventHandler SendUserPasswordRequestSmsCompleted;
+
+ ///
+ public event SendUserPasswordRequestEmailCompletedEventHandler SendUserPasswordRequestEmailCompleted;
+
///
public event AddOrganizationDomainCompletedEventHandler AddOrganizationDomainCompleted;
@@ -367,10 +382,90 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution {
public event GetSupportServiceLevelsCompletedEventHandler GetSupportServiceLevelsCompleted;
///
- public event UpdateSupportServiceLevelCompletedEventHandler UpdateSupportServiceLevelCompleted;
+ [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/UpdateSupportServiceLevel", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
+ public void UpdateSupportServiceLevel(int levelID, string levelName, string levelDescription) {
+ this.Invoke("UpdateSupportServiceLevel", new object[] {
+ levelID,
+ levelName,
+ levelDescription});
+ }
///
- public event DeleteSupportServiceLevelCompletedEventHandler DeleteSupportServiceLevelCompleted;
+ public System.IAsyncResult BeginUpdateSupportServiceLevel(int levelID, string levelName, string levelDescription, System.AsyncCallback callback, object asyncState) {
+ return this.BeginInvoke("UpdateSupportServiceLevel", new object[] {
+ levelID,
+ levelName,
+ levelDescription}, callback, asyncState);
+ }
+
+ ///
+ public void EndUpdateSupportServiceLevel(System.IAsyncResult asyncResult) {
+ this.EndInvoke(asyncResult);
+ }
+
+ ///
+ public void UpdateSupportServiceLevelAsync(int levelID, string levelName, string levelDescription) {
+ this.UpdateSupportServiceLevelAsync(levelID, levelName, levelDescription, null);
+ }
+
+ ///
+ public void UpdateSupportServiceLevelAsync(int levelID, string levelName, string levelDescription, object userState) {
+ if ((this.UpdateSupportServiceLevelOperationCompleted == null)) {
+ this.UpdateSupportServiceLevelOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateSupportServiceLevelOperationCompleted);
+ }
+ this.InvokeAsync("UpdateSupportServiceLevel", new object[] {
+ levelID,
+ levelName,
+ levelDescription}, this.UpdateSupportServiceLevelOperationCompleted, userState);
+ }
+
+ private void OnUpdateSupportServiceLevelOperationCompleted(object arg) {
+ if ((this.UpdateSupportServiceLevelCompleted != null)) {
+ System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
+ this.UpdateSupportServiceLevelCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
+ }
+ }
+
+ ///
+ [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteSupportServiceLevel", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
+ public ResultObject DeleteSupportServiceLevel(int levelId) {
+ object[] results = this.Invoke("DeleteSupportServiceLevel", new object[] {
+ levelId});
+ return ((ResultObject)(results[0]));
+ }
+
+ ///
+ public System.IAsyncResult BeginDeleteSupportServiceLevel(int levelId, System.AsyncCallback callback, object asyncState) {
+ return this.BeginInvoke("DeleteSupportServiceLevel", new object[] {
+ levelId}, callback, asyncState);
+ }
+
+ ///
+ public ResultObject EndDeleteSupportServiceLevel(System.IAsyncResult asyncResult) {
+ object[] results = this.EndInvoke(asyncResult);
+ return ((ResultObject)(results[0]));
+ }
+
+ ///
+ public void DeleteSupportServiceLevelAsync(int levelId) {
+ this.DeleteSupportServiceLevelAsync(levelId, null);
+ }
+
+ ///
+ public void DeleteSupportServiceLevelAsync(int levelId, object userState) {
+ if ((this.DeleteSupportServiceLevelOperationCompleted == null)) {
+ this.DeleteSupportServiceLevelOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteSupportServiceLevelOperationCompleted);
+ }
+ this.InvokeAsync("DeleteSupportServiceLevel", new object[] {
+ levelId}, this.DeleteSupportServiceLevelOperationCompleted, userState);
+ }
+
+ private void OnDeleteSupportServiceLevelOperationCompleted(object arg) {
+ if ((this.DeleteSupportServiceLevelCompleted != null)) {
+ System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
+ this.DeleteSupportServiceLevelCompleted(this, new DeleteSupportServiceLevelCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
+ }
+ }
///
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/AddSupportServiceLevel", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
@@ -1603,6 +1698,107 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution {
}
}
+ ///
+ [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SendUserPasswordRequestSms", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
+ public ResultObject SendUserPasswordRequestSms(int itemId, int accountId, string reason, string phoneTo) {
+ object[] results = this.Invoke("SendUserPasswordRequestSms", new object[] {
+ itemId,
+ accountId,
+ reason,
+ phoneTo});
+ return ((ResultObject)(results[0]));
+ }
+
+ ///
+ public System.IAsyncResult BeginSendUserPasswordRequestSms(int itemId, int accountId, string reason, string phoneTo, System.AsyncCallback callback, object asyncState) {
+ return this.BeginInvoke("SendUserPasswordRequestSms", new object[] {
+ itemId,
+ accountId,
+ reason,
+ phoneTo}, callback, asyncState);
+ }
+
+ ///
+ public ResultObject EndSendUserPasswordRequestSms(System.IAsyncResult asyncResult) {
+ object[] results = this.EndInvoke(asyncResult);
+ return ((ResultObject)(results[0]));
+ }
+
+ ///
+ public void SendUserPasswordRequestSmsAsync(int itemId, int accountId, string reason, string phoneTo) {
+ this.SendUserPasswordRequestSmsAsync(itemId, accountId, reason, phoneTo, null);
+ }
+
+ ///
+ public void SendUserPasswordRequestSmsAsync(int itemId, int accountId, string reason, string phoneTo, object userState) {
+ if ((this.SendUserPasswordRequestSmsOperationCompleted == null)) {
+ this.SendUserPasswordRequestSmsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSendUserPasswordRequestSmsOperationCompleted);
+ }
+ this.InvokeAsync("SendUserPasswordRequestSms", new object[] {
+ itemId,
+ accountId,
+ reason,
+ phoneTo}, this.SendUserPasswordRequestSmsOperationCompleted, userState);
+ }
+
+ private void OnSendUserPasswordRequestSmsOperationCompleted(object arg) {
+ if ((this.SendUserPasswordRequestSmsCompleted != null)) {
+ System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
+ this.SendUserPasswordRequestSmsCompleted(this, new SendUserPasswordRequestSmsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
+ }
+ }
+
+ ///
+ [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SendUserPasswordRequestEmail", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
+ public void SendUserPasswordRequestEmail(int itemId, int accountId, string reason, string mailTo, bool finalStep) {
+ this.Invoke("SendUserPasswordRequestEmail", new object[] {
+ itemId,
+ accountId,
+ reason,
+ mailTo,
+ finalStep});
+ }
+
+ ///
+ public System.IAsyncResult BeginSendUserPasswordRequestEmail(int itemId, int accountId, string reason, string mailTo, bool finalStep, System.AsyncCallback callback, object asyncState) {
+ return this.BeginInvoke("SendUserPasswordRequestEmail", new object[] {
+ itemId,
+ accountId,
+ reason,
+ mailTo,
+ finalStep}, callback, asyncState);
+ }
+
+ ///
+ public void EndSendUserPasswordRequestEmail(System.IAsyncResult asyncResult) {
+ this.EndInvoke(asyncResult);
+ }
+
+ ///
+ public void SendUserPasswordRequestEmailAsync(int itemId, int accountId, string reason, string mailTo, bool finalStep) {
+ this.SendUserPasswordRequestEmailAsync(itemId, accountId, reason, mailTo, finalStep, null);
+ }
+
+ ///
+ public void SendUserPasswordRequestEmailAsync(int itemId, int accountId, string reason, string mailTo, bool finalStep, object userState) {
+ if ((this.SendUserPasswordRequestEmailOperationCompleted == null)) {
+ this.SendUserPasswordRequestEmailOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSendUserPasswordRequestEmailOperationCompleted);
+ }
+ this.InvokeAsync("SendUserPasswordRequestEmail", new object[] {
+ itemId,
+ accountId,
+ reason,
+ mailTo,
+ finalStep}, this.SendUserPasswordRequestEmailOperationCompleted, userState);
+ }
+
+ private void OnSendUserPasswordRequestEmailOperationCompleted(object arg) {
+ if ((this.SendUserPasswordRequestEmailCompleted != null)) {
+ System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
+ this.SendUserPasswordRequestEmailCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
+ }
+ }
+
///
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/AddOrganizationDomain", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public int AddOrganizationDomain(int itemId, string domainName) {
@@ -3517,98 +3713,42 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution {
}
}
- ///
- [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/UpdateSupportServiceLevel", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
- public void UpdateSupportServiceLevel(int levelID, string levelName, string levelDescription) {
- this.Invoke("UpdateSupportServiceLevel", new object[] {
- levelID,
- levelName,
- levelDescription});
- }
-
- ///
- public System.IAsyncResult BeginUpdateSupportServiceLevel(int levelID, string levelName, string levelDescription, System.AsyncCallback callback, object asyncState) {
- return this.BeginInvoke("UpdateSupportServiceLevel", new object[] {
- levelID,
- levelName,
- levelDescription}, callback, asyncState);
- }
-
- ///
- public void EndUpdateSupportServiceLevel(System.IAsyncResult asyncResult) {
- this.EndInvoke(asyncResult);
- }
-
- ///
- public void UpdateSupportServiceLevelAsync(int levelID, string levelName, string levelDescription) {
- this.UpdateSupportServiceLevelAsync(levelID, levelName, levelDescription, null);
- }
-
- ///
- public void UpdateSupportServiceLevelAsync(int levelID, string levelName, string levelDescription, object userState) {
- if ((this.UpdateSupportServiceLevelOperationCompleted == null)) {
- this.UpdateSupportServiceLevelOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateSupportServiceLevelOperationCompleted);
- }
- this.InvokeAsync("UpdateSupportServiceLevel", new object[] {
- levelID,
- levelName,
- levelDescription}, this.UpdateSupportServiceLevelOperationCompleted, userState);
- }
-
- private void OnUpdateSupportServiceLevelOperationCompleted(object arg) {
- if ((this.UpdateSupportServiceLevelCompleted != null)) {
- System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
- this.UpdateSupportServiceLevelCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
- }
- }
-
- ///
- [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteSupportServiceLevel", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
- public ResultObject DeleteSupportServiceLevel(int levelId) {
- object[] results = this.Invoke("DeleteSupportServiceLevel", new object[] {
- levelId});
- return ((ResultObject)(results[0]));
- }
-
- ///
- public System.IAsyncResult BeginDeleteSupportServiceLevel(int levelId, System.AsyncCallback callback, object asyncState) {
- return this.BeginInvoke("DeleteSupportServiceLevel", new object[] {
- levelId}, callback, asyncState);
- }
-
- ///
- public ResultObject EndDeleteSupportServiceLevel(System.IAsyncResult asyncResult) {
- object[] results = this.EndInvoke(asyncResult);
- return ((ResultObject)(results[0]));
- }
-
- ///
- public void DeleteSupportServiceLevelAsync(int levelId) {
- this.DeleteSupportServiceLevelAsync(levelId, null);
- }
-
- ///
- public void DeleteSupportServiceLevelAsync(int levelId, object userState) {
- if ((this.DeleteSupportServiceLevelOperationCompleted == null)) {
- this.DeleteSupportServiceLevelOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteSupportServiceLevelOperationCompleted);
- }
- this.InvokeAsync("DeleteSupportServiceLevel", new object[] {
- levelId}, this.DeleteSupportServiceLevelOperationCompleted, userState);
- }
-
- private void OnDeleteSupportServiceLevelOperationCompleted(object arg) {
- if ((this.DeleteSupportServiceLevelCompleted != null)) {
- System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
- this.DeleteSupportServiceLevelCompleted(this, new DeleteSupportServiceLevelCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
- }
- }
-
///
public new void CancelAsync(object userState) {
base.CancelAsync(userState);
}
}
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
+ public delegate void UpdateSupportServiceLevelCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
+ public delegate void DeleteSupportServiceLevelCompletedEventHandler(object sender, DeleteSupportServiceLevelCompletedEventArgs e);
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.ComponentModel.DesignerCategoryAttribute("code")]
+ public partial class DeleteSupportServiceLevelCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
+
+ private object[] results;
+
+ internal DeleteSupportServiceLevelCompletedEventArgs(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]));
+ }
+ }
+ }
+
///
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void AddSupportServiceLevelCompletedEventHandler(object sender, AddSupportServiceLevelCompletedEventArgs e);
@@ -4227,6 +4367,36 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution {
}
}
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
+ public delegate void SendUserPasswordRequestSmsCompletedEventHandler(object sender, SendUserPasswordRequestSmsCompletedEventArgs e);
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.ComponentModel.DesignerCategoryAttribute("code")]
+ public partial class SendUserPasswordRequestSmsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
+
+ private object[] results;
+
+ internal SendUserPasswordRequestSmsCompletedEventArgs(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]));
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
+ public delegate void SendUserPasswordRequestEmailCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
+
///
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void AddOrganizationDomainCompletedEventHandler(object sender, AddOrganizationDomainCompletedEventArgs e);
@@ -5096,34 +5266,4 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution {
}
}
}
-
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
- public delegate void UpdateSupportServiceLevelCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
-
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
- public delegate void DeleteSupportServiceLevelCompletedEventHandler(object sender, DeleteSupportServiceLevelCompletedEventArgs e);
-
- ///
- [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
- [System.Diagnostics.DebuggerStepThroughAttribute()]
- [System.ComponentModel.DesignerCategoryAttribute("code")]
- public partial class DeleteSupportServiceLevelCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
-
- private object[] results;
-
- internal DeleteSupportServiceLevelCompletedEventArgs(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.Client/SystemProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/SystemProxy.cs
index d96d0a27..9cf076a6 100644
--- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/SystemProxy.cs
+++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/SystemProxy.cs
@@ -31,6 +31,8 @@ namespace WebsitePanel.EnterpriseServer {
private System.Threading.SendOrPostCallback GetSystemSettingsActiveOperationCompleted;
+ private System.Threading.SendOrPostCallback CheckIsTwilioEnabledOperationCompleted;
+
private System.Threading.SendOrPostCallback SetSystemSettingsOperationCompleted;
///
@@ -44,6 +46,9 @@ namespace WebsitePanel.EnterpriseServer {
///
public event GetSystemSettingsActiveCompletedEventHandler GetSystemSettingsActiveCompleted;
+ ///
+ public event CheckIsTwilioEnabledCompletedEventHandler CheckIsTwilioEnabledCompleted;
+
///
public event SetSystemSettingsCompletedEventHandler SetSystemSettingsCompleted;
@@ -132,6 +137,44 @@ namespace WebsitePanel.EnterpriseServer {
}
}
+ ///
+ [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CheckIsTwilioEnabled", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
+ public bool CheckIsTwilioEnabled() {
+ object[] results = this.Invoke("CheckIsTwilioEnabled", new object[0]);
+ return ((bool)(results[0]));
+ }
+
+ ///
+ public System.IAsyncResult BeginCheckIsTwilioEnabled(System.AsyncCallback callback, object asyncState) {
+ return this.BeginInvoke("CheckIsTwilioEnabled", new object[0], callback, asyncState);
+ }
+
+ ///
+ public bool EndCheckIsTwilioEnabled(System.IAsyncResult asyncResult) {
+ object[] results = this.EndInvoke(asyncResult);
+ return ((bool)(results[0]));
+ }
+
+ ///
+ public void CheckIsTwilioEnabledAsync() {
+ this.CheckIsTwilioEnabledAsync(null);
+ }
+
+ ///
+ public void CheckIsTwilioEnabledAsync(object userState) {
+ if ((this.CheckIsTwilioEnabledOperationCompleted == null)) {
+ this.CheckIsTwilioEnabledOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCheckIsTwilioEnabledOperationCompleted);
+ }
+ this.InvokeAsync("CheckIsTwilioEnabled", new object[0], this.CheckIsTwilioEnabledOperationCompleted, userState);
+ }
+
+ private void OnCheckIsTwilioEnabledOperationCompleted(object arg) {
+ if ((this.CheckIsTwilioEnabledCompleted != null)) {
+ System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
+ this.CheckIsTwilioEnabledCompleted(this, new CheckIsTwilioEnabledCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
+ }
+ }
+
///
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SetSystemSettings", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public int SetSystemSettings(string settingsName, SystemSettings settings) {
@@ -234,6 +277,32 @@ namespace WebsitePanel.EnterpriseServer {
}
}
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
+ public delegate void CheckIsTwilioEnabledCompletedEventHandler(object sender, CheckIsTwilioEnabledCompletedEventArgs e);
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.ComponentModel.DesignerCategoryAttribute("code")]
+ public partial class CheckIsTwilioEnabledCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
+
+ private object[] results;
+
+ internal CheckIsTwilioEnabledCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
+ base(exception, cancelled, userState) {
+ this.results = results;
+ }
+
+ ///
+ public bool Result {
+ get {
+ this.RaiseExceptionIfNecessary();
+ return ((bool)(this.results[0]));
+ }
+ }
+ }
+
///
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void SetSystemSettingsCompletedEventHandler(object sender, SetSystemSettingsCompletedEventArgs e);
diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs
index 05fbb37b..e33e9be2 100644
--- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs
+++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs
@@ -1632,6 +1632,73 @@ namespace WebsitePanel.EnterpriseServer
return result;
}
+ public static ResultObject SendUserPasswordRequestSms(int itemId, int accountId, string reason, string phoneTo = null)
+ {
+ var result = TaskManager.StartResultTask("ORGANIZATION", "SEND_USER_PASSWORD_REQUEST_SMS",
+ itemId);
+
+ try
+ {
+
+ // load organization
+ Organization org = GetOrganization(itemId);
+
+ if (org == null)
+ {
+ throw new Exception(string.Format("Organization not found (ItemId = {0})", itemId));
+ }
+
+ UserInfo owner = PackageController.GetPackageOwner(org.PackageId);
+ OrganizationUser user = OrganizationController.GetUserGeneralSettingsWithExtraData(itemId, accountId);
+
+ user.ItemId = itemId;
+
+ if (string.IsNullOrEmpty(phoneTo))
+ {
+ phoneTo = user.MobilePhone;
+ }
+
+ UserSettings settings = UserController.GetUserSettings(owner.UserId, UserSettings.USER_PASSWORD_REQUEST_LETTER);
+
+
+ string body = settings["SMSBody"];
+
+ var pincode = GeneratePincode();
+ Guid token;
+
+ var items = new Hashtable();
+
+ items["passwordResetLink"] = GenerateUserPasswordResetLink(user.ItemId, user.AccountId, out token, pincode);
+
+ body = PackageController.EvaluateTemplate(body, items);
+
+ TaskManager.Write("Organization ID : " + user.ItemId);
+ TaskManager.Write("Account : " + user.DisplayName);
+ TaskManager.Write("Reason : " + reason);
+ TaskManager.Write("SmsTo : " + phoneTo);
+
+ // send Sms message
+ var response = SendSms(phoneTo, body);
+
+ if (response.RestException != null)
+ {
+ throw new Exception(response.RestException.Message);
+ }
+
+ SetAccessTokenResponse(token, pincode);
+ }
+ catch (Exception ex)
+ {
+ TaskManager.WriteError(ex);
+ TaskManager.CompleteResultTask(result);
+ result.AddError("", ex);
+ return result;
+ }
+
+ TaskManager.CompleteResultTask();
+ return result;
+ }
+
public static ResultObject SendResetUserPasswordPincodeSms(Guid token, string phoneTo = null)
{
var result = TaskManager.StartResultTask("ORGANIZATION", "SEND_USER_PASSWORD_RESET_SMS_PINCODE");
@@ -1851,6 +1918,33 @@ namespace WebsitePanel.EnterpriseServer
SendUserPasswordEmail(owner, user, reason, mailTo, logoUrl, UserSettings.USER_PASSWORD_RESET_LETTER, "USER_PASSWORD_RESET_LETTER", finalStep);
}
+ public static void SendUserPasswordRequestEmail(int itemId, int accountId, string reason, string mailTo, bool finalStep)
+ {
+ // load organization
+ Organization org = GetOrganization(itemId);
+
+ if (org == null)
+ {
+ throw new Exception(string.Format("Organization not found (ItemId = {0})", itemId));
+ }
+
+ UserInfo owner = PackageController.GetPackageOwner(org.PackageId);
+ OrganizationUser user = OrganizationController.GetUserGeneralSettingsWithExtraData(itemId, accountId);
+
+ user.ItemId = itemId;
+
+ if (string.IsNullOrEmpty(mailTo))
+ {
+ mailTo = user.PrimaryEmailAddress;
+ }
+
+ var generalSettings = OrganizationController.GetOrganizationGeneralSettings(itemId);
+
+ var logoUrl = generalSettings != null ? generalSettings.OrganizationLogoUrl : string.Empty;
+
+ SendUserPasswordEmail(owner, user, reason, mailTo, logoUrl, UserSettings.USER_PASSWORD_REQUEST_LETTER, "USER_PASSWORD_REQUEST_LETTER", finalStep);
+ }
+
public static void SendUserExpirationPasswordEmail(UserInfo owner, OrganizationUser user, string reason,
string mailTo, string logoUrl)
{
@@ -1919,8 +2013,6 @@ namespace WebsitePanel.EnterpriseServer
}
}
-
-
public static AccessToken GetAccessToken(Guid accessToken, AccessTokenTypes type)
{
return ObjectUtils.FillObjectFromDataReader(DataProvider.GetAccessTokenByAccessToken(accessToken, type));
diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/System/SystemController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/System/SystemController.cs
index 1da3365d..2301a79c 100644
--- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/System/SystemController.cs
+++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/System/SystemController.cs
@@ -202,5 +202,15 @@ namespace WebsitePanel.EnterpriseServer
TaskManager.CompleteTask();
}
}
+
+ public static bool CheckIsTwilioEnabled()
+ {
+ var settings = SystemController.GetSystemSettingsActive(SystemSettings.TWILIO_SETTINGS, false);
+
+ return settings != null
+ && !string.IsNullOrEmpty(settings.GetValueOrDefault(SystemSettings.TWILIO_ACCOUNTSID_KEY, string.Empty))
+ && !string.IsNullOrEmpty(settings.GetValueOrDefault(SystemSettings.TWILIO_AUTHTOKEN_KEY, string.Empty))
+ && !string.IsNullOrEmpty(settings.GetValueOrDefault(SystemSettings.TWILIO_PHONEFROM_KEY, string.Empty));
+ }
}
}
diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs
index 3e6c1188..8e87cb8b 100644
--- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs
+++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs
@@ -211,6 +211,18 @@ namespace WebsitePanel.EnterpriseServer
}
+ [WebMethod]
+ public ResultObject SendUserPasswordRequestSms(int itemId, int accountId, string reason, string phoneTo)
+ {
+ return OrganizationController.SendUserPasswordRequestSms(itemId, accountId, reason, phoneTo);
+ }
+
+ [WebMethod]
+ public void SendUserPasswordRequestEmail(int itemId, int accountId, string reason, string mailTo, bool finalStep)
+ {
+ OrganizationController.SendUserPasswordRequestEmail(itemId, accountId, reason, mailTo, finalStep);
+ }
+
#endregion
#region Domains
diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esSystem.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esSystem.asmx.cs
index 26c44aee..48b23cc0 100644
--- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esSystem.asmx.cs
+++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esSystem.asmx.cs
@@ -59,6 +59,12 @@ namespace WebsitePanel.EnterpriseServer
return SystemController.GetSystemSettingsActive(settingsName, decrypt);
}
+ [WebMethod]
+ public bool CheckIsTwilioEnabled()
+ {
+ return SystemController.CheckIsTwilioEnabled();
+ }
+
[WebMethod]
public int SetSystemSettings(string settingsName, SystemSettings settings)
{
diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/UI.Designer.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/UI.Designer.cs
index 57565d1d..4c1d4299 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/UI.Designer.cs
+++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/UI.Designer.cs
@@ -88,11 +88,11 @@ namespace WebsitePanel.WebDavPortal.Resources {
}
///
- /// Looks up a localized string similar to Address Inforamtion.
+ /// Looks up a localized string similar to Address Information.
///
- public static string AddressInforamtion {
+ public static string AddressInformation {
get {
- return ResourceManager.GetString("AddressInforamtion", resourceCulture);
+ return ResourceManager.GetString("AddressInformation", resourceCulture);
}
}
diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/UI.resx b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/UI.resx
index e5779ae5..1f4ec733 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/UI.resx
+++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/UI.resx
@@ -123,8 +123,8 @@
Address
-
- Address Inforamtion
+
+ Address Information
Back
diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Account/UserProfile.cshtml b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Account/UserProfile.cshtml
index 401acd3c..86282004 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Account/UserProfile.cshtml
+++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Account/UserProfile.cshtml
@@ -169,7 +169,7 @@
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SettingsUserPasswordRequestLetter.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SettingsUserPasswordRequestLetter.ascx.resx
new file mode 100644
index 00000000..34c63a90
--- /dev/null
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SettingsUserPasswordRequestLetter.ascx.resx
@@ -0,0 +1,162 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 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
+
+
+ High
+
+
+ Low
+
+
+ Normal
+
+
+ From:
+
+
+ HTML Body:
+
+
+ Logo Url:
+
+
+ No Changes HTML Body:
+
+
+ No Changes Text Body:
+
+
+ Password Reset Link Sms Body:
+
+
+ Password Reset Link Pincode Body:
+
+
+ Priority:
+
+
+ Subject:
+
+
+ Text Body:
+
+
+ SMS
+
+
\ No newline at end of file
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/UserAccountMailTemplateSettings.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/UserAccountMailTemplateSettings.ascx.resx
index 3329ebf5..5a024ed4 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/UserAccountMailTemplateSettings.ascx.resx
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/UserAccountMailTemplateSettings.ascx.resx
@@ -159,4 +159,7 @@
Organization User Password Reset Pincode Letter
+
+ Organization User Password Request Letter
+
\ No newline at end of file
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx
index 7568dc46..e75dffe8 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx
@@ -8,6 +8,7 @@
<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %>
<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %>
<%@ Register Src="UserControls/MailboxPlanSelector.ascx" TagName="MailboxPlanSelector" TagPrefix="wsp" %>
+<%@ Register Src="../UserControls/SendToControl.ascx" TagName="SendToControl" TagPrefix="wsp" %>
@@ -113,6 +114,11 @@
+
+
+
+
+
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx.cs
index 5608b564..e9926fae 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx.cs
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx.cs
@@ -27,6 +27,7 @@
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
+using System.Web.Security;
using WebsitePanel.EnterpriseServer;
using WebsitePanel.Providers.HostedSolution;
using WebsitePanel.Providers.ResultObjects;
@@ -161,12 +162,19 @@ namespace WebsitePanel.Portal.ExchangeServer
string subscriberNumber = IsNewUser ? txtSubscriberNumber.Text.Trim() : userSelector.GetSubscriberNumber();
+ var passwordString = password.Password;
+
+ if (sendToControl.IsRequestSend && IsNewUser)
+ {
+ passwordString = Membership.GeneratePassword(16, 3);
+ }
+
accountId = ES.Services.ExchangeServer.CreateMailbox(PanelRequest.ItemID, accountId, type,
accountName,
displayName,
name,
domain,
- password.Password,
+ passwordString,
chkSendInstructions.Checked,
sendInstructionEmail.Text,
Convert.ToInt32(mailboxPlanSelector.MailboxPlanId),
@@ -187,6 +195,15 @@ namespace WebsitePanel.Portal.ExchangeServer
}
}
+ if (sendToControl.SendEmail && IsNewUser)
+ {
+ ES.Services.Organizations.SendUserPasswordRequestEmail(PanelRequest.ItemID, accountId, "User creation", sendToControl.Email, true);
+ }
+ else if (sendToControl.SendMobile && IsNewUser)
+ {
+ ES.Services.Organizations.SendUserPasswordRequestSms(PanelRequest.ItemID, accountId, "User creation", sendToControl.Mobile);
+ }
+
Response.Redirect(EditUrl("AccountID", accountId.ToString(), "mailbox_settings",
"SpaceID=" + PanelSecurity.PackageId.ToString(),
"ItemID=" + PanelRequest.ItemID.ToString()));
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx.designer.cs
index 013a6f68..7b1646f4 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx.designer.cs
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx.designer.cs
@@ -255,6 +255,15 @@ namespace WebsitePanel.Portal.ExchangeServer {
///
protected global::System.Web.UI.WebControls.CheckBox chkUserMustChangePassword;
+ ///
+ /// sendToControl control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::WebsitePanel.Portal.UserControls.SendToControl sendToControl;
+
///
/// locMailboxType control.
///
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx
index a69cef4f..cb861a3b 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx
@@ -5,106 +5,118 @@
<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %>
<%@ Register Src="../UserControls/QuotaViewer.ascx" TagName="QuotaViewer" TagPrefix="wsp" %>
<%@ Register Src="../UserControls/EmailControl.ascx" TagName="EmailControl" TagPrefix="wsp" %>
+<%@ Register Src="../UserControls/SendToControl.ascx" TagName="SendToControl" TagPrefix="wsp" %>
-
+ if (document.getElementById("<%= txtLastName.ClientID %>").value != '')
+ document.getElementById("<%= txtDisplayName.ClientID %>").value = document.getElementById("<%= txtDisplayName.ClientID %>").value + document.getElementById("<%= txtLastName.ClientID %>").value;
+ }
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
\ No newline at end of file
+
+
+
+
+
+
+
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx.cs
index 217ac7f0..9bb7ba68 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx.cs
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx.cs
@@ -27,6 +27,7 @@
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
+using System.Web.Security;
using WebsitePanel.EnterpriseServer;
using WebsitePanel.Providers.ResultObjects;
using WebsitePanel.Providers.HostedSolution;
@@ -98,10 +99,17 @@ namespace WebsitePanel.Portal.HostedSolution
try
{
+ var passwordString = password.Password;
+
+ if (sendToControl.IsRequestSend)
+ {
+ passwordString = Membership.GeneratePassword(16, 3);
+ }
+
int accountId = ES.Services.Organizations.CreateUser(PanelRequest.ItemID, txtDisplayName.Text.Trim(),
email.AccountName.ToLower(),
email.DomainName.ToLower(),
- password.Password,
+ passwordString,
txtSubscriberNumber.Text.Trim(),
chkSendInstructions.Checked,
sendInstructionEmail.Text);
@@ -119,6 +127,15 @@ namespace WebsitePanel.Portal.HostedSolution
}
}
+ if (sendToControl.SendEmail)
+ {
+ ES.Services.Organizations.SendUserPasswordRequestEmail(PanelRequest.ItemID, accountId, "User creation", sendToControl.Email, true);
+ }
+ else if (sendToControl.SendMobile)
+ {
+ ES.Services.Organizations.SendUserPasswordRequestSms(PanelRequest.ItemID, accountId, "User creation", sendToControl.Mobile);
+ }
+
Response.Redirect(EditUrl("AccountID", accountId.ToString(), "edit_user",
"SpaceID=" + PanelSecurity.PackageId,
"ItemID=" + PanelRequest.ItemID,
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx.designer.cs
index 727d7527..adf1b0c0 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx.designer.cs
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx.designer.cs
@@ -48,6 +48,15 @@ namespace WebsitePanel.Portal.HostedSolution {
///
protected global::System.Web.UI.WebControls.Localize locTitle;
+ ///
+ /// CreateUserUpdatePanel control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.UpdatePanel CreateUserUpdatePanel;
+
///
/// messageBox control.
///
@@ -210,6 +219,15 @@ namespace WebsitePanel.Portal.HostedSolution {
///
protected global::System.Web.UI.WebControls.CheckBox chkUserMustChangePassword;
+ ///
+ /// sendToControl control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::WebsitePanel.Portal.UserControls.SendToControl sendToControl;
+
///
/// chkSendInstructions control.
///
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordRequestLetter.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordRequestLetter.ascx
new file mode 100644
index 00000000..a8eb6054
--- /dev/null
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordRequestLetter.ascx
@@ -0,0 +1,55 @@
+<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SettingsUserPasswordRequestLetter.ascx.cs" Inherits="WebsitePanel.Portal.SettingsUserPasswordRequestLetter" %>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ High
+ Normal
+ Low
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordRequestLetter.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordRequestLetter.ascx.cs
new file mode 100644
index 00000000..7a1e2596
--- /dev/null
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordRequestLetter.ascx.cs
@@ -0,0 +1,37 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Web;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+using WebsitePanel.EnterpriseServer;
+
+namespace WebsitePanel.Portal
+{
+ public partial class SettingsUserPasswordRequestLetter : WebsitePanelControlBase, IUserSettingsEditorControl
+ {
+ public void BindSettings(UserSettings settings)
+ {
+ txtFrom.Text = settings["From"];
+ txtSubject.Text = settings["Subject"];
+ Utils.SelectListItem(ddlPriority, settings["Priority"]);
+ txtHtmlBody.Text = settings["HtmlBody"];
+ txtTextBody.Text = settings["TextBody"];
+ txtLogoUrl.Text = settings["LogoUrl"];
+
+ txtSmsBody.Text = settings["SMSBody"];
+ }
+
+ public void SaveSettings(UserSettings settings)
+ {
+ settings["From"] = txtFrom.Text;
+ settings["Subject"] = txtSubject.Text;
+ settings["Priority"] = ddlPriority.SelectedValue;
+ settings["HtmlBody"] = txtHtmlBody.Text;
+ settings["TextBody"] = txtTextBody.Text;
+ settings["LogoUrl"] = txtLogoUrl.Text;
+
+ settings["SMSBody"] = txtSmsBody.Text;
+ }
+ }
+}
\ No newline at end of file
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordRequestLetter.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordRequestLetter.ascx.designer.cs
new file mode 100644
index 00000000..69efede1
--- /dev/null
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordRequestLetter.ascx.designer.cs
@@ -0,0 +1,141 @@
+//------------------------------------------------------------------------------
+//
+// 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 {
+
+
+ public partial class SettingsUserPasswordRequestLetter {
+
+ ///
+ /// lblFrom control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Label lblFrom;
+
+ ///
+ /// txtFrom control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox txtFrom;
+
+ ///
+ /// lblSubject control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Label lblSubject;
+
+ ///
+ /// txtSubject control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox txtSubject;
+
+ ///
+ /// lblPriority control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Label lblPriority;
+
+ ///
+ /// ddlPriority control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.DropDownList ddlPriority;
+
+ ///
+ /// lblLogoUrl control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Label lblLogoUrl;
+
+ ///
+ /// txtLogoUrl control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox txtLogoUrl;
+
+ ///
+ /// lblHtmlBody control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Label lblHtmlBody;
+
+ ///
+ /// txtHtmlBody control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox txtHtmlBody;
+
+ ///
+ /// lblTextBody control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Label lblTextBody;
+
+ ///
+ /// txtTextBody control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox txtTextBody;
+
+ ///
+ /// lblSmsBody control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Label lblSmsBody;
+
+ ///
+ /// txtSmsBody control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox txtSmsBody;
+ }
+}
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountMailTemplateSettings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountMailTemplateSettings.ascx
index dd09fdc8..8351143e 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountMailTemplateSettings.ascx
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountMailTemplateSettings.ascx
@@ -54,6 +54,10 @@
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx.designer.cs
index 7b1646f4..f49d06f1 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx.designer.cs
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx.designer.cs
@@ -228,6 +228,24 @@ namespace WebsitePanel.Portal.ExchangeServer {
///
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.EmailAddress email;
+ ///
+ /// sendToControl control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::WebsitePanel.Portal.UserControls.SendToControl sendToControl;
+
+ ///
+ /// PasswordBlock control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlTableRow PasswordBlock;
+
///
/// locPassword control.
///
@@ -255,15 +273,6 @@ namespace WebsitePanel.Portal.ExchangeServer {
///
protected global::System.Web.UI.WebControls.CheckBox chkUserMustChangePassword;
- ///
- /// sendToControl control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::WebsitePanel.Portal.UserControls.SendToControl sendToControl;
-
///
/// locMailboxType control.
///
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx
index cb861a3b..4b0ee5de 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx
@@ -85,16 +85,20 @@
+
+
+
+
+
-
+
-
+
-
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx.designer.cs
index adf1b0c0..38dfdde8 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx.designer.cs
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx.designer.cs
@@ -192,6 +192,24 @@ namespace WebsitePanel.Portal.HostedSolution {
///
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.EmailAddress email;
+ ///
+ /// sendToControl control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::WebsitePanel.Portal.UserControls.SendToControl sendToControl;
+
+ ///
+ /// PasswordBlock control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.HtmlControls.HtmlTableRow PasswordBlock;
+
///
/// locPassword control.
///
@@ -219,15 +237,6 @@ namespace WebsitePanel.Portal.HostedSolution {
///
protected global::System.Web.UI.WebControls.CheckBox chkUserMustChangePassword;
- ///
- /// sendToControl control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::WebsitePanel.Portal.UserControls.SendToControl sendToControl;
-
///
/// chkSendInstructions control.
///
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/App_LocalResources/SendToControl.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/App_LocalResources/SendToControl.ascx.resx
index 98960a84..9e07a1dd 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/App_LocalResources/SendToControl.ascx.resx
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/App_LocalResources/SendToControl.ascx.resx
@@ -124,10 +124,10 @@
Save as user mobile
- Email:
+ Email: *
- Mobile:
+ Mobile: *
Reason:
From ddd4459ac91543b7e2f219a601f78cf34880bb3e Mon Sep 17 00:00:00 2001
From: Virtuworks
Date: Mon, 11 May 2015 08:31:15 -0400
Subject: [PATCH 05/22] Added tag build-2.1.0.711 for changeset a9c2171ad75c
From fbec129fc185a4e067b21ba6bf3f68da3df49714 Mon Sep 17 00:00:00 2001
From: vfedosevich
Date: Mon, 11 May 2015 06:08:02 -0700
Subject: [PATCH 06/22] Fix for sharepoint enterprise quotas
---
WebsitePanel/Database/update_db.sql | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql
index 72d95c43..c112c89e 100644
--- a/WebsitePanel/Database/update_db.sql
+++ b/WebsitePanel/Database/update_db.sql
@@ -9635,6 +9635,9 @@ BEGIN
(SELECT TOP 1 @item_type_id, @group_id, 'SharePointSiteCollection', TypeName, 100, CalculateDiskSpace, CalculateBandwidth, Suspendable, Disposable, Searchable, Importable, Backupable FROM [dbo].[ServiceItemTypes] WHERE DisplayName = 'SharePointFoundationSiteCollection')
END
+
+
+
GO
UPDATE [dbo].[Quotas] SET GroupID = 45 WHERE QuotaName = 'EnterpriseStorage.DriveMaps'
@@ -11098,4 +11101,12 @@ CLOSE @curSpace
DEALLOCATE @curSpace
CLOSE @curUsers
DEALLOCATE @curUsers
-RETURN
\ No newline at end of file
+RETURN
+
+
+IF EXISTS (SELECT TOP 1 * FROM ServiceItemTypes WHERE DisplayName = 'SharePointEnterpriseSiteCollection')
+BEGIN
+ DECLARE @item_type_id AS INT
+ SELECT @item_type_id = ItemTypeId FROM ServiceItemTypes WHERE DisplayName = 'SharePointEnterpriseSiteCollection'
+ UPDATE [dbo].[Quotas] SET ItemTypeID = @item_type_id WHERE QuotaId = 550
+END
\ No newline at end of file
From b7b39e8fa2b077b27f51632a10c2772c0db18ec2 Mon Sep 17 00:00:00 2001
From: vfedosevich
Date: Mon, 11 May 2015 06:38:57 -0700
Subject: [PATCH 07/22] update_db mail template fix
---
WebsitePanel/Database/update_db.sql | 22 ----------------------
1 file changed, 22 deletions(-)
diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql
index da49c75e..abe22af5 100644
--- a/WebsitePanel/Database/update_db.sql
+++ b/WebsitePanel/Database/update_db.sql
@@ -9882,8 +9882,6 @@ IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [Settin
BEGIN
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordExpirationLetter', N'HtmlBody', @UserPasswordExpirationLetterHtmlBody)
END
-ELSE
-UPDATE [dbo].[UserSettings] SET [PropertyValue] = @UserPasswordExpirationLetterHtmlBody WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordExpirationLetter' AND [PropertyName]= N'HtmlBody'
GO
@@ -9926,8 +9924,6 @@ IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [Settin
BEGIN
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordExpirationLetter', N'TextBody', @UserPasswordExpirationLetterTextBody)
END
-ELSE
-UPDATE [dbo].[UserSettings] SET [PropertyValue] = @UserPasswordExpirationLetterTextBody WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordExpirationLetter' AND [PropertyName]= N'TextBody'
GO
@@ -9995,8 +9991,6 @@ IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [Settin
BEGIN
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordResetLetter', N'HtmlBody', @UserPasswordResetLetterHtmlBody)
END
-ELSE
-UPDATE [dbo].[UserSettings] SET [PropertyValue] = @UserPasswordResetLetterHtmlBody WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetLetter' AND [PropertyName]= N'HtmlBody'
GO
@@ -10039,8 +10033,6 @@ IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [Settin
BEGIN
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordResetLetter', N'TextBody', @UserPasswordResetLetterTextBody)
END
-ELSE
-UPDATE [dbo].[UserSettings] SET [PropertyValue] = @UserPasswordResetLetterTextBody WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetLetter' AND [PropertyName]= N'TextBody'
GO
@@ -10056,8 +10048,6 @@ IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [Settin
BEGIN
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordResetLetter', N'PasswordResetLinkSmsBody', @UserPasswordResetSMSBody)
END
-ELSE
-UPDATE [dbo].[UserSettings] SET [PropertyValue] = @UserPasswordResetSMSBody WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetLetter' AND [PropertyName]= N'PasswordResetLinkSmsBody'
GO
-- USER PASSWORD RESET EMAIL PINCODE TEMPLATE
@@ -10121,8 +10111,6 @@ IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [Settin
BEGIN
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordResetPincodeLetter', N'HtmlBody', @UserPasswordResetPincodeLetterHtmlBody)
END
-ELSE
-UPDATE [dbo].[UserSettings] SET [PropertyValue] = @UserPasswordResetPincodeLetterHtmlBody WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetPincodeLetter' AND [PropertyName]= N'HtmlBody'
GO
@@ -10165,8 +10153,6 @@ IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [Settin
BEGIN
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordResetPincodeLetter', N'TextBody', @UserPasswordResetPincodeLetterTextBody)
END
-ELSE
-UPDATE [dbo].[UserSettings] SET [PropertyValue] = @UserPasswordResetPincodeLetterTextBody WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetPincodeLetter' AND [PropertyName]= N'TextBody'
GO
DECLARE @UserPasswordPincodeSMSBody nvarchar(2500)
@@ -10179,8 +10165,6 @@ IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [Settin
BEGIN
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordResetPincodeLetter', N'PasswordResetPincodeSmsBody', @UserPasswordPincodeSMSBody)
END
-ELSE
-UPDATE [dbo].[UserSettings] SET [PropertyValue] = @UserPasswordPincodeSMSBody WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetPincodeLetter' AND [PropertyName]= N'PasswordResetPincodeSmsBody'
GO
@@ -10245,8 +10229,6 @@ IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [Settin
BEGIN
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'OrganizationUserPasswordRequestLetter', N'HtmlBody', @OrganizationUserPasswordRequestLetterHtmlBody)
END
-ELSE
-UPDATE [dbo].[UserSettings] SET [PropertyValue] = @OrganizationUserPasswordRequestLetterHtmlBody WHERE [UserID] = 1 AND [SettingsName]= N'OrganizationUserPasswordRequestLetter' AND [PropertyName]= N'HtmlBody'
GO
@@ -10289,8 +10271,6 @@ IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [Settin
BEGIN
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'OrganizationUserPasswordRequestLetter', N'TextBody', @OrganizationUserPasswordRequestLetterTextBody)
END
-ELSE
-UPDATE [dbo].[UserSettings] SET [PropertyValue] = @OrganizationUserPasswordRequestLetterTextBody WHERE [UserID] = 1 AND [SettingsName]= N'OrganizationUserPasswordRequestLetter' AND [PropertyName]= N'TextBody'
GO
DECLARE @OrganizationUserPasswordRequestLetterSMSBody nvarchar(2500)
@@ -10303,8 +10283,6 @@ IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [Settin
BEGIN
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'OrganizationUserPasswordRequestLetter', N'SMSBody', @OrganizationUserPasswordRequestLetterSMSBody)
END
-ELSE
-UPDATE [dbo].[UserSettings] SET [PropertyValue] = @OrganizationUserPasswordRequestLetterSMSBody WHERE [UserID] = 1 AND [SettingsName]= N'OrganizationUserPasswordRequestLetter' AND [PropertyName]= N'SMSBody'
GO
From a86eed2bfa78590faa42f6b505c0cb85ece0ab4b Mon Sep 17 00:00:00 2001
From: Virtuworks
Date: Mon, 11 May 2015 09:54:30 -0400
Subject: [PATCH 08/22] Added tag build-2.1.0.713 for changeset bc9df5f42133
From a461310368a37d313fc2c6708871739b6ca9db06 Mon Sep 17 00:00:00 2001
From: vfedosevich
Date: Tue, 12 May 2015 06:08:45 -0700
Subject: [PATCH 09/22] password request fix
---
.../ExchangeServer/ExchangeCreateMailbox.ascx | 2 +-
.../ExchangeServer/OrganizationCreateUser.ascx | 2 +-
.../WebsitePanel/UserControls/SendToControl.ascx | 2 +-
.../WebsitePanel/UserControls/SendToControl.ascx.cs | 12 ++++++++++++
4 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx
index 34707f25..55926fa6 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx
@@ -111,7 +111,7 @@
-
+
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx
index 4b0ee5de..8f4282d1 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx
@@ -89,7 +89,7 @@
-
+
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SendToControl.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SendToControl.ascx
index e4e8ace3..544b2091 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SendToControl.ascx
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SendToControl.ascx
@@ -5,7 +5,7 @@
-
+
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SendToControl.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SendToControl.ascx.cs
index c5417946..92eea906 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SendToControl.ascx.cs
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SendToControl.ascx.cs
@@ -74,6 +74,18 @@ namespace WebsitePanel.Portal.UserControls
var isTwilioEnabled = ES.Services.System.CheckIsTwilioEnabled();
rbtnMobile.Visible = isTwilioEnabled;
+
+ if (!Page.IsPostBack)
+ {
+ if (isTwilioEnabled)
+ {
+ rbtnMobile.Checked = true;
+ rbtnEmail.Checked = false;
+ SendToGroupCheckedChanged(null, null);
+ }
+
+ chkSendPasswordResetEmail_StateChanged(null, null);
+ }
}
}
}
\ No newline at end of file
From 97a4b65d3a17078eaca6617a00dfc36419af07bc Mon Sep 17 00:00:00 2001
From: Virtuworks
Date: Tue, 12 May 2015 10:04:24 -0400
Subject: [PATCH 10/22] Added tag build-2.1.0.714 for changeset 9036da179a7b
From 126d8d55b5f43912ce4e75e0514d127be41e82ea Mon Sep 17 00:00:00 2001
From: vfedosevich
Date: Tue, 12 May 2015 08:01:36 -0700
Subject: [PATCH 11/22] setting rename
---
.../WebsitePanel/App_LocalResources/SystemSettings.ascx.resx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SystemSettings.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SystemSettings.ascx.resx
index 0df8b577..776683cc 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SystemSettings.ascx.resx
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SystemSettings.ascx.resx
@@ -172,7 +172,7 @@
Webdav Portal URL
- Webdav Portal
+ Organization Password Reset Module
Yes
From ce671212a20dc2510564def5b6ac142941a521cd Mon Sep 17 00:00:00 2001
From: Virtuworks
Date: Tue, 12 May 2015 14:16:22 -0400
Subject: [PATCH 12/22] Added tag build-2.1.0.715 for changeset b1d91c14ab8d
From dc1190745fce17ddce0c5ba159b855fc750e525b Mon Sep 17 00:00:00 2001
From: Virtuworks
Date: Tue, 12 May 2015 18:27:58 -0400
Subject: [PATCH 13/22] Added tag build-2.1.0.716 for changeset 79d6d2f3f7a1
From 918c19bf82059785d0591292086ab8543d6a4a1b Mon Sep 17 00:00:00 2001
From: Virtuworks
Date: Wed, 13 May 2015 10:03:12 -0400
Subject: [PATCH 14/22] Added tag build-2.1.0.718 for changeset 96912bfdf959
From 806e000d28e4f63d52a31f38ae58169d24d495f2 Mon Sep 17 00:00:00 2001
From: Virtuworks
Date: Thu, 14 May 2015 13:52:43 -0400
Subject: [PATCH 15/22] Added tag build-2.1.0.719 for changeset f86d556bcb5c
From 53f6f7293918ab02f76a140b106156c6467c8074 Mon Sep 17 00:00:00 2001
From: Virtuworks
Date: Thu, 14 May 2015 17:14:20 -0400
Subject: [PATCH 16/22] Added tag build-2.1.0.722 for changeset 1b639b00588a
From 90d351beae0fb7b5c9511c5339630f918a65271d Mon Sep 17 00:00:00 2001
From: Virtuworks
Date: Fri, 15 May 2015 01:23:09 -0400
Subject: [PATCH 17/22] Merge
---
WebsitePanel/Database/update_db.sql | 69 ++++++++++++++---------------
1 file changed, 34 insertions(+), 35 deletions(-)
diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql
index 0b766e03..ed405f7b 100644
--- a/WebsitePanel/Database/update_db.sql
+++ b/WebsitePanel/Database/update_db.sql
@@ -9902,7 +9902,7 @@ END
GO
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordExpirationLetter' AND [PropertyName]= N'LogoUrl' )
BEGIN
-INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordExpirationLetter', N'LogoUrl', N'https://controlpanel.virtuworks.net/App_Themes/Default/Images/logo.png')
+INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordExpirationLetter', N'LogoUrl', N'')
END
GO
@@ -10011,7 +10011,7 @@ END
GO
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetLetter' AND [PropertyName]= N'LogoUrl' )
BEGIN
-INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordResetLetter', N'LogoUrl', N'https://controlpanel.virtuworks.net/App_Themes/Default/Images/logo.png')
+INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordResetLetter', N'LogoUrl', N'')
END
GO
@@ -10131,7 +10131,7 @@ END
GO
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetPincodeLetter' AND [PropertyName]= N'LogoUrl' )
BEGIN
-INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordResetPincodeLetter', N'LogoUrl', N'https://controlpanel.virtuworks.net/App_Themes/Default/Images/logo.png')
+INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordResetPincodeLetter', N'LogoUrl', N'')
END
GO
@@ -10249,7 +10249,7 @@ END
GO
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'OrganizationUserPasswordRequestLetter' AND [PropertyName]= N'LogoUrl' )
BEGIN
-INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'OrganizationUserPasswordRequestLetter', N'LogoUrl', N'https://controlpanel.virtuworks.net/App_Themes/Default/Images/logo.png')
+INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'OrganizationUserPasswordRequestLetter', N'LogoUrl', N'')
END
GO
@@ -10298,7 +10298,7 @@ GO
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'ExchangeMailboxSetupLetter' AND [PropertyName]= N'From' )
BEGIN
-INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'ExchangeMailboxSetupLetter', N'From', N'orders@virtuworks.com')
+INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'ExchangeMailboxSetupLetter', N'From', N'')
END
GO
@@ -10334,7 +10334,7 @@ Set @ExchangeMailboxSetupLetterHtmlBody = N'
-
+
@@ -10349,11 +10349,11 @@ Set @ExchangeMailboxSetupLetterHtmlBody = N'
-Visit VirtuWorks.com
-Account Management
-Control Panel
-Support
-Contact Us
+
+
+
+
+
@@ -10385,7 +10385,7 @@ Set @ExchangeMailboxSetupLetterHtmlBody = N'
@@ -10424,15 +10424,15 @@ Set @ExchangeMailboxSetupLetterHtmlBody = N'https://mail.virtuworks.net/owa
+
Outlook (Windows Clients)
- To configure Outlook 2013 to work with the VirtuWorks servers, please reference:
+ To configure Outlook 2013 to work with the servers, please reference:
- http://www.virtuworks.com/how-to-configure-my-outlook-2010-client-to-work-with-my-velum-hosted-exchange-account/
+
If you need to download and install the Outlook client:
@@ -10443,16 +10443,16 @@ Set @ExchangeMailboxSetupLetterHtmlBody = N'
Download URL:
- Outlook 2013 - 32bit
+
- Outlook 2013 - 64bit
+
KEY:
- HPN4P-JKC89-VCCWD-24CD2-9P8H7
+
@@ -10479,13 +10479,13 @@ Set @ExchangeMailboxSetupLetterHtmlBody = N'Control Panel.
+ Passwords can be changed at any time using Webmail or the Control Panel .
Control Panel
- If you need to change the details of your account, you can easily do this using Control Panel .
+ If you need to change the details of your account, you can easily do this using Control Panel .
Support
- You have 2 options, email help@virtuworks.com or use the web interface at http://www.virtuworks.com/support
+ You have 2 options, email or use the web interface at
@@ -10513,9 +10513,9 @@ Set @ExchangeMailboxSetupLetterHtmlBody = N'
-Visit VirtuWorks.com Learn more about the services VirtuWorks can provide to improve your business.
-Privacy Policy VirtuWorks follows strict guidelines in protecting your privacy. Learn about our Privacy Policy .
-Contact Us Questions? For more information, contact us .
+ Learn more about the services can provide to improve your business.
+Privacy Policy follows strict guidelines in protecting your privacy. Learn about our Privacy Policy .
+Contact Us Questions? For more information, contact us .
@@ -10554,7 +10554,7 @@ END
GO
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'ExchangeMailboxSetupLetter' AND [PropertyName]= N'Subject' )
BEGIN
-INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'ExchangeMailboxSetupLetter', N'Subject', N'Virtuworks Hosted Exchange Mailbox Setup')
+INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'ExchangeMailboxSetupLetter', N'Subject', N' Hosted Exchange Mailbox Setup')
END
GO
@@ -10564,7 +10564,7 @@ DECLARE @ExchangeMailboxSetupLetterTextBody nvarchar(2500)
Set @ExchangeMailboxSetupLetterTextBody = N'
Hello #Account.DisplayName#,
-Thanks for choosing VirtuWorks as your Exchange hosting provider.
+Thanks for choosing as your Exchange hosting provider.
User Accounts
@@ -10590,22 +10590,21 @@ In order for us to accept mail for your domain, you will need to point your MX r
Webmail (OWA, Outlook Web Access)
=================================
-https://mail.virtuworks.net/owa
+
=================================
Outlook (Windows Clients)
=================================
-To configure Outlook 2010 to work with VirtuWorks servers, please reference:
+To configure Outlook 2010 to work with servers, please reference:
+
-https://portal.virtuworks.net/whmcs/knowledgebase.php?action=displayarticle&id=2
If you need to download and install the Outlook 2010 client:
Outlook 2010 Download URL:
-32 Bit - http://www.virtuworks.net/downloads/Outlook2010-32bit.zip
-64 Bit - http://www.virtuworks.net/downloads/Outlook2010-64bit.zip
-KEY: HXGFV-DY3HM-4W2BQ-3R7KQ-K8P49
+
+KEY:
=================================
ActiveSync, iPhone, iPad
@@ -10620,21 +10619,21 @@ Your username: #SamUsername#
Password Changes
=================================
-Passwords can be changed at any time using Webmail or the Control Panel (https://controlpanel.virtuworks.net).
+Passwords can be changed at any time using Webmail or the Control Panel
=================================
Control Panel
=================================
-If you need to change the details of your account, you can easily do this using the Control Panel (https://controlpanel.virtuworks.net).
+If you need to change the details of your account, you can easily do this using the Control Panel
=================================
Support
=================================
-You have 2 options, email help@virtuworks.com or use the web interface at http://www.virtuworks.com/contact/'
+You have 2 options, email or use the web interface at '
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'ExchangeMailboxSetupLetter' AND [PropertyName]= N'TextBody' )
BEGIN
From 9e9f2d5a411d21accae35685e53e43f116b57eef Mon Sep 17 00:00:00 2001
From: Virtuworks
Date: Fri, 15 May 2015 01:36:44 -0400
Subject: [PATCH 18/22] Added tag build-2.1.0.723 for changeset 0af91f09da94
From dbfdb87088afd8f8e2e3de8fef47a2d23b79f9d2 Mon Sep 17 00:00:00 2001
From: vfedosevich
Date: Fri, 15 May 2015 02:17:47 -0700
Subject: [PATCH 19/22] RDS Collections import
---
.../RemoteDesktopServicesProxy.cs | 77 ++-
.../RemoteDesktopServicesController.cs | 532 +++++++-----------
.../RemoteDesktopServicesHelpers.cs | 357 ++++++++++++
.../WebsitePanel.EnterpriseServer.Code.csproj | 1 +
.../esRemoteDesktopServices.asmx.cs | 6 +
.../IRemoteDesktopServices.cs | 2 +
.../ImportedRdsCollection.cs | 17 +
.../RdsCollectionSetting.cs | 14 +
.../RdsServerSettings.cs | 1 +
.../WebsitePanel.Providers.Base.csproj | 2 +
.../RdsRunspaceExtensions.cs | 169 ++++++
...s.RemoteDesktopServices.Windows2012.csproj | 1 +
.../Windows2012.cs | 139 ++++-
.../RemoteDesktopServicesProxy.cs | 128 +++++
.../RemoteDesktopServices.asmx.cs | 32 ++
.../ESModule_ControlsHierarchy.config | 1 +
.../App_Data/WebsitePanel_Modules.config | 1 +
.../WebsitePanel_SharedResources.ascx.resx | 6 +
.../SettingsRdsPolicy.ascx.resx | 6 +
.../RDSCollections.ascx.resx | 3 +
.../RDSImportCollection.ascx.resx | 126 +++++
.../WebsitePanel/RDS/RDSCollections.ascx | 2 +
.../WebsitePanel/RDS/RDSCollections.ascx.cs | 15 +
.../RDS/RDSCollections.ascx.designer.cs | 9 +
.../WebsitePanel/RDS/RDSCreateCollection.ascx | 2 +-
.../WebsitePanel/RDS/RDSImportCollection.ascx | 38 ++
.../RDS/RDSImportCollection.ascx.cs | 35 ++
.../RDS/RDSImportCollection.ascx.designer.cs | 78 +++
.../WebsitePanel/SettingsRdsPolicy.ascx | 13 +-
.../WebsitePanel/SettingsRdsPolicy.ascx.cs | 2 +
.../SettingsRdsPolicy.ascx.designer.cs | 27 +
.../WebsitePanel.Portal.Modules.csproj | 9 +
32 files changed, 1504 insertions(+), 347 deletions(-)
create mode 100644 WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesHelpers.cs
create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/ImportedRdsCollection.cs
create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsCollectionSetting.cs
create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/RdsRunspaceExtensions.cs
create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSImportCollection.ascx.resx
create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSImportCollection.ascx
create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSImportCollection.ascx.cs
create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSImportCollection.ascx.designer.cs
diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/RemoteDesktopServicesProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/RemoteDesktopServicesProxy.cs
index f15a1b1c..a273af30 100644
--- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/RemoteDesktopServicesProxy.cs
+++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/RemoteDesktopServicesProxy.cs
@@ -20,8 +20,8 @@ namespace WebsitePanel.EnterpriseServer {
using System.Diagnostics;
using WebsitePanel.Providers.RemoteDesktopServices;
using WebsitePanel.Providers.Common;
- using WebsitePanel.EnterpriseServer.Base.RDS;
using WebsitePanel.Providers.HostedSolution;
+ using WebsitePanel.EnterpriseServer.Base.RDS;
///
@@ -139,6 +139,8 @@ namespace WebsitePanel.EnterpriseServer {
private System.Threading.SendOrPostCallback ShadowSessionOperationCompleted;
+ private System.Threading.SendOrPostCallback ImportCollectionOperationCompleted;
+
///
public esRemoteDesktopServices() {
this.Url = "http://localhost:9002/esRemoteDesktopServices.asmx";
@@ -306,6 +308,9 @@ namespace WebsitePanel.EnterpriseServer {
///
public event ShadowSessionCompletedEventHandler ShadowSessionCompleted;
+ ///
+ public event ImportCollectionCompletedEventHandler ImportCollectionCompleted;
+
///
[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) {
@@ -2723,6 +2728,50 @@ namespace WebsitePanel.EnterpriseServer {
}
}
+ ///
+ [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/ImportCollection", 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 ImportCollection(int itemId, string collectionName) {
+ object[] results = this.Invoke("ImportCollection", new object[] {
+ itemId,
+ collectionName});
+ return ((ResultObject)(results[0]));
+ }
+
+ ///
+ public System.IAsyncResult BeginImportCollection(int itemId, string collectionName, System.AsyncCallback callback, object asyncState) {
+ return this.BeginInvoke("ImportCollection", new object[] {
+ itemId,
+ collectionName}, callback, asyncState);
+ }
+
+ ///
+ public ResultObject EndImportCollection(System.IAsyncResult asyncResult) {
+ object[] results = this.EndInvoke(asyncResult);
+ return ((ResultObject)(results[0]));
+ }
+
+ ///
+ public void ImportCollectionAsync(int itemId, string collectionName) {
+ this.ImportCollectionAsync(itemId, collectionName, null);
+ }
+
+ ///
+ public void ImportCollectionAsync(int itemId, string collectionName, object userState) {
+ if ((this.ImportCollectionOperationCompleted == null)) {
+ this.ImportCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnImportCollectionOperationCompleted);
+ }
+ this.InvokeAsync("ImportCollection", new object[] {
+ itemId,
+ collectionName}, this.ImportCollectionOperationCompleted, userState);
+ }
+
+ private void OnImportCollectionOperationCompleted(object arg) {
+ if ((this.ImportCollectionCompleted != null)) {
+ System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
+ this.ImportCollectionCompleted(this, new ImportCollectionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
+ }
+ }
+
///
public new void CancelAsync(object userState) {
base.CancelAsync(userState);
@@ -4132,4 +4181,30 @@ namespace WebsitePanel.EnterpriseServer {
}
}
}
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
+ public delegate void ImportCollectionCompletedEventHandler(object sender, ImportCollectionCompletedEventArgs e);
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.ComponentModel.DesignerCategoryAttribute("code")]
+ public partial class ImportCollectionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
+
+ private object[] results;
+
+ internal ImportCollectionCompletedEventArgs(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/RemoteDesktopServices/RemoteDesktopServicesController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs
index b2388d93..88bb4567 100644
--- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs
+++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs
@@ -137,7 +137,7 @@ namespace WebsitePanel.EnterpriseServer
}
public static List GetCollectionRdsServers(int collectionId)
- {
+ {
return GetCollectionRdsServersInternal(collectionId);
}
@@ -304,12 +304,7 @@ namespace WebsitePanel.EnterpriseServer
public static List GetRdsServices()
{
return GetRdsServicesInternal();
- }
-
- private static List GetRdsServicesInternal()
- {
- return ObjectUtils.CreateListFromDataSet(DataProvider.GetServicesByGroupName(SecurityContext.User.UserId, ResourceGroups.RDS));
- }
+ }
public static string GetRdsSetupLetter(int itemId, int? accountId)
{
@@ -336,6 +331,80 @@ namespace WebsitePanel.EnterpriseServer
return ShadowSessionInternal(itemId, sessionId, control);
}
+ public static ResultObject ImportCollection(int itemId, string collectionName)
+ {
+ return ImportCollectionInternal(itemId, collectionName);
+ }
+
+ private static ResultObject ImportCollectionInternal(int itemId, string collectionName)
+ {
+ var result = TaskManager.StartResultTask("REMOTE_DESKTOP_SERVICES", "SHADOW_RDS_SESSION");
+
+ try
+ {
+ Organization org = OrganizationController.GetOrganization(itemId);
+
+ if (org == null)
+ {
+ result.IsSuccess = false;
+ result.AddError("IMPORT_RDS_COLLECTION", new NullReferenceException("Organization not found"));
+
+ return result;
+ }
+
+ var existingCollections = GetRdsCollectionsPaged(itemId, "", "", "", 0, Int32.MaxValue).Collections;
+
+ if (existingCollections.Select(e => e.Name.ToLower()).Contains(collectionName.ToLower()))
+ {
+ result.IsSuccess = false;
+ throw new InvalidOperationException(string.Format("Collection {0} already exists in database", collectionName));
+ }
+
+ var rds = RemoteDesktopServicesHelpers.GetRemoteDesktopServices(RemoteDesktopServicesHelpers.GetRemoteDesktopServiceID(org.PackageId));
+ var collection = rds.GetExistingCollection(collectionName);
+ var newCollection = new RdsCollection
+ {
+ Name = collection.CollectionName,
+ Description = collection.Description,
+ DisplayName = collection.CollectionName
+ };
+
+ newCollection.Id = DataProvider.AddRDSCollection(itemId, newCollection.Name, newCollection.Description, newCollection.DisplayName);
+ newCollection.Settings = RemoteDesktopServicesHelpers.ParseCollectionSettings(collection.CollectionSettings);
+ newCollection.Settings.RdsCollectionId = newCollection.Id;
+ newCollection.Settings.Id = DataProvider.AddRdsCollectionSettings(newCollection.Settings);
+ var existingSessionHosts = GetRdsServersPagedInternal("", "", "", 1, 1000).Servers;
+ RemoteDesktopServicesHelpers.FillSessionHosts(collection.SessionHosts, existingSessionHosts, newCollection.Id, itemId);
+ newCollection.Servers = ObjectUtils.CreateListFromDataReader(DataProvider.GetRDSServersByCollectionId(newCollection.Id)).ToList();
+ UserInfo user = PackageController.GetPackageOwner(org.PackageId);
+ var organizationUsers = OrganizationController.GetOrganizationUsersPaged(itemId, null, null, null, 0, Int32.MaxValue).PageUsers.Select(u => u.SamAccountName.Split('\\').Last().ToLower());
+ var newUsers = organizationUsers.Where(x => collection.UserGroups.Select(a => a.PropertyValue.ToString().Split('\\').Last().ToLower()).Contains(x));
+
+ rds.ImportCollection(org.OrganizationId, newCollection, newUsers.ToArray());
+
+ var emptySettings = RemoteDesktopServicesHelpers.GetEmptyGpoSettings();
+ string xml = RemoteDesktopServicesHelpers.GetSettingsXml(emptySettings);
+ DataProvider.UpdateRdsServerSettings(newCollection.Id, string.Format("Collection-{0}-Settings", newCollection.Id), xml);
+ }
+ catch (Exception ex)
+ {
+ throw TaskManager.WriteError(ex);
+ }
+ finally
+ {
+ if (!result.IsSuccess)
+ {
+ TaskManager.CompleteResultTask(result);
+ }
+ else
+ {
+ TaskManager.CompleteResultTask();
+ }
+ }
+
+ return result;
+ }
+
private static ResultObject ShadowSessionInternal(int itemId, string sessionId, bool control)
{
var result = TaskManager.StartResultTask("REMOTE_DESKTOP_SERVICES", "SHADOW_RDS_SESSION");
@@ -352,7 +421,7 @@ namespace WebsitePanel.EnterpriseServer
return result;
}
- var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
+ var rds = RemoteDesktopServicesHelpers.GetRemoteDesktopServices(RemoteDesktopServicesHelpers.GetRemoteDesktopServiceID(org.PackageId));
rds.ShadowSession(sessionId, control);
}
catch (Exception ex)
@@ -405,10 +474,10 @@ namespace WebsitePanel.EnterpriseServer
try
{
var collection = ObjectUtils.FillObjectFromDataReader(DataProvider.GetRDSCollectionById(serverId));
- var rds = GetRemoteDesktopServices(GetRdsServiceId(collection.ItemId));
+ var rds = RemoteDesktopServicesHelpers.GetRemoteDesktopServices(GetRdsServiceId(collection.ItemId));
Organization org = OrganizationController.GetOrganization(collection.ItemId);
rds.ApplyGPO(org.OrganizationId, collection.Name, settings);
- string xml = GetSettingsXml(settings);
+ string xml = RemoteDesktopServicesHelpers.GetSettingsXml(settings);
DataProvider.UpdateRdsServerSettings(serverId, settingsName, xml);
@@ -442,8 +511,8 @@ namespace WebsitePanel.EnterpriseServer
{
return null;
}
-
- string result = EvaluateMailboxTemplate(body, org, accountId, itemId);
+
+ string result = RemoteDesktopServicesHelpers.EvaluateMailboxTemplate(body, org, accountId, itemId);
return user.HtmlMail ? result : result.Replace("\n", " ");
}
@@ -492,9 +561,9 @@ namespace WebsitePanel.EnterpriseServer
{
to = user.Email;
}
-
- subject = EvaluateMailboxTemplate(subject, org, accountId, itemId);
- body = EvaluateMailboxTemplate(body, org, accountId, itemId);
+
+ subject = RemoteDesktopServicesHelpers.EvaluateMailboxTemplate(subject, org, accountId, itemId);
+ body = RemoteDesktopServicesHelpers.EvaluateMailboxTemplate(body, org, accountId, itemId);
return MailHelper.SendMessage(from, to, cc, subject, body, priority, isHtml);
}
@@ -506,7 +575,7 @@ namespace WebsitePanel.EnterpriseServer
try
{
int serviceId = GetRdsServiceId(rdsServer.ItemId);
- var rds = GetRemoteDesktopServices(serviceId);
+ var rds = RemoteDesktopServicesHelpers.GetRemoteDesktopServices(serviceId);
var certificate = GetRdsCertificateByServiceIdInternal(serviceId);
var array = Convert.FromBase64String(certificate.Hash);
@@ -605,7 +674,7 @@ namespace WebsitePanel.EnterpriseServer
result.AddError("", new NullReferenceException("Organization not found"));
}
- var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
+ var rds = RemoteDesktopServicesHelpers.GetRemoteDesktopServices(RemoteDesktopServicesHelpers.GetRemoteDesktopServiceID(org.PackageId));
rds.GetCollection(collection.Name);
}
@@ -630,8 +699,8 @@ namespace WebsitePanel.EnterpriseServer
{
return result;
}
-
- var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
+
+ var rds = RemoteDesktopServicesHelpers.GetRemoteDesktopServices(RemoteDesktopServicesHelpers.GetRemoteDesktopServiceID(org.PackageId));
var organizationUsers = OrganizationController.GetOrganizationUsersPaged(collection.ItemId, null, null, null, 0, Int32.MaxValue).PageUsers;
var organizationAdmins = rds.GetRdsCollectionLocalAdmins(org.OrganizationId, collection.Name);
@@ -655,7 +724,7 @@ namespace WebsitePanel.EnterpriseServer
return result;
}
- var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
+ var rds = RemoteDesktopServicesHelpers.GetRemoteDesktopServices(RemoteDesktopServicesHelpers.GetRemoteDesktopServiceID(org.PackageId));
var servers = ObjectUtils.CreateListFromDataReader(DataProvider.GetRDSServersByCollectionId(collection.Id)).ToList();
rds.SaveRdsCollectionLocalAdmins(users.Select(u => u.AccountName).ToArray(), servers.Select(s => s.FqdName).ToArray(), org.OrganizationId, collection.Name);
@@ -730,7 +799,7 @@ namespace WebsitePanel.EnterpriseServer
return -1;
}
- var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
+ var rds = RemoteDesktopServicesHelpers.GetRemoteDesktopServices(RemoteDesktopServicesHelpers.GetRemoteDesktopServiceID(org.PackageId));
foreach(var server in collection.Servers)
{
@@ -744,41 +813,15 @@ namespace WebsitePanel.EnterpriseServer
throw TaskManager.WriteError(new Exception(string.Format("Unable to connect to {0} server.", server.FqdName)));
}
}
-
- collection.Name = GetFormattedCollectionName(collection.DisplayName, org.OrganizationId);
- collection.Settings = new RdsCollectionSettings
- {
- DisconnectedSessionLimitMin = 0,
- ActiveSessionLimitMin = 0,
- IdleSessionLimitMin = 0,
- BrokenConnectionAction = BrokenConnectionActionValues.Disconnect.ToString(),
- AutomaticReconnectionEnabled = true,
- TemporaryFoldersDeletedOnExit = true,
- TemporaryFoldersPerSession = true,
- ClientDeviceRedirectionOptions = string.Join(",", new List
- {
- ClientDeviceRedirectionOptionValues.AudioVideoPlayBack.ToString(),
- ClientDeviceRedirectionOptionValues.AudioRecording.ToString(),
- ClientDeviceRedirectionOptionValues.SmartCard.ToString(),
- ClientDeviceRedirectionOptionValues.Clipboard.ToString(),
- ClientDeviceRedirectionOptionValues.Drive.ToString(),
- ClientDeviceRedirectionOptionValues.PlugAndPlayDevice.ToString()
- }.ToArray()),
- ClientPrinterRedirected = true,
- ClientPrinterAsDefault = true,
- RDEasyPrintDriverEnabled = true,
- MaxRedirectedMonitors = 16,
- EncryptionLevel = EncryptionLevel.ClientCompatible.ToString(),
- SecurityLayer = SecurityLayerValues.Negotiate.ToString(),
- AuthenticateUsingNLA = true
- };
+ collection.Name = RemoteDesktopServicesHelpers.GetFormattedCollectionName(collection.DisplayName, org.OrganizationId);
+ collection.Settings = RemoteDesktopServicesHelpers.GetDefaultCollectionSettings();
rds.CreateCollection(org.OrganizationId, collection);
- var defaultGpoSettings = GetDefaultGpoSettings();
+ var defaultGpoSettings = RemoteDesktopServicesHelpers.GetDefaultGpoSettings();
rds.ApplyGPO(org.OrganizationId, collection.Name, defaultGpoSettings);
collection.Id = DataProvider.AddRDSCollection(itemId, collection.Name, collection.Description, collection.DisplayName);
- string xml = GetSettingsXml(defaultGpoSettings);
+ string xml = RemoteDesktopServicesHelpers.GetSettingsXml(defaultGpoSettings);
DataProvider.UpdateRdsServerSettings(collection.Id, string.Format("Collection-{0}-Settings", collection.Id), xml);
collection.Settings.RdsCollectionId = collection.Id;
@@ -824,7 +867,7 @@ namespace WebsitePanel.EnterpriseServer
return result;
}
- var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
+ var rds = RemoteDesktopServicesHelpers.GetRemoteDesktopServices(RemoteDesktopServicesHelpers.GetRemoteDesktopServiceID(org.PackageId));
var existingServers =
ObjectUtils.CreateListFromDataReader(DataProvider.GetRDSServersByCollectionId(collection.Id)).ToList();
var removedServers = existingServers.Where(x => !collection.Servers.Select(y => y.Id).Contains(x.Id));
@@ -876,8 +919,8 @@ namespace WebsitePanel.EnterpriseServer
result.AddError("", new NullReferenceException("Organization not found"));
return result;
}
-
- var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
+
+ var rds = RemoteDesktopServicesHelpers.GetRemoteDesktopServices(RemoteDesktopServicesHelpers.GetRemoteDesktopServiceID(org.PackageId));
rds.EditRdsCollectionSettings(collection);
var collectionSettings = ObjectUtils.FillObjectFromDataReader(DataProvider.GetRdsCollectionSettingsByCollectionId(collection.Id));
@@ -948,7 +991,7 @@ namespace WebsitePanel.EnterpriseServer
return result;
}
- var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
+ var rds = RemoteDesktopServicesHelpers.GetRemoteDesktopServices(RemoteDesktopServicesHelpers.GetRemoteDesktopServiceID(org.PackageId));
var servers = ObjectUtils.CreateListFromDataReader(DataProvider.GetRDSServersByCollectionId(collection.Id)).ToArray();
rds.RemoveCollection(org.OrganizationId, collection.Name, servers);
@@ -991,7 +1034,7 @@ namespace WebsitePanel.EnterpriseServer
return result;
}
- var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
+ var rds = RemoteDesktopServicesHelpers.GetRemoteDesktopServices(RemoteDesktopServicesHelpers.GetRemoteDesktopServiceID(org.PackageId));
result.AddRange(rds.GetAvailableRemoteApplications(collectionName));
}
@@ -1027,7 +1070,7 @@ namespace WebsitePanel.EnterpriseServer
foreach (var tmpServer in tmpServers)
{
- FillRdsServerData(tmpServer);
+ RemoteDesktopServicesHelpers.FillRdsServerData(tmpServer);
}
result.Servers = tmpServers.ToArray();
@@ -1046,7 +1089,7 @@ namespace WebsitePanel.EnterpriseServer
return result;
}
- var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(organization.PackageId));
+ var rds = RemoteDesktopServicesHelpers.GetRemoteDesktopServices(RemoteDesktopServicesHelpers.GetRemoteDesktopServiceID(organization.PackageId));
var userSessions = rds.GetRdsUserSessions(collection.Name).ToList();
var organizationUsers = OrganizationController.GetOrganizationUsersPaged(collection.ItemId, null, null, null, 0, Int32.MaxValue).PageUsers;
@@ -1074,7 +1117,7 @@ namespace WebsitePanel.EnterpriseServer
return result;
}
- var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
+ var rds = RemoteDesktopServicesHelpers.GetRemoteDesktopServices(RemoteDesktopServicesHelpers.GetRemoteDesktopServiceID(org.PackageId));
var existingServers = rds.GetServersExistingInCollections();
DataSet ds = DataProvider.GetRDSServersPaged(null, null, filterColumn, filterValue, sortColumn, startRow, maximumRows);
@@ -1100,7 +1143,7 @@ namespace WebsitePanel.EnterpriseServer
return result;
}
- var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
+ var rds = RemoteDesktopServicesHelpers.GetRemoteDesktopServices(RemoteDesktopServicesHelpers.GetRemoteDesktopServiceID(org.PackageId));
result = rds.GetRdsCollectionSessionHosts(collection.Name).ToList();
return result;
@@ -1157,7 +1200,7 @@ namespace WebsitePanel.EnterpriseServer
return result;
}
- var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
+ var rds = RemoteDesktopServicesHelpers.GetRemoteDesktopServices(RemoteDesktopServicesHelpers.GetRemoteDesktopServiceID(org.PackageId));
var rdsServer = GetRdsServer(rdsSeverId);
@@ -1189,32 +1232,7 @@ namespace WebsitePanel.EnterpriseServer
}
return result;
- }
-
- private static int GetOrganizationRdsUsersCountInternal(int itemId)
- {
- return DataProvider.GetOrganizationRdsUsersCount(itemId);
- }
-
- private static int GetOrganizationRdsServersCountInternal(int itemId)
- {
- return DataProvider.GetOrganizationRdsServersCount(itemId);
- }
-
- private static int GetOrganizationRdsCollectionsCountInternal(int itemId)
- {
- return DataProvider.GetOrganizationRdsCollectionsCount(itemId);
- }
-
- private static List GetCollectionRdsServersInternal(int collectionId)
- {
- return ObjectUtils.CreateListFromDataReader(DataProvider.GetRDSServersByCollectionId(collectionId)).ToList();
- }
-
- private static List GetOrganizationRdsServersInternal(int itemId)
- {
- return ObjectUtils.CreateListFromDataReader(DataProvider.GetRDSServersByItemId(itemId)).ToList();
- }
+ }
private static ResultObject AddRdsServerInternal(RdsServer rdsServer)
{
@@ -1223,7 +1241,7 @@ namespace WebsitePanel.EnterpriseServer
try
{
int serviceId = GetRdsMainServiceId();
- var rds = GetRemoteDesktopServices(serviceId);
+ var rds = RemoteDesktopServicesHelpers.GetRemoteDesktopServices(serviceId);
if (rds.CheckRDSServerAvaliable(rdsServer.FqdName))
{
@@ -1275,7 +1293,7 @@ namespace WebsitePanel.EnterpriseServer
return result;
}
- var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
+ var rds = RemoteDesktopServicesHelpers.GetRemoteDesktopServices(RemoteDesktopServicesHelpers.GetRemoteDesktopServiceID(org.PackageId));
if (!rds.CheckSessionHostFeatureInstallation(rdsServer.FqdName))
{
@@ -1320,7 +1338,7 @@ namespace WebsitePanel.EnterpriseServer
return result;
}
- var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
+ var rds = RemoteDesktopServicesHelpers.GetRemoteDesktopServices(RemoteDesktopServicesHelpers.GetRemoteDesktopServiceID(org.PackageId));
rds.RemoveSessionHostServerFromCollection(org.OrganizationId, rdsCollection.Name, rdsServer);
@@ -1387,7 +1405,7 @@ namespace WebsitePanel.EnterpriseServer
return result;
}
- var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
+ var rds = RemoteDesktopServicesHelpers.GetRemoteDesktopServices(RemoteDesktopServicesHelpers.GetRemoteDesktopServiceID(org.PackageId));
RdsServer rdsServer = GetRdsServer(serverId);
rds.MoveRdsServerToTenantOU(rdsServer.FqdName, org.OrganizationId);
@@ -1428,7 +1446,7 @@ namespace WebsitePanel.EnterpriseServer
}
var rdsServer = ObjectUtils.FillObjectFromDataReader(DataProvider.GetRDSServerById(rdsServerId));
- var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
+ var rds = RemoteDesktopServicesHelpers.GetRemoteDesktopServices(RemoteDesktopServicesHelpers.GetRemoteDesktopServiceID(org.PackageId));
rds.RemoveRdsServerFromTenantOU(rdsServer.FqdName, org.OrganizationId);
DataProvider.RemoveRDSServerFromOrganization(rdsServerId);
}
@@ -1498,7 +1516,7 @@ namespace WebsitePanel.EnterpriseServer
return result;
}
- var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
+ var rds = RemoteDesktopServicesHelpers.GetRemoteDesktopServices(RemoteDesktopServicesHelpers.GetRemoteDesktopServiceID(org.PackageId));
var collection = GetRdsCollection(collectionId);
@@ -1571,7 +1589,7 @@ namespace WebsitePanel.EnterpriseServer
return result;
}
- var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
+ var rds = RemoteDesktopServicesHelpers.GetRemoteDesktopServices(RemoteDesktopServicesHelpers.GetRemoteDesktopServiceID(org.PackageId));
var collection = ObjectUtils.FillObjectFromDataReader(DataProvider.GetRDSCollectionById(collectionId));
var users = rds.GetApplicationUsers(collection.Name, remoteApp.Alias);
result.AddRange(users);
@@ -1594,7 +1612,7 @@ namespace WebsitePanel.EnterpriseServer
}
var collection = ObjectUtils.FillObjectFromDataReader(DataProvider.GetRDSCollectionById(collectionId));
- var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
+ var rds = RemoteDesktopServicesHelpers.GetRemoteDesktopServices(RemoteDesktopServicesHelpers.GetRemoteDesktopServiceID(org.PackageId));
rds.SetApplicationUsers(collection.Name, remoteApp, users.ToArray());
}
catch (Exception ex)
@@ -1631,8 +1649,8 @@ namespace WebsitePanel.EnterpriseServer
return result;
}
-
- var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
+
+ var rds = RemoteDesktopServicesHelpers.GetRemoteDesktopServices(RemoteDesktopServicesHelpers.GetRemoteDesktopServiceID(org.PackageId));
rds.LogOffRdsUser(unifiedSessionId, hostServer);
}
catch (Exception ex)
@@ -1669,7 +1687,7 @@ namespace WebsitePanel.EnterpriseServer
return result;
}
- var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
+ var rds = RemoteDesktopServicesHelpers.GetRemoteDesktopServices(RemoteDesktopServicesHelpers.GetRemoteDesktopServiceID(org.PackageId));
if (!string.IsNullOrEmpty(remoteApp.Alias))
{
@@ -1696,41 +1714,7 @@ namespace WebsitePanel.EnterpriseServer
}
return result;
- }
-
- private static RdsServerInfo GetRdsServerInfoInternal(int? itemId, string fqdnName)
- {
- int serviceId = GetRdsServiceId(itemId);
- var result = new RdsServerInfo();
-
- if (serviceId != -1)
- {
- var rds = GetRemoteDesktopServices(serviceId);
- result = rds.GetRdsServerInfo(fqdnName);
- }
-
- return result;
- }
-
- private static string GetRdsServerStatusInternal(int? itemId, string fqdnName)
- {
- var result = "Unavailable";
- var serviceId = GetRdsServiceId(itemId);
-
- try
- {
- if (serviceId != -1)
- {
- var rds = GetRemoteDesktopServices(serviceId);
- result = rds.GetRdsServerStatus(fqdnName);
- }
- }
- catch
- {
- }
-
- return result;
- }
+ }
private static ResultObject ShutDownRdsServerInternal(int? itemId, string fqdnName)
{
@@ -1742,7 +1726,7 @@ namespace WebsitePanel.EnterpriseServer
if (serviceId != -1)
{
- var rds = GetRemoteDesktopServices(serviceId);
+ var rds = RemoteDesktopServicesHelpers.GetRemoteDesktopServices(serviceId);
rds.ShutDownRdsServer(fqdnName);
}
}
@@ -1775,7 +1759,7 @@ namespace WebsitePanel.EnterpriseServer
if (serviceId != -1)
{
- var rds = GetRemoteDesktopServices(serviceId);
+ var rds = RemoteDesktopServicesHelpers.GetRemoteDesktopServices(serviceId);
rds.RestartRdsServer(fqdnName);
}
}
@@ -1810,7 +1794,7 @@ namespace WebsitePanel.EnterpriseServer
return result;
}
- var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
+ var rds = RemoteDesktopServicesHelpers.GetRemoteDesktopServices(RemoteDesktopServicesHelpers.GetRemoteDesktopServiceID(org.PackageId));
result.AddRange(rds.GetCollectionRemoteApplications(collectionName));
@@ -1832,7 +1816,7 @@ namespace WebsitePanel.EnterpriseServer
return result;
}
- var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
+ var rds = RemoteDesktopServicesHelpers.GetRemoteDesktopServices(RemoteDesktopServicesHelpers.GetRemoteDesktopServiceID(org.PackageId));
rds.RemoveRemoteApplication(collection.Name, application);
}
@@ -1869,7 +1853,7 @@ namespace WebsitePanel.EnterpriseServer
return result;
}
- var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
+ var rds = RemoteDesktopServicesHelpers.GetRemoteDesktopServices(RemoteDesktopServicesHelpers.GetRemoteDesktopServiceID(org.PackageId));
var collection = GetRdsCollection(collectionId);
@@ -1911,35 +1895,7 @@ namespace WebsitePanel.EnterpriseServer
}
return result;
- }
-
- private static RdsCollection FillRdsCollection(RdsCollection collection)
- {
- collection.Servers = GetCollectionRdsServers(collection.Id) ?? new List();
-
- return collection;
- }
-
- private static RdsServer FillRdsServerData(RdsServer server)
- {
- server.Address = GetServerIp(server.FqdName).ToString();
-
- return server;
- }
-
- private static System.Net.IPAddress GetServerIp(string hostname, AddressFamily addressFamily = AddressFamily.InterNetwork)
- {
- var address = GetServerIps(hostname);
-
- return address.FirstOrDefault(x => x.AddressFamily == addressFamily);
- }
-
- private static IEnumerable GetServerIps(string hostname)
- {
- var address = Dns.GetHostAddresses(hostname);
-
- return address;
- }
+ }
private static ResultObject DeleteRemoteDesktopServiceInternal(int itemId)
{
@@ -1980,49 +1936,43 @@ namespace WebsitePanel.EnterpriseServer
return result;
}
- private static int GetRemoteDesktopServiceID(int packageId)
+ private static int GetOrganizationRdsUsersCountInternal(int itemId)
{
- return PackageController.GetPackageServiceId(packageId, ResourceGroups.RDS);
- }
-
- private static int GetRdsServiceId(int? itemId)
- {
- int serviceId = -1;
-
- if (itemId.HasValue)
- {
- Organization org = OrganizationController.GetOrganization(itemId.Value);
-
- if (org == null)
- {
- return serviceId;
- }
-
- serviceId = GetRemoteDesktopServiceID(org.PackageId);
- }
- else
- {
- serviceId = GetRdsMainServiceId();
- }
-
- return serviceId;
+ return DataProvider.GetOrganizationRdsUsersCount(itemId);
}
- private static RemoteDesktopServices GetRemoteDesktopServices(int serviceId)
+ private static int GetOrganizationRdsServersCountInternal(int itemId)
{
- var rds = new RemoteDesktopServices();
- ServiceProviderProxy.Init(rds, serviceId);
-
- return rds;
+ return DataProvider.GetOrganizationRdsServersCount(itemId);
}
- private static int GetRdsMainServiceId()
+ private static int GetOrganizationRdsCollectionsCountInternal(int itemId)
{
- var settings = SystemController.GetSystemSettings(WebsitePanel.EnterpriseServer.SystemSettings.RDS_SETTINGS);
+ return DataProvider.GetOrganizationRdsCollectionsCount(itemId);
+ }
+
+ private static List GetCollectionRdsServersInternal(int collectionId)
+ {
+ return ObjectUtils.CreateListFromDataReader(DataProvider.GetRDSServersByCollectionId(collectionId)).ToList();
+ }
+
+ private static List GetOrganizationRdsServersInternal(int itemId)
+ {
+ return ObjectUtils.CreateListFromDataReader(DataProvider.GetRDSServersByItemId(itemId)).ToList();
+ }
+
+ private static List GetRdsServicesInternal()
+ {
+ return ObjectUtils.CreateListFromDataSet(DataProvider.GetServicesByGroupName(SecurityContext.User.UserId, ResourceGroups.RDS));
+ }
+
+ protected static int GetRdsMainServiceId()
+ {
+ var settings = SystemController.GetSystemSettings(WebsitePanel.EnterpriseServer.SystemSettings.RDS_SETTINGS);
if (!string.IsNullOrEmpty(settings["RdsMainController"]))
{
- return Convert.ToInt32(settings["RdsMainController"]);
+ return Convert.ToInt32(settings["RdsMainController"]);
}
var rdsServices = GetRdsServicesInternal();
@@ -2035,146 +1985,68 @@ namespace WebsitePanel.EnterpriseServer
return -1;
}
- private static string GetFormattedCollectionName(string displayName, string organizationId)
+ protected static RdsCollection FillRdsCollection(RdsCollection collection)
{
- return string.Format("{0}-{1}", organizationId, displayName.Replace(" ", "_"));
+ collection.Servers = GetCollectionRdsServersInternal(collection.Id) ?? new List();
+
+ return collection;
}
- private static string EvaluateMailboxTemplate(string template, Organization org, int? accountId, int itemId)
+ protected static int GetRdsServiceId(int? itemId)
{
- OrganizationUser user = null;
+ int serviceId = -1;
- if (accountId.HasValue)
+ if (itemId.HasValue)
{
- user = OrganizationController.GetAccount(itemId, accountId.Value);
- }
+ Organization org = OrganizationController.GetOrganization(itemId.Value);
- Hashtable items = new Hashtable();
- items["Organization"] = org;
-
- if (user != null)
- {
- items["account"] = user;
- }
-
- return PackageController.EvaluateTemplate(template, items);
- }
-
- private static RdsServerSettings GetDefaultGpoSettings()
- {
- var defaultSettings = UserController.GetUserSettings(SecurityContext.User.UserId, UserSettings.RDS_POLICY);
- var settings = new RdsServerSettings();
-
- settings.Settings.Add(new RdsServerSetting
- {
- PropertyName = RdsServerSettings.LOCK_SCREEN_TIMEOUT,
- PropertyValue = defaultSettings[RdsServerSettings.LOCK_SCREEN_TIMEOUT_VALUE],
- ApplyAdministrators = Convert.ToBoolean(defaultSettings[RdsServerSettings.LOCK_SCREEN_TIMEOUT_ADMINISTRATORS]),
- ApplyUsers = Convert.ToBoolean(defaultSettings[RdsServerSettings.LOCK_SCREEN_TIMEOUT_USERS])
- });
-
- settings.Settings.Add(new RdsServerSetting
- {
- PropertyName = RdsServerSettings.REMOVE_RUN_COMMAND,
- PropertyValue = "",
- ApplyAdministrators = Convert.ToBoolean(defaultSettings[RdsServerSettings.REMOVE_RUN_COMMAND_ADMINISTRATORS]),
- ApplyUsers = Convert.ToBoolean(defaultSettings[RdsServerSettings.REMOVE_RUN_COMMAND_USERS])
- });
-
- settings.Settings.Add(new RdsServerSetting
- {
- PropertyName = RdsServerSettings.REMOVE_POWERSHELL_COMMAND,
- PropertyValue = "",
- ApplyAdministrators = Convert.ToBoolean(defaultSettings[RdsServerSettings.REMOVE_POWERSHELL_COMMAND_ADMINISTRATORS]),
- ApplyUsers = Convert.ToBoolean(defaultSettings[RdsServerSettings.REMOVE_POWERSHELL_COMMAND_USERS])
- });
-
- settings.Settings.Add(new RdsServerSetting
- {
- PropertyName = RdsServerSettings.HIDE_C_DRIVE,
- PropertyValue = "",
- ApplyAdministrators = Convert.ToBoolean(defaultSettings[RdsServerSettings.HIDE_C_DRIVE_ADMINISTRATORS]),
- ApplyUsers = Convert.ToBoolean(defaultSettings[RdsServerSettings.HIDE_C_DRIVE_USERS])
- });
-
- settings.Settings.Add(new RdsServerSetting
- {
- PropertyName = RdsServerSettings.REMOVE_SHUTDOWN_RESTART,
- PropertyValue = "",
- ApplyAdministrators = Convert.ToBoolean(defaultSettings[RdsServerSettings.REMOVE_SHUTDOWN_RESTART_ADMINISTRATORS]),
- ApplyUsers = Convert.ToBoolean(defaultSettings[RdsServerSettings.REMOVE_SHUTDOWN_RESTART_USERS])
- });
-
- settings.Settings.Add(new RdsServerSetting
- {
- PropertyName = RdsServerSettings.DISABLE_TASK_MANAGER,
- PropertyValue = "",
- ApplyAdministrators = Convert.ToBoolean(defaultSettings[RdsServerSettings.DISABLE_TASK_MANAGER_ADMINISTRATORS]),
- ApplyUsers = Convert.ToBoolean(defaultSettings[RdsServerSettings.DISABLE_TASK_MANAGER_USERS])
- });
-
- settings.Settings.Add(new RdsServerSetting
- {
- PropertyName = RdsServerSettings.CHANGE_DESKTOP_DISABLED,
- PropertyValue = "",
- ApplyAdministrators = Convert.ToBoolean(defaultSettings[RdsServerSettings.CHANGE_DESKTOP_DISABLED_ADMINISTRATORS]),
- ApplyUsers = Convert.ToBoolean(defaultSettings[RdsServerSettings.CHANGE_DESKTOP_DISABLED_USERS])
- });
-
- settings.Settings.Add(new RdsServerSetting
- {
- PropertyName = RdsServerSettings.SCREEN_SAVER_DISABLED,
- PropertyValue = "",
- ApplyAdministrators = Convert.ToBoolean(defaultSettings[RdsServerSettings.SCREEN_SAVER_DISABLED_ADMINISTRATORS]),
- ApplyUsers = Convert.ToBoolean(defaultSettings[RdsServerSettings.SCREEN_SAVER_DISABLED_USERS])
- });
-
- settings.Settings.Add(new RdsServerSetting
- {
- PropertyName = RdsServerSettings.RDS_VIEW_WITHOUT_PERMISSION,
- PropertyValue = "",
- ApplyAdministrators = Convert.ToBoolean(defaultSettings[RdsServerSettings.RDS_VIEW_WITHOUT_PERMISSION_ADMINISTRATORS]),
- ApplyUsers = Convert.ToBoolean(defaultSettings[RdsServerSettings.RDS_VIEW_WITHOUT_PERMISSION_Users])
- });
-
- settings.Settings.Add(new RdsServerSetting
- {
- PropertyName = RdsServerSettings.RDS_CONTROL_WITHOUT_PERMISSION,
- PropertyValue = "",
- ApplyAdministrators = Convert.ToBoolean(defaultSettings[RdsServerSettings.RDS_CONTROL_WITHOUT_PERMISSION_ADMINISTRATORS]),
- ApplyUsers = Convert.ToBoolean(defaultSettings[RdsServerSettings.RDS_CONTROL_WITHOUT_PERMISSION_Users])
- });
-
- settings.Settings.Add(new RdsServerSetting
- {
- PropertyName = RdsServerSettings.DISABLE_CMD,
- PropertyValue = "",
- ApplyAdministrators = Convert.ToBoolean(defaultSettings[RdsServerSettings.DISABLE_CMD_ADMINISTRATORS]),
- ApplyUsers = Convert.ToBoolean(defaultSettings[RdsServerSettings.DISABLE_CMD_USERS])
- });
-
- return settings;
- }
-
- private static string GetSettingsXml(RdsServerSettings settings)
- {
- XmlDocument doc = new XmlDocument();
- XmlElement nodeProps = doc.CreateElement("properties");
-
- if (settings != null)
- {
- foreach (var setting in settings.Settings)
+ if (org == null)
{
- XmlElement nodeProp = doc.CreateElement("property");
- nodeProp.SetAttribute("name", setting.PropertyName);
- nodeProp.SetAttribute("value", setting.PropertyValue);
- nodeProp.SetAttribute("applyUsers", setting.ApplyUsers ? "1" : "0");
- nodeProp.SetAttribute("applyAdministrators", setting.ApplyAdministrators ? "1" : "0");
- nodeProps.AppendChild(nodeProp);
+ return serviceId;
+ }
+
+ serviceId = RemoteDesktopServicesHelpers.GetRemoteDesktopServiceID(org.PackageId);
+ }
+ else
+ {
+ serviceId = GetRdsMainServiceId();
+ }
+
+ return serviceId;
+ }
+
+ private static RdsServerInfo GetRdsServerInfoInternal(int? itemId, string fqdnName)
+ {
+ int serviceId = GetRdsServiceId(itemId);
+ var result = new RdsServerInfo();
+
+ if (serviceId != -1)
+ {
+ var rds = RemoteDesktopServicesHelpers.GetRemoteDesktopServices(serviceId);
+ result = rds.GetRdsServerInfo(fqdnName);
+ }
+
+ return result;
+ }
+
+ private static string GetRdsServerStatusInternal(int? itemId, string fqdnName)
+ {
+ var result = "Unavailable";
+ var serviceId = GetRdsServiceId(itemId);
+
+ try
+ {
+ if (serviceId != -1)
+ {
+ var rds = RemoteDesktopServicesHelpers.GetRemoteDesktopServices(serviceId);
+ result = rds.GetRdsServerStatus(fqdnName);
}
}
+ catch
+ {
+ }
- return nodeProps.OuterXml;
- }
+ return result;
+ }
}
}
diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesHelpers.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesHelpers.cs
new file mode 100644
index 00000000..e18e9a73
--- /dev/null
+++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesHelpers.cs
@@ -0,0 +1,357 @@
+using System;
+using System.Collections;
+using System.Collections.Generic;
+using System.Linq;
+using System.Net;
+using System.Net.NetworkInformation;
+using System.Net.Sockets;
+using System.Text;
+using System.Xml;
+using WebsitePanel.EnterpriseServer.Base.RDS;
+using WebsitePanel.Providers.HostedSolution;
+using WebsitePanel.Providers.RemoteDesktopServices;
+
+namespace WebsitePanel.EnterpriseServer
+{
+ public class RemoteDesktopServicesHelpers
+ {
+ public static string GetFormattedCollectionName(string displayName, string organizationId)
+ {
+ return string.Format("{0}-{1}", organizationId, displayName.Replace(" ", "_"));
+ }
+
+ public static string EvaluateMailboxTemplate(string template, Organization org, int? accountId, int itemId)
+ {
+ OrganizationUser user = null;
+
+ if (accountId.HasValue)
+ {
+ user = OrganizationController.GetAccount(itemId, accountId.Value);
+ }
+
+ Hashtable items = new Hashtable();
+ items["Organization"] = org;
+
+ if (user != null)
+ {
+ items["account"] = user;
+ }
+
+ return PackageController.EvaluateTemplate(template, items);
+ }
+
+ public static RdsCollectionSettings GetDefaultCollectionSettings()
+ {
+ return new RdsCollectionSettings
+ {
+ DisconnectedSessionLimitMin = 0,
+ ActiveSessionLimitMin = 0,
+ IdleSessionLimitMin = 0,
+ BrokenConnectionAction = BrokenConnectionActionValues.Disconnect.ToString(),
+ AutomaticReconnectionEnabled = true,
+ TemporaryFoldersDeletedOnExit = true,
+ TemporaryFoldersPerSession = true,
+ ClientDeviceRedirectionOptions = string.Join(",", new List
+ {
+ ClientDeviceRedirectionOptionValues.AudioVideoPlayBack.ToString(),
+ ClientDeviceRedirectionOptionValues.AudioRecording.ToString(),
+ ClientDeviceRedirectionOptionValues.SmartCard.ToString(),
+ ClientDeviceRedirectionOptionValues.Clipboard.ToString(),
+ ClientDeviceRedirectionOptionValues.Drive.ToString(),
+ ClientDeviceRedirectionOptionValues.PlugAndPlayDevice.ToString()
+ }.ToArray()),
+ ClientPrinterRedirected = true,
+ ClientPrinterAsDefault = true,
+ RDEasyPrintDriverEnabled = true,
+ MaxRedirectedMonitors = 16,
+ EncryptionLevel = EncryptionLevel.ClientCompatible.ToString(),
+ SecurityLayer = SecurityLayerValues.Negotiate.ToString(),
+ AuthenticateUsingNLA = true
+ };
+ }
+
+ public static RdsServerSettings GetDefaultGpoSettings()
+ {
+ var defaultSettings = UserController.GetUserSettings(SecurityContext.User.UserId, UserSettings.RDS_POLICY);
+ var settings = new RdsServerSettings();
+
+ settings.Settings.Add(new RdsServerSetting
+ {
+ PropertyName = RdsServerSettings.LOCK_SCREEN_TIMEOUT,
+ PropertyValue = defaultSettings[RdsServerSettings.LOCK_SCREEN_TIMEOUT_VALUE],
+ ApplyAdministrators = Convert.ToBoolean(defaultSettings[RdsServerSettings.LOCK_SCREEN_TIMEOUT_ADMINISTRATORS]),
+ ApplyUsers = Convert.ToBoolean(defaultSettings[RdsServerSettings.LOCK_SCREEN_TIMEOUT_USERS])
+ });
+
+ settings.Settings.Add(new RdsServerSetting
+ {
+ PropertyName = RdsServerSettings.REMOVE_RUN_COMMAND,
+ PropertyValue = "",
+ ApplyAdministrators = Convert.ToBoolean(defaultSettings[RdsServerSettings.REMOVE_RUN_COMMAND_ADMINISTRATORS]),
+ ApplyUsers = Convert.ToBoolean(defaultSettings[RdsServerSettings.REMOVE_RUN_COMMAND_USERS])
+ });
+
+ settings.Settings.Add(new RdsServerSetting
+ {
+ PropertyName = RdsServerSettings.REMOVE_POWERSHELL_COMMAND,
+ PropertyValue = "",
+ ApplyAdministrators = Convert.ToBoolean(defaultSettings[RdsServerSettings.REMOVE_POWERSHELL_COMMAND_ADMINISTRATORS]),
+ ApplyUsers = Convert.ToBoolean(defaultSettings[RdsServerSettings.REMOVE_POWERSHELL_COMMAND_USERS])
+ });
+
+ settings.Settings.Add(new RdsServerSetting
+ {
+ PropertyName = RdsServerSettings.HIDE_C_DRIVE,
+ PropertyValue = "",
+ ApplyAdministrators = Convert.ToBoolean(defaultSettings[RdsServerSettings.HIDE_C_DRIVE_ADMINISTRATORS]),
+ ApplyUsers = Convert.ToBoolean(defaultSettings[RdsServerSettings.HIDE_C_DRIVE_USERS])
+ });
+
+ settings.Settings.Add(new RdsServerSetting
+ {
+ PropertyName = RdsServerSettings.REMOVE_SHUTDOWN_RESTART,
+ PropertyValue = "",
+ ApplyAdministrators = Convert.ToBoolean(defaultSettings[RdsServerSettings.REMOVE_SHUTDOWN_RESTART_ADMINISTRATORS]),
+ ApplyUsers = Convert.ToBoolean(defaultSettings[RdsServerSettings.REMOVE_SHUTDOWN_RESTART_USERS])
+ });
+
+ settings.Settings.Add(new RdsServerSetting
+ {
+ PropertyName = RdsServerSettings.DISABLE_TASK_MANAGER,
+ PropertyValue = "",
+ ApplyAdministrators = Convert.ToBoolean(defaultSettings[RdsServerSettings.DISABLE_TASK_MANAGER_ADMINISTRATORS]),
+ ApplyUsers = Convert.ToBoolean(defaultSettings[RdsServerSettings.DISABLE_TASK_MANAGER_USERS])
+ });
+
+ settings.Settings.Add(new RdsServerSetting
+ {
+ PropertyName = RdsServerSettings.CHANGE_DESKTOP_DISABLED,
+ PropertyValue = "",
+ ApplyAdministrators = Convert.ToBoolean(defaultSettings[RdsServerSettings.CHANGE_DESKTOP_DISABLED_ADMINISTRATORS]),
+ ApplyUsers = Convert.ToBoolean(defaultSettings[RdsServerSettings.CHANGE_DESKTOP_DISABLED_USERS])
+ });
+
+ settings.Settings.Add(new RdsServerSetting
+ {
+ PropertyName = RdsServerSettings.SCREEN_SAVER_DISABLED,
+ PropertyValue = "",
+ ApplyAdministrators = Convert.ToBoolean(defaultSettings[RdsServerSettings.SCREEN_SAVER_DISABLED_ADMINISTRATORS]),
+ ApplyUsers = Convert.ToBoolean(defaultSettings[RdsServerSettings.SCREEN_SAVER_DISABLED_USERS])
+ });
+
+ settings.Settings.Add(new RdsServerSetting
+ {
+ PropertyName = RdsServerSettings.RDS_VIEW_WITHOUT_PERMISSION,
+ PropertyValue = "",
+ ApplyAdministrators = Convert.ToBoolean(defaultSettings[RdsServerSettings.RDS_VIEW_WITHOUT_PERMISSION_ADMINISTRATORS]),
+ ApplyUsers = Convert.ToBoolean(defaultSettings[RdsServerSettings.RDS_VIEW_WITHOUT_PERMISSION_Users])
+ });
+
+ settings.Settings.Add(new RdsServerSetting
+ {
+ PropertyName = RdsServerSettings.RDS_CONTROL_WITHOUT_PERMISSION,
+ PropertyValue = "",
+ ApplyAdministrators = Convert.ToBoolean(defaultSettings[RdsServerSettings.RDS_CONTROL_WITHOUT_PERMISSION_ADMINISTRATORS]),
+ ApplyUsers = Convert.ToBoolean(defaultSettings[RdsServerSettings.RDS_CONTROL_WITHOUT_PERMISSION_Users])
+ });
+
+ settings.Settings.Add(new RdsServerSetting
+ {
+ PropertyName = RdsServerSettings.DISABLE_CMD,
+ PropertyValue = "",
+ ApplyAdministrators = Convert.ToBoolean(defaultSettings[RdsServerSettings.DISABLE_CMD_ADMINISTRATORS]),
+ ApplyUsers = Convert.ToBoolean(defaultSettings[RdsServerSettings.DISABLE_CMD_USERS])
+ });
+
+ return settings;
+ }
+
+ public static RdsServerSettings GetEmptyGpoSettings()
+ {
+ var defaultSettings = UserController.GetUserSettings(SecurityContext.User.UserId, UserSettings.RDS_POLICY);
+ var settings = new RdsServerSettings();
+
+ settings.Settings.Add(new RdsServerSetting
+ {
+ PropertyName = RdsServerSettings.LOCK_SCREEN_TIMEOUT,
+ PropertyValue = defaultSettings[RdsServerSettings.LOCK_SCREEN_TIMEOUT_VALUE]
+ });
+
+ settings.Settings.Add(new RdsServerSetting
+ {
+ PropertyName = RdsServerSettings.REMOVE_RUN_COMMAND,
+ PropertyValue = ""
+ });
+
+ settings.Settings.Add(new RdsServerSetting
+ {
+ PropertyName = RdsServerSettings.REMOVE_POWERSHELL_COMMAND,
+ PropertyValue = ""
+ });
+
+ settings.Settings.Add(new RdsServerSetting
+ {
+ PropertyName = RdsServerSettings.HIDE_C_DRIVE,
+ PropertyValue = ""
+ });
+
+ settings.Settings.Add(new RdsServerSetting
+ {
+ PropertyName = RdsServerSettings.REMOVE_SHUTDOWN_RESTART,
+ PropertyValue = ""
+ });
+
+ settings.Settings.Add(new RdsServerSetting
+ {
+ PropertyName = RdsServerSettings.DISABLE_TASK_MANAGER,
+ PropertyValue = ""
+ });
+
+ settings.Settings.Add(new RdsServerSetting
+ {
+ PropertyName = RdsServerSettings.CHANGE_DESKTOP_DISABLED,
+ PropertyValue = ""
+ });
+
+ settings.Settings.Add(new RdsServerSetting
+ {
+ PropertyName = RdsServerSettings.SCREEN_SAVER_DISABLED,
+ PropertyValue = ""
+ });
+
+ settings.Settings.Add(new RdsServerSetting
+ {
+ PropertyName = RdsServerSettings.RDS_VIEW_WITHOUT_PERMISSION,
+ PropertyValue = ""
+ });
+
+ settings.Settings.Add(new RdsServerSetting
+ {
+ PropertyName = RdsServerSettings.RDS_CONTROL_WITHOUT_PERMISSION,
+ PropertyValue = ""
+ });
+
+ settings.Settings.Add(new RdsServerSetting
+ {
+ PropertyName = RdsServerSettings.DISABLE_CMD,
+ PropertyValue = ""
+ });
+
+ return settings;
+ }
+
+ public static string GetSettingsXml(RdsServerSettings settings)
+ {
+ XmlDocument doc = new XmlDocument();
+ XmlElement nodeProps = doc.CreateElement("properties");
+
+ if (settings != null)
+ {
+ foreach (var setting in settings.Settings)
+ {
+ XmlElement nodeProp = doc.CreateElement("property");
+ nodeProp.SetAttribute("name", setting.PropertyName);
+ nodeProp.SetAttribute("value", setting.PropertyValue);
+ nodeProp.SetAttribute("applyUsers", setting.ApplyUsers ? "1" : "0");
+ nodeProp.SetAttribute("applyAdministrators", setting.ApplyAdministrators ? "1" : "0");
+ nodeProps.AppendChild(nodeProp);
+ }
+ }
+
+ return nodeProps.OuterXml;
+ }
+
+ public static int GetRemoteDesktopServiceID(int packageId)
+ {
+ return PackageController.GetPackageServiceId(packageId, ResourceGroups.RDS);
+ }
+
+ public static RemoteDesktopServices GetRemoteDesktopServices(int serviceId)
+ {
+ var rds = new RemoteDesktopServices();
+ ServiceProviderProxy.Init(rds, serviceId);
+
+ return rds;
+ }
+
+ public static RdsServer FillRdsServerData(RdsServer server)
+ {
+ server.Address = GetServerIp(server.FqdName).ToString();
+
+ return server;
+ }
+
+ public static System.Net.IPAddress GetServerIp(string hostname, AddressFamily addressFamily = AddressFamily.InterNetwork)
+ {
+ var address = GetServerIps(hostname);
+
+ return address.FirstOrDefault(x => x.AddressFamily == addressFamily);
+ }
+
+ public static RdsCollectionSettings ParseCollectionSettings(List settings)
+ {
+ var collectionSettings = new RdsCollectionSettings();
+ var properties = typeof(RdsCollectionSettings).GetProperties().Where(p => p.Name.ToLower() != "id" && p.Name.ToLower() != "rdscollectionid");
+
+ foreach (var prop in properties)
+ {
+ var values = settings.Where(s => s.PropertyName.Equals(prop.Name, StringComparison.InvariantCultureIgnoreCase));
+
+ if (values.Count() == 1)
+ {
+ switch(prop.Name.ToLower())
+ {
+ case "brokenconnectionaction":
+ prop.SetValue(collectionSettings, ((BrokenConnectionActionValues)values.First().PropertyValue).ToString(), null);
+ break;
+ case "clientdeviceredirectionoptions":
+ prop.SetValue(collectionSettings, ((ClientDeviceRedirectionOptionValues)values.First().PropertyValue).ToString(), null);
+ break;
+ case "encryptionlevel":
+ prop.SetValue(collectionSettings, ((EncryptionLevel)values.First().PropertyValue).ToString(), null);
+ break;
+ case "securitylayer":
+ prop.SetValue(collectionSettings, ((SecurityLayerValues)values.First().PropertyValue).ToString(), null);
+ break;
+ default:
+ prop.SetValue(collectionSettings, Convert.ChangeType(values.First().PropertyValue, prop.PropertyType), null);
+ break;
+ }
+ }
+ }
+
+ return collectionSettings;
+ }
+
+ public static void FillSessionHosts(IEnumerable sessionHosts, IEnumerable existingSessionHosts, int collectionId, int itemId)
+ {
+ var domainName = string.Format(".{0}", IPGlobalProperties.GetIPGlobalProperties().DomainName);
+
+ foreach (var sessionHost in sessionHosts)
+ {
+ var existingSessionHost = existingSessionHosts.FirstOrDefault(e => e.FqdName.Equals(sessionHost, StringComparison.InvariantCultureIgnoreCase));
+ int serverId = -1;
+
+ if (existingSessionHost == null)
+ {
+ var serverName = sessionHost.Replace(domainName, "");
+ serverId = DataProvider.AddRDSServer(serverName, sessionHost, "");
+ }
+ else
+ {
+ serverId = existingSessionHost.Id;
+ }
+
+ DataProvider.AddRDSServerToOrganization(itemId, serverId);
+ DataProvider.AddRDSServerToCollection(serverId, collectionId);
+ }
+ }
+
+ private static IEnumerable GetServerIps(string hostname)
+ {
+ var address = Dns.GetHostAddresses(hostname);
+
+ return address;
+ }
+ }
+}
diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/WebsitePanel.EnterpriseServer.Code.csproj b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/WebsitePanel.EnterpriseServer.Code.csproj
index 1532ee8a..21b45545 100644
--- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/WebsitePanel.EnterpriseServer.Code.csproj
+++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/WebsitePanel.EnterpriseServer.Code.csproj
@@ -146,6 +146,7 @@
+
diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esRemoteDesktopServices.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esRemoteDesktopServices.asmx.cs
index b99ea321..e509dd99 100644
--- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esRemoteDesktopServices.asmx.cs
+++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esRemoteDesktopServices.asmx.cs
@@ -386,5 +386,11 @@ namespace WebsitePanel.EnterpriseServer
{
return RemoteDesktopServicesController.ShadowSession(itemId, sessionId, control);
}
+
+ [WebMethod]
+ public ResultObject ImportCollection(int itemId, string collectionName)
+ {
+ return RemoteDesktopServicesController.ImportCollection(itemId, collectionName);
+ }
}
}
diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/IRemoteDesktopServices.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/IRemoteDesktopServices.cs
index 2cfe5b06..67dbde9c 100644
--- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/IRemoteDesktopServices.cs
+++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/IRemoteDesktopServices.cs
@@ -84,5 +84,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
void ApplyGPO(string organizationId, string collectionName, RdsServerSettings serverSettings);
void ShadowSession(string sessionId, bool control);
void MoveSessionHostsToCollectionOU(List servers, string collectionName, string organizationId);
+ ImportedRdsCollection GetExistingCollection(string collectionName);
+ void ImportCollection(string organizationId, RdsCollection collection, List users);
}
}
diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/ImportedRdsCollection.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/ImportedRdsCollection.cs
new file mode 100644
index 00000000..a1c4b64a
--- /dev/null
+++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/ImportedRdsCollection.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using WebsitePanel.EnterpriseServer.Base.RDS;
+
+namespace WebsitePanel.Providers.RemoteDesktopServices
+{
+ public class ImportedRdsCollection
+ {
+ public string CollectionName { get; set; }
+ public string Description { get; set; }
+ public List CollectionSettings { get; set; }
+ public List UserGroups { get; set; }
+ public List SessionHosts { get; set; }
+ }
+}
diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsCollectionSetting.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsCollectionSetting.cs
new file mode 100644
index 00000000..c0930b40
--- /dev/null
+++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsCollectionSetting.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace WebsitePanel.Providers.RemoteDesktopServices
+{
+ public class RdsCollectionSetting
+ {
+ public string PropertyName { get; set; }
+
+ public object PropertyValue { get; set; }
+ }
+}
diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsServerSettings.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsServerSettings.cs
index ad175a46..c132a79f 100644
--- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsServerSettings.cs
+++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsServerSettings.cs
@@ -48,6 +48,7 @@ namespace WebsitePanel.EnterpriseServer.Base.RDS
public const string DISABLE_CMD = "DisableCMD";
public const string DISABLE_CMD_ADMINISTRATORS = "DisableCMDAdministrators";
public const string DISABLE_CMD_USERS = "DisableCMDUsers";
+ public const string ALLOWCONNECTIONSIMPORT = "AllowConnectionsImport";
public string SettingsName { get; set; }
public int ServerId { 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 80c567d5..71bd8ac8 100644
--- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj
+++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj
@@ -134,10 +134,12 @@
+
+
diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/RdsRunspaceExtensions.cs b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/RdsRunspaceExtensions.cs
new file mode 100644
index 00000000..78498d3c
--- /dev/null
+++ b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/RdsRunspaceExtensions.cs
@@ -0,0 +1,169 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Management.Automation;
+using System.Management.Automation.Runspaces;
+using System.Text;
+using WebsitePanel.Server.Utils;
+
+namespace WebsitePanel.Providers.RemoteDesktopServices
+{
+ public static class RdsRunspaceExtensions
+ {
+ public static RdsCollection GetCollection(this Runspace runspace, string collectionName, string connectionBroker, string primaryDomainController)
+ {
+ RdsCollection collection = null;
+ Command cmd = new Command("Get-RDSessionCollection");
+ cmd.Parameters.Add("CollectionName", collectionName);
+ cmd.Parameters.Add("ConnectionBroker", connectionBroker);
+
+ var collectionPs = ExecuteShellCommand(runspace, cmd, false, primaryDomainController).FirstOrDefault();
+
+ if (collectionPs != null)
+ {
+ collection = new RdsCollection();
+ collection.Name = Convert.ToString(GetPSObjectProperty(collectionPs, "CollectionName"));
+ collection.Description = Convert.ToString(GetPSObjectProperty(collectionPs, "CollectionDescription"));
+ }
+
+ return collection;
+ }
+
+ public static List GetCollectionSettings(this Runspace runspace, string collectionName, string connectionBroker, string primaryDomainController, out object[] errors)
+ {
+ var result = new List();
+ var errorsList = new List();
+
+ result.AddRange(GetCollectionSettings(runspace, collectionName, connectionBroker, primaryDomainController, "Connection", out errors));
+ errorsList.AddRange(errors);
+ result.AddRange(GetCollectionSettings(runspace, collectionName, connectionBroker, primaryDomainController, "UserProfileDisk", out errors));
+ errorsList.AddRange(errors);
+ result.AddRange(GetCollectionSettings(runspace, collectionName, connectionBroker, primaryDomainController, "Security", out errors));
+ errorsList.AddRange(errors);
+ result.AddRange(GetCollectionSettings(runspace, collectionName, connectionBroker, primaryDomainController, "LoadBalancing", out errors));
+ errorsList.AddRange(errors);
+ result.AddRange(GetCollectionSettings(runspace, collectionName, connectionBroker, primaryDomainController, "Client", out errors));
+ errorsList.AddRange(errors);
+ errors = errorsList.ToArray();
+
+ return result;
+ }
+
+ public static List GetCollectionUserGroups(this Runspace runspace, string collectionName, string connectionBroker, string primaryDomainController, out object[] errors)
+ {
+ return GetCollectionSettings(runspace, collectionName, connectionBroker, primaryDomainController, "UserGroup", out errors);
+ }
+
+ public static List GetSessionHosts(this Runspace runspace, string collectionName, string connectionBroker, string primaryDomainController, out object[] errors)
+ {
+ Command cmd = new Command("Get-RDSessionHost");
+ cmd.Parameters.Add("CollectionName", collectionName);
+ cmd.Parameters.Add("ConnectionBroker", connectionBroker);
+
+ var psObjects = ExecuteShellCommand(runspace, cmd, false, primaryDomainController, out errors);
+ var rdsServers = new List();
+
+ if (psObjects != null)
+ {
+ foreach(var psObject in psObjects)
+ {
+ rdsServers.Add(GetPSObjectProperty(psObject, "SessionHost").ToString());
+ }
+ }
+
+ return rdsServers;
+ }
+
+ private static List GetCollectionSettings(this Runspace runspace, string collectionName, string connectionBroker, string primaryDomainController, string param, out object[] errors)
+ {
+ Command cmd = new Command("Get-RDSessionCollectionConfiguration");
+ cmd.Parameters.Add("CollectionName", collectionName);
+ cmd.Parameters.Add("ConnectionBroker", connectionBroker);
+
+ if (!string.IsNullOrEmpty(param))
+ {
+ cmd.Parameters.Add(param, true);
+ }
+
+ var psObject = ExecuteShellCommand(runspace, cmd, false, primaryDomainController, out errors).FirstOrDefault();
+
+ var properties = typeof(RdsCollectionSettings).GetProperties().Select(p => p.Name.ToLower());
+ var collectionSettings = new RdsCollectionSettings();
+ var result = new List();
+
+ if (psObject != null)
+ {
+ foreach (var prop in psObject.Properties)
+ {
+ if (prop.Name.ToLower() != "id" && prop.Name.ToLower() != "rdscollectionid")
+ {
+ result.Add(new RdsCollectionSetting
+ {
+ PropertyName = prop.Name,
+ PropertyValue = prop.Value
+ });
+ }
+ }
+ }
+
+ return result;
+ }
+
+ private static Collection ExecuteShellCommand(Runspace runSpace, Command cmd, bool useDomainController, string primaryDomainController)
+ {
+ object[] errors;
+ return ExecuteShellCommand(runSpace, cmd, useDomainController, primaryDomainController, out errors);
+ }
+
+ private static Collection ExecuteShellCommand(Runspace runSpace, Command cmd, bool useDomainController, string primaryDomainController,
+ out object[] errors)
+ {
+ Log.WriteStart("ExecuteShellCommand");
+ List errorList = new List();
+
+ if (useDomainController)
+ {
+ CommandParameter dc = new CommandParameter("DomainController", primaryDomainController);
+ if (!cmd.Parameters.Contains(dc))
+ {
+ cmd.Parameters.Add(dc);
+ }
+ }
+
+ Collection results = null;
+ // Create a pipeline
+ Pipeline pipeLine = runSpace.CreatePipeline();
+ using (pipeLine)
+ {
+ // Add the command
+ pipeLine.Commands.Add(cmd);
+ // Execute the pipeline and save the objects returned.
+ results = pipeLine.Invoke();
+
+ // Log out any errors in the pipeline execution
+ // NOTE: These errors are NOT thrown as exceptions!
+ // Be sure to check this to ensure that no errors
+ // happened while executing the command.
+ if (pipeLine.Error != null && pipeLine.Error.Count > 0)
+ {
+ foreach (object item in pipeLine.Error.ReadToEnd())
+ {
+ errorList.Add(item);
+ string errorMessage = string.Format("Invoke error: {0}", item);
+ Log.WriteWarning(errorMessage);
+ }
+ }
+ }
+ pipeLine = null;
+ errors = errorList.ToArray();
+ Log.WriteEnd("ExecuteShellCommand");
+ return results;
+ }
+
+ private static object GetPSObjectProperty(PSObject obj, string name)
+ {
+ return obj.Members[name].Value;
+ }
+ }
+}
diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/WebsitePanel.Providers.RemoteDesktopServices.Windows2012.csproj b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/WebsitePanel.Providers.RemoteDesktopServices.Windows2012.csproj
index 66dd13d8..4b112526 100644
--- a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/WebsitePanel.Providers.RemoteDesktopServices.Windows2012.csproj
+++ b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/WebsitePanel.Providers.RemoteDesktopServices.Windows2012.csproj
@@ -46,6 +46,7 @@
+
diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs
index 233fe6a2..dd287158 100644
--- a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs
+++ b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs
@@ -486,19 +486,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
try
{
runSpace = OpenRunspace();
-
- Command cmd = new Command("Get-RDSessionCollection");
- cmd.Parameters.Add("CollectionName", collectionName);
- cmd.Parameters.Add("ConnectionBroker", ConnectionBroker);
-
- var collectionPs = ExecuteShellCommand(runSpace, cmd, false).FirstOrDefault();
-
- if (collectionPs != null)
- {
- collection = new RdsCollection();
- collection.Name = Convert.ToString(GetPSObjectProperty(collectionPs, "CollectionName"));
- collection.Description = Convert.ToString(GetPSObjectProperty(collectionPs, "CollectionDescription"));
- }
+ collection = runSpace.GetCollection(collectionName, ConnectionBroker, PrimaryDomainController);
}
finally
{
@@ -1656,6 +1644,124 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
#endregion
+ #region Import Collection
+
+ public ImportedRdsCollection GetExistingCollection(string collectionName)
+ {
+ Runspace runspace = null;
+ ImportedRdsCollection result;
+
+ try
+ {
+ runspace = OpenRunspace();
+ var collection = runspace.GetCollection(collectionName, ConnectionBroker, PrimaryDomainController);
+ result = new ImportedRdsCollection
+ {
+ CollectionName = collection.Name,
+ Description = collection.Description
+ };
+
+ if (collection == null)
+ {
+ throw new NullReferenceException(string.Format("Collection \"{0}\" not found", collectionName));
+ }
+
+ object[] errors;
+ result.CollectionSettings = runspace.GetCollectionSettings(collectionName, ConnectionBroker, PrimaryDomainController, out errors).ToList();
+
+ if (errors.Any())
+ {
+ throw new Exception(string.Format("Collection not imported:\r\n{0}", string.Join("r\\n\\", errors.Select(e => e.ToString()).ToArray())));
+ }
+
+ result.SessionHosts = runspace.GetSessionHosts(collectionName, ConnectionBroker, PrimaryDomainController, out errors);
+
+ if (errors.Any())
+ {
+ throw new Exception(string.Format("Collection not imported:\r\n{0}", string.Join("r\\n\\", errors.Select(e => e.ToString()).ToArray())));
+ }
+
+ result.UserGroups = runspace.GetCollectionUserGroups(collectionName, ConnectionBroker, PrimaryDomainController, out errors).ToList();
+
+ if (errors.Any())
+ {
+ throw new Exception(string.Format("Collection not imported:\r\n{0}", string.Join("r\\n\\", errors.Select(e => e.ToString()).ToArray())));
+ }
+ }
+ finally
+ {
+ CloseRunspace(runspace);
+ }
+
+ return result;
+ }
+
+ public void ImportCollection(string organizationId, RdsCollection collection, List users)
+ {
+ Runspace runSpace = null;
+
+ try
+ {
+ runSpace = OpenRunspace();
+ var orgPath = GetOrganizationPath(organizationId);
+ CheckOrCreateAdGroup(GetComputerGroupPath(organizationId, collection.Name), orgPath, GetComputersGroupName(collection.Name), RdsCollectionComputersGroupDescription);
+ CheckOrCreateHelpDeskComputerGroup();
+ string helpDeskGroupSamAccountName = CheckOrCreateAdGroup(GetHelpDeskGroupPath(RDSHelpDeskGroup), GetRootOUPath(), RDSHelpDeskGroup, RDSHelpDeskGroupDescription);
+ string groupName = GetLocalAdminsGroupName(collection.Name);
+ string groupPath = GetGroupPath(organizationId, collection.Name, groupName);
+ string localAdminsGroupSamAccountName = CheckOrCreateAdGroup(groupPath, GetOrganizationPath(organizationId), groupName, WspAdministratorsGroupDescription);
+ CheckOrCreateAdGroup(GetUsersGroupPath(organizationId, collection.Name), orgPath, GetUsersGroupName(collection.Name), RdsCollectionUsersGroupDescription);
+
+ var capPolicyName = GetPolicyName(organizationId, collection.Name, RdsPolicyTypes.RdCap);
+ var rapPolicyName = GetPolicyName(organizationId, collection.Name, RdsPolicyTypes.RdRap);
+
+ foreach (var gateway in Gateways)
+ {
+ CreateHelpDeskRdCapForce(runSpace, gateway);
+ CreateHelpDeskRdRapForce(runSpace, gateway);
+
+ if (!CentralNps)
+ {
+ CreateRdCapForce(runSpace, gateway, capPolicyName, collection.Name, new List { GetUsersGroupName(collection.Name) });
+ }
+
+ CreateRdRapForce(runSpace, gateway, rapPolicyName, collection.Name, new List { GetUsersGroupName(collection.Name) });
+ }
+
+ if (CentralNps)
+ {
+ CreateCentralNpsPolicy(runSpace, CentralNpsHost, capPolicyName, collection.Name, organizationId);
+ }
+
+ //add user group to collection
+ AddUserGroupsToCollection(runSpace, collection.Name, new List { GetUsersGroupName(collection.Name) });
+
+ //add session servers to group
+ foreach (var rdsServer in collection.Servers)
+ {
+ MoveSessionHostToCollectionOU(rdsServer.Name, collection.Name, organizationId);
+ AddAdGroupToLocalAdmins(runSpace, rdsServer.FqdName, helpDeskGroupSamAccountName);
+ AddAdGroupToLocalAdmins(runSpace, rdsServer.FqdName, localAdminsGroupSamAccountName);
+ AddComputerToCollectionAdComputerGroup(organizationId, collection.Name, rdsServer);
+ }
+
+ string collectionComputersPath = GetComputerGroupPath(organizationId, collection.Name);
+ CreatePolicy(runSpace, organizationId, string.Format("{0}-administrators", collection.Name),
+ new DirectoryEntry(GetGroupPath(organizationId, collection.Name, GetLocalAdminsGroupName(collection.Name))), new DirectoryEntry(collectionComputersPath), collection.Name);
+ CreatePolicy(runSpace, organizationId, string.Format("{0}-users", collection.Name), new DirectoryEntry(GetUsersGroupPath(organizationId, collection.Name))
+ , new DirectoryEntry(collectionComputersPath), collection.Name);
+ CreateHelpDeskPolicy(runSpace, new DirectoryEntry(GetHelpDeskGroupPath(RDSHelpDeskGroup)), new DirectoryEntry(collectionComputersPath), organizationId, collection.Name);
+
+ SetUsersInCollection(organizationId, collection.Name, users);
+ }
+ finally
+ {
+ CloseRunspace(runSpace);
+ }
+ }
+
+ #endregion
+
private void AddRdsServerToDeployment(Runspace runSpace, RdsServer server)
{
Command cmd = new Command("Add-RDserver");
@@ -2723,6 +2829,11 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
cmd.Parameters.Add("CollectionName", collection.Name);
cmd.Parameters.Add("ConnectionBroker", ConnectionBroker);
+ if (string.IsNullOrEmpty(collection.Settings.ClientDeviceRedirectionOptions))
+ {
+ collection.Settings.ClientDeviceRedirectionOptions = "None";
+ }
+
var properties = collection.Settings.GetType().GetProperties();
foreach(var prop in properties)
@@ -2733,7 +2844,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
if (value != null)
{
- cmd.Parameters.Add(prop.Name, value);
+ cmd.Parameters.Add(prop.Name, value);
}
}
}
diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/RemoteDesktopServicesProxy.cs b/WebsitePanel/Sources/WebsitePanel.Server.Client/RemoteDesktopServicesProxy.cs
index bbd90595..d07b437c 100644
--- a/WebsitePanel/Sources/WebsitePanel.Server.Client/RemoteDesktopServicesProxy.cs
+++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/RemoteDesktopServicesProxy.cs
@@ -108,6 +108,10 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
private System.Threading.SendOrPostCallback MoveSessionHostsToCollectionOUOperationCompleted;
+ private System.Threading.SendOrPostCallback GetExistingCollectionOperationCompleted;
+
+ private System.Threading.SendOrPostCallback ImportCollectionOperationCompleted;
+
///
public RemoteDesktopServices() {
this.Url = "http://localhost:9003/RemoteDesktopServices.asmx";
@@ -230,6 +234,12 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
///
public event MoveSessionHostsToCollectionOUCompletedEventHandler MoveSessionHostsToCollectionOUCompleted;
+ ///
+ public event GetExistingCollectionCompletedEventHandler GetExistingCollectionCompleted;
+
+ ///
+ public event ImportCollectionCompletedEventHandler ImportCollectionCompleted;
+
///
[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)]
@@ -1933,6 +1943,94 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
}
}
+ ///
+ [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
+ [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetExistingCollection", 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 ImportedRdsCollection GetExistingCollection(string collectionName) {
+ object[] results = this.Invoke("GetExistingCollection", new object[] {
+ collectionName});
+ return ((ImportedRdsCollection)(results[0]));
+ }
+
+ ///
+ public System.IAsyncResult BeginGetExistingCollection(string collectionName, System.AsyncCallback callback, object asyncState) {
+ return this.BeginInvoke("GetExistingCollection", new object[] {
+ collectionName}, callback, asyncState);
+ }
+
+ ///
+ public ImportedRdsCollection EndGetExistingCollection(System.IAsyncResult asyncResult) {
+ object[] results = this.EndInvoke(asyncResult);
+ return ((ImportedRdsCollection)(results[0]));
+ }
+
+ ///
+ public void GetExistingCollectionAsync(string collectionName) {
+ this.GetExistingCollectionAsync(collectionName, null);
+ }
+
+ ///
+ public void GetExistingCollectionAsync(string collectionName, object userState) {
+ if ((this.GetExistingCollectionOperationCompleted == null)) {
+ this.GetExistingCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetExistingCollectionOperationCompleted);
+ }
+ this.InvokeAsync("GetExistingCollection", new object[] {
+ collectionName}, this.GetExistingCollectionOperationCompleted, userState);
+ }
+
+ private void OnGetExistingCollectionOperationCompleted(object arg) {
+ if ((this.GetExistingCollectionCompleted != null)) {
+ System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
+ this.GetExistingCollectionCompleted(this, new GetExistingCollectionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
+ }
+ }
+
+ ///
+ [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
+ [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/ImportCollection", 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 ImportCollection(string organizationId, RdsCollection collection, string[] users) {
+ this.Invoke("ImportCollection", new object[] {
+ organizationId,
+ collection,
+ users});
+ }
+
+ ///
+ public System.IAsyncResult BeginImportCollection(string organizationId, RdsCollection collection, string[] users, System.AsyncCallback callback, object asyncState) {
+ return this.BeginInvoke("ImportCollection", new object[] {
+ organizationId,
+ collection,
+ users}, callback, asyncState);
+ }
+
+ ///
+ public void EndImportCollection(System.IAsyncResult asyncResult) {
+ this.EndInvoke(asyncResult);
+ }
+
+ ///
+ public void ImportCollectionAsync(string organizationId, RdsCollection collection, string[] users) {
+ this.ImportCollectionAsync(organizationId, collection, users, null);
+ }
+
+ ///
+ public void ImportCollectionAsync(string organizationId, RdsCollection collection, string[] users, object userState) {
+ if ((this.ImportCollectionOperationCompleted == null)) {
+ this.ImportCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnImportCollectionOperationCompleted);
+ }
+ this.InvokeAsync("ImportCollection", new object[] {
+ organizationId,
+ collection,
+ users}, this.ImportCollectionOperationCompleted, userState);
+ }
+
+ private void OnImportCollectionOperationCompleted(object arg) {
+ if ((this.ImportCollectionCompleted != null)) {
+ System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
+ this.ImportCollectionCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
+ }
+ }
+
///
public new void CancelAsync(object userState) {
base.CancelAsync(userState);
@@ -2578,4 +2676,34 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
///
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void MoveSessionHostsToCollectionOUCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
+ public delegate void GetExistingCollectionCompletedEventHandler(object sender, GetExistingCollectionCompletedEventArgs e);
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
+ [System.Diagnostics.DebuggerStepThroughAttribute()]
+ [System.ComponentModel.DesignerCategoryAttribute("code")]
+ public partial class GetExistingCollectionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
+
+ private object[] results;
+
+ internal GetExistingCollectionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
+ base(exception, cancelled, userState) {
+ this.results = results;
+ }
+
+ ///
+ public ImportedRdsCollection Result {
+ get {
+ this.RaiseExceptionIfNecessary();
+ return ((ImportedRdsCollection)(this.results[0]));
+ }
+ }
+ }
+
+ ///
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
+ public delegate void ImportCollectionCompletedEventHandler(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 e28846eb..d7449faa 100644
--- a/WebsitePanel/Sources/WebsitePanel.Server/RemoteDesktopServices.asmx.cs
+++ b/WebsitePanel/Sources/WebsitePanel.Server/RemoteDesktopServices.asmx.cs
@@ -711,5 +711,37 @@ namespace WebsitePanel.Server
throw;
}
}
+
+ [WebMethod, SoapHeader("settings")]
+ public ImportedRdsCollection GetExistingCollection(string collectionName)
+ {
+ try
+ {
+ Log.WriteStart("'{0}' GetExistingCollection", ProviderSettings.ProviderName);
+ return RDSProvider.GetExistingCollection(collectionName);
+ Log.WriteEnd("'{0}' GetExistingCollection", ProviderSettings.ProviderName);
+ }
+ catch (Exception ex)
+ {
+ Log.WriteError(String.Format("'{0}' GetExistingCollection", ProviderSettings.ProviderName), ex);
+ throw;
+ }
+ }
+
+ [WebMethod, SoapHeader("settings")]
+ public void ImportCollection(string organizationId, RdsCollection collection, List users)
+ {
+ try
+ {
+ Log.WriteStart("'{0}' ImportCollection", ProviderSettings.ProviderName);
+ RDSProvider.ImportCollection(organizationId, collection, users);
+ Log.WriteEnd("'{0}' ImportCollection", ProviderSettings.ProviderName);
+ }
+ catch (Exception ex)
+ {
+ Log.WriteError(String.Format("'{0}' ImportCollection", 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 7933d0cc..8a21c2f2 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/ESModule_ControlsHierarchy.config
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/ESModule_ControlsHierarchy.config
@@ -158,6 +158,7 @@
+
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config
index 70e8407b..63c4235e 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config
@@ -606,6 +606,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 3c67a53e..d83c52e3 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx
@@ -5784,6 +5784,9 @@
Error creating rds collection. You need to add at least 1 rds server to collection
+
+ Error importing rds collection. Collection not found
+
Resource Mailboxes per Organization
@@ -5820,6 +5823,9 @@
Collection not created
+
+ Collection not imported
+
Session host certificate not installed
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SettingsRdsPolicy.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SettingsRdsPolicy.ascx.resx
index 4e783a67..2f01e647 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SettingsRdsPolicy.ascx.resx
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SettingsRdsPolicy.ascx.resx
@@ -120,9 +120,15 @@
Administrators
+
+ Allow
+
Users
+
+ Connections Import
+
Changing Desktop Disabled
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSCollections.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSCollections.ascx.resx
index 3a2deaac..fe45f728 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSCollections.ascx.resx
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSCollections.ascx.resx
@@ -150,4 +150,7 @@
Total Remote Desktop Collections Created:
+
+ Import RDS Collection
+
\ No newline at end of file
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSImportCollection.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSImportCollection.ascx.resx
new file mode 100644
index 00000000..46f650df
--- /dev/null
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSImportCollection.ascx.resx
@@ -0,0 +1,126 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 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
+
+
+ Import
+
+
+ Import RDSCollection
+
+
\ No newline at end of file
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSCollections.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSCollections.ascx
index a5369d97..37e1deae 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSCollections.ascx
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSCollections.ascx
@@ -22,6 +22,8 @@