From e93d35405877fea76ffa4ef51d27155e3d1bf9b2 Mon Sep 17 00:00:00 2001 From: alexY2004 Date: Wed, 6 May 2015 17:03:18 +0300 Subject: [PATCH 01/36] Rollback 3339 --- .../WebsitePanel/WebSitesEditSite.ascx.cs | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx.cs index 3f36fcf9..26502684 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx.cs @@ -206,23 +206,7 @@ namespace WebsitePanel.Portal { lblSharedIP.Text = string.Format("({0})", ipsGeneral[0].ExternalIP); } - else - { - string[] settings = ES.Services.Servers.GetServiceSettings(site.ServiceId); - foreach (string setting in settings) - { - int idx = setting.IndexOf('='); - string option = setting.Substring(0, idx); - if (String.Compare(option, "publicsharedip", true) == 0) - { - string res = setting.Substring(idx + 1); - if (!String.IsNullOrEmpty(res)) - lblSharedIP.Text = string.Format("({0})", res); - break; - } - } - } - lblSharedIP.Visible = !String.IsNullOrEmpty(lblSharedIP.Text); + lblSharedIP.Visible = generalIPExists; } dedicatedIP.Visible = site.IsDedicatedIP; From 01daa1a293dab5e1642bd05a95c097e890721afb Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Wed, 6 May 2015 10:44:30 -0400 Subject: [PATCH 02/36] Added tag build-2.1.0.704 for changeset 41fe22fe2adf From 2e13fd4d165b253f9cdc80b6a62a5db16051b816 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Wed, 6 May 2015 16:46:28 -0400 Subject: [PATCH 03/36] Added tag build-2.1.0.705 for changeset 205d8f91935e From 4a45e05f07f08d52082a36f39fa957d1e3fcf615 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Wed, 6 May 2015 20:20:09 -0400 Subject: [PATCH 04/36] Re-Style Webdav Portal --- .../Content/Site.css | 72 +++++++++++++++++++ .../Views/FileSystem/_ResoursePartial.cshtml | 2 +- 2 files changed, 73 insertions(+), 1 deletion(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Content/Site.css b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Content/Site.css index 2173c20a..2ab67ad3 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Content/Site.css +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Content/Site.css @@ -455,4 +455,76 @@ div#breadcrumb_wrapper a:last-child { .navbar-right { margin-right: 0; } +} + +.navbar-inverse { + background-color: #F4F4F4; + border-color: #d4d4d4; + background: rgb(251,251,251); + background: -moz-linear-gradient(top, rgba(251,251,251,1) 0%, rgba(242,242,242,1) 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(251,251,251,1)), color-stop(100%,rgba(242,242,242,1))); + background: -webkit-linear-gradient(top, rgba(251,251,251,1) 0%,rgba(242,242,242,1) 100%); + background: -o-linear-gradient(top, rgba(251,251,251,1) 0%,rgba(242,242,242,1) 100%); + background: -ms-linear-gradient(top, rgba(251,251,251,1) 0%,rgba(242,242,242,1) 100%); + background: linear-gradient(to bottom, rgba(251,251,251,1) 0%,rgba(242,242,242,1) 100%); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#fbfbfb', endColorstr='#f2f2f2',GradientType=0 ); + -webkit-box-shadow: 0 1px 10px rgba(0,0,0,.1); + -moz-box-shadow: 0 1px 10px rgba(0,0,0,.1); + box-shadow: 0 1px 10px rgba(0,0,0,.1); +} +.navbar-inverse .navbar-text, .navbar-inverse .navbar-brand, .navbar-text, #logout { + color: #565656; +} + +.navbar-inverse .navbar-brand:hover, .navbar-inverse .navbar-brand:focus, .navbar-text:hover, #logout:hover { + color: #565656; + background-color: transparent; + opacity: 1; +} + +div#breadcrumb_wrapper { + background-color: #F7F7F7; + border: 1px solid #d4d4d4; + margin-top: 9px; +} +.progress { + height:21px; + + background-color: #ffffff; + border: 1px solid #BBBBBB; + border-radius: 3px!important; +} +.progress-bar { + background-color: #F4C18F; + -webkit-box-shadow: none; + box-shadow: none; +} +body { + background-color: #FAFAFA; +} +p.progress-text { + position: absolute; + left: 44%; + color: #515151; +} +p.resource-subtext { + color: #AEAEAE; +} +#logout :hover { + color: #333; +} + +.file-link:hover { + text-decoration:none; +} +.file-link p { + color: #818181; + font-size: 13pt; +} +.file-link p:hover { + color: #333!important; +} +.icon-size { + width: 60px; + height: 60px; } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/FileSystem/_ResoursePartial.cshtml b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/FileSystem/_ResoursePartial.cshtml index 9285872a..9f5dbcdc 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/FileSystem/_ResoursePartial.cshtml +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/FileSystem/_ResoursePartial.cshtml @@ -64,7 +64,7 @@

@percent%

-

@ViewDataHelper.BytesToSize(resource.ContentLength) / @ViewDataHelper.BytesToSize(resource.AllocatedSpace)

+

@ViewDataHelper.BytesToSize(resource.ContentLength) / @ViewDataHelper.BytesToSize(resource.AllocatedSpace)

}
From 4be06211a44723d9017e45032ea69e672da845c8 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Wed, 6 May 2015 20:34:00 -0400 Subject: [PATCH 05/36] Added tag build-2.1.0.706 for changeset 9577939ee17a From 3c7cc2fc8c5e860fa3a73e84832339aa3c9357cd Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Wed, 6 May 2015 21:38:19 -0400 Subject: [PATCH 06/36] Update Webdav Portal Logo --- .../Content/Images/logo.png | Bin 6045 -> 6205 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Content/Images/logo.png b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Content/Images/logo.png index 8db3bf628312588c512b6d06272d3562ed109d67..bf543851b73a0f0231c68129942f7fea00524985 100644 GIT binary patch delta 5482 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 delta 5332 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 mbnOt@n;k-X`-|;A0t^5aNp`%WGN5b#0000 Date: Wed, 6 May 2015 21:50:23 -0400 Subject: [PATCH 07/36] Added tag build-2.1.0.707 for changeset 16aa24360497 From 5bc6de2f5ec3e29f09f96b2b3864da74273d9b75 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Thu, 7 May 2015 13:39:11 -0400 Subject: [PATCH 08/36] Added tag build-2.1.0.708 for changeset 97a9a9f34040 From 82e7d0eb25bd7c7f233f645687bb322b7b6caa30 Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Fri, 8 May 2015 04:57:15 -0700 Subject: [PATCH 09/36] 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 From 976518dd52a63f5c00071ea254ff15eebfd1fcbc Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Fri, 8 May 2015 05:41:47 -0700 Subject: [PATCH 10/36] typo fix --- .../UserControls/App_LocalResources/SendToControl.ascx.resx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 1b01ac03..98960a84 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 @@ -127,7 +127,7 @@ Email: - Mobile + Mobile: Reason: From feb73de8a63e7aa40233d739a4e11f5c23db85f3 Mon Sep 17 00:00:00 2001 From: McMak Date: Fri, 8 May 2015 17:13:05 +0300 Subject: [PATCH 11/36] update update_db.sql for WiX --- WebsitePanel/Database/wix_update_db.sql | 560 +++++++++++++++++++++--- 1 file changed, 487 insertions(+), 73 deletions(-) diff --git a/WebsitePanel/Database/wix_update_db.sql b/WebsitePanel/Database/wix_update_db.sql index 4f342f1d..c44654db 100644 --- a/WebsitePanel/Database/wix_update_db.sql +++ b/WebsitePanel/Database/wix_update_db.sql @@ -8910,6 +8910,12 @@ INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDe END GO +IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaID] = '572') +BEGIN + INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (572, 33, 20, N'VPS2012.ReplicationEnabled', N'Allow user to Replication', 1, 0, NULL, NULL) +END +GO + IF NOT EXISTS (SELECT * FROM [dbo].[Providers] WHERE [ProviderName] = 'HyperV2012R2') BEGIN INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (350, 33, N'HyperV2012R2', N'Microsoft Hyper-V 2012 R2', N'WebsitePanel.Providers.Virtualization.HyperV2012R2, WebsitePanel.Providers.Virtualization.HyperV2012R2', N'HyperV2012R2', 1) @@ -9590,6 +9596,13 @@ IF EXISTS (SELECT * FROM ResourceGroups WHERE GroupName = 'SharePoint') BEGIN DECLARE @group_id INT SELECT @group_id = GroupId FROM ResourceGroups WHERE GroupName = 'SharePoint' + DELETE FROM PackageQuotas WHERE QuotaID IN (SELECT QuotaID FROM Quotas WHERE GroupID = @group_id) + DELETE FROM HostingPlanQuotas WHERE QuotaID IN (SELECT QuotaID FROM Quotas WHERE GroupID = @group_id) + DELETE FROM HostingPlanResources WHERE GroupId = @group_id + DELETE FROM PackagesBandwidth WHERE GroupId = @group_id + DELETE FROM PackagesDiskspace WHERE GroupId = @group_id + DELETE FROM PackageResources WHERE GroupId = @group_id + DELETE FROM ResourceGroupDnsRecords WHERE GroupId = @group_id DELETE FROM Providers WHERE GroupID = @group_id DELETE FROM Quotas WHERE GroupID = @group_id DELETE FROM VirtualGroups WHERE GroupID = @group_id @@ -10020,6 +10033,145 @@ UPDATE [dbo].[UserSettings] SET [PropertyValue] = @UserPasswordResetLetterTextBo GO + + +DECLARE @UserPasswordResetSMSBody nvarchar(2500) + +Set @UserPasswordResetSMSBody = N'Password reset link: +#passwordResetLink# +' + +IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetLetter' AND [PropertyName]= N'PasswordResetLinkSmsBody' ) +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 + +IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetPincodeLetter' AND [PropertyName]= N'From' ) +BEGIN +INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordResetPincodeLetter', N'From', N'support@HostingCompany.com') +END +GO + +DECLARE @UserPasswordResetPincodeLetterHtmlBody nvarchar(2500) + +Set @UserPasswordResetPincodeLetterHtmlBody = N' + + Password reset notification + + + +
    +
    + +
    +

    Password reset notification

    + + +

    +Hello #user.FirstName#, +

    +
    + +

    +We received a request to reset the password for your account. Your password reset pincode: +

    + +#passwordResetPincode# + +

    +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'UserPasswordResetPincodeLetter' AND [PropertyName]= N'HtmlBody' ) +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 + + +IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetPincodeLetter' AND [PropertyName]= N'Priority' ) +BEGIN +INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordResetPincodeLetter', N'Priority', N'Normal') +END +GO +IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetPincodeLetter' AND [PropertyName]= N'Subject' ) +BEGIN +INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordResetPincodeLetter', N'Subject', N'Password reset notification') +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') +END +GO + + +DECLARE @UserPasswordResetPincodeLetterTextBody nvarchar(2500) + +Set @UserPasswordResetPincodeLetterTextBody = N'========================================= + Password reset notification +========================================= + + +Hello #user.FirstName#, + + +We received a request to reset the password for your account. Your password reset pincode: + +#passwordResetPincode# + +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'UserPasswordResetPincodeLetter' AND [PropertyName]= N'TextBody' ) +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) + +Set @UserPasswordPincodeSMSBody = N' +Your password reset pincode: +#passwordResetPincode#' + +IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetPincodeLetter' AND [PropertyName]= N'PasswordResetPincodeSmsBody' ) +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 + -- Exchange setup EMAIL TEMPLATE @@ -10289,79 +10441,79 @@ GO DECLARE @ExchangeMailboxSetupLetterTextBody nvarchar(2500) -Set @ExchangeMailboxSetupLetterTextBody = N' -Hello #Account.DisplayName#, - -Thanks for choosing VirtuWorks as your Exchange hosting provider. - - -User Accounts - -The following user accounts have been created for you. - -Username: #Account.UserPrincipalName# -E-mail: #Account.PrimaryEmailAddress# - -Password Reset Url: #PswResetUrl# - - - -================================= -DNS -================================= - -In order for us to accept mail for your domain, you will need to point your MX records to: - -#SmtpServer# - -================================= -Webmail (OWA, Outlook Web Access) -================================= - -https://mail.virtuworks.net/owa - -================================= -Outlook (Windows Clients) -================================= - -To configure Outlook 2010 to work with VirtuWorks 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 - -================================= -ActiveSync, iPhone, iPad -================================= - -Server: #ActiveSyncServer# -Domain: #SamDomain# -SSL: must be checked -Your username: #SamUsername# - -================================= -Password Changes -================================= - -Passwords can be changed at any time using Webmail or the Control Panel (https://controlpanel.virtuworks.net). - - -================================= -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). - - -================================= -Support -================================= - +Set @ExchangeMailboxSetupLetterTextBody = N' +Hello #Account.DisplayName#, + +Thanks for choosing VirtuWorks as your Exchange hosting provider. + + +User Accounts + +The following user accounts have been created for you. + +Username: #Account.UserPrincipalName# +E-mail: #Account.PrimaryEmailAddress# + +Password Reset Url: #PswResetUrl# + + + +================================= +DNS +================================= + +In order for us to accept mail for your domain, you will need to point your MX records to: + +#SmtpServer# + +================================= +Webmail (OWA, Outlook Web Access) +================================= + +https://mail.virtuworks.net/owa + +================================= +Outlook (Windows Clients) +================================= + +To configure Outlook 2010 to work with VirtuWorks 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 + +================================= +ActiveSync, iPhone, iPad +================================= + +Server: #ActiveSyncServer# +Domain: #SamDomain# +SSL: must be checked +Your username: #SamUsername# + +================================= +Password Changes +================================= + +Passwords can be changed at any time using Webmail or the Control Panel (https://controlpanel.virtuworks.net). + + +================================= +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). + + +================================= +Support +================================= + You have 2 options, email help@virtuworks.com or use the web interface at http://www.virtuworks.com/contact/' IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'ExchangeMailboxSetupLetter' AND [PropertyName]= N'TextBody' ) @@ -10674,3 +10826,265 @@ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER OFF GO + + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetSearchObject') +DROP PROCEDURE GetSearchObject +GO +CREATE PROCEDURE [dbo].[GetSearchObject] +( + @ActorID int, + @UserID int, + @FilterColumn nvarchar(50) = '', + @FilterValue nvarchar(50) = '', + @StatusID int, + @RoleID int, + @SortColumn nvarchar(50), + @StartRow int, + @MaximumRows int = 0, + @Recursive bit, + @ColType nvarchar(50) = '', + @FullType nvarchar(50) = '', + @OnlyFind bit +) +AS + +IF dbo.CheckActorUserRights(@ActorID, @UserID) = 0 +RAISERROR('You are not allowed to access this account', 16, 1) + +DECLARE @columnUsername nvarchar(20) +SET @columnUsername = 'Username' + +DECLARE @columnEmail nvarchar(20) +SET @columnEmail = 'Email' + +DECLARE @columnCompanyName nvarchar(20) +SET @columnCompanyName = 'CompanyName' + +DECLARE @columnFullName nvarchar(20) +SET @columnFullName = 'FullName' + +DECLARE @curUsers cursor +DECLARE @curSpace cursor + +DECLARE @sqlSpace nvarchar(2000) +DECLARE @sqlUsers nvarchar(2000) +DECLARE @sqlReturn nvarchar(4000) + +IF @FilterColumn = '' AND @FilterValue <> '' +SET @FilterColumn = 'TextSearch' + +SET @sqlUsers = ' +DECLARE @HasUserRights bit +SET @HasUserRights = dbo.CheckActorUserRights(@ActorID, @UserID) +DECLARE @Users TABLE +( + ItemPosition int IDENTITY(0,1), + UserID int +) +INSERT INTO @Users (UserID) +SELECT ' + +IF @OnlyFind = 1 +SET @sqlUsers = @sqlUsers + 'TOP ' + CAST(@MaximumRows AS varchar(12)) + ' ' + +SET @sqlUsers = @sqlUsers + 'U.UserID +FROM UsersDetailed AS U +WHERE + U.UserID <> @UserID AND U.IsPeer = 0 AND + ( + (@Recursive = 0 AND OwnerID = @UserID) OR + (@Recursive = 1 AND dbo.CheckUserParent(@UserID, U.UserID) = 1) + ) + AND ((@StatusID = 0) OR (@StatusID > 0 AND U.StatusID = @StatusID)) + AND ((@RoleID = 0) OR (@RoleID > 0 AND U.RoleID = @RoleID)) + AND @HasUserRights = 1 +SET @curValue = cursor local for +SELECT + U.ItemID, + U.TextSearch, + U.ColumnType, + ''Users'' as FullType, + 0 as PackageID, + 0 as AccountID +FROM @Users AS TU +INNER JOIN +( +SELECT ItemID, TextSearch, ColumnType +FROM( +SELECT U0.UserID as ItemID, U0.Username as TextSearch, @columnUsername as ColumnType +FROM dbo.Users AS U0 +UNION +SELECT U1.UserID as ItemID, U1.Email as TextSearch, @columnEmail as ColumnType +FROM dbo.Users AS U1 +UNION +SELECT U2.UserID as ItemID, U2.CompanyName as TextSearch, @columnCompanyName as ColumnType +FROM dbo.Users AS U2 +UNION +SELECT U3.UserID as ItemID, U3.FirstName + '' '' + U3.LastName as TextSearch, @columnFullName as ColumnType +FROM dbo.Users AS U3) as U +WHERE TextSearch<>'' '' OR ISNULL(TextSearch, 0) > 0 +) + AS U ON TU.UserID = U.ItemID' + +SET @sqlUsers = @sqlUsers + ' open @curValue' + +exec sp_executesql @sqlUsers, N'@UserID int, @FilterValue nvarchar(50), @ActorID int, @Recursive bit, @StatusID int, @RoleID int, @columnUsername nvarchar(20), @columnEmail nvarchar(20), @columnCompanyName nvarchar(20), @columnFullName nvarchar(20), @curValue cursor output', +@UserID, @FilterValue, @ActorID, @Recursive, @StatusID, @RoleID, @columnUsername, @columnEmail, @columnCompanyName, @columnFullName, @curValue=@curUsers output + +SET @sqlSpace = ' + DECLARE @ItemsService TABLE + ( + ItemID int + ) + INSERT INTO @ItemsService (ItemID) + SELECT ' + +IF @OnlyFind = 1 +SET @sqlSpace = @sqlSpace + 'TOP ' + CAST(@MaximumRows AS varchar(12)) + ' ' + +SET @sqlSpace = @sqlSpace + 'SI.ItemID + FROM ServiceItems AS SI + INNER JOIN Packages AS P ON P.PackageID = SI.PackageID + INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID + WHERE + dbo.CheckUserParent(@UserID, P.UserID) = 1 + DECLARE @ItemsDomain TABLE + ( + ItemID int + ) + INSERT INTO @ItemsDomain (ItemID) + SELECT + D.DomainID + FROM Domains AS D + INNER JOIN Packages AS P ON P.PackageID = D.PackageID + INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID + WHERE + dbo.CheckUserParent(@UserID, P.UserID) = 1 + + SET @curValue = cursor local for + SELECT + + SI.ItemID as ItemID, + SI.ItemName as TextSearch, + STYPE.DisplayName as ColumnType, + STYPE.DisplayName as FullType, + SI.PackageID as PackageID, + 0 as AccountID + FROM @ItemsService AS I + INNER JOIN ServiceItems AS SI ON I.ItemID = SI.ItemID + INNER JOIN ServiceItemTypes AS STYPE ON SI.ItemTypeID = STYPE.ItemTypeID + WHERE STYPE.Searchable = 1 + UNION + SELECT + D.DomainID AS ItemID, + D.DomainName as TextSearch, + ''Domain'' as ColumnType, + ''Domain'' as FullType, + D.PackageID as PackageID, + 0 as AccountID + FROM @ItemsDomain AS I + INNER JOIN Domains AS D ON I.ItemID = D.DomainID + WHERE D.IsDomainPointer=0 + UNION + SELECT + EA.ItemID AS ItemID, + EA.AccountName as TextSearch, + ''ExchangeAccount'' as ColumnType, + ''ExchangeAccount'' as FullType, + SI2.PackageID as PackageID, + EA.AccountID as AccountID + FROM @ItemsService AS I2 + INNER JOIN ServiceItems AS SI2 ON I2.ItemID = SI2.ItemID + INNER JOIN ExchangeAccounts AS EA ON I2.ItemID = EA.ItemID +'; + +SET @sqlSpace = @sqlSpace + ' open @curValue' + +exec sp_executesql @sqlSpace, N'@UserID int, @FilterValue nvarchar(50), @ActorID int, @curValue cursor output', +@UserID, @FilterValue, @ActorID, @curValue=@curSpace output + +SET @sqlReturn = ' +DECLARE @ItemID int +DECLARE @TextSearch nvarchar(500) +DECLARE @ColumnType nvarchar(50) +DECLARE @FullType nvarchar(50) +DECLARE @PackageID int +DECLARE @AccountID int +DECLARE @EndRow int +SET @EndRow = @StartRow + @MaximumRows +DECLARE @ItemsAll TABLE + ( + ItemPosition int IDENTITY(1,1), + ItemID int, + TextSearch nvarchar(500), + ColumnType nvarchar(50), + FullType nvarchar(50), + PackageID int, + AccountID int + ) + +FETCH NEXT FROM @curSpaceValue INTO @ItemID, @TextSearch, @ColumnType, @FullType, @PackageID, @AccountID +WHILE @@FETCH_STATUS = 0 +BEGIN +INSERT INTO @ItemsAll(ItemID, TextSearch, ColumnType, FullType, PackageID, AccountID) +VALUES(@ItemID, @TextSearch, @ColumnType, @FullType, @PackageID, @AccountID) +FETCH NEXT FROM @curSpaceValue INTO @ItemID, @TextSearch, @ColumnType, @FullType, @PackageID, @AccountID +END + +FETCH NEXT FROM @curUsersValue INTO @ItemID, @TextSearch, @ColumnType, @FullType, @PackageID, @AccountID +WHILE @@FETCH_STATUS = 0 +BEGIN +INSERT INTO @ItemsAll(ItemID, TextSearch, ColumnType, FullType, PackageID, AccountID) +VALUES(@ItemID, @TextSearch, @ColumnType, @FullType, @PackageID, @AccountID) +FETCH NEXT FROM @curUsersValue INTO @ItemID, @TextSearch, @ColumnType, @FullType, @PackageID, @AccountID +END + +DECLARE @ItemsReturn TABLE + ( + ItemPosition int IDENTITY(1,1), + ItemID int, + TextSearch nvarchar(500), + ColumnType nvarchar(50), + FullType nvarchar(50), + PackageID int, + AccountID int + ) +INSERT INTO @ItemsReturn(ItemID, TextSearch, ColumnType, FullType, PackageID, AccountID) +SELECT ItemID, TextSearch, ColumnType, FullType, PackageID, AccountID +FROM @ItemsAll AS IA WHERE (1 = 1) ' + + +IF @ColType <> '' +SET @sqlReturn = @sqlReturn + ' AND IA.ColumnType in ( ' + @ColType + ' ) '; + +IF @FullType <> '' +SET @sqlReturn = @sqlReturn + ' AND IA.FullType = ''' + @FullType + ''''; + +IF @FilterValue <> '' +SET @sqlReturn = @sqlReturn + ' AND IA.' + @FilterColumn + ' LIKE @FilterValue ' + +IF @SortColumn <> '' AND @SortColumn IS NOT NULL +SET @sqlReturn = @sqlReturn + ' ORDER BY ' + @SortColumn + ' ' +SET @sqlReturn = @sqlReturn + ' +SELECT COUNT(ItemID) FROM @ItemsReturn; +SELECT DISTINCT(ColumnType) FROM @ItemsReturn WHERE (1 = 1) '; +IF @FullType <> '' +SET @sqlReturn = @sqlReturn + ' AND FullType = ''' + @FullType + ''''; +SET @sqlReturn = @sqlReturn + '; '; +SET @sqlReturn = @sqlReturn + ' +SELECT ItemPosition, ItemID, TextSearch, ColumnType, FullType, PackageID, AccountID +FROM @ItemsReturn AS IR WHERE (1 = 1) +' + +IF @MaximumRows > 0 +SET @sqlReturn = @sqlReturn + ' AND IR.ItemPosition BETWEEN @StartRow AND @EndRow'; + +exec sp_executesql @sqlReturn, N'@StartRow int, @MaximumRows int, @FilterValue nvarchar(50), @curSpaceValue cursor, @curUsersValue cursor', +@StartRow, @MaximumRows, @FilterValue, @curSpace, @curUsers + +CLOSE @curSpace +DEALLOCATE @curSpace +CLOSE @curUsers +DEALLOCATE @curUsers +RETURN From b35dec4356bb7ceeaf38dfc2988d6b1a3dcbf748 Mon Sep 17 00:00:00 2001 From: McMak Date: Fri, 8 May 2015 17:15:01 +0300 Subject: [PATCH 12/36] Fix sql update script --- WebsitePanel/Database/wix_update_db.sql | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/WebsitePanel/Database/wix_update_db.sql b/WebsitePanel/Database/wix_update_db.sql index c44654db..4131b41b 100644 --- a/WebsitePanel/Database/wix_update_db.sql +++ b/WebsitePanel/Database/wix_update_db.sql @@ -8197,11 +8197,13 @@ AS INNER JOIN PackagesTreeCache AS PT ON PIP.PackageID = PT.PackageID WHERE PT.ParentPackageID = @PackageID AND IP.PoolID = 3) ELSE IF @QuotaID = 558 BEGIN -- RAM of VPS2012 - DECLARE @Result1 int = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP + DECLARE @Result1 int + SET @Result1 = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP INNER JOIN ServiceItems AS SI ON SIP.ItemID = SI.ItemID INNER JOIN PackagesTreeCache AS PT ON SI.PackageID = PT.PackageID WHERE SIP.PropertyName = 'RamSize' AND PT.ParentPackageID = @PackageID) - DECLARE @Result2 int = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP + DECLARE @Result2 int + SET @Result2 = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP INNER JOIN ServiceItems AS SI ON SIP.ItemID = SI.ItemID INNER JOIN ServiceItemProperties AS SIP2 ON SIP2.ItemID = SI.ItemID AND SIP2.PropertyName = 'DynamicMemory.Enabled' AND SIP2.PropertyValue = 'True' From 98e4ab42f3634dbdedb19a211062f2c67c3ca57e Mon Sep 17 00:00:00 2001 From: Alexander Trofimov Date: Fri, 8 May 2015 18:16:11 +0300 Subject: [PATCH 13/36] HyperV minor fix --- WebsitePanel/Database/update_db.sql | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index 72d95c43..b4cf06cb 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -8208,11 +8208,13 @@ AS INNER JOIN PackagesTreeCache AS PT ON PIP.PackageID = PT.PackageID WHERE PT.ParentPackageID = @PackageID AND IP.PoolID = 3) ELSE IF @QuotaID = 558 BEGIN -- RAM of VPS2012 - DECLARE @Result1 int = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP + DECLARE @Result1 int + SET @Result1 = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP INNER JOIN ServiceItems AS SI ON SIP.ItemID = SI.ItemID INNER JOIN PackagesTreeCache AS PT ON SI.PackageID = PT.PackageID WHERE SIP.PropertyName = 'RamSize' AND PT.ParentPackageID = @PackageID) - DECLARE @Result2 int = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP + DECLARE @Result2 int + SET @Result2 = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP INNER JOIN ServiceItems AS SI ON SIP.ItemID = SI.ItemID INNER JOIN ServiceItemProperties AS SIP2 ON SIP2.ItemID = SI.ItemID AND SIP2.PropertyName = 'DynamicMemory.Enabled' AND SIP2.PropertyValue = 'True' From 0ffa71d0709df5d29ccac05b042757954672578d Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Fri, 8 May 2015 11:45:13 -0400 Subject: [PATCH 14/36] Added tag build-2.1.0.709 for changeset 7eef364995e4 From bae4d630d42e494ef16789df597249951f84ed36 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Fri, 8 May 2015 13:34:53 -0400 Subject: [PATCH 15/36] Added tag build-2.1.0.710 for changeset 198fa5885d22 From ff7ccc7dab8f2db1bf1313d082711cde82aa7dde Mon Sep 17 00:00:00 2001 From: McMak Date: Fri, 8 May 2015 20:50:54 +0300 Subject: [PATCH 16/36] Added file logger and default values for usernames, passwords. --- .../Sources/Setup.WIXInstaller/Product.wxs | 14 +++-- .../Common/WiXLogFileListener.cs | 55 +++++++++++++++++++ .../WebsitePanel.WIXInstaller/CustomAction.cs | 28 ++++++++++ .../WebsitePanel.WIXInstaller.csproj | 1 + 4 files changed, 93 insertions(+), 5 deletions(-) create mode 100644 WebsitePanel.Installer/Sources/WebsitePanel.WIXInstaller/Common/WiXLogFileListener.cs diff --git a/WebsitePanel.Installer/Sources/Setup.WIXInstaller/Product.wxs b/WebsitePanel.Installer/Sources/Setup.WIXInstaller/Product.wxs index 82eef886..866e0a79 100644 --- a/WebsitePanel.Installer/Sources/Setup.WIXInstaller/Product.wxs +++ b/WebsitePanel.Installer/Sources/Setup.WIXInstaller/Product.wxs @@ -452,6 +452,7 @@ 1 1 + Please wait while [ProductName] Installer configures IIS & ASP.NET, this may take a few minutes. Thanks! @@ -476,7 +477,7 @@ - + @@ -503,7 +504,7 @@ - + @@ -512,7 +513,7 @@ - + @@ -522,7 +523,7 @@ - + @@ -590,9 +591,10 @@ WSP_ROOT + - + @@ -610,8 +612,10 @@ + 1 + diff --git a/WebsitePanel.Installer/Sources/WebsitePanel.WIXInstaller/Common/WiXLogFileListener.cs b/WebsitePanel.Installer/Sources/WebsitePanel.WIXInstaller/Common/WiXLogFileListener.cs new file mode 100644 index 00000000..623505fa --- /dev/null +++ b/WebsitePanel.Installer/Sources/WebsitePanel.WIXInstaller/Common/WiXLogFileListener.cs @@ -0,0 +1,55 @@ +using System; +using System.Diagnostics; +using System.IO; +using System.Text; +using Microsoft.Deployment.WindowsInstaller; + +namespace WebsitePanel.WIXInstaller.Common +{ + public class WiXLogFileListener : TraceListener + { + public const uint FileFlushSize = 4096; + public const string DefaultLogFile = "WSPInstallation.log.txt"; + public static string LogFile { get; private set; } + private StringBuilder m_Ctx; + static WiXLogFileListener() + { + LogFile = Path.Combine(Path.GetTempPath() + DefaultLogFile); + } + public WiXLogFileListener(string LogFileName = DefaultLogFile) + : base("WiXLogFileListener") + { + m_Ctx = new StringBuilder(); + } + ~WiXLogFileListener() + { + Dispose(false); + } + protected override void Dispose(bool disposing) + { + base.Dispose(disposing); + Flush(true); + } + public override void Write(string Value) + { + m_Ctx.Append(Value); + Flush(); + } + public override void WriteLine(string Value) + { + m_Ctx.AppendLine(Value); + Flush(); + } + private void Flush(bool Force = false) + { + if(m_Ctx.Length >= FileFlushSize || Force) + { + using (var FileCtx = new StreamWriter(LogFile, true)) + { + FileCtx.Write(m_Ctx.ToString()); + } + m_Ctx.Clear(); + } + } + } +} diff --git a/WebsitePanel.Installer/Sources/WebsitePanel.WIXInstaller/CustomAction.cs b/WebsitePanel.Installer/Sources/WebsitePanel.WIXInstaller/CustomAction.cs index 2f652068..726ded67 100644 --- a/WebsitePanel.Installer/Sources/WebsitePanel.WIXInstaller/CustomAction.cs +++ b/WebsitePanel.Installer/Sources/WebsitePanel.WIXInstaller/CustomAction.cs @@ -54,6 +54,32 @@ namespace WebsitePanel.WIXInstaller #region CustomActions [CustomAction] + public static ActionResult PreFillSettings(Session session) + { + PopUpDebugger(); + var Ctx = session; + Ctx.AttachToSetupLog(); + Log.WriteStart("PreFillSettings"); + TryApllyNewPassword(Ctx, "PI_SERVER_PASSWORD"); + TryApllyNewPassword(Ctx, "PI_ESERVER_PASSWORD"); + TryApllyNewPassword(Ctx, "PI_PORTAL_PASSWORD"); + TryApllyNewPassword(Ctx, "SERVER_ACCESS_PASSWORD"); + TryApllyNewPassword(Ctx, "SERVERADMIN_PASSWORD"); + Log.WriteEnd("PreFillSettings"); + return ActionResult.Success; + } + private static void TryApllyNewPassword(Session Ctx, string Id) + { + var Pass = Ctx[Id]; + if(string.IsNullOrWhiteSpace(Pass)) + { + Pass = Guid.NewGuid().ToString(); + Ctx[Id] = Pass; + Ctx[Id + "_CONFIRM"] = Pass; + Log.WriteInfo("New password was applied to " + Id); + } + } + [CustomAction] public static ActionResult InstallWebFeatures(Session session) { var Msg = string.Empty; @@ -406,6 +432,7 @@ namespace WebsitePanel.WIXInstaller [CustomAction] public static ActionResult FillIpListUI(Session session) { + PopUpDebugger(); var Ctrls = new[]{ new ComboBoxCtrl(session, "PI_SERVER_IP"), new ComboBoxCtrl(session, "PI_ESERVER_IP"), new ComboBoxCtrl(session, "PI_PORTAL_IP") }; @@ -758,6 +785,7 @@ namespace WebsitePanel.WIXInstaller { WiXSetup.InstallLogListener(new WiXLogListener(Ctx)); WiXSetup.InstallLogListener(new InMemoryStringLogListener("WIX CA IN MEMORY")); + WiXSetup.InstallLogListener(new WiXLogFileListener()); } } diff --git a/WebsitePanel.Installer/Sources/WebsitePanel.WIXInstaller/WebsitePanel.WIXInstaller.csproj b/WebsitePanel.Installer/Sources/WebsitePanel.WIXInstaller/WebsitePanel.WIXInstaller.csproj index 59ae4596..1a4b44b7 100644 --- a/WebsitePanel.Installer/Sources/WebsitePanel.WIXInstaller/WebsitePanel.WIXInstaller.csproj +++ b/WebsitePanel.Installer/Sources/WebsitePanel.WIXInstaller/WebsitePanel.WIXInstaller.csproj @@ -63,6 +63,7 @@ + From 5ab109df9a05e0d107f3c9ac199672a6934ff75f Mon Sep 17 00:00:00 2001 From: McMak Date: Fri, 8 May 2015 21:55:14 +0300 Subject: [PATCH 17/36] Fix WSP registry locator. --- .../Sources/Setup.WIXInstaller/Product.wxs | 12 +++++----- .../WebsitePanel.WIXInstaller/CustomAction.cs | 23 +++++++++---------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/WebsitePanel.Installer/Sources/Setup.WIXInstaller/Product.wxs b/WebsitePanel.Installer/Sources/Setup.WIXInstaller/Product.wxs index 866e0a79..c22fd509 100644 --- a/WebsitePanel.Installer/Sources/Setup.WIXInstaller/Product.wxs +++ b/WebsitePanel.Installer/Sources/Setup.WIXInstaller/Product.wxs @@ -540,8 +540,8 @@ - - + + - WSP_ROOT + WSP_BASE @@ -684,9 +684,9 @@ - - + diff --git a/WebsitePanel.Installer/Sources/WebsitePanel.WIXInstaller/CustomAction.cs b/WebsitePanel.Installer/Sources/WebsitePanel.WIXInstaller/CustomAction.cs index 726ded67..e14b3ce4 100644 --- a/WebsitePanel.Installer/Sources/WebsitePanel.WIXInstaller/CustomAction.cs +++ b/WebsitePanel.Installer/Sources/WebsitePanel.WIXInstaller/CustomAction.cs @@ -68,17 +68,6 @@ namespace WebsitePanel.WIXInstaller Log.WriteEnd("PreFillSettings"); return ActionResult.Success; } - private static void TryApllyNewPassword(Session Ctx, string Id) - { - var Pass = Ctx[Id]; - if(string.IsNullOrWhiteSpace(Pass)) - { - Pass = Guid.NewGuid().ToString(); - Ctx[Id] = Pass; - Ctx[Id + "_CONFIRM"] = Pass; - Log.WriteInfo("New password was applied to " + Id); - } - } [CustomAction] public static ActionResult InstallWebFeatures(Session session) { @@ -778,6 +767,17 @@ namespace WebsitePanel.WIXInstaller { Debugger.Launch(); } + private static void TryApllyNewPassword(Session Ctx, string Id) + { + var Pass = Ctx[Id]; + if (string.IsNullOrWhiteSpace(Pass)) + { + Pass = Guid.NewGuid().ToString(); + Ctx[Id] = Pass; + Ctx[Id + "_CONFIRM"] = Pass; + Log.WriteInfo("New password was applied to " + Id); + } + } } public static class SessionExtension { @@ -788,7 +788,6 @@ namespace WebsitePanel.WIXInstaller WiXSetup.InstallLogListener(new WiXLogFileListener()); } } - internal enum WiXInstallType: byte { InstallServer, From 4baf93defc2292fc6c99fed0daa2c840e8e95d72 Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Mon, 11 May 2015 00:49:05 -0700 Subject: [PATCH 18/36] password request UI changes --- .../ExchangeServer/ExchangeCreateMailbox.ascx | 18 ++++++------- .../ExchangeCreateMailbox.ascx.designer.cs | 27 ++++++++++++------- .../OrganizationCreateUser.ascx | 10 ++++--- .../OrganizationCreateUser.ascx.designer.cs | 27 ++++++++++++------- .../SendToControl.ascx.resx | 4 +-- 5 files changed, 54 insertions(+), 32 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx index e75dffe8..34707f25 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx @@ -104,21 +104,21 @@ - - - - - - - - - + + + + + + + + + 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 19/36] Added tag build-2.1.0.711 for changeset a9c2171ad75c From b7b39e8fa2b077b27f51632a10c2772c0db18ec2 Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Mon, 11 May 2015 06:38:57 -0700 Subject: [PATCH 20/36] 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 21/36] 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 22/36] 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/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 23/36] 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 24/36] 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 25/36] Added tag build-2.1.0.715 for changeset b1d91c14ab8d From 473fd3c3ef2f75fc62660aa849defb64dae81ab9 Mon Sep 17 00:00:00 2001 From: McMak Date: Tue, 12 May 2015 23:44:49 +0300 Subject: [PATCH 26/36] WiX Update fixes. --- .../Sources/Setup.WIXInstaller/Product.wxs | 71 ++++++-- .../Common/InstallAction.cs | 3 +- .../Sources/WebsitePanel.Setup/Common/OS.cs | 18 ++ .../WebsitePanel.Setup/Internal/Adapter.cs | 160 ++++++++++++++---- .../Internal/BackupRestore.cs | 122 +++++++++++++ .../Internal/XmlDocumentMerge.cs | 139 +++++++++++++++ .../WebsitePanel.Setup.csproj | 2 + .../WebsitePanel.WIXInstaller/CustomAction.cs | 41 ++++- 8 files changed, 500 insertions(+), 56 deletions(-) create mode 100644 WebsitePanel.Installer/Sources/WebsitePanel.Setup/Internal/BackupRestore.cs create mode 100644 WebsitePanel.Installer/Sources/WebsitePanel.Setup/Internal/XmlDocumentMerge.cs diff --git a/WebsitePanel.Installer/Sources/Setup.WIXInstaller/Product.wxs b/WebsitePanel.Installer/Sources/Setup.WIXInstaller/Product.wxs index c22fd509..273fbfaf 100644 --- a/WebsitePanel.Installer/Sources/Setup.WIXInstaller/Product.wxs +++ b/WebsitePanel.Installer/Sources/Setup.WIXInstaller/Product.wxs @@ -331,11 +331,14 @@ 1 1 - &ServerFeature=3 - &EnterpriseServerFeature=3 - &PortalFeature=3 - &SchedulerServiceFeature=3 - &WDPortalFeature=3 + + + + + + + + 1 1 @@ -357,7 +360,10 @@ ""]]> "" AND DSOP_UPN = ""]]> - 1 + + 1 + + &EnterpriseServerFeature=3 AND VALIDATE_OK = "1" &PortalFeature=3 AND VALIDATE_OK = "1" &SchedulerServiceFeature=3 AND VALIDATE_OK = "1" @@ -389,7 +395,11 @@ ""]]> "" AND DSOP_UPN = ""]]> - 1 + + + 1 + + VALIDATE_OK="0" 1 @@ -437,16 +447,22 @@ ""]]> "" AND DSOP_UPN = ""]]> - 1 + + + + 1 1 1 - - - - 3]]> - 3 AND &PortalFeature<>3]]> + + + + + + + 3 AND COMPFOUND_ESERVER=0]]> + 3 AND &PortalFeature<>3 AND COMPFOUND_SERVER=0]]> 1 1 @@ -540,9 +556,15 @@ - + + + + + + + @@ -589,6 +611,13 @@ + + + + + + + WSP_BASE @@ -611,7 +640,15 @@ - + + + + + + + + + 1 @@ -634,7 +671,7 @@ - (NOT Installed OR NOT WIX_UPGRADE_DETECTED) AND NOT(DB_AUTH = "Windows Authentication") + (NOT Installed AND NOT WIX_UPGRADE_DETECTED) AND NOT(DB_AUTH = "Windows Authentication") - (NOT Installed OR NOT WIX_UPGRADE_DETECTED) AND (DB_AUTH = "Windows Authentication") + (NOT Installed AND NOT WIX_UPGRADE_DETECTED) AND (DB_AUTH = "Windows Authentication") /// LoadSetupVariablesFromParameters. @@ -393,6 +397,9 @@ namespace WebsitePanel.Setup.Internal case ActionTypes.ConfigureSecureSessionModuleInWebConfig: ConfigureSecureSessionModuleInWebConfig(); break; + case ActionTypes.RestoreConfig: + RestoreXmlConfigs(Execute.SetupVariables); + break; } } catch (Exception ex) @@ -402,7 +409,6 @@ namespace WebsitePanel.Setup.Internal } } } - protected virtual List GetActions(string ComponentID) { return new List(); @@ -843,7 +849,7 @@ namespace WebsitePanel.Setup.Internal return; } // Load web.config - XmlDocument doc = new XmlDocument(); + var doc = new XmlDocument(); doc.Load(webConfigPath); // add node: @@ -993,7 +999,7 @@ namespace WebsitePanel.Setup.Internal return; } // Load web.config - XmlDocument doc = new XmlDocument(); + var doc = new XmlDocument(); doc.Load(webConfigPath); // do Windows 2008 platform-specific changes bool iis7 = (Context.IISVersion.Major >= 7); @@ -1229,7 +1235,7 @@ namespace WebsitePanel.Setup.Internal private string GetConnectionString(string webConfigPath) { string ret = null; - XmlDocument doc = new XmlDocument(); + var doc = new XmlDocument(); doc.Load(webConfigPath); //connection string string xPath = "configuration/connectionStrings/add[@name=\"EnterpriseServer\"]"; @@ -1244,7 +1250,7 @@ namespace WebsitePanel.Setup.Internal private string GetCryptoKey(string webConfigPath) { string ret = null; - XmlDocument doc = new XmlDocument(); + var doc = new XmlDocument(); doc.Load(webConfigPath); //crypto key string xPath = "configuration/appSettings/add[@key=\"WebsitePanel.CryptoKey\"]"; @@ -1258,7 +1264,7 @@ namespace WebsitePanel.Setup.Internal private bool IsEncryptionEnabled(string webConfigPath) { - XmlDocument doc = new XmlDocument(); + var doc = new XmlDocument(); doc.Load(webConfigPath); //encryption enabled string xPath = "configuration/appSettings/add[@key=\"WebsitePanel.EncryptionEnabled\"]"; @@ -2316,7 +2322,7 @@ namespace WebsitePanel.Setup.Internal } Log.WriteStart("Updating config.xml file"); - XmlDocument doc = new XmlDocument(); + var doc = new XmlDocument(); doc.Load(path); XmlNode serversNode = doc.SelectSingleNode("//myLittleAdmin/sqlservers"); @@ -2429,7 +2435,7 @@ namespace WebsitePanel.Setup.Internal return; } // Load web.config - XmlDocument doc = new XmlDocument(); + var doc = new XmlDocument(); doc.Load(webConfigPath); // Tighten WSE security on local machine @@ -2513,7 +2519,7 @@ namespace WebsitePanel.Setup.Internal } Log.WriteStart("Loading portal settings"); - XmlDocument doc = new XmlDocument(); + var doc = new XmlDocument(); doc.Load(path); string xPath = "configuration/connectionStrings/add[@name=\"SiteSqlServer\"]"; @@ -2605,7 +2611,7 @@ namespace WebsitePanel.Setup.Internal } Log.WriteStart("Updating site settings"); - XmlDocument doc = new XmlDocument(); + var doc = new XmlDocument(); doc.Load(path); XmlElement urlNode = doc.SelectSingleNode("SiteSettings/EnterpriseServer") as XmlElement; @@ -3178,7 +3184,7 @@ namespace WebsitePanel.Setup.Internal } Log.WriteStart("Updating configuration file (server password)"); - XmlDocument doc = new XmlDocument(); + var doc = new XmlDocument(); doc.Load(path); XmlElement passwordNode = doc.SelectSingleNode("//websitepanel.server/security/password") as XmlElement; @@ -3221,7 +3227,7 @@ namespace WebsitePanel.Setup.Internal } Log.WriteStart("Updating configuration file (service settings)"); - XmlDocument doc = new XmlDocument(); + var doc = new XmlDocument(); doc.Load(path); XmlElement ipNode = doc.SelectSingleNode("//configuration/appSettings/add[@key='WebsitePanel.HostIP']") as XmlElement; @@ -3881,7 +3887,7 @@ namespace WebsitePanel.Setup.Internal return; } // Load web.config - XmlDocument doc = new XmlDocument(); + var doc = new XmlDocument(); doc.Load(webConfigPath); // replace existing node: @@ -3915,8 +3921,63 @@ namespace WebsitePanel.Setup.Internal } #endregion #endregion + private void RestoreXmlConfigs(SetupVariables Ctx) + { + try + { + Log.WriteStart("RestoreXmlConfigs"); + var Backup = BackupRestore.Find(Ctx.InstallerFolder, "WebsitePanel", Ctx.ComponentName); + switch(Ctx.ComponentCode) + { + case "server": + { + Backup.XmlFiles.Add("Web.config"); + } + break; + case "enterpriseserver": + { + Backup.XmlFiles.Add("Web.config"); + } + break; + case "portal": + { + Backup.XmlFiles.Add("Web.config"); + Backup.XmlFiles.Add(@"App_Data\Countries.config"); + Backup.XmlFiles.Add(@"App_Data\CountryStates.config"); + Backup.XmlFiles.Add(@"App_Data\Ecommerce_Modules.config"); + Backup.XmlFiles.Add(@"App_Data\Ecommerce_Pages.config"); + Backup.XmlFiles.Add(@"App_Data\ESModule_ControlsHierarchy.config"); + Backup.XmlFiles.Add(@"App_Data\ModulesData.config"); + Backup.XmlFiles.Add(@"App_Data\SiteSettings.config"); + Backup.XmlFiles.Add(@"App_Data\SupportedLocales.config"); + Backup.XmlFiles.Add(@"App_Data\SupportedThemes.config"); + Backup.XmlFiles.Add(@"App_Data\WebsitePanel_Modules.config"); + Backup.XmlFiles.Add(@"App_Data\WebsitePanel_Pages.config"); + } + break; + } + var MainCfg = Path.Combine(Ctx.InstallerFolder, BackupRestore.MainConfig); + var XCfg = new XmlDocument(); + XCfg.Load(MainCfg); + if (XCfg.SelectSingleNode("//components").ChildNodes.Count == 0) + { + Log.WriteInfo("Restoring main config..."); + XmlDocumentMerge.Process(Backup.BackupMainConfigFile, MainCfg); + Context.ComponentId = WiXSetup.GetComponentID(Ctx); + AppConfig.LoadConfiguration(new ExeConfigurationFileMap { ExeConfigFilename = MainCfg }); + AppConfig.LoadComponentSettings(Ctx); + } + Log.WriteInfo(string.Format("Restoring xml config for component - {0}.", Ctx.ComponentFullName)); + Backup.Restore(); + Log.WriteEnd("RestoreXmlConfigs"); + } + catch (Exception ex) + { + Log.WriteError("RestoreXmlConfigs", ex); + throw; + } + } } - public class UninstallScript : SetupScript // UninstallPage { public UninstallScript(SetupVariables SessionVariables):base(SessionVariables) @@ -4117,12 +4178,22 @@ namespace WebsitePanel.Setup.Internal protected override List GetActions(string ComponentID) { var Scenario = base.GetActions(ComponentID); - var Act = new InstallAction(ActionTypes.UpdateConfig); - Act.Description = "Updating system configuration..."; - Scenario.Add(Act); - Act = new InstallAction(ActionTypes.StartApplicationPool); - Act.Description = "Starting IIS Application Pool..."; - Scenario.Add(Act); + Scenario.Add(new InstallAction(ActionTypes.RestoreConfig) { SetupVariables = Context, Description = "Restoring xml configuration files..." }); + Scenario.Add(new InstallAction(ActionTypes.UpdateConfig) { Description = "Updating system configuration..." }); + Scenario.Add(new InstallAction(ActionTypes.StartApplicationPool) { Description = "Starting IIS Application Pool..." }); + return Scenario; + } + } + public class MaintenanceScript: ExpressScript + { + public MaintenanceScript(SetupVariables SessionVariables):base(SessionVariables) + { + Context.SetupAction = SetupActions.Setup; + } + protected override List GetActions(string ComponentID) + { + var Scenario = base.GetActions(ComponentID); + Scenario.Add(new InstallAction(ActionTypes.UpdateConfig) { Description = "Updating system configuration..." }); return Scenario; } } @@ -4170,6 +4241,7 @@ namespace WebsitePanel.Setup.Internal else if (ModeExtension == ModeExtension.Restore) { Context.ComponentId = GetComponentID(Context); + Context.UpdateVersion = Context.Release; AppConfig.LoadComponentSettings(Context); new RestoreScript(Context).Run(); } @@ -4194,12 +4266,19 @@ namespace WebsitePanel.Setup.Internal } Script.Run(); } + protected override void Maintenance() + { + Context.ComponentId = GetComponentID(Context); + AppConfig.LoadComponentSettings(Context); + SetupScript Script = new MaintenanceScript(Context); + Script.Actions.Add(new InstallAction(ActionTypes.UpdateServerPassword) { Description = "Updating server password..." }); + Script.Run(); + } } - public class EServerSetup : WiXSetup { - public EServerSetup(SetupVariables Ctx) - : base(Ctx) + public EServerSetup(SetupVariables Ctx, ModeExtension Ext) + : base(Ctx, Ext) { } @@ -4210,7 +4289,7 @@ namespace WebsitePanel.Setup.Internal SetupVars.SetupAction = Action; SetupVars.IISVersion = Global.IISVersion; AppConfig.LoadConfiguration(new ExeConfigurationFileMap { ExeConfigFilename = GetFullConfigPath(SetupVars) }); - return new EServerSetup(SetupVars); + return new EServerSetup(SetupVars, GetModeExtension(Ctx)); } protected override void Install() { @@ -4240,6 +4319,7 @@ namespace WebsitePanel.Setup.Internal else if (ModeExtension == ModeExtension.Restore) { Context.ComponentId = GetComponentID(Context); + Context.UpdateVersion = Context.Release; AppConfig.LoadComponentSettings(Context); new RestoreScript(Context).Run(); } @@ -4264,12 +4344,19 @@ namespace WebsitePanel.Setup.Internal } Script.Run(); } + protected override void Maintenance() + { + Context.ComponentId = GetComponentID(Context); + AppConfig.LoadComponentSettings(Context); + SetupScript Script = new MaintenanceScript(Context); + Script.Actions.Add(new InstallAction(ActionTypes.UpdateServerAdminPassword) { Description = "Updating serveradmin password..." }); + Script.Run(); + } } - public class PortalSetup : WiXSetup { - public PortalSetup(SetupVariables Ctx) - : base(Ctx) + public PortalSetup(SetupVariables Ctx, ModeExtension Ext) + : base(Ctx, Ext) { } @@ -4280,7 +4367,7 @@ namespace WebsitePanel.Setup.Internal SetupVars.SetupAction = Action; SetupVars.IISVersion = Global.IISVersion; AppConfig.LoadConfiguration(new ExeConfigurationFileMap { ExeConfigFilename = GetFullConfigPath(SetupVars) }); - return new PortalSetup(SetupVars); + return new PortalSetup(SetupVars, GetModeExtension(Ctx)); } protected override void Install() { @@ -4306,17 +4393,11 @@ namespace WebsitePanel.Setup.Internal } if (WiXThrow) InstallFailed(); - - else if (ModeExtension == ModeExtension.Restore) - { - Context.ComponentId = GetComponentID(Context); - AppConfig.LoadComponentSettings(Context); - new RestoreScript(Context).Run(); - } } else if (ModeExtension == ModeExtension.Restore) { Context.ComponentId = GetComponentID(Context); + Context.UpdateVersion = Context.Release; AppConfig.LoadComponentSettings(Context); new RestoreScript(Context).Run(); } @@ -4348,8 +4429,15 @@ namespace WebsitePanel.Setup.Internal } Script.Run(); } + protected override void Maintenance() + { + Context.ComponentId = GetComponentID(Context); + AppConfig.LoadComponentSettings(Context); + SetupScript Script = new MaintenanceScript(Context); + Script.Actions.Add(new InstallAction(ActionTypes.UpdateEnterpriseServerUrl) { Description = "Updating site settings..." }); + Script.Run(); + } } - #region WiXActionManagers public class WiXServerActionManager : BaseActionManager { diff --git a/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Internal/BackupRestore.cs b/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Internal/BackupRestore.cs new file mode 100644 index 00000000..5778175f --- /dev/null +++ b/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Internal/BackupRestore.cs @@ -0,0 +1,122 @@ +using System; +using System.Collections.Generic; +using System.Globalization; +using System.IO; +using System.Linq; +using System.Xml; +using Ionic.Zip; + +namespace WebsitePanel.Setup.Internal +{ + class BackupRestore + { + struct DirectoryTag + { + public string Name; + public DateTime Date; + public Version Version; + } + public const string MainConfig = "WebsitePanel.config"; + const string BackupDirectory = "Backup"; + const string ConfigDirectory = "Config"; + const string AppZip = @"App\app.zip"; + const string DateFormat = "yyyy-MM-dd"; + public BackupRestore() + { + XmlFiles = new List(); + } + public static BackupRestore Find(string Root, string Product, string Id) + { + var Result = default(BackupRestore); + var Dir = Path.Combine(Root, BackupDirectory); + var FullId = GetFullId(Product, Id); + if (Directory.Exists(Dir)) + { + var DirList = new List(); + foreach (var DateItem in Directory.GetDirectories(Dir)) + { + DateTime date; + var DateName = new DirectoryInfo(DateItem).Name; + if (DateTime.TryParseExact(DateName, DateFormat, CultureInfo.InvariantCulture, DateTimeStyles.None, out date)) + { + foreach (var VersionItem in Directory.GetDirectories(DateItem)) + { + var VersionName = new DirectoryInfo(VersionItem).Name; + if (VersionName.StartsWith(FullId, StringComparison.InvariantCultureIgnoreCase)) + { + Version BckpVersion; + var StrVersion = VersionName.Substring(FullId.Length); + if (Version.TryParse(StrVersion, out BckpVersion)) + { + DirList.Add(new DirectoryTag { Name = VersionItem, Date = date, Version = BckpVersion }); + } + } + } + } + } + var ByVersion = from i in DirList where i.Version == (from v in DirList select v.Version).Max() select i; + var ByDate = from i in ByVersion where i.Date == (from v in ByVersion select v.Date).Max() select i; + var SrcTag = ByDate.First(); + Result = new BackupRestore { Id = Id, Root = GetComponentRoot(SrcTag, Id), BackupFile = Path.Combine(SrcTag.Name, AppZip), BackupMainConfigFile = GetMainConfig(SrcTag) }; + } + return Result; + } + private static string GetComponentRoot(DirectoryTag DirTag, string Id) + { + var Cfg = GetMainConfig(DirTag); + if (string.IsNullOrWhiteSpace(Cfg)) + throw new Exception("Broken backup. Main config file not found."); + var XCfg = new XmlDocument(); + XCfg.Load(Cfg); + var Component = XCfg.SelectSingleNode(string.Format("//component[.//add/@key='ComponentName' and .//add/@value='{0}']", Id)); + var InstallFolder = Component.SelectSingleNode(".//add[@key='InstallFolder']"); + return InstallFolder.Attributes["value"].Value; + } + private static string GetMainConfig(DirectoryTag DirTag) + { + return Path.Combine(DirTag.Name, ConfigDirectory, MainConfig); + } + private static string GetFullId(string Product, string Id) + { + return string.Format("{0} {1}", Product, Id); + } + public virtual void Restore() + { + using (var Bckp = new ZipFile(BackupFile)) + { + foreach (var Xml in XmlFiles) + { + var SrcEntry = from Entry in Bckp.Entries where NormalizePath(Entry.FileName.ToLowerInvariant(), "/") == Xml.ToLowerInvariant() select Entry; + if (SrcEntry != null) + { + if (SrcEntry.LongCount() > 1) + throw new Exception(string.Format("Too many backup entries - {0}.", Xml)); + var FileEntry = SrcEntry.FirstOrDefault(); + if (FileEntry != null) + { + using (var InMem = new MemoryStream()) + { + FileEntry.Extract(InMem); + InMem.Seek(0, SeekOrigin.Begin); + using (var OutFile = new FileStream(Path.Combine(Root, Xml), FileMode.Open, FileAccess.ReadWrite)) + { + XmlDocumentMerge.Process(InMem, OutFile); + } + } + } + } + } + } + } + private string NormalizePath(string FilePath, string In) + { + return Path.Combine(FilePath.Split(new string[] { In }, StringSplitOptions.RemoveEmptyEntries)); + } + public string Id { get; set; } // Component full name. + public string Comment { get; set; } + public string BackupFile { get; set; } // Should be zip archive. + public string BackupMainConfigFile { get; set; } + public IList XmlFiles { get; set; } // Xml files (configs) to merge and update. + public string Root { get; set; } + } +} diff --git a/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Internal/XmlDocumentMerge.cs b/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Internal/XmlDocumentMerge.cs new file mode 100644 index 00000000..4c4511c4 --- /dev/null +++ b/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Internal/XmlDocumentMerge.cs @@ -0,0 +1,139 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Xml; +using System.Xml.XPath; + +namespace WebsitePanel.Setup.Internal +{ + public static class XmlDocumentMerge + { + const string SuccessFormat = "Success: {0}."; + const string ErrorFormat = "Error: {0}."; + const string MergeCompleted = "XmlDocumentMerge completed"; + static XmlDocumentMerge() + { + KeyAttributes = new List { "name", "id", "key" }; + } + public static List KeyAttributes { get; set; } + public static string Process(string Src, string Dst, string SaveTo = "") + { + var Result = string.Empty; + if (!File.Exists(Src)) + Result = string.Format(ErrorFormat, string.Format("source document [{0}] does not exists", Src)); + else if (!File.Exists(Dst)) + Result = string.Format(ErrorFormat, string.Format("destination document [{0}] does not exists", Dst)); + else + { + try + { + var InStream = new FileStream(Src, FileMode.Open, FileAccess.Read); + var OutStream = new FileStream(Dst, FileMode.Open, FileAccess.ReadWrite); + Result = Process(InStream, + OutStream, + SaveTo); + InStream.Close(); + OutStream.Flush(); + OutStream.Close(); + } + catch (Exception ex) + { + Result = string.Format(ErrorFormat, ex.ToString()); + } + } + return Result; + } + public static string Process(Stream InSrc, Stream OutDst, string SaveTo = "") + { + var Result = string.Format(SuccessFormat, MergeCompleted); + try + { + var SrcDoc = new XmlDocument(); + SrcDoc.Load(InSrc); + var DstDoc = new XmlDocument(); + DstDoc.Load(OutDst); + var DstNavi = DstDoc.CreateNavigator(); + var DstIterator = DstNavi.SelectChildren(XPathNodeType.All); + while (DstIterator.MoveNext()) + Merge(DstIterator.Current.Clone(), SrcDoc, string.Empty); + if (string.IsNullOrWhiteSpace(SaveTo)) + { + OutDst.SetLength(0); + DstDoc.Save(OutDst); + } + else + DstDoc.Save(SaveTo); + } + catch (Exception ex) + { + Result = string.Format(ErrorFormat, ex.ToString()); + } + return Result; + } + private static string NodePath(string Parent, string Current) + { + var Result = string.Empty; + if (!string.IsNullOrWhiteSpace(Parent) && !string.IsNullOrWhiteSpace(Current)) + Result = string.Format("{0}/{1}", Parent, Current); + else if (!string.IsNullOrWhiteSpace(Parent)) + Result = Parent; + else if (!string.IsNullOrWhiteSpace(Current)) + Result = Current; + return Result; + } + private static string NodeView(XPathNavigator Navi) + { + foreach (var Attr in KeyAttributes) + { + var Value = Navi.GetAttribute(Attr, string.Empty); + if (!string.IsNullOrWhiteSpace(Value)) + return string.Format("{0}[@{1}='{2}']", Navi.Name, Attr, Value); + } + return Navi.Name; + } + private static void Merge(XPathNavigator DstNavi, XmlDocument SrcDoc, string Parent) + { + if (DstNavi.NodeType == XPathNodeType.Element) + { + var SrcElem = SrcDoc.SelectSingleNode(NodePath(Parent, NodeView(DstNavi))); + if (SrcElem != null) + { + if (DstNavi.MoveToFirstAttribute()) + { + do + { + var SrcElemAttr = SrcElem.Attributes[DstNavi.LocalName]; + if (SrcElemAttr != null) + DstNavi.SetValue(SrcElemAttr.Value); + } + while (DstNavi.MoveToNextAttribute()); + DstNavi.MoveToParent(); + } + } + } + else if (DstNavi.NodeType == XPathNodeType.Text) + { + var SrcElem = SrcDoc.SelectSingleNode(NodePath(Parent, NodeView(DstNavi))); + if (SrcElem != null) + DstNavi.SetValue(SrcElem.InnerText); + } + var Here = NodeView(DstNavi); + if (DstNavi.MoveToFirstChild()) + { + do + { + Merge(DstNavi, SrcDoc, NodePath(Parent, Here)); + } + while (DstNavi.MoveToNext()); + DstNavi.MoveToParent(); + } + else if (DstNavi.NodeType == XPathNodeType.Element) + { + var SrcElem = SrcDoc.SelectSingleNode(NodePath(Parent, Here)); + if (SrcElem != null && !string.IsNullOrWhiteSpace(SrcElem.InnerXml)) + foreach (XmlNode Child in SrcElem.ChildNodes) + DstNavi.AppendChild(Child.CloneNode(true).CreateNavigator()); + } + } + } +} diff --git a/WebsitePanel.Installer/Sources/WebsitePanel.Setup/WebsitePanel.Setup.csproj b/WebsitePanel.Installer/Sources/WebsitePanel.Setup/WebsitePanel.Setup.csproj index 246d4850..864c3e5d 100644 --- a/WebsitePanel.Installer/Sources/WebsitePanel.Setup/WebsitePanel.Setup.csproj +++ b/WebsitePanel.Installer/Sources/WebsitePanel.Setup/WebsitePanel.Setup.csproj @@ -144,6 +144,8 @@ + + diff --git a/WebsitePanel.Installer/Sources/WebsitePanel.WIXInstaller/CustomAction.cs b/WebsitePanel.Installer/Sources/WebsitePanel.WIXInstaller/CustomAction.cs index e14b3ce4..3bc32d46 100644 --- a/WebsitePanel.Installer/Sources/WebsitePanel.WIXInstaller/CustomAction.cs +++ b/WebsitePanel.Installer/Sources/WebsitePanel.WIXInstaller/CustomAction.cs @@ -54,6 +54,33 @@ namespace WebsitePanel.WIXInstaller #region CustomActions [CustomAction] + public static ActionResult MaintenanceServer(Session session) + { + var Result = ActionResult.Success; + Log.WriteStart("MaintenanceServer"); + Result = ProcessInstall(session, WiXInstallType.MaintenanceServer); + Log.WriteEnd("MaintenanceServer"); + return Result; + } + [CustomAction] + public static ActionResult MaintenanceEServer(Session session) + { + var Result = ActionResult.Success; + Log.WriteStart("MaintenanceEServer"); + Result = ProcessInstall(session, WiXInstallType.MaintenanceEnterpriseServer); + Log.WriteEnd("MaintenanceEServer"); + return Result; + } + [CustomAction] + public static ActionResult MaintenancePortal(Session session) + { + var Result = ActionResult.Success; + Log.WriteStart("MaintenancePortal"); + Result = ProcessInstall(session, WiXInstallType.MaintenancePortal); + Log.WriteEnd("MaintenancePortal"); + return Result; + } + [CustomAction] public static ActionResult PreFillSettings(Session session) { PopUpDebugger(); @@ -733,18 +760,27 @@ namespace WebsitePanel.WIXInstaller case WiXInstallType.RemoveServer: Install = ServerSetup.Create(Ctx.CustomActionData, SetupActions.Uninstall); break; + case WiXInstallType.MaintenanceServer: + Install = ServerSetup.Create(Ctx.CustomActionData, SetupActions.Setup); + break; case WiXInstallType.InstallEnterpriseServer: Install = EServerSetup.Create(Ctx.CustomActionData, SetupActions.Install); break; case WiXInstallType.RemoveEnterpriseServer: Install = EServerSetup.Create(Ctx.CustomActionData, SetupActions.Uninstall); break; + case WiXInstallType.MaintenanceEnterpriseServer: + Install = EServerSetup.Create(Ctx.CustomActionData, SetupActions.Setup); + break; case WiXInstallType.InstallPortal: Install = PortalSetup.Create(Ctx.CustomActionData, SetupActions.Install); break; case WiXInstallType.RemovePortal: Install = PortalSetup.Create(Ctx.CustomActionData, SetupActions.Uninstall); break; + case WiXInstallType.MaintenancePortal: + Install = PortalSetup.Create(Ctx.CustomActionData, SetupActions.Setup); + break; default: throw new NotImplementedException(); } @@ -796,7 +832,8 @@ namespace WebsitePanel.WIXInstaller RemoveServer, RemoveEnterpriseServer, RemovePortal, - RemoveUpdate, - RestoreUpdate + MaintenanceServer, + MaintenanceEnterpriseServer, + MaintenancePortal } } From dc1190745fce17ddce0c5ba159b855fc750e525b Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Tue, 12 May 2015 18:27:58 -0400 Subject: [PATCH 27/36] Added tag build-2.1.0.716 for changeset 79d6d2f3f7a1 From ce508b178c1a26d28811ca5bace20801ed3992eb Mon Sep 17 00:00:00 2001 From: McMak Date: Wed, 13 May 2015 06:27:24 +0300 Subject: [PATCH 28/36] Improvements WiX UI, installed component detection, update via UI. --- .../Sources/Setup.WIXInstaller/Product.wxs | 12 +-- .../WebsitePanel.Setup/Common/Global.cs | 1 + .../WebsitePanel.Setup/Internal/Adapter.cs | 20 ++-- .../Internal/BackupRestore.cs | 14 ++- .../WebsitePanel.WIXInstaller/CustomAction.cs | 97 +++++++++++++++++++ .../WebsitePanel.WIXInstaller.csproj | 1 + 6 files changed, 127 insertions(+), 18 deletions(-) diff --git a/WebsitePanel.Installer/Sources/Setup.WIXInstaller/Product.wxs b/WebsitePanel.Installer/Sources/Setup.WIXInstaller/Product.wxs index 273fbfaf..6d4f921b 100644 --- a/WebsitePanel.Installer/Sources/Setup.WIXInstaller/Product.wxs +++ b/WebsitePanel.Installer/Sources/Setup.WIXInstaller/Product.wxs @@ -563,8 +563,8 @@ - - + + @@ -599,7 +599,7 @@ - + @@ -607,14 +607,14 @@ - + - + @@ -649,7 +649,7 @@ - 1 + diff --git a/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Common/Global.cs b/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Common/Global.cs index 6bf1759f..e0215046 100644 --- a/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Common/Global.cs +++ b/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Common/Global.cs @@ -39,6 +39,7 @@ namespace WebsitePanel.Setup public const string DefaultInstallPathRoot = @"C:\WebsitePanel"; public const string LoopbackIPv4 = "127.0.0.1"; public const string InstallerProductCode = "cfg core"; + public const string DefaultProductName = "WebsitePanel"; public abstract class Parameters { diff --git a/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Internal/Adapter.cs b/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Internal/Adapter.cs index f0f28301..5eeb3a0c 100644 --- a/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Internal/Adapter.cs +++ b/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Internal/Adapter.cs @@ -170,9 +170,13 @@ namespace WebsitePanel.Setup.Internal } public static string GetComponentID(SetupVariables Ctx) { - var XmlPath = string.Format("//component[.//add/@key='ComponentCode' and .//add/@value='{0}']", Ctx.ComponentCode); + return GetComponentID(GetFullConfigPath(Ctx), Ctx.ComponentCode); + } + public static string GetComponentID(string Cfg, string ComponentCode) + { + var XmlPath = string.Format("//component[.//add/@key='ComponentCode' and .//add/@value='{0}']", ComponentCode); var Xml = new XmlDocument(); - Xml.Load(GetFullConfigPath(Ctx)); + Xml.Load(Cfg); var Node = Xml.SelectSingleNode(XmlPath) as XmlElement; return Node == null ? null : Node.GetAttribute("id"); } @@ -3926,20 +3930,20 @@ namespace WebsitePanel.Setup.Internal try { Log.WriteStart("RestoreXmlConfigs"); - var Backup = BackupRestore.Find(Ctx.InstallerFolder, "WebsitePanel", Ctx.ComponentName); + var Backup = BackupRestore.Find(Ctx.InstallerFolder, Global.DefaultProductName, Ctx.ComponentName); switch(Ctx.ComponentCode) { - case "server": + case Global.Server.ComponentCode: { Backup.XmlFiles.Add("Web.config"); } break; - case "enterpriseserver": + case Global.EntServer.ComponentCode: { Backup.XmlFiles.Add("Web.config"); } break; - case "portal": + case Global.WebPortal.ComponentCode: { Backup.XmlFiles.Add("Web.config"); Backup.XmlFiles.Add(@"App_Data\Countries.config"); @@ -3957,9 +3961,7 @@ namespace WebsitePanel.Setup.Internal break; } var MainCfg = Path.Combine(Ctx.InstallerFolder, BackupRestore.MainConfig); - var XCfg = new XmlDocument(); - XCfg.Load(MainCfg); - if (XCfg.SelectSingleNode("//components").ChildNodes.Count == 0) + if (!BackupRestore.HaveChild(MainCfg, "//components")) { Log.WriteInfo("Restoring main config..."); XmlDocumentMerge.Process(Backup.BackupMainConfigFile, MainCfg); diff --git a/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Internal/BackupRestore.cs b/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Internal/BackupRestore.cs index 5778175f..91890d6e 100644 --- a/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Internal/BackupRestore.cs +++ b/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Internal/BackupRestore.cs @@ -8,7 +8,7 @@ using Ionic.Zip; namespace WebsitePanel.Setup.Internal { - class BackupRestore + public class BackupRestore { struct DirectoryTag { @@ -47,9 +47,7 @@ namespace WebsitePanel.Setup.Internal Version BckpVersion; var StrVersion = VersionName.Substring(FullId.Length); if (Version.TryParse(StrVersion, out BckpVersion)) - { DirList.Add(new DirectoryTag { Name = VersionItem, Date = date, Version = BckpVersion }); - } } } } @@ -61,6 +59,16 @@ namespace WebsitePanel.Setup.Internal } return Result; } + public static bool HaveChild(string XmlDocPath, string XmlPath) + { + var Result = false; + var XCfg = new XmlDocument(); + XCfg.Load(XmlDocPath); + var Node = XCfg.SelectSingleNode(XmlPath); + if (Node != null) + Result = Node.ChildNodes.Count > 0; + return Result; + } private static string GetComponentRoot(DirectoryTag DirTag, string Id) { var Cfg = GetMainConfig(DirTag); diff --git a/WebsitePanel.Installer/Sources/WebsitePanel.WIXInstaller/CustomAction.cs b/WebsitePanel.Installer/Sources/WebsitePanel.WIXInstaller/CustomAction.cs index 3bc32d46..0ff7782e 100644 --- a/WebsitePanel.Installer/Sources/WebsitePanel.WIXInstaller/CustomAction.cs +++ b/WebsitePanel.Installer/Sources/WebsitePanel.WIXInstaller/CustomAction.cs @@ -27,6 +27,7 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using System; using System.Collections.Generic; +using System.Configuration; using System.Configuration.Install; using System.Data; using System.Data.Sql; @@ -87,6 +88,102 @@ namespace WebsitePanel.WIXInstaller var Ctx = session; Ctx.AttachToSetupLog(); Log.WriteStart("PreFillSettings"); + var WSP = Ctx["WEBSITEPANELDIR"]; + var CfgStr = string.Empty; + Func GetCfg = (string CfgDir) => + { + if (Directory.Exists(CfgDir)) + { + var CfgFile = Path.Combine(CfgDir, BackupRestore.MainConfig); + if (File.Exists(CfgFile) && BackupRestore.HaveChild(CfgFile, "//components")) + return CfgFile; + else + { + var Names = new string[] { Global.Server.ComponentName, Global.EntServer.ComponentName, Global.WebPortal.ComponentName }; + foreach (var Name in Names) + { + var Backup = BackupRestore.Find(CfgDir, Global.DefaultProductName, Name); + if (Backup != null && BackupRestore.HaveChild(Backup.BackupMainConfigFile, "//components")) + return CfgStr = Backup.BackupMainConfigFile; + } + } + } + return string.Empty; + }; + Func SetProperty = (Session CtxSession, string Prop, string Value) => + { + if(!string.IsNullOrWhiteSpace(Value)) + { + CtxSession[Prop] = Value; + return true; + } + return false; + }; + CfgStr = GetCfg(WSP); + if(string.IsNullOrWhiteSpace(CfgStr)) + { + var Drives = from Drive in DriveInfo.GetDrives() where Drive.DriveType == DriveType.Fixed select Drive; + foreach(var Drive in Drives) + { + var Dir = Path.Combine(Drive.RootDirectory.FullName, Global.DefaultProductName); + CfgStr = GetCfg(Dir); + if (!string.IsNullOrWhiteSpace(CfgStr)) + break; + } + } + if (!string.IsNullOrWhiteSpace(CfgStr)) + { + var EServerUrl = string.Empty; + AppConfig.LoadConfiguration(new ExeConfigurationFileMap { ExeConfigFilename = CfgStr }); + var CtxVars = new SetupVariables(); + CtxVars.ComponentId = WiXSetup.GetComponentID(CfgStr, Global.Server.ComponentCode); + if (!string.IsNullOrWhiteSpace(CtxVars.ComponentId)) + { + AppConfig.LoadComponentSettings(CtxVars); + Ctx["COMPFOUND_SERVER"] = "1"; + SetProperty(Ctx, "PI_SERVER_IP", CtxVars.WebSiteIP); + SetProperty(Ctx, "PI_SERVER_PORT", CtxVars.WebSitePort); + SetProperty(Ctx, "PI_SERVER_HOST", CtxVars.WebSiteDomain); + SetProperty(Ctx, "PI_SERVER_LOGIN", CtxVars.UserAccount); + SetProperty(Ctx, "PI_SERVER_PASSWORD", CtxVars.UserPassword); + SetProperty(Ctx, "PI_SERVER_PASSWORD_CONFIRM",CtxVars.UserPassword); + SetProperty(Ctx, "PI_SERVER_DOMAIN", CtxVars.UserDomain); + SetProperty(Ctx, "SERVER_ACCESS_PASSWORD", CtxVars.ServerPassword); + SetProperty(Ctx, "SERVER_ACCESS_PASSWORD_CONFIRM", CtxVars.ServerPassword); + } + CtxVars.ComponentId = WiXSetup.GetComponentID(CfgStr, Global.EntServer.ComponentCode); + if (!string.IsNullOrWhiteSpace(CtxVars.ComponentId)) + { + AppConfig.LoadComponentSettings(CtxVars); + Ctx["COMPFOUND_ESERVER"] = "1"; + SetProperty(Ctx, "PI_ESERVER_IP", CtxVars.WebSiteIP); + SetProperty(Ctx, "PI_ESERVER_PORT", CtxVars.WebSitePort); + SetProperty(Ctx, "PI_ESERVER_HOST", CtxVars.WebSiteDomain); + SetProperty(Ctx, "PI_ESERVER_LOGIN", CtxVars.UserAccount); + SetProperty(Ctx, "PI_ESERVER_PASSWORD", CtxVars.UserPassword); + SetProperty(Ctx, "PI_ESERVER_PASSWORD_CONFIRM", CtxVars.UserPassword); + SetProperty(Ctx, "PI_ESERVER_DOMAIN", CtxVars.UserDomain); + SetProperty(Ctx, "SERVERADMIN_PASSWORD", CtxVars.ServerAdminPassword); + SetProperty(Ctx, "SERVERADMIN_PASSWORD_CONFIRM", CtxVars.ServerAdminPassword); + EServerUrl = string.Format("http://{0}:{1}", CtxVars.WebSiteIP, CtxVars.WebSitePort); + } + CtxVars.ComponentId = WiXSetup.GetComponentID(CfgStr, Global.WebPortal.ComponentCode); + if (!string.IsNullOrWhiteSpace(CtxVars.ComponentId)) + { + AppConfig.LoadComponentSettings(CtxVars); + Ctx["COMPFOUND_PORTAL"] = "1"; + SetProperty(Ctx, "PI_PORTAL_IP", CtxVars.WebSiteIP); + SetProperty(Ctx, "PI_PORTAL_PORT", CtxVars.WebSitePort); + SetProperty(Ctx, "PI_PORTAL_HOST", CtxVars.WebSiteDomain); + SetProperty(Ctx, "PI_PORTAL_LOGIN", CtxVars.UserAccount); + SetProperty(Ctx, "PI_PORTAL_PASSWORD", CtxVars.UserPassword); + SetProperty(Ctx, "PI_PORTAL_PASSWORD_CONFIRM", CtxVars.UserPassword); + SetProperty(Ctx, "PI_PORTAL_DOMAIN", CtxVars.UserDomain); + if (!SetProperty(Ctx, "PI_ESERVER_URL", CtxVars.EnterpriseServerURL)) + if (!SetProperty(Ctx, "PI_ESERVER_URL", EServerUrl)) + SetProperty(Ctx, "PI_ESERVER_URL", Global.WebPortal.DefaultEntServURL); + } + } TryApllyNewPassword(Ctx, "PI_SERVER_PASSWORD"); TryApllyNewPassword(Ctx, "PI_ESERVER_PASSWORD"); TryApllyNewPassword(Ctx, "PI_PORTAL_PASSWORD"); diff --git a/WebsitePanel.Installer/Sources/WebsitePanel.WIXInstaller/WebsitePanel.WIXInstaller.csproj b/WebsitePanel.Installer/Sources/WebsitePanel.WIXInstaller/WebsitePanel.WIXInstaller.csproj index 1a4b44b7..0aee4f2c 100644 --- a/WebsitePanel.Installer/Sources/WebsitePanel.WIXInstaller/WebsitePanel.WIXInstaller.csproj +++ b/WebsitePanel.Installer/Sources/WebsitePanel.WIXInstaller/WebsitePanel.WIXInstaller.csproj @@ -47,6 +47,7 @@ ..\..\Lib\Microsoft.Web.Administration.dll + From 918c19bf82059785d0591292086ab8543d6a4a1b Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Wed, 13 May 2015 10:03:12 -0400 Subject: [PATCH 29/36] Added tag build-2.1.0.718 for changeset 96912bfdf959 From ee19096e2da1680db023daeec1ed29c795641f2f Mon Sep 17 00:00:00 2001 From: dev_amdtel Date: Wed, 13 May 2015 17:10:29 +0300 Subject: [PATCH 30/36] Exchange2013 fixes --- .../Exchange2013.cs | 36 ++++++++++++------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.Exchange2013/Exchange2013.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.Exchange2013/Exchange2013.cs index 02dead74..28e536b7 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.Exchange2013/Exchange2013.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.Exchange2013/Exchange2013.cs @@ -4479,7 +4479,7 @@ namespace WebsitePanel.Providers.HostedSolution { ExchangeLog.LogStart("CheckOrganizationPublicFolderMailbox"); - Collection result = GetPublicFolderMailbox(runSpace, orgCanonicalName, GetPublicFolderMailboxName(organizationId)); + Collection result = GetPublicFolderMailbox(runSpace, orgCanonicalName, GetPublicFolderMailboxName(organizationId), true); if (result == null || result.Count == 0) { ExchangeTransaction transaction = StartTransaction(); @@ -4501,7 +4501,7 @@ namespace WebsitePanel.Providers.HostedSolution { ExchangeLog.LogStart("CheckOrganizationRootFolder"); - Collection result = GetPublicFolderObject(runSpace, orgCanonicalName+"/"+GetPublicFolderMailboxName(organizationId), "\\" + folder); + Collection result = GetPublicFolderObject(runSpace, orgCanonicalName+"/"+GetPublicFolderMailboxName(organizationId), "\\" + folder, true); if (result == null || result.Count == 0) { ExchangeTransaction transaction = StartTransaction(); @@ -4617,22 +4617,22 @@ namespace WebsitePanel.Providers.HostedSolution ExchangeLog.LogEnd("DeletePublicFolderInternal"); } - private Collection GetPublicFolderObject(Runspace runSpace, string mailbox, string id) + private Collection GetPublicFolderObject(Runspace runSpace, string mailbox, string id, bool checkExist = false) { Command cmd = new Command("Get-PublicFolder"); cmd.Parameters.Add("Identity", id); //cmd.Parameters.Add("Mailbox", mailbox); - Collection result = ExecuteShellCommand(runSpace, cmd); + Collection result = ExecuteShellCommand(runSpace, cmd, true, !checkExist); return result; } - private Collection GetPublicFolderMailbox(Runspace runSpace, string organizationDistinguishedName, string name) + private Collection GetPublicFolderMailbox(Runspace runSpace, string organizationDistinguishedName, string name, bool checkExist) { Command cmd = new Command("Get-Mailbox"); cmd.Parameters.Add("Identity", name); cmd.Parameters.Add("PublicFolder"); cmd.Parameters.Add("OrganizationalUnit", organizationDistinguishedName); - Collection result = ExecuteShellCommand(runSpace, cmd); + Collection result = ExecuteShellCommand(runSpace, cmd, true, !checkExist); return result; } @@ -5369,7 +5369,7 @@ namespace WebsitePanel.Providers.HostedSolution string resultObjectDN = null; Command cmd = new Command("Get-AddressList"); cmd.Parameters.Add("Identity", id); - Collection result = this.ExecuteShellCommand(runSpace, cmd); + Collection result = this.ExecuteShellCommand(runSpace, cmd, true, false); if ((result != null) && (result.Count > 0)) { resultObjectDN = this.GetResultObjectDN(result); @@ -6242,13 +6242,19 @@ namespace WebsitePanel.Providers.HostedSolution internal Collection ExecuteShellCommand(Runspace runSpace, Command cmd) { - return ExecuteShellCommand(runSpace, cmd, true); + return ExecuteShellCommand(runSpace, cmd, true, true); } internal Collection ExecuteShellCommand(Runspace runSpace, Command cmd, bool useDomainController) { object[] errors; - return ExecuteShellCommand(runSpace, cmd, useDomainController, out errors); + return ExecuteShellCommand(runSpace, cmd, useDomainController, out errors, true); + } + + internal Collection ExecuteShellCommand(Runspace runSpace, Command cmd, bool useDomainController, bool writeErrorExchangeLog) + { + object[] errors; + return ExecuteShellCommand(runSpace, cmd, useDomainController, out errors, writeErrorExchangeLog); } internal Collection ExecuteShellCommand(Runspace runSpace, Command cmd, ResultObject res) @@ -6272,10 +6278,10 @@ namespace WebsitePanel.Providers.HostedSolution internal Collection ExecuteShellCommand(Runspace runSpace, Command cmd, out object[] errors) { - return ExecuteShellCommand(runSpace, cmd, true, out errors); + return ExecuteShellCommand(runSpace, cmd, true, out errors, true); } - internal Collection ExecuteShellCommand(Runspace runSpace, Command cmd, bool useDomainController, out object[] errors) + internal Collection ExecuteShellCommand(Runspace runSpace, Command cmd, bool useDomainController, out object[] errors, bool writeErrorExchangeLog) { ExchangeLog.LogStart("ExecuteShellCommand"); List errorList = new List(); @@ -6309,8 +6315,12 @@ namespace WebsitePanel.Providers.HostedSolution foreach (object item in pipeLine.Error.ReadToEnd()) { errorList.Add(item); - string errorMessage = string.Format("Invoke error: {0}", item); - ExchangeLog.LogWarning(errorMessage); + + if (writeErrorExchangeLog) + { + string errorMessage = string.Format("Invoke error: {0}", item); + ExchangeLog.LogWarning(errorMessage); + } } } } From db16c927cbbc07c3a2e402e468756bf916b0274c Mon Sep 17 00:00:00 2001 From: alexY2004 Date: Thu, 14 May 2015 12:18:53 +0300 Subject: [PATCH 31/36] Do not return password form Enterprise Service Methods --- .../Users/UserInfo.cs | 58 ++++++++++++++++--- .../UsersProxy.cs | 20 ++++--- .../Common/ServiceUsernameTokenManager.cs | 2 +- .../ContractSystem/ContractController.cs | 2 +- .../Provisioning/DomainNameController.cs | 4 +- .../Ecommerce/TriggerSystem/CommonTrigger.cs | 4 +- .../Packages/PackageController.cs | 6 +- .../StatisticsServerController.cs | 6 +- .../Users/UserController.cs | 32 +++++----- .../Wizards/UserCreationWizard.cs | 4 +- .../esUsers.asmx.cs | 14 +++-- .../Code/PortalUtils.cs | 26 +++++++-- .../WebsitePanel/Code/Helpers/UsersHelper.cs | 4 +- .../WebsitePanel/PeersEditPeer.ascx.cs | 4 +- .../UserCreateUserAccount.ascx.cs | 4 +- 15 files changed, 129 insertions(+), 61 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Users/UserInfo.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Users/UserInfo.cs index 259d0c53..1850c5bf 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Users/UserInfo.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Users/UserInfo.cs @@ -51,7 +51,7 @@ namespace WebsitePanel.EnterpriseServer private bool isDemo; private string comments; private string username; - private string password; +// private string password; private string firstName; private string lastName; private string email; @@ -78,6 +78,39 @@ namespace WebsitePanel.EnterpriseServer { } + public UserInfo(UserInfo src) + { + userId = src.userId; + ownerId = src.ownerId; + roleId = src.roleId; + statusId = src.statusId; + loginStatusId = src.loginStatusId; + failedLogins = src.failedLogins; + created = src.created; + changed = src.changed; + isPeer = src.isPeer; + isDemo = src.isDemo; + comments = src.comments; + username = src.username; + firstName = src.firstName; + lastName = src.lastName; + email = src.email; + secondaryEmail = src.secondaryEmail; + address = src.address; + city = src.city; + country = src.country; + state = src.state; + zip = src.zip; + primaryPhone = src.primaryPhone; + secondaryPhone = src.secondaryPhone; + fax = src.fax; + instantMessenger = src.instantMessenger; + htmlMail = src.htmlMail; + companyName = src.companyName; + ecommerceEnabled = src.ecommerceEnabled; + subscriberNumber = src.subscriberNumber; + } + /// /// User role ID: /// Administrator = 1, @@ -200,11 +233,11 @@ namespace WebsitePanel.EnterpriseServer set { this.username = value; } } - public string Password - { - get { return this.password; } - set { this.password = value; } - } +// public string Password +// { +// get { return this.password; } +// set { this.password = value; } +// } public string FirstName { @@ -347,7 +380,18 @@ namespace WebsitePanel.EnterpriseServer { public ushort VLanID { get; set; } public string Comment { get; set; } - } + }; + + public class UserInfoInternal : UserInfo + { + private string password; + + public string Password + { + get { return this.password; } + set { this.password = value; } + } + }; } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/UsersProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/UsersProxy.cs index d19bafce..0b3fc9dd 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/UsersProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/UsersProxy.cs @@ -840,20 +840,23 @@ namespace WebsitePanel.EnterpriseServer /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/AddUser", 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 int AddUser(UserInfo user, bool sendLetter) + public int AddUser(UserInfo user, bool sendLetter, string password) { object[] results = this.Invoke("AddUser", new object[] { user, - sendLetter}); + sendLetter, + password + }); return ((int)(results[0])); } /// - public System.IAsyncResult BeginAddUser(UserInfo user, bool sendLetter, System.AsyncCallback callback, object asyncState) + public System.IAsyncResult BeginAddUser(UserInfo user, bool sendLetter, string password, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("AddUser", new object[] { user, - sendLetter}, callback, asyncState); + sendLetter, + password}, callback, asyncState); } /// @@ -864,13 +867,13 @@ namespace WebsitePanel.EnterpriseServer } /// - public void AddUserAsync(UserInfo user, bool sendLetter) + public void AddUserAsync(UserInfo user, bool sendLetter, string password) { - this.AddUserAsync(user, sendLetter, null); + this.AddUserAsync(user, sendLetter, password, null); } /// - public void AddUserAsync(UserInfo user, bool sendLetter, object userState) + public void AddUserAsync(UserInfo user, bool sendLetter, string password, object userState) { if ((this.AddUserOperationCompleted == null)) { @@ -878,7 +881,8 @@ namespace WebsitePanel.EnterpriseServer } this.InvokeAsync("AddUser", new object[] { user, - sendLetter}, this.AddUserOperationCompleted, userState); + sendLetter, + password}, this.AddUserOperationCompleted, userState); } private void OnAddUserOperationCompleted(object arg) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Common/ServiceUsernameTokenManager.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Common/ServiceUsernameTokenManager.cs index eb81f69f..1902f125 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Common/ServiceUsernameTokenManager.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Common/ServiceUsernameTokenManager.cs @@ -69,7 +69,7 @@ namespace WebsitePanel.EnterpriseServer protected override string AuthenticateToken(UsernameToken token) { // try to load user account - UserInfo user = UserController.GetUserInternally(token.Username); + UserInfoInternal user = UserController.GetUserInternally(token.Username); if (user == null) return null; diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Ecommerce/ContractSystem/ContractController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Ecommerce/ContractSystem/ContractController.cs index aac2727c..0d870c89 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Ecommerce/ContractSystem/ContractController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Ecommerce/ContractSystem/ContractController.cs @@ -182,7 +182,7 @@ namespace WebsitePanel.Ecommerce.EnterpriseServer.ContractSystem // if (customerId > -1) { - ES.UserInfo userInfo = (internally) ? ES.UserController.GetUserInternally(customerId) : + ES.UserInfoInternal userInfo = (internally) ? ES.UserController.GetUserInternally(customerId) : ES.UserController.GetUser(customerId); // if (internally) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Ecommerce/Provisioning/DomainNameController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Ecommerce/Provisioning/DomainNameController.cs index a4140b9e..c50b4aba 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Ecommerce/Provisioning/DomainNameController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Ecommerce/Provisioning/DomainNameController.cs @@ -520,12 +520,12 @@ namespace WebsitePanel.Ecommerce.EnterpriseServer return settings; } - private CommandParams PrepeareAccountParams(UserInfo userInfo) + private CommandParams PrepeareAccountParams(UserInfo userInfo, string password) { CommandParams args = new CommandParams(); args[CommandParams.USERNAME] = userInfo.Username; - args[CommandParams.PASSWORD] = userInfo.Password; + args[CommandParams.PASSWORD] = password; args[CommandParams.FIRST_NAME] = userInfo.FirstName; args[CommandParams.LAST_NAME] = userInfo.LastName; args[CommandParams.EMAIL] = userInfo.Email; diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Ecommerce/TriggerSystem/CommonTrigger.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Ecommerce/TriggerSystem/CommonTrigger.cs index e749e42c..b4906d20 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Ecommerce/TriggerSystem/CommonTrigger.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Ecommerce/TriggerSystem/CommonTrigger.cs @@ -113,7 +113,7 @@ namespace WebsitePanel.Ecommerce.EnterpriseServer // create user account ES.UserInfo userInfo = new ES.UserInfo(); userInfo.Username = account[ContractAccount.USERNAME]; - userInfo.Password = account[ContractAccount.PASSWORD]; +// userInfo.Password = account[ContractAccount.PASSWORD]; userInfo.Email = account[ContractAccount.EMAIL]; userInfo.FirstName = account[ContractAccount.FIRST_NAME]; userInfo.LastName = account[ContractAccount.LAST_NAME]; @@ -133,7 +133,7 @@ namespace WebsitePanel.Ecommerce.EnterpriseServer userInfo.OwnerId = contract.ResellerId; userInfo.Created = DateTime.Now; // create account - int resultCode = ES.UserController.AddUser(userInfo, true); + int resultCode = ES.UserController.AddUser(userInfo, true, account[ContractAccount.PASSWORD]); // if (resultCode > 0) { diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Packages/PackageController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Packages/PackageController.cs index ba78d84c..56aab96f 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Packages/PackageController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Packages/PackageController.cs @@ -422,7 +422,7 @@ namespace WebsitePanel.EnterpriseServer return result; // load user info - UserInfo user = UserController.GetUser(userId); + UserInfoInternal user = UserController.GetUser(userId); if (createFtpAccount) { @@ -2086,7 +2086,7 @@ namespace WebsitePanel.EnterpriseServer items["user"] = user; // get reseller details - UserInfo reseller = UserController.GetUser(user.OwnerId); + UserInfoInternal reseller = UserController.GetUser(user.OwnerId); if (reseller != null) { reseller.Password = ""; @@ -2123,7 +2123,7 @@ namespace WebsitePanel.EnterpriseServer items["user"] = user; // get reseller details - UserInfo reseller = UserController.GetUser(user.OwnerId); + UserInfoInternal reseller = UserController.GetUser(user.OwnerId); if (reseller != null) { reseller.Password = ""; diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/StatisticsServers/StatisticsServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/StatisticsServers/StatisticsServerController.cs index b28248a6..7c05d896 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/StatisticsServers/StatisticsServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/StatisticsServers/StatisticsServerController.cs @@ -112,10 +112,12 @@ namespace WebsitePanel.EnterpriseServer UserInfo user = PackageController.GetPackageOwner(item.PackageId); if (user != null) { + UserInfoInternal userInternal = UserController.GetUserInternally(user.UserId); + site.StatisticsUrl = Utils.ReplaceStringVariable(site.StatisticsUrl, "username", - HttpUtility.UrlEncode(user.Username)); + HttpUtility.UrlEncode(userInternal.Username)); site.StatisticsUrl = Utils.ReplaceStringVariable(site.StatisticsUrl, "password", - HttpUtility.UrlEncode(user.Password)); + HttpUtility.UrlEncode(userInternal.Password)); } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Users/UserController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Users/UserController.cs index de9d56c3..fabe98bc 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Users/UserController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Users/UserController.cs @@ -58,7 +58,7 @@ namespace WebsitePanel.EnterpriseServer try { // try to get user from database - UserInfo user = GetUserInternally(username); + UserInfoInternal user = GetUserInternally(username); // check if the user exists if (user == null) @@ -99,7 +99,7 @@ namespace WebsitePanel.EnterpriseServer // compare user passwords - if (user.Password != password) + if (CryptoUtils.SHA1(user.Password) != password) { if (lockOut >= 0) DataProvider.UpdateUserFailedLoginAttempt(user.UserId, lockOut, false); @@ -145,7 +145,7 @@ namespace WebsitePanel.EnterpriseServer try { // try to get user from database - UserInfo user = GetUserInternally(username); + UserInfoInternal user = GetUserInternally(username); // check if the user exists if (user == null) @@ -155,8 +155,8 @@ namespace WebsitePanel.EnterpriseServer } // compare user passwords - if (user.Password == password) - return user; + if (CryptoUtils.SHA1(user.Password) == password) + return new UserInfo(user); return null; } @@ -239,7 +239,7 @@ namespace WebsitePanel.EnterpriseServer items["Email"] = true; // get reseller details - UserInfo reseller = UserController.GetUser(user.OwnerId); + UserInfoInternal reseller = UserController.GetUser(user.OwnerId); if (reseller != null) { reseller.Password = ""; @@ -264,10 +264,10 @@ namespace WebsitePanel.EnterpriseServer } } - internal static UserInfo GetUserInternally(int userId) + internal static UserInfoInternal GetUserInternally(int userId) { // try to get user from database - UserInfo user = ObjectUtils.FillObjectFromDataReader( + UserInfoInternal user = ObjectUtils.FillObjectFromDataReader( DataProvider.GetUserByIdInternally(userId)); if (user != null) @@ -275,10 +275,10 @@ namespace WebsitePanel.EnterpriseServer return user; } - internal static UserInfo GetUserInternally(string username) + internal static UserInfoInternal GetUserInternally(string username) { // try to get user from database - UserInfo user = ObjectUtils.FillObjectFromDataReader( + UserInfoInternal user = ObjectUtils.FillObjectFromDataReader( DataProvider.GetUserByUsernameInternally(username)); if (user != null) @@ -288,10 +288,10 @@ namespace WebsitePanel.EnterpriseServer return user; } - public static UserInfo GetUser(int userId) + public static UserInfoInternal GetUser(int userId) { // try to get user from database - UserInfo user = ObjectUtils.FillObjectFromDataReader( + UserInfoInternal user = ObjectUtils.FillObjectFromDataReader( DataProvider.GetUserById(SecurityContext.User.UserId, userId)); if (user != null) @@ -299,10 +299,10 @@ namespace WebsitePanel.EnterpriseServer return user; } - public static UserInfo GetUser(string username) + public static UserInfoInternal GetUser(string username) { // try to get user from database - UserInfo user = ObjectUtils.FillObjectFromDataReader( + UserInfoInternal user = ObjectUtils.FillObjectFromDataReader( DataProvider.GetUserByUsername(SecurityContext.User.UserId, username)); if (user != null) @@ -381,7 +381,7 @@ namespace WebsitePanel.EnterpriseServer return DataProvider.GetUsers(SecurityContext.User.UserId, ownerId, recursive); } - public static int AddUser(UserInfo user, bool sendLetter) + public static int AddUser(UserInfo user, bool sendLetter, string password) { // check account int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo); @@ -424,7 +424,7 @@ namespace WebsitePanel.EnterpriseServer user.IsPeer, user.Comments, user.Username.Trim(), - CryptoUtils.Encrypt(user.Password), + CryptoUtils.Encrypt(password), user.FirstName, user.LastName, user.Email, diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Wizards/UserCreationWizard.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Wizards/UserCreationWizard.cs index e343fccd..d283dfbf 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Wizards/UserCreationWizard.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Wizards/UserCreationWizard.cs @@ -119,11 +119,11 @@ namespace WebsitePanel.EnterpriseServer user.Email = email; user.SecondaryEmail = secondaryEmail; user.Username = username; - user.Password = password; +// user.Password = password; user.HtmlMail = htmlMail; // add a new user - createdUserId = UserController.AddUser(user, false); + createdUserId = UserController.AddUser(user, false, password); if (createdUserId < 0) { // exit diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esUsers.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esUsers.asmx.cs index 64ccb43d..eea1c318 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esUsers.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esUsers.asmx.cs @@ -57,13 +57,15 @@ namespace WebsitePanel.EnterpriseServer [WebMethod] public UserInfo GetUserById(int userId) { - return UserController.GetUser(userId); + UserInfoInternal uinfo = UserController.GetUser(userId); + return (uinfo != null) ? new UserInfo(uinfo) : null; } [WebMethod] public UserInfo GetUserByUsername(string username) { - return UserController.GetUser(username); + UserInfoInternal uinfo = UserController.GetUser(username); + return (uinfo != null) ? new UserInfo(uinfo) : null; } [WebMethod] @@ -136,9 +138,9 @@ namespace WebsitePanel.EnterpriseServer } [WebMethod] - public int AddUser(UserInfo user, bool sendLetter) + public int AddUser(UserInfo user, bool sendLetter, string password) { - return UserController.AddUser(user, sendLetter); + return UserController.AddUser(user, sendLetter, password); } [WebMethod] @@ -175,7 +177,7 @@ namespace WebsitePanel.EnterpriseServer user.IsPeer = isPeer; user.IsDemo = isDemo; user.Username = username; - user.Password = password; +// user.Password = password; user.FirstName = firstName; user.LastName = lastName; user.Email = email; @@ -192,7 +194,7 @@ namespace WebsitePanel.EnterpriseServer user.HtmlMail = htmlMail; user.CompanyName = companyName; user.EcommerceEnabled = ecommerceEnabled; - return UserController.AddUser(user, sendLetter); + return UserController.AddUser(user, sendLetter, password); } [WebMethod] diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/Code/PortalUtils.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/Code/PortalUtils.cs index b4793320..d3c706c0 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/Code/PortalUtils.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/Code/PortalUtils.cs @@ -43,6 +43,7 @@ using System.Web.Security; using System.Web.UI.WebControls; using System.Net; using System.Net.Mail; +using System.Security.Cryptography; using Microsoft.Web.Services3; using WebsitePanel.EnterpriseServer; @@ -336,15 +337,30 @@ namespace WebsitePanel.Portal return DefaultPage.GetLocalizedPageName(pageId); } + public static string SHA1(string plainText) + { + // Convert plain text into a byte array. + byte[] plainTextBytes = Encoding.UTF8.GetBytes(plainText); + + HashAlgorithm hash = new SHA1Managed(); ; + + // Compute hash value of our plain text with appended salt. + byte[] hashBytes = hash.ComputeHash(plainTextBytes); + + // Return the result. + return Convert.ToBase64String(hashBytes); + } public static int AuthenticateUser(string username, string password, string ipAddress, bool rememberLogin, string preferredLocale, string theme) { esAuthentication authService = new esAuthentication(); ConfigureEnterpriseServerProxy(authService, false); + string passwordSH = SHA1(password); + try { - int authResult = authService.AuthenticateUser(username, password, ipAddress); + int authResult = authService.AuthenticateUser(username, passwordSH, ipAddress); if (authResult < 0) { @@ -352,13 +368,13 @@ namespace WebsitePanel.Portal } else { - UserInfo user = authService.GetUserByUsernamePassword(username, password, ipAddress); + UserInfo user = authService.GetUserByUsernamePassword(username, passwordSH, ipAddress); if (user != null) { if (IsRoleAllowedToLogin(user.Role)) { // issue authentication ticket - FormsAuthenticationTicket ticket = CreateAuthTicket(user.Username, user.Password, user.Role, rememberLogin); + FormsAuthenticationTicket ticket = CreateAuthTicket(user.Username, password, user.Role, rememberLogin); SetAuthTicket(ticket, rememberLogin); CompleteUserLogin(username, rememberLogin, preferredLocale, theme); @@ -513,7 +529,7 @@ namespace WebsitePanel.Portal } } - public static int AddUserAccount(List log, UserInfo user, bool sendLetter) + public static int AddUserAccount(List log, UserInfo user, bool sendLetter, string password) { esUsers usersService = new esUsers(); ConfigureEnterpriseServerProxy(usersService, true); @@ -521,7 +537,7 @@ namespace WebsitePanel.Portal try { // add user to WebsitePanel server - return usersService.AddUser(user, sendLetter); + return usersService.AddUser(user, sendLetter, password); } catch (Exception ex) { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Helpers/UsersHelper.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Helpers/UsersHelper.cs index 9c97f47c..d6b12bb6 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Helpers/UsersHelper.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Helpers/UsersHelper.cs @@ -210,10 +210,10 @@ namespace WebsitePanel.Portal return dsUsers; } - public static int AddUser(List log, int portalId, UserInfo user, bool sendLetter) + public static int AddUser(List log, int portalId, UserInfo user, bool sendLetter, string password) { // add user to WebsitePanel server - return ES.Services.Users.AddUser(user, sendLetter); + return ES.Services.Users.AddUser(user, sendLetter, password); } public static void AddUserVLan(int userId, UserVlan vLan) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PeersEditPeer.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PeersEditPeer.ascx.cs index 5f8a110c..e5359606 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PeersEditPeer.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PeersEditPeer.ascx.cs @@ -195,7 +195,7 @@ namespace WebsitePanel.Portal user.SecondaryEmail = txtSecondaryEmail.Text; user.HtmlMail = ddlMailFormat.SelectedIndex == 1; user.Username = txtUsername.Text; - user.Password = userPassword.Password; +// user.Password = userPassword.Password; user.IsDemo = chkDemo.Checked; user.LoginStatusId = loginStatus.SelectedIndex; @@ -220,7 +220,7 @@ namespace WebsitePanel.Portal try { //int userId = UsersHelper.AddUser(log, PortalId, user); - int userId = PortalUtils.AddUserAccount(log, user, false); + int userId = PortalUtils.AddUserAccount(log, user, false, userPassword.Password); if (userId < 0) { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateUserAccount.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateUserAccount.ascx.cs index 4c67a45c..bf2fa0af 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateUserAccount.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateUserAccount.ascx.cs @@ -103,7 +103,7 @@ namespace WebsitePanel.Portal user.SecondaryEmail = txtSecondaryEmail.Text; user.HtmlMail = ddlMailFormat.SelectedIndex == 1; user.Username = txtUsername.Text.Trim(); - user.Password = userPassword.Password; +// user.Password = userPassword.Password; // contact info user.CompanyName = contact.CompanyName; @@ -123,7 +123,7 @@ namespace WebsitePanel.Portal try { //int userId = UsersHelper.AddUser(log, PortalId, user); - int userId = PortalUtils.AddUserAccount(log, user, chkAccountLetter.Checked); + int userId = PortalUtils.AddUserAccount(log, user, chkAccountLetter.Checked, userPassword.Password); if (userId == BusinessErrorCodes.ERROR_INVALID_USER_NAME) { From 806e000d28e4f63d52a31f38ae58169d24d495f2 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Thu, 14 May 2015 13:52:43 -0400 Subject: [PATCH 32/36] Added tag build-2.1.0.719 for changeset f86d556bcb5c From 0a391910cec3620d9d83d3c363548bce4e15e13e Mon Sep 17 00:00:00 2001 From: dev_amdtel Date: Thu, 14 May 2015 23:17:58 +0300 Subject: [PATCH 33/36] fixes --- .../Actions/StandaloneServerActionManager.cs | 3 +-- .../Sources/WebsitePanel.Setup/Internal/Adapter.cs | 3 +-- .../Sources/WebsitePanel.Setup/Wizard/ExpressInstallPage.cs | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Actions/StandaloneServerActionManager.cs b/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Actions/StandaloneServerActionManager.cs index 60b02246..b1cdb349 100644 --- a/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Actions/StandaloneServerActionManager.cs +++ b/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Actions/StandaloneServerActionManager.cs @@ -651,12 +651,11 @@ namespace WebsitePanel.Setup.Actions user.IsPeer = false; user.HtmlMail = true; user.Username = loginName; - user.Password = password; user.FirstName = firstName; user.LastName = lastName; user.Email = email; - int userId = ES.Services.Users.AddUser(user, false); + int userId = ES.Services.Users.AddUser(user, false, password); if (userId > 0) { Log.WriteEnd("Added user account"); diff --git a/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Internal/Adapter.cs b/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Internal/Adapter.cs index 5eeb3a0c..ea1913ec 100644 --- a/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Internal/Adapter.cs +++ b/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Internal/Adapter.cs @@ -1720,12 +1720,11 @@ namespace WebsitePanel.Setup.Internal user.IsPeer = false; user.HtmlMail = true; user.Username = loginName; - user.Password = password; user.FirstName = firstName; user.LastName = lastName; user.Email = email; - int userId = ES.Services.Users.AddUser(user, false); + int userId = ES.Services.Users.AddUser(user, false, password); if (userId > 0) { Log.WriteEnd("Added user account"); diff --git a/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Wizard/ExpressInstallPage.cs b/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Wizard/ExpressInstallPage.cs index 82062a32..29056db1 100644 --- a/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Wizard/ExpressInstallPage.cs +++ b/WebsitePanel.Installer/Sources/WebsitePanel.Setup/Wizard/ExpressInstallPage.cs @@ -1153,12 +1153,11 @@ namespace WebsitePanel.Setup user.IsPeer = false; user.HtmlMail = true; user.Username = loginName; - user.Password = password; user.FirstName = firstName; user.LastName = lastName; user.Email = email; - int userId = ES.Services.Users.AddUser(user, false); + int userId = ES.Services.Users.AddUser(user, false, password); if (userId > 0) { Log.WriteEnd("Added user account"); From 53f6f7293918ab02f76a140b106156c6467c8074 Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Thu, 14 May 2015 17:14:20 -0400 Subject: [PATCH 34/36] 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 35/36] 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' - +
    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 @@
    - +
    VirtuWorks: Run Your Business In The Cloud
    @@ -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 36/36] Added tag build-2.1.0.723 for changeset 0af91f09da94