From aa59d180e285f95b887e3ffccf8aab670a72ed81 Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Thu, 2 Apr 2015 04:36:45 -0700 Subject: [PATCH 01/38] password reset scheduler added --- WebsitePanel/Database/update_db.sql | 145 +- .../Users/UserSettings.cs | 2 + .../HostedSolution/OrganizationController.cs | 58 + .../UserPasswordExpirationNotificationTask.cs | 63 + .../WebsitePanel.EnterpriseServer.Code.csproj | 1 + .../HostedSolution/IOrganization.cs | 3 + .../HostedSolution/OrganizationUser.cs | 2 + .../OrganizationProvider.cs | 72 + .../OrganizationProxy.cs | 1927 ++++++++--------- .../WebsitePanel.Server/Organizations.asmx.cs | 7 + .../ESModule_ControlsHierarchy.config | 1 + .../App_Data/WebsitePanel_Modules.config | 1 + .../WebsitePanel_SharedResources.ascx.resx | 6 +- ...ingsUserPasswordExpirationLetter.ascx.resx | 156 ++ .../UserAccountMailTemplateSettings.ascx.resx | 3 + .../OrganizationUserGeneralSettings.ascx.resx | 3 + .../OrganizationUserResetPassword.ascx.resx | 132 ++ .../OrganizationUserGeneralSettings.ascx | 2 + .../OrganizationUserGeneralSettings.ascx.cs | 8 + ...zationUserGeneralSettings.ascx.designer.cs | 9 + .../OrganizationUserResetPassword.ascx | 45 + .../OrganizationUserResetPassword.ascx.cs | 43 + ...nizationUserResetPassword.ascx.designer.cs | 114 + ...sswordExpirationNotificationView.ascx.resx | 101 + ...serPasswordExpirationNotificationView.ascx | 13 + ...PasswordExpirationNotificationView.ascx.cs | 43 + ...xpirationNotificationView.ascx.designer.cs | 33 + .../SettingsUserPasswordExpirationLetter.ascx | 49 + ...ttingsUserPasswordExpirationLetter.ascx.cs | 35 + ...rPasswordExpirationLetter.ascx.designer.cs | 141 ++ .../UserAccountMailTemplateSettings.ascx | 4 + ...countMailTemplateSettings.ascx.designer.cs | 9 + .../WebsitePanel.Portal.Modules.csproj | 27 + 33 files changed, 2180 insertions(+), 1078 deletions(-) create mode 100644 WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SchedulerTasks/UserPasswordExpirationNotificationTask.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SettingsUserPasswordExpirationLetter.ascx.resx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUserResetPassword.ascx.resx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserResetPassword.ascx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserResetPassword.ascx.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserResetPassword.ascx.designer.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/App_LocalResources/UserPasswordExpirationNotificationView.ascx.resx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/UserPasswordExpirationNotificationView.ascx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/UserPasswordExpirationNotificationView.ascx.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/UserPasswordExpirationNotificationView.ascx.designer.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordExpirationLetter.ascx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordExpirationLetter.ascx.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordExpirationLetter.ascx.designer.cs diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index 8829cb8d..910ae546 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -9459,4 +9459,147 @@ BEGIN (SELECT TOP 1 @item_type_id, @group_id, 'SharePointSiteCollection', TypeName, 100, CalculateDiskSpace, CalculateBandwidth, Suspendable, Disposable, Searchable, Importable, Backupable FROM [dbo].[ServiceItemTypes] WHERE DisplayName = 'SharePointFoundationSiteCollection') END -GO \ No newline at end of file +GO + + + + + + +-- USER PASSWORD EXPIRATION NOTIFICATION tasks + +IF NOT EXISTS (SELECT * FROM [dbo].[ScheduleTasks] WHERE [TaskID] = N'SCHEDULE_TASK_USER_PASSWORD_EXPIRATION_NOTIFICATION') +BEGIN +INSERT [dbo].[ScheduleTasks] ([TaskID], [TaskType], [RoleID]) VALUES (N'SCHEDULE_TASK_USER_PASSWORD_EXPIRATION_NOTIFICATION', N'WebsitePanel.EnterpriseServer.UserPasswordExpirationNotificationTask, WebsitePanel.EnterpriseServer.Code', 1) +END +GO + +IF NOT EXISTS (SELECT * FROM [dbo].[ScheduleTaskViewConfiguration] WHERE [TaskID] = N'SCHEDULE_TASK_USER_PASSWORD_EXPIRATION_NOTIFICATION') +BEGIN +INSERT [dbo].[ScheduleTaskViewConfiguration] ([TaskID], [ConfigurationID], [Environment], [Description]) VALUES (N'SCHEDULE_TASK_USER_PASSWORD_EXPIRATION_NOTIFICATION', N'ASP_NET', N'ASP.NET', N'~/DesktopModules/WebsitePanel/ScheduleTaskControls/UserPasswordExpirationNotificationView.ascx') +END +GO + +IF NOT EXISTS (SELECT * FROM [dbo].[ScheduleTaskParameters] WHERE [TaskID] = N'SCHEDULE_TASK_USER_PASSWORD_EXPIRATION_NOTIFICATION' AND [ParameterID]= N'DAYS_BEFORE_EXPIRATION' ) +BEGIN +INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_USER_PASSWORD_EXPIRATION_NOTIFICATION', N'DAYS_BEFORE_EXPIRATION', N'String', NULL, 1) +END +GO + + +-- USER PASSWORD EXPIRATION EMAIL TEMPLATE + + +IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordExpirationLetter' AND [PropertyName]= N'WebDavPortalResetUrl' ) +BEGIN +INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordExpirationLetter', N'WebDavPortalResetUrl', N'http://webdav.virtuworks.net/') +END +GO +IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordExpirationLetter' AND [PropertyName]= N'From' ) +BEGIN +INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordExpirationLetter', N'From', N'support@HostingCompany.com') +END +GO + +DECLARE @UserPasswordExpirationLetterHtmlBody nvarchar(2500) + +Set @UserPasswordExpirationLetterHtmlBody = N' + + Password expiration notification + + + +
+
+ +
+

Password expiration notification

+ + +

+Hello #user.FirstName#, +

+
+ +

+Your password will expire at #user.PasswordExpirationDateTime#. You can reset your own password by visiting the following page: +

+ +#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'UserPasswordExpirationLetter' AND [PropertyName]= N'HtmlBody' ) +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 + + +IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordExpirationLetter' AND [PropertyName]= N'Priority' ) +BEGIN +INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordExpirationLetter', N'Priority', N'Normal') +END +GO +IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordExpirationLetter' AND [PropertyName]= N'Subject' ) +BEGIN +INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordExpirationLetter', N'Subject', N'Password expiration notification') +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') +END +GO + + +DECLARE @UserPasswordExpirationLetterTextBody nvarchar(2500) + +Set @UserPasswordExpirationLetterTextBody = N'========================================= + Password expiration notification +========================================= + + +Hello #user.FirstName#, + + +Your password will expire at #user.PasswordExpirationDateTime#. You can reset your own password by visiting the following page: + +#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'UserPasswordExpirationLetter' AND [PropertyName]= N'TextBody' ) +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 + diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Users/UserSettings.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Users/UserSettings.cs index 251d5dbf..6740094f 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Users/UserSettings.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Users/UserSettings.cs @@ -65,6 +65,8 @@ namespace WebsitePanel.EnterpriseServer public const string DEFAULT_LYNCUSERPLANS = "DefaultLyncUserPlans"; public const string RDS_SETUP_LETTER = "RDSSetupLetter"; public const string RDS_POLICY = "RdsPolicy"; + public const string USER_PASSWORD_EXPIRATION_LETTER = "UserPasswordExpirationLetter"; + public int UserId; public string SettingsName; diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs index 57d9ea5f..61590314 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs @@ -1494,7 +1494,65 @@ namespace WebsitePanel.EnterpriseServer return result; } + public static List GetOrganizationUsersWithExpiredPassword(int itemId, int daysBeforeExpiration) + { + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + { + return null; + } + + Organizations orgProxy = GetOrganizationProxy(org.ServiceId); + + var expiredUsersAd = orgProxy.GetOrganizationUsersWithExpiredPassword(org.OrganizationId, daysBeforeExpiration); + + var expiredUsersDb = GetOrganizationUsersPaged(itemId, null, null, null, 0, int.MaxValue).PageUsers.Where(x => expiredUsersAd.Any(z => z.SamAccountName == x.SamAccountName)).ToList(); + + foreach (var user in expiredUsersDb) + { + var adUser = expiredUsersAd.First(x => x.SamAccountName == user.SamAccountName); + + user.PasswordExpirationDateTime = adUser.PasswordExpirationDateTime; + } + + return expiredUsersDb; + } + + public static void SendResetUserPasswordEmail(UserInfo owner, OrganizationUser user, string mailTo, string logoUrl) + { + UserSettings settings = UserController.GetUserSettings(owner.UserId, UserSettings.USER_PASSWORD_EXPIRATION_LETTER); + + if (string.IsNullOrEmpty(logoUrl)) + { + logoUrl = settings["LogoUrl"]; + } + + string from = settings["From"]; + + string subject = settings["Subject"]; + string body = owner.HtmlMail ? settings["HtmlBody"] : settings["TextBody"]; + bool isHtml = owner.HtmlMail; + + MailPriority priority = MailPriority.Normal; + + if (!String.IsNullOrEmpty(settings["Priority"])) + { + priority = (MailPriority)Enum.Parse(typeof(MailPriority), settings["Priority"], true); + } + + Hashtable items = new Hashtable(); + + items["user"] = user; + items["logoUrl"] = logoUrl; + items["passwordResetLink"] = "reset link"; + + body = PackageController.EvaluateTemplate(body, items); + + // send mail message + //MailHelper.SendMessage(from, mailTo, string.Empty, subject, body, priority, isHtml); + } private static bool EmailAddressExists(string emailAddress) { diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SchedulerTasks/UserPasswordExpirationNotificationTask.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SchedulerTasks/UserPasswordExpirationNotificationTask.cs new file mode 100644 index 00000000..debd1ee4 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SchedulerTasks/UserPasswordExpirationNotificationTask.cs @@ -0,0 +1,63 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Net.Mail; +using WebsitePanel.Providers.HostedSolution; + +namespace WebsitePanel.EnterpriseServer +{ + public class UserPasswordExpirationNotificationTask : SchedulerTask + { + private static readonly string TaskId = "SCHEDULE_TASK_DOMAIN_EXPIRATION"; + + // Input parameters: + private static readonly string DaysBeforeNotify = "DAYS_BEFORE_EXPIRATION"; + + public override void DoWork() + { + BackgroundTask topTask = TaskManager.TopTask; + + int daysBeforeNotify; + + // check input parameters + if (!int.TryParse((string)topTask.GetParamValue(DaysBeforeNotify), out daysBeforeNotify)) + { + TaskManager.WriteWarning("Specify 'Notify before (days)' task parameter"); + return; + } + + var owner = UserController.GetUser(topTask.EffectiveUserId); + + var packages = PackageController.GetMyPackages(topTask.EffectiveUserId); + + foreach (var package in packages) + { + var organizations = ExchangeServerController.GetExchangeOrganizations(package.PackageId, true); + + foreach (var organization in organizations) + { + var usersWithExpiredPasswords = OrganizationController.GetOrganizationUsersWithExpiredPassword(organization.Id, daysBeforeNotify); + + foreach (var user in usersWithExpiredPasswords) + { + if (string.IsNullOrEmpty(user.PrimaryEmailAddress)) + { + TaskManager.WriteWarning(string.Format("Unable to send email to {0} user (organization: {1}), user primary email address is not set.", user.DisplayName, organization.OrganizationId)); + continue; + } + + TaskManager.Write(string.Format("Email sent to {0} user (organization: {1}).", user.DisplayName, organization.OrganizationId)); + + OrganizationController.SendResetUserPasswordEmail(owner, user, user.PrimaryEmailAddress, string.Empty); + } + } + } + + // send mail message + // MailHelper.SendMessage(mailFrom, mailTo, mailSubject, mailBody, false); + } + + + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/WebsitePanel.EnterpriseServer.Code.csproj b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/WebsitePanel.EnterpriseServer.Code.csproj index 58c17bbf..cc5a9f03 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/WebsitePanel.EnterpriseServer.Code.csproj +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/WebsitePanel.EnterpriseServer.Code.csproj @@ -158,6 +158,7 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/IOrganization.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/IOrganization.cs index ea66403f..99e2c637 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/IOrganization.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/IOrganization.cs @@ -26,6 +26,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +using System.Collections.Generic; using WebsitePanel.Providers.OS; using WebsitePanel.Providers.ResultObjects; @@ -96,5 +97,7 @@ namespace WebsitePanel.Providers.HostedSolution void SetDriveMapsTargetingFilter(string organizationId, ExchangeAccount[] accounts, string folderName); void ChangeDriveMapFolderPath(string organizationId, string oldFolder, string newFolder); + + List GetOrganizationUsersWithExpiredPassword(string organizationId, int daysBeforeExpiration); } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationUser.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationUser.cs index b0c18b83..5a1dfb5d 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationUser.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationUser.cs @@ -334,5 +334,7 @@ namespace WebsitePanel.Providers.HostedSolution get { return userMustChangePassword; } set { userMustChangePassword = value; } } + + public DateTime PasswordExpirationDateTime { get; set; } } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs index 44ee8db4..26d4dfb8 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs @@ -27,6 +27,7 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using System; +using System.DirectoryServices.ActiveDirectory; using System.IO; using System.Xml; using System.Linq; @@ -480,6 +481,77 @@ namespace WebsitePanel.Providers.HostedSolution return Errors.OK; } + public List GetOrganizationUsersWithExpiredPassword(string organizationId, int daysBeforeExpiration) + { + return GetOrganizationUsersWithExpiredPasswordInternal(organizationId, daysBeforeExpiration); + } + + internal List GetOrganizationUsersWithExpiredPasswordInternal(string organizationId, int daysBeforeExpiration) + { + var result = new List(); + + var maxPasswordAgeSpan = GetMaxPasswordAge(); + + var searchRoot = new DirectoryEntry(GetOrganizationPath(organizationId)); + + var search = new DirectorySearcher(searchRoot) + { + SearchScope = SearchScope.Subtree, + Filter = "(objectClass=user)" + }; + + search.PropertiesToLoad.Add("pwdLastSet"); + search.PropertiesToLoad.Add("sAMAccountName"); + + SearchResultCollection searchResults = search.FindAll(); + + foreach (SearchResult searchResult in searchResults) + { + var pwdLastSetTicks = (long)searchResult.Properties["pwdLastSet"][0]; + + var pwdLastSetDate = DateTime.FromFileTimeUtc(pwdLastSetTicks); + + var expirationDate = pwdLastSetDate.AddDays(maxPasswordAgeSpan.Days); + + if (pwdLastSetDate > expirationDate.AddDays(-daysBeforeExpiration)) + { + var user = new OrganizationUser(); + + user.PasswordExpirationDateTime = expirationDate; + user.SamAccountName = (string)searchResult.Properties["sAMAccountName"][0]; + + result.Add(user); + } + } + + return result; + } + + internal TimeSpan GetMaxPasswordAge() + { + using (Domain d = Domain.GetCurrentDomain()) + { + using (DirectoryEntry domain = d.GetDirectoryEntry()) + { + DirectorySearcher ds = new DirectorySearcher( + domain, + "(objectClass=*)", + null, + SearchScope.Base + ); + + SearchResult sr = ds.FindOne(); + + if (sr != null && sr.Properties.Contains("maxPwdAge")) + { + return TimeSpan.FromTicks((long)sr.Properties["maxPwdAge"][0]).Duration(); + } + + throw new Exception("'maxPwdAge' property not found."); + } + } + } + public PasswordPolicyResult GetPasswordPolicy() { return GetPasswordPolicyInternal(); diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/OrganizationProxy.cs b/WebsitePanel/Sources/WebsitePanel.Server.Client/OrganizationProxy.cs index fa24e922..ef15952c 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.Client/OrganizationProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/OrganizationProxy.cs @@ -1,39 +1,7 @@ -// Copyright (c) 2015, Outercurve Foundation. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// - Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// - Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// - Neither the name of the Outercurve Foundation nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using WebsitePanel.Providers.ResultObjects; -using WebsitePanel.Providers.OS; -using WebsitePanel.Providers.Common; - //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.5466 +// Runtime Version:2.0.50727.7905 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -41,329 +9,311 @@ using WebsitePanel.Providers.Common; //------------------------------------------------------------------------------ // -// This source code was auto-generated by wsdl, Version=2.0.50727.42. +// This source code was auto-generated by wsdl, Version=2.0.50727.3038. // -namespace WebsitePanel.Providers.HostedSolution -{ + +using WebsitePanel.Providers.Common; +using WebsitePanel.Providers.OS; +using WebsitePanel.Providers.ResultObjects; + +namespace WebsitePanel.Providers.HostedSolution { using System.Xml.Serialization; using System.Web.Services; using System.ComponentModel; using System.Web.Services.Protocols; using System; using System.Diagnostics; - - + + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Web.Services.WebServiceBindingAttribute(Name = "OrganizationsSoap", Namespace = "http://tempuri.org/")] + [System.Web.Services.WebServiceBindingAttribute(Name="OrganizationsSoap", Namespace="http://tempuri.org/")] [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResultObject))] [System.Xml.Serialization.XmlIncludeAttribute(typeof(ServiceProviderItem))] - public partial class Organizations : Microsoft.Web.Services3.WebServicesClientProtocol - { - + public partial class Organizations : Microsoft.Web.Services3.WebServicesClientProtocol { + public ServiceProviderSettingsSoapHeader ServiceProviderSettingsSoapHeaderValue; - + private System.Threading.SendOrPostCallback OrganizationExistsOperationCompleted; - + private System.Threading.SendOrPostCallback CreateOrganizationOperationCompleted; - + private System.Threading.SendOrPostCallback DeleteOrganizationOperationCompleted; - + private System.Threading.SendOrPostCallback CreateUserOperationCompleted; - + private System.Threading.SendOrPostCallback DisableUserOperationCompleted; - + private System.Threading.SendOrPostCallback DeleteUserOperationCompleted; - + private System.Threading.SendOrPostCallback GetUserGeneralSettingsOperationCompleted; - + private System.Threading.SendOrPostCallback CreateSecurityGroupOperationCompleted; - + private System.Threading.SendOrPostCallback GetSecurityGroupGeneralSettingsOperationCompleted; - + private System.Threading.SendOrPostCallback DeleteSecurityGroupOperationCompleted; - + private System.Threading.SendOrPostCallback SetSecurityGroupGeneralSettingsOperationCompleted; - + private System.Threading.SendOrPostCallback AddObjectToSecurityGroupOperationCompleted; - + private System.Threading.SendOrPostCallback DeleteObjectFromSecurityGroupOperationCompleted; - + private System.Threading.SendOrPostCallback SetUserGeneralSettingsOperationCompleted; - + private System.Threading.SendOrPostCallback SetUserPasswordOperationCompleted; - + private System.Threading.SendOrPostCallback SetUserPrincipalNameOperationCompleted; - + private System.Threading.SendOrPostCallback DeleteOrganizationDomainOperationCompleted; - + private System.Threading.SendOrPostCallback CreateOrganizationDomainOperationCompleted; - + private System.Threading.SendOrPostCallback GetPasswordPolicyOperationCompleted; - + private System.Threading.SendOrPostCallback GetSamAccountNameByUserPrincipalNameOperationCompleted; - + private System.Threading.SendOrPostCallback DoesSamAccountNameExistOperationCompleted; - + private System.Threading.SendOrPostCallback GetDriveMapsOperationCompleted; - + private System.Threading.SendOrPostCallback CreateMappedDriveOperationCompleted; - + private System.Threading.SendOrPostCallback DeleteMappedDriveOperationCompleted; - + private System.Threading.SendOrPostCallback DeleteMappedDriveByPathOperationCompleted; - + private System.Threading.SendOrPostCallback DeleteMappedDrivesGPOOperationCompleted; - + private System.Threading.SendOrPostCallback SetDriveMapsTargetingFilterOperationCompleted; - + private System.Threading.SendOrPostCallback ChangeDriveMapFolderPathOperationCompleted; - + + private System.Threading.SendOrPostCallback GetOrganizationUsersWithExpiredPasswordOperationCompleted; + /// - public Organizations() - { - this.Url = "http://localhost:9004/Organizations.asmx"; + public Organizations() { + this.Url = "http://localhost:9003/Organizations.asmx"; } - + /// public event OrganizationExistsCompletedEventHandler OrganizationExistsCompleted; - + /// public event CreateOrganizationCompletedEventHandler CreateOrganizationCompleted; - + /// public event DeleteOrganizationCompletedEventHandler DeleteOrganizationCompleted; - + /// public event CreateUserCompletedEventHandler CreateUserCompleted; - + /// public event DisableUserCompletedEventHandler DisableUserCompleted; - + /// public event DeleteUserCompletedEventHandler DeleteUserCompleted; - + /// public event GetUserGeneralSettingsCompletedEventHandler GetUserGeneralSettingsCompleted; - + /// public event CreateSecurityGroupCompletedEventHandler CreateSecurityGroupCompleted; - + /// public event GetSecurityGroupGeneralSettingsCompletedEventHandler GetSecurityGroupGeneralSettingsCompleted; - + /// public event DeleteSecurityGroupCompletedEventHandler DeleteSecurityGroupCompleted; - + /// public event SetSecurityGroupGeneralSettingsCompletedEventHandler SetSecurityGroupGeneralSettingsCompleted; - + /// public event AddObjectToSecurityGroupCompletedEventHandler AddObjectToSecurityGroupCompleted; - + /// public event DeleteObjectFromSecurityGroupCompletedEventHandler DeleteObjectFromSecurityGroupCompleted; - + /// public event SetUserGeneralSettingsCompletedEventHandler SetUserGeneralSettingsCompleted; - + /// public event SetUserPasswordCompletedEventHandler SetUserPasswordCompleted; - + /// public event SetUserPrincipalNameCompletedEventHandler SetUserPrincipalNameCompleted; - + /// public event DeleteOrganizationDomainCompletedEventHandler DeleteOrganizationDomainCompleted; - + /// public event CreateOrganizationDomainCompletedEventHandler CreateOrganizationDomainCompleted; - + /// public event GetPasswordPolicyCompletedEventHandler GetPasswordPolicyCompleted; - + /// public event GetSamAccountNameByUserPrincipalNameCompletedEventHandler GetSamAccountNameByUserPrincipalNameCompleted; - + /// public event DoesSamAccountNameExistCompletedEventHandler DoesSamAccountNameExistCompleted; - + /// public event GetDriveMapsCompletedEventHandler GetDriveMapsCompleted; - + /// public event CreateMappedDriveCompletedEventHandler CreateMappedDriveCompleted; - + /// public event DeleteMappedDriveCompletedEventHandler DeleteMappedDriveCompleted; - + /// public event DeleteMappedDriveByPathCompletedEventHandler DeleteMappedDriveByPathCompleted; - + /// public event DeleteMappedDrivesGPOCompletedEventHandler DeleteMappedDrivesGPOCompleted; - + /// public event SetDriveMapsTargetingFilterCompletedEventHandler SetDriveMapsTargetingFilterCompleted; - + /// public event ChangeDriveMapFolderPathCompletedEventHandler ChangeDriveMapFolderPathCompleted; - + + /// + public event GetOrganizationUsersWithExpiredPasswordCompletedEventHandler GetOrganizationUsersWithExpiredPasswordCompleted; + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/OrganizationExists", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public bool OrganizationExists(string organizationId) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/OrganizationExists", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public bool OrganizationExists(string organizationId) { object[] results = this.Invoke("OrganizationExists", new object[] { organizationId}); return ((bool)(results[0])); } - + /// - public System.IAsyncResult BeginOrganizationExists(string organizationId, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginOrganizationExists(string organizationId, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("OrganizationExists", new object[] { organizationId}, callback, asyncState); } - + /// - public bool EndOrganizationExists(System.IAsyncResult asyncResult) - { + public bool EndOrganizationExists(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((bool)(results[0])); } - + /// - public void OrganizationExistsAsync(string organizationId) - { + public void OrganizationExistsAsync(string organizationId) { this.OrganizationExistsAsync(organizationId, null); } - + /// - public void OrganizationExistsAsync(string organizationId, object userState) - { - if ((this.OrganizationExistsOperationCompleted == null)) - { + public void OrganizationExistsAsync(string organizationId, object userState) { + if ((this.OrganizationExistsOperationCompleted == null)) { this.OrganizationExistsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnOrganizationExistsOperationCompleted); } this.InvokeAsync("OrganizationExists", new object[] { organizationId}, this.OrganizationExistsOperationCompleted, userState); } - - private void OnOrganizationExistsOperationCompleted(object arg) - { - if ((this.OrganizationExistsCompleted != null)) - { + + private void OnOrganizationExistsOperationCompleted(object arg) { + if ((this.OrganizationExistsCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.OrganizationExistsCompleted(this, new OrganizationExistsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CreateOrganization", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public Organization CreateOrganization(string organizationId) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CreateOrganization", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public Organization CreateOrganization(string organizationId) { object[] results = this.Invoke("CreateOrganization", new object[] { organizationId}); return ((Organization)(results[0])); } - + /// - public System.IAsyncResult BeginCreateOrganization(string organizationId, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginCreateOrganization(string organizationId, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("CreateOrganization", new object[] { organizationId}, callback, asyncState); } - + /// - public Organization EndCreateOrganization(System.IAsyncResult asyncResult) - { + public Organization EndCreateOrganization(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((Organization)(results[0])); } - + /// - public void CreateOrganizationAsync(string organizationId) - { + public void CreateOrganizationAsync(string organizationId) { this.CreateOrganizationAsync(organizationId, null); } - + /// - public void CreateOrganizationAsync(string organizationId, object userState) - { - if ((this.CreateOrganizationOperationCompleted == null)) - { + public void CreateOrganizationAsync(string organizationId, object userState) { + if ((this.CreateOrganizationOperationCompleted == null)) { this.CreateOrganizationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateOrganizationOperationCompleted); } this.InvokeAsync("CreateOrganization", new object[] { organizationId}, this.CreateOrganizationOperationCompleted, userState); } - - private void OnCreateOrganizationOperationCompleted(object arg) - { - if ((this.CreateOrganizationCompleted != null)) - { + + private void OnCreateOrganizationOperationCompleted(object arg) { + if ((this.CreateOrganizationCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.CreateOrganizationCompleted(this, new CreateOrganizationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteOrganization", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void DeleteOrganization(string organizationId) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteOrganization", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void DeleteOrganization(string organizationId) { this.Invoke("DeleteOrganization", new object[] { organizationId}); } - + /// - public System.IAsyncResult BeginDeleteOrganization(string organizationId, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginDeleteOrganization(string organizationId, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("DeleteOrganization", new object[] { organizationId}, callback, asyncState); } - + /// - public void EndDeleteOrganization(System.IAsyncResult asyncResult) - { + public void EndDeleteOrganization(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void DeleteOrganizationAsync(string organizationId) - { + public void DeleteOrganizationAsync(string organizationId) { this.DeleteOrganizationAsync(organizationId, null); } - + /// - public void DeleteOrganizationAsync(string organizationId, object userState) - { - if ((this.DeleteOrganizationOperationCompleted == null)) - { + public void DeleteOrganizationAsync(string organizationId, object userState) { + if ((this.DeleteOrganizationOperationCompleted == null)) { this.DeleteOrganizationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteOrganizationOperationCompleted); } this.InvokeAsync("DeleteOrganization", new object[] { organizationId}, this.DeleteOrganizationOperationCompleted, userState); } - - private void OnDeleteOrganizationOperationCompleted(object arg) - { - if ((this.DeleteOrganizationCompleted != null)) - { + + private void OnDeleteOrganizationOperationCompleted(object arg) { + if ((this.DeleteOrganizationCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.DeleteOrganizationCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CreateUser", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public int CreateUser(string organizationId, string loginName, string displayName, string upn, string password, bool enabled) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CreateUser", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int CreateUser(string organizationId, string loginName, string displayName, string upn, string password, bool enabled) { object[] results = this.Invoke("CreateUser", new object[] { organizationId, loginName, @@ -373,10 +323,9 @@ namespace WebsitePanel.Providers.HostedSolution enabled}); return ((int)(results[0])); } - + /// - public System.IAsyncResult BeginCreateUser(string organizationId, string loginName, string displayName, string upn, string password, bool enabled, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginCreateUser(string organizationId, string loginName, string displayName, string upn, string password, bool enabled, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("CreateUser", new object[] { organizationId, loginName, @@ -385,25 +334,21 @@ namespace WebsitePanel.Providers.HostedSolution password, enabled}, callback, asyncState); } - + /// - public int EndCreateUser(System.IAsyncResult asyncResult) - { + public int EndCreateUser(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((int)(results[0])); } - + /// - public void CreateUserAsync(string organizationId, string loginName, string displayName, string upn, string password, bool enabled) - { + public void CreateUserAsync(string organizationId, string loginName, string displayName, string upn, string password, bool enabled) { this.CreateUserAsync(organizationId, loginName, displayName, upn, password, enabled, null); } - + /// - public void CreateUserAsync(string organizationId, string loginName, string displayName, string upn, string password, bool enabled, object userState) - { - if ((this.CreateUserOperationCompleted == null)) - { + public void CreateUserAsync(string organizationId, string loginName, string displayName, string upn, string password, bool enabled, object userState) { + if ((this.CreateUserOperationCompleted == null)) { this.CreateUserOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateUserOperationCompleted); } this.InvokeAsync("CreateUser", new object[] { @@ -414,367 +359,311 @@ namespace WebsitePanel.Providers.HostedSolution password, enabled}, this.CreateUserOperationCompleted, userState); } - - private void OnCreateUserOperationCompleted(object arg) - { - if ((this.CreateUserCompleted != null)) - { + + private void OnCreateUserOperationCompleted(object arg) { + if ((this.CreateUserCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.CreateUserCompleted(this, new CreateUserCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DisableUser", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void DisableUser(string loginName, string organizationId) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DisableUser", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void DisableUser(string loginName, string organizationId) { this.Invoke("DisableUser", new object[] { loginName, organizationId}); } - + /// - public System.IAsyncResult BeginDisableUser(string loginName, string organizationId, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginDisableUser(string loginName, string organizationId, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("DisableUser", new object[] { loginName, organizationId}, callback, asyncState); } - + /// - public void EndDisableUser(System.IAsyncResult asyncResult) - { + public void EndDisableUser(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void DisableUserAsync(string loginName, string organizationId) - { + public void DisableUserAsync(string loginName, string organizationId) { this.DisableUserAsync(loginName, organizationId, null); } - + /// - public void DisableUserAsync(string loginName, string organizationId, object userState) - { - if ((this.DisableUserOperationCompleted == null)) - { + public void DisableUserAsync(string loginName, string organizationId, object userState) { + if ((this.DisableUserOperationCompleted == null)) { this.DisableUserOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDisableUserOperationCompleted); } this.InvokeAsync("DisableUser", new object[] { loginName, organizationId}, this.DisableUserOperationCompleted, userState); } - - private void OnDisableUserOperationCompleted(object arg) - { - if ((this.DisableUserCompleted != null)) - { + + private void OnDisableUserOperationCompleted(object arg) { + if ((this.DisableUserCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.DisableUserCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteUser", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void DeleteUser(string loginName, string organizationId) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteUser", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void DeleteUser(string loginName, string organizationId) { this.Invoke("DeleteUser", new object[] { loginName, organizationId}); } - + /// - public System.IAsyncResult BeginDeleteUser(string loginName, string organizationId, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginDeleteUser(string loginName, string organizationId, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("DeleteUser", new object[] { loginName, organizationId}, callback, asyncState); } - + /// - public void EndDeleteUser(System.IAsyncResult asyncResult) - { + public void EndDeleteUser(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void DeleteUserAsync(string loginName, string organizationId) - { + public void DeleteUserAsync(string loginName, string organizationId) { this.DeleteUserAsync(loginName, organizationId, null); } - + /// - public void DeleteUserAsync(string loginName, string organizationId, object userState) - { - if ((this.DeleteUserOperationCompleted == null)) - { + public void DeleteUserAsync(string loginName, string organizationId, object userState) { + if ((this.DeleteUserOperationCompleted == null)) { this.DeleteUserOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteUserOperationCompleted); } this.InvokeAsync("DeleteUser", new object[] { loginName, organizationId}, this.DeleteUserOperationCompleted, userState); } - - private void OnDeleteUserOperationCompleted(object arg) - { - if ((this.DeleteUserCompleted != null)) - { + + private void OnDeleteUserOperationCompleted(object arg) { + if ((this.DeleteUserCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.DeleteUserCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetUserGeneralSettings", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public OrganizationUser GetUserGeneralSettings(string loginName, string organizationId) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetUserGeneralSettings", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public OrganizationUser GetUserGeneralSettings(string loginName, string organizationId) { object[] results = this.Invoke("GetUserGeneralSettings", new object[] { loginName, organizationId}); return ((OrganizationUser)(results[0])); } - + /// - public System.IAsyncResult BeginGetUserGeneralSettings(string loginName, string organizationId, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginGetUserGeneralSettings(string loginName, string organizationId, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("GetUserGeneralSettings", new object[] { loginName, organizationId}, callback, asyncState); } - + /// - public OrganizationUser EndGetUserGeneralSettings(System.IAsyncResult asyncResult) - { + public OrganizationUser EndGetUserGeneralSettings(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((OrganizationUser)(results[0])); } - + /// - public void GetUserGeneralSettingsAsync(string loginName, string organizationId) - { + public void GetUserGeneralSettingsAsync(string loginName, string organizationId) { this.GetUserGeneralSettingsAsync(loginName, organizationId, null); } - + /// - public void GetUserGeneralSettingsAsync(string loginName, string organizationId, object userState) - { - if ((this.GetUserGeneralSettingsOperationCompleted == null)) - { + public void GetUserGeneralSettingsAsync(string loginName, string organizationId, object userState) { + if ((this.GetUserGeneralSettingsOperationCompleted == null)) { this.GetUserGeneralSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetUserGeneralSettingsOperationCompleted); } this.InvokeAsync("GetUserGeneralSettings", new object[] { loginName, organizationId}, this.GetUserGeneralSettingsOperationCompleted, userState); } - - private void OnGetUserGeneralSettingsOperationCompleted(object arg) - { - if ((this.GetUserGeneralSettingsCompleted != null)) - { + + private void OnGetUserGeneralSettingsOperationCompleted(object arg) { + if ((this.GetUserGeneralSettingsCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetUserGeneralSettingsCompleted(this, new GetUserGeneralSettingsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CreateSecurityGroup", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public int CreateSecurityGroup(string organizationId, string groupName) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CreateSecurityGroup", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int CreateSecurityGroup(string organizationId, string groupName) { object[] results = this.Invoke("CreateSecurityGroup", new object[] { organizationId, groupName}); return ((int)(results[0])); } - + /// - public System.IAsyncResult BeginCreateSecurityGroup(string organizationId, string groupName, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginCreateSecurityGroup(string organizationId, string groupName, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("CreateSecurityGroup", new object[] { organizationId, groupName}, callback, asyncState); } - + /// - public int EndCreateSecurityGroup(System.IAsyncResult asyncResult) - { + public int EndCreateSecurityGroup(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((int)(results[0])); } - + /// - public void CreateSecurityGroupAsync(string organizationId, string groupName) - { + public void CreateSecurityGroupAsync(string organizationId, string groupName) { this.CreateSecurityGroupAsync(organizationId, groupName, null); } - + /// - public void CreateSecurityGroupAsync(string organizationId, string groupName, object userState) - { - if ((this.CreateSecurityGroupOperationCompleted == null)) - { + public void CreateSecurityGroupAsync(string organizationId, string groupName, object userState) { + if ((this.CreateSecurityGroupOperationCompleted == null)) { this.CreateSecurityGroupOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateSecurityGroupOperationCompleted); } this.InvokeAsync("CreateSecurityGroup", new object[] { organizationId, groupName}, this.CreateSecurityGroupOperationCompleted, userState); } - - private void OnCreateSecurityGroupOperationCompleted(object arg) - { - if ((this.CreateSecurityGroupCompleted != null)) - { + + private void OnCreateSecurityGroupOperationCompleted(object arg) { + if ((this.CreateSecurityGroupCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.CreateSecurityGroupCompleted(this, new CreateSecurityGroupCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetSecurityGroupGeneralSettings", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public OrganizationSecurityGroup GetSecurityGroupGeneralSettings(string groupName, string organizationId) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetSecurityGroupGeneralSettings", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public OrganizationSecurityGroup GetSecurityGroupGeneralSettings(string groupName, string organizationId) { object[] results = this.Invoke("GetSecurityGroupGeneralSettings", new object[] { groupName, organizationId}); return ((OrganizationSecurityGroup)(results[0])); } - + /// - public System.IAsyncResult BeginGetSecurityGroupGeneralSettings(string groupName, string organizationId, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginGetSecurityGroupGeneralSettings(string groupName, string organizationId, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("GetSecurityGroupGeneralSettings", new object[] { groupName, organizationId}, callback, asyncState); } - + /// - public OrganizationSecurityGroup EndGetSecurityGroupGeneralSettings(System.IAsyncResult asyncResult) - { + public OrganizationSecurityGroup EndGetSecurityGroupGeneralSettings(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((OrganizationSecurityGroup)(results[0])); } - + /// - public void GetSecurityGroupGeneralSettingsAsync(string groupName, string organizationId) - { + public void GetSecurityGroupGeneralSettingsAsync(string groupName, string organizationId) { this.GetSecurityGroupGeneralSettingsAsync(groupName, organizationId, null); } - + /// - public void GetSecurityGroupGeneralSettingsAsync(string groupName, string organizationId, object userState) - { - if ((this.GetSecurityGroupGeneralSettingsOperationCompleted == null)) - { + public void GetSecurityGroupGeneralSettingsAsync(string groupName, string organizationId, object userState) { + if ((this.GetSecurityGroupGeneralSettingsOperationCompleted == null)) { this.GetSecurityGroupGeneralSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetSecurityGroupGeneralSettingsOperationCompleted); } this.InvokeAsync("GetSecurityGroupGeneralSettings", new object[] { groupName, organizationId}, this.GetSecurityGroupGeneralSettingsOperationCompleted, userState); } - - private void OnGetSecurityGroupGeneralSettingsOperationCompleted(object arg) - { - if ((this.GetSecurityGroupGeneralSettingsCompleted != null)) - { + + private void OnGetSecurityGroupGeneralSettingsOperationCompleted(object arg) { + if ((this.GetSecurityGroupGeneralSettingsCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetSecurityGroupGeneralSettingsCompleted(this, new GetSecurityGroupGeneralSettingsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteSecurityGroup", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void DeleteSecurityGroup(string groupName, string organizationId) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteSecurityGroup", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void DeleteSecurityGroup(string groupName, string organizationId) { this.Invoke("DeleteSecurityGroup", new object[] { groupName, organizationId}); } - + /// - public System.IAsyncResult BeginDeleteSecurityGroup(string groupName, string organizationId, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginDeleteSecurityGroup(string groupName, string organizationId, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("DeleteSecurityGroup", new object[] { groupName, organizationId}, callback, asyncState); } - + /// - public void EndDeleteSecurityGroup(System.IAsyncResult asyncResult) - { + public void EndDeleteSecurityGroup(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void DeleteSecurityGroupAsync(string groupName, string organizationId) - { + public void DeleteSecurityGroupAsync(string groupName, string organizationId) { this.DeleteSecurityGroupAsync(groupName, organizationId, null); } - + /// - public void DeleteSecurityGroupAsync(string groupName, string organizationId, object userState) - { - if ((this.DeleteSecurityGroupOperationCompleted == null)) - { + public void DeleteSecurityGroupAsync(string groupName, string organizationId, object userState) { + if ((this.DeleteSecurityGroupOperationCompleted == null)) { this.DeleteSecurityGroupOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteSecurityGroupOperationCompleted); } this.InvokeAsync("DeleteSecurityGroup", new object[] { groupName, organizationId}, this.DeleteSecurityGroupOperationCompleted, userState); } - - private void OnDeleteSecurityGroupOperationCompleted(object arg) - { - if ((this.DeleteSecurityGroupCompleted != null)) - { + + private void OnDeleteSecurityGroupOperationCompleted(object arg) { + if ((this.DeleteSecurityGroupCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.DeleteSecurityGroupCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SetSecurityGroupGeneralSettings", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void SetSecurityGroupGeneralSettings(string organizationId, string groupName, string[] memberAccounts, string notes) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SetSecurityGroupGeneralSettings", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void SetSecurityGroupGeneralSettings(string organizationId, string groupName, string[] memberAccounts, string notes) { this.Invoke("SetSecurityGroupGeneralSettings", new object[] { organizationId, groupName, memberAccounts, notes}); } - + /// - public System.IAsyncResult BeginSetSecurityGroupGeneralSettings(string organizationId, string groupName, string[] memberAccounts, string notes, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginSetSecurityGroupGeneralSettings(string organizationId, string groupName, string[] memberAccounts, string notes, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("SetSecurityGroupGeneralSettings", new object[] { organizationId, groupName, memberAccounts, notes}, callback, asyncState); } - + /// - public void EndSetSecurityGroupGeneralSettings(System.IAsyncResult asyncResult) - { + public void EndSetSecurityGroupGeneralSettings(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void SetSecurityGroupGeneralSettingsAsync(string organizationId, string groupName, string[] memberAccounts, string notes) - { + public void SetSecurityGroupGeneralSettingsAsync(string organizationId, string groupName, string[] memberAccounts, string notes) { this.SetSecurityGroupGeneralSettingsAsync(organizationId, groupName, memberAccounts, notes, null); } - + /// - public void SetSecurityGroupGeneralSettingsAsync(string organizationId, string groupName, string[] memberAccounts, string notes, object userState) - { - if ((this.SetSecurityGroupGeneralSettingsOperationCompleted == null)) - { + public void SetSecurityGroupGeneralSettingsAsync(string organizationId, string groupName, string[] memberAccounts, string notes, object userState) { + if ((this.SetSecurityGroupGeneralSettingsOperationCompleted == null)) { this.SetSecurityGroupGeneralSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetSecurityGroupGeneralSettingsOperationCompleted); } this.InvokeAsync("SetSecurityGroupGeneralSettings", new object[] { @@ -783,53 +672,45 @@ namespace WebsitePanel.Providers.HostedSolution memberAccounts, notes}, this.SetSecurityGroupGeneralSettingsOperationCompleted, userState); } - - private void OnSetSecurityGroupGeneralSettingsOperationCompleted(object arg) - { - if ((this.SetSecurityGroupGeneralSettingsCompleted != null)) - { + + private void OnSetSecurityGroupGeneralSettingsOperationCompleted(object arg) { + if ((this.SetSecurityGroupGeneralSettingsCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.SetSecurityGroupGeneralSettingsCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/AddObjectToSecurityGroup", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void AddObjectToSecurityGroup(string organizationId, string accountName, string groupName) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/AddObjectToSecurityGroup", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void AddObjectToSecurityGroup(string organizationId, string accountName, string groupName) { this.Invoke("AddObjectToSecurityGroup", new object[] { organizationId, accountName, groupName}); } - + /// - public System.IAsyncResult BeginAddObjectToSecurityGroup(string organizationId, string accountName, string groupName, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginAddObjectToSecurityGroup(string organizationId, string accountName, string groupName, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("AddObjectToSecurityGroup", new object[] { organizationId, accountName, groupName}, callback, asyncState); } - + /// - public void EndAddObjectToSecurityGroup(System.IAsyncResult asyncResult) - { + public void EndAddObjectToSecurityGroup(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void AddObjectToSecurityGroupAsync(string organizationId, string accountName, string groupName) - { + public void AddObjectToSecurityGroupAsync(string organizationId, string accountName, string groupName) { this.AddObjectToSecurityGroupAsync(organizationId, accountName, groupName, null); } - + /// - public void AddObjectToSecurityGroupAsync(string organizationId, string accountName, string groupName, object userState) - { - if ((this.AddObjectToSecurityGroupOperationCompleted == null)) - { + public void AddObjectToSecurityGroupAsync(string organizationId, string accountName, string groupName, object userState) { + if ((this.AddObjectToSecurityGroupOperationCompleted == null)) { this.AddObjectToSecurityGroupOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddObjectToSecurityGroupOperationCompleted); } this.InvokeAsync("AddObjectToSecurityGroup", new object[] { @@ -837,53 +718,45 @@ namespace WebsitePanel.Providers.HostedSolution accountName, groupName}, this.AddObjectToSecurityGroupOperationCompleted, userState); } - - private void OnAddObjectToSecurityGroupOperationCompleted(object arg) - { - if ((this.AddObjectToSecurityGroupCompleted != null)) - { + + private void OnAddObjectToSecurityGroupOperationCompleted(object arg) { + if ((this.AddObjectToSecurityGroupCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.AddObjectToSecurityGroupCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteObjectFromSecurityGroup", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void DeleteObjectFromSecurityGroup(string organizationId, string accountName, string groupName) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteObjectFromSecurityGroup", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void DeleteObjectFromSecurityGroup(string organizationId, string accountName, string groupName) { this.Invoke("DeleteObjectFromSecurityGroup", new object[] { organizationId, accountName, groupName}); } - + /// - public System.IAsyncResult BeginDeleteObjectFromSecurityGroup(string organizationId, string accountName, string groupName, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginDeleteObjectFromSecurityGroup(string organizationId, string accountName, string groupName, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("DeleteObjectFromSecurityGroup", new object[] { organizationId, accountName, groupName}, callback, asyncState); } - + /// - public void EndDeleteObjectFromSecurityGroup(System.IAsyncResult asyncResult) - { + public void EndDeleteObjectFromSecurityGroup(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void DeleteObjectFromSecurityGroupAsync(string organizationId, string accountName, string groupName) - { + public void DeleteObjectFromSecurityGroupAsync(string organizationId, string accountName, string groupName) { this.DeleteObjectFromSecurityGroupAsync(organizationId, accountName, groupName, null); } - + /// - public void DeleteObjectFromSecurityGroupAsync(string organizationId, string accountName, string groupName, object userState) - { - if ((this.DeleteObjectFromSecurityGroupOperationCompleted == null)) - { + public void DeleteObjectFromSecurityGroupAsync(string organizationId, string accountName, string groupName, object userState) { + if ((this.DeleteObjectFromSecurityGroupOperationCompleted == null)) { this.DeleteObjectFromSecurityGroupOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteObjectFromSecurityGroupOperationCompleted); } this.InvokeAsync("DeleteObjectFromSecurityGroup", new object[] { @@ -891,50 +764,47 @@ namespace WebsitePanel.Providers.HostedSolution accountName, groupName}, this.DeleteObjectFromSecurityGroupOperationCompleted, userState); } - - private void OnDeleteObjectFromSecurityGroupOperationCompleted(object arg) - { - if ((this.DeleteObjectFromSecurityGroupCompleted != null)) - { + + private void OnDeleteObjectFromSecurityGroupOperationCompleted(object arg) { + if ((this.DeleteObjectFromSecurityGroupCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.DeleteObjectFromSecurityGroupCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SetUserGeneralSettings", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SetUserGeneralSettings", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] public void SetUserGeneralSettings( - string organizationId, - string accountName, - string displayName, - string password, - bool hideFromAddressBook, - bool disabled, - bool locked, - string firstName, - string initials, - string lastName, - string address, - string city, - string state, - string zip, - string country, - string jobTitle, - string company, - string department, - string office, - string managerAccountName, - string businessPhone, - string fax, - string homePhone, - string mobilePhone, - string pager, - string webPage, - string notes, - string externalEmail, - bool userMustChangePassword) - { + string organizationId, + string accountName, + string displayName, + string password, + bool hideFromAddressBook, + bool disabled, + bool locked, + string firstName, + string initials, + string lastName, + string address, + string city, + string state, + string zip, + string country, + string jobTitle, + string company, + string department, + string office, + string managerAccountName, + string businessPhone, + string fax, + string homePhone, + string mobilePhone, + string pager, + string webPage, + string notes, + string externalEmail, + bool userMustChangePassword) { this.Invoke("SetUserGeneralSettings", new object[] { organizationId, accountName, @@ -966,41 +836,40 @@ namespace WebsitePanel.Providers.HostedSolution externalEmail, userMustChangePassword}); } - + /// public System.IAsyncResult BeginSetUserGeneralSettings( - string organizationId, - string accountName, - string displayName, - string password, - bool hideFromAddressBook, - bool disabled, - bool locked, - string firstName, - string initials, - string lastName, - string address, - string city, - string state, - string zip, - string country, - string jobTitle, - string company, - string department, - string office, - string managerAccountName, - string businessPhone, - string fax, - string homePhone, - string mobilePhone, - string pager, - string webPage, - string notes, - string externalEmail, - bool userMustChangePassword, - System.AsyncCallback callback, - object asyncState) - { + string organizationId, + string accountName, + string displayName, + string password, + bool hideFromAddressBook, + bool disabled, + bool locked, + string firstName, + string initials, + string lastName, + string address, + string city, + string state, + string zip, + string country, + string jobTitle, + string company, + string department, + string office, + string managerAccountName, + string businessPhone, + string fax, + string homePhone, + string mobilePhone, + string pager, + string webPage, + string notes, + string externalEmail, + bool userMustChangePassword, + System.AsyncCallback callback, + object asyncState) { return this.BeginInvoke("SetUserGeneralSettings", new object[] { organizationId, accountName, @@ -1032,83 +901,79 @@ namespace WebsitePanel.Providers.HostedSolution externalEmail, userMustChangePassword}, callback, asyncState); } - + /// - public void EndSetUserGeneralSettings(System.IAsyncResult asyncResult) - { + public void EndSetUserGeneralSettings(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// public void SetUserGeneralSettingsAsync( - string organizationId, - string accountName, - string displayName, - string password, - bool hideFromAddressBook, - bool disabled, - bool locked, - string firstName, - string initials, - string lastName, - string address, - string city, - string state, - string zip, - string country, - string jobTitle, - string company, - string department, - string office, - string managerAccountName, - string businessPhone, - string fax, - string homePhone, - string mobilePhone, - string pager, - string webPage, - string notes, - string externalEmail, - bool userMustChangePassword) - { + string organizationId, + string accountName, + string displayName, + string password, + bool hideFromAddressBook, + bool disabled, + bool locked, + string firstName, + string initials, + string lastName, + string address, + string city, + string state, + string zip, + string country, + string jobTitle, + string company, + string department, + string office, + string managerAccountName, + string businessPhone, + string fax, + string homePhone, + string mobilePhone, + string pager, + string webPage, + string notes, + string externalEmail, + bool userMustChangePassword) { this.SetUserGeneralSettingsAsync(organizationId, accountName, displayName, password, hideFromAddressBook, disabled, locked, firstName, initials, lastName, address, city, state, zip, country, jobTitle, company, department, office, managerAccountName, businessPhone, fax, homePhone, mobilePhone, pager, webPage, notes, externalEmail, userMustChangePassword, null); } - + /// public void SetUserGeneralSettingsAsync( - string organizationId, - string accountName, - string displayName, - string password, - bool hideFromAddressBook, - bool disabled, - bool locked, - string firstName, - string initials, - string lastName, - string address, - string city, - string state, - string zip, - string country, - string jobTitle, - string company, - string department, - string office, - string managerAccountName, - string businessPhone, - string fax, - string homePhone, - string mobilePhone, - string pager, - string webPage, - string notes, - string externalEmail, - bool userMustChangePassword, - object userState) - { - if ((this.SetUserGeneralSettingsOperationCompleted == null)) - { + string organizationId, + string accountName, + string displayName, + string password, + bool hideFromAddressBook, + bool disabled, + bool locked, + string firstName, + string initials, + string lastName, + string address, + string city, + string state, + string zip, + string country, + string jobTitle, + string company, + string department, + string office, + string managerAccountName, + string businessPhone, + string fax, + string homePhone, + string mobilePhone, + string pager, + string webPage, + string notes, + string externalEmail, + bool userMustChangePassword, + object userState) { + if ((this.SetUserGeneralSettingsOperationCompleted == null)) { this.SetUserGeneralSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetUserGeneralSettingsOperationCompleted); } this.InvokeAsync("SetUserGeneralSettings", new object[] { @@ -1142,53 +1007,45 @@ namespace WebsitePanel.Providers.HostedSolution externalEmail, userMustChangePassword}, this.SetUserGeneralSettingsOperationCompleted, userState); } - - private void OnSetUserGeneralSettingsOperationCompleted(object arg) - { - if ((this.SetUserGeneralSettingsCompleted != null)) - { + + private void OnSetUserGeneralSettingsOperationCompleted(object arg) { + if ((this.SetUserGeneralSettingsCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.SetUserGeneralSettingsCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SetUserPassword", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void SetUserPassword(string organizationId, string accountName, string password) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SetUserPassword", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void SetUserPassword(string organizationId, string accountName, string password) { this.Invoke("SetUserPassword", new object[] { organizationId, accountName, password}); } - + /// - public System.IAsyncResult BeginSetUserPassword(string organizationId, string accountName, string password, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginSetUserPassword(string organizationId, string accountName, string password, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("SetUserPassword", new object[] { organizationId, accountName, password}, callback, asyncState); } - + /// - public void EndSetUserPassword(System.IAsyncResult asyncResult) - { + public void EndSetUserPassword(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void SetUserPasswordAsync(string organizationId, string accountName, string password) - { + public void SetUserPasswordAsync(string organizationId, string accountName, string password) { this.SetUserPasswordAsync(organizationId, accountName, password, null); } - + /// - public void SetUserPasswordAsync(string organizationId, string accountName, string password, object userState) - { - if ((this.SetUserPasswordOperationCompleted == null)) - { + public void SetUserPasswordAsync(string organizationId, string accountName, string password, object userState) { + if ((this.SetUserPasswordOperationCompleted == null)) { this.SetUserPasswordOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetUserPasswordOperationCompleted); } this.InvokeAsync("SetUserPassword", new object[] { @@ -1196,53 +1053,45 @@ namespace WebsitePanel.Providers.HostedSolution accountName, password}, this.SetUserPasswordOperationCompleted, userState); } - - private void OnSetUserPasswordOperationCompleted(object arg) - { - if ((this.SetUserPasswordCompleted != null)) - { + + private void OnSetUserPasswordOperationCompleted(object arg) { + if ((this.SetUserPasswordCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.SetUserPasswordCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SetUserPrincipalName", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void SetUserPrincipalName(string organizationId, string accountName, string userPrincipalName) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SetUserPrincipalName", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void SetUserPrincipalName(string organizationId, string accountName, string userPrincipalName) { this.Invoke("SetUserPrincipalName", new object[] { organizationId, accountName, userPrincipalName}); } - + /// - public System.IAsyncResult BeginSetUserPrincipalName(string organizationId, string accountName, string userPrincipalName, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginSetUserPrincipalName(string organizationId, string accountName, string userPrincipalName, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("SetUserPrincipalName", new object[] { organizationId, accountName, userPrincipalName}, callback, asyncState); } - + /// - public void EndSetUserPrincipalName(System.IAsyncResult asyncResult) - { + public void EndSetUserPrincipalName(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void SetUserPrincipalNameAsync(string organizationId, string accountName, string userPrincipalName) - { + public void SetUserPrincipalNameAsync(string organizationId, string accountName, string userPrincipalName) { this.SetUserPrincipalNameAsync(organizationId, accountName, userPrincipalName, null); } - + /// - public void SetUserPrincipalNameAsync(string organizationId, string accountName, string userPrincipalName, object userState) - { - if ((this.SetUserPrincipalNameOperationCompleted == null)) - { + public void SetUserPrincipalNameAsync(string organizationId, string accountName, string userPrincipalName, object userState) { + if ((this.SetUserPrincipalNameOperationCompleted == null)) { this.SetUserPrincipalNameOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetUserPrincipalNameOperationCompleted); } this.InvokeAsync("SetUserPrincipalName", new object[] { @@ -1250,323 +1099,272 @@ namespace WebsitePanel.Providers.HostedSolution accountName, userPrincipalName}, this.SetUserPrincipalNameOperationCompleted, userState); } - - private void OnSetUserPrincipalNameOperationCompleted(object arg) - { - if ((this.SetUserPrincipalNameCompleted != null)) - { + + private void OnSetUserPrincipalNameOperationCompleted(object arg) { + if ((this.SetUserPrincipalNameCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.SetUserPrincipalNameCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteOrganizationDomain", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void DeleteOrganizationDomain(string organizationDistinguishedName, string domain) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteOrganizationDomain", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void DeleteOrganizationDomain(string organizationDistinguishedName, string domain) { this.Invoke("DeleteOrganizationDomain", new object[] { organizationDistinguishedName, domain}); } - + /// - public System.IAsyncResult BeginDeleteOrganizationDomain(string organizationDistinguishedName, string domain, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginDeleteOrganizationDomain(string organizationDistinguishedName, string domain, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("DeleteOrganizationDomain", new object[] { organizationDistinguishedName, domain}, callback, asyncState); } - + /// - public void EndDeleteOrganizationDomain(System.IAsyncResult asyncResult) - { + public void EndDeleteOrganizationDomain(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void DeleteOrganizationDomainAsync(string organizationDistinguishedName, string domain) - { + public void DeleteOrganizationDomainAsync(string organizationDistinguishedName, string domain) { this.DeleteOrganizationDomainAsync(organizationDistinguishedName, domain, null); } - + /// - public void DeleteOrganizationDomainAsync(string organizationDistinguishedName, string domain, object userState) - { - if ((this.DeleteOrganizationDomainOperationCompleted == null)) - { + public void DeleteOrganizationDomainAsync(string organizationDistinguishedName, string domain, object userState) { + if ((this.DeleteOrganizationDomainOperationCompleted == null)) { this.DeleteOrganizationDomainOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteOrganizationDomainOperationCompleted); } this.InvokeAsync("DeleteOrganizationDomain", new object[] { organizationDistinguishedName, domain}, this.DeleteOrganizationDomainOperationCompleted, userState); } - - private void OnDeleteOrganizationDomainOperationCompleted(object arg) - { - if ((this.DeleteOrganizationDomainCompleted != null)) - { + + private void OnDeleteOrganizationDomainOperationCompleted(object arg) { + if ((this.DeleteOrganizationDomainCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.DeleteOrganizationDomainCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CreateOrganizationDomain", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void CreateOrganizationDomain(string organizationDistinguishedName, string domain) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CreateOrganizationDomain", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void CreateOrganizationDomain(string organizationDistinguishedName, string domain) { this.Invoke("CreateOrganizationDomain", new object[] { organizationDistinguishedName, domain}); } - + /// - public System.IAsyncResult BeginCreateOrganizationDomain(string organizationDistinguishedName, string domain, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginCreateOrganizationDomain(string organizationDistinguishedName, string domain, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("CreateOrganizationDomain", new object[] { organizationDistinguishedName, domain}, callback, asyncState); } - + /// - public void EndCreateOrganizationDomain(System.IAsyncResult asyncResult) - { + public void EndCreateOrganizationDomain(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void CreateOrganizationDomainAsync(string organizationDistinguishedName, string domain) - { + public void CreateOrganizationDomainAsync(string organizationDistinguishedName, string domain) { this.CreateOrganizationDomainAsync(organizationDistinguishedName, domain, null); } - + /// - public void CreateOrganizationDomainAsync(string organizationDistinguishedName, string domain, object userState) - { - if ((this.CreateOrganizationDomainOperationCompleted == null)) - { + public void CreateOrganizationDomainAsync(string organizationDistinguishedName, string domain, object userState) { + if ((this.CreateOrganizationDomainOperationCompleted == null)) { this.CreateOrganizationDomainOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateOrganizationDomainOperationCompleted); } this.InvokeAsync("CreateOrganizationDomain", new object[] { organizationDistinguishedName, domain}, this.CreateOrganizationDomainOperationCompleted, userState); } - - private void OnCreateOrganizationDomainOperationCompleted(object arg) - { - if ((this.CreateOrganizationDomainCompleted != null)) - { + + private void OnCreateOrganizationDomainOperationCompleted(object arg) { + if ((this.CreateOrganizationDomainCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.CreateOrganizationDomainCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetPasswordPolicy", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public PasswordPolicyResult GetPasswordPolicy() - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetPasswordPolicy", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public PasswordPolicyResult GetPasswordPolicy() { object[] results = this.Invoke("GetPasswordPolicy", new object[0]); return ((PasswordPolicyResult)(results[0])); } - + /// - public System.IAsyncResult BeginGetPasswordPolicy(System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginGetPasswordPolicy(System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("GetPasswordPolicy", new object[0], callback, asyncState); } - + /// - public PasswordPolicyResult EndGetPasswordPolicy(System.IAsyncResult asyncResult) - { + public PasswordPolicyResult EndGetPasswordPolicy(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((PasswordPolicyResult)(results[0])); } - + /// - public void GetPasswordPolicyAsync() - { + public void GetPasswordPolicyAsync() { this.GetPasswordPolicyAsync(null); } - + /// - public void GetPasswordPolicyAsync(object userState) - { - if ((this.GetPasswordPolicyOperationCompleted == null)) - { + public void GetPasswordPolicyAsync(object userState) { + if ((this.GetPasswordPolicyOperationCompleted == null)) { this.GetPasswordPolicyOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetPasswordPolicyOperationCompleted); } this.InvokeAsync("GetPasswordPolicy", new object[0], this.GetPasswordPolicyOperationCompleted, userState); } - - private void OnGetPasswordPolicyOperationCompleted(object arg) - { - if ((this.GetPasswordPolicyCompleted != null)) - { + + private void OnGetPasswordPolicyOperationCompleted(object arg) { + if ((this.GetPasswordPolicyCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetPasswordPolicyCompleted(this, new GetPasswordPolicyCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetSamAccountNameByUserPrincipalName", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public string GetSamAccountNameByUserPrincipalName(string organizationId, string userPrincipalName) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetSamAccountNameByUserPrincipalName", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string GetSamAccountNameByUserPrincipalName(string organizationId, string userPrincipalName) { object[] results = this.Invoke("GetSamAccountNameByUserPrincipalName", new object[] { organizationId, userPrincipalName}); return ((string)(results[0])); } - + /// - public System.IAsyncResult BeginGetSamAccountNameByUserPrincipalName(string organizationId, string userPrincipalName, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginGetSamAccountNameByUserPrincipalName(string organizationId, string userPrincipalName, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("GetSamAccountNameByUserPrincipalName", new object[] { organizationId, userPrincipalName}, callback, asyncState); } - + /// - public string EndGetSamAccountNameByUserPrincipalName(System.IAsyncResult asyncResult) - { + public string EndGetSamAccountNameByUserPrincipalName(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((string)(results[0])); } - + /// - public void GetSamAccountNameByUserPrincipalNameAsync(string organizationId, string userPrincipalName) - { + public void GetSamAccountNameByUserPrincipalNameAsync(string organizationId, string userPrincipalName) { this.GetSamAccountNameByUserPrincipalNameAsync(organizationId, userPrincipalName, null); } - + /// - public void GetSamAccountNameByUserPrincipalNameAsync(string organizationId, string userPrincipalName, object userState) - { - if ((this.GetSamAccountNameByUserPrincipalNameOperationCompleted == null)) - { + public void GetSamAccountNameByUserPrincipalNameAsync(string organizationId, string userPrincipalName, object userState) { + if ((this.GetSamAccountNameByUserPrincipalNameOperationCompleted == null)) { this.GetSamAccountNameByUserPrincipalNameOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetSamAccountNameByUserPrincipalNameOperationCompleted); } this.InvokeAsync("GetSamAccountNameByUserPrincipalName", new object[] { organizationId, userPrincipalName}, this.GetSamAccountNameByUserPrincipalNameOperationCompleted, userState); } - - private void OnGetSamAccountNameByUserPrincipalNameOperationCompleted(object arg) - { - if ((this.GetSamAccountNameByUserPrincipalNameCompleted != null)) - { + + private void OnGetSamAccountNameByUserPrincipalNameOperationCompleted(object arg) { + if ((this.GetSamAccountNameByUserPrincipalNameCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetSamAccountNameByUserPrincipalNameCompleted(this, new GetSamAccountNameByUserPrincipalNameCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DoesSamAccountNameExist", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public bool DoesSamAccountNameExist(string accountName) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DoesSamAccountNameExist", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public bool DoesSamAccountNameExist(string accountName) { object[] results = this.Invoke("DoesSamAccountNameExist", new object[] { accountName}); return ((bool)(results[0])); } - + /// - public System.IAsyncResult BeginDoesSamAccountNameExist(string accountName, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginDoesSamAccountNameExist(string accountName, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("DoesSamAccountNameExist", new object[] { accountName}, callback, asyncState); } - + /// - public bool EndDoesSamAccountNameExist(System.IAsyncResult asyncResult) - { + public bool EndDoesSamAccountNameExist(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((bool)(results[0])); } - + /// - public void DoesSamAccountNameExistAsync(string accountName) - { + public void DoesSamAccountNameExistAsync(string accountName) { this.DoesSamAccountNameExistAsync(accountName, null); } - + /// - public void DoesSamAccountNameExistAsync(string accountName, object userState) - { - if ((this.DoesSamAccountNameExistOperationCompleted == null)) - { + public void DoesSamAccountNameExistAsync(string accountName, object userState) { + if ((this.DoesSamAccountNameExistOperationCompleted == null)) { this.DoesSamAccountNameExistOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDoesSamAccountNameExistOperationCompleted); } this.InvokeAsync("DoesSamAccountNameExist", new object[] { accountName}, this.DoesSamAccountNameExistOperationCompleted, userState); } - - private void OnDoesSamAccountNameExistOperationCompleted(object arg) - { - if ((this.DoesSamAccountNameExistCompleted != null)) - { + + private void OnDoesSamAccountNameExistOperationCompleted(object arg) { + if ((this.DoesSamAccountNameExistCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.DoesSamAccountNameExistCompleted(this, new DoesSamAccountNameExistCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetDriveMaps", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public MappedDrive[] GetDriveMaps(string organizationId) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetDriveMaps", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public MappedDrive[] GetDriveMaps(string organizationId) { object[] results = this.Invoke("GetDriveMaps", new object[] { organizationId}); return ((MappedDrive[])(results[0])); } - + /// - public System.IAsyncResult BeginGetDriveMaps(string organizationId, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginGetDriveMaps(string organizationId, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("GetDriveMaps", new object[] { organizationId}, callback, asyncState); } - + /// - public MappedDrive[] EndGetDriveMaps(System.IAsyncResult asyncResult) - { + public MappedDrive[] EndGetDriveMaps(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((MappedDrive[])(results[0])); } - + /// - public void GetDriveMapsAsync(string organizationId) - { + public void GetDriveMapsAsync(string organizationId) { this.GetDriveMapsAsync(organizationId, null); } - + /// - public void GetDriveMapsAsync(string organizationId, object userState) - { - if ((this.GetDriveMapsOperationCompleted == null)) - { + public void GetDriveMapsAsync(string organizationId, object userState) { + if ((this.GetDriveMapsOperationCompleted == null)) { this.GetDriveMapsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetDriveMapsOperationCompleted); } this.InvokeAsync("GetDriveMaps", new object[] { organizationId}, this.GetDriveMapsOperationCompleted, userState); } - - private void OnGetDriveMapsOperationCompleted(object arg) - { - if ((this.GetDriveMapsCompleted != null)) - { + + private void OnGetDriveMapsOperationCompleted(object arg) { + if ((this.GetDriveMapsCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetDriveMapsCompleted(this, new GetDriveMapsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CreateMappedDrive", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public int CreateMappedDrive(string organizationId, string drive, string labelAs, string path) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CreateMappedDrive", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int CreateMappedDrive(string organizationId, string drive, string labelAs, string path) { object[] results = this.Invoke("CreateMappedDrive", new object[] { organizationId, drive, @@ -1574,35 +1372,30 @@ namespace WebsitePanel.Providers.HostedSolution path}); return ((int)(results[0])); } - + /// - public System.IAsyncResult BeginCreateMappedDrive(string organizationId, string drive, string labelAs, string path, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginCreateMappedDrive(string organizationId, string drive, string labelAs, string path, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("CreateMappedDrive", new object[] { organizationId, drive, labelAs, path}, callback, asyncState); } - + /// - public int EndCreateMappedDrive(System.IAsyncResult asyncResult) - { + public int EndCreateMappedDrive(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((int)(results[0])); } - + /// - public void CreateMappedDriveAsync(string organizationId, string drive, string labelAs, string path) - { + public void CreateMappedDriveAsync(string organizationId, string drive, string labelAs, string path) { this.CreateMappedDriveAsync(organizationId, drive, labelAs, path, null); } - + /// - public void CreateMappedDriveAsync(string organizationId, string drive, string labelAs, string path, object userState) - { - if ((this.CreateMappedDriveOperationCompleted == null)) - { + public void CreateMappedDriveAsync(string organizationId, string drive, string labelAs, string path, object userState) { + if ((this.CreateMappedDriveOperationCompleted == null)) { this.CreateMappedDriveOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateMappedDriveOperationCompleted); } this.InvokeAsync("CreateMappedDrive", new object[] { @@ -1611,203 +1404,171 @@ namespace WebsitePanel.Providers.HostedSolution labelAs, path}, this.CreateMappedDriveOperationCompleted, userState); } - - private void OnCreateMappedDriveOperationCompleted(object arg) - { - if ((this.CreateMappedDriveCompleted != null)) - { + + private void OnCreateMappedDriveOperationCompleted(object arg) { + if ((this.CreateMappedDriveCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.CreateMappedDriveCompleted(this, new CreateMappedDriveCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteMappedDrive", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void DeleteMappedDrive(string organizationId, string drive) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteMappedDrive", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void DeleteMappedDrive(string organizationId, string drive) { this.Invoke("DeleteMappedDrive", new object[] { organizationId, drive}); } - + /// - public System.IAsyncResult BeginDeleteMappedDrive(string organizationId, string drive, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginDeleteMappedDrive(string organizationId, string drive, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("DeleteMappedDrive", new object[] { organizationId, drive}, callback, asyncState); } - + /// - public void EndDeleteMappedDrive(System.IAsyncResult asyncResult) - { + public void EndDeleteMappedDrive(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void DeleteMappedDriveAsync(string organizationId, string drive) - { + public void DeleteMappedDriveAsync(string organizationId, string drive) { this.DeleteMappedDriveAsync(organizationId, drive, null); } - + /// - public void DeleteMappedDriveAsync(string organizationId, string drive, object userState) - { - if ((this.DeleteMappedDriveOperationCompleted == null)) - { + public void DeleteMappedDriveAsync(string organizationId, string drive, object userState) { + if ((this.DeleteMappedDriveOperationCompleted == null)) { this.DeleteMappedDriveOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteMappedDriveOperationCompleted); } this.InvokeAsync("DeleteMappedDrive", new object[] { organizationId, drive}, this.DeleteMappedDriveOperationCompleted, userState); } - - private void OnDeleteMappedDriveOperationCompleted(object arg) - { - if ((this.DeleteMappedDriveCompleted != null)) - { + + private void OnDeleteMappedDriveOperationCompleted(object arg) { + if ((this.DeleteMappedDriveCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.DeleteMappedDriveCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteMappedDriveByPath", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void DeleteMappedDriveByPath(string organizationId, string path) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteMappedDriveByPath", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void DeleteMappedDriveByPath(string organizationId, string path) { this.Invoke("DeleteMappedDriveByPath", new object[] { organizationId, path}); } - + /// - public System.IAsyncResult BeginDeleteMappedDriveByPath(string organizationId, string path, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginDeleteMappedDriveByPath(string organizationId, string path, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("DeleteMappedDriveByPath", new object[] { organizationId, path}, callback, asyncState); } - + /// - public void EndDeleteMappedDriveByPath(System.IAsyncResult asyncResult) - { + public void EndDeleteMappedDriveByPath(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void DeleteMappedDriveByPathAsync(string organizationId, string path) - { + public void DeleteMappedDriveByPathAsync(string organizationId, string path) { this.DeleteMappedDriveByPathAsync(organizationId, path, null); } - + /// - public void DeleteMappedDriveByPathAsync(string organizationId, string path, object userState) - { - if ((this.DeleteMappedDriveByPathOperationCompleted == null)) - { + public void DeleteMappedDriveByPathAsync(string organizationId, string path, object userState) { + if ((this.DeleteMappedDriveByPathOperationCompleted == null)) { this.DeleteMappedDriveByPathOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteMappedDriveByPathOperationCompleted); } this.InvokeAsync("DeleteMappedDriveByPath", new object[] { organizationId, path}, this.DeleteMappedDriveByPathOperationCompleted, userState); } - - private void OnDeleteMappedDriveByPathOperationCompleted(object arg) - { - if ((this.DeleteMappedDriveByPathCompleted != null)) - { + + private void OnDeleteMappedDriveByPathOperationCompleted(object arg) { + if ((this.DeleteMappedDriveByPathCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.DeleteMappedDriveByPathCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteMappedDrivesGPO", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void DeleteMappedDrivesGPO(string organizationId) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteMappedDrivesGPO", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void DeleteMappedDrivesGPO(string organizationId) { this.Invoke("DeleteMappedDrivesGPO", new object[] { organizationId}); } - + /// - public System.IAsyncResult BeginDeleteMappedDrivesGPO(string organizationId, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginDeleteMappedDrivesGPO(string organizationId, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("DeleteMappedDrivesGPO", new object[] { organizationId}, callback, asyncState); } - + /// - public void EndDeleteMappedDrivesGPO(System.IAsyncResult asyncResult) - { + public void EndDeleteMappedDrivesGPO(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void DeleteMappedDrivesGPOAsync(string organizationId) - { + public void DeleteMappedDrivesGPOAsync(string organizationId) { this.DeleteMappedDrivesGPOAsync(organizationId, null); } - + /// - public void DeleteMappedDrivesGPOAsync(string organizationId, object userState) - { - if ((this.DeleteMappedDrivesGPOOperationCompleted == null)) - { + public void DeleteMappedDrivesGPOAsync(string organizationId, object userState) { + if ((this.DeleteMappedDrivesGPOOperationCompleted == null)) { this.DeleteMappedDrivesGPOOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteMappedDrivesGPOOperationCompleted); } this.InvokeAsync("DeleteMappedDrivesGPO", new object[] { organizationId}, this.DeleteMappedDrivesGPOOperationCompleted, userState); } - - private void OnDeleteMappedDrivesGPOOperationCompleted(object arg) - { - if ((this.DeleteMappedDrivesGPOCompleted != null)) - { + + private void OnDeleteMappedDrivesGPOOperationCompleted(object arg) { + if ((this.DeleteMappedDrivesGPOCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.DeleteMappedDrivesGPOCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SetDriveMapsTargetingFilter", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void SetDriveMapsTargetingFilter(string organizationId, ExchangeAccount[] accounts, string folderName) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SetDriveMapsTargetingFilter", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void SetDriveMapsTargetingFilter(string organizationId, ExchangeAccount[] accounts, string folderName) { this.Invoke("SetDriveMapsTargetingFilter", new object[] { organizationId, accounts, folderName}); } - + /// - public System.IAsyncResult BeginSetDriveMapsTargetingFilter(string organizationId, ExchangeAccount[] accounts, string folderName, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginSetDriveMapsTargetingFilter(string organizationId, ExchangeAccount[] accounts, string folderName, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("SetDriveMapsTargetingFilter", new object[] { organizationId, accounts, folderName}, callback, asyncState); } - + /// - public void EndSetDriveMapsTargetingFilter(System.IAsyncResult asyncResult) - { + public void EndSetDriveMapsTargetingFilter(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void SetDriveMapsTargetingFilterAsync(string organizationId, ExchangeAccount[] accounts, string folderName) - { + public void SetDriveMapsTargetingFilterAsync(string organizationId, ExchangeAccount[] accounts, string folderName) { this.SetDriveMapsTargetingFilterAsync(organizationId, accounts, folderName, null); } - + /// - public void SetDriveMapsTargetingFilterAsync(string organizationId, ExchangeAccount[] accounts, string folderName, object userState) - { - if ((this.SetDriveMapsTargetingFilterOperationCompleted == null)) - { + public void SetDriveMapsTargetingFilterAsync(string organizationId, ExchangeAccount[] accounts, string folderName, object userState) { + if ((this.SetDriveMapsTargetingFilterOperationCompleted == null)) { this.SetDriveMapsTargetingFilterOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetDriveMapsTargetingFilterOperationCompleted); } this.InvokeAsync("SetDriveMapsTargetingFilter", new object[] { @@ -1815,53 +1576,45 @@ namespace WebsitePanel.Providers.HostedSolution accounts, folderName}, this.SetDriveMapsTargetingFilterOperationCompleted, userState); } - - private void OnSetDriveMapsTargetingFilterOperationCompleted(object arg) - { - if ((this.SetDriveMapsTargetingFilterCompleted != null)) - { + + private void OnSetDriveMapsTargetingFilterOperationCompleted(object arg) { + if ((this.SetDriveMapsTargetingFilterCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.SetDriveMapsTargetingFilterCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/ChangeDriveMapFolderPath", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void ChangeDriveMapFolderPath(string organizationId, string oldFolder, string newFolder) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/ChangeDriveMapFolderPath", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void ChangeDriveMapFolderPath(string organizationId, string oldFolder, string newFolder) { this.Invoke("ChangeDriveMapFolderPath", new object[] { organizationId, oldFolder, newFolder}); } - + /// - public System.IAsyncResult BeginChangeDriveMapFolderPath(string organizationId, string oldFolder, string newFolder, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginChangeDriveMapFolderPath(string organizationId, string oldFolder, string newFolder, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("ChangeDriveMapFolderPath", new object[] { organizationId, oldFolder, newFolder}, callback, asyncState); } - + /// - public void EndChangeDriveMapFolderPath(System.IAsyncResult asyncResult) - { + public void EndChangeDriveMapFolderPath(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void ChangeDriveMapFolderPathAsync(string organizationId, string oldFolder, string newFolder) - { + public void ChangeDriveMapFolderPathAsync(string organizationId, string oldFolder, string newFolder) { this.ChangeDriveMapFolderPathAsync(organizationId, oldFolder, newFolder, null); } - + /// - public void ChangeDriveMapFolderPathAsync(string organizationId, string oldFolder, string newFolder, object userState) - { - if ((this.ChangeDriveMapFolderPathOperationCompleted == null)) - { + public void ChangeDriveMapFolderPathAsync(string organizationId, string oldFolder, string newFolder, object userState) { + if ((this.ChangeDriveMapFolderPathOperationCompleted == null)) { this.ChangeDriveMapFolderPathOperationCompleted = new System.Threading.SendOrPostCallback(this.OnChangeDriveMapFolderPathOperationCompleted); } this.InvokeAsync("ChangeDriveMapFolderPath", new object[] { @@ -1869,418 +1622,442 @@ namespace WebsitePanel.Providers.HostedSolution oldFolder, newFolder}, this.ChangeDriveMapFolderPathOperationCompleted, userState); } - - private void OnChangeDriveMapFolderPathOperationCompleted(object arg) - { - if ((this.ChangeDriveMapFolderPathCompleted != null)) - { + + private void OnChangeDriveMapFolderPathOperationCompleted(object arg) { + if ((this.ChangeDriveMapFolderPathCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.ChangeDriveMapFolderPathCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - public new void CancelAsync(object userState) - { + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganizationUsersWithExpiredPassword", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public OrganizationUser[] GetOrganizationUsersWithExpiredPassword(string organizationId, int daysBeforeExpiration) { + object[] results = this.Invoke("GetOrganizationUsersWithExpiredPassword", new object[] { + organizationId, + daysBeforeExpiration}); + return ((OrganizationUser[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetOrganizationUsersWithExpiredPassword(string organizationId, int daysBeforeExpiration, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetOrganizationUsersWithExpiredPassword", new object[] { + organizationId, + daysBeforeExpiration}, callback, asyncState); + } + + /// + public OrganizationUser[] EndGetOrganizationUsersWithExpiredPassword(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((OrganizationUser[])(results[0])); + } + + /// + public void GetOrganizationUsersWithExpiredPasswordAsync(string organizationId, int daysBeforeExpiration) { + this.GetOrganizationUsersWithExpiredPasswordAsync(organizationId, daysBeforeExpiration, null); + } + + /// + public void GetOrganizationUsersWithExpiredPasswordAsync(string organizationId, int daysBeforeExpiration, object userState) { + if ((this.GetOrganizationUsersWithExpiredPasswordOperationCompleted == null)) { + this.GetOrganizationUsersWithExpiredPasswordOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetOrganizationUsersWithExpiredPasswordOperationCompleted); + } + this.InvokeAsync("GetOrganizationUsersWithExpiredPassword", new object[] { + organizationId, + daysBeforeExpiration}, this.GetOrganizationUsersWithExpiredPasswordOperationCompleted, userState); + } + + private void OnGetOrganizationUsersWithExpiredPasswordOperationCompleted(object arg) { + if ((this.GetOrganizationUsersWithExpiredPasswordCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetOrganizationUsersWithExpiredPasswordCompleted(this, new GetOrganizationUsersWithExpiredPasswordCompletedEventArgs(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.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void OrganizationExistsCompletedEventHandler(object sender, OrganizationExistsCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class OrganizationExistsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class OrganizationExistsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal OrganizationExistsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal OrganizationExistsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public bool Result - { - get - { + public bool Result { + get { this.RaiseExceptionIfNecessary(); return ((bool)(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void CreateOrganizationCompletedEventHandler(object sender, CreateOrganizationCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class CreateOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class CreateOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal CreateOrganizationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal CreateOrganizationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public Organization Result - { - get - { + public Organization Result { + get { this.RaiseExceptionIfNecessary(); return ((Organization)(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void DeleteOrganizationCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void CreateUserCompletedEventHandler(object sender, CreateUserCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class CreateUserCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class CreateUserCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal CreateUserCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal CreateUserCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public int Result - { - get - { + public int Result { + get { this.RaiseExceptionIfNecessary(); return ((int)(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void DisableUserCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void DeleteUserCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetUserGeneralSettingsCompletedEventHandler(object sender, GetUserGeneralSettingsCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetUserGeneralSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class GetUserGeneralSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal GetUserGeneralSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal GetUserGeneralSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public OrganizationUser Result - { - get - { + public OrganizationUser Result { + get { this.RaiseExceptionIfNecessary(); return ((OrganizationUser)(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void CreateSecurityGroupCompletedEventHandler(object sender, CreateSecurityGroupCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class CreateSecurityGroupCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class CreateSecurityGroupCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal CreateSecurityGroupCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal CreateSecurityGroupCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public int Result - { - get - { + public int Result { + get { this.RaiseExceptionIfNecessary(); return ((int)(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetSecurityGroupGeneralSettingsCompletedEventHandler(object sender, GetSecurityGroupGeneralSettingsCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetSecurityGroupGeneralSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class GetSecurityGroupGeneralSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal GetSecurityGroupGeneralSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal GetSecurityGroupGeneralSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public OrganizationSecurityGroup Result - { - get - { + public OrganizationSecurityGroup Result { + get { this.RaiseExceptionIfNecessary(); return ((OrganizationSecurityGroup)(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void DeleteSecurityGroupCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void SetSecurityGroupGeneralSettingsCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void AddObjectToSecurityGroupCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void DeleteObjectFromSecurityGroupCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void SetUserGeneralSettingsCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void SetUserPasswordCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void SetUserPrincipalNameCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void DeleteOrganizationDomainCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void CreateOrganizationDomainCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetPasswordPolicyCompletedEventHandler(object sender, GetPasswordPolicyCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetPasswordPolicyCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class GetPasswordPolicyCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal GetPasswordPolicyCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal GetPasswordPolicyCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public PasswordPolicyResult Result - { - get - { + public PasswordPolicyResult Result { + get { this.RaiseExceptionIfNecessary(); return ((PasswordPolicyResult)(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetSamAccountNameByUserPrincipalNameCompletedEventHandler(object sender, GetSamAccountNameByUserPrincipalNameCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetSamAccountNameByUserPrincipalNameCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class GetSamAccountNameByUserPrincipalNameCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal GetSamAccountNameByUserPrincipalNameCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal GetSamAccountNameByUserPrincipalNameCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public string Result - { - get - { + public string Result { + get { this.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void DoesSamAccountNameExistCompletedEventHandler(object sender, DoesSamAccountNameExistCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class DoesSamAccountNameExistCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class DoesSamAccountNameExistCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal DoesSamAccountNameExistCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal DoesSamAccountNameExistCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public bool Result - { - get - { + public bool Result { + get { this.RaiseExceptionIfNecessary(); return ((bool)(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetDriveMapsCompletedEventHandler(object sender, GetDriveMapsCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetDriveMapsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class GetDriveMapsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal GetDriveMapsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal GetDriveMapsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public MappedDrive[] Result - { - get - { + public MappedDrive[] Result { + get { this.RaiseExceptionIfNecessary(); return ((MappedDrive[])(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void CreateMappedDriveCompletedEventHandler(object sender, CreateMappedDriveCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class CreateMappedDriveCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class CreateMappedDriveCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal CreateMappedDriveCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal CreateMappedDriveCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public int Result - { - get - { + public int Result { + get { this.RaiseExceptionIfNecessary(); return ((int)(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void DeleteMappedDriveCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void DeleteMappedDriveByPathCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void DeleteMappedDrivesGPOCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void SetDriveMapsTargetingFilterCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void ChangeDriveMapFolderPathCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void GetOrganizationUsersWithExpiredPasswordCompletedEventHandler(object sender, GetOrganizationUsersWithExpiredPasswordCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetOrganizationUsersWithExpiredPasswordCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetOrganizationUsersWithExpiredPasswordCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public OrganizationUser[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((OrganizationUser[])(this.results[0])); + } + } + } } diff --git a/WebsitePanel/Sources/WebsitePanel.Server/Organizations.asmx.cs b/WebsitePanel/Sources/WebsitePanel.Server/Organizations.asmx.cs index 2b2abc5f..4cae8631 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/Organizations.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server/Organizations.asmx.cs @@ -27,6 +27,7 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using System; +using System.Collections.Generic; using System.ComponentModel; using System.Web.Services; using System.Web.Services.Protocols; @@ -254,5 +255,11 @@ namespace WebsitePanel.Server { Organization.ChangeDriveMapFolderPath(organizationId, oldFolder, newFolder); } + + [WebMethod, SoapHeader("settings")] + public List GetOrganizationUsersWithExpiredPassword(string organizationId, int daysBeforeExpiration) + { + return Organization.GetOrganizationUsersWithExpiredPassword(organizationId, daysBeforeExpiration); + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/ESModule_ControlsHierarchy.config b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/ESModule_ControlsHierarchy.config index 7ed16940..f79eefba 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/ESModule_ControlsHierarchy.config +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/ESModule_ControlsHierarchy.config @@ -13,6 +13,7 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config index ecbdc1f6..e3263482 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config @@ -471,6 +471,7 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx index cbff0b24..975a6a96 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx @@ -3345,7 +3345,6 @@ CRM 4/2011 - BlackBerry @@ -3377,7 +3376,7 @@ SharePoint Foundation Server - + SharePoint Server @@ -5711,4 +5710,7 @@ RDS User experience has been updated + + User password expiration notification + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SettingsUserPasswordExpirationLetter.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SettingsUserPasswordExpirationLetter.ascx.resx new file mode 100644 index 00000000..b8764bdc --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SettingsUserPasswordExpirationLetter.ascx.resx @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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: + + + Priority: + + + Subject: + + + Text Body: + + + Webdav portal reset URL: + + \ 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 2e02f4fe..1ea4b782 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 @@ -150,4 +150,7 @@ RDS Setup Letter + + User Password Expiration Letter + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUserGeneralSettings.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUserGeneralSettings.ascx.resx index bcbae1f8..ab9d05c4 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUserGeneralSettings.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUserGeneralSettings.ascx.resx @@ -255,4 +255,7 @@ User must change password at next logon + + Reset Password + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUserResetPassword.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUserResetPassword.ascx.resx new file mode 100644 index 00000000..521750a1 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUserResetPassword.ascx.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + Sent Password Reset Email + + + Email: + + + Reason: + + + Reset Password + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx index 0cdd7181..dad039a0 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx @@ -74,6 +74,8 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs index faf9723b..bde31fc9 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs @@ -435,5 +435,13 @@ namespace WebsitePanel.Portal.HostedSolution } + protected void btnResetUserPassword_Click(object sender, EventArgs e) + { + Response.Redirect(PortalUtils.EditUrl("ItemID", PanelRequest.ItemID.ToString(), + "user_reset_password", + "SpaceID=" + PanelSecurity.PackageId, + "Context=" + ((PanelRequest.Context == "Mailbox") ? "Mailbox" : "User"), + "AccountID=" + PanelRequest.AccountID)); + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.designer.cs index 555a2e6a..3ad5507c 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.designer.cs @@ -210,6 +210,15 @@ namespace WebsitePanel.Portal.HostedSolution { /// protected global::System.Web.UI.WebControls.ValidationSummary ValidationSummary2; + /// + /// btnResetUserPassword control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnResetUserPassword; + /// /// chkUserMustChangePassword control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserResetPassword.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserResetPassword.ascx new file mode 100644 index 00000000..b49be890 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserResetPassword.ascx @@ -0,0 +1,45 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="OrganizationUserResetPassword.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.OrganizationUserResetPassword" %> + +<%@ Register Src="../UserControls/ItemButtonPanel.ascx" TagName="ItemButtonPanel" TagPrefix="wsp" %> + + +
+
+
+
+
+
+
+ + + - + +
+ +
+ + + + + + + + + +
+ + + +
+ + +
+ +
+ +
+
+
+
+
+
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserResetPassword.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserResetPassword.ascx.cs new file mode 100644 index 00000000..7aa28e6f --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserResetPassword.ascx.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.Providers.HostedSolution; + +namespace WebsitePanel.Portal.ExchangeServer +{ + public partial class OrganizationUserResetPassword : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + BindSettings(); + } + } + + private void BindSettings() + { + OrganizationUser user = ES.Services.Organizations.GetUserGeneralSettings(PanelRequest.ItemID, + PanelRequest.AccountID); + + litDisplayName.Text = PortalAntiXSS.Encode(user.DisplayName); + + txtEmailAddress.Text = user.PrimaryEmailAddress; + } + + protected void btnResetPassoword_Click(object sender, EventArgs e) + { + if (!Page.IsValid) + { + return; + } + + Response.Redirect(PortalUtils.EditUrl("ItemID", PanelRequest.ItemID.ToString(), + (PanelRequest.Context == "Mailbox") ? "mailboxes" : "users", + "SpaceID=" + PanelSecurity.PackageId)); + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserResetPassword.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserResetPassword.ascx.designer.cs new file mode 100644 index 00000000..5b263a84 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserResetPassword.ascx.designer.cs @@ -0,0 +1,114 @@ +//------------------------------------------------------------------------------ +// +// 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.ExchangeServer { + + + public partial class OrganizationUserResetPassword { + + /// + /// Image1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image Image1; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// litDisplayName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litDisplayName; + + /// + /// 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; + + /// + /// locReason control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locReason; + + /// + /// txtReason control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtReason; + + /// + /// valReason control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valReason; + + /// + /// btnResetPassoword control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnResetPassoword; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/App_LocalResources/UserPasswordExpirationNotificationView.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/App_LocalResources/UserPasswordExpirationNotificationView.ascx.resx new file mode 100644 index 00000000..85c90909 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/App_LocalResources/UserPasswordExpirationNotificationView.ascx.resx @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/UserPasswordExpirationNotificationView.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/UserPasswordExpirationNotificationView.ascx new file mode 100644 index 00000000..54882d71 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/UserPasswordExpirationNotificationView.ascx @@ -0,0 +1,13 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UserPasswordExpirationNotificationView.ascx.cs" Inherits="WebsitePanel.Portal.ScheduleTaskControls.UserPasswordExpirationNotificationView" %> + + + + + + + +
+ + + +
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/UserPasswordExpirationNotificationView.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/UserPasswordExpirationNotificationView.ascx.cs new file mode 100644 index 00000000..dab296de --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/UserPasswordExpirationNotificationView.ascx.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.EnterpriseServer; +using WebsitePanel.Portal.UserControls.ScheduleTaskView; + +namespace WebsitePanel.Portal.ScheduleTaskControls +{ + public partial class UserPasswordExpirationNotificationView : EmptyView + { + private static readonly string DaysBeforeParameter = "DAYS_BEFORE_EXPIRATION"; + + protected void Page_Load(object sender, EventArgs e) + { + + } + + /// + /// Sets scheduler task parameters on view. + /// + /// Parameters list to be set on view. + public override void SetParameters(ScheduleTaskParameterInfo[] parameters) + { + base.SetParameters(parameters); + + this.SetParameter(this.txtDaysBeforeNotify, DaysBeforeParameter); + } + + /// + /// Gets scheduler task parameters from view. + /// + /// Parameters list filled from view. + public override ScheduleTaskParameterInfo[] GetParameters() + { + ScheduleTaskParameterInfo daysBefore = this.GetParameter(this.txtDaysBeforeNotify, DaysBeforeParameter); + + return new[] { daysBefore }; + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/UserPasswordExpirationNotificationView.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/UserPasswordExpirationNotificationView.ascx.designer.cs new file mode 100644 index 00000000..cb733b60 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/UserPasswordExpirationNotificationView.ascx.designer.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// +// 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.ScheduleTaskControls { + + + public partial class UserPasswordExpirationNotificationView { + + /// + /// lblDayBeforeNotify control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblDayBeforeNotify; + + /// + /// txtDaysBeforeNotify control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtDaysBeforeNotify; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordExpirationLetter.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordExpirationLetter.ascx new file mode 100644 index 00000000..a041b140 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordExpirationLetter.ascx @@ -0,0 +1,49 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SettingsUserPasswordExpirationLetter.ascx.cs" Inherits="WebsitePanel.Portal.SettingsUserPasswordExpirationLetter" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + High + Normal + Low + +
+
+


+


+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordExpirationLetter.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordExpirationLetter.ascx.cs new file mode 100644 index 00000000..189e66e7 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordExpirationLetter.ascx.cs @@ -0,0 +1,35 @@ +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 SettingsUserPasswordExpirationLetter : WebsitePanelControlBase, IUserSettingsEditorControl + { + public void BindSettings(UserSettings settings) + { + txtFrom.Text = settings["From"]; + txtWebDavPortalResetUrl.Text = settings["WebDavPortalResetUrl"]; + txtSubject.Text = settings["Subject"]; + Utils.SelectListItem(ddlPriority, settings["Priority"]); + txtHtmlBody.Text = settings["HtmlBody"]; + txtTextBody.Text = settings["TextBody"]; + txtLogoUrl.Text = settings["LogoUrl"]; + } + + public void SaveSettings(UserSettings settings) + { + settings["From"] = txtFrom.Text; + settings["WebDavPortalResetUrl"] = txtWebDavPortalResetUrl.Text; + settings["Subject"] = txtSubject.Text; + settings["Priority"] = ddlPriority.SelectedValue; + settings["HtmlBody"] = txtHtmlBody.Text; + settings["TextBody"] = txtTextBody.Text; + settings["LogoUrl"] = txtLogoUrl.Text; + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordExpirationLetter.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordExpirationLetter.ascx.designer.cs new file mode 100644 index 00000000..e8bba7b9 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordExpirationLetter.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 SettingsUserPasswordExpirationLetter { + + /// + /// 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; + + /// + /// lblWebDavPortalResetUrl control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblWebDavPortalResetUrl; + + /// + /// txtWebDavPortalResetUrl control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtWebDavPortalResetUrl; + + /// + /// 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; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountMailTemplateSettings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountMailTemplateSettings.ascx index 37f5ca86..9df60dfc 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountMailTemplateSettings.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountMailTemplateSettings.ascx @@ -42,6 +42,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 b326b1ce..44f84dd2 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountMailTemplateSettings.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountMailTemplateSettings.ascx.designer.cs @@ -102,6 +102,15 @@ namespace WebsitePanel.Portal { /// protected global::System.Web.UI.WebControls.HyperLink lnkRdsSetupLetter; + /// + /// lnkUserPasswordExpirationLetter control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HyperLink lnkUserPasswordExpirationLetter; + /// /// btnCancel control. /// 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 ed34810f..e7326a7d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj @@ -244,6 +244,13 @@ OrganizationDeletedUserGeneralSettings.ascx ASPXCodeBehind + + OrganizationUserResetPassword.ascx + ASPXCodeBehind + + + OrganizationUserResetPassword.ascx + EnterpriseStorageEditFolderTabs.ascx ASPXCodeBehind @@ -265,6 +272,20 @@ HyperV2012R2_Settings.ascx + + UserPasswordExpirationNotificationView.ascx + ASPXCodeBehind + + + UserPasswordExpirationNotificationView.ascx + + + SettingsUserPasswordExpirationLetter.ascx + ASPXCodeBehind + + + SettingsUserPasswordExpirationLetter.ascx + HyperV2012R2_Create.ascx ASPXCodeBehind @@ -4536,9 +4557,12 @@ + + + @@ -4596,6 +4620,8 @@ Designer + + @@ -4791,6 +4817,7 @@ + From e320b4c79e97aa1b727e926ea93b02ffdf42b0fd Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Fri, 3 Apr 2015 01:31:01 -0700 Subject: [PATCH 02/38] pasword expiration scheduler + email tempaltes fixes + accesst oken stored procedures added --- WebsitePanel/Database/update_db.sql | 94 +++++- .../HostedSolution/AccessToken.cs | 14 + .../HostedSolution/AccessTokenTypes.cs | 7 + .../System/SystemSettings.cs | 1 + .../WebsitePanel.EnterpriseServer.Base.csproj | 2 + .../OrganizationProxy.cs | 300 ++++++++++-------- .../Common/Extensions/UriExtensions.cs | 13 + .../Data/DataProvider.cs | 47 +++ .../HostedSolution/OrganizationController.cs | 137 ++++++-- .../UserPasswordExpirationNotificationTask.cs | 10 +- .../WebsitePanel.EnterpriseServer.Code.csproj | 1 + .../esOrganizations.asmx.cs | 5 + .../SystemSettings.ascx.resx | 6 + .../OrganizationUserResetPassword.ascx.cs | 2 + .../SettingsUserPasswordExpirationLetter.ascx | 5 - ...ttingsUserPasswordExpirationLetter.ascx.cs | 2 - ...rPasswordExpirationLetter.ascx.designer.cs | 18 -- .../WebsitePanel/SystemSettings.ascx | 10 + .../WebsitePanel/SystemSettings.ascx.cs | 13 + .../SystemSettings.ascx.designer.cs | 36 +++ 20 files changed, 530 insertions(+), 193 deletions(-) create mode 100644 WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/HostedSolution/AccessToken.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/HostedSolution/AccessTokenTypes.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Common/Extensions/UriExtensions.cs diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index 910ae546..6e66d880 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -9489,12 +9489,6 @@ GO -- USER PASSWORD EXPIRATION EMAIL TEMPLATE - -IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordExpirationLetter' AND [PropertyName]= N'WebDavPortalResetUrl' ) -BEGIN -INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordExpirationLetter', N'WebDavPortalResetUrl', N'http://webdav.virtuworks.net/') -END -GO IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordExpirationLetter' AND [PropertyName]= N'From' ) BEGIN INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordExpirationLetter', N'From', N'support@HostingCompany.com') @@ -9603,3 +9597,91 @@ ELSE UPDATE [dbo].[UserSettings] SET [PropertyValue] = @UserPasswordExpirationLetterTextBody WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordExpirationLetter' AND [PropertyName]= N'TextBody' GO + +-- ORGANIZATION USER PASSWORD RESET TOKENS + + +IF EXISTS (SELECT * FROM SYS.TABLES WHERE name = 'AccessTokens') +DROP TABLE AccessTokens +GO +CREATE TABLE AccessTokens +( + ID INT IDENTITY(1,1) NOT NULL PRIMARY KEY, + AccessTokenGuid UNIQUEIDENTIFIER NOT NULL, + ExpirationDate DATETIME NOT NULL, + AccountID INT NOT NULL , + ItemId INT NOT NULL, + TokenType INT NOT NULL +) +GO + +ALTER TABLE [dbo].[AccessTokens] WITH CHECK ADD CONSTRAINT [FK_AccessTokens_UserId] FOREIGN KEY([AccountID]) +REFERENCES [dbo].[ExchangeAccounts] ([AccountID]) +ON DELETE CASCADE +GO + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'AddAccessToken') +DROP PROCEDURE AddAccessToken +GO +CREATE PROCEDURE [dbo].[AddAccessToken] +( + @TokenID INT OUTPUT, + @AccessToken UNIQUEIDENTIFIER, + @ExpirationDate DATETIME, + @AccountID INT, + @ItemId INT, + @TokenType INT +) +AS +INSERT INTO AccessTokens +( + AccessTokenGuid, + ExpirationDate, + AccountID , + ItemId, + TokenType +) +VALUES +( + @AccessToken , + @ExpirationDate , + @AccountID, + @ItemId, + @TokenType +) + +SET @TokenID = SCOPE_IDENTITY() + +RETURN +GO + + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'DeleteExpiredAccessTokenTokens') +DROP PROCEDURE DeleteExpiredAccessTokenTokens +GO +CREATE PROCEDURE [dbo].[DeleteExpiredAccessTokenTokens] +AS +DELETE FROM AccessTokens +WHERE ExpirationDate < getdate() +GO + + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetAccessTokenByAccessToken') +DROP PROCEDURE GetAccessTokenByAccessToken +GO +CREATE PROCEDURE [dbo].[GetAccessTokenByAccessToken] +( + @AccessToken UNIQUEIDENTIFIER, + @TokenType INT +) +AS +SELECT + ID , + AccessTokenGuid, + ExpirationDate, + AccountID, + ItemId, + TokenType + FROM AccessTokens + Where AccessTokenGuid = @AccessToken AND ExpirationDate > getdate() AND TokenType = @TokenType +GO \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/HostedSolution/AccessToken.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/HostedSolution/AccessToken.cs new file mode 100644 index 00000000..cbb4bf8b --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/HostedSolution/AccessToken.cs @@ -0,0 +1,14 @@ +using System; + +namespace WebsitePanel.EnterpriseServer.Base.HostedSolution +{ + public class AccessToken + { + public int Id { get; set; } + public Guid AccessTokenGuid { get; set; } + public DateTime ExpirationDate { get; set; } + public int AccountId { get; set; } + public int ItemId { get; set; } + public AccessTokenTypes Type { get; set; } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/HostedSolution/AccessTokenTypes.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/HostedSolution/AccessTokenTypes.cs new file mode 100644 index 00000000..059e43d5 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/HostedSolution/AccessTokenTypes.cs @@ -0,0 +1,7 @@ +namespace WebsitePanel.EnterpriseServer.Base.HostedSolution +{ + public enum AccessTokenTypes + { + PasswrodReset = 1 + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/System/SystemSettings.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/System/SystemSettings.cs index 542a611c..89033a84 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/System/SystemSettings.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/System/SystemSettings.cs @@ -45,6 +45,7 @@ namespace WebsitePanel.EnterpriseServer public const string FILEMANAGER_SETTINGS = "FileManagerSettings"; public const string PACKAGE_DISPLAY_SETTINGS = "PackageDisplaySettings"; public const string RDS_SETTINGS = "RdsSettings"; + public const string WEBDAV_PORTAL_SETTINGS = "WebdavPortalSettings"; // key to access to wpi main & custom feed in wpi settings public const string WPI_MAIN_FEED_KEY = "WpiMainFeedUrl"; diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/WebsitePanel.EnterpriseServer.Base.csproj b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/WebsitePanel.EnterpriseServer.Base.csproj index 9f9c3763..7deb1d4d 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/WebsitePanel.EnterpriseServer.Base.csproj +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/WebsitePanel.EnterpriseServer.Base.csproj @@ -116,10 +116,12 @@ + + diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs index 02682edb..92580b04 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs @@ -1,41 +1,7 @@ -// Copyright (c) 2015, Outercurve Foundation. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// - Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// - Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// - Neither the name of the Outercurve Foundation nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using WebsitePanel.Providers; -using WebsitePanel.Providers.Common; -using WebsitePanel.Providers.ResultObjects; -using WebsitePanel.Providers.HostedSolution; -using WebsitePanel.EnterpriseServer.Base.HostedSolution; - //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.5466 +// Runtime Version:2.0.50727.7905 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -43,8 +9,15 @@ using WebsitePanel.EnterpriseServer.Base.HostedSolution; //------------------------------------------------------------------------------ // -// This source code was auto-generated by wsdl, Version=2.0.50727.42. +// This source code was auto-generated by wsdl, Version=2.0.50727.3038. // + +using WebsitePanel.Providers; +using WebsitePanel.Providers.Common; +using WebsitePanel.Providers.ResultObjects; +using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.EnterpriseServer.Base.HostedSolution; + namespace WebsitePanel.EnterpriseServer.HostedSolution { using System.Xml.Serialization; using System.Web.Services; @@ -56,7 +29,7 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Web.Services.WebServiceBindingAttribute(Name="esOrganizationsSoap", Namespace="http://tempuri.org/")] @@ -129,6 +102,8 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { private System.Threading.SendOrPostCallback GetPasswordPolicyOperationCompleted; + private System.Threading.SendOrPostCallback SendResetUserPasswordEmailOperationCompleted; + private System.Threading.SendOrPostCallback CreateSecurityGroupOperationCompleted; private System.Threading.SendOrPostCallback GetSecurityGroupGeneralSettingsOperationCompleted; @@ -269,6 +244,9 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { /// public event GetPasswordPolicyCompletedEventHandler GetPasswordPolicyCompleted; + /// + public event SendResetUserPasswordEmailCompletedEventHandler SendResetUserPasswordEmailCompleted; + /// public event CreateSecurityGroupCompletedEventHandler CreateSecurityGroupCompleted; @@ -2097,6 +2075,54 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } } + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SendResetUserPasswordEmail", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void SendResetUserPasswordEmail(int itemId, int accountId, string reason, string mailTo) { + this.Invoke("SendResetUserPasswordEmail", new object[] { + itemId, + accountId, + reason, + mailTo}); + } + + /// + public System.IAsyncResult BeginSendResetUserPasswordEmail(int itemId, int accountId, string reason, string mailTo, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("SendResetUserPasswordEmail", new object[] { + itemId, + accountId, + reason, + mailTo}, callback, asyncState); + } + + /// + public void EndSendResetUserPasswordEmail(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void SendResetUserPasswordEmailAsync(int itemId, int accountId, string reason, string mailTo) { + this.SendResetUserPasswordEmailAsync(itemId, accountId, reason, mailTo, null); + } + + /// + public void SendResetUserPasswordEmailAsync(int itemId, int accountId, string reason, string mailTo, object userState) { + if ((this.SendResetUserPasswordEmailOperationCompleted == null)) { + this.SendResetUserPasswordEmailOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSendResetUserPasswordEmailOperationCompleted); + } + this.InvokeAsync("SendResetUserPasswordEmail", new object[] { + itemId, + accountId, + reason, + mailTo}, this.SendResetUserPasswordEmailOperationCompleted, userState); + } + + private void OnSendResetUserPasswordEmailOperationCompleted(object arg) { + if ((this.SendResetUserPasswordEmailCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.SendResetUserPasswordEmailCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CreateSecurityGroup", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] public int CreateSecurityGroup(int itemId, string displayName) { @@ -2911,11 +2937,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void CheckOrgIdExistsCompletedEventHandler(object sender, CheckOrgIdExistsCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class CheckOrgIdExistsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -2937,11 +2963,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void CreateOrganizationCompletedEventHandler(object sender, CreateOrganizationCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class CreateOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -2963,11 +2989,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetRawOrganizationsPagedCompletedEventHandler(object sender, GetRawOrganizationsPagedCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class GetRawOrganizationsPagedCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -2989,11 +3015,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetOrganizationsCompletedEventHandler(object sender, GetOrganizationsCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class GetOrganizationsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -3015,11 +3041,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetOrganizationByIdCompletedEventHandler(object sender, GetOrganizationByIdCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class GetOrganizationByIdCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -3041,11 +3067,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetOrganizationUserSummuryLetterCompletedEventHandler(object sender, GetOrganizationUserSummuryLetterCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class GetOrganizationUserSummuryLetterCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -3067,11 +3093,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void SendOrganizationUserSummuryLetterCompletedEventHandler(object sender, SendOrganizationUserSummuryLetterCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class SendOrganizationUserSummuryLetterCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -3093,11 +3119,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void DeleteOrganizationCompletedEventHandler(object sender, DeleteOrganizationCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class DeleteOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -3119,11 +3145,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetOrganizationStatisticsCompletedEventHandler(object sender, GetOrganizationStatisticsCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class GetOrganizationStatisticsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -3145,11 +3171,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetOrganizationStatisticsByOrganizationCompletedEventHandler(object sender, GetOrganizationStatisticsByOrganizationCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class GetOrganizationStatisticsByOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -3171,11 +3197,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetOrganizationCompletedEventHandler(object sender, GetOrganizationCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class GetOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -3197,11 +3223,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetAccountIdByUserPrincipalNameCompletedEventHandler(object sender, GetAccountIdByUserPrincipalNameCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class GetAccountIdByUserPrincipalNameCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -3223,15 +3249,15 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void SetDefaultOrganizationCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void AddOrganizationDomainCompletedEventHandler(object sender, AddOrganizationDomainCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class AddOrganizationDomainCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -3253,11 +3279,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void ChangeOrganizationDomainTypeCompletedEventHandler(object sender, ChangeOrganizationDomainTypeCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class ChangeOrganizationDomainTypeCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -3279,11 +3305,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetOrganizationDomainsCompletedEventHandler(object sender, GetOrganizationDomainsCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class GetOrganizationDomainsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -3305,11 +3331,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void DeleteOrganizationDomainCompletedEventHandler(object sender, DeleteOrganizationDomainCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class DeleteOrganizationDomainCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -3331,11 +3357,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void SetOrganizationDefaultDomainCompletedEventHandler(object sender, SetOrganizationDefaultDomainCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class SetOrganizationDefaultDomainCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -3357,11 +3383,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetOrganizationObjectsByDomainCompletedEventHandler(object sender, GetOrganizationObjectsByDomainCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class GetOrganizationObjectsByDomainCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -3383,11 +3409,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void CheckDomainUsedByHostedOrganizationCompletedEventHandler(object sender, CheckDomainUsedByHostedOrganizationCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class CheckDomainUsedByHostedOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -3409,11 +3435,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void CreateUserCompletedEventHandler(object sender, CreateUserCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class CreateUserCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -3435,11 +3461,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void ImportUserCompletedEventHandler(object sender, ImportUserCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class ImportUserCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -3461,11 +3487,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetOrganizationDeletedUsersPagedCompletedEventHandler(object sender, GetOrganizationDeletedUsersPagedCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class GetOrganizationDeletedUsersPagedCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -3487,11 +3513,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetOrganizationUsersPagedCompletedEventHandler(object sender, GetOrganizationUsersPagedCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class GetOrganizationUsersPagedCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -3513,11 +3539,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetUserGeneralSettingsCompletedEventHandler(object sender, GetUserGeneralSettingsCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class GetUserGeneralSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -3539,11 +3565,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void SetUserGeneralSettingsCompletedEventHandler(object sender, SetUserGeneralSettingsCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class SetUserGeneralSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -3565,11 +3591,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void SetUserPrincipalNameCompletedEventHandler(object sender, SetUserPrincipalNameCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class SetUserPrincipalNameCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -3591,11 +3617,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void SetUserPasswordCompletedEventHandler(object sender, SetUserPasswordCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class SetUserPasswordCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -3617,11 +3643,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void SearchAccountsCompletedEventHandler(object sender, SearchAccountsCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class SearchAccountsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -3643,11 +3669,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void SetDeletedUserCompletedEventHandler(object sender, SetDeletedUserCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class SetDeletedUserCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -3669,11 +3695,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetArchiveFileBinaryChunkCompletedEventHandler(object sender, GetArchiveFileBinaryChunkCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class GetArchiveFileBinaryChunkCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -3695,11 +3721,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void DeleteUserCompletedEventHandler(object sender, DeleteUserCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class DeleteUserCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -3721,11 +3747,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetPasswordPolicyCompletedEventHandler(object sender, GetPasswordPolicyCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class GetPasswordPolicyCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -3747,11 +3773,15 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void SendResetUserPasswordEmailCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void CreateSecurityGroupCompletedEventHandler(object sender, CreateSecurityGroupCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class CreateSecurityGroupCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -3773,11 +3803,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetSecurityGroupGeneralSettingsCompletedEventHandler(object sender, GetSecurityGroupGeneralSettingsCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class GetSecurityGroupGeneralSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -3799,11 +3829,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void DeleteSecurityGroupCompletedEventHandler(object sender, DeleteSecurityGroupCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class DeleteSecurityGroupCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -3825,11 +3855,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void SetSecurityGroupGeneralSettingsCompletedEventHandler(object sender, SetSecurityGroupGeneralSettingsCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class SetSecurityGroupGeneralSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -3851,11 +3881,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetOrganizationSecurityGroupsPagedCompletedEventHandler(object sender, GetOrganizationSecurityGroupsPagedCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class GetOrganizationSecurityGroupsPagedCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -3877,11 +3907,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void AddObjectToSecurityGroupCompletedEventHandler(object sender, AddObjectToSecurityGroupCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class AddObjectToSecurityGroupCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -3903,11 +3933,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void DeleteObjectFromSecurityGroupCompletedEventHandler(object sender, DeleteObjectFromSecurityGroupCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class DeleteObjectFromSecurityGroupCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -3929,11 +3959,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetSecurityGroupsByMemberCompletedEventHandler(object sender, GetSecurityGroupsByMemberCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class GetSecurityGroupsByMemberCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -3955,11 +3985,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void SearchOrganizationAccountsCompletedEventHandler(object sender, SearchOrganizationAccountsCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class SearchOrganizationAccountsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -3981,11 +4011,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetAdditionalGroupsCompletedEventHandler(object sender, GetAdditionalGroupsCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class GetAdditionalGroupsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -4007,19 +4037,19 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void UpdateAdditionalGroupCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void DeleteAdditionalGroupCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void AddAdditionalGroupCompletedEventHandler(object sender, AddAdditionalGroupCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class AddAdditionalGroupCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -4041,11 +4071,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetSupportServiceLevelsCompletedEventHandler(object sender, GetSupportServiceLevelsCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class GetSupportServiceLevelsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -4067,15 +4097,15 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [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.42")] + [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.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class DeleteSupportServiceLevelCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -4097,11 +4127,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void AddSupportServiceLevelCompletedEventHandler(object sender, AddSupportServiceLevelCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class AddSupportServiceLevelCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { @@ -4123,11 +4153,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetSupportServiceLevelCompletedEventHandler(object sender, GetSupportServiceLevelCompletedEventArgs e); /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] public partial class GetSupportServiceLevelCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Common/Extensions/UriExtensions.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Common/Extensions/UriExtensions.cs new file mode 100644 index 00000000..2ec58ede --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Common/Extensions/UriExtensions.cs @@ -0,0 +1,13 @@ +using System; +using System.Linq; + +namespace WebsitePanel.EnterpriseServer.Extensions +{ + public static class UriExtensions + { + public static Uri Append(this Uri uri, params string[] paths) + { + return new Uri(paths.Aggregate(uri.AbsoluteUri, (current, path) => string.Format("{0}/{1}", current.TrimEnd('/'), path.TrimStart('/')))); + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs index 1ed10655..c7bff6f7 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs @@ -31,6 +31,7 @@ using System.Configuration; using System.Data; using System.Data.SqlClient; using System.Text.RegularExpressions; +using WebsitePanel.EnterpriseServer.Base.HostedSolution; using WebsitePanel.Providers.HostedSolution; using Microsoft.ApplicationBlocks.Data; using System.Collections.Generic; @@ -3189,6 +3190,52 @@ namespace WebsitePanel.EnterpriseServer #region Organizations + public static int AddAccessToken(AccessToken token) + { + return AddAccessToken(token.AccessTokenGuid, token.AccountId, token.ItemId, token.ExpirationDate, token.Type); + } + + public static int AddAccessToken(Guid accessToken, int accountId, int itemId, DateTime expirationDate, AccessTokenTypes type) + { + SqlParameter prmId = new SqlParameter("@TokenID", SqlDbType.Int); + prmId.Direction = ParameterDirection.Output; + + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "AddAccessToken", + prmId, + new SqlParameter("@AccessToken", accessToken), + new SqlParameter("@ExpirationDate", expirationDate), + new SqlParameter("@AccountID", accountId), + new SqlParameter("@ItemId", itemId), + new SqlParameter("@TokenType", (int)type) + ); + + // read identity + return Convert.ToInt32(prmId.Value); + } + + public static void DeleteExpiredAccessTokens() + { + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "DeleteExpiredAccessTokenTokens" + ); + } + + public static IDataReader GetAccessTokenByAccessToken(Guid accessToken, AccessTokenTypes type) + { + return SqlHelper.ExecuteReader( + ConnectionString, + CommandType.StoredProcedure, + "GetAccessTokenByAccessToken", + new SqlParameter("@AccessToken", accessToken), + new SqlParameter("@TokenType", type) + ); + } + public static int AddOrganizationDeletedUser(int accountId, int originAT, string storagePath, string folderName, string fileName, DateTime expirationDate) { SqlParameter outParam = new SqlParameter("@ID", SqlDbType.Int); diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs index 61590314..499f9bfc 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs @@ -35,6 +35,7 @@ using System.Net.Mail; using System.Text; using WebsitePanel.EnterpriseServer.Code.HostedSolution; using WebsitePanel.EnterpriseServer.Code.SharePoint; +using WebsitePanel.EnterpriseServer.Extensions; using WebsitePanel.Providers; using WebsitePanel.Providers.HostedSolution; using WebsitePanel.Providers.ResultObjects; @@ -1520,38 +1521,130 @@ namespace WebsitePanel.EnterpriseServer return expiredUsersDb; } - public static void SendResetUserPasswordEmail(UserInfo owner, OrganizationUser user, string mailTo, string logoUrl) + /// + /// Send reset user password email + /// + /// Organization Id + /// User Id + /// Reason why reset email is sent. + /// Optional, if null accountID user PrimaryEmailAddress will be used + public static void SendResetUserPasswordEmail(int itemId, int accountId, string reason, string mailTo = null) { - UserSettings settings = UserController.GetUserSettings(owner.UserId, UserSettings.USER_PASSWORD_EXPIRATION_LETTER); + // load organization + Organization org = GetOrganization(itemId); - if (string.IsNullOrEmpty(logoUrl)) + if (org == null) { - logoUrl = settings["LogoUrl"]; + throw new Exception(string.Format("Organization not found (ItemId = {0})", itemId)); } - string from = settings["From"]; + UserInfo owner = PackageController.GetPackageOwner(org.PackageId); + OrganizationUser user = OrganizationController.GetAccount(itemId, accountId); - string subject = settings["Subject"]; - string body = owner.HtmlMail ? settings["HtmlBody"] : settings["TextBody"]; - bool isHtml = owner.HtmlMail; - - MailPriority priority = MailPriority.Normal; - - if (!String.IsNullOrEmpty(settings["Priority"])) + if (string.IsNullOrEmpty(mailTo)) { - priority = (MailPriority)Enum.Parse(typeof(MailPriority), settings["Priority"], true); + mailTo = user.PrimaryEmailAddress; } - Hashtable items = new Hashtable(); + SendResetUserPasswordEmail(owner, user, mailTo, reason, string.Empty); + } - items["user"] = user; - items["logoUrl"] = logoUrl; - items["passwordResetLink"] = "reset link"; + public static void SendResetUserPasswordEmail(UserInfo owner, OrganizationUser user, string reason, string mailTo, string logoUrl) + { + UserSettings settings = UserController.GetUserSettings(owner.UserId, + UserSettings.USER_PASSWORD_EXPIRATION_LETTER); - body = PackageController.EvaluateTemplate(body, items); + TaskManager.StartTask("ORGANIZATION", "SEND_PASSWORD_RESET_EMAIL", user.ItemId); - // send mail message - //MailHelper.SendMessage(from, mailTo, string.Empty, subject, body, priority, isHtml); + try + { + if (string.IsNullOrEmpty(logoUrl)) + { + logoUrl = settings["LogoUrl"]; + } + + string from = settings["From"]; + + string subject = settings["Subject"]; + string body = owner.HtmlMail ? settings["HtmlBody"] : settings["TextBody"]; + bool isHtml = owner.HtmlMail; + + MailPriority priority = MailPriority.Normal; + + if (!String.IsNullOrEmpty(settings["Priority"])) + { + priority = (MailPriority) Enum.Parse(typeof (MailPriority), settings["Priority"], true); + } + + Hashtable items = new Hashtable(); + + items["user"] = user; + items["logoUrl"] = logoUrl; + items["passwordResetLink"] = GenerateUserPasswordResetLink(user.ItemId, user.AccountId); + + body = PackageController.EvaluateTemplate(body, items); + + TaskManager.Write("Organization ID : " + user.ItemId); + TaskManager.Write("Account : " + user.DisplayName); + TaskManager.Write("Reason : " + reason); + TaskManager.Write("MailTo : " + mailTo); + + // send mail message + //MailHelper.SendMessage(from, mailTo, string.Empty, subject, body, priority, isHtml); + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + public static AccessToken GetAccessToken(Guid accessToken, AccessTokenTypes type) + { + return ObjectUtils.FillObjectFromDataReader(DataProvider.GetAccessTokenByAccessToken(accessToken, type)); + } + + public static void DeleteAllExpiredTokens() + { + DataProvider.DeleteExpiredAccessTokens(); + } + + private static string GenerateUserPasswordResetLink(int itemId, int accountId) + { + string passwordResetUrlFormat = "account/password-reset"; + + var settings = SystemController.GetSystemSettings(SystemSettings.WEBDAV_PORTAL_SETTINGS); + + if (settings == null) + { + throw new Exception("Webdav portal system settings are not set"); + } + + var webdavPortalUrl = new Uri(settings["WebdavPortalUrl"]); + + var token = CreateAccessToken(itemId, accountId, AccessTokenTypes.PasswrodReset); + + return webdavPortalUrl.Append(passwordResetUrlFormat) + .Append(token.AccessTokenGuid.ToString("n")).ToString(); + } + + private static AccessToken CreateAccessToken(int itemId, int accountId, AccessTokenTypes type) + { + var token = new AccessToken + { + AccessTokenGuid = Guid.NewGuid(), + ItemId = itemId, + AccountId = accountId, + Type = type, + ExpirationDate = DateTime.Now.AddHours(12) + }; + + token.Id = DataProvider.AddAccessToken(token); + + return token; } private static bool EmailAddressExists(string emailAddress) @@ -2288,7 +2381,7 @@ namespace WebsitePanel.EnterpriseServer #endregion // place log record - TaskManager.StartTask("ORGANIZATION", "GET_USER_GENERAL", itemId); + //TaskManager.StartTask("ORGANIZATION", "GET_USER_GENERAL", itemId); OrganizationUser account = null; Organization org = null; @@ -2331,7 +2424,7 @@ namespace WebsitePanel.EnterpriseServer catch { } finally { - TaskManager.CompleteTask(); + //TaskManager.CompleteTask(); } return (account); diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SchedulerTasks/UserPasswordExpirationNotificationTask.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SchedulerTasks/UserPasswordExpirationNotificationTask.cs index debd1ee4..afc3b575 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SchedulerTasks/UserPasswordExpirationNotificationTask.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SchedulerTasks/UserPasswordExpirationNotificationTask.cs @@ -9,8 +9,6 @@ namespace WebsitePanel.EnterpriseServer { public class UserPasswordExpirationNotificationTask : SchedulerTask { - private static readonly string TaskId = "SCHEDULE_TASK_DOMAIN_EXPIRATION"; - // Input parameters: private static readonly string DaysBeforeNotify = "DAYS_BEFORE_EXPIRATION"; @@ -27,6 +25,8 @@ namespace WebsitePanel.EnterpriseServer return; } + OrganizationController.DeleteAllExpiredTokens(); + var owner = UserController.GetUser(topTask.EffectiveUserId); var packages = PackageController.GetMyPackages(topTask.EffectiveUserId); @@ -41,15 +41,15 @@ namespace WebsitePanel.EnterpriseServer foreach (var user in usersWithExpiredPasswords) { + user.ItemId = organization.Id; + if (string.IsNullOrEmpty(user.PrimaryEmailAddress)) { TaskManager.WriteWarning(string.Format("Unable to send email to {0} user (organization: {1}), user primary email address is not set.", user.DisplayName, organization.OrganizationId)); continue; } - TaskManager.Write(string.Format("Email sent to {0} user (organization: {1}).", user.DisplayName, organization.OrganizationId)); - - OrganizationController.SendResetUserPasswordEmail(owner, user, user.PrimaryEmailAddress, string.Empty); + OrganizationController.SendResetUserPasswordEmail(owner, user, "Scheduler Password Expiration Notification", user.PrimaryEmailAddress, string.Empty); } } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/WebsitePanel.EnterpriseServer.Code.csproj b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/WebsitePanel.EnterpriseServer.Code.csproj index cc5a9f03..014a1d07 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/WebsitePanel.EnterpriseServer.Code.csproj +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/WebsitePanel.EnterpriseServer.Code.csproj @@ -75,6 +75,7 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs index 6db1e5f2..6352e52b 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs @@ -280,6 +280,11 @@ namespace WebsitePanel.EnterpriseServer return OrganizationController.GetPasswordPolicy(itemId); } + [WebMethod] + public void SendResetUserPasswordEmail(int itemId, int accountId, string reason, string mailTo = null) + { + OrganizationController.SendResetUserPasswordEmail(itemId, accountId, reason, mailTo); + } #endregion 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 fb855fc2..4ef094a1 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 @@ -168,4 +168,10 @@ RDS + + Webdav Portal URL + + + Webdav Portal + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserResetPassword.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserResetPassword.ascx.cs index 7aa28e6f..90a5508a 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserResetPassword.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserResetPassword.ascx.cs @@ -35,6 +35,8 @@ namespace WebsitePanel.Portal.ExchangeServer return; } + ES.Services.Organizations.SendResetUserPasswordEmail(PanelRequest.ItemID,PanelRequest.AccountID, txtReason.Text, txtEmailAddress.Text); + Response.Redirect(PortalUtils.EditUrl("ItemID", PanelRequest.ItemID.ToString(), (PanelRequest.Context == "Mailbox") ? "mailboxes" : "users", "SpaceID=" + PanelSecurity.PackageId)); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordExpirationLetter.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordExpirationLetter.ascx index a041b140..ee1a952f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordExpirationLetter.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordExpirationLetter.ascx @@ -25,11 +25,6 @@ - - - - -

    diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordExpirationLetter.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordExpirationLetter.ascx.cs index 189e66e7..61c1708b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordExpirationLetter.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordExpirationLetter.ascx.cs @@ -13,7 +13,6 @@ namespace WebsitePanel.Portal public void BindSettings(UserSettings settings) { txtFrom.Text = settings["From"]; - txtWebDavPortalResetUrl.Text = settings["WebDavPortalResetUrl"]; txtSubject.Text = settings["Subject"]; Utils.SelectListItem(ddlPriority, settings["Priority"]); txtHtmlBody.Text = settings["HtmlBody"]; @@ -24,7 +23,6 @@ namespace WebsitePanel.Portal public void SaveSettings(UserSettings settings) { settings["From"] = txtFrom.Text; - settings["WebDavPortalResetUrl"] = txtWebDavPortalResetUrl.Text; settings["Subject"] = txtSubject.Text; settings["Priority"] = ddlPriority.SelectedValue; settings["HtmlBody"] = txtHtmlBody.Text; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordExpirationLetter.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordExpirationLetter.ascx.designer.cs index e8bba7b9..ed594ab7 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordExpirationLetter.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordExpirationLetter.ascx.designer.cs @@ -84,24 +84,6 @@ namespace WebsitePanel.Portal { ///
    protected global::System.Web.UI.WebControls.TextBox txtLogoUrl; - /// - /// lblWebDavPortalResetUrl control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Label lblWebDavPortalResetUrl; - - /// - /// txtWebDavPortalResetUrl control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox txtWebDavPortalResetUrl; - /// /// lblHtmlBody control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SystemSettings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SystemSettings.ascx index 5fef4935..c192544a 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SystemSettings.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SystemSettings.ascx @@ -82,6 +82,16 @@ + + + + + + + +
    +
    +
    protected global::System.Web.UI.WebControls.DropDownList ddlRdsController; + /// + /// WebdavPortalSettings control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel WebdavPortalSettings; + + /// + /// PanelWebdavPortalSettings control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel PanelWebdavPortalSettings; + + /// + /// lblWebdavPortalUrl control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize lblWebdavPortalUrl; + + /// + /// txtWebdavPortalUrl control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtWebdavPortalUrl; + /// /// btnSaveSettings control. /// From 60214cdcf122a4c318e9ed54b1c31eca15a343f9 Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Mon, 6 Apr 2015 07:09:53 -0700 Subject: [PATCH 03/38] organization password settings added (without GPO) --- WebsitePanel/Database/update_db.sql | 61 ++ .../Users/UserSettings.cs | 1 + .../OrganizationProxy.cs | 127 ++++- .../Common/ObjectUtils.cs | 35 +- .../Data/DataProvider.cs | 17 + .../HostedSolution/OrganizationController.cs | 50 ++ .../esOrganizations.asmx.cs | 12 + .../HostedSolution/IOrganization.cs | 1 + .../OrganizationPasswordSettings.cs | 19 + .../HostedSolution/OrganizationSettings.cs | 7 + .../OrganizationSettingsEntity.cs | 9 + .../WebsitePanel.Providers.Base.csproj | 3 + .../OrganizationProvider.cs | 108 ++++ .../OrganizationProxy.cs | 53 ++ .../WebsitePanel.Server/Organizations.asmx.cs | 6 + .../App_Data/WebsitePanel_Modules.config | 1 + .../WebsitePanel_SharedResources.ascx.resx | 3 + .../OrganizationHome.ascx.resx | 6 + ...nizationSettingsPasswordSettings.ascx.resx | 216 ++++++++ .../ExchangeCreateMailbox.ascx.cs | 49 +- .../OrganizationCreateUser.ascx.cs | 49 +- .../ExchangeServer/OrganizationHome.ascx | 8 + .../ExchangeServer/OrganizationHome.ascx.cs | 3 + .../OrganizationHome.ascx.designer.cs | 18 + .../OrganizationSettingsPasswordSettings.ascx | 164 ++++++ ...ganizationSettingsPasswordSettings.ascx.cs | 163 ++++++ ...nSettingsPasswordSettings.ascx.designer.cs | 519 ++++++++++++++++++ .../OrganizationUserGeneralSettings.ascx.cs | 44 +- .../OrganizationSettingsTabs.ascx.resx | 123 +++++ .../OrganizationSettingsTabs.ascx | 32 ++ .../OrganizationSettingsTabs.ascx.cs | 50 ++ .../OrganizationSettingsTabs.ascx.designer.cs | 24 + .../WebsitePanel/SettingsExchangePolicy.ascx | 2 +- .../SettingsExchangePolicy.ascx.designer.cs | 33 +- .../PasswordPolicyEditor.ascx.resx | 35 +- .../UserControls/PasswordControl.ascx.cs | 43 +- .../UserControls/PasswordPolicyEditor.ascx | 69 ++- .../UserControls/PasswordPolicyEditor.ascx.cs | 65 ++- .../PasswordPolicyEditor.ascx.designer.cs | 257 +++++++-- .../WebsitePanel.Portal.Modules.csproj | 18 + 40 files changed, 2351 insertions(+), 152 deletions(-) create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationPasswordSettings.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationSettings.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationSettingsEntity.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationSettingsPasswordSettings.ascx.resx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSettingsPasswordSettings.ascx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSettingsPasswordSettings.ascx.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSettingsPasswordSettings.ascx.designer.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/OrganizationSettingsTabs.ascx.resx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/OrganizationSettingsTabs.ascx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/OrganizationSettingsTabs.ascx.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/OrganizationSettingsTabs.ascx.designer.cs diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index 6e66d880..aa60afa4 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -9684,4 +9684,65 @@ SELECT TokenType FROM AccessTokens Where AccessTokenGuid = @AccessToken AND ExpirationDate > getdate() AND TokenType = @TokenType +GO + + +-- ORGANIZATION SETTINGS + + +IF EXISTS (SELECT * FROM SYS.TABLES WHERE name = 'ExchangeOrganizationSettings') +DROP TABLE ExchangeOrganizationSettings +GO +CREATE TABLE ExchangeOrganizationSettings +( + ItemId INT NOT NULL, + SettingsName nvarchar(100) NOT NULL, + Xml nvarchar(max) NOT NULL +) +GO + +ALTER TABLE [dbo].[ExchangeOrganizationSettings] WITH CHECK ADD CONSTRAINT [FK_ExchangeOrganizationSettings_ExchangeOrganizations_ItemId] FOREIGN KEY([ItemId]) +REFERENCES [dbo].[ExchangeOrganizations] ([ItemId]) +ON DELETE CASCADE +GO + + + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'UpdateExchangeOrganizationSettings') +DROP PROCEDURE UpdateExchangeOrganizationSettings +GO +CREATE PROCEDURE [dbo].[UpdateExchangeOrganizationSettings] +( + @ItemId INT , + @SettingsName nvarchar(100) , + @Xml nvarchar(max) +) +AS +IF NOT EXISTS (SELECT * FROM [dbo].[ExchangeOrganizationSettings] WHERE [ItemId] = @ItemId AND [SettingsName]= @SettingsName ) +BEGIN +INSERT [dbo].[ExchangeOrganizationSettings] ([ItemId], [SettingsName], [Xml]) VALUES (@ItemId, @SettingsName, @Xml) +END +ELSE +UPDATE [dbo].[ExchangeOrganizationSettings] SET [Xml] = @Xml WHERE [ItemId] = @ItemId AND [SettingsName]= @SettingsName +GO + + + + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetExchangeOrganizationSettings') +DROP PROCEDURE GetExchangeOrganizationSettings +GO +CREATE PROCEDURE [dbo].[GetExchangeOrganizationSettings] +( + @ItemId INT , + @SettingsName nvarchar(100) +) +AS +SELECT + ItemId, + SettingsName, + Xml + +FROM ExchangeOrganizationSettings +Where ItemId = @ItemId AND SettingsName = @SettingsName GO \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Users/UserSettings.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Users/UserSettings.cs index 6740094f..f6780cf5 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Users/UserSettings.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Users/UserSettings.cs @@ -66,6 +66,7 @@ namespace WebsitePanel.EnterpriseServer public const string RDS_SETUP_LETTER = "RDSSetupLetter"; public const string RDS_POLICY = "RdsPolicy"; public const string USER_PASSWORD_EXPIRATION_LETTER = "UserPasswordExpirationLetter"; + public const string HOSTED_ORGANIZATION_PASSWORD_POLICY = "MailboxPasswordPolicy"; public int UserId; diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs index 92580b04..fa3c8d81 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs @@ -12,11 +12,11 @@ // 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; -using WebsitePanel.Providers.ResultObjects; using WebsitePanel.Providers.HostedSolution; -using WebsitePanel.EnterpriseServer.Base.HostedSolution; +using WebsitePanel.Providers.ResultObjects; namespace WebsitePanel.EnterpriseServer.HostedSolution { using System.Xml.Serialization; @@ -36,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 UpdateOrganizationPasswordSettingsOperationCompleted; + + private System.Threading.SendOrPostCallback GetOrganizationPasswordSettingsOperationCompleted; + private System.Threading.SendOrPostCallback CheckOrgIdExistsOperationCompleted; private System.Threading.SendOrPostCallback CreateOrganizationOperationCompleted; @@ -145,6 +149,12 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { this.Url = "http://localhost:9002/esOrganizations.asmx"; } + /// + public event UpdateOrganizationPasswordSettingsCompletedEventHandler UpdateOrganizationPasswordSettingsCompleted; + + /// + public event GetOrganizationPasswordSettingsCompletedEventHandler GetOrganizationPasswordSettingsCompleted; + /// public event CheckOrgIdExistsCompletedEventHandler CheckOrgIdExistsCompleted; @@ -301,6 +311,89 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { /// public event GetSupportServiceLevelCompletedEventHandler GetSupportServiceLevelCompleted; + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/UpdateOrganizationPasswordSettings", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void UpdateOrganizationPasswordSettings(int itemId, OrganizationPasswordSettings settings) { + this.Invoke("UpdateOrganizationPasswordSettings", new object[] { + itemId, + settings}); + } + + /// + public System.IAsyncResult BeginUpdateOrganizationPasswordSettings(int itemId, OrganizationPasswordSettings settings, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("UpdateOrganizationPasswordSettings", new object[] { + itemId, + settings}, callback, asyncState); + } + + /// + public void EndUpdateOrganizationPasswordSettings(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void UpdateOrganizationPasswordSettingsAsync(int itemId, OrganizationPasswordSettings settings) { + this.UpdateOrganizationPasswordSettingsAsync(itemId, settings, null); + } + + /// + public void UpdateOrganizationPasswordSettingsAsync(int itemId, OrganizationPasswordSettings settings, object userState) { + if ((this.UpdateOrganizationPasswordSettingsOperationCompleted == null)) { + this.UpdateOrganizationPasswordSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateOrganizationPasswordSettingsOperationCompleted); + } + this.InvokeAsync("UpdateOrganizationPasswordSettings", new object[] { + itemId, + settings}, this.UpdateOrganizationPasswordSettingsOperationCompleted, userState); + } + + private void OnUpdateOrganizationPasswordSettingsOperationCompleted(object arg) { + if ((this.UpdateOrganizationPasswordSettingsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.UpdateOrganizationPasswordSettingsCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganizationPasswordSettings", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public OrganizationPasswordSettings GetOrganizationPasswordSettings(int itemId) { + object[] results = this.Invoke("GetOrganizationPasswordSettings", new object[] { + itemId}); + return ((OrganizationPasswordSettings)(results[0])); + } + + /// + public System.IAsyncResult BeginGetOrganizationPasswordSettings(int itemId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetOrganizationPasswordSettings", new object[] { + itemId}, callback, asyncState); + } + + /// + public OrganizationPasswordSettings EndGetOrganizationPasswordSettings(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((OrganizationPasswordSettings)(results[0])); + } + + /// + public void GetOrganizationPasswordSettingsAsync(int itemId) { + this.GetOrganizationPasswordSettingsAsync(itemId, null); + } + + /// + public void GetOrganizationPasswordSettingsAsync(int itemId, object userState) { + if ((this.GetOrganizationPasswordSettingsOperationCompleted == null)) { + this.GetOrganizationPasswordSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetOrganizationPasswordSettingsOperationCompleted); + } + this.InvokeAsync("GetOrganizationPasswordSettings", new object[] { + itemId}, this.GetOrganizationPasswordSettingsOperationCompleted, userState); + } + + private void OnGetOrganizationPasswordSettingsOperationCompleted(object arg) { + if ((this.GetOrganizationPasswordSettingsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetOrganizationPasswordSettingsCompleted(this, new GetOrganizationPasswordSettingsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CheckOrgIdExists", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] public bool CheckOrgIdExists(string orgId) { @@ -2936,6 +3029,36 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void UpdateOrganizationPasswordSettingsCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void GetOrganizationPasswordSettingsCompletedEventHandler(object sender, GetOrganizationPasswordSettingsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetOrganizationPasswordSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetOrganizationPasswordSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public OrganizationPasswordSettings Result { + get { + this.RaiseExceptionIfNecessary(); + return ((OrganizationPasswordSettings)(this.results[0])); + } + } + } + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void CheckOrgIdExistsCompletedEventHandler(object sender, CheckOrgIdExistsCompletedEventArgs e); diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Common/ObjectUtils.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Common/ObjectUtils.cs index 67b8a138..ea5744ca 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Common/ObjectUtils.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Common/ObjectUtils.cs @@ -27,11 +27,13 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using System; +using System.IO; using System.Reflection; using System.Data; using System.Collections; using System.Collections.Generic; - +using System.Xml; +using System.Xml.Serialization; using WebsitePanel.Providers; namespace WebsitePanel.EnterpriseServer @@ -645,6 +647,37 @@ namespace WebsitePanel.EnterpriseServer return type.FullName + ", " + type.Assembly.GetName().Name; } + public static TResult Deserialize(string inputString) + { + TResult result; + + var serializer = new XmlSerializer(typeof(TResult)); + + using (TextReader reader = new StringReader(inputString)) + { + result = (TResult)serializer.Deserialize(reader); + } + + return result; + } + + public static string Serialize(TEntity entity) + { + string result = string.Empty; + + var xmlSerializer = new XmlSerializer(typeof(TEntity)); + + using (var stringWriter = new StringWriter()) + { + using (XmlWriter writer = XmlWriter.Create(stringWriter)) + { + xmlSerializer.Serialize(writer, entity); + result = stringWriter.ToString(); + } + } + + return result; + } #region Helper Functions diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs index c7bff6f7..a9ee96ac 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs @@ -3236,6 +3236,23 @@ namespace WebsitePanel.EnterpriseServer ); } + public static void UpdateOrganizationSettings(int itemId, string settingsName, string xml) + { + SqlHelper.ExecuteNonQuery(ConnectionString, CommandType.StoredProcedure, + ObjectQualifier + "UpdateExchangeOrganizationSettings", + new SqlParameter("@ItemId", itemId), + new SqlParameter("@SettingsName", settingsName), + new SqlParameter("@Xml", xml)); + } + + public static IDataReader GetOrganizationSettings(int itemId, string settingsName) + { + return SqlHelper.ExecuteReader(ConnectionString, CommandType.StoredProcedure, + ObjectQualifier + "GetExchangeOrganizationSettings", + new SqlParameter("@ItemId", itemId), + new SqlParameter("@SettingsName", settingsName)); + } + public static int AddOrganizationDeletedUser(int accountId, int originAT, string storagePath, string folderName, string fileName, DateTime expirationDate) { SqlParameter outParam = new SqlParameter("@ID", SqlDbType.Int); diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs index 499f9bfc..5f0a1e59 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs @@ -1647,6 +1647,56 @@ namespace WebsitePanel.EnterpriseServer return token; } + public static void UpdateOrganizationPasswordSettings(int itemId, OrganizationPasswordSettings settings) + { + TaskManager.StartTask("ORGANIZATION", "UPDATE_PASSWORD_SETTINGS"); + + try + { + // load organization + Organization org = GetOrganization(itemId); + + if (org == null) + { + TaskManager.WriteWarning("Organization with itemId '{0}' not found", itemId.ToString()); + return; + } + + Organizations orgProxy = GetOrganizationProxy(org.ServiceId); + + orgProxy.ApplyPasswordSettings(org.OrganizationId, settings); + + var xml = ObjectUtils.Serialize(settings); + + DataProvider.UpdateOrganizationSettings(itemId, OrganizationSettings.PasswordSettings, xml); + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + public static OrganizationPasswordSettings GetOrganizationPasswordSettings(int itemId) + { + return GetOrganizationSettings(itemId, OrganizationSettings.PasswordSettings); + } + + private static T GetOrganizationSettings(int itemId, string settingsName) + { + var entity = ObjectUtils.FillObjectFromDataReader(DataProvider.GetOrganizationSettings(itemId, settingsName)); + + if (entity == null) + { + return default(T); + } + + return ObjectUtils.Deserialize(entity.Xml); + } + private static bool EmailAddressExists(string emailAddress) { return DataProvider.ExchangeAccountEmailAddressExists(emailAddress); diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs index 6352e52b..0524c2d8 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs @@ -47,6 +47,18 @@ namespace WebsitePanel.EnterpriseServer { #region Organizations + [WebMethod] + public void UpdateOrganizationPasswordSettings(int itemId, OrganizationPasswordSettings settings) + { + OrganizationController.UpdateOrganizationPasswordSettings(itemId, settings); + } + + [WebMethod] + public OrganizationPasswordSettings GetOrganizationPasswordSettings(int itemId) + { + return OrganizationController.GetOrganizationPasswordSettings(itemId); + } + [WebMethod] public bool CheckOrgIdExists(string orgId) { diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/IOrganization.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/IOrganization.cs index 99e2c637..8386310e 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/IOrganization.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/IOrganization.cs @@ -99,5 +99,6 @@ namespace WebsitePanel.Providers.HostedSolution void ChangeDriveMapFolderPath(string organizationId, string oldFolder, string newFolder); List GetOrganizationUsersWithExpiredPassword(string organizationId, int daysBeforeExpiration); + void ApplyPasswordSettings(string organizationId, OrganizationPasswordSettings passwordSettings); } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationPasswordSettings.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationPasswordSettings.cs new file mode 100644 index 00000000..cc00f552 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationPasswordSettings.cs @@ -0,0 +1,19 @@ +namespace WebsitePanel.Providers.HostedSolution +{ + public class OrganizationPasswordSettings + { + public int MinimumLength { get; set; } + public int MaximumLength { get; set; } + public int EnforcePasswordHistory { get; set; } + + public bool LockoutSettingsEnabled { get; set; } + public int AccountLockoutDuration { get; set; } + public int AccountLockoutThreshold { get; set; } + public int ResetAccountLockoutCounterAfter { get; set; } + + public bool PasswordComplexityEnabled { get; set; } + public int UppercaseLettersCount { get; set; } + public int NumbersCount { get; set; } + public int SymbolsCount { get; set; } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationSettings.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationSettings.cs new file mode 100644 index 00000000..38e01f95 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationSettings.cs @@ -0,0 +1,7 @@ +namespace WebsitePanel.Providers.HostedSolution +{ + public class OrganizationSettings + { + public const string PasswordSettings = "PasswordSettings"; + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationSettingsEntity.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationSettingsEntity.cs new file mode 100644 index 00000000..750e26a2 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationSettingsEntity.cs @@ -0,0 +1,9 @@ +namespace WebsitePanel.Providers.HostedSolution +{ + public class OrganizationSettingsEntity + { + public int ItemId { get; set; } + public string SettingsName { get; set; } + public string Xml { get; set; } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj index e72359e6..a8951639 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj @@ -119,9 +119,12 @@ + + + diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs index 26d4dfb8..ddeeba63 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs @@ -552,6 +552,114 @@ namespace WebsitePanel.Providers.HostedSolution } } + public void ApplyPasswordSettings(string organizationId, OrganizationPasswordSettings settings) + { + HostedSolutionLog.LogStart("ApplyPasswordPolicy"); + + Runspace runspace = null; + + try + { + runspace = OpenRunspace(); + + var gpoId = CreatePolicyIfNotExist(runspace, organizationId, FormOrganizationSettingsGpoName(organizationId)); + } + catch (Exception ex) + { + HostedSolutionLog.LogError(ex); + throw; + } + finally + { + CloseRunspace(runspace); + HostedSolutionLog.LogEnd("ApplyPasswordPolicy"); + } + } + + private string FormOrganizationSettingsGpoName(string organizationId) + { + return string.Format("{0}-settings", organizationId); + } + + private string CreatePolicyIfNotExist(Runspace runspace, string organizationId, string gpoName) + { + string gpoId = GetPolicyId(runspace, gpoName); + + if (string.IsNullOrEmpty(gpoId)) + { + gpoId = CreateAndLinkPolicy(runspace, gpoName, organizationId); + } + + return gpoId; + } + + private void DeleteGpo(Runspace runspace, string gpoName) + { + Command cmd = new Command("Remove-GPO"); + cmd.Parameters.Add("Name", gpoName); + + // Collection result = ExecuteRemoteShellCommand(runspace, PrimaryDomainController, cmd); + } + + private string CreateAndLinkPolicy(Runspace runspace, string gpoName, string organizationId) + { + string pathOU = GetOrganizationTargetPath(organizationId); + + //create new gpo + Command cmd = new Command("New-GPO"); + cmd.Parameters.Add("Name", gpoName); + + Collection result = ExecuteShellCommand(runspace, cmd); + + string gpoId = null; + + if (result != null && result.Count > 0) + { + PSObject gpo = result[0]; + //get gpo id + gpoId = ((Guid) GetPSObjectProperty(gpo, "Id")).ToString("B"); + + } + + //create gpo link + cmd = new Command("New-GPLink"); + cmd.Parameters.Add("Name", gpoName); + cmd.Parameters.Add("Target", pathOU); + + ExecuteShellCommand(runspace, cmd); + + return gpoId; + } + + private string GetPolicyId(Runspace runspace, string gpoName) + { + Runspace runSpace = null; + + string gpoId = null; + + try + { + runSpace = OpenRunspace(); + + Command cmd = new Command("Get-GPO"); + cmd.Parameters.Add("Name", gpoName); + + Collection result = ExecuteShellCommand(runSpace, cmd); + + if (result != null && result.Count > 0) + { + PSObject gpo = result[0]; + gpoId = ((Guid)GetPSObjectProperty(gpo, "Id")).ToString("B"); + } + } + finally + { + CloseRunspace(runSpace); + } + + return gpoId; + } + public PasswordPolicyResult GetPasswordPolicy() { return GetPasswordPolicyInternal(); diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/OrganizationProxy.cs b/WebsitePanel/Sources/WebsitePanel.Server.Client/OrganizationProxy.cs index ef15952c..ddbe1a66 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.Client/OrganizationProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/OrganizationProxy.cs @@ -12,6 +12,7 @@ // This source code was auto-generated by wsdl, Version=2.0.50727.3038. // + using WebsitePanel.Providers.Common; using WebsitePanel.Providers.OS; using WebsitePanel.Providers.ResultObjects; @@ -94,6 +95,8 @@ namespace WebsitePanel.Providers.HostedSolution { private System.Threading.SendOrPostCallback GetOrganizationUsersWithExpiredPasswordOperationCompleted; + private System.Threading.SendOrPostCallback ApplyPasswordSettingsOperationCompleted; + /// public Organizations() { this.Url = "http://localhost:9003/Organizations.asmx"; @@ -186,6 +189,9 @@ namespace WebsitePanel.Providers.HostedSolution { /// public event GetOrganizationUsersWithExpiredPasswordCompletedEventHandler GetOrganizationUsersWithExpiredPasswordCompleted; + /// + public event ApplyPasswordSettingsCompletedEventHandler ApplyPasswordSettingsCompleted; + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/OrganizationExists", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] @@ -1675,6 +1681,49 @@ namespace WebsitePanel.Providers.HostedSolution { } } + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/ApplyPasswordSettings", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void ApplyPasswordSettings(string organizationId, OrganizationPasswordSettings passwordSettings) { + this.Invoke("ApplyPasswordSettings", new object[] { + organizationId, + passwordSettings}); + } + + /// + public System.IAsyncResult BeginApplyPasswordSettings(string organizationId, OrganizationPasswordSettings passwordSettings, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("ApplyPasswordSettings", new object[] { + organizationId, + passwordSettings}, callback, asyncState); + } + + /// + public void EndApplyPasswordSettings(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void ApplyPasswordSettingsAsync(string organizationId, OrganizationPasswordSettings passwordSettings) { + this.ApplyPasswordSettingsAsync(organizationId, passwordSettings, null); + } + + /// + public void ApplyPasswordSettingsAsync(string organizationId, OrganizationPasswordSettings passwordSettings, object userState) { + if ((this.ApplyPasswordSettingsOperationCompleted == null)) { + this.ApplyPasswordSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnApplyPasswordSettingsOperationCompleted); + } + this.InvokeAsync("ApplyPasswordSettings", new object[] { + organizationId, + passwordSettings}, this.ApplyPasswordSettingsOperationCompleted, userState); + } + + private void OnApplyPasswordSettingsOperationCompleted(object arg) { + if ((this.ApplyPasswordSettingsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ApplyPasswordSettingsCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + /// public new void CancelAsync(object userState) { base.CancelAsync(userState); @@ -2060,4 +2109,8 @@ namespace WebsitePanel.Providers.HostedSolution { } } } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void ApplyPasswordSettingsCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); } diff --git a/WebsitePanel/Sources/WebsitePanel.Server/Organizations.asmx.cs b/WebsitePanel/Sources/WebsitePanel.Server/Organizations.asmx.cs index 4cae8631..61c568b3 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/Organizations.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server/Organizations.asmx.cs @@ -261,5 +261,11 @@ namespace WebsitePanel.Server { return Organization.GetOrganizationUsersWithExpiredPassword(organizationId, daysBeforeExpiration); } + + [WebMethod, SoapHeader("settings")] + public void ApplyPasswordSettings(string organizationId, OrganizationPasswordSettings passwordSettings) + { + Organization.ApplyPasswordSettings(organizationId, passwordSettings); + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config index e3263482..4a2b2c76 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config @@ -476,6 +476,7 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx index 975a6a96..490b50b0 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx @@ -5713,4 +5713,7 @@ User password expiration notification + + Error during updating settings. + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationHome.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationHome.ascx.resx index 7b71c51e..2e38b9a4 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationHome.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationHome.ascx.resx @@ -237,4 +237,10 @@ RDS Users + + Edit + + + Organization settings + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationSettingsPasswordSettings.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationSettingsPasswordSettings.ascx.resx new file mode 100644 index 00000000..8387aed9 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationSettingsPasswordSettings.ascx.resx @@ -0,0 +1,216 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + Save Changes + + + Enable Lockout Settings + + + Enable Password Complexity + + + Password settings + + + Account lockout duration: + + + Enforce password history: + + + Account lockout threshold: + + + Lock out settings: + + + Maximum length: + + + Minimum length: + + + Numbers: + + + Non-alphanumeric symbols: + + + Uppercase letters: + + + Reset account lockout counter after (minutes): + + + Password should contain at least: + + + Edit settings + + + * + + + * + + + * + + + * + + + * + + + * + + + * + + + * + + + * + + + * + + + * + + + * + + + * + + + * + + + * + + + * + + \ No newline at end of file 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 90254770..20d3049f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx.cs @@ -49,23 +49,7 @@ namespace WebsitePanel.Portal.ExchangeServer if (!IsPostBack) { - password.SetPackagePolicy(PanelSecurity.PackageId, UserSettings.EXCHANGE_POLICY, "MailboxPasswordPolicy"); - PasswordPolicyResult passwordPolicy = ES.Services.Organizations.GetPasswordPolicy(PanelRequest.ItemID); - if (passwordPolicy.IsSuccess) - { - password.MinimumLength = passwordPolicy.Value.MinLength; - if (passwordPolicy.Value.IsComplexityEnable) - { - password.MinimumNumbers = 1; - password.MinimumSymbols = 1; - password.MinimumUppercase = 1; - } - } - else - { - messageBox.ShowMessage(passwordPolicy, "EXCHANGE_CREATE_MAILBOX", "HostedOrganization"); - return; - } + BindPasswordSettings(); string instructions = ES.Services.ExchangeServer.GetMailboxSetupInstructions(PanelRequest.ItemID, PanelRequest.AccountID, false, false, false); if (!string.IsNullOrEmpty(instructions)) @@ -135,6 +119,37 @@ namespace WebsitePanel.Portal.ExchangeServer } + private void BindPasswordSettings() + { + var grainedPasswordSettigns = ES.Services.Organizations.GetOrganizationPasswordSettings(PanelRequest.ItemID); + + if (grainedPasswordSettigns != null) + { + password.SetUserPolicy(grainedPasswordSettigns); + } + else + { + password.SetPackagePolicy(PanelSecurity.PackageId, UserSettings.EXCHANGE_POLICY, "MailboxPasswordPolicy"); + + PasswordPolicyResult passwordPolicy = ES.Services.Organizations.GetPasswordPolicy(PanelRequest.ItemID); + + if (passwordPolicy.IsSuccess) + { + password.MinimumLength = passwordPolicy.Value.MinLength; + if (passwordPolicy.Value.IsComplexityEnable) + { + password.MinimumNumbers = 1; + password.MinimumSymbols = 1; + password.MinimumUppercase = 1; + } + } + else + { + messageBox.ShowMessage(passwordPolicy, "CREATE_ORGANIZATION_USER", "HostedOrganization"); + } + } + } + protected void btnCreate_Click(object sender, EventArgs e) { CreateMailbox(); 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 97a724d6..11f190db 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx.cs @@ -40,23 +40,7 @@ namespace WebsitePanel.Portal.HostedSolution { if (!IsPostBack) { - password.SetPackagePolicy(PanelSecurity.PackageId, UserSettings.EXCHANGE_POLICY, "MailboxPasswordPolicy"); - - PasswordPolicyResult passwordPolicy = ES.Services.Organizations.GetPasswordPolicy(PanelRequest.ItemID); - if (passwordPolicy.IsSuccess) - { - password.MinimumLength = passwordPolicy.Value.MinLength; - if (passwordPolicy.Value.IsComplexityEnable) - { - password.MinimumNumbers = 1; - password.MinimumSymbols = 1; - password.MinimumUppercase = 1; - } - } - else - { - messageBox.ShowMessage(passwordPolicy, "CREATE_ORGANIZATION_USER", "HostedOrganization"); - } + BindPasswordSettings(); string instructions = ES.Services.Organizations.GetOrganizationUserSummuryLetter(PanelRequest.ItemID, PanelRequest.AccountID, false, false, false); if (!string.IsNullOrEmpty(instructions)) @@ -88,6 +72,37 @@ namespace WebsitePanel.Portal.HostedSolution } + private void BindPasswordSettings() + { + var grainedPasswordSettigns = ES.Services.Organizations.GetOrganizationPasswordSettings(PanelRequest.ItemID); + + if (grainedPasswordSettigns != null) + { + password.SetUserPolicy(grainedPasswordSettigns); + } + else + { + password.SetPackagePolicy(PanelSecurity.PackageId, UserSettings.EXCHANGE_POLICY, "MailboxPasswordPolicy"); + + PasswordPolicyResult passwordPolicy = ES.Services.Organizations.GetPasswordPolicy(PanelRequest.ItemID); + + if (passwordPolicy.IsSuccess) + { + password.MinimumLength = passwordPolicy.Value.MinLength; + if (passwordPolicy.Value.IsComplexityEnable) + { + password.MinimumNumbers = 1; + password.MinimumSymbols = 1; + password.MinimumUppercase = 1; + } + } + else + { + messageBox.ShowMessage(passwordPolicy, "CREATE_ORGANIZATION_USER", "HostedOrganization"); + } + } + } + protected void btnCreate_Click(object sender, EventArgs e) { CreateMailbox(); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx index 532fc488..e8c1d3e7 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx @@ -37,6 +37,14 @@ + + + + + + + +
    diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.cs index 7a483c39..de167b9a 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.cs @@ -175,6 +175,9 @@ namespace WebsitePanel.Portal.ExchangeServer lblOrganizationNameValue.Text = org.Name; lblOrganizationIDValue.Text = org.OrganizationId; lblCreatedValue.Text = org.CreatedDate.Date.ToShortDateString(); + lnkEditOrganizationSettings.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "organization_settings_password_settings", + "SpaceID=" + PanelSecurity.PackageId); + OrganizationStatistics orgStats = ES.Services.Organizations.GetOrganizationStatisticsByOrganization(PanelRequest.ItemID); OrganizationStatistics tenantStats = ES.Services.Organizations.GetOrganizationStatistics(PanelRequest.ItemID); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.designer.cs index 26a5655d..f0f7aab1 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.designer.cs @@ -84,6 +84,24 @@ namespace WebsitePanel.Portal.ExchangeServer { /// protected global::System.Web.UI.WebControls.Label lblCreatedValue; + /// + /// Label1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label Label1; + + /// + /// lnkEditOrganizationSettings control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HyperLink lnkEditOrganizationSettings; + /// /// organizationStatsPanel control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSettingsPasswordSettings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSettingsPasswordSettings.ascx new file mode 100644 index 00000000..0b99d95e --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSettingsPasswordSettings.ascx @@ -0,0 +1,164 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="OrganizationSettingsPasswordSettings.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.OrganizationSettingsPasswordSettings" %> + +<%@ Register Src="UserControls/OrganizationSettingsTabs.ascx" TagName="CollectionTabs" TagPrefix="wsp" %> +<%@ Register TagPrefix="wsp" TagName="CollapsiblePanel" Src="../UserControls/CollapsiblePanel.ascx" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/ItemButtonPanel.ascx" TagName="ItemButtonPanel" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + + +
    +
    +
    +
    +
    +
    +
    + + + + +
    +
    + + + + + + + + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + + +
    + + +
    + +
    + + +
    + + + +
    + + + +
    + +
    + + + + +
    + + + + +
    + + + + +
    + +
    + + + + +
    + +
    +
    + + + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSettingsPasswordSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSettingsPasswordSettings.ascx.cs new file mode 100644 index 00000000..48ceea57 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSettingsPasswordSettings.ascx.cs @@ -0,0 +1,163 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.EnterpriseServer; +using WebsitePanel.Providers.HostedSolution; + +namespace WebsitePanel.Portal.ExchangeServer +{ + public partial class OrganizationSettingsPasswordSettings : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + Organization org = ES.Services.Organizations.GetOrganization(PanelRequest.ItemID); + litOrganizationName.Text = org.OrganizationId; + + BindSettings(); + } + + } + + private void BindSettings() + { + var settings = ES.Services.Organizations.GetOrganizationPasswordSettings(PanelRequest.ItemID); + + if (settings == null) + { + var defaultSettings = ES.Services.Users.GetUserSettings(PanelSecurity.LoggedUserId, UserSettings.EXCHANGE_POLICY); + + BindDefaultSettings(defaultSettings[UserSettings.HOSTED_ORGANIZATION_PASSWORD_POLICY]); + } + else + { + BindSettings(settings); + } + + ToggleLockoutControls(chkLockOutSettigns.Checked); + ToggleComplexityControls(chkPasswordComplexity.Checked); + } + + private void BindDefaultSettings(string defaultSettings) + { + // parse settings + string[] parts = defaultSettings.Split(';'); + txtMinimumLength.Text = parts[1]; + txtMaximumLength.Text = parts[2]; + txtMinimumUppercase.Text = parts[3]; + txtMinimumNumbers.Text = parts[4]; + txtMinimumSymbols.Text = parts[5]; + chkNotEqualUsername.Checked = Utils.ParseBool(parts[6], false); + txtLockedOut.Text = parts[7]; + + txtEnforcePasswordHistory.Text = PasswordPolicyEditor.GetValueSafe(parts, 8, "0"); + txtAccountLockoutDuration.Text = PasswordPolicyEditor.GetValueSafe(parts, 9, "0"); + txtResetAccountLockout.Text = PasswordPolicyEditor.GetValueSafe(parts, 10, "0"); + chkLockOutSettigns.Checked = PasswordPolicyEditor.GetValueSafe(parts, 11, false); + chkPasswordComplexity.Checked = PasswordPolicyEditor.GetValueSafe(parts, 12, true); + } + + private void BindSettings(OrganizationPasswordSettings settings) + { + txtMinimumLength.Text = settings.MinimumLength.ToString(); + txtMaximumLength.Text = settings.MaximumLength.ToString(); + txtMinimumUppercase.Text = settings.UppercaseLettersCount.ToString(); + txtMinimumNumbers.Text = settings.NumbersCount.ToString(); + txtMinimumSymbols.Text = settings.SymbolsCount.ToString(); + txtLockedOut.Text = settings.AccountLockoutThreshold.ToString(); + + txtEnforcePasswordHistory.Text = settings.EnforcePasswordHistory.ToString(); + txtAccountLockoutDuration.Text = settings.AccountLockoutDuration.ToString(); + txtResetAccountLockout.Text = settings.ResetAccountLockoutCounterAfter.ToString(); + chkLockOutSettigns.Checked = settings.LockoutSettingsEnabled; + chkPasswordComplexity.Checked = settings.PasswordComplexityEnabled; + } + + private OrganizationPasswordSettings GetSettings() + { + var settings = new OrganizationPasswordSettings(); + + settings.MinimumLength = Utils.ParseInt(txtMinimumLength.Text, 3); + settings.MaximumLength = Utils.ParseInt(txtMaximumLength.Text, 7); + settings.UppercaseLettersCount = Utils.ParseInt(txtMinimumUppercase.Text, 3); + settings.NumbersCount = Utils.ParseInt(txtMinimumNumbers.Text, 3); + settings.SymbolsCount = Utils.ParseInt(txtMinimumSymbols.Text, 3); + settings.AccountLockoutThreshold = Utils.ParseInt(txtLockedOut.Text, 3); + settings.EnforcePasswordHistory = Utils.ParseInt(txtEnforcePasswordHistory.Text, 3); + settings.AccountLockoutDuration = Utils.ParseInt(txtAccountLockoutDuration.Text, 3); + settings.ResetAccountLockoutCounterAfter = Utils.ParseInt(txtResetAccountLockout.Text, 3); + + settings.LockoutSettingsEnabled = chkLockOutSettigns.Checked; + settings.PasswordComplexityEnabled =chkPasswordComplexity.Checked; + + return settings; + } + + + private bool SavePasswordSettings() + { + try + { + ES.Services.Organizations.UpdateOrganizationPasswordSettings(PanelRequest.ItemID, GetSettings()); + } + catch (Exception ex) + { + ShowErrorMessage("ORANIZATIONSETTINGS_NOT_UPDATED", ex); + return false; + } + + return true; + } + + protected void btnSave_Click(object sender, EventArgs e) + { + if (!Page.IsValid) + { + return; + } + + SavePasswordSettings(); + } + + private void ToggleLockoutControls(bool visible) + { + RowAccountLockoutDuration.Visible = visible; + RowLockedOut.Visible = visible; + RowResetAccountLockout.Visible = visible; + } + + protected void chkLockOutSettigns_CheckedChanged(object sender, EventArgs e) + { + ToggleLockoutControls(chkLockOutSettigns.Checked); + } + + private void ToggleComplexityControls(bool visible) + { + RowMinimumUppercase.Visible = visible; + RowMinimumNumbers.Visible = visible; + RowMinimumSymbols.Visible = visible; + } + + protected void chkPasswordComplexity_CheckedChanged(object sender, EventArgs e) + { + ToggleComplexityControls(chkPasswordComplexity.Checked); + } + + protected void btnSaveExit_Click(object sender, EventArgs e) + { + if (!Page.IsValid) + { + return; + } + + if (SavePasswordSettings()) + { + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "organization_home", "SpaceID=" + PanelSecurity.PackageId)); + } + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSettingsPasswordSettings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSettingsPasswordSettings.ascx.designer.cs new file mode 100644 index 00000000..345b5367 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSettingsPasswordSettings.ascx.designer.cs @@ -0,0 +1,519 @@ +//------------------------------------------------------------------------------ +// +// 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.ExchangeServer { + + + public partial class OrganizationSettingsPasswordSettings { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// Image1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image Image1; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// litOrganizationName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litOrganizationName; + + /// + /// tabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.OrganizationSettingsTabs tabs; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// PasswordPolicyPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UpdatePanel PasswordPolicyPanel; + + /// + /// colPasswordSettings control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel colPasswordSettings; + + /// + /// panelPasswordSettings control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel panelPasswordSettings; + + /// + /// PolicyTable control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTable PolicyTable; + + /// + /// lblMinimumLength control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblMinimumLength; + + /// + /// txtMinimumLength control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtMinimumLength; + + /// + /// valRequireMinLength control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireMinLength; + + /// + /// valCorrectMinLength control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator valCorrectMinLength; + + /// + /// lblMaximumLength control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblMaximumLength; + + /// + /// txtMaximumLength control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtMaximumLength; + + /// + /// valRequireMaxLength control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireMaxLength; + + /// + /// valCorrectMaxLength control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator valCorrectMaxLength; + + /// + /// lblEnforcePasswordHistory control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblEnforcePasswordHistory; + + /// + /// txtEnforcePasswordHistory control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtEnforcePasswordHistory; + + /// + /// valRequireEnforcePasswordHistory control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireEnforcePasswordHistory; + + /// + /// valCorrectEnforcePasswordHistory control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator valCorrectEnforcePasswordHistory; + + /// + /// RowChkLockOutSettigns control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow RowChkLockOutSettigns; + + /// + /// chkLockOutSettigns control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkLockOutSettigns; + + /// + /// RowAccountLockoutDuration control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow RowAccountLockoutDuration; + + /// + /// lblAccountLockoutDuration control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblAccountLockoutDuration; + + /// + /// txtAccountLockoutDuration control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtAccountLockoutDuration; + + /// + /// valRequireAccountLockoutDuration control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireAccountLockoutDuration; + + /// + /// valCorrectAccountLockoutDuration control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator valCorrectAccountLockoutDuration; + + /// + /// RowLockedOut control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow RowLockedOut; + + /// + /// lblLockedOut control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblLockedOut; + + /// + /// txtLockedOut control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtLockedOut; + + /// + /// valCorrectLockedOut control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator valCorrectLockedOut; + + /// + /// RowResetAccountLockout control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow RowResetAccountLockout; + + /// + /// lblResetAccountLockout control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblResetAccountLockout; + + /// + /// txtResetAccountLockout control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtResetAccountLockout; + + /// + /// valResetAccountLockout control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator valResetAccountLockout; + + /// + /// chkPasswordComplexity control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkPasswordComplexity; + + /// + /// RowMinimumUppercase control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow RowMinimumUppercase; + + /// + /// lblMinimumUppercase control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblMinimumUppercase; + + /// + /// txtMinimumUppercase control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtMinimumUppercase; + + /// + /// valRequireUppercase control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireUppercase; + + /// + /// valCorrectUppercase control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator valCorrectUppercase; + + /// + /// RowMinimumNumbers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow RowMinimumNumbers; + + /// + /// lblMinimumNumbers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblMinimumNumbers; + + /// + /// txtMinimumNumbers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtMinimumNumbers; + + /// + /// valRequireNumbers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireNumbers; + + /// + /// valCorrectNumbers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator valCorrectNumbers; + + /// + /// RowMinimumSymbols control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow RowMinimumSymbols; + + /// + /// lblMinimumSymbols control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblMinimumSymbols; + + /// + /// txtMinimumSymbols control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtMinimumSymbols; + + /// + /// valRequireSymbols control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireSymbols; + + /// + /// valCorrectSymbols control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator valCorrectSymbols; + + /// + /// rowEqualUsername control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow rowEqualUsername; + + /// + /// chkNotEqualUsername control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkNotEqualUsername; + + /// + /// buttonPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ItemButtonPanel buttonPanel; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs index bde31fc9..7eed531f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs @@ -59,18 +59,7 @@ namespace WebsitePanel.Portal.HostedSolution { try { - password.SetPackagePolicy(PanelSecurity.PackageId, UserSettings.EXCHANGE_POLICY, "MailboxPasswordPolicy"); - PasswordPolicyResult passwordPolicy = ES.Services.Organizations.GetPasswordPolicy(PanelRequest.ItemID); - if (passwordPolicy.IsSuccess) - { - password.MinimumLength = passwordPolicy.Value.MinLength; - if (passwordPolicy.Value.IsComplexityEnable) - { - password.MinimumNumbers = 1; - password.MinimumSymbols = 1; - password.MinimumUppercase = 1; - } - } + BindPasswordSettings(); // get settings OrganizationUser user = ES.Services.Organizations.GetUserGeneralSettings(PanelRequest.ItemID, @@ -273,6 +262,37 @@ namespace WebsitePanel.Portal.HostedSolution } + private void BindPasswordSettings() + { + var grainedPasswordSettigns = ES.Services.Organizations.GetOrganizationPasswordSettings(PanelRequest.ItemID); + + if (grainedPasswordSettigns != null) + { + password.SetUserPolicy(grainedPasswordSettigns); + } + else + { + password.SetPackagePolicy(PanelSecurity.PackageId, UserSettings.EXCHANGE_POLICY, "MailboxPasswordPolicy"); + + PasswordPolicyResult passwordPolicy = ES.Services.Organizations.GetPasswordPolicy(PanelRequest.ItemID); + + if (passwordPolicy.IsSuccess) + { + password.MinimumLength = passwordPolicy.Value.MinLength; + if (passwordPolicy.Value.IsComplexityEnable) + { + password.MinimumNumbers = 1; + password.MinimumSymbols = 1; + password.MinimumUppercase = 1; + } + } + else + { + messageBox.ShowMessage(passwordPolicy, "CREATE_ORGANIZATION_USER", "HostedOrganization"); + } + } + } + private bool CheckServiceLevelQuota(QuotaValueInfo quota) { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/OrganizationSettingsTabs.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/OrganizationSettingsTabs.ascx.resx new file mode 100644 index 00000000..ecbb2a94 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/OrganizationSettingsTabs.ascx.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + Password Settings + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/OrganizationSettingsTabs.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/OrganizationSettingsTabs.ascx new file mode 100644 index 00000000..5575c4e1 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/OrganizationSettingsTabs.ascx @@ -0,0 +1,32 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="OrganizationSettingsTabs.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.UserControls.OrganizationSettingsTabs" %> + + + + + + +
    + + + + + <%# Eval("Name") %> + + + + + + <%# Eval("Name") %> + + + +
    +
    + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/OrganizationSettingsTabs.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/OrganizationSettingsTabs.ascx.cs new file mode 100644 index 00000000..3fa348da --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/OrganizationSettingsTabs.ascx.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.Portal.Code.UserControls; + +namespace WebsitePanel.Portal.ExchangeServer.UserControls +{ + public partial class OrganizationSettingsTabs : WebsitePanelControlBase + { + public string SelectedTab { get; set; } + + protected void Page_Load(object sender, EventArgs e) + { + BindTabs(); + } + + private void BindTabs() + { + List tabsList = new List(); + tabsList.Add(CreateTab("organization_settings_password_settings", "Tab.PasswordSettings")); + + int idx = 0; + + foreach (Tab tab in tabsList) + { + if (String.Compare(tab.Id, SelectedTab, true) == 0) + { + break; + } + + idx++; + } + + osTabs.SelectedIndex = idx; + osTabs.DataSource = tabsList; + osTabs.DataBind(); + } + + private Tab CreateTab(string id, string text) + { + return new Tab(id, GetLocalizedString(text), + HostModule.EditUrl("ItemID", PanelRequest.ItemID.ToString(), id, + "SpaceID=" + PanelSecurity.PackageId + )); + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/OrganizationSettingsTabs.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/OrganizationSettingsTabs.ascx.designer.cs new file mode 100644 index 00000000..07100ae3 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/OrganizationSettingsTabs.ascx.designer.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// +// 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.ExchangeServer.UserControls { + + + public partial class OrganizationSettingsTabs { + + /// + /// osTabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DataList osTabs; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangePolicy.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangePolicy.ascx index 517be9ab..8aca548c 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangePolicy.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangePolicy.ascx @@ -13,7 +13,7 @@ - + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangePolicy.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangePolicy.ascx.designer.cs index 0e14d0a6..4eca5840 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangePolicy.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangePolicy.ascx.designer.cs @@ -1,30 +1,11 @@ -// Copyright (c) 2015, Outercurve Foundation. -// All rights reserved. +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. // -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// - Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// - Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// - Neither the name of the Outercurve Foundation nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ namespace WebsitePanel.Portal { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/App_LocalResources/PasswordPolicyEditor.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/App_LocalResources/PasswordPolicyEditor.ascx.resx index 205a3bce..a4b1ce09 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/App_LocalResources/PasswordPolicyEditor.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/App_LocalResources/PasswordPolicyEditor.ascx.resx @@ -120,11 +120,26 @@ Enable Policy + + Enable Lockout Settings + Should not be equal to username + + Enable Password Complexity + + + Account lockout duration: + + + Enforce password history: + - Lock out after # attempts: + Account lockout threshold: + + + Lock out settings: Maximum length: @@ -141,9 +156,18 @@ Uppercase letters: + + Reset account lockout counter after (minutes): + Password should contain at least: + + * + + + * + * @@ -162,6 +186,12 @@ * + + * + + + * + * @@ -177,4 +207,7 @@ * + + * + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/PasswordControl.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/PasswordControl.ascx.cs index 15473082..d297936e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/PasswordControl.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/PasswordControl.ascx.cs @@ -27,6 +27,7 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using System; +using System.Configuration.Internal; using System.Data; using System.Configuration; using System.Collections; @@ -41,6 +42,7 @@ using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using WebsitePanel.EnterpriseServer; +using WebsitePanel.Providers.HostedSolution; namespace WebsitePanel.Portal { @@ -112,7 +114,14 @@ namespace WebsitePanel.Portal public int MaximumLength { get { return (ViewState["MaximumLength"] != null) ? (int)ViewState["MaximumLength"] : 0; } - set { ViewState["MaximumLength"] = value; } + set + { + { + txtPassword.MaxLength = value; + txtConfirmPassword.MaxLength = value; + ViewState["MaximumLength"] = value; + } + } } public int MinimumNumbers @@ -182,6 +191,38 @@ namespace WebsitePanel.Portal ToggleControls(); } + public void SetUserPolicy(OrganizationPasswordSettings settings) + { + int minimumUppercase; + int minimumNumbers; + int minimumSymbols; + + + if (settings.PasswordComplexityEnabled) + { + minimumUppercase = settings.UppercaseLettersCount; + minimumNumbers = settings.NumbersCount; + minimumSymbols = settings.SymbolsCount; + } + else + { + minimumUppercase = 0; + minimumNumbers = 0; + minimumSymbols = 0; + } + + PolicyValue = string.Join(";", true, settings.MinimumLength, settings.MaximumLength, minimumUppercase, minimumNumbers, minimumSymbols, true); + + ToggleControls(); + } + + public void SetUserPolicy(bool enabled, int minLength, int maxLength, int minimumUppercase, int minimumNumbers, int minimumSymbols, bool notEqualToUsername) + { + PolicyValue = string.Join(";", enabled, minLength, maxLength, minimumUppercase, minimumNumbers, minimumSymbols, notEqualToUsername); + + ToggleControls(); + } + protected void Page_Load(object sender, EventArgs e) { txtPassword.Attributes["value"] = txtPassword.Text; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/PasswordPolicyEditor.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/PasswordPolicyEditor.ascx index 2086c289..ab2431fc 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/PasswordPolicyEditor.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/PasswordPolicyEditor.ascx @@ -28,10 +28,59 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -43,7 +92,7 @@ Display="Dynamic" ErrorMessage="*" ValidationExpression="\d{1,3}" ValidationGroup="SettingsEditor"> - + @@ -55,7 +104,7 @@ Display="Dynamic" ErrorMessage="*" ValidationExpression="\d{1,3}" ValidationGroup="SettingsEditor"> - + @@ -72,18 +121,6 @@ - - - - - - - - - - diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/PasswordPolicyEditor.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/PasswordPolicyEditor.ascx.cs index f74ecd8b..8a3c2e6e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/PasswordPolicyEditor.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/PasswordPolicyEditor.ascx.cs @@ -42,6 +42,8 @@ namespace WebsitePanel.Portal { public partial class PasswordPolicyEditor : WebsitePanelControlBase { + public bool ShowLockoutSettings { get; set; } + public string Value { get @@ -56,6 +58,12 @@ namespace WebsitePanel.Portal sb.Append(chkNotEqualUsername.Checked.ToString()).Append(";"); sb.Append(txtLockedOut.Text).Append(";"); + sb.Append(txtEnforcePasswordHistory.Text).Append(";"); + sb.Append(txtAccountLockoutDuration.Text).Append(";"); + sb.Append(txtResetAccountLockout.Text).Append(";"); + sb.Append(chkLockOutSettigns.Checked.ToString()).Append(";"); + sb.Append(chkPasswordComplexity.Checked.ToString()).Append(";"); + return sb.ToString(); } set @@ -70,6 +78,7 @@ namespace WebsitePanel.Portal txtMinimumNumbers.Text = "0"; txtMinimumSymbols.Text = "0"; txtLockedOut.Text = "3"; + chkPasswordComplexity.Checked = true; } else { @@ -85,8 +94,17 @@ namespace WebsitePanel.Portal txtMinimumSymbols.Text = parts[5]; chkNotEqualUsername.Checked = Utils.ParseBool(parts[6], false); txtLockedOut.Text = parts[7]; + + txtEnforcePasswordHistory.Text = GetValueSafe(parts, 8, "0"); + txtAccountLockoutDuration.Text = GetValueSafe(parts, 9, "0"); + txtResetAccountLockout.Text = GetValueSafe(parts, 10, "0"); + chkLockOutSettigns.Checked = GetValueSafe(parts, 11, false) && ShowLockoutSettings; + chkPasswordComplexity.Checked = GetValueSafe(parts, 12, true); + } + catch + { + /* skip */ } - catch { /* skip */ } } ToggleControls(); } @@ -99,11 +117,56 @@ namespace WebsitePanel.Portal private void ToggleControls() { PolicyTable.Visible = chkEnabled.Checked; + + ToggleLockOutSettignsControls(); + TogglePasswordCompelxitySettignsControls(); + + RowChkLockOutSettigns.Visible = ShowLockoutSettings; } protected void chkEnabled_CheckedChanged(object sender, EventArgs e) { ToggleControls(); } + + private void ToggleLockOutSettignsControls() + { + RowAccountLockoutDuration.Visible = chkLockOutSettigns.Checked; + RowLockedOut.Visible = chkLockOutSettigns.Checked; + RowResetAccountLockout.Visible = chkLockOutSettigns.Checked; + } + + private void TogglePasswordCompelxitySettignsControls() + { + RowMinimumUppercase.Visible = chkPasswordComplexity.Checked; + RowMinimumNumbers.Visible = chkPasswordComplexity.Checked; + RowMinimumSymbols.Visible = chkPasswordComplexity.Checked; + } + + protected void chkLockOutSettigns_CheckedChanged(object sender, EventArgs e) + { + ToggleLockOutSettignsControls(); + } + + protected void chkPasswordComplexity_CheckedChanged(object sender, EventArgs e) + { + TogglePasswordCompelxitySettignsControls(); + } + + public static T GetValueSafe(string[] array, int index, T defaultValue) + { + if (array.Length > index) + { + if (string.IsNullOrEmpty(array[index])) + { + return defaultValue; + } + + return (T)Convert.ChangeType(array[index], typeof(T)); + } + + return defaultValue; + } + } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/PasswordPolicyEditor.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/PasswordPolicyEditor.ascx.designer.cs index a5bf2867..557e0e74 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/PasswordPolicyEditor.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/PasswordPolicyEditor.ascx.designer.cs @@ -1,31 +1,3 @@ -// Copyright (c) 2015, Outercurve Foundation. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// - Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// - Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// - Neither the name of the Outercurve Foundation nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - //------------------------------------------------------------------------------ // // This code was generated by a tool. @@ -140,13 +112,193 @@ namespace WebsitePanel.Portal { protected global::System.Web.UI.WebControls.RegularExpressionValidator valCorrectMaxLength; /// - /// lblShouldContain control. + /// lblEnforcePasswordHistory control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.Label lblShouldContain; + protected global::System.Web.UI.WebControls.Label lblEnforcePasswordHistory; + + /// + /// txtEnforcePasswordHistory control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtEnforcePasswordHistory; + + /// + /// valRequireEnforcePasswordHistory control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireEnforcePasswordHistory; + + /// + /// valCorrectEnforcePasswordHistory control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator valCorrectEnforcePasswordHistory; + + /// + /// RowChkLockOutSettigns control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow RowChkLockOutSettigns; + + /// + /// chkLockOutSettigns control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkLockOutSettigns; + + /// + /// RowAccountLockoutDuration control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow RowAccountLockoutDuration; + + /// + /// lblAccountLockoutDuration control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblAccountLockoutDuration; + + /// + /// txtAccountLockoutDuration control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtAccountLockoutDuration; + + /// + /// valRequireAccountLockoutDuration control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireAccountLockoutDuration; + + /// + /// valCorrectAccountLockoutDuration control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator valCorrectAccountLockoutDuration; + + /// + /// RowLockedOut control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow RowLockedOut; + + /// + /// lblLockedOut control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblLockedOut; + + /// + /// txtLockedOut control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtLockedOut; + + /// + /// valCorrectLockedOut control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator valCorrectLockedOut; + + /// + /// RowResetAccountLockout control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow RowResetAccountLockout; + + /// + /// lblResetAccountLockout control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblResetAccountLockout; + + /// + /// txtResetAccountLockout control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtResetAccountLockout; + + /// + /// valResetAccountLockout control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator valResetAccountLockout; + + /// + /// chkPasswordComplexity control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkPasswordComplexity; + + /// + /// RowMinimumUppercase control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow RowMinimumUppercase; /// /// lblMinimumUppercase control. @@ -184,6 +336,15 @@ namespace WebsitePanel.Portal { /// protected global::System.Web.UI.WebControls.RegularExpressionValidator valCorrectUppercase; + /// + /// RowMinimumNumbers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow RowMinimumNumbers; + /// /// lblMinimumNumbers control. /// @@ -220,6 +381,15 @@ namespace WebsitePanel.Portal { /// protected global::System.Web.UI.WebControls.RegularExpressionValidator valCorrectNumbers; + /// + /// RowMinimumSymbols control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow RowMinimumSymbols; + /// /// lblMinimumSymbols control. /// @@ -273,32 +443,5 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.CheckBox chkNotEqualUsername; - - /// - /// lblLockedOut control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Label lblLockedOut; - - /// - /// txtLockedOut control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox txtLockedOut; - - /// - /// valCorrectLockedOut control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.RegularExpressionValidator valCorrectLockedOut; } } 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 e7326a7d..cde0ab55 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj @@ -244,6 +244,13 @@ OrganizationDeletedUserGeneralSettings.ascx ASPXCodeBehind + + OrganizationSettingsPasswordSettings.ascx + ASPXCodeBehind + + + OrganizationSettingsPasswordSettings.ascx + OrganizationUserResetPassword.ascx ASPXCodeBehind @@ -265,6 +272,13 @@ EnterpriseStorageOwaUsersList.ascx + + OrganizationSettingsTabs.ascx + ASPXCodeBehind + + + OrganizationSettingsTabs.ascx + HyperV2012R2_Settings.ascx ASPXCodeBehind @@ -4557,9 +4571,11 @@ + + @@ -4622,6 +4638,8 @@ + + From 606233361f43988e1fb730bc4d342dd7c3f113d1 Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Tue, 7 Apr 2015 01:01:19 -0700 Subject: [PATCH 04/38] organization general settings added --- .../OrganizationProxy.cs | 123 ++++++++++++++++ .../HostedSolution/OrganizationController.cs | 34 +++++ .../UserPasswordExpirationNotificationTask.cs | 4 +- .../esOrganizations.asmx.cs | 12 ++ .../OrganizationGeneralSettings.cs | 7 + .../HostedSolution/OrganizationSettings.cs | 1 + .../WebsitePanel.Providers.Base.csproj | 1 + .../App_Data/WebsitePanel_Modules.config | 1 + .../OrganizationHome.ascx.resx | 2 +- ...anizationSettingsGeneralSettings.ascx.resx | 132 ++++++++++++++++++ ...nizationSettingsPasswordSettings.ascx.resx | 6 + .../OrganizationSettingsGeneralSettings.ascx | 56 ++++++++ ...rganizationSettingsGeneralSettings.ascx.cs | 86 ++++++++++++ ...onSettingsGeneralSettings.ascx.designer.cs | 132 ++++++++++++++++++ .../OrganizationSettingsPasswordSettings.ascx | 10 +- ...nSettingsPasswordSettings.ascx.designer.cs | 18 +++ .../OrganizationSettingsTabs.ascx.resx | 3 + .../OrganizationSettingsTabs.ascx.cs | 3 + .../WebsitePanel.Portal.Modules.csproj | 9 ++ 19 files changed, 635 insertions(+), 5 deletions(-) create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationGeneralSettings.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationSettingsGeneralSettings.ascx.resx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSettingsGeneralSettings.ascx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSettingsGeneralSettings.ascx.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSettingsGeneralSettings.ascx.designer.cs diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs index fa3c8d81..8cb893f1 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs @@ -36,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 UpdateOrganizationGeneralSettingsOperationCompleted; + + private System.Threading.SendOrPostCallback GetOrganizationGeneralSettingsOperationCompleted; + private System.Threading.SendOrPostCallback UpdateOrganizationPasswordSettingsOperationCompleted; private System.Threading.SendOrPostCallback GetOrganizationPasswordSettingsOperationCompleted; @@ -149,6 +153,12 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { this.Url = "http://localhost:9002/esOrganizations.asmx"; } + /// + public event UpdateOrganizationGeneralSettingsCompletedEventHandler UpdateOrganizationGeneralSettingsCompleted; + + /// + public event GetOrganizationGeneralSettingsCompletedEventHandler GetOrganizationGeneralSettingsCompleted; + /// public event UpdateOrganizationPasswordSettingsCompletedEventHandler UpdateOrganizationPasswordSettingsCompleted; @@ -311,6 +321,89 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { /// public event GetSupportServiceLevelCompletedEventHandler GetSupportServiceLevelCompleted; + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/UpdateOrganizationGeneralSettings", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void UpdateOrganizationGeneralSettings(int itemId, OrganizationGeneralSettings settings) { + this.Invoke("UpdateOrganizationGeneralSettings", new object[] { + itemId, + settings}); + } + + /// + public System.IAsyncResult BeginUpdateOrganizationGeneralSettings(int itemId, OrganizationGeneralSettings settings, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("UpdateOrganizationGeneralSettings", new object[] { + itemId, + settings}, callback, asyncState); + } + + /// + public void EndUpdateOrganizationGeneralSettings(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void UpdateOrganizationGeneralSettingsAsync(int itemId, OrganizationGeneralSettings settings) { + this.UpdateOrganizationGeneralSettingsAsync(itemId, settings, null); + } + + /// + public void UpdateOrganizationGeneralSettingsAsync(int itemId, OrganizationGeneralSettings settings, object userState) { + if ((this.UpdateOrganizationGeneralSettingsOperationCompleted == null)) { + this.UpdateOrganizationGeneralSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnUpdateOrganizationGeneralSettingsOperationCompleted); + } + this.InvokeAsync("UpdateOrganizationGeneralSettings", new object[] { + itemId, + settings}, this.UpdateOrganizationGeneralSettingsOperationCompleted, userState); + } + + private void OnUpdateOrganizationGeneralSettingsOperationCompleted(object arg) { + if ((this.UpdateOrganizationGeneralSettingsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.UpdateOrganizationGeneralSettingsCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganizationGeneralSettings", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public OrganizationGeneralSettings GetOrganizationGeneralSettings(int itemId) { + object[] results = this.Invoke("GetOrganizationGeneralSettings", new object[] { + itemId}); + return ((OrganizationGeneralSettings)(results[0])); + } + + /// + public System.IAsyncResult BeginGetOrganizationGeneralSettings(int itemId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetOrganizationGeneralSettings", new object[] { + itemId}, callback, asyncState); + } + + /// + public OrganizationGeneralSettings EndGetOrganizationGeneralSettings(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((OrganizationGeneralSettings)(results[0])); + } + + /// + public void GetOrganizationGeneralSettingsAsync(int itemId) { + this.GetOrganizationGeneralSettingsAsync(itemId, null); + } + + /// + public void GetOrganizationGeneralSettingsAsync(int itemId, object userState) { + if ((this.GetOrganizationGeneralSettingsOperationCompleted == null)) { + this.GetOrganizationGeneralSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetOrganizationGeneralSettingsOperationCompleted); + } + this.InvokeAsync("GetOrganizationGeneralSettings", new object[] { + itemId}, this.GetOrganizationGeneralSettingsOperationCompleted, userState); + } + + private void OnGetOrganizationGeneralSettingsOperationCompleted(object arg) { + if ((this.GetOrganizationGeneralSettingsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetOrganizationGeneralSettingsCompleted(this, new GetOrganizationGeneralSettingsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/UpdateOrganizationPasswordSettings", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] public void UpdateOrganizationPasswordSettings(int itemId, OrganizationPasswordSettings settings) { @@ -3029,6 +3122,36 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void UpdateOrganizationGeneralSettingsCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void GetOrganizationGeneralSettingsCompletedEventHandler(object sender, GetOrganizationGeneralSettingsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetOrganizationGeneralSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetOrganizationGeneralSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public OrganizationGeneralSettings Result { + get { + this.RaiseExceptionIfNecessary(); + return ((OrganizationGeneralSettings)(this.results[0])); + } + } + } + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void UpdateOrganizationPasswordSettingsCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs index 5f0a1e59..e87226ba 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs @@ -1685,6 +1685,40 @@ namespace WebsitePanel.EnterpriseServer return GetOrganizationSettings(itemId, OrganizationSettings.PasswordSettings); } + public static void UpdateOrganizationGeneralSettings(int itemId, OrganizationGeneralSettings settings) + { + TaskManager.StartTask("ORGANIZATION", "UPDATE_GENERAL_SETTINGS"); + + try + { + // load organization + Organization org = GetOrganization(itemId); + + if (org == null) + { + TaskManager.WriteWarning("Organization with itemId '{0}' not found", itemId.ToString()); + return; + } + + var xml = ObjectUtils.Serialize(settings); + + DataProvider.UpdateOrganizationSettings(itemId, OrganizationSettings.GeneralSettings, xml); + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + public static OrganizationGeneralSettings GetOrganizationGeneralSettings(int itemId) + { + return GetOrganizationSettings(itemId, OrganizationSettings.GeneralSettings); + } + private static T GetOrganizationSettings(int itemId, string settingsName) { var entity = ObjectUtils.FillObjectFromDataReader(DataProvider.GetOrganizationSettings(itemId, settingsName)); diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SchedulerTasks/UserPasswordExpirationNotificationTask.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SchedulerTasks/UserPasswordExpirationNotificationTask.cs index afc3b575..4508a845 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SchedulerTasks/UserPasswordExpirationNotificationTask.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SchedulerTasks/UserPasswordExpirationNotificationTask.cs @@ -39,6 +39,8 @@ namespace WebsitePanel.EnterpriseServer { var usersWithExpiredPasswords = OrganizationController.GetOrganizationUsersWithExpiredPassword(organization.Id, daysBeforeNotify); + var generalSettings = OrganizationController.GetOrganizationGeneralSettings(organization.Id); + foreach (var user in usersWithExpiredPasswords) { user.ItemId = organization.Id; @@ -49,7 +51,7 @@ namespace WebsitePanel.EnterpriseServer continue; } - OrganizationController.SendResetUserPasswordEmail(owner, user, "Scheduler Password Expiration Notification", user.PrimaryEmailAddress, string.Empty); + OrganizationController.SendResetUserPasswordEmail(owner, user, "Scheduler Password Expiration Notification", user.PrimaryEmailAddress, generalSettings.OrganizationLogoUrl); } } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs index 0524c2d8..e26cd9f3 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs @@ -47,6 +47,18 @@ namespace WebsitePanel.EnterpriseServer { #region Organizations + [WebMethod] + public void UpdateOrganizationGeneralSettings(int itemId, OrganizationGeneralSettings settings) + { + OrganizationController.UpdateOrganizationGeneralSettings(itemId, settings); + } + + [WebMethod] + public OrganizationGeneralSettings GetOrganizationGeneralSettings(int itemId) + { + return OrganizationController.GetOrganizationGeneralSettings(itemId); + } + [WebMethod] public void UpdateOrganizationPasswordSettings(int itemId, OrganizationPasswordSettings settings) { diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationGeneralSettings.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationGeneralSettings.cs new file mode 100644 index 00000000..345fd0e2 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationGeneralSettings.cs @@ -0,0 +1,7 @@ +namespace WebsitePanel.Providers.HostedSolution +{ + public class OrganizationGeneralSettings + { + public string OrganizationLogoUrl { get; set; } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationSettings.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationSettings.cs index 38e01f95..4fe39b96 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationSettings.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationSettings.cs @@ -3,5 +3,6 @@ public class OrganizationSettings { public const string PasswordSettings = "PasswordSettings"; + public const string GeneralSettings = "GeneralSettings"; } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj index a8951639..ce9cc986 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj @@ -119,6 +119,7 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config index 4a2b2c76..8e94ffca 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config @@ -477,6 +477,7 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationHome.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationHome.ascx.resx index 2e38b9a4..d3d1e91f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationHome.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationHome.ascx.resx @@ -241,6 +241,6 @@ Edit - Organization settings + Organization settings: \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationSettingsGeneralSettings.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationSettingsGeneralSettings.ascx.resx new file mode 100644 index 00000000..5e45627c --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationSettingsGeneralSettings.ascx.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + General settings + + + Organization logo URL: + + + Edit settings + + + * + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationSettingsPasswordSettings.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationSettingsPasswordSettings.ascx.resx index 8387aed9..4aa72a90 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationSettingsPasswordSettings.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationSettingsPasswordSettings.ascx.resx @@ -192,6 +192,9 @@ * + + * + * @@ -204,6 +207,9 @@ * + + * + * diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSettingsGeneralSettings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSettingsGeneralSettings.ascx new file mode 100644 index 00000000..931c6283 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSettingsGeneralSettings.ascx @@ -0,0 +1,56 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="OrganizationSettingsGeneralSettings.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.OrganizationSettingsGeneralSettings" %> + + + +<%@ Register Src="UserControls/OrganizationSettingsTabs.ascx" TagName="CollectionTabs" TagPrefix="wsp" %> +<%@ Register TagPrefix="wsp" TagName="CollapsiblePanel" Src="../UserControls/CollapsiblePanel.ascx" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/ItemButtonPanel.ascx" TagName="ItemButtonPanel" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + + +
    +
    +
    +
    +
    +
    +
    + + + + +
    +
    + + + + + + + + + + + + +
    + + + +
    +
    + +
    + +
    +
    +
    +
    +
    +
    diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSettingsGeneralSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSettingsGeneralSettings.ascx.cs new file mode 100644 index 00000000..e5777b0a --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSettingsGeneralSettings.ascx.cs @@ -0,0 +1,86 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.EnterpriseServer; +using WebsitePanel.Providers.HostedSolution; + +namespace WebsitePanel.Portal.ExchangeServer +{ + public partial class OrganizationSettingsGeneralSettings : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + Organization org = ES.Services.Organizations.GetOrganization(PanelRequest.ItemID); + litOrganizationName.Text = org.OrganizationId; + + BindSettings(); + } + + } + + private void BindSettings() + { + var settings = ES.Services.Organizations.GetOrganizationGeneralSettings(PanelRequest.ItemID); + + if (settings != null) + { + txtOrganizationLogoUrl.Text = settings.OrganizationLogoUrl; + } + } + + protected void btnSave_Click(object sender, EventArgs e) + { + if (!Page.IsValid) + { + return; + } + + SaveGeneralSettings(GetSettings()); + } + + protected void btnSaveExit_Click(object sender, EventArgs e) + { + if (!Page.IsValid) + { + return; + } + + if (SaveGeneralSettings(GetSettings())) + { + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "organization_home", + "SpaceID=" + PanelSecurity.PackageId)); + } + } + + private OrganizationGeneralSettings GetSettings() + { + var settings = new OrganizationGeneralSettings + { + OrganizationLogoUrl = txtOrganizationLogoUrl.Text + }; + + return settings; + } + + + private bool SaveGeneralSettings(OrganizationGeneralSettings settings) + { + try + { + ES.Services.Organizations.UpdateOrganizationGeneralSettings(PanelRequest.ItemID, GetSettings()); + } + catch (Exception ex) + { + ShowErrorMessage("ORANIZATIONSETTINGS_NOT_UPDATED", ex); + return false; + } + + return true; + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSettingsGeneralSettings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSettingsGeneralSettings.ascx.designer.cs new file mode 100644 index 00000000..b3478050 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSettingsGeneralSettings.ascx.designer.cs @@ -0,0 +1,132 @@ +//------------------------------------------------------------------------------ +// +// 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.ExchangeServer { + + + public partial class OrganizationSettingsGeneralSettings { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// Image1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image Image1; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// litOrganizationName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litOrganizationName; + + /// + /// tabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.OrganizationSettingsTabs tabs; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// colGeneralSettings control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel colGeneralSettings; + + /// + /// panelGeneralSettings control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel panelGeneralSettings; + + /// + /// GenerralSettignsTable control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTable GenerralSettignsTable; + + /// + /// lblOrganizationLogoUrl control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblOrganizationLogoUrl; + + /// + /// txtOrganizationLogoUrl control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtOrganizationLogoUrl; + + /// + /// valRequireMinLength control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireMinLength; + + /// + /// buttonPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ItemButtonPanel buttonPanel; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSettingsPasswordSettings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSettingsPasswordSettings.ascx index 0b99d95e..f29446db 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSettingsPasswordSettings.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSettingsPasswordSettings.ascx @@ -23,8 +23,8 @@
    - + + @@ -86,6 +86,8 @@ meta:resourcekey="lblLockedOut" Text="Account Lockout threshold:"> + @@ -96,6 +98,8 @@ meta:resourcekey="lblResetAccountLockout" Text="Reset account lockout counter after (minutes):"> + @@ -154,7 +158,7 @@
    -
    diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSettingsPasswordSettings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSettingsPasswordSettings.ascx.designer.cs index 345b5367..0b6398ac 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSettingsPasswordSettings.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSettingsPasswordSettings.ascx.designer.cs @@ -300,6 +300,15 @@ namespace WebsitePanel.Portal.ExchangeServer { ///
    protected global::System.Web.UI.WebControls.TextBox txtLockedOut; + /// + /// valRequiredLockedOut control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequiredLockedOut; + /// /// valCorrectLockedOut control. /// @@ -336,6 +345,15 @@ namespace WebsitePanel.Portal.ExchangeServer { ///
    protected global::System.Web.UI.WebControls.TextBox txtResetAccountLockout; + /// + /// valRequireResetAccountLockout control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireResetAccountLockout; + /// /// valResetAccountLockout control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/OrganizationSettingsTabs.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/OrganizationSettingsTabs.ascx.resx index ecbb2a94..13e577fc 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/OrganizationSettingsTabs.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/OrganizationSettingsTabs.ascx.resx @@ -117,6 +117,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + General Settings + Password Settings diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/OrganizationSettingsTabs.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/OrganizationSettingsTabs.ascx.cs index 3fa348da..9d8b50bd 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/OrganizationSettingsTabs.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/OrganizationSettingsTabs.ascx.cs @@ -20,8 +20,11 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls private void BindTabs() { List tabsList = new List(); + tabsList.Add(CreateTab("organization_settings_general_settings", "Tab.GeneralSettigns")); tabsList.Add(CreateTab("organization_settings_password_settings", "Tab.PasswordSettings")); + + int idx = 0; foreach (Tab tab in tabsList) 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 cde0ab55..989d4f45 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj @@ -244,6 +244,13 @@ OrganizationDeletedUserGeneralSettings.ascx ASPXCodeBehind
    + + OrganizationSettingsGeneralSettings.ascx + ASPXCodeBehind + + + OrganizationSettingsGeneralSettings.ascx + OrganizationSettingsPasswordSettings.ascx ASPXCodeBehind @@ -4571,6 +4578,7 @@ + @@ -4640,6 +4648,7 @@ + From dd156737522a31429d7000f0abf9a98b0b323414 Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Tue, 7 Apr 2015 03:37:35 -0700 Subject: [PATCH 05/38] organization password reset email added + scheduler fixes --- WebsitePanel/Database/update_db.sql | 115 +++++++++++++ .../Users/UserSettings.cs | 1 + .../HostedSolution/OrganizationController.cs | 25 ++- .../UserPasswordExpirationNotificationTask.cs | 4 +- .../OrganizationProvider.cs | 20 ++- .../SettingsUserPasswordResetLetter.ascx.resx | 153 ++++++++++++++++++ .../UserAccountMailTemplateSettings.ascx.resx | 5 +- .../OrganizationUserResetPassword.ascx.resx | 2 +- .../OrganizationUserResetPassword.ascx | 2 +- .../SettingsUserPasswordResetLetter.ascx | 45 ++++++ .../SettingsUserPasswordResetLetter.ascx.cs | 33 ++++ ...gsUserPasswordResetLetter.ascx.designer.cs | 123 ++++++++++++++ .../UserAccountMailTemplateSettings.ascx | 4 + ...countMailTemplateSettings.ascx.designer.cs | 9 ++ .../WebsitePanel.Portal.Modules.csproj | 9 ++ 15 files changed, 541 insertions(+), 9 deletions(-) create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SettingsUserPasswordResetLetter.ascx.resx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordResetLetter.ascx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordResetLetter.ascx.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordResetLetter.ascx.designer.cs diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index aa60afa4..09db0c57 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -9598,6 +9598,121 @@ UPDATE [dbo].[UserSettings] SET [PropertyValue] = @UserPasswordExpirationLetterT GO +-- USER PASSWORD RESET EMAIL TEMPLATE + + + +IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetLetter' AND [PropertyName]= N'From' ) +BEGIN +INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordResetLetter', N'From', N'support@HostingCompany.com') +END +GO + +DECLARE @UserPasswordResetLetterHtmlBody nvarchar(2500) + +Set @UserPasswordResetLetterHtmlBody = N' + + Password expiration notification + + + +
    +
    + +
    +

    Password reset notification

    + + +

    +Hello #user.FirstName#, +

    +
    + +

    +We received a request to reset the password for your account. If you made this request, click the link below. If you did not make this request, you can ignore this email. +

    + +#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'UserPasswordResetLetter' AND [PropertyName]= N'HtmlBody' ) +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 + + +IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetLetter' AND [PropertyName]= N'Priority' ) +BEGIN +INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordResetLetter', N'Priority', N'Normal') +END +GO +IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'UserPasswordResetLetter' AND [PropertyName]= N'Subject' ) +BEGIN +INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'UserPasswordResetLetter', N'Subject', N'Password reset notification') +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') +END +GO + + +DECLARE @UserPasswordResetLetterTextBody nvarchar(2500) + +Set @UserPasswordResetLetterTextBody = N'========================================= + Password reset notification +========================================= + + +Hello #user.FirstName#, + + +We received a request to reset the password for your account. If you made this request, click the link below. If you did not make this request, you can ignore this email. + +#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'UserPasswordResetLetter' AND [PropertyName]= N'TextBody' ) +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 + + + + -- ORGANIZATION USER PASSWORD RESET TOKENS diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Users/UserSettings.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Users/UserSettings.cs index f6780cf5..3d163d59 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Users/UserSettings.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Users/UserSettings.cs @@ -66,6 +66,7 @@ namespace WebsitePanel.EnterpriseServer public const string RDS_SETUP_LETTER = "RDSSetupLetter"; 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 HOSTED_ORGANIZATION_PASSWORD_POLICY = "MailboxPasswordPolicy"; diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs index e87226ba..f615daaf 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs @@ -1538,23 +1538,40 @@ namespace WebsitePanel.EnterpriseServer throw new Exception(string.Format("Organization not found (ItemId = {0})", itemId)); } + Organizations orgProxy = GetOrganizationProxy(org.ServiceId); + + UserInfo owner = PackageController.GetPackageOwner(org.PackageId); OrganizationUser user = OrganizationController.GetAccount(itemId, accountId); + OrganizationUser settings = orgProxy.GetUserGeneralSettings(user.AccountName, org.OrganizationId); + + user.PasswordExpirationDateTime = settings.PasswordExpirationDateTime; + if (string.IsNullOrEmpty(mailTo)) { mailTo = user.PrimaryEmailAddress; } - SendResetUserPasswordEmail(owner, user, mailTo, reason, string.Empty); + var generalSettings = OrganizationController.GetOrganizationGeneralSettings(itemId); + + var logoUrl = generalSettings != null ? generalSettings.OrganizationLogoUrl : string.Empty; + + SendUserPasswordEmail(owner, user, reason, mailTo, logoUrl, UserSettings.USER_PASSWORD_RESET_LETTER, "USER_PASSWORD_RESET_LETTER"); } - public static void SendResetUserPasswordEmail(UserInfo owner, OrganizationUser user, string reason, string mailTo, string logoUrl) + public static void SendUserExpirationPasswordEmail(UserInfo owner, OrganizationUser user, string reason, + string mailTo, string logoUrl) + { + SendUserPasswordEmail(owner, user, reason, user.PrimaryEmailAddress, logoUrl, UserSettings.USER_PASSWORD_EXPIRATION_LETTER, "USER_PASSWORD_EXPIRATION_LETTER"); + } + + public static void SendUserPasswordEmail(UserInfo owner, OrganizationUser user, string reason, string mailTo, string logoUrl, string settingsName, string taskName) { UserSettings settings = UserController.GetUserSettings(owner.UserId, - UserSettings.USER_PASSWORD_EXPIRATION_LETTER); + settingsName); - TaskManager.StartTask("ORGANIZATION", "SEND_PASSWORD_RESET_EMAIL", user.ItemId); + TaskManager.StartTask("ORGANIZATION", "SEND_" + taskName, user.ItemId); try { diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SchedulerTasks/UserPasswordExpirationNotificationTask.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SchedulerTasks/UserPasswordExpirationNotificationTask.cs index 4508a845..bda161b1 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SchedulerTasks/UserPasswordExpirationNotificationTask.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SchedulerTasks/UserPasswordExpirationNotificationTask.cs @@ -41,6 +41,8 @@ namespace WebsitePanel.EnterpriseServer var generalSettings = OrganizationController.GetOrganizationGeneralSettings(organization.Id); + var logoUrl = generalSettings != null ? generalSettings.OrganizationLogoUrl : string.Empty; + foreach (var user in usersWithExpiredPasswords) { user.ItemId = organization.Id; @@ -51,7 +53,7 @@ namespace WebsitePanel.EnterpriseServer continue; } - OrganizationController.SendResetUserPasswordEmail(owner, user, "Scheduler Password Expiration Notification", user.PrimaryEmailAddress, generalSettings.OrganizationLogoUrl); + OrganizationController.SendUserExpirationPasswordEmail(owner, user, "Scheduler Password Expiration Notification", user.PrimaryEmailAddress, logoUrl); } } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs index ddeeba63..752509c1 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs @@ -490,6 +490,11 @@ namespace WebsitePanel.Providers.HostedSolution { var result = new List(); + if (string.IsNullOrEmpty(organizationId)) + { + return result; + } + var maxPasswordAgeSpan = GetMaxPasswordAge(); var searchRoot = new DirectoryEntry(GetOrganizationPath(organizationId)); @@ -513,7 +518,7 @@ namespace WebsitePanel.Providers.HostedSolution var expirationDate = pwdLastSetDate.AddDays(maxPasswordAgeSpan.Days); - if (pwdLastSetDate > expirationDate.AddDays(-daysBeforeExpiration)) + if (expirationDate.AddDays(-daysBeforeExpiration) < DateTime.Now) { var user = new OrganizationUser(); @@ -866,9 +871,22 @@ namespace WebsitePanel.Providers.HostedSolution retUser.UserPrincipalName = (string)entry.InvokeGet(ADAttributes.UserPrincipalName); retUser.UserMustChangePassword = GetUserMustChangePassword(entry); + retUser.PasswordExpirationDateTime = GetPasswordExpirationDate(entry); + return retUser; } + private DateTime GetPasswordExpirationDate(DirectoryEntry entry) + { + var maxPasswordAgeSpan = GetMaxPasswordAge(); + + var pwdLastSetTicks = ConvertADSLargeIntegerToInt64(entry.Properties[ADAttributes.PwdLastSet].Value); + + var pwdLastSetDate = DateTime.FromFileTimeUtc(pwdLastSetTicks); + + return pwdLastSetDate.AddDays(maxPasswordAgeSpan.Days); + } + private string GetDomainName(string username) { string domain = ActiveDirectoryUtils.GetNETBIOSDomainName(RootDomain); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SettingsUserPasswordResetLetter.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SettingsUserPasswordResetLetter.ascx.resx new file mode 100644 index 00000000..d0758d63 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SettingsUserPasswordResetLetter.ascx.resx @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + High + + + Low + + + Normal + + + From: + + + HTML Body: + + + Logo Url: + + + No Changes HTML Body: + + + No Changes Text Body: + + + Priority: + + + Subject: + + + Text Body: + + \ 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 1ea4b782..cedcfc35 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 @@ -151,6 +151,9 @@ RDS Setup Letter - User Password Expiration Letter + Organization User Password Expiration Letter + + + Organization User Password Reset Letter \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUserResetPassword.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUserResetPassword.ascx.resx index 521750a1..adb7dc30 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUserResetPassword.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUserResetPassword.ascx.resx @@ -118,7 +118,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - Sent Password Reset Email + Send Password Reset Email Email: diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserResetPassword.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserResetPassword.ascx index b49be890..7da8a076 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserResetPassword.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserResetPassword.ascx @@ -36,7 +36,7 @@
    - +
    diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordResetLetter.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordResetLetter.ascx new file mode 100644 index 00000000..48251fb0 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordResetLetter.ascx @@ -0,0 +1,45 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SettingsUserPasswordResetLetter.ascx.cs" Inherits="WebsitePanel.Portal.SettingsUserPasswordResetLetter" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    +
    + + High + Normal + Low + +
    +


    +


    +
    \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordResetLetter.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordResetLetter.ascx.cs new file mode 100644 index 00000000..12cb669b --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordResetLetter.ascx.cs @@ -0,0 +1,33 @@ +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 SettingsUserPasswordResetLetter : 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"]; + } + + 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; + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordResetLetter.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordResetLetter.ascx.designer.cs new file mode 100644 index 00000000..84c322e1 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsUserPasswordResetLetter.ascx.designer.cs @@ -0,0 +1,123 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal { + + + public partial class SettingsUserPasswordResetLetter { + + /// + /// 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; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountMailTemplateSettings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountMailTemplateSettings.ascx index 9df60dfc..f74b84f9 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountMailTemplateSettings.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountMailTemplateSettings.ascx @@ -46,6 +46,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 44f84dd2..e402ebb0 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountMailTemplateSettings.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountMailTemplateSettings.ascx.designer.cs @@ -111,6 +111,15 @@ namespace WebsitePanel.Portal { /// protected global::System.Web.UI.WebControls.HyperLink lnkUserPasswordExpirationLetter; + /// + /// lnkOrganizationUserPasswordResetLetter control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HyperLink lnkOrganizationUserPasswordResetLetter; + /// /// btnCancel control. /// 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 989d4f45..ca2f7100 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj @@ -307,6 +307,13 @@ SettingsUserPasswordExpirationLetter.ascx + + SettingsUserPasswordResetLetter.ascx + ASPXCodeBehind + + + SettingsUserPasswordResetLetter.ascx + HyperV2012R2_Create.ascx ASPXCodeBehind @@ -4587,6 +4594,7 @@ + @@ -4649,6 +4657,7 @@ + From 4bae47e17f6bd518c73101824624e80d429183a6 Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Fri, 10 Apr 2015 02:07:19 -0700 Subject: [PATCH 06/38] webdav portal password change page added --- .../HostedSolution/OrganizationController.cs | 61 +++- .../Security/IAuthenticationService.cs | 1 + .../FormsAuthenticationService.cs | 26 +- .../App_Start/BundleConfig.cs | 3 +- .../App_Start/RouteConfig.cs | 12 + .../App_Start/Routes/AccountRouteNames.cs | 3 + .../Constants/{Formtas.cs => Formats.cs} | 2 +- .../Content/Site.css | 17 + .../Controllers/AccountController.cs | 119 +++++- .../OrganizationPasswordPolicyAttribute.cs | 124 +++++++ .../CustomAttributes/PhoneNumberAttribute.cs | 21 ++ .../WebsitePanel.WebDavPortal/Global.asax.cs | 5 + .../Mapping/AutoMapperPortalConfiguration.cs | 2 + .../Profiles/Account/UserProfileProfile.cs | 67 ++++ .../Webdav/ResourceTableItemProfile.cs | 6 +- .../Models/Account/PasswordChangeModel.cs | 23 ++ .../Models/Account/UserProfile.cs | 62 ++++ .../Models/Common/BaseModel.cs | 2 +- .../Common/EditorTemplates/PasswordEditor.cs | 22 ++ .../Resources/Messages.Designer.cs | 162 +++++++++ .../Resources/Messages.resx | 153 ++++++++ .../Resources/UI.Designer.cs | 342 ++++++++++++++++++ .../Resources/UI.resx | 114 ++++++ .../validation/passwordeditor.unobtrusive.js | 54 +++ .../Scripts/appScripts/wsp.js | 76 +++- .../Views/Account/PasswordChange.cshtml | 31 ++ .../Views/Account/UserProfile.cshtml | 212 +++++++++++ .../EditorTemplates/CountrySelector.cshtml | 264 ++++++++++++++ .../EditorTemplates/PasswordEditor.cshtml | 22 ++ .../Views/Shared/_Layout.cshtml | 13 +- .../WebsitePanel.WebDavPortal.csproj | 22 +- .../WebsitePanel_SharedResources.ascx.resx | 3 + .../ExchangeCreateMailbox.ascx.cs | 19 +- .../OrganizationCreateUser.ascx.cs | 19 +- .../OrganizationUserGeneralSettings.ascx.cs | 19 +- 35 files changed, 2010 insertions(+), 93 deletions(-) rename WebsitePanel/Sources/WebsitePanel.WebDavPortal/Constants/{Formtas.cs => Formats.cs} (81%) create mode 100644 WebsitePanel/Sources/WebsitePanel.WebDavPortal/CustomAttributes/OrganizationPasswordPolicyAttribute.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebDavPortal/CustomAttributes/PhoneNumberAttribute.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebDavPortal/Mapping/Profiles/Account/UserProfileProfile.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/Account/PasswordChangeModel.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/Account/UserProfile.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/Common/EditorTemplates/PasswordEditor.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/Messages.Designer.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/Messages.resx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebDavPortal/Scripts/appScripts/validation/passwordeditor.unobtrusive.js create mode 100644 WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Account/PasswordChange.cshtml create mode 100644 WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Account/UserProfile.cshtml create mode 100644 WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Shared/EditorTemplates/CountrySelector.cshtml create mode 100644 WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Shared/EditorTemplates/PasswordEditor.cshtml diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs index f615daaf..733a4642 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs @@ -33,6 +33,7 @@ using System.Collections.Specialized; using System.Data; using System.Net.Mail; using System.Text; +using System.Threading.Tasks; using WebsitePanel.EnterpriseServer.Code.HostedSolution; using WebsitePanel.EnterpriseServer.Code.SharePoint; using WebsitePanel.EnterpriseServer.Extensions; @@ -1699,7 +1700,62 @@ namespace WebsitePanel.EnterpriseServer public static OrganizationPasswordSettings GetOrganizationPasswordSettings(int itemId) { - return GetOrganizationSettings(itemId, OrganizationSettings.PasswordSettings); + var passwordSettings = GetOrganizationSettings(itemId, OrganizationSettings.PasswordSettings); + + if (passwordSettings == null) + { + Organization org = GetOrganization(itemId); + + if (org == null) + { + throw new Exception(string.Format("Organization not found (ItemId = {0})", itemId)); + } + + var package = PackageController.GetPackage(org.PackageId); + + UserSettings userSettings = UserController.GetUserSettings(package.UserId, UserSettings.EXCHANGE_POLICY); + + if (userSettings != null) + { + string policyValue = userSettings["MailboxPasswordPolicy"]; + + if (policyValue != null) + { + string[] parts = policyValue.Split(';'); + + passwordSettings = new OrganizationPasswordSettings + { + MinimumLength = Utils.ParseInt(parts[1], 0), + MaximumLength = Utils.ParseInt(parts[2], 0), + UppercaseLettersCount = Utils.ParseInt(parts[3], 0), + NumbersCount = Utils.ParseInt(parts[4], 0), + SymbolsCount = Utils.ParseInt(parts[5], 0), + AccountLockoutThreshold = Utils.ParseInt(parts[7], 0), + EnforcePasswordHistory = Utils.ParseInt(parts[8], 0), + AccountLockoutDuration = Utils.ParseInt(parts[9], 0), + ResetAccountLockoutCounterAfter = Utils.ParseInt(parts[10], 0), + LockoutSettingsEnabled = Utils.ParseBool(parts[11], false), + PasswordComplexityEnabled = Utils.ParseBool(parts[12], true), + }; + + + PasswordPolicyResult passwordPolicy = GetPasswordPolicy(itemId); + + if (passwordPolicy.IsSuccess) + { + passwordSettings.MinimumLength = passwordPolicy.Value.MinLength; + if (passwordPolicy.Value.IsComplexityEnable) + { + passwordSettings.NumbersCount = 1; + passwordSettings.SymbolsCount = 1; + passwordSettings.UppercaseLettersCount = 1; + } + } + } + } + } + + return passwordSettings; } public static void UpdateOrganizationGeneralSettings(int itemId, OrganizationGeneralSettings settings) @@ -2740,6 +2796,9 @@ namespace WebsitePanel.EnterpriseServer // place log record TaskManager.StartTask("ORGANIZATION", "SET_USER_PASSWORD", itemId); + TaskManager.Write("ItemId: {0}", itemId.ToString()); + TaskManager.Write("AccountId: {0}", accountId.ToString()); + try { // load organization diff --git a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Interfaces/Security/IAuthenticationService.cs b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Interfaces/Security/IAuthenticationService.cs index 0cddd68c..2c526578 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Interfaces/Security/IAuthenticationService.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Interfaces/Security/IAuthenticationService.cs @@ -14,5 +14,6 @@ namespace WebsitePanel.WebDav.Core.Interfaces.Security WspPrincipal LogIn(string login, string password); void CreateAuthenticationTicket(WspPrincipal principal); void LogOut(); + bool ValidateAuthenticationData(string login, string password); } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Security/Authentication/FormsAuthenticationService.cs b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Security/Authentication/FormsAuthenticationService.cs index f802b9b8..972589f3 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Security/Authentication/FormsAuthenticationService.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Security/Authentication/FormsAuthenticationService.cs @@ -26,14 +26,7 @@ namespace WebsitePanel.WebDav.Core.Security.Authentication public WspPrincipal LogIn(string login, string password) { - if (string.IsNullOrEmpty(login) || string.IsNullOrEmpty(password)) - { - return null; - } - - var user = UserPrincipal.FindByIdentity(_principalContext, IdentityType.UserPrincipalName, login); - - if (user == null || _principalContext.ValidateCredentials(login, password) == false) + if (ValidateAuthenticationData(login, password) == false) { return null; } @@ -83,5 +76,22 @@ namespace WebsitePanel.WebDav.Core.Security.Authentication { FormsAuthentication.SignOut(); } + + public bool ValidateAuthenticationData(string login, string password) + { + if (string.IsNullOrEmpty(login) || string.IsNullOrEmpty(password)) + { + return false; + } + + var user = UserPrincipal.FindByIdentity(_principalContext, IdentityType.UserPrincipalName, login); + + if (user == null || _principalContext.ValidateCredentials(login, password) == false) + { + return false; + } + + return true; + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/App_Start/BundleConfig.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/App_Start/BundleConfig.cs index d3be4e58..1986068a 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/App_Start/BundleConfig.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/App_Start/BundleConfig.cs @@ -17,7 +17,8 @@ namespace WebsitePanel.WebDavPortal bundles.Add(jQueryBundle); bundles.Add(new ScriptBundle("~/bundles/jqueryval").Include( - "~/Scripts/jquery.validate*")); + "~/Scripts/jquery.validate*", + "~/Scripts/appScripts/validation/passwordeditor.unobtrusive.js")); // Use the development version of Modernizr to develop with and learn from. Then, when you're // ready for production, use the build tool at http://modernizr.com to pick only the tests you need. diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/App_Start/RouteConfig.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/App_Start/RouteConfig.cs index bf48c585..93bf1f75 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/App_Start/RouteConfig.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/App_Start/RouteConfig.cs @@ -12,6 +12,18 @@ namespace WebsitePanel.WebDavPortal #region Account + routes.MapRoute( + name: AccountRouteNames.UserProfile, + url: "account/profile", + defaults: new { controller = "Account", action = "UserProfile" } + ); + + routes.MapRoute( + name: AccountRouteNames.PasswordChange, + url: "account/profile/password-change", + defaults: new { controller = "Account", action = "PasswordChange" } + ); + routes.MapRoute( name: AccountRouteNames.Logout, url: "account/logout", diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/App_Start/Routes/AccountRouteNames.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/App_Start/Routes/AccountRouteNames.cs index 035fde95..36f4c562 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/App_Start/Routes/AccountRouteNames.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/App_Start/Routes/AccountRouteNames.cs @@ -9,5 +9,8 @@ namespace WebsitePanel.WebDavPortal.UI.Routes { public const string Logout = "AccountLogout"; public const string Login = "AccountLogin"; + public const string UserProfile = "UserProfileRoute"; + + public const string PasswordChange = "PasswordChangeRoute"; } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Constants/Formtas.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Constants/Formats.cs similarity index 81% rename from WebsitePanel/Sources/WebsitePanel.WebDavPortal/Constants/Formtas.cs rename to WebsitePanel/Sources/WebsitePanel.WebDavPortal/Constants/Formats.cs index 9c4127ab..775cd9b3 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Constants/Formtas.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Constants/Formats.cs @@ -1,6 +1,6 @@ namespace WebsitePanel.WebDavPortal.Constants { - public class Formtas + public class Formats { public const string DateFormatWithTime = "MM/dd/yyyy hh:mm tt"; } diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Content/Site.css b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Content/Site.css index 609ab5d0..1cbed98d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Content/Site.css +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Content/Site.css @@ -231,6 +231,23 @@ tr.selected-file { } +.navbar-fixed-top #user-profile { + font-size: 18px; + text-decoration: none; +} + +.navbar-fixed-top #user-profile:hover { + text-decoration: none; +} + +.user-profile .password-information { + padding-top: 7px; +} + +.user-profile .login-name { + padding-top: 7px; +} + .web-dav-folder-progress { margin-bottom: 0px; } diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Controllers/AccountController.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Controllers/AccountController.cs index 6af67e4b..091e4899 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Controllers/AccountController.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Controllers/AccountController.cs @@ -2,11 +2,16 @@ using System.Net; using System.Web.Mvc; using System.Web.Routing; +using AutoMapper; +using WebsitePanel.Providers.HostedSolution; using WebsitePanel.WebDav.Core.Config; using WebsitePanel.WebDav.Core.Security.Authentication; using WebsitePanel.WebDav.Core.Security.Cryptography; +using WebsitePanel.WebDavPortal.CustomAttributes; using WebsitePanel.WebDavPortal.Models; +using WebsitePanel.WebDavPortal.Models.Account; using WebsitePanel.WebDavPortal.Models.Common; +using WebsitePanel.WebDavPortal.Models.Common.EditorTemplates; using WebsitePanel.WebDavPortal.Models.Common.Enums; using WebsitePanel.WebDavPortal.UI.Routes; using WebsitePanel.WebDav.Core.Interfaces.Security; @@ -14,7 +19,7 @@ using WebsitePanel.WebDav.Core; namespace WebsitePanel.WebDavPortal.Controllers { - [AllowAnonymous] + [LdapAuthorization] public class AccountController : Controller { private readonly ICryptography _cryptography; @@ -27,6 +32,8 @@ namespace WebsitePanel.WebDavPortal.Controllers } [HttpGet] + [AllowAnonymous] + public ActionResult Login() { if (WspContext.User != null && WspContext.User.Identity.IsAuthenticated) @@ -38,6 +45,7 @@ namespace WebsitePanel.WebDavPortal.Controllers } [HttpPost] + [AllowAnonymous] public ActionResult Login(AccountModel model) { var user = _authenticationService.LogIn(model.Login, model.Password); @@ -63,5 +71,114 @@ namespace WebsitePanel.WebDavPortal.Controllers return RedirectToRoute(AccountRouteNames.Login); } + + [HttpGet] + public ActionResult UserProfile() + { + var model = GetUserProfileModel(WspContext.User.ItemId, WspContext.User.AccountId); + + return View(model); + } + + [HttpPost] + [ValidateAntiForgeryToken] + public ActionResult UserProfile(UserProfile model) + { + if (!ModelState.IsValid) + { + return View(model); + } + + int result = UpdateUserProfile(WspContext.User.ItemId, WspContext.User.AccountId, model); + + model.AddMessage(MessageType.Success, Resources.UI.UserProfileSuccessfullyUpdated); + + return View(model); + } + + [HttpGet] + public ActionResult PasswordChange() + { + var model = new PasswordChangeModel(); + model.PasswordEditor.Settings = WspContext.Services.Organizations.GetOrganizationPasswordSettings(WspContext.User.ItemId); + + return View(model); + } + + [HttpPost] + public ActionResult PasswordChange(PasswordChangeModel model) + { + if (!ModelState.IsValid) + { + return View(model); + } + + if (_authenticationService.ValidateAuthenticationData(WspContext.User.Login, model.OldPassword) == false) + { + model.AddMessage(MessageType.Error, Resources.Messages.OldPasswordIsNotCorrect); + + return View(model); + } + + WspContext.Services.Organizations.SetUserPassword( + WspContext.User.ItemId, WspContext.User.AccountId, + model.PasswordEditor.NewPassword); + + return RedirectToRoute(AccountRouteNames.UserProfile); + } + + #region Helpers + + private UserProfile GetUserProfileModel(int itemId, int accountId) + { + var user = WspContext.Services.Organizations.GetUserGeneralSettings(itemId, accountId); + + return Mapper.Map(user); + } + + private int UpdateUserProfile(int itemId, int accountId, UserProfile model) + { + var user = WspContext.Services.Organizations.GetUserGeneralSettings(itemId, accountId); + + return WspContext.Services.Organizations.SetUserGeneralSettings( + itemId, accountId, + model.DisplayName, + string.Empty, + false, + user.Disabled, + user.Locked, + + model.FirstName, + model.Initials, + model.LastName, + + model.Address, + model.City, + model.State, + model.Zip, + model.Country, + + user.JobTitle, + user.Company, + user.Department, + user.Office, + user.Manager == null ? null : user.Manager.AccountName, + + model.BusinessPhone, + model.Fax, + model.HomePhone, + model.MobilePhone, + model.Pager, + model.WebPage, + model.Notes, + model.ExternalEmail, + user.SubscriberNumber, + user.LevelId, + user.IsVIP, + user.UserMustChangePassword); + } + + #endregion + } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/CustomAttributes/OrganizationPasswordPolicyAttribute.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/CustomAttributes/OrganizationPasswordPolicyAttribute.cs new file mode 100644 index 00000000..14cfd4c1 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/CustomAttributes/OrganizationPasswordPolicyAttribute.cs @@ -0,0 +1,124 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Web.Mvc; +using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.WebDav.Core; + +namespace WebsitePanel.WebDavPortal.CustomAttributes +{ + [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = false)] + public class OrganizationPasswordPolicyAttribute : ValidationAttribute, IClientValidatable + { + public OrganizationPasswordSettings Settings { get; private set; } + + public OrganizationPasswordPolicyAttribute() + { + Settings = WspContext.Services.Organizations.GetOrganizationPasswordSettings(WspContext.User.ItemId); + } + + protected override ValidationResult IsValid(object value, ValidationContext validationContext) + { + if (value != null && WspContext.User != null) + { + + var resultMessages = new List(); + + if (Settings != null) + { + var valueString = value.ToString(); + + if (valueString.Length < Settings.MinimumLength) + { + resultMessages.Add(string.Format(Resources.Messages.PasswordMinLengthFormat, + Settings.MinimumLength)); + } + + if (valueString.Length > Settings.MaximumLength) + { + resultMessages.Add(string.Format(Resources.Messages.PasswordMaxLengthFormat, + Settings.MaximumLength)); + } + + if (Settings.PasswordComplexityEnabled) + { + var symbolsCount = valueString.Count(Char.IsSymbol); + var numbersCount = valueString.Count(Char.IsDigit); + var upperLetterCount = valueString.Count(Char.IsUpper); + + if (upperLetterCount < Settings.UppercaseLettersCount) + { + resultMessages.Add(string.Format(Resources.Messages.PasswordUppercaseCountFormat, + Settings.UppercaseLettersCount)); + } + + if (numbersCount < Settings.NumbersCount) + { + resultMessages.Add(string.Format(Resources.Messages.PasswordNumbersCountFormat, + Settings.NumbersCount)); + } + + if (symbolsCount < Settings.SymbolsCount) + { + resultMessages.Add(string.Format(Resources.Messages.PasswordSymbolsCountFormat, + Settings.SymbolsCount)); + } + } + + } + + return resultMessages.Any()? new ValidationResult(string.Join("
    ", resultMessages)) : ValidationResult.Success; + } + + return ValidationResult.Success; + } + + public IEnumerable GetClientValidationRules(ModelMetadata metadata, ControllerContext context) + { + var rule = new ModelClientValidationRule(); + + rule.ErrorMessage = string.Format(Resources.Messages.PasswordMinLengthFormat, Settings.MinimumLength); + rule.ValidationParameters.Add("count", Settings.MinimumLength); + rule.ValidationType = "minimumlength"; + + yield return rule; + + rule = new ModelClientValidationRule(); + + rule.ErrorMessage = string.Format(Resources.Messages.PasswordMaxLengthFormat, Settings.MaximumLength); + rule.ValidationParameters.Add("count", Settings.MaximumLength); + rule.ValidationType = "maximumlength"; + + yield return rule; + + if (Settings.PasswordComplexityEnabled) + { + rule = new ModelClientValidationRule(); + + rule.ErrorMessage = string.Format(Resources.Messages.PasswordUppercaseCountFormat, Settings.UppercaseLettersCount); + rule.ValidationParameters.Add("count", Settings.UppercaseLettersCount); + rule.ValidationType = "uppercasecount"; + + yield return rule; + + rule = new ModelClientValidationRule(); + + rule.ErrorMessage = string.Format(Resources.Messages.PasswordNumbersCountFormat, Settings.NumbersCount); + rule.ValidationParameters.Add("count", Settings.NumbersCount); + rule.ValidationType = "numberscount"; + + yield return rule; + + rule = new ModelClientValidationRule(); + + rule.ErrorMessage = string.Format(Resources.Messages.PasswordSymbolsCountFormat, Settings.SymbolsCount); + rule.ValidationParameters.Add("count", Settings.SymbolsCount); + rule.ValidationType = "symbolscount"; + + yield return rule; + } + } + + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/CustomAttributes/PhoneNumberAttribute.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/CustomAttributes/PhoneNumberAttribute.cs new file mode 100644 index 00000000..92f4c862 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/CustomAttributes/PhoneNumberAttribute.cs @@ -0,0 +1,21 @@ +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Web.Mvc; + +namespace WebsitePanel.WebDavPortal.CustomAttributes +{ + public class PhoneNumberAttribute : RegularExpressionAttribute, IClientValidatable + { + public const string PhonePattern = @"^\+?(\d[\d-. ]+)?(\([\d-. ]+\))?[\d-. ]+\d$"; + + public PhoneNumberAttribute() + : base(PhonePattern) + { + } + + public IEnumerable GetClientValidationRules(ModelMetadata metadata, ControllerContext context) + { + yield return new ModelClientValidationRegexRule(FormatErrorMessage(metadata.GetDisplayName()), Pattern); + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Global.asax.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Global.asax.cs index fd14b881..fa9a357c 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Global.asax.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Global.asax.cs @@ -15,6 +15,7 @@ using WebsitePanel.WebDav.Core.Security.Authentication.Principals; using WebsitePanel.WebDav.Core.Security.Cryptography; using WebsitePanel.WebDavPortal.App_Start; using WebsitePanel.WebDavPortal.Controllers; +using WebsitePanel.WebDavPortal.CustomAttributes; using WebsitePanel.WebDavPortal.DependencyInjection; using WebsitePanel.WebDavPortal.HttpHandlers; using WebsitePanel.WebDavPortal.Mapping; @@ -39,6 +40,10 @@ namespace WebsitePanel.WebDavPortal Mapper.AssertConfigurationIsValid(); log4net.Config.XmlConfigurator.Configure(); + + DataAnnotationsModelValidatorProvider.RegisterAdapter( + typeof(PhoneNumberAttribute), + typeof(RegularExpressionAttributeAdapter)); } protected void Application_Error(object sender, EventArgs e) diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Mapping/AutoMapperPortalConfiguration.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Mapping/AutoMapperPortalConfiguration.cs index 060bb3af..b13fbf4c 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Mapping/AutoMapperPortalConfiguration.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Mapping/AutoMapperPortalConfiguration.cs @@ -1,4 +1,5 @@ using AutoMapper; +using WebsitePanel.WebDavPortal.Mapping.Profiles.Account; using WebsitePanel.WebDavPortal.Mapping.Profiles.Webdav; namespace WebsitePanel.WebDavPortal.Mapping @@ -10,6 +11,7 @@ namespace WebsitePanel.WebDavPortal.Mapping Mapper.Initialize( config => { + config.AddProfile(); config.AddProfile(); }); } diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Mapping/Profiles/Account/UserProfileProfile.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Mapping/Profiles/Account/UserProfileProfile.cs new file mode 100644 index 00000000..4f92103e --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Mapping/Profiles/Account/UserProfileProfile.cs @@ -0,0 +1,67 @@ +using System; +using System.IO; +using AutoMapper; +using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.WebDav.Core.Client; +using WebsitePanel.WebDav.Core.Config; +using WebsitePanel.WebDav.Core.Extensions; +using WebsitePanel.WebDavPortal.Constants; +using WebsitePanel.WebDavPortal.FileOperations; +using WebsitePanel.WebDavPortal.Models.Account; +using WebsitePanel.WebDavPortal.Models.FileSystem; + +namespace WebsitePanel.WebDavPortal.Mapping.Profiles.Account +{ + public class UserProfileProfile : Profile + { + /// + /// Gets the name of the profile. + /// + /// + /// The name of the profile. + /// + public override string ProfileName + { + get + { + return this.GetType().Name; + } + } + + /// + /// Override this method in a derived class and call the CreateMap method to associate that map with this profile. + /// Avoid calling the class from this method. + /// + protected override void Configure() + { + Mapper.CreateMap() + .ForMember(ti => ti.PrimaryEmailAddress, x => x.MapFrom(hi => hi.PrimaryEmailAddress)) + .ForMember(ti => ti.DisplayName, x => x.MapFrom(hi => hi.DisplayName)) + .ForMember(ti => ti.DisplayName, x => x.MapFrom(hi => hi.DisplayName)) + .ForMember(ti => ti.AccountName, x => x.MapFrom(hi => hi.AccountName)) + .ForMember(ti => ti.FirstName, x => x.MapFrom(hi => hi.FirstName)) + .ForMember(ti => ti.Initials, x => x.MapFrom(hi => hi.Initials)) + .ForMember(ti => ti.LastName, x => x.MapFrom(hi => hi.LastName)) + .ForMember(ti => ti.JobTitle, x => x.MapFrom(hi => hi.JobTitle)) + .ForMember(ti => ti.Company, x => x.MapFrom(hi => hi.Company)) + .ForMember(ti => ti.Department, x => x.MapFrom(hi => hi.Department)) + .ForMember(ti => ti.Office, x => x.MapFrom(hi => hi.Office)) + .ForMember(ti => ti.BusinessPhone, x => x.MapFrom(hi => hi.BusinessPhone)) + .ForMember(ti => ti.Fax, x => x.MapFrom(hi => hi.Fax)) + .ForMember(ti => ti.HomePhone, x => x.MapFrom(hi => hi.HomePhone)) + .ForMember(ti => ti.MobilePhone, x => x.MapFrom(hi => hi.MobilePhone)) + .ForMember(ti => ti.Pager, x => x.MapFrom(hi => hi.Pager)) + .ForMember(ti => ti.WebPage, x => x.MapFrom(hi => hi.WebPage)) + .ForMember(ti => ti.Address, x => x.MapFrom(hi => hi.Address)) + .ForMember(ti => ti.City, x => x.MapFrom(hi => hi.City)) + .ForMember(ti => ti.State, x => x.MapFrom(hi => hi.State)) + .ForMember(ti => ti.Zip, x => x.MapFrom(hi => hi.Zip)) + .ForMember(ti => ti.Country, x => x.MapFrom(hi => hi.Country)) + .ForMember(ti => ti.Notes, x => x.MapFrom(hi => hi.Notes)) + .ForMember(ti => ti.PasswordExpirationDateTime, x => x.MapFrom(hi => hi.PasswordExpirationDateTime)) + .ForMember(ti => ti.ExternalEmail, x => x.MapFrom(hi => hi.ExternalEmail)) + .ForMember(ti => ti.Messages, x => x.Ignore()); + } + } +} + diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Mapping/Profiles/Webdav/ResourceTableItemProfile.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Mapping/Profiles/Webdav/ResourceTableItemProfile.cs index 92987801..579911bc 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Mapping/Profiles/Webdav/ResourceTableItemProfile.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Mapping/Profiles/Webdav/ResourceTableItemProfile.cs @@ -44,12 +44,16 @@ namespace WebsitePanel.WebDavPortal.Mapping.Profiles.Webdav .ForMember(ti => ti.IconHref, x => x.MapFrom(hi => hi.ItemType == ItemType.Folder ? WebDavAppConfigManager.Instance.FileIcons.FolderPath.Trim('~') : WebDavAppConfigManager.Instance.FileIcons[Path.GetExtension(hi.DisplayName.Trim('/'))].Trim('~'))) .ForMember(ti => ti.IsTargetBlank, x => x.MapFrom(hi => openerManager.GetIsTargetBlank(hi))) .ForMember(ti => ti.LastModified, x => x.MapFrom(hi => hi.LastModified)) - .ForMember(ti => ti.LastModifiedFormated, x => x.MapFrom(hi => hi.LastModified == DateTime.MinValue ? "--" : (new WebDavResource(null, hi)).LastModified.ToString(Formtas.DateFormatWithTime))) + .ForMember(ti => ti.LastModifiedFormated, x => x.MapFrom(hi => hi.LastModified == DateTime.MinValue ? "--" : (new WebDavResource(null, hi)).LastModified.ToString(Formats.DateFormatWithTime))) .ForMember(ti => ti.Summary, x => x.MapFrom(hi => hi.Summary)) .ForMember(ti => ti.IsRoot, x => x.MapFrom(hi => hi.IsRootItem)) .ForMember(ti => ti.Size, x => x.MapFrom(hi => hi.ContentLength)) .ForMember(ti => ti.Quota, x => x.MapFrom(hi => hi.AllocatedSpace)) + .ForMember(ti => ti.Url, x => x.Ignore()) + .ForMember(ti => ti.FolderUrlAbsoluteString, x => x.Ignore()) + .ForMember(ti => ti.FolderUrlLocalString, x => x.Ignore()) + .ForMember(ti => ti.FolderName, x => x.Ignore()) .ForMember(ti => ti.IsFolder, x => x.MapFrom(hi => hi.ItemType == ItemType.Folder)); } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/Account/PasswordChangeModel.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/Account/PasswordChangeModel.cs new file mode 100644 index 00000000..3efb943a --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/Account/PasswordChangeModel.cs @@ -0,0 +1,23 @@ +using System.ComponentModel.DataAnnotations; +using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.WebDavPortal.Models.Common; +using WebsitePanel.WebDavPortal.Models.Common.EditorTemplates; + +namespace WebsitePanel.WebDavPortal.Models.Account +{ + public class PasswordChangeModel : BaseModel + { + [Display(ResourceType = typeof (Resources.UI), Name = "OldPassword")] + [Required(ErrorMessageResourceType = typeof (Resources.Messages), ErrorMessageResourceName = "Required")] + public string OldPassword { get; set; } + + [UIHint("PasswordEditor")] + public PasswordEditor PasswordEditor { get; set; } + + + public PasswordChangeModel() + { + PasswordEditor = new PasswordEditor(); + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/Account/UserProfile.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/Account/UserProfile.cs new file mode 100644 index 00000000..a38046aa --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/Account/UserProfile.cs @@ -0,0 +1,62 @@ +using System; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using System.Security.AccessControl; +using WebsitePanel.WebDavPortal.CustomAttributes; +using WebsitePanel.WebDavPortal.Models.Common; + +namespace WebsitePanel.WebDavPortal.Models.Account +{ + public class UserProfile : BaseModel + { + [Display(ResourceType = typeof(Resources.UI), Name = "PrimaryEmail")] + [Required(ErrorMessageResourceType = typeof(Resources.Messages), ErrorMessageResourceName = "Required")] + [EmailAddress(ErrorMessageResourceType = typeof(Resources.Messages), ErrorMessageResourceName = "EmailInvalid", ErrorMessage = null)] + public string PrimaryEmailAddress { get; set; } + + [Display(ResourceType = typeof(Resources.UI), Name = "DisplayName")] + [Required(ErrorMessageResourceType = typeof(Resources.Messages), ErrorMessageResourceName = "Required")] + public string DisplayName { get; set; } + public string AccountName { get; set; } + public string FirstName { get; set; } + public string Initials { get; set; } + public string LastName { get; set; } + public string JobTitle { get; set; } + public string Company { get; set; } + public string Department { get; set; } + public string Office { get; set; } + + [PhoneNumber(ErrorMessageResourceType = typeof(Resources.Messages), ErrorMessageResourceName = "PhoneNumberInvalid")] + public string BusinessPhone { get; set; } + + [PhoneNumber(ErrorMessageResourceType = typeof(Resources.Messages), ErrorMessageResourceName = "PhoneNumberInvalid")] + public string Fax { get; set; } + + [PhoneNumber(ErrorMessageResourceType = typeof(Resources.Messages), ErrorMessageResourceName = "PhoneNumberInvalid")] + public string HomePhone { get; set; } + + [Display(ResourceType = typeof(Resources.UI), Name = "MobilePhone")] + [Required(ErrorMessageResourceType = typeof(Resources.Messages), ErrorMessageResourceName = "Required")] + [PhoneNumber(ErrorMessageResourceType = typeof(Resources.Messages), ErrorMessageResourceName = "PhoneNumberInvalid")] + public string MobilePhone { get; set; } + + [PhoneNumber(ErrorMessageResourceType = typeof(Resources.Messages), ErrorMessageResourceName = "PhoneNumberInvalid")] + public string Pager { get; set; } + + [Url(ErrorMessageResourceType = typeof(Resources.Messages), ErrorMessageResourceName = "UrlInvalid", ErrorMessage = null)] + public string WebPage { get; set; } + public string Address { get; set; } + public string City { get; set; } + public string State { get; set; } + public string Zip { get; set; } + + [EmailAddress(ErrorMessageResourceType = typeof(Resources.Messages), ErrorMessageResourceName = "EmailInvalid", ErrorMessage = null)] + public string ExternalEmail { get; set; } + + [UIHint("CountrySelector")] + public string Country { get; set; } + + public string Notes { get; set; } + public DateTime PasswordExpirationDateTime { get; set; } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/Common/BaseModel.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/Common/BaseModel.cs index 7622e201..77261fa8 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/Common/BaseModel.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/Common/BaseModel.cs @@ -17,7 +17,7 @@ namespace WebsitePanel.WebDavPortal.Models.Common { Messages.Add(new Message { - Type =type, + Type = type, Value = value }); } diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/Common/EditorTemplates/PasswordEditor.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/Common/EditorTemplates/PasswordEditor.cs new file mode 100644 index 00000000..03b30a43 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/Common/EditorTemplates/PasswordEditor.cs @@ -0,0 +1,22 @@ +using System.ComponentModel.DataAnnotations; +using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.WebDavPortal.CustomAttributes; + +namespace WebsitePanel.WebDavPortal.Models.Common.EditorTemplates +{ + public class PasswordEditor + { + + [Display(ResourceType = typeof(Resources.UI), Name = "NewPassword")] + [Required(ErrorMessageResourceType = typeof(Resources.Messages), ErrorMessageResourceName = "Required")] + [OrganizationPasswordPolicy] + public string NewPassword { get; set; } + + [Display(ResourceType = typeof(Resources.UI), Name = "NewPasswordConfirmation")] + [Required(ErrorMessageResourceType = typeof(Resources.Messages), ErrorMessageResourceName = "Required")] + [Compare("NewPassword", ErrorMessageResourceType = typeof(Resources.Messages), ErrorMessageResourceName = "PasswordDoesntMatch")] + public string NewPasswordConfirmation { get; set; } + + public OrganizationPasswordSettings Settings { get; set; } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/Messages.Designer.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/Messages.Designer.cs new file mode 100644 index 00000000..af62e425 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/Messages.Designer.cs @@ -0,0 +1,162 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.33440 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.WebDavPortal.Resources { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class Messages { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Messages() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WebsitePanel.WebDavPortal.Resources.Messages", typeof(Messages).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Email is invalid. + /// + public static string EmailInvalid { + get { + return ResourceManager.GetString("EmailInvalid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Old password is not correct. + /// + public static string OldPasswordIsNotCorrect { + get { + return ResourceManager.GetString("OldPasswordIsNotCorrect", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The password and confirmation password do not match.. + /// + public static string PasswordDoesntMatch { + get { + return ResourceManager.GetString("PasswordDoesntMatch", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Password should be maximum {0} characters. + /// + public static string PasswordMaxLengthFormat { + get { + return ResourceManager.GetString("PasswordMaxLengthFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Password should be at least {0} characters. + /// + public static string PasswordMinLengthFormat { + get { + return ResourceManager.GetString("PasswordMinLengthFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Password should contain at least {0} numbers. + /// + public static string PasswordNumbersCountFormat { + get { + return ResourceManager.GetString("PasswordNumbersCountFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Password should contain at least {0} non-alphanumeric symbols. + /// + public static string PasswordSymbolsCountFormat { + get { + return ResourceManager.GetString("PasswordSymbolsCountFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Password should contain at least {0} UPPERCASE characters. + /// + public static string PasswordUppercaseCountFormat { + get { + return ResourceManager.GetString("PasswordUppercaseCountFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Phone number is invalid. + /// + public static string PhoneNumberInvalid { + get { + return ResourceManager.GetString("PhoneNumberInvalid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} field is required. + /// + public static string Required { + get { + return ResourceManager.GetString("Required", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Url is invalid. + /// + public static string UrlInvalid { + get { + return ResourceManager.GetString("UrlInvalid", resourceCulture); + } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/Messages.resx b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/Messages.resx new file mode 100644 index 00000000..88beb538 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/Messages.resx @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Email is invalid + + + Old password is not correct + + + The password and confirmation password do not match. + + + Password should be maximum {0} characters + + + Password should be at least {0} characters + + + Password should contain at least {0} numbers + + + Password should contain at least {0} non-alphanumeric symbols + + + Password should contain at least {0} UPPERCASE characters + + + Phone number is invalid + + + {0} field is required + + + Url is invalid + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/UI.Designer.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/UI.Designer.cs index f9a6db66..a88478a0 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/UI.Designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/UI.Designer.cs @@ -69,6 +69,42 @@ namespace WebsitePanel.WebDavPortal.Resources { } } + /// + /// Looks up a localized string similar to Address. + /// + public static string Address { + get { + return ResourceManager.GetString("Address", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Address Inforamtion. + /// + public static string AddressInforamtion { + get { + return ResourceManager.GetString("AddressInforamtion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Back. + /// + public static string Back { + get { + return ResourceManager.GetString("Back", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Business Phone. + /// + public static string BusinessPhone { + get { + return ResourceManager.GetString("BusinessPhone", resourceCulture); + } + } + /// /// Looks up a localized string similar to Byte. /// @@ -105,6 +141,24 @@ namespace WebsitePanel.WebDavPortal.Resources { } } + /// + /// Looks up a localized string similar to Change password. + /// + public static string ChangePassword { + get { + return ResourceManager.GetString("ChangePassword", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to City. + /// + public static string City { + get { + return ResourceManager.GetString("City", resourceCulture); + } + } + /// /// Looks up a localized string similar to Close. /// @@ -114,6 +168,15 @@ namespace WebsitePanel.WebDavPortal.Resources { } } + /// + /// Looks up a localized string similar to Company Information. + /// + public static string CompanyInformation { + get { + return ResourceManager.GetString("CompanyInformation", resourceCulture); + } + } + /// /// Looks up a localized string similar to Confirm. /// @@ -123,6 +186,24 @@ namespace WebsitePanel.WebDavPortal.Resources { } } + /// + /// Looks up a localized string similar to Contact Information. + /// + public static string ContactInformation { + get { + return ResourceManager.GetString("ContactInformation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Country/Region. + /// + public static string Country { + get { + return ResourceManager.GetString("Country", resourceCulture); + } + } + /// /// Looks up a localized string similar to Create. /// @@ -168,6 +249,24 @@ namespace WebsitePanel.WebDavPortal.Resources { } } + /// + /// Looks up a localized string similar to Display Name. + /// + public static string DisplayName { + get { + return ResourceManager.GetString("DisplayName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Email. + /// + public static string Email { + get { + return ResourceManager.GetString("Email", resourceCulture); + } + } + /// /// Looks up a localized string similar to Please enter file name. /// @@ -204,6 +303,24 @@ namespace WebsitePanel.WebDavPortal.Resources { } } + /// + /// Looks up a localized string similar to External Email. + /// + public static string ExternalEmail { + get { + return ResourceManager.GetString("ExternalEmail", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Fax. + /// + public static string Fax { + get { + return ResourceManager.GetString("Fax", resourceCulture); + } + } + /// /// Looks up a localized string similar to File. /// @@ -231,6 +348,24 @@ namespace WebsitePanel.WebDavPortal.Resources { } } + /// + /// Looks up a localized string similar to First Name. + /// + public static string FirstName { + get { + return ResourceManager.GetString("FirstName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to General Information. + /// + public static string GeneralInformation { + get { + return ResourceManager.GetString("GeneralInformation", resourceCulture); + } + } + /// /// Looks up a localized string similar to Gb. /// @@ -240,6 +375,24 @@ namespace WebsitePanel.WebDavPortal.Resources { } } + /// + /// Looks up a localized string similar to Here. + /// + public static string Here { + get { + return ResourceManager.GetString("Here", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Home Phone. + /// + public static string HomePhone { + get { + return ResourceManager.GetString("HomePhone", resourceCulture); + } + } + /// /// Looks up a localized string similar to Info. /// @@ -249,6 +402,15 @@ namespace WebsitePanel.WebDavPortal.Resources { } } + /// + /// Looks up a localized string similar to Initials. + /// + public static string Initials { + get { + return ResourceManager.GetString("Initials", resourceCulture); + } + } + /// /// Looks up a localized string similar to File already exist. /// @@ -267,6 +429,15 @@ namespace WebsitePanel.WebDavPortal.Resources { } } + /// + /// Looks up a localized string similar to Job Title. + /// + public static string JobTitle { + get { + return ResourceManager.GetString("JobTitle", resourceCulture); + } + } + /// /// Looks up a localized string similar to KB. /// @@ -276,6 +447,33 @@ namespace WebsitePanel.WebDavPortal.Resources { } } + /// + /// Looks up a localized string similar to Last Name. + /// + public static string LastName { + get { + return ResourceManager.GetString("LastName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Login name. + /// + public static string LoginName { + get { + return ResourceManager.GetString("LoginName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Log out. + /// + public static string LogOut { + get { + return ResourceManager.GetString("LogOut", resourceCulture); + } + } + /// /// Looks up a localized string similar to MB. /// @@ -285,6 +483,15 @@ namespace WebsitePanel.WebDavPortal.Resources { } } + /// + /// Looks up a localized string similar to Mobile Phone. + /// + public static string MobilePhone { + get { + return ResourceManager.GetString("MobilePhone", resourceCulture); + } + } + /// /// Looks up a localized string similar to Modified. /// @@ -303,6 +510,24 @@ namespace WebsitePanel.WebDavPortal.Resources { } } + /// + /// Looks up a localized string similar to New password. + /// + public static string NewPassword { + get { + return ResourceManager.GetString("NewPassword", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Confirm password. + /// + public static string NewPasswordConfirmation { + get { + return ResourceManager.GetString("NewPasswordConfirmation", resourceCulture); + } + } + /// /// Looks up a localized string similar to No files are selected.. /// @@ -321,6 +546,24 @@ namespace WebsitePanel.WebDavPortal.Resources { } } + /// + /// Looks up a localized string similar to Notes. + /// + public static string Notes { + get { + return ResourceManager.GetString("Notes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Old password. + /// + public static string OldPassword { + get { + return ResourceManager.GetString("OldPassword", resourceCulture); + } + } + /// /// Looks up a localized string similar to or drag and drop files here.. /// @@ -330,6 +573,33 @@ namespace WebsitePanel.WebDavPortal.Resources { } } + /// + /// Looks up a localized string similar to Pager. + /// + public static string Pager { + get { + return ResourceManager.GetString("Pager", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Password. + /// + public static string Password { + get { + return ResourceManager.GetString("Password", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Will expire on {0}. If you want to change password then please click {1}.. + /// + public static string PasswordExpirationFormat { + get { + return ResourceManager.GetString("PasswordExpirationFormat", resourceCulture); + } + } + /// /// Looks up a localized string similar to PB. /// @@ -357,6 +627,15 @@ namespace WebsitePanel.WebDavPortal.Resources { } } + /// + /// Looks up a localized string similar to Primary Email. + /// + public static string PrimaryEmail { + get { + return ResourceManager.GetString("PrimaryEmail", resourceCulture); + } + } + /// /// Looks up a localized string similar to Processing. /// @@ -375,6 +654,24 @@ namespace WebsitePanel.WebDavPortal.Resources { } } + /// + /// Looks up a localized string similar to Profile. + /// + public static string Profile { + get { + return ResourceManager.GetString("Profile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Save Changes. + /// + public static string SaveChanges { + get { + return ResourceManager.GetString("SaveChanges", resourceCulture); + } + } + /// /// Looks up a localized string similar to Search. /// @@ -402,6 +699,15 @@ namespace WebsitePanel.WebDavPortal.Resources { } } + /// + /// Looks up a localized string similar to Select. + /// + public static string Select { + get { + return ResourceManager.GetString("Select", resourceCulture); + } + } + /// /// Looks up a localized string similar to Select files to upload. /// @@ -420,6 +726,15 @@ namespace WebsitePanel.WebDavPortal.Resources { } } + /// + /// Looks up a localized string similar to State/Province. + /// + public static string State { + get { + return ResourceManager.GetString("State", resourceCulture); + } + } + /// /// Looks up a localized string similar to Table. /// @@ -456,6 +771,24 @@ namespace WebsitePanel.WebDavPortal.Resources { } } + /// + /// Looks up a localized string similar to User profile successfully updated. + /// + public static string UserProfileSuccessfullyUpdated { + get { + return ResourceManager.GetString("UserProfileSuccessfullyUpdated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Web Page. + /// + public static string WebPage { + get { + return ResourceManager.GetString("WebPage", resourceCulture); + } + } + /// /// Looks up a localized string similar to Word document. /// @@ -473,5 +806,14 @@ namespace WebsitePanel.WebDavPortal.Resources { return ResourceManager.GetString("Yes", resourceCulture); } } + + /// + /// Looks up a localized string similar to Zip/Postal Code. + /// + public static string Zip { + get { + return ResourceManager.GetString("Zip", resourceCulture); + } + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/UI.resx b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/UI.resx index 56929bcc..deda00a1 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/UI.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/UI.resx @@ -120,6 +120,18 @@ Actions + + Address + + + Address Inforamtion + + + Back + + + Business Phone + Byte @@ -132,12 +144,27 @@ Cancel All + + Change password + + + City + Close + + Company Information + Confirm + + Contact Information + + + Country/Region + Create @@ -153,6 +180,12 @@ Are you sure you want to delete {0} item(s)? + + Display Name + + + Email + Please enter file name @@ -165,6 +198,12 @@ Excel workbook + + External Email + + + Fax + File @@ -174,39 +213,90 @@ File Upload + + First Name + + + General Information + Gb + + Here + + + Home Phone + Info + + Initials + File already exist {0} items was removed. + + Job Title + KB + + Last Name + + + Login name + + + Log out + MB + + Mobile Phone + Modified Name + + New password + + + Confirm password + No files are selected. Not a file. + + Notes + + + Old password + or drag and drop files here. + + Pager + + + Password + + + Will expire on {0}. If you want to change password then please click {1}. + PB @@ -216,12 +306,21 @@ Powerpoint presentation + + Primary Email + Processing Processing... + + Profile + + + Save Changes + Search @@ -231,12 +330,18 @@ Search Results + + Select + Select files to upload Size + + State/Province + Table @@ -249,10 +354,19 @@ Upload + + User profile successfully updated + + + Web Page + Word document Yes + + Zip/Postal Code + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Scripts/appScripts/validation/passwordeditor.unobtrusive.js b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Scripts/appScripts/validation/passwordeditor.unobtrusive.js new file mode 100644 index 00000000..799b8f82 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Scripts/appScripts/validation/passwordeditor.unobtrusive.js @@ -0,0 +1,54 @@ +/// +/// + + +$.validator.unobtrusive.adapters.addSingleVal("minimumlength", "count"); + +$.validator.addMethod("minimumlength", function (value, element, count) { + if (value.length < count) { + return false; + } + + return true; +}); + +$.validator.unobtrusive.adapters.addSingleVal("maximumlength", "count"); + +$.validator.addMethod("maximumlength", function (value, element, count) { + if (value.length > count) { + return false; + } + + return true; +}); + +$.validator.unobtrusive.adapters.addSingleVal("uppercasecount", "count"); + +$.validator.addMethod("uppercasecount", function (value, element, count) { + if (value.replace(/[^A-Z]/g, "").length < count) { + return false; + } + + return true; +}); + +$.validator.unobtrusive.adapters.addSingleVal("numberscount", "count"); + +$.validator.addMethod("numberscount", function (value, element, count) { + if (value.replace(/[^0-9]/g, "").length < count) { + return false; + } + + return true; +}); + +$.validator.unobtrusive.adapters.addSingleVal("symbolscount", "count"); + +$.validator.addMethod("symbolscount", function (value, element, count) { + if (value.replace(/[a-zA-Z0-9_]/g, "").length < count) { + + return false; + } + + return true; +}); \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Scripts/appScripts/wsp.js b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Scripts/appScripts/wsp.js index a45da0f1..96a4a5ff 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Scripts/appScripts/wsp.js +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Scripts/appScripts/wsp.js @@ -10,25 +10,11 @@ $(document).on('click', '.processing-dialog', function (e) { }); -$(document).ready(function() { +$(document).ready(function () { + //bootstrap jquery validate styles fix - $.validator.setDefaults({ - highlight: function(element) { - $(element).closest('.form-group').addClass('has-error'); - }, - unhighlight: function(element) { - $(element).closest('.form-group').removeClass('has-error'); - }, - errorElement: 'span', - errorClass: 'help-block', - errorPlacement: function(error, element) { - if (element.parent('.input-group').length) { - error.insertAfter(element.parent()); - } else { - error.insertAfter(element); - } - } - }); + BindBootstrapValidationStyles(); + $.validator.addMethod("synchronousRemote", function(value, element, param) { if (this.optional(element)) { @@ -86,6 +72,60 @@ $(document).ready(function() { }, "Please fix this field."); }); +function BindBootstrapValidationStyles() { + $.validator.setDefaults({ + highlight: function (element) { + $(element).closest('.form-group').addClass('has-error'); + }, + unhighlight: function (element) { + $(element).closest('.form-group').removeClass('has-error'); + }, + errorElement: 'span', + errorClass: 'help-block', + errorPlacement: function (error, element) { + if (element.parent('.input-group').length) { + error.insertAfter(element.parent()); + } else { + error.insertAfter(element); + } + } + }); + + $('.bs-val-styles').each(function () { + var form = $(this); + var formData = $.data(form[0]); + if (formData && formData.validator) { + + var settings = formData.validator.settings; + // Store existing event handlers in local variables + var oldErrorPlacement = settings.errorPlacement; + var oldSuccess = settings.success; + + settings.errorPlacement = function (label, element) { + + oldErrorPlacement(label, element); + + element.closest('.form-group').addClass('has-error'); + label.addClass('text-danger'); + }; + + settings.success = function (label, element) { + $(element).closest('.form-group').removeClass('has-error'); + + oldSuccess(label); + } + } + }); + + $('.input-validation-error').each(function () { + $(this).closest('.form-group').addClass('has-error'); + }); + + $('.field-validation-error').each(function () { + $(this).addClass('text-danger'); + }); +} + $.fn.clearValidation = function () { var v = $(this).validate(); $('[name]', this).each(function () { v.successList.push(this); v.showErrors(); }); v.resetForm(); v.reset(); $(this).find('.form-group').removeClass('has-error'); }; diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Account/PasswordChange.cshtml b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Account/PasswordChange.cshtml new file mode 100644 index 00000000..dafe337e --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Account/PasswordChange.cshtml @@ -0,0 +1,31 @@ +@using WebsitePanel.WebDavPortal.Resources +@using WebsitePanel.WebDavPortal.UI.Routes +@model WebsitePanel.WebDavPortal.Models.Account.PasswordChangeModel + +@{ + Layout = "~/Views/Shared/_Layout.cshtml"; +} +
    + @using (Html.BeginRouteForm(AccountRouteNames.PasswordChange, FormMethod.Post, new { @class = "form-horizontal user-password-change bs-val-styles col-lg-10 col-lg-offset-3", id = "user-password-change" })) + { +
    +

    @UI.ChangePassword

    +
    +
    + +
    + @Html.PasswordFor(x => x.OldPassword, new { @class = "form-control", placeholder = UI.OldPassword }) + @Html.ValidationMessageFor(x => x.OldPassword) +
    +
    + + @Html.EditorFor(x=>x.PasswordEditor) + +
    +
    + +
    +
    + } +
    + diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Account/UserProfile.cshtml b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Account/UserProfile.cshtml new file mode 100644 index 00000000..b08841c4 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Account/UserProfile.cshtml @@ -0,0 +1,212 @@ +@using WebsitePanel.WebDavPortal.Constants +@using WebsitePanel.WebDavPortal.Resources +@using WebsitePanel.WebDavPortal.UI.Routes +@model WebsitePanel.WebDavPortal.Models.Account.UserProfile + +@{ + Layout = "~/Views/Shared/_Layout.cshtml"; + + var passwordExpriationText = string.Format(UI.PasswordExpirationFormat, Model.PasswordExpirationDateTime.ToString(Formats.DateFormatWithTime), Html.RouteLink(UI.Here.ToLowerInvariant(), AccountRouteNames.PasswordChange)); +} + +
    + @using (Html.BeginRouteForm(AccountRouteNames.UserProfile, FormMethod.Post, new { @class = "form-horizontal user-profile bs-val-styles", id = "user-profile-form" })) + { + @Html.HiddenFor(x => x.PasswordExpirationDateTime) + @Html.HiddenFor(x => x.PrimaryEmailAddress) + @Html.AntiForgeryToken() + +
    +
    + +
    +
    + +
    + + +
    + +
    + +
    + @Html.TextBoxFor(x => x.DisplayName, new { @class = "form-control", placeholder = UI.DisplayName }) +
    +
    + +
    + +
    + @Html.TextBoxFor(x => x.FirstName, new { @class = "form-control", placeholder = UI.FirstName }) +
    +
    + +
    + +
    + @Html.TextBoxFor(x => x.Initials, new { @class = "form-control", placeholder = UI.Initials }) +
    +
    + +
    + +
    + @Html.TextBoxFor(x => x.LastName, new { @class = "form-control", placeholder = UI.LastName }) +
    +
    + +
    + +
    + @Html.TextAreaFor(x => x.Notes, new { @class = "form-control", placeholder = UI.Notes }) +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + @Html.TextBoxFor(x => x.ExternalEmail, new { @class = "form-control", placeholder = UI.ExternalEmail }) +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    + +
    + @Html.TextBoxFor(x => x.BusinessPhone, new { @class = "form-control", placeholder = UI.BusinessPhone }) +
    +
    + +
    + +
    + @Html.TextBoxFor(x => x.Fax, new { @class = "form-control", placeholder = UI.Fax }) +
    +
    + +
    + +
    + @Html.TextBoxFor(x => x.HomePhone, new { @class = "form-control", placeholder = UI.HomePhone }) +
    +
    + +
    + +
    + @Html.TextBoxFor(x => x.MobilePhone, new { @class = "form-control", placeholder = UI.MobilePhone }) +
    +
    + +
    + +
    + @Html.TextBoxFor(x => x.Pager, new { @class = "form-control", placeholder = UI.Pager }) +
    +
    + +
    + +
    + @Html.TextBoxFor(x => x.WebPage, new { @class = "form-control", placeholder = UI.WebPage }) +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    + +
    + @Html.TextBoxFor(x => x.Address, new { @class = "form-control", placeholder = UI.Address }) +
    +
    + +
    + +
    + @Html.TextBoxFor(x => x.City, new { @class = "form-control", placeholder = UI.City }) +
    +
    + +
    + +
    + @Html.TextBoxFor(x => x.State, new { @class = "form-control", placeholder = UI.State }) +
    +
    + +
    + +
    + @Html.TextBoxFor(x => x.Zip, new { @class = "form-control", placeholder = UI.Zip }) +
    +
    + +
    + +
    + @Html.EditorFor(x => x.Country) +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    + } +
    + + @section scripts{ + + } diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Shared/EditorTemplates/CountrySelector.cshtml b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Shared/EditorTemplates/CountrySelector.cshtml new file mode 100644 index 00000000..34e18c14 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Shared/EditorTemplates/CountrySelector.cshtml @@ -0,0 +1,264 @@ +@using WebsitePanel.WebDavPortal.Resources +@model string + +@{ + List listItems = new List + { + new SelectListItem {Text = "Afghanistan", Value = "AF"}, + new SelectListItem {Text = "Aland Islands", Value = "AX"}, + new SelectListItem {Text = "Algeria", Value = "DZ"}, + new SelectListItem {Text = "American Samoa", Value = "AS"}, + new SelectListItem {Text = "Andorra", Value = "AD"}, + new SelectListItem {Text = "Angola", Value = "AO"}, + new SelectListItem {Text = "Anguilla", Value = "AI"}, + new SelectListItem {Text = "Antarctica", Value = "AQ"}, + new SelectListItem {Text = "Antigua and Barbuda", Value = "AG"}, + new SelectListItem {Text = "Argentina", Value = "AR"}, + new SelectListItem {Text = "Armenia", Value = "AM"}, + new SelectListItem {Text = "Aruba", Value = "AW"}, + new SelectListItem {Text = "Australia", Value = "AU"}, + }; + + var selectedItem = listItems.FirstOrDefault(x => x.Value == Model); + + if (selectedItem != null) + { + selectedItem.Selected = true; + } + + @*Austria + Azerbaijan + Bahamas + Bahrain + Bangladesh + Barbados + Belarus + Belgium + Belize + Benin + Bermuda + Bhutan + Bolivia, Plurinational State of + Bosnia and Herzegovina + Botswana + Bouvet Island + Brazil + British Indian Ocean Territory + Brunei Darussalam + Bulgaria + Burkina Faso + Burundi + Cambodia + Cameroon + Canada + Cape Verde + Cayman Islands + Central African Republic + Chad + Chile + China + Christmas Island + Cocos (Keeling) Islands + Colombia + Comoros + Congo + Congo, the Democratic Republic of the + Cook Islands + Costa Rica + Cote D'Ivoire + Croatia + Cuba + Cyprus + Czech Republic + Denmark + Djibouti + Dominica + Dominican Republic + Ecuador + Egypt + El Salvador + Equatorial Guinea + Eritrea + Estonia + Ethiopia + Falkland Islands (Malvinas) + Faroe Islands + Fiji + Finland + France + French Guiana + French Polynesia + French Southern Territories + Gabon + Gambia + Georgia + Germany + Ghana + Gibraltar + Greece + Greenland + Grenada + Guadeloupe + Guam + Guatemala + Guernsey + Guinea + Guinea-Bissau + Guyana + Haiti + Heard Island and Mcdonald Islands + Holy See (Vatican City State) + Honduras + Hong Kong + Hungary + Iceland + India + Indonesia + Iran, Islamic Republic of + Iraq + Ireland + Isle of Man + Israel + Italy + Jamaica + Japan + Jersey + Jordan + Kazakhstan + Kenya + Kiribati + Korea, Democratic People's Republic of + Korea, Republic of + Kuwait + Kyrgyzstan + Lao People's Democratic Republic + Latvia + Lebanon + Lesotho + Liberia + Libyan Arab Jamahiriya + Liechtenstein + Lithuania + Luxembourg + Macao + Macedonia, the Former Yugoslav Republic of + Madagascar + Malawi + Malaysia + Maldives + Mali + Malta + Marshall Islands + Martinique + Mauritania + Mauritius + Mayotte + Mexico + Micronesia, Federated States of + Moldova, Republic of + Monaco + Mongolia + Montenegro + Montserrat + Morocco + Mozambique + Myanmar + Namibia + Nauru + Nepal + Netherlands + Netherlands Antilles + New Caledonia + New Zealand + Nicaragua + Niger + Nigeria + Niue + Norfolk Island + Northern Mariana Islands + Norway + Oman + Pakistan + Palau + Palestinian Territory, Occupied + Panama + Papua New Guinea + Paraguay + Peru + Philippines + Pitcairn + Poland + Portugal + Puerto Rico + Qatar + Reunion + Romania + Russian Federation + Rwanda + Saint Barthelemy + Saint Helena + Saint Kitts and Nevis + Saint Lucia + Saint Martin + Saint Pierre and Miquelon + Saint Vincent and the Grenadines + Samoa + San Marino + Sao Tome and Principe + Saudi Arabia + Senegal + Serbia + Seychelles + Sierra Leone + Singapore + Slovakia + Slovenia + Solomon Islands + Somalia + South Africa + South Georgia and the South Sandwich Islands + Spain + Sri Lanka + Sudan + Suriname + Svalbard and Jan Mayen + Swaziland + Sweden + Switzerland + Syrian Arab Republic + Taiwan, Province of China + Tajikistan + Tanzania, United Republic of + Thailand + Timor-Leste + Togo + Tokelau + Tonga + Trinidad and Tobago + Tunisia + Turkey + Turkmenistan + Turks and Caicos Islands + Tuvalu + Uganda + Ukraine + United Arab Emirates + United Kingdom + United States + United States Minor Outlying Islands + Uruguay + Uzbekistan + Vanuatu + Venezuela, Bolivarian Republic of + Viet Nam + Virgin Islands, British + Virgin Islands, U.S. + Wallis and Futuna + Western Sahara + Yemen + Zambia + Zimbabwe*@ + +} + +@Html.DropDownListFor(model => model, listItems, @UI.Select, new { @class = "form-control" }) \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Shared/EditorTemplates/PasswordEditor.cshtml b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Shared/EditorTemplates/PasswordEditor.cshtml new file mode 100644 index 00000000..d285f042 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Shared/EditorTemplates/PasswordEditor.cshtml @@ -0,0 +1,22 @@ +@using WebsitePanel.WebDavPortal.Resources +@model WebsitePanel.WebDavPortal.Models.Common.EditorTemplates.PasswordEditor + +@{ + var settings = Model.Settings; + var maxlength = settings != null ? settings.MaximumLength : 20; +} +
    + +
    + @Html.PasswordFor(x => x.NewPassword, new { @class = "form-control", placeholder = UI.NewPassword, maxlength }) + @Html.Raw(HttpUtility.HtmlDecode(Html.ValidationMessageFor(m => m.NewPassword).ToHtmlString())) +
    +
    + +
    + +
    + @Html.PasswordFor(x => x.NewPasswordConfirmation, new { @class = "form-control", placeholder = UI.NewPasswordConfirmation, maxlength }) + @Html.ValidationMessageFor(x => x.NewPasswordConfirmation) +
    +
    diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Shared/_Layout.cshtml b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Shared/_Layout.cshtml index ba5378f3..25cc02b3 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Shared/_Layout.cshtml +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Shared/_Layout.cshtml @@ -4,6 +4,7 @@ @using WebsitePanel.WebDav.Core.Config @using WebsitePanel.WebDavPortal.DependencyInjection @using WebsitePanel.WebDavPortal.Models +@using WebsitePanel.WebDavPortal.Resources @using WebsitePanel.WebDavPortal.UI.Routes; @model WebsitePanel.WebDavPortal.Models.Common.BaseModel @@ -26,7 +27,7 @@ - +
    @@ -34,8 +35,8 @@ @{ if (WspContext.User != null) { - - + + @WspContext.User.Login } } @@ -65,9 +66,9 @@ @Scripts.Render("~/bundles/authScripts") } diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/WebsitePanel.WebDavPortal.csproj b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/WebsitePanel.WebDavPortal.csproj index 21db106b..67af8355 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/WebsitePanel.WebDavPortal.csproj +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/WebsitePanel.WebDavPortal.csproj @@ -165,13 +165,15 @@ - + + + @@ -188,9 +190,12 @@ + + + @@ -198,6 +203,7 @@ + @@ -208,6 +214,11 @@ + + True + True + Messages.resx + True True @@ -380,6 +391,7 @@ + @@ -465,6 +477,10 @@ + + + + @@ -481,6 +497,10 @@ + + PublicResXFileCodeGenerator + Messages.Designer.cs + PublicResXFileCodeGenerator UI.Designer.cs diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx index 490b50b0..b9b15589 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx @@ -5716,4 +5716,7 @@ Error during updating settings. + + Unable to load password settings + \ No newline at end of file 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 20d3049f..84e1404d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx.cs @@ -129,24 +129,7 @@ namespace WebsitePanel.Portal.ExchangeServer } else { - password.SetPackagePolicy(PanelSecurity.PackageId, UserSettings.EXCHANGE_POLICY, "MailboxPasswordPolicy"); - - PasswordPolicyResult passwordPolicy = ES.Services.Organizations.GetPasswordPolicy(PanelRequest.ItemID); - - if (passwordPolicy.IsSuccess) - { - password.MinimumLength = passwordPolicy.Value.MinLength; - if (passwordPolicy.Value.IsComplexityEnable) - { - password.MinimumNumbers = 1; - password.MinimumSymbols = 1; - password.MinimumUppercase = 1; - } - } - else - { - messageBox.ShowMessage(passwordPolicy, "CREATE_ORGANIZATION_USER", "HostedOrganization"); - } + messageBox.ShowErrorMessage("UNABLETOLOADPASSWORDSETTINGS"); } } 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 11f190db..217ac7f0 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx.cs @@ -82,24 +82,7 @@ namespace WebsitePanel.Portal.HostedSolution } else { - password.SetPackagePolicy(PanelSecurity.PackageId, UserSettings.EXCHANGE_POLICY, "MailboxPasswordPolicy"); - - PasswordPolicyResult passwordPolicy = ES.Services.Organizations.GetPasswordPolicy(PanelRequest.ItemID); - - if (passwordPolicy.IsSuccess) - { - password.MinimumLength = passwordPolicy.Value.MinLength; - if (passwordPolicy.Value.IsComplexityEnable) - { - password.MinimumNumbers = 1; - password.MinimumSymbols = 1; - password.MinimumUppercase = 1; - } - } - else - { - messageBox.ShowMessage(passwordPolicy, "CREATE_ORGANIZATION_USER", "HostedOrganization"); - } + messageBox.ShowErrorMessage("UNABLETOLOADPASSWORDSETTINGS"); } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs index 7eed531f..c4baf96b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs @@ -272,24 +272,7 @@ namespace WebsitePanel.Portal.HostedSolution } else { - password.SetPackagePolicy(PanelSecurity.PackageId, UserSettings.EXCHANGE_POLICY, "MailboxPasswordPolicy"); - - PasswordPolicyResult passwordPolicy = ES.Services.Organizations.GetPasswordPolicy(PanelRequest.ItemID); - - if (passwordPolicy.IsSuccess) - { - password.MinimumLength = passwordPolicy.Value.MinLength; - if (passwordPolicy.Value.IsComplexityEnable) - { - password.MinimumNumbers = 1; - password.MinimumSymbols = 1; - password.MinimumUppercase = 1; - } - } - else - { - messageBox.ShowMessage(passwordPolicy, "CREATE_ORGANIZATION_USER", "HostedOrganization"); - } + messageBox.ShowErrorMessage("UNABLETOLOADPASSWORDSETTINGS"); } } From 599e9a8865fd5783cc35d19a5bd43d9da444a298 Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Tue, 14 Apr 2015 00:40:11 -0700 Subject: [PATCH 07/38] webdav portal password reset added --- WebsitePanel/Database/update_db.sql | 33 ++- .../HostedSolution/AccessToken.cs | 6 +- .../OrganizationProxy.cs | 172 +++++++++++ .../Data/DataProvider.cs | 24 +- .../HostedSolution/OrganizationController.cs | 14 +- .../esOrganizations.asmx.cs | 19 ++ .../OrganizationProvider.cs | 270 ++++++++++++------ .../Config/Entities/SessionKeysCollection.cs | 10 + .../Config/Entities/TwilioParameters.cs | 16 ++ .../Config/IWebDavAppConfig.cs | 1 + .../WebConfigSections/SessionKeysElement.cs | 1 + .../Config/WebConfigSections/TwilioElement.cs | 32 +++ ...DavExplorerConfigurationSettingsSection.cs | 8 + .../Config/WebDavAppConfigManager.cs | 2 + .../Security/ISmsAuthenticationService.cs | 11 + .../Services/ISmsDistributionService.cs | 9 + .../SmsAuthenticationService.cs | 46 +++ .../Services/TwillioSmsDistributionService.cs | 27 ++ .../WebsitePanel.WebDav.Core.csproj | 13 + .../WebsitePanel.WebDav.Core/packages.config | 2 + .../App_Start/RouteConfig.cs | 24 ++ .../App_Start/Routes/AccountRouteNames.cs | 4 + .../Content/Site.css | 3 + .../Controllers/AccountController.cs | 160 ++++++++++- .../OrganizationPasswordPolicyAttribute.cs | 19 +- .../DependencyInjection/PortalDependencies.cs | 4 + .../Models/Account/PasswordResetEmailModel.cs | 14 + .../Models/Account/PasswordResetSmsModel.cs | 12 + .../Common/EditorTemplates/PasswordEditor.cs | 2 +- .../Resources/Messages.Designer.cs | 54 ++++ .../Resources/Messages.resx | 18 ++ .../Resources/UI.Designer.cs | 45 +++ .../Resources/UI.resx | 15 + .../Scripts/_references.js | 36 ++- .../Views/Account/Login.cshtml | 5 +- .../Views/Account/PasswordResetEmail.cshtml | 31 ++ .../Account/PasswordResetEmailSent.cshtml | 14 + .../Account/PasswordResetFinalStep.cshtml | 27 ++ .../Views/Account/PasswordResetSms.cshtml | 38 +++ .../Views/Shared/_Layout.cshtml | 3 +- .../WebsitePanel.WebDavPortal/Web.config | 16 +- .../WebsitePanel.WebDavPortal.csproj | 6 + ...nizationSettingsPasswordSettings.ascx.resx | 2 +- .../ExchangeServer/OrganizationHome.ascx | 2 +- .../OrganizationSettingsPasswordSettings.ascx | 2 +- .../PasswordPolicyEditor.ascx.resx | 2 +- .../UserControls/PasswordPolicyEditor.ascx | 2 +- .../WebsitePanel.Portal.Modules.csproj | 4 +- 48 files changed, 1163 insertions(+), 117 deletions(-) create mode 100644 WebsitePanel/Sources/WebsitePanel.WebDav.Core/Config/Entities/TwilioParameters.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebDav.Core/Config/WebConfigSections/TwilioElement.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebDav.Core/Interfaces/Security/ISmsAuthenticationService.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebDav.Core/Interfaces/Services/ISmsDistributionService.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebDav.Core/Security/Authentication/SmsAuthenticationService.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebDav.Core/Services/TwillioSmsDistributionService.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/Account/PasswordResetEmailModel.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/Account/PasswordResetSmsModel.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Account/PasswordResetEmail.cshtml create mode 100644 WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Account/PasswordResetEmailSent.cshtml create mode 100644 WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Account/PasswordResetFinalStep.cshtml create mode 100644 WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Account/PasswordResetSms.cshtml diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index 09db0c57..3fb95e49 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -9726,7 +9726,8 @@ CREATE TABLE AccessTokens ExpirationDate DATETIME NOT NULL, AccountID INT NOT NULL , ItemId INT NOT NULL, - TokenType INT NOT NULL + TokenType INT NOT NULL, + SmsResponse varchar(100) ) GO @@ -9771,6 +9772,33 @@ RETURN GO +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'SetAccessTokenSmsResponse') +DROP PROCEDURE SetAccessTokenSmsResponse +GO +CREATE PROCEDURE [dbo].[SetAccessTokenSmsResponse] +( + @AccessToken UNIQUEIDENTIFIER, + @SmsResponse varchar(100) +) +AS +UPDATE [dbo].[AccessTokens] SET [SmsResponse] = @SmsResponse WHERE [AccessTokenGuid] = @AccessToken +RETURN +GO + +IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'DeleteAccessToken') +DROP PROCEDURE DeleteAccessToken +GO +CREATE PROCEDURE [dbo].[DeleteAccessToken] +( + @AccessToken UNIQUEIDENTIFIER, + @TokenType INT +) +AS +DELETE FROM AccessTokens +WHERE AccessTokenGuid = @AccessToken AND TokenType = @TokenType +GO + + IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'DeleteExpiredAccessTokenTokens') DROP PROCEDURE DeleteExpiredAccessTokenTokens GO @@ -9796,7 +9824,8 @@ SELECT ExpirationDate, AccountID, ItemId, - TokenType + TokenType, + SmsResponse FROM AccessTokens Where AccessTokenGuid = @AccessToken AND ExpirationDate > getdate() AND TokenType = @TokenType GO diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/HostedSolution/AccessToken.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/HostedSolution/AccessToken.cs index cbb4bf8b..9556d1c3 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/HostedSolution/AccessToken.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/HostedSolution/AccessToken.cs @@ -9,6 +9,10 @@ namespace WebsitePanel.EnterpriseServer.Base.HostedSolution public DateTime ExpirationDate { get; set; } public int AccountId { get; set; } public int ItemId { get; set; } - public AccessTokenTypes Type { get; set; } + public AccessTokenTypes TokenType { get; set; } + public string SmsResponse { get; set; } + public bool IsSmsSent { + get { return !string.IsNullOrEmpty(SmsResponse); } + } } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs index 8cb893f1..92f24a94 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs @@ -18,6 +18,7 @@ using WebsitePanel.Providers.Common; using WebsitePanel.Providers.HostedSolution; using WebsitePanel.Providers.ResultObjects; + namespace WebsitePanel.EnterpriseServer.HostedSolution { using System.Xml.Serialization; using System.Web.Services; @@ -36,6 +37,12 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { [System.Xml.Serialization.XmlIncludeAttribute(typeof(ServiceProviderItem))] public partial class esOrganizations : Microsoft.Web.Services3.WebServicesClientProtocol { + private System.Threading.SendOrPostCallback DeletePasswordresetAccessTokenOperationCompleted; + + private System.Threading.SendOrPostCallback SetAccessTokenResponseOperationCompleted; + + private System.Threading.SendOrPostCallback GetPasswordresetAccessTokenOperationCompleted; + private System.Threading.SendOrPostCallback UpdateOrganizationGeneralSettingsOperationCompleted; private System.Threading.SendOrPostCallback GetOrganizationGeneralSettingsOperationCompleted; @@ -153,6 +160,15 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { this.Url = "http://localhost:9002/esOrganizations.asmx"; } + /// + public event DeletePasswordresetAccessTokenCompletedEventHandler DeletePasswordresetAccessTokenCompleted; + + /// + public event SetAccessTokenResponseCompletedEventHandler SetAccessTokenResponseCompleted; + + /// + public event GetPasswordresetAccessTokenCompletedEventHandler GetPasswordresetAccessTokenCompleted; + /// public event UpdateOrganizationGeneralSettingsCompletedEventHandler UpdateOrganizationGeneralSettingsCompleted; @@ -321,6 +337,128 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { /// public event GetSupportServiceLevelCompletedEventHandler GetSupportServiceLevelCompleted; + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeletePasswordresetAccessToken", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void DeletePasswordresetAccessToken(System.Guid accessToken) { + this.Invoke("DeletePasswordresetAccessToken", new object[] { + accessToken}); + } + + /// + public System.IAsyncResult BeginDeletePasswordresetAccessToken(System.Guid accessToken, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("DeletePasswordresetAccessToken", new object[] { + accessToken}, callback, asyncState); + } + + /// + public void EndDeletePasswordresetAccessToken(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void DeletePasswordresetAccessTokenAsync(System.Guid accessToken) { + this.DeletePasswordresetAccessTokenAsync(accessToken, null); + } + + /// + public void DeletePasswordresetAccessTokenAsync(System.Guid accessToken, object userState) { + if ((this.DeletePasswordresetAccessTokenOperationCompleted == null)) { + this.DeletePasswordresetAccessTokenOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeletePasswordresetAccessTokenOperationCompleted); + } + this.InvokeAsync("DeletePasswordresetAccessToken", new object[] { + accessToken}, this.DeletePasswordresetAccessTokenOperationCompleted, userState); + } + + private void OnDeletePasswordresetAccessTokenOperationCompleted(object arg) { + if ((this.DeletePasswordresetAccessTokenCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.DeletePasswordresetAccessTokenCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SetAccessTokenResponse", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void SetAccessTokenResponse(System.Guid accessToken, string response) { + this.Invoke("SetAccessTokenResponse", new object[] { + accessToken, + response}); + } + + /// + public System.IAsyncResult BeginSetAccessTokenResponse(System.Guid accessToken, string response, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("SetAccessTokenResponse", new object[] { + accessToken, + response}, callback, asyncState); + } + + /// + public void EndSetAccessTokenResponse(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void SetAccessTokenResponseAsync(System.Guid accessToken, string response) { + this.SetAccessTokenResponseAsync(accessToken, response, null); + } + + /// + public void SetAccessTokenResponseAsync(System.Guid accessToken, string response, object userState) { + if ((this.SetAccessTokenResponseOperationCompleted == null)) { + this.SetAccessTokenResponseOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetAccessTokenResponseOperationCompleted); + } + this.InvokeAsync("SetAccessTokenResponse", new object[] { + accessToken, + response}, this.SetAccessTokenResponseOperationCompleted, userState); + } + + private void OnSetAccessTokenResponseOperationCompleted(object arg) { + if ((this.SetAccessTokenResponseCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.SetAccessTokenResponseCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetPasswordresetAccessToken", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public AccessToken GetPasswordresetAccessToken(System.Guid token) { + object[] results = this.Invoke("GetPasswordresetAccessToken", new object[] { + token}); + return ((AccessToken)(results[0])); + } + + /// + public System.IAsyncResult BeginGetPasswordresetAccessToken(System.Guid token, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetPasswordresetAccessToken", new object[] { + token}, callback, asyncState); + } + + /// + public AccessToken EndGetPasswordresetAccessToken(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((AccessToken)(results[0])); + } + + /// + public void GetPasswordresetAccessTokenAsync(System.Guid token) { + this.GetPasswordresetAccessTokenAsync(token, null); + } + + /// + public void GetPasswordresetAccessTokenAsync(System.Guid token, object userState) { + if ((this.GetPasswordresetAccessTokenOperationCompleted == null)) { + this.GetPasswordresetAccessTokenOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetPasswordresetAccessTokenOperationCompleted); + } + this.InvokeAsync("GetPasswordresetAccessToken", new object[] { + token}, this.GetPasswordresetAccessTokenOperationCompleted, userState); + } + + private void OnGetPasswordresetAccessTokenOperationCompleted(object arg) { + if ((this.GetPasswordresetAccessTokenCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetPasswordresetAccessTokenCompleted(this, new GetPasswordresetAccessTokenCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/UpdateOrganizationGeneralSettings", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] public void UpdateOrganizationGeneralSettings(int itemId, OrganizationGeneralSettings settings) { @@ -3122,6 +3260,40 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void DeletePasswordresetAccessTokenCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void SetAccessTokenResponseCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void GetPasswordresetAccessTokenCompletedEventHandler(object sender, GetPasswordresetAccessTokenCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetPasswordresetAccessTokenCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetPasswordresetAccessTokenCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public AccessToken Result { + get { + this.RaiseExceptionIfNecessary(); + return ((AccessToken)(this.results[0])); + } + } + } + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void UpdateOrganizationGeneralSettingsCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs index a9ee96ac..f1975f10 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs @@ -3192,7 +3192,7 @@ namespace WebsitePanel.EnterpriseServer public static int AddAccessToken(AccessToken token) { - return AddAccessToken(token.AccessTokenGuid, token.AccountId, token.ItemId, token.ExpirationDate, token.Type); + return AddAccessToken(token.AccessTokenGuid, token.AccountId, token.ItemId, token.ExpirationDate, token.TokenType); } public static int AddAccessToken(Guid accessToken, int accountId, int itemId, DateTime expirationDate, AccessTokenTypes type) @@ -3216,6 +3216,17 @@ namespace WebsitePanel.EnterpriseServer return Convert.ToInt32(prmId.Value); } + public static void SetAccessTokenResponseMessage(Guid accessToken, string response) + { + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "SetAccessTokenSmsResponse", + new SqlParameter("@AccessToken", accessToken), + new SqlParameter("@SmsResponse", response) + ); + } + public static void DeleteExpiredAccessTokens() { SqlHelper.ExecuteNonQuery( @@ -3236,6 +3247,17 @@ namespace WebsitePanel.EnterpriseServer ); } + public static void DeleteAccessToken(Guid accessToken, AccessTokenTypes type) + { + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "DeleteAccessToken", + new SqlParameter("@AccessToken", accessToken), + new SqlParameter("@TokenType", type) + ); + } + public static void UpdateOrganizationSettings(int itemId, string settingsName, string xml) { SqlHelper.ExecuteNonQuery(ConnectionString, CommandType.StoredProcedure, diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs index 733a4642..c3923871 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs @@ -1625,6 +1625,11 @@ namespace WebsitePanel.EnterpriseServer return ObjectUtils.FillObjectFromDataReader(DataProvider.GetAccessTokenByAccessToken(accessToken, type)); } + public static void DeleteAccessToken(Guid accessToken, AccessTokenTypes type) + { + DataProvider.DeleteAccessToken(accessToken, type); + } + public static void DeleteAllExpiredTokens() { DataProvider.DeleteExpiredAccessTokens(); @@ -1632,7 +1637,7 @@ namespace WebsitePanel.EnterpriseServer private static string GenerateUserPasswordResetLink(int itemId, int accountId) { - string passwordResetUrlFormat = "account/password-reset"; + string passwordResetUrlFormat = "account/password-reset/step-2"; var settings = SystemController.GetSystemSettings(SystemSettings.WEBDAV_PORTAL_SETTINGS); @@ -1656,7 +1661,7 @@ namespace WebsitePanel.EnterpriseServer AccessTokenGuid = Guid.NewGuid(), ItemId = itemId, AccountId = accountId, - Type = type, + TokenType = type, ExpirationDate = DateTime.Now.AddHours(12) }; @@ -1665,6 +1670,11 @@ namespace WebsitePanel.EnterpriseServer return token; } + public static void SetAccessTokenResponse(Guid accessToken, string response) + { + DataProvider.SetAccessTokenResponseMessage(accessToken, response); + } + public static void UpdateOrganizationPasswordSettings(int itemId, OrganizationPasswordSettings settings) { TaskManager.StartTask("ORGANIZATION", "UPDATE_PASSWORD_SETTINGS"); diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs index e26cd9f3..50080c76 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs @@ -26,6 +26,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; @@ -47,6 +48,24 @@ namespace WebsitePanel.EnterpriseServer { #region Organizations + [WebMethod] + public void DeletePasswordresetAccessToken(Guid accessToken) + { + OrganizationController.DeleteAccessToken(accessToken, AccessTokenTypes.PasswrodReset); + } + + [WebMethod] + public void SetAccessTokenResponse(Guid accessToken, string response) + { + OrganizationController.SetAccessTokenResponse(accessToken, response); + } + + [WebMethod] + public AccessToken GetPasswordresetAccessToken(Guid token) + { + return OrganizationController.GetAccessToken(token, AccessTokenTypes.PasswrodReset); + } + [WebMethod] public void UpdateOrganizationGeneralSettings(int itemId, OrganizationGeneralSettings settings) { diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs index 752509c1..7781540b 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs @@ -395,11 +395,28 @@ namespace WebsitePanel.Providers.HostedSolution throw new ArgumentNullException("organizationId"); string groupPath = GetGroupPath(organizationId); + string psoName = FormOrganizationPSOName(organizationId); + Runspace runspace = null; + try { + runspace = OpenRunspace(); + + if (FineGrainedPasswordPolicyExist(runspace, psoName)) + { + RemoveFineGrainedPasswordPolicy(runspace, psoName); + } + ActiveDirectoryUtils.DeleteADObject(groupPath); } - catch { /* skip */ } + catch + { + /* skip */ + } + finally + { + CloseRunspace(runspace); + } string path = GetOrganizationPath(organizationId); ActiveDirectoryUtils.DeleteADObject(path, true); @@ -495,45 +512,75 @@ namespace WebsitePanel.Providers.HostedSolution return result; } - var maxPasswordAgeSpan = GetMaxPasswordAge(); + Runspace runspace = null; - var searchRoot = new DirectoryEntry(GetOrganizationPath(organizationId)); - - var search = new DirectorySearcher(searchRoot) + try { - SearchScope = SearchScope.Subtree, - Filter = "(objectClass=user)" - }; + runspace = OpenRunspace(); - search.PropertiesToLoad.Add("pwdLastSet"); - search.PropertiesToLoad.Add("sAMAccountName"); + var psoName = FormOrganizationPSOName(organizationId); - SearchResultCollection searchResults = search.FindAll(); + var maxPasswordAgeSpan = GetMaxPasswordAge(runspace, psoName); - foreach (SearchResult searchResult in searchResults) - { - var pwdLastSetTicks = (long)searchResult.Properties["pwdLastSet"][0]; + var searchRoot = new DirectoryEntry(GetOrganizationPath(organizationId)); - var pwdLastSetDate = DateTime.FromFileTimeUtc(pwdLastSetTicks); - - var expirationDate = pwdLastSetDate.AddDays(maxPasswordAgeSpan.Days); - - if (expirationDate.AddDays(-daysBeforeExpiration) < DateTime.Now) + var search = new DirectorySearcher(searchRoot) { - var user = new OrganizationUser(); + SearchScope = SearchScope.Subtree, + Filter = "(objectClass=user)" + }; - user.PasswordExpirationDateTime = expirationDate; - user.SamAccountName = (string)searchResult.Properties["sAMAccountName"][0]; + search.PropertiesToLoad.Add("pwdLastSet"); + search.PropertiesToLoad.Add("sAMAccountName"); - result.Add(user); + SearchResultCollection searchResults = search.FindAll(); + + foreach (SearchResult searchResult in searchResults) + { + var pwdLastSetTicks = (long) searchResult.Properties["pwdLastSet"][0]; + + var pwdLastSetDate = DateTime.FromFileTimeUtc(pwdLastSetTicks); + + var expirationDate = pwdLastSetDate.AddDays(maxPasswordAgeSpan.Days); + + if (expirationDate.AddDays(-daysBeforeExpiration) < DateTime.Now) + { + var user = new OrganizationUser(); + + user.PasswordExpirationDateTime = expirationDate; + user.SamAccountName = (string) searchResult.Properties["sAMAccountName"][0]; + + result.Add(user); + } } } + catch (Exception) + { + throw; + } + finally + { + CloseRunspace(runspace); + } return result; } - internal TimeSpan GetMaxPasswordAge() + internal TimeSpan GetMaxPasswordAge(Runspace runspace, string psoName) { + if (FineGrainedPasswordPolicyExist(runspace, psoName)) + { + var psoObject = GetFineGrainedPasswordPolicy(runspace, psoName); + + var span = GetPSObjectProperty(psoObject, "MaxPasswordAge") as TimeSpan?; + + if (span != null) + { + return span.Value; + } + } + + using (Domain d = Domain.GetCurrentDomain()) { using (DirectoryEntry domain = d.GetDirectoryEntry()) @@ -563,11 +610,26 @@ namespace WebsitePanel.Providers.HostedSolution Runspace runspace = null; + var psoName = FormOrganizationPSOName(organizationId); + try { runspace = OpenRunspace(); - var gpoId = CreatePolicyIfNotExist(runspace, organizationId, FormOrganizationSettingsGpoName(organizationId)); + if (!FineGrainedPasswordPolicyExist(runspace, psoName)) + { + CreateFineGrainedPasswordPolicy(runspace, organizationId, psoName, settings); + + string groupPath = GetGroupPath(organizationId); + + SetFineGrainedPasswordPolicySubject(runspace, groupPath, psoName); + } + else + { + UpdateFineGrainedPasswordPolicy(runspace, psoName, settings); + + RemoveFineGrainedPasswordPolicy(runspace, psoName); + } } catch (Exception ex) { @@ -581,88 +643,108 @@ namespace WebsitePanel.Providers.HostedSolution } } - private string FormOrganizationSettingsGpoName(string organizationId) + private string FormOrganizationPSOName(string organizationId) { - return string.Format("{0}-settings", organizationId); + return string.Format("{0}-PSO", organizationId); } - private string CreatePolicyIfNotExist(Runspace runspace, string organizationId, string gpoName) + private bool FineGrainedPasswordPolicyExist(Runspace runspace, string psoName) { - string gpoId = GetPolicyId(runspace, gpoName); - - if (string.IsNullOrEmpty(gpoId)) + try { - gpoId = CreateAndLinkPolicy(runspace, gpoName, organizationId); + var cmd = new Command("Get-ADFineGrainedPasswordPolicy"); + cmd.Parameters.Add("Identity", psoName); + + var result = ExecuteShellCommand(runspace, cmd); + } + catch (Exception e) + { + return false; } - return gpoId; + return true; } - private void DeleteGpo(Runspace runspace, string gpoName) + private PSObject GetFineGrainedPasswordPolicy(Runspace runspace, string psoName) { - Command cmd = new Command("Remove-GPO"); - cmd.Parameters.Add("Name", gpoName); + var cmd = new Command("Get-ADFineGrainedPasswordPolicy"); + cmd.Parameters.Add("Identity", psoName); - // Collection result = ExecuteRemoteShellCommand(runspace, PrimaryDomainController, cmd); + return ExecuteShellCommand(runspace, cmd).FirstOrDefault(); } - private string CreateAndLinkPolicy(Runspace runspace, string gpoName, string organizationId) + private void CreateFineGrainedPasswordPolicy(Runspace runspace, string organizationId, string psoName, OrganizationPasswordSettings settings) { - string pathOU = GetOrganizationTargetPath(organizationId); - - //create new gpo - Command cmd = new Command("New-GPO"); - cmd.Parameters.Add("Name", gpoName); - - Collection result = ExecuteShellCommand(runspace, cmd); - - string gpoId = null; - - if (result != null && result.Count > 0) + var cmd = new Command("New-ADFineGrainedPasswordPolicy"); + cmd.Parameters.Add("Name", psoName); + cmd.Parameters.Add("Description", string.Format("The {0} Password Policy", organizationId)); + cmd.Parameters.Add("Precedence", 50); + cmd.Parameters.Add("MinPasswordLength", settings.MinimumLength); + cmd.Parameters.Add("PasswordHistoryCount", settings.EnforcePasswordHistory); + cmd.Parameters.Add("ComplexityEnabled", false); + cmd.Parameters.Add("ReversibleEncryptionEnabled", false); + + if (settings.LockoutSettingsEnabled) { - PSObject gpo = result[0]; - //get gpo id - gpoId = ((Guid) GetPSObjectProperty(gpo, "Id")).ToString("B"); - + cmd.Parameters.Add("LockoutDuration", new TimeSpan(0, settings.AccountLockoutDuration, 0)); + cmd.Parameters.Add("LockoutThreshold", settings.AccountLockoutThreshold); + cmd.Parameters.Add("LockoutObservationWindow", settings.ResetAccountLockoutCounterAfter); } - //create gpo link - cmd = new Command("New-GPLink"); - cmd.Parameters.Add("Name", gpoName); - cmd.Parameters.Add("Target", pathOU); + ExecuteShellCommand(runspace, cmd); + } + + private void SetFineGrainedPasswordPolicySubject(Runspace runspace, string subjectPath, string psoName) + { + var entry = new DirectoryEntry(subjectPath); + + var cmd = new Command("Add-ADFineGrainedPasswordPolicySubject"); + cmd.Parameters.Add("Identity", psoName); + cmd.Parameters.Add("Subjects", entry.Properties[ADAttributes.SAMAccountName].Value.ToString()); ExecuteShellCommand(runspace, cmd); - return gpoId; + cmd = new Command("Set-ADGroup"); + cmd.Parameters.Add("Identity", entry.Properties[ADAttributes.SAMAccountName].Value.ToString()); + cmd.Parameters.Add("GroupScope", "Global"); + + ExecuteShellCommand(runspace, cmd); } - private string GetPolicyId(Runspace runspace, string gpoName) + private void UpdateFineGrainedPasswordPolicy(Runspace runspace, string psoName, OrganizationPasswordSettings settings) { - Runspace runSpace = null; + var cmd = new Command("Set-ADFineGrainedPasswordPolicy"); + cmd.Parameters.Add("Identity", psoName); + cmd.Parameters.Add("MinPasswordLength", settings.MinimumLength); + cmd.Parameters.Add("PasswordHistoryCount", settings.EnforcePasswordHistory); + cmd.Parameters.Add("ComplexityEnabled", false); + cmd.Parameters.Add("ReversibleEncryptionEnabled", false); - string gpoId = null; - - try + if (settings.LockoutSettingsEnabled) { - runSpace = OpenRunspace(); - - Command cmd = new Command("Get-GPO"); - cmd.Parameters.Add("Name", gpoName); - - Collection result = ExecuteShellCommand(runSpace, cmd); - - if (result != null && result.Count > 0) - { - PSObject gpo = result[0]; - gpoId = ((Guid)GetPSObjectProperty(gpo, "Id")).ToString("B"); - } + cmd.Parameters.Add("LockoutDuration", new TimeSpan(0, settings.AccountLockoutDuration, 0)); + cmd.Parameters.Add("LockoutThreshold", settings.AccountLockoutThreshold); + cmd.Parameters.Add("LockoutObservationWindow", settings.ResetAccountLockoutCounterAfter); } - finally + else { - CloseRunspace(runSpace); + cmd.Parameters.Add("LockoutDuration", new TimeSpan(0)); + cmd.Parameters.Add("LockoutThreshold", 0); + cmd.Parameters.Add("LockoutObservationWindow", 0); } - return gpoId; + var result = ExecuteShellCommand(runspace, cmd); + + + var s = GetFineGrainedPasswordPolicy(runspace, psoName); + } + + private void RemoveFineGrainedPasswordPolicy(Runspace runspace, string psoName) + { + var cmd = new Command("Remove-ADFineGrainedPasswordPolicy"); + cmd.Parameters.Add("Identity", psoName); + + ExecuteShellCommand(runspace, cmd); } public PasswordPolicyResult GetPasswordPolicy() @@ -782,7 +864,7 @@ namespace WebsitePanel.Providers.HostedSolution string path = GetUserPath(organizationId, loginName); - OrganizationUser retUser = GetUser(path); + OrganizationUser retUser = GetUser(organizationId, path); HostedSolutionLog.LogEnd("GetUserGeneralSettingsInternal"); return retUser; @@ -835,7 +917,7 @@ namespace WebsitePanel.Providers.HostedSolution user.Properties[ADAttributes.PwdLastSet].Value = userMustChangePassword ? 0 : -1; } - private OrganizationUser GetUser(string path) + private OrganizationUser GetUser(string organizationId, string path) { OrganizationUser retUser = new OrganizationUser(); @@ -871,20 +953,34 @@ namespace WebsitePanel.Providers.HostedSolution retUser.UserPrincipalName = (string)entry.InvokeGet(ADAttributes.UserPrincipalName); retUser.UserMustChangePassword = GetUserMustChangePassword(entry); - retUser.PasswordExpirationDateTime = GetPasswordExpirationDate(entry); + var psoName = FormOrganizationPSOName(organizationId); + + retUser.PasswordExpirationDateTime = GetPasswordExpirationDate(psoName, entry); return retUser; } - private DateTime GetPasswordExpirationDate(DirectoryEntry entry) + private DateTime GetPasswordExpirationDate(string psoName, DirectoryEntry entry) { - var maxPasswordAgeSpan = GetMaxPasswordAge(); + Runspace runspace = null; - var pwdLastSetTicks = ConvertADSLargeIntegerToInt64(entry.Properties[ADAttributes.PwdLastSet].Value); + try + { + runspace = OpenRunspace(); - var pwdLastSetDate = DateTime.FromFileTimeUtc(pwdLastSetTicks); + var maxPasswordAgeSpan = GetMaxPasswordAge(runspace, psoName); + + var pwdLastSetTicks = ConvertADSLargeIntegerToInt64(entry.Properties[ADAttributes.PwdLastSet].Value); + + var pwdLastSetDate = DateTime.FromFileTimeUtc(pwdLastSetTicks); + + return pwdLastSetDate.AddDays(maxPasswordAgeSpan.Days); + } + finally + { + CloseRunspace(runspace); + } - return pwdLastSetDate.AddDays(maxPasswordAgeSpan.Days); } private string GetDomainName(string username) @@ -1253,7 +1349,7 @@ namespace WebsitePanel.Providers.HostedSolution foreach (string userPath in ActiveDirectoryUtils.GetGroupObjects(groupName, "user", organizationEntry)) { - OrganizationUser tmpUser = GetUser(userPath); + OrganizationUser tmpUser = GetUser(organizationId, userPath); members.Add(new ExchangeAccount { diff --git a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Config/Entities/SessionKeysCollection.cs b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Config/Entities/SessionKeysCollection.cs index 1a45b059..1cbfa2e9 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Config/Entities/SessionKeysCollection.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Config/Entities/SessionKeysCollection.cs @@ -65,6 +65,16 @@ namespace WebsitePanel.WebDav.Core.Config.Entities } } + public string PasswordResetSmsKey + { + get + { + SessionKeysElement sessionKey = + _sessionKeys.FirstOrDefault(x => x.Key == SessionKeysElement.PassswordResetSmsKey); + return sessionKey != null ? sessionKey.Value : null; + } + } + public string ResourseRenderCount { get diff --git a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Config/Entities/TwilioParameters.cs b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Config/Entities/TwilioParameters.cs new file mode 100644 index 00000000..9ce1ffbe --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Config/Entities/TwilioParameters.cs @@ -0,0 +1,16 @@ +namespace WebsitePanel.WebDav.Core.Config.Entities +{ + public class TwilioParameters: AbstractConfigCollection + { + public string AccountSid { get; private set; } + public string AuthorizationToken { get; private set; } + public string PhoneFrom { get; private set; } + + public TwilioParameters() + { + AccountSid = ConfigSection.Twilio.AccountSid; + AuthorizationToken = ConfigSection.Twilio.AuthorizationToken; + PhoneFrom = ConfigSection.Twilio.PhoneFrom; + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Config/IWebDavAppConfig.cs b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Config/IWebDavAppConfig.cs index 86ce78de..0c72e9c5 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Config/IWebDavAppConfig.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Config/IWebDavAppConfig.cs @@ -8,6 +8,7 @@ namespace WebsitePanel.WebDav.Core.Config string ApplicationName { get; } ElementsRendering ElementsRendering { get; } WebsitePanelConstantUserParameters WebsitePanelConstantUserParameters { get; } + TwilioParameters TwilioParameters { get; } SessionKeysCollection SessionKeys { get; } FileIconsDictionary FileIcons { get; } HttpErrorsCollection HttpErrors { get; } diff --git a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Config/WebConfigSections/SessionKeysElement.cs b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Config/WebConfigSections/SessionKeysElement.cs index 76a0e7e8..efeea291 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Config/WebConfigSections/SessionKeysElement.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Config/WebConfigSections/SessionKeysElement.cs @@ -12,6 +12,7 @@ namespace WebsitePanel.WebDav.Core.Config.WebConfigSections public const string WebDavManagerKey = "WebDavManagerSessionKey"; public const string UserGroupsKey = "UserGroupsKey"; public const string WebDavRootFolderPermissionsKey = "WebDavRootFolderPermissionsKey"; + public const string PassswordResetSmsKey = "PassswordResetSmsKey"; public const string ResourseRenderCountKey = "ResourseRenderCountSessionKey"; public const string ItemIdSessionKey = "ItemId"; public const string OwaEditFoldersSessionKey = "OwaEditFoldersSession"; diff --git a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Config/WebConfigSections/TwilioElement.cs b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Config/WebConfigSections/TwilioElement.cs new file mode 100644 index 00000000..c53856b6 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Config/WebConfigSections/TwilioElement.cs @@ -0,0 +1,32 @@ +using System.Configuration; + +namespace WebsitePanel.WebDav.Core.Config.WebConfigSections +{ + public class TwilioElement : ConfigurationElement + { + private const string AccountSidPropName = "accountSid"; + private const string AuthorizationTokenPropName = "authorizationToken"; + private const string PhoneFromPropName = "phoneFrom"; + + [ConfigurationProperty(AccountSidPropName, IsKey = true, IsRequired = true)] + public string AccountSid + { + get { return this[AccountSidPropName].ToString(); } + set { this[AccountSidPropName] = value; } + } + + [ConfigurationProperty(AuthorizationTokenPropName, IsKey = true, IsRequired = true)] + public string AuthorizationToken + { + get { return this[AuthorizationTokenPropName].ToString(); } + set { this[AuthorizationTokenPropName] = value; } + } + + [ConfigurationProperty(PhoneFromPropName, IsKey = true, IsRequired = true)] + public string PhoneFrom + { + get { return this[PhoneFromPropName].ToString(); } + set { this[PhoneFromPropName] = value; } + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Config/WebConfigSections/WebDavExplorerConfigurationSettingsSection.cs b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Config/WebConfigSections/WebDavExplorerConfigurationSettingsSection.cs index d471a912..8edbb92f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Config/WebConfigSections/WebDavExplorerConfigurationSettingsSection.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Config/WebConfigSections/WebDavExplorerConfigurationSettingsSection.cs @@ -20,6 +20,7 @@ namespace WebsitePanel.WebDavPortal.WebConfigSections private const string OfficeOnlineKey = "officeOnline"; private const string FilesToIgnoreKey = "filesToIgnore"; private const string TypeOpenerKey = "typeOpener"; + private const string TwilioKey = "twilio"; public const string SectionName = "webDavExplorerConfigurationSettings"; @@ -65,6 +66,13 @@ namespace WebsitePanel.WebDavPortal.WebConfigSections set { this[WebsitePanelConstantUserKey] = value; } } + [ConfigurationProperty(TwilioKey, IsRequired = true)] + public TwilioElement Twilio + { + get { return (TwilioElement)this[TwilioKey]; } + set { this[TwilioKey] = value; } + } + [ConfigurationProperty(ElementsRenderingKey, IsRequired = true)] public ElementsRenderingElement ElementsRendering { diff --git a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Config/WebDavAppConfigManager.cs b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Config/WebDavAppConfigManager.cs index 696c1d54..03de83f7 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Config/WebDavAppConfigManager.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Config/WebDavAppConfigManager.cs @@ -21,6 +21,7 @@ namespace WebsitePanel.WebDav.Core.Config OwaSupportedBrowsers = new OwaSupportedBrowsersCollection(); FilesToIgnore = new FilesToIgnoreCollection(); FileOpener = new OpenerCollection(); + TwilioParameters = new TwilioParameters(); } public static WebDavAppConfigManager Instance @@ -55,6 +56,7 @@ namespace WebsitePanel.WebDav.Core.Config public ElementsRendering ElementsRendering { get; private set; } public WebsitePanelConstantUserParameters WebsitePanelConstantUserParameters { get; private set; } + public TwilioParameters TwilioParameters { get; private set; } public SessionKeysCollection SessionKeys { get; private set; } public FileIconsDictionary FileIcons { get; private set; } public HttpErrorsCollection HttpErrors { get; private set; } diff --git a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Interfaces/Security/ISmsAuthenticationService.cs b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Interfaces/Security/ISmsAuthenticationService.cs new file mode 100644 index 00000000..8eb0b563 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Interfaces/Security/ISmsAuthenticationService.cs @@ -0,0 +1,11 @@ +using System; + +namespace WebsitePanel.WebDav.Core.Interfaces.Security +{ + public interface ISmsAuthenticationService + { + bool VerifyResponse(Guid token, string response); + string SendRequestMessage(string phoneTo); + string GenerateResponse(); + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Interfaces/Services/ISmsDistributionService.cs b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Interfaces/Services/ISmsDistributionService.cs new file mode 100644 index 00000000..2d3185ff --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Interfaces/Services/ISmsDistributionService.cs @@ -0,0 +1,9 @@ +namespace WebsitePanel.WebDav.Core.Interfaces.Services +{ + public interface ISmsDistributionService + { + void SendMessage(string phoneFrom, string phone, string message); + + void SendMessage(string phone, string message); + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Security/Authentication/SmsAuthenticationService.cs b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Security/Authentication/SmsAuthenticationService.cs new file mode 100644 index 00000000..45771b73 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Security/Authentication/SmsAuthenticationService.cs @@ -0,0 +1,46 @@ +using System; +using System.Globalization; +using WebsitePanel.WebDav.Core.Config; +using WebsitePanel.WebDav.Core.Interfaces.Security; +using WebsitePanel.WebDav.Core.Interfaces.Services; + +namespace WebsitePanel.WebDav.Core.Security.Authentication +{ + public class SmsAuthenticationService : ISmsAuthenticationService + { + private ISmsDistributionService _smsService; + + public SmsAuthenticationService(ISmsDistributionService smsService) + { + _smsService = smsService; + } + + public bool VerifyResponse( Guid token, string response) + { + var accessToken = WspContext.Services.Organizations.GetPasswordresetAccessToken(token); + + if (accessToken == null) + { + return false; + } + + return string.Compare(accessToken.SmsResponse, response, StringComparison.InvariantCultureIgnoreCase) == 0; + } + + public string SendRequestMessage(string phoneTo) + { + var response = GenerateResponse(); + + _smsService.SendMessage(WebDavAppConfigManager.Instance.TwilioParameters.PhoneFrom, phoneTo, response); + + return response; + } + + public string GenerateResponse() + { + var random = new Random(Guid.NewGuid().GetHashCode()); + + return random.Next(10000, 99999).ToString(CultureInfo.InvariantCulture); + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Services/TwillioSmsDistributionService.cs b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Services/TwillioSmsDistributionService.cs new file mode 100644 index 00000000..b764c6e7 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Services/TwillioSmsDistributionService.cs @@ -0,0 +1,27 @@ +using Twilio; +using WebsitePanel.WebDav.Core.Config; +using WebsitePanel.WebDav.Core.Interfaces.Services; + +namespace WebsitePanel.WebDav.Core.Services +{ + public class TwillioSmsDistributionService : ISmsDistributionService + { + private TwilioRestClient _twilioRestClient { get; set; } + + public TwillioSmsDistributionService() + { + _twilioRestClient = new TwilioRestClient(WebDavAppConfigManager.Instance.TwilioParameters.AccountSid, WebDavAppConfigManager.Instance.TwilioParameters.AuthorizationToken); + } + + + public void SendMessage(string phoneFrom, string phone, string message) + { + _twilioRestClient.SendSmsMessage(phoneFrom, phone, message); + } + + public void SendMessage(string phone, string message) + { + _twilioRestClient.SendSmsMessage(WebDavAppConfigManager.Instance.TwilioParameters.PhoneFrom, phone, message); + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/WebsitePanel.WebDav.Core.csproj b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/WebsitePanel.WebDav.Core.csproj index 67043bd5..1398a59d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/WebsitePanel.WebDav.Core.csproj +++ b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/WebsitePanel.WebDav.Core.csproj @@ -46,6 +46,9 @@ False ..\..\Bin\Microsoft.Web.Services3.dll + + ..\packages\RestSharp.105.0.1\lib\net4\RestSharp.dll + @@ -87,6 +90,10 @@ + + ..\packages\Twilio.3.6.29\lib\3.5\Twilio.Api.dll + True + ..\..\Bin\WebsitePanel.EnterpriseServer.Base.dll @@ -108,6 +115,7 @@ + @@ -126,6 +134,7 @@ + @@ -149,6 +158,9 @@ + + + @@ -188,6 +200,7 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/packages.config b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/packages.config index ad6a1af2..7188fe00 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/packages.config +++ b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/packages.config @@ -5,4 +5,6 @@ + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/App_Start/RouteConfig.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/App_Start/RouteConfig.cs index 93bf1f75..3be2e49d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/App_Start/RouteConfig.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/App_Start/RouteConfig.cs @@ -18,6 +18,30 @@ namespace WebsitePanel.WebDavPortal defaults: new { controller = "Account", action = "UserProfile" } ); + routes.MapRoute( + name: AccountRouteNames.PasswordResetEmail, + url: "account/password-reset/step-1", + defaults: new { controller = "Account", action = "PasswordResetEmail" } + ); + + routes.MapRoute( + name: AccountRouteNames.PasswordResetSms, + url: "account/password-reset/step-2/{token}", + defaults: new { controller = "Account", action = "PasswordResetSms" } + ); + + routes.MapRoute( + name: AccountRouteNames.PasswordResetSendSms, + url: "account/password-reset/step-final/{token}", + defaults: new { controller = "Account", action = "PasswordResetSendSms" } + ); + + routes.MapRoute( + name: AccountRouteNames.PasswordResetFinalStep, + url: "account/password-reset/send-new-sms/{token}", + defaults: new { controller = "Account", action = "PasswordResetFinalStep" } + ); + routes.MapRoute( name: AccountRouteNames.PasswordChange, url: "account/profile/password-change", diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/App_Start/Routes/AccountRouteNames.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/App_Start/Routes/AccountRouteNames.cs index 36f4c562..8a3da848 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/App_Start/Routes/AccountRouteNames.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/App_Start/Routes/AccountRouteNames.cs @@ -12,5 +12,9 @@ namespace WebsitePanel.WebDavPortal.UI.Routes public const string UserProfile = "UserProfileRoute"; public const string PasswordChange = "PasswordChangeRoute"; + public const string PasswordResetEmail = "PasswordResetEmailRoute"; + public const string PasswordResetSms = "PasswordResetSmsRoute"; + public const string PasswordResetSendSms = "PasswordResetSendSmsRoute"; + public const string PasswordResetFinalStep = "PasswordResetFinalStepRoute"; } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Content/Site.css b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Content/Site.css index 1cbed98d..2173c20a 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Content/Site.css +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Content/Site.css @@ -230,6 +230,9 @@ tr.selected-file { color: white; } +.forgot-your-password-link { + margin-left: 10px; +} .navbar-fixed-top #user-profile { font-size: 18px; diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Controllers/AccountController.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Controllers/AccountController.cs index 091e4899..c533cfc2 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Controllers/AccountController.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Controllers/AccountController.cs @@ -1,4 +1,5 @@ -using System.Linq; +using System; +using System.Linq; using System.Net; using System.Web.Mvc; using System.Web.Routing; @@ -7,6 +8,7 @@ using WebsitePanel.Providers.HostedSolution; using WebsitePanel.WebDav.Core.Config; using WebsitePanel.WebDav.Core.Security.Authentication; using WebsitePanel.WebDav.Core.Security.Cryptography; +using WebsitePanel.WebDav.Core.Wsp.Framework; using WebsitePanel.WebDavPortal.CustomAttributes; using WebsitePanel.WebDavPortal.Models; using WebsitePanel.WebDavPortal.Models.Account; @@ -24,16 +26,17 @@ namespace WebsitePanel.WebDavPortal.Controllers { private readonly ICryptography _cryptography; private readonly IAuthenticationService _authenticationService; + private readonly ISmsAuthenticationService _smsAuthService; - public AccountController(ICryptography cryptography, IAuthenticationService authenticationService) + public AccountController(ICryptography cryptography, IAuthenticationService authenticationService, ISmsAuthenticationService smsAuthService) { _cryptography = cryptography; _authenticationService = authenticationService; + _smsAuthService = smsAuthService; } [HttpGet] [AllowAnonymous] - public ActionResult Login() { if (WspContext.User != null && WspContext.User.Identity.IsAuthenticated) @@ -127,6 +130,157 @@ namespace WebsitePanel.WebDavPortal.Controllers return RedirectToRoute(AccountRouteNames.UserProfile); } + [HttpGet] + [AllowAnonymous] + public ActionResult PasswordResetEmail() + { + var model = new PasswordResetEmailModel(); + + return View(model); + } + + [HttpPost] + [AllowAnonymous] + public ActionResult PasswordResetEmail(PasswordResetEmailModel model) + { + if (!ModelState.IsValid) + { + return View(model); + } + + var exchangeAccount = WspContext.Services.ExchangeServer.GetAccountByAccountNameWithoutItemId(model.Email); + + if (exchangeAccount == null) + { + model.AddMessage(MessageType.Error, Resources.Messages.AccountNotFound); + + return View(model); + } + + WspContext.Services.Organizations.SendResetUserPasswordEmail(exchangeAccount.ItemId, exchangeAccount.AccountId, Resources.Messages.PasswordResetUserReason, exchangeAccount.PrimaryEmailAddress); + + return View("PasswordResetEmailSent"); + } + + + [HttpGet] + [AllowAnonymous] + public ActionResult PasswordResetSms(Guid token) + { + var model = new PasswordResetSmsModel(); + + var accessToken = WspContext.Services.Organizations.GetPasswordresetAccessToken(token); + + model.IsTokenExist = accessToken != null; + + if (model.IsTokenExist == false) + { + model.AddMessage(MessageType.Error, Resources.Messages.IncorrectPasswordResetUrl); + + return View(model); + } + + if (accessToken.IsSmsSent == false) + { + var user = WspContext.Services.Organizations.GetUserGeneralSettings(accessToken.ItemId, accessToken.AccountId); + + var response = _smsAuthService.SendRequestMessage(user.MobilePhone); + WspContext.Services.Organizations.SetAccessTokenResponse(accessToken.AccessTokenGuid, response); + } + + return View(model); + } + + [HttpPost] + [AllowAnonymous] + public ActionResult PasswordResetSms(Guid token, PasswordResetSmsModel model) + { + if (!ModelState.IsValid) + { + return View(model); + } + + if (_smsAuthService.VerifyResponse(token, model.Sms)) + { + var tokenEntity = WspContext.Services.Organizations.GetPasswordresetAccessToken(token); + + Session[WebDavAppConfigManager.Instance.SessionKeys.PasswordResetSmsKey] = model.Sms; + Session[WebDavAppConfigManager.Instance.SessionKeys.ItemId] = tokenEntity.ItemId; + + return RedirectToRoute(AccountRouteNames.PasswordResetFinalStep); + } + + model.AddMessage(MessageType.Error, Resources.Messages.IncorrectSmsResponse); + + return View(model); + } + + + [HttpGet] + [AllowAnonymous] + public ActionResult PasswordResetFinalStep(Guid token) + { + var smsResponse = Session[WebDavAppConfigManager.Instance.SessionKeys.PasswordResetSmsKey] as string; + + if (_smsAuthService.VerifyResponse(token, smsResponse) == false) + { + return RedirectToRoute(AccountRouteNames.PasswordResetSms); + } + + var model = new PasswordEditor(); + + return View(model); + } + + [HttpPost] + [AllowAnonymous] + public ActionResult PasswordResetFinalStep(Guid token, PasswordEditor model) + { + if (!ModelState.IsValid) + { + return View(model); + } + + var smsResponse = Session[WebDavAppConfigManager.Instance.SessionKeys.PasswordResetSmsKey] as string; + + if (_smsAuthService.VerifyResponse(token, smsResponse) == false) + { + model.AddMessage(MessageType.Error, Resources.Messages.IncorrectSmsResponse); + + return RedirectToRoute(AccountRouteNames.PasswordResetSms); + } + + var tokenEntity = WspContext.Services.Organizations.GetPasswordresetAccessToken(token); + + WspContext.Services.Organizations.SetUserPassword( + tokenEntity.ItemId, tokenEntity.AccountId, + model.NewPassword); + + WspContext.Services.Organizations.DeletePasswordresetAccessToken(token); + + return RedirectToRoute(AccountRouteNames.Login); + } + + [HttpGet] + [AllowAnonymous] + public ActionResult PasswordResetSendSms(Guid token) + { + var accessToken = WspContext.Services.Organizations.GetPasswordresetAccessToken(token); + + if (accessToken == null) + { + return RedirectToRoute(AccountRouteNames.PasswordResetSms); + } + + var user = WspContext.Services.Organizations.GetUserGeneralSettings(accessToken.ItemId, + accessToken.AccountId); + + var response = _smsAuthService.SendRequestMessage(user.MobilePhone); + WspContext.Services.Organizations.SetAccessTokenResponse(accessToken.AccessTokenGuid, response); + + return RedirectToRoute(AccountRouteNames.PasswordResetSms); + } + #region Helpers private UserProfile GetUserProfileModel(int itemId, int accountId) diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/CustomAttributes/OrganizationPasswordPolicyAttribute.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/CustomAttributes/OrganizationPasswordPolicyAttribute.cs index 14cfd4c1..1bd6c7c6 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/CustomAttributes/OrganizationPasswordPolicyAttribute.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/CustomAttributes/OrganizationPasswordPolicyAttribute.cs @@ -2,9 +2,11 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.Linq; +using System.Web; using System.Web.Mvc; using WebsitePanel.Providers.HostedSolution; using WebsitePanel.WebDav.Core; +using WebsitePanel.WebDav.Core.Config; namespace WebsitePanel.WebDavPortal.CustomAttributes { @@ -15,14 +17,25 @@ namespace WebsitePanel.WebDavPortal.CustomAttributes public OrganizationPasswordPolicyAttribute() { - Settings = WspContext.Services.Organizations.GetOrganizationPasswordSettings(WspContext.User.ItemId); + int itemId = -1; + + if (WspContext.User != null) + { + itemId = WspContext.User.ItemId; + } + else if (HttpContext.Current != null && HttpContext.Current.Session[WebDavAppConfigManager.Instance.SessionKeys.ItemId] != null) + { + itemId = (int) HttpContext.Current.Session[WebDavAppConfigManager.Instance.SessionKeys.ItemId]; + } + + + Settings = WspContext.Services.Organizations.GetOrganizationPasswordSettings(itemId); } protected override ValidationResult IsValid(object value, ValidationContext validationContext) { - if (value != null && WspContext.User != null) + if (value != null) { - var resultMessages = new List(); if (Settings != null) diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/DependencyInjection/PortalDependencies.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/DependencyInjection/PortalDependencies.cs index c7661530..ad15cd2b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/DependencyInjection/PortalDependencies.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/DependencyInjection/PortalDependencies.cs @@ -4,6 +4,7 @@ using WebsitePanel.WebDav.Core.Interfaces.Managers; using WebsitePanel.WebDav.Core.Interfaces.Managers.Users; using WebsitePanel.WebDav.Core.Interfaces.Owa; using WebsitePanel.WebDav.Core.Interfaces.Security; +using WebsitePanel.WebDav.Core.Interfaces.Services; using WebsitePanel.WebDav.Core.Interfaces.Storages; using WebsitePanel.WebDav.Core.Managers; using WebsitePanel.WebDav.Core.Managers.Users; @@ -11,6 +12,7 @@ using WebsitePanel.WebDav.Core.Owa; using WebsitePanel.WebDav.Core.Security.Authentication; using WebsitePanel.WebDav.Core.Security.Authorization; using WebsitePanel.WebDav.Core.Security.Cryptography; +using WebsitePanel.WebDav.Core.Services; using WebsitePanel.WebDav.Core.Storages; using WebsitePanel.WebDavPortal.DependencyInjection.Providers; @@ -31,6 +33,8 @@ namespace WebsitePanel.WebDavPortal.DependencyInjection kernel.Bind().To(); kernel.Bind().To(); kernel.Bind().To(); + kernel.Bind().To(); + kernel.Bind().To(); } } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/Account/PasswordResetEmailModel.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/Account/PasswordResetEmailModel.cs new file mode 100644 index 00000000..2655e419 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/Account/PasswordResetEmailModel.cs @@ -0,0 +1,14 @@ +using System.ComponentModel.DataAnnotations; +using WebsitePanel.WebDavPortal.Models.Common; +using WebsitePanel.WebDavPortal.Resources; + +namespace WebsitePanel.WebDavPortal.Models.Account +{ + public class PasswordResetEmailModel : BaseModel + { + [Required] + [Display(ResourceType = typeof(Resources.UI), Name = "Email")] + [EmailAddress(ErrorMessageResourceType = typeof(Messages), ErrorMessageResourceName = "EmailInvalid",ErrorMessage = null)] + public string Email { get; set; } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/Account/PasswordResetSmsModel.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/Account/PasswordResetSmsModel.cs new file mode 100644 index 00000000..0a0e2715 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/Account/PasswordResetSmsModel.cs @@ -0,0 +1,12 @@ +using System.ComponentModel.DataAnnotations; +using WebsitePanel.WebDavPortal.Models.Common; + +namespace WebsitePanel.WebDavPortal.Models.Account +{ + public class PasswordResetSmsModel : BaseModel + { + [Required] + public string Sms { get; set; } + public bool IsTokenExist { get; set; } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/Common/EditorTemplates/PasswordEditor.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/Common/EditorTemplates/PasswordEditor.cs index 03b30a43..9ef55cc6 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/Common/EditorTemplates/PasswordEditor.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/Common/EditorTemplates/PasswordEditor.cs @@ -4,7 +4,7 @@ using WebsitePanel.WebDavPortal.CustomAttributes; namespace WebsitePanel.WebDavPortal.Models.Common.EditorTemplates { - public class PasswordEditor + public class PasswordEditor : BaseModel { [Display(ResourceType = typeof(Resources.UI), Name = "NewPassword")] diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/Messages.Designer.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/Messages.Designer.cs index af62e425..04c01d13 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/Messages.Designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/Messages.Designer.cs @@ -60,6 +60,15 @@ namespace WebsitePanel.WebDavPortal.Resources { } } + /// + /// Looks up a localized string similar to Account was not found. + /// + public static string AccountNotFound { + get { + return ResourceManager.GetString("AccountNotFound", resourceCulture); + } + } + /// /// Looks up a localized string similar to Email is invalid. /// @@ -69,6 +78,24 @@ namespace WebsitePanel.WebDavPortal.Resources { } } + /// + /// Looks up a localized string similar to Your password could not be reset. The url you followed is either incorrect, has been used or has expired.. + /// + public static string IncorrectPasswordResetUrl { + get { + return ResourceManager.GetString("IncorrectPasswordResetUrl", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Incorrect text message (SMS) response.. + /// + public static string IncorrectSmsResponse { + get { + return ResourceManager.GetString("IncorrectSmsResponse", resourceCulture); + } + } + /// /// Looks up a localized string similar to Old password is not correct. /// @@ -114,6 +141,33 @@ namespace WebsitePanel.WebDavPortal.Resources { } } + /// + /// Looks up a localized string similar to A message was sent to your email address. Please check your email for further instructions.. + /// + public static string PasswordResetEmailSent { + get { + return ResourceManager.GetString("PasswordResetEmailSent", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Text message (SMS) was sent to the phone number associated to your account. If you didn't recieve text message (SMS) click {0} for new text message (SMS).. + /// + public static string PasswordResetSmsHintFormat { + get { + return ResourceManager.GetString("PasswordResetSmsHintFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Webdav portal user request.. + /// + public static string PasswordResetUserReason { + get { + return ResourceManager.GetString("PasswordResetUserReason", resourceCulture); + } + } + /// /// Looks up a localized string similar to Password should contain at least {0} non-alphanumeric symbols. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/Messages.resx b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/Messages.resx index 88beb538..2ebec533 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/Messages.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/Messages.resx @@ -117,9 +117,18 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Account was not found + Email is invalid + + Your password could not be reset. The url you followed is either incorrect, has been used or has expired. + + + Incorrect text message (SMS) response. + Old password is not correct @@ -135,6 +144,15 @@ Password should contain at least {0} numbers + + A message was sent to your email address. Please check your email for further instructions. + + + Text message (SMS) was sent to the phone number associated to your account. If you didn't recieve text message (SMS) click {0} for new text message (SMS). + + + Webdav portal user request. + Password should contain at least {0} non-alphanumeric symbols diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/UI.Designer.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/UI.Designer.cs index a88478a0..d189d450 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/UI.Designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/UI.Designer.cs @@ -357,6 +357,15 @@ namespace WebsitePanel.WebDavPortal.Resources { } } + /// + /// Looks up a localized string similar to Forgot your password?. + /// + public static string ForgotYourPassword { + get { + return ResourceManager.GetString("ForgotYourPassword", resourceCulture); + } + } + /// /// Looks up a localized string similar to General Information. /// @@ -528,6 +537,15 @@ namespace WebsitePanel.WebDavPortal.Resources { } } + /// + /// Looks up a localized string similar to Next. + /// + public static string Next { + get { + return ResourceManager.GetString("Next", resourceCulture); + } + } + /// /// Looks up a localized string similar to No files are selected.. /// @@ -600,6 +618,15 @@ namespace WebsitePanel.WebDavPortal.Resources { } } + /// + /// Looks up a localized string similar to Password reset. + /// + public static string PasswordReset { + get { + return ResourceManager.GetString("PasswordReset", resourceCulture); + } + } + /// /// Looks up a localized string similar to PB. /// @@ -717,6 +744,15 @@ namespace WebsitePanel.WebDavPortal.Resources { } } + /// + /// Looks up a localized string similar to Send email. + /// + public static string SendEmail { + get { + return ResourceManager.GetString("SendEmail", resourceCulture); + } + } + /// /// Looks up a localized string similar to Size. /// @@ -726,6 +762,15 @@ namespace WebsitePanel.WebDavPortal.Resources { } } + /// + /// Looks up a localized string similar to Sms. + /// + public static string Sms { + get { + return ResourceManager.GetString("Sms", resourceCulture); + } + } + /// /// Looks up a localized string similar to State/Province. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/UI.resx b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/UI.resx index deda00a1..2b5cbd35 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/UI.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Resources/UI.resx @@ -216,6 +216,9 @@ First Name + + Forgot your password? + General Information @@ -273,6 +276,9 @@ Confirm password + + Next + No files are selected. @@ -297,6 +303,9 @@ Will expire on {0}. If you want to change password then please click {1}. + + Password reset + PB @@ -336,9 +345,15 @@ Select files to upload + + Send email + Size + + Sms + State/Province diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Scripts/_references.js b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Scripts/_references.js index 7a771e40..2a5be867 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Scripts/_references.js +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Scripts/_references.js @@ -1,8 +1,9 @@ -/// -/// +/// /// /// +/// /// +/// /// /// /// @@ -10,5 +11,36 @@ /// /// /// +/// +/// +/// /// /// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Account/Login.cshtml b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Account/Login.cshtml index c7c827b8..b5d506d8 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Account/Login.cshtml +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Account/Login.cshtml @@ -1,4 +1,6 @@ -@model WebsitePanel.WebDavPortal.Models.AccountModel +@using WebsitePanel.WebDavPortal.Resources +@using WebsitePanel.WebDavPortal.UI.Routes +@model WebsitePanel.WebDavPortal.Models.AccountModel @{ ViewBag.Title = "Login"; } @@ -30,6 +32,7 @@ diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Account/PasswordResetEmail.cshtml b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Account/PasswordResetEmail.cshtml new file mode 100644 index 00000000..96052e57 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Account/PasswordResetEmail.cshtml @@ -0,0 +1,31 @@ +@using WebsitePanel.WebDavPortal.Resources +@using WebsitePanel.WebDavPortal.UI.Routes +@model WebsitePanel.WebDavPortal.Models.Account.PasswordResetEmailModel + +@{ + Layout = "~/Views/Shared/_Layout.cshtml"; +} + + +
    + @using (Html.BeginRouteForm(AccountRouteNames.PasswordResetEmail, FormMethod.Post, new { @class = "form-horizontal user-password-reset-email bs-val-styles col-lg-10 col-lg-offset-3", id = "user-password-reset" })) + { +
    +

    @UI.PasswordReset

    +
    +
    + +
    + @Html.TextBoxFor(x => x.Email, new { @class = "form-control", placeholder = UI.Email }) + @Html.ValidationMessageFor(x => x.Email) +
    +
    + +
    +
    + +
    +
    + } +
    + diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Account/PasswordResetEmailSent.cshtml b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Account/PasswordResetEmailSent.cshtml new file mode 100644 index 00000000..7455f688 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Account/PasswordResetEmailSent.cshtml @@ -0,0 +1,14 @@ +@using WebsitePanel.WebDavPortal.Resources + +@{ + Layout = "~/Views/Shared/_Layout.cshtml"; +} + + +
    +
    +

    @UI.PasswordReset

    +

    @Messages.PasswordResetEmailSent

    +
    +
    + diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Account/PasswordResetFinalStep.cshtml b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Account/PasswordResetFinalStep.cshtml new file mode 100644 index 00000000..11fbfbfc --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Account/PasswordResetFinalStep.cshtml @@ -0,0 +1,27 @@ +@{ + Layout = "~/Views/Shared/_Layout.cshtml"; +} +@using WebsitePanel.WebDavPortal.Resources +@using WebsitePanel.WebDavPortal.UI.Routes +@model WebsitePanel.WebDavPortal.Models.Common.EditorTemplates.PasswordEditor + +
    + @using (Html.BeginRouteForm(AccountRouteNames.PasswordResetFinalStep, FormMethod.Post, new { @class = "form-horizontal user-password-reset-final-step bs-val-styles col-lg-9 col-lg-offset-3", id = "user-password-reset" })) + { + +
    +

    @UI.PasswordReset

    +
    + + @Html.EditorFor(x=>x) + +
    +
    + +
    +
    + } +
    + + + diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Account/PasswordResetSms.cshtml b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Account/PasswordResetSms.cshtml new file mode 100644 index 00000000..08523c08 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Account/PasswordResetSms.cshtml @@ -0,0 +1,38 @@ +@using WebsitePanel.WebDavPortal.Resources +@using WebsitePanel.WebDavPortal.UI.Routes +@model WebsitePanel.WebDavPortal.Models.Account.PasswordResetSmsModel + +@{ + Layout = "~/Views/Shared/_Layout.cshtml"; +} + +@if (Model.IsTokenExist) +{ +
    + @using (Html.BeginRouteForm(AccountRouteNames.PasswordResetSms, FormMethod.Post, new {@class = "form-horizontal user-password-reset-sms bs-val-styles col-lg-9 col-lg-offset-3", id = "user-password-reset"})) + { + @Html.HiddenFor(x=>x.IsTokenExist) + +
    +

    @UI.PasswordReset

    +
    +
    + @Html.Raw(string.Format(Messages.PasswordResetSmsHintFormat, Html.RouteLink(UI.Here.ToLowerInvariant(), AccountRouteNames.PasswordResetSendSms))) +
    +
    + +
    + @Html.TextBoxFor(x => x.Sms, new {@class = "form-control", placeholder = UI.Sms}) + @Html.ValidationMessageFor(x => x.Sms) +
    +
    + +
    +
    + +
    +
    + } +
    +} + diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Shared/_Layout.cshtml b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Shared/_Layout.cshtml index 25cc02b3..725be072 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Shared/_Layout.cshtml +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Shared/_Layout.cshtml @@ -43,7 +43,8 @@
    -
    +
    + @RenderBody()
    diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Web.config b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Web.config index b33b3e60..d186e35d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Web.config +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Web.config @@ -52,7 +52,8 @@ - + + @@ -86,12 +87,12 @@ - - - - - - + + + + + + @@ -100,6 +101,7 @@ + + + + + + + + + + +
    VirtuWorks: Run Your Business In The Cloud
    + + + + + + +
    + + + + + + +
    + + + + + + + + + + + +
    +
    + + + + + + + + + +
    + + + + + + + +
    + + + + + + +
    + + +
    + +

    + 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:Click here
    +
    +

    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 2013 to work with the VirtuWorks 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:

    + + + + + + + + + + + + + + + + +
    Outlook 2013 Client
    + Download URL:Outlook 2013 - 32bit
    Outlook 2013 - 64bit
    + KEY:HPN4P-JKC89-VCCWD-24CD2-9P8H7
    + +

    + 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.

    +

    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

    + +
    + +
    +
    +
    + + + + + + +
    + + + + + + +
    + + + + + + + + +
    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.
    +
    +
    +
    + + + + + +'; + +IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'ExchangeMailboxSetupLetter' AND [PropertyName]= N'HtmlBody' ) +BEGIN +INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'ExchangeMailboxSetupLetter', N'HtmlBody', @ExchangeMailboxSetupLetterHtmlBody) +END +ELSE +UPDATE [dbo].[UserSettings] SET [PropertyValue] = @ExchangeMailboxSetupLetterHtmlBody WHERE [UserID] = 1 AND [SettingsName]= N'ExchangeMailboxSetupLetter' AND [PropertyName]= N'HtmlBody' +GO + + +IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'ExchangeMailboxSetupLetter' AND [PropertyName]= N'Priority' ) +BEGIN +INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'ExchangeMailboxSetupLetter', N'Priority', N'Normal') +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') +END +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 +================================= + +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' ) +BEGIN +INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'ExchangeMailboxSetupLetter', N'TextBody', @ExchangeMailboxSetupLetterTextBody) +END +ELSE +UPDATE [dbo].[UserSettings] SET [PropertyValue] = @ExchangeMailboxSetupLetterTextBody WHERE [UserID] = 1 AND [SettingsName]= N'ExchangeMailboxSetupLetter' AND [PropertyName]= N'TextBody' +GO + -- ORGANIZATION USER PASSWORD RESET TOKENS diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs index 43e9ec0d..404ce57d 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs @@ -1646,7 +1646,7 @@ namespace WebsitePanel.EnterpriseServer TaskManager.Write("MailTo : " + mailTo); // send mail message - //MailHelper.SendMessage(from, mailTo, string.Empty, subject, body, priority, isHtml); + MailHelper.SendMessage(from, mailTo, null, subject, body, priority, isHtml); } catch (Exception ex) { From 12d026e8b0ab8b9469b87cc3d0a980077e5c6069 Mon Sep 17 00:00:00 2001 From: Alexander Trofimov Date: Fri, 17 Apr 2015 22:40:39 +0300 Subject: [PATCH 16/38] wsp-10329 Adding hyper-v replica to HyperV Provider. WebPortal Part. --- .../VirtualizationErrorCodes.cs | 2 + .../VirtualizationServerController2012.cs | 44 +++ .../App_Data/WebsitePanel_Modules.config | 1 + .../HyperV2012R2_Settings.ascx.cs | 7 +- .../VpsDetailsReplications.ascx.resx | 174 ++++++++++++ .../VPS2012/VpsDetailsReplications.ascx | 146 ++++++++++ .../VPS2012/VpsDetailsReplications.ascx.cs | 262 +++++++++++++++++ .../VpsDetailsReplications.ascx.designer.cs | 267 ++++++++++++++++++ .../WebsitePanel.Portal.Modules.csproj | 11 + 9 files changed, 910 insertions(+), 4 deletions(-) create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsReplications.ascx.resx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsReplications.ascx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsReplications.ascx.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsReplications.ascx.designer.cs diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Virtualization/VirtualizationErrorCodes.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Virtualization/VirtualizationErrorCodes.cs index 7c92ee9f..4e51f34e 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Virtualization/VirtualizationErrorCodes.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Virtualization/VirtualizationErrorCodes.cs @@ -115,6 +115,8 @@ // Replication public const string SET_REPLICA_SERVER_ERROR = "SET_REPLICA_SERVER_ERROR"; + public const string SET_NO_REPLICA_SERVER_ERROR = "SET_NO_REPLICA_SERVER_ERROR"; + public const string SET_SET_REPLICATION_ERROR = "SET_SET_REPLICATION_ERROR"; public const string HOST_NAMER_IS_ALREADY_USED = "HOST_NAMER_IS_ALREADY_USED"; diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Virtualization2012/VirtualizationServerController2012.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Virtualization2012/VirtualizationServerController2012.cs index 79a19aeb..f84f9849 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Virtualization2012/VirtualizationServerController2012.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Virtualization2012/VirtualizationServerController2012.cs @@ -3751,6 +3751,50 @@ namespace WebsitePanel.EnterpriseServer return vs.IsReplicaServer(remoteServer); } + public static VmReplication GetReplication(int itemId) + { + VirtualMachine vm = GetVirtualMachineByItemId(itemId); + VirtualizationServer2012 vs = GetVirtualizationProxy(vm.ServiceId); + return vs.GetReplication(vm.VirtualMachineId); + } + + public static ResultObject SetVmReplication(int itemId, string replicaServer, VmReplication replication) + { + ResultObject result = new ResultObject(); + try + { + VirtualMachine vm = GetVirtualMachineByItemId(itemId); + VirtualizationServer2012 vs = GetVirtualizationProxy(vm.ServiceId); + + // Get replica server name + StringDictionary vsSesstings = ServerController.GetServiceSettings(vm.ServiceId); + string replicaServiceId = vsSesstings["ReplicaServerId"]; + + if (string.IsNullOrEmpty(replicaServiceId)) + { + result.ErrorCodes.Add(VirtualizationErrorCodes.SET_NO_REPLICA_SERVER_ERROR); + return result; + } + + //StringDictionary vsSesstings = ServerController.GetServiceSettings(vm.replicaServiceId); + //string replicaServiceId = vsSesstings["ReplicaServerId"]; + + //if (string.IsNullOrEmpty(replicaServiceId)) + //{ + // result.ErrorCodes.Add(VirtualizationErrorCodes.SET_NO_REPLICA_SERVER_ERROR); + // return result; + //} + + vs.SetVmReplication(vm.VirtualMachineId, replicaServer, replication); + result.IsSuccess = true; + } + catch (Exception ex) + { + result.AddError(VirtualizationErrorCodes.SET_SET_REPLICATION_ERROR, ex); + } + return result; + } + #endregion } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config index 827da994..e9b74d59 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config @@ -658,6 +658,7 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/HyperV2012R2_Settings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/HyperV2012R2_Settings.ascx.cs index 974ce822..2734e9eb 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/HyperV2012R2_Settings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/HyperV2012R2_Settings.ascx.cs @@ -237,7 +237,7 @@ namespace WebsitePanel.Portal.ProviderControls continue; var currentServiceSettings = ConvertArrayToDictionary(ES.Services.Servers.GetServiceSettings(serviceId)); - if (currentServiceSettings["ReplicaMode"] == ReplicaMode.IsReplicaServer.ToString()) + if (currentServiceSettings["ReplicaMode"] != ReplicaMode.IsReplicaServer.ToString()) continue; var exists = false; @@ -294,11 +294,10 @@ namespace WebsitePanel.Portal.ProviderControls ManagePreferredNameServerRow.Visible = ManageNicConfigRow.Visible && (ddlManageNicConfig.SelectedIndex == 0); // Replica - IsReplicaServerRow.Visible = IsReplicaServer; EnableReplicaRow.Visible = EnabledReplica; - ddlCertThumbnail.Visible = !IsRemoteServer; - txtCertThumbnail.Visible = CertificateThumbnailValidator.Visible = IsRemoteServer; IsReplicaServerRow.Visible = IsReplicaServer; + ddlCertThumbnail.Visible = CertificateDdlThumbnailValidator.Visible = !IsRemoteServer; + txtCertThumbnail.Visible = CertificateThumbnailValidator.Visible = IsRemoteServer; ReplicaPathErrorTr.Visible = ReplicaErrorTr.Visible = false; if (IsReplicaServer) BindCertificates(); if (EnabledReplica) BindReplicaServices(); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsReplications.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsReplications.ascx.resx new file mode 100644 index 00000000..3b106beb --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/App_LocalResources/VpsDetailsReplications.ascx.resx @@ -0,0 +1,174 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + if(this.disabled) return false;if(!confirm('Do you want to apply selected snapshot to VPS?')) return false;ShowProgressDialog('Applying snapshot...'); + + + if(this.disabled) return false;if(!confirm('Do you want to completely delete selected snapshot?')) return false;ShowProgressDialog('Deleting snapshot...'); + + + if(!confirm('Do you want to completely delete selected snapshot and all its sub-tree?')) return false;ShowProgressDialog('Deleting snapshot sub-tree...'); + + + ShowProgressDialog('Renaming snapshot...', 'RenameSnapshotModal'); + + + ShowProgressDialog('Taking snapshot...'); + + + Now + + + This virtual server has no snapshots. + + + Apply + + + Cancel + + + Delete + + + Delete Subtree + + + Rename + + + Rename + + + <p>To take a <b>snapshot</b> is much like to take a picture of current VPS state: its configuration, memory and hard disk.</p><p>Snapshots maybe used as backup/restore points when installing new software or using VPS for development or testing purposes. If something has gone wrong there is an ability to roll-back and <b>"Apply"</b> a snapshot with good configuration.</p><p><b>"Rename"</b> button allows renaming snapshot and giving it some informative name, for example "Before applying service pack".</p> + + + Created: + + + Number of Snapshots: + + + Rename Snapshot + + + Snapshots + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsReplications.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsReplications.ascx new file mode 100644 index 00000000..b66cb332 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsReplications.ascx @@ -0,0 +1,146 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VpsDetailsReplications.ascx.cs" Inherits="WebsitePanel.Portal.VPS2012.VpsDetailsReplications" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/ServerTabs.ascx" TagName="ServerTabs" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="UserControls/FormTitle.ascx" TagName="FormTitle" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/QuotaViewer.ascx" TagName="QuotaViewer" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + +
    +
    + +
    + +
    + +
    + +
    + +
    +
    +
    + + +
    +
    + + + + + + + + + +
    + +
    + +
    +
    + + + + + + + + +
    + +
    + +
    +
    + +     + + +
    + +

    + + +

    +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    +
    + +
    +
    + +
    + +
    +
    + + + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsReplications.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsReplications.ascx.cs new file mode 100644 index 00000000..d231dc9a --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsReplications.ascx.cs @@ -0,0 +1,262 @@ +// Copyright (c) 2015, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +using System; +using System.Collections.Generic; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.Providers.Common; +using WebsitePanel.Providers.Virtualization; + +namespace WebsitePanel.Portal.VPS2012 +{ + public partial class VpsDetailsReplications : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + BindSnapshotsTree(); + } + } + + private void BindSnapshotsTree() + { + VirtualMachineSnapshot[] snapshots = ES.Services.VPS2012.GetVirtualMachineSnapshots(PanelRequest.ItemID); + + // clear tree + SnapshotsTree.Nodes.Clear(); + + // fill tree by root nodes + AddChildNodes(SnapshotsTree.Nodes, null, snapshots); + + // select first node + if (SnapshotsTree.Nodes.Count > 0) + { + SnapshotsTree.Nodes[0].Selected = true; + } + + // refresh + BindSelectedNode(); + + // quotas + VirtualMachine vm = ES.Services.VPS2012.GetVirtualMachineItem(PanelRequest.ItemID); + snapshotsQuota.QuotaUsedValue = snapshots.Length; + snapshotsQuota.QuotaValue = vm.SnapshotsNumber; + btnTakeSnapshot.Enabled = snapshots.Length < vm.SnapshotsNumber; + } + + private void BindSelectedNode() + { + TreeNode node = SnapshotsTree.SelectedNode; + + btnApply.Enabled = + btnRename.Enabled = + btnDelete.Enabled = + btnDeleteSubtree.Enabled = + SnapshotDetailsPanel.Visible = (node != null); + + NoSnapshotsPanel.Visible = (SnapshotsTree.Nodes.Count == 0); + + if (node != null) + { + // set name + txtSnapshotName.Text = node.Text; + + // load snapshot details + VirtualMachineSnapshot snapshot = ES.Services.VPS2012.GetSnapshot(PanelRequest.ItemID, node.Value); + if (snapshot != null) + litCreated.Text = snapshot.Created.ToString(); + + // set image + imgThumbnail.ImageUrl = + string.Format("~/DesktopModules/WebsitePanel/VPS2012/VirtualMachineSnapshotImage.ashx?ItemID={0}&SnapshotID={1}&rnd={2}", + PanelRequest.ItemID, HttpUtility.UrlEncode(node.Value), DateTime.Now.Ticks); + } + } + + private void AddChildNodes(TreeNodeCollection parent, string parentId, VirtualMachineSnapshot[] snapshots) + { + foreach (VirtualMachineSnapshot snapshot in snapshots) + { + if (snapshot.ParentId == parentId) + { + // add node + TreeNode node = new TreeNode(snapshot.Name, snapshot.Id); + node.Expanded = true; + node.ImageUrl = PortalUtils.GetThemedImage("VPS/snapshot.png"); + parent.Add(node); + + // check if the current + if (snapshot.IsCurrent) + { + TreeNode nowNode = new TreeNode(GetLocalizedString("Now.Text"), ""); + nowNode.ImageUrl = PortalUtils.GetThemedImage("VPS/start2.png"); + nowNode.SelectAction = TreeNodeSelectAction.None; + node.ChildNodes.Add(nowNode); + } + + // fill children + AddChildNodes(node.ChildNodes, snapshot.Id, snapshots); + } + } + } + + protected void btnTakeSnapshot_Click(object sender, EventArgs e) + { + try + { + ResultObject res = ES.Services.VPS2012.CreateSnapshot(PanelRequest.ItemID); + + if (res.IsSuccess) + { + // bind tree + BindSnapshotsTree(); + return; + } + else + { + // show error + messageBox.ShowMessage(res, "VPS_ERROR_TAKE_SNAPSHOT", "VPS"); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_TAKE_SNAPSHOT", ex); + } + } + + protected void btnApply_Click(object sender, EventArgs e) + { + try + { + ResultObject res = ES.Services.VPS2012.ApplySnapshot(PanelRequest.ItemID, GetSelectedSnapshot()); + + if (res.IsSuccess) + { + // bind tree + BindSnapshotsTree(); + return; + } + else + { + // show error + messageBox.ShowMessage(res, "VPS_ERROR_APPLY_SNAPSHOT", "VPS"); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_APPLY_SNAPSHOT", ex); + } + } + + protected void btnRenameSnapshot_Click(object sender, EventArgs e) + { + try + { + string newName = txtSnapshotName.Text.Trim(); + ResultObject res = ES.Services.VPS2012.RenameSnapshot(PanelRequest.ItemID, GetSelectedSnapshot(), newName); + + if (res.IsSuccess) + { + // bind tree + SnapshotsTree.SelectedNode.Text = newName; + return; + } + else + { + // show error + messageBox.ShowMessage(res, "VPS_ERROR_RENAME_SNAPSHOT", "VPS"); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_RENAME_SNAPSHOT", ex); + } + } + + protected void btnDelete_Click(object sender, EventArgs e) + { + try + { + ResultObject res = ES.Services.VPS2012.DeleteSnapshot(PanelRequest.ItemID, GetSelectedSnapshot()); + + if (res.IsSuccess) + { + // bind tree + BindSnapshotsTree(); + return; + } + else + { + // show error + messageBox.ShowMessage(res, "VPS_ERROR_DELETE_SNAPSHOT", "VPS"); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_DELETE_SNAPSHOT", ex); + } + } + + protected void btnDeleteSubtree_Click(object sender, EventArgs e) + { + try + { + ResultObject res = ES.Services.VPS2012.DeleteSnapshotSubtree(PanelRequest.ItemID, GetSelectedSnapshot()); + + if (res.IsSuccess) + { + // bind tree + BindSnapshotsTree(); + return; + } + else + { + // show error + messageBox.ShowMessage(res, "VPS_ERROR_DELETE_SNAPSHOT_SUBTREE", "VPS"); + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("VPS_ERROR_DELETE_SNAPSHOT_SUBTREE", ex); + } + } + + private string GetSelectedSnapshot() + { + return SnapshotsTree.SelectedNode.Value; + } + + protected void SnapshotsTree_SelectedNodeChanged(object sender, EventArgs e) + { + BindSelectedNode(); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsReplications.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsReplications.ascx.designer.cs new file mode 100644 index 00000000..dcfa30fe --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/VPS2012/VpsDetailsReplications.ascx.designer.cs @@ -0,0 +1,267 @@ +//------------------------------------------------------------------------------ +// +// 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.VPS2012 { + + + public partial class VpsDetailsReplications { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.Menu menu; + + /// + /// imgIcon control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgIcon; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.FormTitle locTitle; + + /// + /// tabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.VPS2012.UserControls.ServerTabs tabs; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// btnTakeSnapshot control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnTakeSnapshot; + + /// + /// SnapshotsTree control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TreeView SnapshotsTree; + + /// + /// NoSnapshotsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl NoSnapshotsPanel; + + /// + /// locNoSnapshots control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locNoSnapshots; + + /// + /// locQuota control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locQuota; + + /// + /// snapshotsQuota control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.QuotaViewer snapshotsQuota; + + /// + /// SnapshotDetailsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableCell SnapshotDetailsPanel; + + /// + /// imgThumbnail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgThumbnail; + + /// + /// locCreated control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locCreated; + + /// + /// litCreated control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litCreated; + + /// + /// btnApply control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton btnApply; + + /// + /// btnRename control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton btnRename; + + /// + /// btnDelete control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton btnDelete; + + /// + /// btnDeleteSubtree control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.LinkButton btnDeleteSubtree; + + /// + /// RenamePanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel RenamePanel; + + /// + /// locRenameSnapshot control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locRenameSnapshot; + + /// + /// txtSnapshotName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtSnapshotName; + + /// + /// SnapshotNameValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator SnapshotNameValidator; + + /// + /// btnRenameSnapshot control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnRenameSnapshot; + + /// + /// btnCancelRename control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCancelRename; + + /// + /// RenameSnapshotModal control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::AjaxControlToolkit.ModalPopupExtender RenameSnapshotModal; + } +} 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 f9c0c3ad..9c1cd5a4 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj @@ -512,6 +512,13 @@ VpsDetailsPermissions.ascx + + VpsDetailsReplications.ascx + ASPXCodeBehind + + + VpsDetailsReplications.ascx + VpsDetailsSnapshots.ascx ASPXCodeBehind @@ -4849,6 +4856,7 @@ + @@ -5220,6 +5228,9 @@ Designer + + Designer +
    From e8643e17ddcd0c43bacfc29ab2007fa3a0d0abec Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Fri, 17 Apr 2015 23:03:49 -0400 Subject: [PATCH 17/38] Added tag build-2.1.0.668 for changeset 41c22204b579 From 087697ba7f3a21d9617c70265a87f756e53a77e6 Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Mon, 20 Apr 2015 03:01:21 -0700 Subject: [PATCH 18/38] password reset fixes --- WebsitePanel/Database/update_db.sql | 10 ++++-- .../System/SystemSettings.cs | 22 ++++++++++++- .../ExchangeServerController.cs | 8 ++++- .../HostedSolution/OrganizationController.cs | 31 ++++++++++++++++--- .../Controllers/AccountController.cs | 12 ++++++- .../Models/AccountModel.cs | 2 ++ .../Views/Account/Login.cshtml | 6 +++- .../Views/Shared/_Layout.cshtml | 13 +++++--- .../SystemSettings.ascx.resx | 6 ++++ .../UserOrganization.ascx.resx | 3 ++ .../ExchangeServer/OrganizationHome.ascx | 8 ----- .../ExchangeServer/OrganizationHome.ascx.cs | 3 -- .../OrganizationHome.ascx.designer.cs | 18 ----------- .../OrganizationUserGeneralSettings.ascx.cs | 8 +++++ .../WebsitePanel/SystemSettings.ascx | 6 ++++ .../WebsitePanel/SystemSettings.ascx.cs | 3 ++ .../SystemSettings.ascx.designer.cs | 18 +++++++++++ .../UserControls/OrganizationMenuControl.cs | 2 ++ 18 files changed, 133 insertions(+), 46 deletions(-) diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index 0490afd7..9fa58a77 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -9850,7 +9850,7 @@ Hello #user.FirstName#, Your password expiration date is #user.PasswordExpirationDateTime#. You can reset your own password by visiting the following page:

    -#passwordResetLink# +#passwordResetLink#

    @@ -9963,7 +9963,7 @@ Hello #user.FirstName#, We received a request to reset the password for your account. If you made this request, click the link below. If you did not make this request, you can ignore this email.

    -#passwordResetLink# +#passwordResetLink#

    @@ -10139,10 +10139,12 @@ Set @ExchangeMailboxSetupLetterHtmlBody = N'E-mail: #Account.PrimaryEmailAddress# + Password Reset Url: - Click here + Click here +

    DNS

    @@ -10308,8 +10310,10 @@ The following user accounts have been created for you. Username: #Account.UserPrincipalName# E-mail: #Account.PrimaryEmailAddress# + Password Reset Url: #PswResetUrl# + ================================= DNS diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/System/SystemSettings.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/System/SystemSettings.cs index 89033a84..d3edc7ee 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/System/SystemSettings.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/System/SystemSettings.cs @@ -27,6 +27,7 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using System; +using System.Linq; using System.Xml; using System.Collections.Generic; using System.Text; @@ -46,6 +47,7 @@ namespace WebsitePanel.EnterpriseServer public const string PACKAGE_DISPLAY_SETTINGS = "PackageDisplaySettings"; public const string RDS_SETTINGS = "RdsSettings"; public const string WEBDAV_PORTAL_SETTINGS = "WebdavPortalSettings"; + public const string WEBDAV_PASSWORD_RESET_ENABLED_KEY = "WebdavPasswordResetEnabled"; // key to access to wpi main & custom feed in wpi settings public const string WPI_MAIN_FEED_KEY = "WpiMainFeedUrl"; @@ -98,7 +100,25 @@ namespace WebsitePanel.EnterpriseServer } } - public int GetInt(string settingName) + public bool Contains(string settingName) + { + return Settings.AllKeys.Any(x => x.ToLowerInvariant() == (settingName ?? string.Empty).ToLowerInvariant()); + } + + public T GetValueOrDefault(string settingName, T defaultValue) + { + try + { + return (T)Convert.ChangeType(Settings[settingName], typeof(T)); + } + catch + { + } + + return defaultValue; + } + + public int GetInt(string settingName) { return Int32.Parse(Settings[settingName]); } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs index b6458e47..47a17473 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs @@ -2613,10 +2613,16 @@ namespace WebsitePanel.EnterpriseServer // add account items["Account"] = account; - items["PswResetUrl"] = OrganizationController.GenerateUserPasswordResetLink(account.ItemId, account.AccountId); items["AccountDomain"] = account.PrimaryEmailAddress.Substring(account.PrimaryEmailAddress.IndexOf("@") + 1); items["DefaultDomain"] = org.DefaultDomain; + var passwordResetUrl = OrganizationController.GenerateUserPasswordResetLink(account.ItemId, account.AccountId); + if (!string.IsNullOrEmpty(passwordResetUrl)) + { + items["PswResetUrl"] = passwordResetUrl; + } + + if (!String.IsNullOrEmpty(account.SamAccountName)) { int idx = account.SamAccountName.IndexOf("\\"); diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs index 404ce57d..15ca5e96 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs @@ -1684,6 +1684,11 @@ namespace WebsitePanel.EnterpriseServer throw new Exception("Webdav portal system settings are not set"); } + if (!settings.GetValueOrDefault(SystemSettings.WEBDAV_PASSWORD_RESET_ENABLED_KEY, false) ||!settings.Contains("WebdavPortalUrl")) + { + return string.Empty; + } + var webdavPortalUrl = new Uri(settings["WebdavPortalUrl"]); var token = CreateAccessToken(itemId, accountId, AccessTokenTypes.PasswrodReset); @@ -1794,11 +1799,12 @@ namespace WebsitePanel.EnterpriseServer NumbersCount = Utils.ParseInt(parts[4], 0), SymbolsCount = Utils.ParseInt(parts[5], 0), AccountLockoutThreshold = Utils.ParseInt(parts[7], 0), - EnforcePasswordHistory = Utils.ParseInt(parts[8], 0), - AccountLockoutDuration = Utils.ParseInt(parts[9], 0), - ResetAccountLockoutCounterAfter = Utils.ParseInt(parts[10], 0), - LockoutSettingsEnabled = Utils.ParseBool(parts[11], false), - PasswordComplexityEnabled = Utils.ParseBool(parts[12], true), + + EnforcePasswordHistory = GetValueSafe(parts, 8, 0), + AccountLockoutDuration = GetValueSafe(parts, 9, 0), + ResetAccountLockoutCounterAfter = GetValueSafe(parts, 10, 0), + LockoutSettingsEnabled = GetValueSafe(parts, 11, false), + PasswordComplexityEnabled = GetValueSafe(parts, 11, true), }; @@ -1821,6 +1827,21 @@ namespace WebsitePanel.EnterpriseServer return passwordSettings; } + public static T GetValueSafe(string[] array, int index, T defaultValue) + { + if (array.Length > index) + { + if (string.IsNullOrEmpty(array[index])) + { + return defaultValue; + } + + return (T)Convert.ChangeType(array[index], typeof(T)); + } + + return defaultValue; + } + public static void UpdateOrganizationGeneralSettings(int itemId, OrganizationGeneralSettings settings) { TaskManager.StartTask("ORGANIZATION", "UPDATE_GENERAL_SETTINGS"); diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Controllers/AccountController.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Controllers/AccountController.cs index f326b353..654fd5d8 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Controllers/AccountController.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Controllers/AccountController.cs @@ -44,7 +44,17 @@ namespace WebsitePanel.WebDavPortal.Controllers return RedirectToRoute(FileSystemRouteNames.ShowContentPath, new { org = WspContext.User.OrganizationId }); } - return View(); + var model = new AccountModel(); + + var settings = WspContext.Services.System.GetSystemSettings(EnterpriseServer.SystemSettings.WEBDAV_PORTAL_SETTINGS); + + if (settings != null) + { + model.PasswordResetEnabled = settings.GetValueOrDefault(EnterpriseServer.SystemSettings.WEBDAV_PASSWORD_RESET_ENABLED_KEY, false); + + } + + return View(model); } [HttpPost] diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/AccountModel.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/AccountModel.cs index 3093f79c..57351755 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/AccountModel.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Models/AccountModel.cs @@ -17,5 +17,7 @@ namespace WebsitePanel.WebDavPortal.Models public string Password { get; set; } public string LdapError { get; set; } + + public bool PasswordResetEnabled { get; set; } } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Account/Login.cshtml b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Account/Login.cshtml index 65d23735..23aaf2f0 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Account/Login.cshtml +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Account/Login.cshtml @@ -9,6 +9,7 @@
    + @Html.HiddenFor(x=>x.PasswordResetEnabled)

    Sign In

    @@ -33,7 +34,10 @@
    - @UI.ForgotYourPassword + @if (Model.PasswordResetEnabled) + { + @UI.ForgotYourPassword + }
    diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Shared/_Layout.cshtml b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Shared/_Layout.cshtml index 17e01610..0a08f09f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Shared/_Layout.cshtml +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/Shared/_Layout.cshtml @@ -28,11 +28,14 @@ + + + + + + + + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + +
    + + + +
    + + + +
    + + + + +
    + + + +
    + + +
    + + +
    +
    + + +
    +
    + + + + 30seconds + 5minutes + 15minutes + +
    + + + + Maintain only the latest recovery point + Create additional hourly recovery points + + + + + + + + + + + +
    + + + + + + +
    + + +
    + + + + +
    +
    +
    +
    + +
    +
    +
    + + + -