From 43ff5bfaf696543b17b000cc506ba09722b2164b Mon Sep 17 00:00:00 2001 From: robvde Date: Sat, 19 Jan 2013 09:55:05 +0400 Subject: [PATCH] fixed: AD verification on samAccountName when creating user object --- .../HostedSolution/OrganizationController.cs | 23 +- .../HostedSolution/IOrganization.cs | 2 + .../OrganizationProvider.cs | 41 + .../OrganizationProxy.cs | 1034 ++++++++++------- .../WebsitePanel.Server/Organizations.asmx.cs | 7 + 5 files changed, 691 insertions(+), 416 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs index ef2994d8..fd26bfd9 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs @@ -1329,7 +1329,7 @@ namespace WebsitePanel.EnterpriseServer Organizations orgProxy = GetOrganizationProxy(org.ServiceId); string upn = string.Format("{0}@{1}", name, domain); - string sAMAccountName = BuildAccountName(org.OrganizationId, name); + string sAMAccountName = BuildAccountName(org.OrganizationId, name, org.ServiceId); TaskManager.Write("accountName :" + sAMAccountName); TaskManager.Write("upn :" + upn); @@ -1454,21 +1454,21 @@ namespace WebsitePanel.EnterpriseServer { DataProvider.AddExchangeAccountEmailAddress(accountId, emailAddress); } - - private static string BuildAccountName(string orgId, string name) + + private static string BuildAccountName(string orgId, string name, int ServiceId) { string accountName = name = name.Replace(" ", ""); string CounterStr = "00000"; int counter = 0; bool bFound = false; - if (!AccountExists(accountName)) return accountName; + if (!AccountExists(accountName, ServiceId)) return accountName; do { accountName = genSamLogin(name, CounterStr); - if (!AccountExists(accountName)) bFound = true; + if (!AccountExists(accountName, ServiceId)) bFound = true; CounterStr = counter.ToString("d5"); counter++; @@ -1494,9 +1494,18 @@ namespace WebsitePanel.EnterpriseServer } - private static bool AccountExists(string accountName) + private static bool AccountExists(string accountName, int ServiceId) { - return DataProvider.ExchangeAccountExists(accountName); + if (!DataProvider.ExchangeAccountExists(accountName)) + { + Organizations orgProxy = GetOrganizationProxy(ServiceId); + + + return orgProxy.DoesSamAccountNameExist(accountName); + } + else + return true; + } public static int DeleteUser(int itemId, int accountId) diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/IOrganization.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/IOrganization.cs index e3ce875d..4c4bddd9 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/IOrganization.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/IOrganization.cs @@ -64,5 +64,7 @@ namespace WebsitePanel.Providers.HostedSolution PasswordPolicyResult GetPasswordPolicy(); string GetSamAccountNameByUserPrincipalName(string organizationId, string userPrincipalName); + + bool DoesSamAccountNameExist(string accountName); } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs index cd7e60b0..3b37a4df 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs @@ -710,6 +710,47 @@ namespace WebsitePanel.Providers.HostedSolution } + public bool DoesSamAccountNameExist(string accountName) + { + return DoesSamAccountNameExistInternal(accountName); + } + + + private bool DoesSamAccountNameExistInternal(string accountName) + { + HostedSolutionLog.LogStart("DoesSamAccountNameExistInternal"); + HostedSolutionLog.DebugInfo("userPrincipalName : {0}", accountName); + bool bFound = false; + + try + { + + string path = GetRootOU(); + DirectoryEntry entry = ActiveDirectoryUtils.GetADObject(path); + + DirectorySearcher searcher = new DirectorySearcher(entry); + searcher.PropertiesToLoad.Add("sAMAccountName"); + searcher.Filter = "(sAMAccountName=" + accountName + ")"; + searcher.SearchScope = SearchScope.Subtree; + + SearchResult resCollection = searcher.FindOne(); + if (resCollection != null) + { + if (resCollection.Properties["samaccountname"] != null) + bFound = true; ; + } + + HostedSolutionLog.LogEnd("GetSamAccountNameByUserPrincipalNameInternal"); + } + catch (Exception e) + { + HostedSolutionLog.DebugInfo("Failed : {0}", e.Message); + } + + return bFound; + } + + #endregion #region Domains diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/OrganizationProxy.cs b/WebsitePanel/Sources/WebsitePanel.Server.Client/OrganizationProxy.cs index f7ecb33e..ee7b41c2 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.Client/OrganizationProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/OrganizationProxy.cs @@ -26,7 +26,6 @@ // (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. @@ -40,7 +39,8 @@ // // This source code was auto-generated by wsdl, Version=2.0.50727.3038. // -namespace WebsitePanel.Providers.HostedSolution { +namespace WebsitePanel.Providers.HostedSolution +{ using System.Xml.Serialization; using System.Web.Services; using System.ComponentModel; @@ -48,220 +48,252 @@ namespace WebsitePanel.Providers.HostedSolution { using System; using System.Diagnostics; - using WebsitePanel.Providers.Common; using WebsitePanel.Providers.ResultObjects; + /// [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 DeleteUserOperationCompleted; - + private System.Threading.SendOrPostCallback GetUserGeneralSettingsOperationCompleted; - + 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; + /// - public Organizations() { + 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 DeleteUserCompletedEventHandler DeleteUserCompleted; - + /// public event GetUserGeneralSettingsCompletedEventHandler GetUserGeneralSettingsCompleted; - + /// 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; + /// [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, @@ -271,9 +303,10 @@ 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, @@ -282,21 +315,25 @@ 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[] { @@ -307,134 +344,153 @@ 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/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/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) { + 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) + { this.Invoke("SetUserGeneralSettings", new object[] { organizationId, accountName, @@ -465,39 +521,40 @@ namespace WebsitePanel.Providers.HostedSolution { notes, externalEmail}); } - + /// 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, - 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, + System.AsyncCallback callback, + object asyncState) + { return this.BeginInvoke("SetUserGeneralSettings", new object[] { organizationId, accountName, @@ -528,77 +585,81 @@ namespace WebsitePanel.Providers.HostedSolution { notes, externalEmail}, 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) { + 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) + { 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, 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, - 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, + object userState) + { + if ((this.SetUserGeneralSettingsOperationCompleted == null)) + { this.SetUserGeneralSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetUserGeneralSettingsOperationCompleted); } this.InvokeAsync("SetUserGeneralSettings", new object[] { @@ -631,45 +692,53 @@ namespace WebsitePanel.Providers.HostedSolution { notes, externalEmail}, 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[] { @@ -677,45 +746,53 @@ 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[] { @@ -723,371 +800,510 @@ 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)); } } - + /// - public new void CancelAsync(object 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) + { + object[] results = this.Invoke("DoesSamAccountNameExist", new object[] { + accountName}); + return ((bool)(results[0])); + } + + /// + 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) + { + object[] results = this.EndInvoke(asyncResult); + return ((bool)(results[0])); + } + + /// + public void DoesSamAccountNameExistAsync(string accountName) + { + this.DoesSamAccountNameExistAsync(accountName, 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)) + { + 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)); + } + } + + /// + public new void CancelAsync(object userState) + { base.CancelAsync(userState); } } - + /// [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.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.3038")] public delegate void CreateOrganizationCompletedEventHandler(object sender, CreateOrganizationCompletedEventArgs e); - + /// [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.3038")] public delegate void DeleteOrganizationCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// [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.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.3038")] public delegate void DeleteUserCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// [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.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.3038")] public delegate void SetUserGeneralSettingsCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// [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.3038")] public delegate void SetUserPrincipalNameCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// [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.3038")] public delegate void CreateOrganizationDomainCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// [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.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.3038")] public delegate void GetSamAccountNameByUserPrincipalNameCompletedEventHandler(object sender, GetSamAccountNameByUserPrincipalNameCompletedEventArgs e); - + /// [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.3038")] + public delegate void DoesSamAccountNameExistCompletedEventHandler(object sender, DoesSamAccountNameExistCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + 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) + { + this.results = results; + } + + /// + public bool Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((bool)(this.results[0])); + } + } + } } diff --git a/WebsitePanel/Sources/WebsitePanel.Server/Organizations.asmx.cs b/WebsitePanel/Sources/WebsitePanel.Server/Organizations.asmx.cs index 4b70e354..1e814394 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/Organizations.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server/Organizations.asmx.cs @@ -162,5 +162,12 @@ namespace WebsitePanel.Server { return Organization.GetSamAccountNameByUserPrincipalName(organizationId, userPrincipalName); } + + [WebMethod, SoapHeader("settings")] + public bool DoesSamAccountNameExist(string accountName) + { + return Organization.DoesSamAccountNameExist(accountName); + } + } }