From 82e7d0eb25bd7c7f233f645687bb322b7b6caa30 Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Fri, 8 May 2015 04:57:15 -0700 Subject: [PATCH] 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/UserAccountMailTemplateSettings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountMailTemplateSettings.ascx.designer.cs index a5217667..ded9a986 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountMailTemplateSettings.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountMailTemplateSettings.ascx.designer.cs @@ -129,6 +129,15 @@ namespace WebsitePanel.Portal { /// protected global::System.Web.UI.WebControls.HyperLink lnkOrganizationUserPasswordResetPincodeLetter; + /// + /// HyperLink3 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HyperLink HyperLink3; + /// /// btnCancel 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 new file mode 100644 index 00000000..1b01ac03 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/App_LocalResources/SendToControl.ascx.resx @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + Send Password Reset Email + + + Save as user mobile + + + Email: + + + Mobile + + + Reason: + + + Send to: + + + Reset Password + + + Email + + + Mobile + + + Send Password Request + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SendToControl.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SendToControl.ascx new file mode 100644 index 00000000..e4e8ace3 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SendToControl.ascx @@ -0,0 +1,52 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SendToControl.ascx.cs" Inherits="WebsitePanel.Portal.UserControls.SendToControl" %> + + + + + + + + + + + + + + + + + + + + + +
    + +
    + + + +
    +
    +
    + + + + +
    + + + + +
    + + +
    + +
    \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SendToControl.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SendToControl.ascx.cs new file mode 100644 index 00000000..c5417946 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SendToControl.ascx.cs @@ -0,0 +1,79 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace WebsitePanel.Portal.UserControls +{ + public partial class SendToControl : WebsitePanelControlBase + { + public string ValidationGroup + { + get { return valEmailAddress.ValidationGroup; } + set + { + valEmailAddress.ValidationGroup = value; + regexEmailValid.ValidationGroup = value; + valMobile.ValidationGroup = value; + regexMobileValid.ValidationGroup = value; + } + } + + public bool IsRequestSend + { + get { return chkSendPasswordResetEmail.Checked; } + } + + public bool SendEmail + { + get { return chkSendPasswordResetEmail.Checked && rbtnEmail.Checked; } + } + + public bool SendMobile + { + get { return chkSendPasswordResetEmail.Checked && rbtnMobile.Checked; } + } + + public string Email + { + get { return txtEmailAddress.Text; } + } + + public string Mobile + { + get { return txtMobile.Text; } + } + + public string ControlToHide { get; set; } + + protected void SendToGroupCheckedChanged(object sender, EventArgs e) + { + EmailRow.Visible = rbtnEmail.Checked; + MobileRow.Visible = !rbtnEmail.Checked; + } + + protected void chkSendPasswordResetEmail_StateChanged(object sender, EventArgs e) + { + SendToBody.Visible = chkSendPasswordResetEmail.Checked; + + if (!string.IsNullOrEmpty(ControlToHide)) + { + var control = Parent.FindControl(ControlToHide); + + if (control != null) + { + control.Visible = !chkSendPasswordResetEmail.Checked; + } + } + } + + protected void Page_Load(object sender, EventArgs e) + { + var isTwilioEnabled = ES.Services.System.CheckIsTwilioEnabled(); + + rbtnMobile.Visible = isTwilioEnabled; + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SendToControl.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SendToControl.ascx.designer.cs new file mode 100644 index 00000000..abb80d9b --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SendToControl.ascx.designer.cs @@ -0,0 +1,159 @@ +//------------------------------------------------------------------------------ +// +// 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.UserControls { + + + public partial class SendToControl { + + /// + /// chkSendPasswordResetEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkSendPasswordResetEmail; + + /// + /// SendToBody control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl SendToBody; + + /// + /// locSendTo control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locSendTo; + + /// + /// rbtnEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButton rbtnEmail; + + /// + /// rbtnMobile control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButton rbtnMobile; + + /// + /// EmailRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow EmailRow; + + /// + /// locEmailAddress control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locEmailAddress; + + /// + /// txtEmailAddress control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtEmailAddress; + + /// + /// valEmailAddress control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valEmailAddress; + + /// + /// regexEmailValid control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator regexEmailValid; + + /// + /// MobileRow control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow MobileRow; + + /// + /// locMobile control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locMobile; + + /// + /// txtMobile control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtMobile; + + /// + /// valMobile control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valMobile; + + /// + /// regexMobileValid control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator regexMobileValid; + + /// + /// divWrapper control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl divWrapper; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj index 3d5054ea..7aefaf58 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj @@ -332,6 +332,20 @@ HostedSharePointEnterpriseStorageUsage.ascx + + SettingsUserPasswordRequestLetter.ascx + ASPXCodeBehind + + + SettingsUserPasswordRequestLetter.ascx + + + SendToControl.ascx + ASPXCodeBehind + + + SendToControl.ascx + VpsMenu.ascx ASPXCodeBehind @@ -4901,6 +4915,8 @@ + + @@ -5026,6 +5042,9 @@ Designer + + Designer + @@ -5225,6 +5244,7 @@ + Designer