diff --git a/WebsitePanel.WHMCSModule/modules/servers/websitepanel/websitepanel.php b/WebsitePanel.WHMCSModule/modules/servers/websitepanel/websitepanel.php index ea5c8c05..f322d709 100644 --- a/WebsitePanel.WHMCSModule/modules/servers/websitepanel/websitepanel.php +++ b/WebsitePanel.WHMCSModule/modules/servers/websitepanel/websitepanel.php @@ -310,10 +310,10 @@ function websitepanel_ChangePassword($params) else { // Attempt to change the user's account password - $result = $wsp->change_user_password($user['UserId'], $password); + $result = $wsp->changeUserPassword($user['UserId'], $password); if ($result >= 0) { - // Log this action for logging / tracking purposes incase the client complains we have record of what went on and why + // Log this action for logging / tracking purposes incase the client complains we have record of what went on and why logActivity("Control Panel Password Updated - Service ID: {$serviceId}", $userId); // Success - Alert WHMCS diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index df4b9e3f..895dc713 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -1637,6 +1637,13 @@ IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE ([QuotaName] = N'Exchange2007. BEGIN INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (422, 12, 26, N'Exchange2007.DisclaimersAllowed', N'Disclaimers Allowed', 1, 0, NULL, NULL) END +GO + +--add SecurityGroupManagement Quota +IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'HostedSolution.SecurityGroupManagement') +BEGIN +INSERT [dbo].[Quotas] ([QuotaID], [GroupID],[QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (423, 13, 5, N'HostedSolution.SecurityGroupManagement', N'Allow Security Group Management', 1, 0, NULL, NULL) +END GO -- Lync Enterprise Voice @@ -2098,3 +2105,133 @@ AS + +ALTER PROCEDURE [dbo].[SearchExchangeAccounts] +( + @ActorID int, + @ItemID int, + @IncludeMailboxes bit, + @IncludeContacts bit, + @IncludeDistributionLists bit, + @IncludeRooms bit, + @IncludeEquipment bit, + @IncludeSecurityGroups bit, + @FilterColumn nvarchar(50) = '', + @FilterValue nvarchar(50) = '', + @SortColumn nvarchar(50) +) +AS +DECLARE @PackageID int +SELECT @PackageID = PackageID FROM ServiceItems +WHERE ItemID = @ItemID + +-- check rights +IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0 +RAISERROR('You are not allowed to access this package', 16, 1) + +-- start +DECLARE @condition nvarchar(700) +SET @condition = ' +((@IncludeMailboxes = 1 AND EA.AccountType = 1) +OR (@IncludeContacts = 1 AND EA.AccountType = 2) +OR (@IncludeDistributionLists = 1 AND EA.AccountType = 3) +OR (@IncludeRooms = 1 AND EA.AccountType = 5) +OR (@IncludeEquipment = 1 AND EA.AccountType = 6) +OR (@IncludeSecurityGroups = 1 AND EA.AccountType = 8)) +AND EA.ItemID = @ItemID +' + +IF @FilterColumn <> '' AND @FilterColumn IS NOT NULL +AND @FilterValue <> '' AND @FilterValue IS NOT NULL +SET @condition = @condition + ' AND ' + @FilterColumn + ' LIKE ''' + @FilterValue + '''' + +IF @SortColumn IS NULL OR @SortColumn = '' +SET @SortColumn = 'EA.DisplayName ASC' + +DECLARE @sql nvarchar(3500) + +set @sql = ' +SELECT + EA.AccountID, + EA.ItemID, + EA.AccountType, + EA.AccountName, + EA.DisplayName, + EA.PrimaryEmailAddress, + EA.MailEnabledPublicFolder, + EA.SubscriberNumber, + EA.UserPrincipalName +FROM ExchangeAccounts AS EA +WHERE ' + @condition + +print @sql + +exec sp_executesql @sql, N'@ItemID int, @IncludeMailboxes int, @IncludeContacts int, + @IncludeDistributionLists int, @IncludeRooms bit, @IncludeEquipment bit, @IncludeSecurityGroups bit', +@ItemID, @IncludeMailboxes, @IncludeContacts, @IncludeDistributionLists, @IncludeRooms, @IncludeEquipment, @IncludeSecurityGroups + +RETURN +GO + +CREATE PROCEDURE [dbo].[SearchExchangeAccountsByTypes] +( + @ActorID int, + @ItemID int, + @AccountTypes nvarchar(30), + @FilterColumn nvarchar(50) = '', + @FilterValue nvarchar(50) = '', + @SortColumn nvarchar(50) +) +AS + +DECLARE @PackageID int +SELECT @PackageID = PackageID FROM ServiceItems +WHERE ItemID = @ItemID + +-- check rights +IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0 +RAISERROR('You are not allowed to access this package', 16, 1) + +DECLARE @condition nvarchar(700) +SET @condition = 'EA.ItemID = @ItemID AND EA.AccountType IN (' + @AccountTypes + ')' + +IF @FilterColumn <> '' AND @FilterColumn IS NOT NULL +AND @FilterValue <> '' AND @FilterValue IS NOT NULL +BEGIN + IF @FilterColumn = 'PrimaryEmailAddress' AND @AccountTypes <> '2' + BEGIN + SET @condition = @condition + ' AND EA.AccountID IN (SELECT EAEA.AccountID FROM ExchangeAccountEmailAddresses EAEA WHERE EAEA.EmailAddress LIKE ''' + @FilterValue + ''')' + END + ELSE + BEGIN + SET @condition = @condition + ' AND ' + @FilterColumn + ' LIKE ''' + @FilterValue + '''' + END +END + +IF @SortColumn IS NULL OR @SortColumn = '' +SET @SortColumn = 'EA.DisplayName ASC' + +DECLARE @sql nvarchar(3500) +SET @sql = ' +SELECT + EA.AccountID, + EA.ItemID, + EA.AccountType, + EA.AccountName, + EA.DisplayName, + EA.PrimaryEmailAddress, + EA.MailEnabledPublicFolder, + EA.MailboxPlanId, + P.MailboxPlan, + EA.SubscriberNumber, + EA.UserPrincipalName +FROM + ExchangeAccounts AS EA +LEFT OUTER JOIN ExchangeMailboxPlans AS P ON EA.MailboxPlanId = P.MailboxPlanId + WHERE ' + @condition + + ' ORDER BY ' + @SortColumn + +EXEC sp_executesql @sql, N'@ItemID int', @ItemID + +RETURN +GO \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs index dd7c2eeb..6e6bad12 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs @@ -155,6 +155,7 @@ order by rg.groupOrder public const string ORGANIZATION_USERS = "HostedSolution.Users"; public const string ORGANIZATION_DOMAINS = "HostedSolution.Domains"; public const string ORGANIZATION_ALLOWCHANGEUPN = "HostedSolution.AllowChangeUPN"; + public const string ORGANIZATION_SECURITYGROUPMANAGEMENT = "HostedSolution.SecurityGroupManagement"; public const string CRM_USERS = "HostedCRM.Users"; public const string CRM_ORGANIZATION = "HostedCRM.Organization"; diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/ExchangeServerProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/ExchangeServerProxy.cs index c2434558..8fda3459 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/ExchangeServerProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/ExchangeServerProxy.cs @@ -3053,7 +3053,7 @@ namespace WebsitePanel.EnterpriseServer /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SearchAccounts", RequestNamespace = "http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace = "http://smbsaas/websitepanel/enterpriseserver", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public ExchangeAccount[] SearchAccounts(int itemId, bool includeMailboxes, bool includeContacts, bool includeDistributionLists, bool includeRooms, bool includeEquipment, string filterColumn, string filterValue, string sortColumn) + public ExchangeAccount[] SearchAccounts(int itemId, bool includeMailboxes, bool includeContacts, bool includeDistributionLists, bool includeRooms, bool includeEquipment, bool includeSecurityGroups, string filterColumn, string filterValue, string sortColumn) { object[] results = this.Invoke("SearchAccounts", new object[] { itemId, @@ -3062,6 +3062,7 @@ namespace WebsitePanel.EnterpriseServer includeDistributionLists, includeRooms, includeEquipment, + includeSecurityGroups, filterColumn, filterValue, sortColumn}); @@ -3069,7 +3070,7 @@ namespace WebsitePanel.EnterpriseServer } /// - public System.IAsyncResult BeginSearchAccounts(int itemId, bool includeMailboxes, bool includeContacts, bool includeDistributionLists, bool includeRooms, bool includeEquipment, string filterColumn, string filterValue, string sortColumn, System.AsyncCallback callback, object asyncState) + public System.IAsyncResult BeginSearchAccounts(int itemId, bool includeMailboxes, bool includeContacts, bool includeDistributionLists, bool includeRooms, bool includeEquipment, bool includeSecurityGroups, string filterColumn, string filterValue, string sortColumn, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("SearchAccounts", new object[] { itemId, @@ -3078,6 +3079,7 @@ namespace WebsitePanel.EnterpriseServer includeDistributionLists, includeRooms, includeEquipment, + includeSecurityGroups, filterColumn, filterValue, sortColumn}, callback, asyncState); @@ -3091,13 +3093,13 @@ namespace WebsitePanel.EnterpriseServer } /// - public void SearchAccountsAsync(int itemId, bool includeMailboxes, bool includeContacts, bool includeDistributionLists, bool includeRooms, bool includeEquipment, string filterColumn, string filterValue, string sortColumn) + public void SearchAccountsAsync(int itemId, bool includeMailboxes, bool includeContacts, bool includeDistributionLists, bool includeRooms, bool includeEquipment, bool includeSecurityGroups, string filterColumn, string filterValue, string sortColumn) { - this.SearchAccountsAsync(itemId, includeMailboxes, includeContacts, includeDistributionLists, includeRooms, includeEquipment, filterColumn, filterValue, sortColumn, null); + this.SearchAccountsAsync(itemId, includeMailboxes, includeContacts, includeDistributionLists, includeRooms, includeEquipment, includeSecurityGroups, filterColumn, filterValue, sortColumn, null); } /// - public void SearchAccountsAsync(int itemId, bool includeMailboxes, bool includeContacts, bool includeDistributionLists, bool includeRooms, bool includeEquipment, string filterColumn, string filterValue, string sortColumn, object userState) + public void SearchAccountsAsync(int itemId, bool includeMailboxes, bool includeContacts, bool includeDistributionLists, bool includeRooms, bool includeEquipment, bool includeSecurityGroups, string filterColumn, string filterValue, string sortColumn, object userState) { if ((this.SearchAccountsOperationCompleted == null)) { @@ -3110,6 +3112,7 @@ namespace WebsitePanel.EnterpriseServer includeDistributionLists, includeRooms, includeEquipment, + includeSecurityGroups, filterColumn, filterValue, sortColumn}, this.SearchAccountsOperationCompleted, userState); diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs index 088e33d6..fe3e9e11 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs @@ -39,7 +39,8 @@ // // This source code was auto-generated by wsdl, Version=2.0.50727.3038. // -namespace WebsitePanel.EnterpriseServer.HostedSolution { +namespace WebsitePanel.EnterpriseServer.HostedSolution +{ using System.Xml.Serialization; using System.Web.Services; using System.ComponentModel; @@ -53,151 +54,198 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { using WebsitePanel.Providers.HostedSolution; 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="esOrganizationsSoap", Namespace="http://tempuri.org/")] + [System.Web.Services.WebServiceBindingAttribute(Name = "esOrganizationsSoap", Namespace = "http://tempuri.org/")] [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResultObject))] [System.Xml.Serialization.XmlIncludeAttribute(typeof(ServiceProviderItem))] - public partial class esOrganizations : Microsoft.Web.Services3.WebServicesClientProtocol { + public partial class esOrganizations : Microsoft.Web.Services3.WebServicesClientProtocol + { private System.Threading.SendOrPostCallback CheckOrgIdExistsOperationCompleted; - + private System.Threading.SendOrPostCallback CreateOrganizationOperationCompleted; - + private System.Threading.SendOrPostCallback GetRawOrganizationsPagedOperationCompleted; - + private System.Threading.SendOrPostCallback GetOrganizationsOperationCompleted; - + private System.Threading.SendOrPostCallback GetOrganizationUserSummuryLetterOperationCompleted; - + private System.Threading.SendOrPostCallback SendOrganizationUserSummuryLetterOperationCompleted; - + private System.Threading.SendOrPostCallback DeleteOrganizationOperationCompleted; - + private System.Threading.SendOrPostCallback GetOrganizationStatisticsOperationCompleted; - + private System.Threading.SendOrPostCallback GetOrganizationStatisticsByOrganizationOperationCompleted; - + private System.Threading.SendOrPostCallback GetOrganizationOperationCompleted; - + private System.Threading.SendOrPostCallback GetAccountIdByUserPrincipalNameOperationCompleted; - + private System.Threading.SendOrPostCallback AddOrganizationDomainOperationCompleted; - + private System.Threading.SendOrPostCallback ChangeOrganizationDomainTypeOperationCompleted; - + private System.Threading.SendOrPostCallback GetOrganizationDomainsOperationCompleted; - + private System.Threading.SendOrPostCallback DeleteOrganizationDomainOperationCompleted; - + private System.Threading.SendOrPostCallback SetOrganizationDefaultDomainOperationCompleted; - + private System.Threading.SendOrPostCallback CreateUserOperationCompleted; - + private System.Threading.SendOrPostCallback ImportUserOperationCompleted; - + private System.Threading.SendOrPostCallback GetOrganizationUsersPagedOperationCompleted; - + private System.Threading.SendOrPostCallback GetUserGeneralSettingsOperationCompleted; - + private System.Threading.SendOrPostCallback SetUserGeneralSettingsOperationCompleted; - + private System.Threading.SendOrPostCallback SetUserPrincipalNameOperationCompleted; - + private System.Threading.SendOrPostCallback SetUserPasswordOperationCompleted; - + private System.Threading.SendOrPostCallback SearchAccountsOperationCompleted; - + private System.Threading.SendOrPostCallback DeleteUserOperationCompleted; - + private System.Threading.SendOrPostCallback GetPasswordPolicyOperationCompleted; - + + private System.Threading.SendOrPostCallback CreateSecurityGroupOperationCompleted; + + private System.Threading.SendOrPostCallback GetSecurityGroupGeneralSettingsOperationCompleted; + + private System.Threading.SendOrPostCallback DeleteSecurityGroupOperationCompleted; + + private System.Threading.SendOrPostCallback SetSecurityGroupGeneralSettingsOperationCompleted; + + private System.Threading.SendOrPostCallback GetOrganizationSecurityGroupsPagedOperationCompleted; + + private System.Threading.SendOrPostCallback AddUserToSecurityGroupOperationCompleted; + + private System.Threading.SendOrPostCallback DeleteUserFromSecurityGroupOperationCompleted; + + private System.Threading.SendOrPostCallback GetSecurityGroupsByMemberOperationCompleted; + + private System.Threading.SendOrPostCallback SearchOrganizationAccountsOperationCompleted; + /// - public esOrganizations() { + public esOrganizations() + { this.Url = "http://localhost:9002/esOrganizations.asmx"; } /// public event CheckOrgIdExistsCompletedEventHandler CheckOrgIdExistsCompleted; - + /// public event CreateOrganizationCompletedEventHandler CreateOrganizationCompleted; - + /// public event GetRawOrganizationsPagedCompletedEventHandler GetRawOrganizationsPagedCompleted; - + /// public event GetOrganizationsCompletedEventHandler GetOrganizationsCompleted; - + /// public event GetOrganizationUserSummuryLetterCompletedEventHandler GetOrganizationUserSummuryLetterCompleted; - + /// public event SendOrganizationUserSummuryLetterCompletedEventHandler SendOrganizationUserSummuryLetterCompleted; - + /// public event DeleteOrganizationCompletedEventHandler DeleteOrganizationCompleted; - + /// public event GetOrganizationStatisticsCompletedEventHandler GetOrganizationStatisticsCompleted; - + /// public event GetOrganizationStatisticsByOrganizationCompletedEventHandler GetOrganizationStatisticsByOrganizationCompleted; - + /// public event GetOrganizationCompletedEventHandler GetOrganizationCompleted; - + /// public event GetAccountIdByUserPrincipalNameCompletedEventHandler GetAccountIdByUserPrincipalNameCompleted; - + /// public event AddOrganizationDomainCompletedEventHandler AddOrganizationDomainCompleted; - + /// public event ChangeOrganizationDomainTypeCompletedEventHandler ChangeOrganizationDomainTypeCompleted; - + /// public event GetOrganizationDomainsCompletedEventHandler GetOrganizationDomainsCompleted; - + /// public event DeleteOrganizationDomainCompletedEventHandler DeleteOrganizationDomainCompleted; - + /// public event SetOrganizationDefaultDomainCompletedEventHandler SetOrganizationDefaultDomainCompleted; - + /// public event CreateUserCompletedEventHandler CreateUserCompleted; - + /// public event ImportUserCompletedEventHandler ImportUserCompleted; - + /// public event GetOrganizationUsersPagedCompletedEventHandler GetOrganizationUsersPagedCompleted; - + /// public event GetUserGeneralSettingsCompletedEventHandler GetUserGeneralSettingsCompleted; - + /// public event SetUserGeneralSettingsCompletedEventHandler SetUserGeneralSettingsCompleted; - + /// public event SetUserPrincipalNameCompletedEventHandler SetUserPrincipalNameCompleted; - + /// public event SetUserPasswordCompletedEventHandler SetUserPasswordCompleted; - + /// public event SearchAccountsCompletedEventHandler SearchAccountsCompleted; - + /// public event DeleteUserCompletedEventHandler DeleteUserCompleted; - + /// public event GetPasswordPolicyCompletedEventHandler GetPasswordPolicyCompleted; + /// + public event CreateSecurityGroupCompletedEventHandler CreateSecurityGroupCompleted; + + /// + public event GetSecurityGroupGeneralSettingsCompletedEventHandler GetSecurityGroupGeneralSettingsCompleted; + + /// + public event DeleteSecurityGroupCompletedEventHandler DeleteSecurityGroupCompleted; + + /// + public event SetSecurityGroupGeneralSettingsCompletedEventHandler SetSecurityGroupGeneralSettingsCompleted; + + /// + public event GetOrganizationSecurityGroupsPagedCompletedEventHandler GetOrganizationSecurityGroupsPagedCompleted; + + /// + public event AddUserToSecurityGroupCompletedEventHandler AddUserToSecurityGroupCompleted; + + /// + public event DeleteUserFromSecurityGroupCompletedEventHandler DeleteUserFromSecurityGroupCompleted; + + /// + public event GetSecurityGroupsByMemberCompletedEventHandler GetSecurityGroupsByMemberCompleted; + + /// + public event SearchOrganizationAccountsCompletedEventHandler SearchOrganizationAccountsCompleted; + /// [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) @@ -246,10 +294,11 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { this.CheckOrgIdExistsCompleted(this, new CheckOrgIdExistsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [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 int CreateOrganization(int packageId, string organizationID, string organizationName, string domainName) { + [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 int CreateOrganization(int packageId, string organizationID, string organizationName, string domainName) + { object[] results = this.Invoke("CreateOrganization", new object[] { packageId, organizationID, @@ -257,32 +306,37 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { domainName}); return ((int)(results[0])); } - + /// - public System.IAsyncResult BeginCreateOrganization(int packageId, string organizationID, string organizationName, string domainName, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginCreateOrganization(int packageId, string organizationID, string organizationName, string domainName, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("CreateOrganization", new object[] { packageId, organizationID, organizationName, domainName}, callback, asyncState); } - + /// - public int EndCreateOrganization(System.IAsyncResult asyncResult) { + public int EndCreateOrganization(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((int)(results[0])); } - + /// - public void CreateOrganizationAsync(int packageId, string organizationID, string organizationName, string domainName) { + public void CreateOrganizationAsync(int packageId, string organizationID, string organizationName, string domainName) + { this.CreateOrganizationAsync(packageId, organizationID, organizationName, domainName, null); } - + /// - public void CreateOrganizationAsync(int packageId, string organizationID, string organizationName, string domainName, object userState) { - if ((this.CreateOrganizationOperationCompleted == null)) { + public void CreateOrganizationAsync(int packageId, string organizationID, string organizationName, string domainName, object userState) + { + if ((this.CreateOrganizationOperationCompleted == null)) + { this.CreateOrganizationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateOrganizationOperationCompleted); } this.InvokeAsync("CreateOrganization", new object[] { @@ -291,17 +345,20 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { organizationName, domainName}, 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.SoapDocumentMethodAttribute("http://tempuri.org/GetRawOrganizationsPaged", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public System.Data.DataSet GetRawOrganizationsPaged(int packageId, bool recursive, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetRawOrganizationsPaged", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public System.Data.DataSet GetRawOrganizationsPaged(int packageId, bool recursive, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { object[] results = this.Invoke("GetRawOrganizationsPaged", new object[] { packageId, recursive, @@ -312,9 +369,10 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { maximumRows}); return ((System.Data.DataSet)(results[0])); } - + /// - public System.IAsyncResult BeginGetRawOrganizationsPaged(int packageId, bool recursive, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginGetRawOrganizationsPaged(int packageId, bool recursive, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("GetRawOrganizationsPaged", new object[] { packageId, recursive, @@ -324,21 +382,25 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { startRow, maximumRows}, callback, asyncState); } - + /// - public System.Data.DataSet EndGetRawOrganizationsPaged(System.IAsyncResult asyncResult) { + public System.Data.DataSet EndGetRawOrganizationsPaged(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((System.Data.DataSet)(results[0])); } - + /// - public void GetRawOrganizationsPagedAsync(int packageId, bool recursive, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) { + public void GetRawOrganizationsPagedAsync(int packageId, bool recursive, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { this.GetRawOrganizationsPagedAsync(packageId, recursive, filterColumn, filterValue, sortColumn, startRow, maximumRows, null); } - + /// - public void GetRawOrganizationsPagedAsync(int packageId, bool recursive, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, object userState) { - if ((this.GetRawOrganizationsPagedOperationCompleted == null)) { + public void GetRawOrganizationsPagedAsync(int packageId, bool recursive, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, object userState) + { + if ((this.GetRawOrganizationsPagedOperationCompleted == null)) + { this.GetRawOrganizationsPagedOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRawOrganizationsPagedOperationCompleted); } this.InvokeAsync("GetRawOrganizationsPaged", new object[] { @@ -350,61 +412,72 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { startRow, maximumRows}, this.GetRawOrganizationsPagedOperationCompleted, userState); } - - private void OnGetRawOrganizationsPagedOperationCompleted(object arg) { - if ((this.GetRawOrganizationsPagedCompleted != null)) { + + private void OnGetRawOrganizationsPagedOperationCompleted(object arg) + { + if ((this.GetRawOrganizationsPagedCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetRawOrganizationsPagedCompleted(this, new GetRawOrganizationsPagedCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganizations", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public Organization[] GetOrganizations(int packageId, bool recursive) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganizations", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public Organization[] GetOrganizations(int packageId, bool recursive) + { object[] results = this.Invoke("GetOrganizations", new object[] { packageId, recursive}); return ((Organization[])(results[0])); } - + /// - public System.IAsyncResult BeginGetOrganizations(int packageId, bool recursive, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginGetOrganizations(int packageId, bool recursive, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("GetOrganizations", new object[] { packageId, recursive}, callback, asyncState); } - + /// - public Organization[] EndGetOrganizations(System.IAsyncResult asyncResult) { + public Organization[] EndGetOrganizations(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((Organization[])(results[0])); } - + /// - public void GetOrganizationsAsync(int packageId, bool recursive) { + public void GetOrganizationsAsync(int packageId, bool recursive) + { this.GetOrganizationsAsync(packageId, recursive, null); } - + /// - public void GetOrganizationsAsync(int packageId, bool recursive, object userState) { - if ((this.GetOrganizationsOperationCompleted == null)) { + public void GetOrganizationsAsync(int packageId, bool recursive, object userState) + { + if ((this.GetOrganizationsOperationCompleted == null)) + { this.GetOrganizationsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetOrganizationsOperationCompleted); } this.InvokeAsync("GetOrganizations", new object[] { packageId, recursive}, this.GetOrganizationsOperationCompleted, userState); } - - private void OnGetOrganizationsOperationCompleted(object arg) { - if ((this.GetOrganizationsCompleted != null)) { + + private void OnGetOrganizationsOperationCompleted(object arg) + { + if ((this.GetOrganizationsCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetOrganizationsCompleted(this, new GetOrganizationsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganizationUserSummuryLetter", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public string GetOrganizationUserSummuryLetter(int itemId, int accountId, bool pmm, bool emailMode, bool signup) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganizationUserSummuryLetter", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string GetOrganizationUserSummuryLetter(int itemId, int accountId, bool pmm, bool emailMode, bool signup) + { object[] results = this.Invoke("GetOrganizationUserSummuryLetter", new object[] { itemId, accountId, @@ -413,9 +486,10 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { signup}); return ((string)(results[0])); } - + /// - public System.IAsyncResult BeginGetOrganizationUserSummuryLetter(int itemId, int accountId, bool pmm, bool emailMode, bool signup, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginGetOrganizationUserSummuryLetter(int itemId, int accountId, bool pmm, bool emailMode, bool signup, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("GetOrganizationUserSummuryLetter", new object[] { itemId, accountId, @@ -423,21 +497,25 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { emailMode, signup}, callback, asyncState); } - + /// - public string EndGetOrganizationUserSummuryLetter(System.IAsyncResult asyncResult) { + public string EndGetOrganizationUserSummuryLetter(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((string)(results[0])); } - + /// - public void GetOrganizationUserSummuryLetterAsync(int itemId, int accountId, bool pmm, bool emailMode, bool signup) { + public void GetOrganizationUserSummuryLetterAsync(int itemId, int accountId, bool pmm, bool emailMode, bool signup) + { this.GetOrganizationUserSummuryLetterAsync(itemId, accountId, pmm, emailMode, signup, null); } - + /// - public void GetOrganizationUserSummuryLetterAsync(int itemId, int accountId, bool pmm, bool emailMode, bool signup, object userState) { - if ((this.GetOrganizationUserSummuryLetterOperationCompleted == null)) { + public void GetOrganizationUserSummuryLetterAsync(int itemId, int accountId, bool pmm, bool emailMode, bool signup, object userState) + { + if ((this.GetOrganizationUserSummuryLetterOperationCompleted == null)) + { this.GetOrganizationUserSummuryLetterOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetOrganizationUserSummuryLetterOperationCompleted); } this.InvokeAsync("GetOrganizationUserSummuryLetter", new object[] { @@ -447,17 +525,20 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { emailMode, signup}, this.GetOrganizationUserSummuryLetterOperationCompleted, userState); } - - private void OnGetOrganizationUserSummuryLetterOperationCompleted(object arg) { - if ((this.GetOrganizationUserSummuryLetterCompleted != null)) { + + private void OnGetOrganizationUserSummuryLetterOperationCompleted(object arg) + { + if ((this.GetOrganizationUserSummuryLetterCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetOrganizationUserSummuryLetterCompleted(this, new GetOrganizationUserSummuryLetterCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SendOrganizationUserSummuryLetter", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public int SendOrganizationUserSummuryLetter(int itemId, int accountId, bool signup, string to, string cc) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SendOrganizationUserSummuryLetter", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int SendOrganizationUserSummuryLetter(int itemId, int accountId, bool signup, string to, string cc) + { object[] results = this.Invoke("SendOrganizationUserSummuryLetter", new object[] { itemId, accountId, @@ -466,9 +547,10 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { cc}); return ((int)(results[0])); } - + /// - public System.IAsyncResult BeginSendOrganizationUserSummuryLetter(int itemId, int accountId, bool signup, string to, string cc, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginSendOrganizationUserSummuryLetter(int itemId, int accountId, bool signup, string to, string cc, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("SendOrganizationUserSummuryLetter", new object[] { itemId, accountId, @@ -476,21 +558,25 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { to, cc}, callback, asyncState); } - + /// - public int EndSendOrganizationUserSummuryLetter(System.IAsyncResult asyncResult) { + public int EndSendOrganizationUserSummuryLetter(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((int)(results[0])); } - + /// - public void SendOrganizationUserSummuryLetterAsync(int itemId, int accountId, bool signup, string to, string cc) { + public void SendOrganizationUserSummuryLetterAsync(int itemId, int accountId, bool signup, string to, string cc) + { this.SendOrganizationUserSummuryLetterAsync(itemId, accountId, signup, to, cc, null); } - + /// - public void SendOrganizationUserSummuryLetterAsync(int itemId, int accountId, bool signup, string to, string cc, object userState) { - if ((this.SendOrganizationUserSummuryLetterOperationCompleted == null)) { + public void SendOrganizationUserSummuryLetterAsync(int itemId, int accountId, bool signup, string to, string cc, object userState) + { + if ((this.SendOrganizationUserSummuryLetterOperationCompleted == null)) + { this.SendOrganizationUserSummuryLetterOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSendOrganizationUserSummuryLetterOperationCompleted); } this.InvokeAsync("SendOrganizationUserSummuryLetter", new object[] { @@ -500,298 +586,354 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { to, cc}, this.SendOrganizationUserSummuryLetterOperationCompleted, userState); } - - private void OnSendOrganizationUserSummuryLetterOperationCompleted(object arg) { - if ((this.SendOrganizationUserSummuryLetterCompleted != null)) { + + private void OnSendOrganizationUserSummuryLetterOperationCompleted(object arg) + { + if ((this.SendOrganizationUserSummuryLetterCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.SendOrganizationUserSummuryLetterCompleted(this, new SendOrganizationUserSummuryLetterCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [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 int DeleteOrganization(int itemId) { + [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 int DeleteOrganization(int itemId) + { object[] results = this.Invoke("DeleteOrganization", new object[] { itemId}); return ((int)(results[0])); } - + /// - public System.IAsyncResult BeginDeleteOrganization(int itemId, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginDeleteOrganization(int itemId, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("DeleteOrganization", new object[] { itemId}, callback, asyncState); } - + /// - public int EndDeleteOrganization(System.IAsyncResult asyncResult) { + public int EndDeleteOrganization(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((int)(results[0])); } - + /// - public void DeleteOrganizationAsync(int itemId) { + public void DeleteOrganizationAsync(int itemId) + { this.DeleteOrganizationAsync(itemId, null); } - + /// - public void DeleteOrganizationAsync(int itemId, object userState) { - if ((this.DeleteOrganizationOperationCompleted == null)) { + public void DeleteOrganizationAsync(int itemId, object userState) + { + if ((this.DeleteOrganizationOperationCompleted == null)) + { this.DeleteOrganizationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteOrganizationOperationCompleted); } this.InvokeAsync("DeleteOrganization", new object[] { itemId}, 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 DeleteOrganizationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganizationStatistics", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public OrganizationStatistics GetOrganizationStatistics(int itemId) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganizationStatistics", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public OrganizationStatistics GetOrganizationStatistics(int itemId) + { object[] results = this.Invoke("GetOrganizationStatistics", new object[] { itemId}); return ((OrganizationStatistics)(results[0])); } - + /// - public System.IAsyncResult BeginGetOrganizationStatistics(int itemId, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginGetOrganizationStatistics(int itemId, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("GetOrganizationStatistics", new object[] { itemId}, callback, asyncState); } - + /// - public OrganizationStatistics EndGetOrganizationStatistics(System.IAsyncResult asyncResult) { + public OrganizationStatistics EndGetOrganizationStatistics(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((OrganizationStatistics)(results[0])); } - + /// - public void GetOrganizationStatisticsAsync(int itemId) { + public void GetOrganizationStatisticsAsync(int itemId) + { this.GetOrganizationStatisticsAsync(itemId, null); } - + /// - public void GetOrganizationStatisticsAsync(int itemId, object userState) { - if ((this.GetOrganizationStatisticsOperationCompleted == null)) { + public void GetOrganizationStatisticsAsync(int itemId, object userState) + { + if ((this.GetOrganizationStatisticsOperationCompleted == null)) + { this.GetOrganizationStatisticsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetOrganizationStatisticsOperationCompleted); } this.InvokeAsync("GetOrganizationStatistics", new object[] { itemId}, this.GetOrganizationStatisticsOperationCompleted, userState); } - - private void OnGetOrganizationStatisticsOperationCompleted(object arg) { - if ((this.GetOrganizationStatisticsCompleted != null)) { + + private void OnGetOrganizationStatisticsOperationCompleted(object arg) + { + if ((this.GetOrganizationStatisticsCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetOrganizationStatisticsCompleted(this, new GetOrganizationStatisticsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganizationStatisticsByOrganization", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public OrganizationStatistics GetOrganizationStatisticsByOrganization(int itemId) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganizationStatisticsByOrganization", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public OrganizationStatistics GetOrganizationStatisticsByOrganization(int itemId) + { object[] results = this.Invoke("GetOrganizationStatisticsByOrganization", new object[] { itemId}); return ((OrganizationStatistics)(results[0])); } - + /// - public System.IAsyncResult BeginGetOrganizationStatisticsByOrganization(int itemId, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginGetOrganizationStatisticsByOrganization(int itemId, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("GetOrganizationStatisticsByOrganization", new object[] { itemId}, callback, asyncState); } - + /// - public OrganizationStatistics EndGetOrganizationStatisticsByOrganization(System.IAsyncResult asyncResult) { + public OrganizationStatistics EndGetOrganizationStatisticsByOrganization(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((OrganizationStatistics)(results[0])); } - + /// - public void GetOrganizationStatisticsByOrganizationAsync(int itemId) { + public void GetOrganizationStatisticsByOrganizationAsync(int itemId) + { this.GetOrganizationStatisticsByOrganizationAsync(itemId, null); } - + /// - public void GetOrganizationStatisticsByOrganizationAsync(int itemId, object userState) { - if ((this.GetOrganizationStatisticsByOrganizationOperationCompleted == null)) { + public void GetOrganizationStatisticsByOrganizationAsync(int itemId, object userState) + { + if ((this.GetOrganizationStatisticsByOrganizationOperationCompleted == null)) + { this.GetOrganizationStatisticsByOrganizationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetOrganizationStatisticsByOrganizationOperationCompleted); } this.InvokeAsync("GetOrganizationStatisticsByOrganization", new object[] { itemId}, this.GetOrganizationStatisticsByOrganizationOperationCompleted, userState); } - - private void OnGetOrganizationStatisticsByOrganizationOperationCompleted(object arg) { - if ((this.GetOrganizationStatisticsByOrganizationCompleted != null)) { + + private void OnGetOrganizationStatisticsByOrganizationOperationCompleted(object arg) + { + if ((this.GetOrganizationStatisticsByOrganizationCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetOrganizationStatisticsByOrganizationCompleted(this, new GetOrganizationStatisticsByOrganizationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganization", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public Organization GetOrganization(int itemId) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganization", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public Organization GetOrganization(int itemId) + { object[] results = this.Invoke("GetOrganization", new object[] { itemId}); return ((Organization)(results[0])); } - + /// - public System.IAsyncResult BeginGetOrganization(int itemId, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginGetOrganization(int itemId, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("GetOrganization", new object[] { itemId}, callback, asyncState); } - + /// - public Organization EndGetOrganization(System.IAsyncResult asyncResult) { + public Organization EndGetOrganization(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((Organization)(results[0])); } - + /// - public void GetOrganizationAsync(int itemId) { + public void GetOrganizationAsync(int itemId) + { this.GetOrganizationAsync(itemId, null); } - + /// - public void GetOrganizationAsync(int itemId, object userState) { - if ((this.GetOrganizationOperationCompleted == null)) { + public void GetOrganizationAsync(int itemId, object userState) + { + if ((this.GetOrganizationOperationCompleted == null)) + { this.GetOrganizationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetOrganizationOperationCompleted); } this.InvokeAsync("GetOrganization", new object[] { itemId}, this.GetOrganizationOperationCompleted, userState); } - - private void OnGetOrganizationOperationCompleted(object arg) { - if ((this.GetOrganizationCompleted != null)) { + + private void OnGetOrganizationOperationCompleted(object arg) + { + if ((this.GetOrganizationCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetOrganizationCompleted(this, new GetOrganizationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetAccountIdByUserPrincipalName", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public int GetAccountIdByUserPrincipalName(int itemId, string userPrincipalName) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetAccountIdByUserPrincipalName", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int GetAccountIdByUserPrincipalName(int itemId, string userPrincipalName) + { object[] results = this.Invoke("GetAccountIdByUserPrincipalName", new object[] { itemId, userPrincipalName}); return ((int)(results[0])); } - + /// - public System.IAsyncResult BeginGetAccountIdByUserPrincipalName(int itemId, string userPrincipalName, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginGetAccountIdByUserPrincipalName(int itemId, string userPrincipalName, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("GetAccountIdByUserPrincipalName", new object[] { itemId, userPrincipalName}, callback, asyncState); } - + /// - public int EndGetAccountIdByUserPrincipalName(System.IAsyncResult asyncResult) { + public int EndGetAccountIdByUserPrincipalName(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((int)(results[0])); } - + /// - public void GetAccountIdByUserPrincipalNameAsync(int itemId, string userPrincipalName) { + public void GetAccountIdByUserPrincipalNameAsync(int itemId, string userPrincipalName) + { this.GetAccountIdByUserPrincipalNameAsync(itemId, userPrincipalName, null); } - + /// - public void GetAccountIdByUserPrincipalNameAsync(int itemId, string userPrincipalName, object userState) { - if ((this.GetAccountIdByUserPrincipalNameOperationCompleted == null)) { + public void GetAccountIdByUserPrincipalNameAsync(int itemId, string userPrincipalName, object userState) + { + if ((this.GetAccountIdByUserPrincipalNameOperationCompleted == null)) + { this.GetAccountIdByUserPrincipalNameOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetAccountIdByUserPrincipalNameOperationCompleted); } this.InvokeAsync("GetAccountIdByUserPrincipalName", new object[] { itemId, userPrincipalName}, this.GetAccountIdByUserPrincipalNameOperationCompleted, userState); } - - private void OnGetAccountIdByUserPrincipalNameOperationCompleted(object arg) { - if ((this.GetAccountIdByUserPrincipalNameCompleted != null)) { + + private void OnGetAccountIdByUserPrincipalNameOperationCompleted(object arg) + { + if ((this.GetAccountIdByUserPrincipalNameCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetAccountIdByUserPrincipalNameCompleted(this, new GetAccountIdByUserPrincipalNameCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/AddOrganizationDomain", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public int AddOrganizationDomain(int itemId, string domainName) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/AddOrganizationDomain", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int AddOrganizationDomain(int itemId, string domainName) + { object[] results = this.Invoke("AddOrganizationDomain", new object[] { itemId, domainName}); return ((int)(results[0])); } - + /// - public System.IAsyncResult BeginAddOrganizationDomain(int itemId, string domainName, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginAddOrganizationDomain(int itemId, string domainName, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("AddOrganizationDomain", new object[] { itemId, domainName}, callback, asyncState); } - + /// - public int EndAddOrganizationDomain(System.IAsyncResult asyncResult) { + public int EndAddOrganizationDomain(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((int)(results[0])); } - + /// - public void AddOrganizationDomainAsync(int itemId, string domainName) { + public void AddOrganizationDomainAsync(int itemId, string domainName) + { this.AddOrganizationDomainAsync(itemId, domainName, null); } - + /// - public void AddOrganizationDomainAsync(int itemId, string domainName, object userState) { - if ((this.AddOrganizationDomainOperationCompleted == null)) { + public void AddOrganizationDomainAsync(int itemId, string domainName, object userState) + { + if ((this.AddOrganizationDomainOperationCompleted == null)) + { this.AddOrganizationDomainOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddOrganizationDomainOperationCompleted); } this.InvokeAsync("AddOrganizationDomain", new object[] { itemId, domainName}, this.AddOrganizationDomainOperationCompleted, userState); } - - private void OnAddOrganizationDomainOperationCompleted(object arg) { - if ((this.AddOrganizationDomainCompleted != null)) { + + private void OnAddOrganizationDomainOperationCompleted(object arg) + { + if ((this.AddOrganizationDomainCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.AddOrganizationDomainCompleted(this, new AddOrganizationDomainCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/ChangeOrganizationDomainType", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public int ChangeOrganizationDomainType(int itemId, int domainId, ExchangeAcceptedDomainType newDomainType) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/ChangeOrganizationDomainType", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int ChangeOrganizationDomainType(int itemId, int domainId, ExchangeAcceptedDomainType newDomainType) + { object[] results = this.Invoke("ChangeOrganizationDomainType", new object[] { itemId, domainId, newDomainType}); return ((int)(results[0])); } - + /// - public System.IAsyncResult BeginChangeOrganizationDomainType(int itemId, int domainId, ExchangeAcceptedDomainType newDomainType, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginChangeOrganizationDomainType(int itemId, int domainId, ExchangeAcceptedDomainType newDomainType, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("ChangeOrganizationDomainType", new object[] { itemId, domainId, newDomainType}, callback, asyncState); } - + /// - public int EndChangeOrganizationDomainType(System.IAsyncResult asyncResult) { + public int EndChangeOrganizationDomainType(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((int)(results[0])); } - + /// - public void ChangeOrganizationDomainTypeAsync(int itemId, int domainId, ExchangeAcceptedDomainType newDomainType) { + public void ChangeOrganizationDomainTypeAsync(int itemId, int domainId, ExchangeAcceptedDomainType newDomainType) + { this.ChangeOrganizationDomainTypeAsync(itemId, domainId, newDomainType, null); } - + /// - public void ChangeOrganizationDomainTypeAsync(int itemId, int domainId, ExchangeAcceptedDomainType newDomainType, object userState) { - if ((this.ChangeOrganizationDomainTypeOperationCompleted == null)) { + public void ChangeOrganizationDomainTypeAsync(int itemId, int domainId, ExchangeAcceptedDomainType newDomainType, object userState) + { + if ((this.ChangeOrganizationDomainTypeOperationCompleted == null)) + { this.ChangeOrganizationDomainTypeOperationCompleted = new System.Threading.SendOrPostCallback(this.OnChangeOrganizationDomainTypeOperationCompleted); } this.InvokeAsync("ChangeOrganizationDomainType", new object[] { @@ -799,146 +941,173 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { domainId, newDomainType}, this.ChangeOrganizationDomainTypeOperationCompleted, userState); } - - private void OnChangeOrganizationDomainTypeOperationCompleted(object arg) { - if ((this.ChangeOrganizationDomainTypeCompleted != null)) { + + private void OnChangeOrganizationDomainTypeOperationCompleted(object arg) + { + if ((this.ChangeOrganizationDomainTypeCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.ChangeOrganizationDomainTypeCompleted(this, new ChangeOrganizationDomainTypeCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganizationDomains", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public OrganizationDomainName[] GetOrganizationDomains(int itemId) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganizationDomains", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public OrganizationDomainName[] GetOrganizationDomains(int itemId) + { object[] results = this.Invoke("GetOrganizationDomains", new object[] { itemId}); return ((OrganizationDomainName[])(results[0])); } - + /// - public System.IAsyncResult BeginGetOrganizationDomains(int itemId, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginGetOrganizationDomains(int itemId, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("GetOrganizationDomains", new object[] { itemId}, callback, asyncState); } - + /// - public OrganizationDomainName[] EndGetOrganizationDomains(System.IAsyncResult asyncResult) { + public OrganizationDomainName[] EndGetOrganizationDomains(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((OrganizationDomainName[])(results[0])); } - + /// - public void GetOrganizationDomainsAsync(int itemId) { + public void GetOrganizationDomainsAsync(int itemId) + { this.GetOrganizationDomainsAsync(itemId, null); } - + /// - public void GetOrganizationDomainsAsync(int itemId, object userState) { - if ((this.GetOrganizationDomainsOperationCompleted == null)) { + public void GetOrganizationDomainsAsync(int itemId, object userState) + { + if ((this.GetOrganizationDomainsOperationCompleted == null)) + { this.GetOrganizationDomainsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetOrganizationDomainsOperationCompleted); } this.InvokeAsync("GetOrganizationDomains", new object[] { itemId}, this.GetOrganizationDomainsOperationCompleted, userState); } - - private void OnGetOrganizationDomainsOperationCompleted(object arg) { - if ((this.GetOrganizationDomainsCompleted != null)) { + + private void OnGetOrganizationDomainsOperationCompleted(object arg) + { + if ((this.GetOrganizationDomainsCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetOrganizationDomainsCompleted(this, new GetOrganizationDomainsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [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 int DeleteOrganizationDomain(int itemId, int domainId) { + [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 int DeleteOrganizationDomain(int itemId, int domainId) + { object[] results = this.Invoke("DeleteOrganizationDomain", new object[] { itemId, domainId}); return ((int)(results[0])); } - + /// - public System.IAsyncResult BeginDeleteOrganizationDomain(int itemId, int domainId, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginDeleteOrganizationDomain(int itemId, int domainId, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("DeleteOrganizationDomain", new object[] { itemId, domainId}, callback, asyncState); } - + /// - public int EndDeleteOrganizationDomain(System.IAsyncResult asyncResult) { + public int EndDeleteOrganizationDomain(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((int)(results[0])); } - + /// - public void DeleteOrganizationDomainAsync(int itemId, int domainId) { + public void DeleteOrganizationDomainAsync(int itemId, int domainId) + { this.DeleteOrganizationDomainAsync(itemId, domainId, null); } - + /// - public void DeleteOrganizationDomainAsync(int itemId, int domainId, object userState) { - if ((this.DeleteOrganizationDomainOperationCompleted == null)) { + public void DeleteOrganizationDomainAsync(int itemId, int domainId, object userState) + { + if ((this.DeleteOrganizationDomainOperationCompleted == null)) + { this.DeleteOrganizationDomainOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteOrganizationDomainOperationCompleted); } this.InvokeAsync("DeleteOrganizationDomain", new object[] { itemId, domainId}, 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 DeleteOrganizationDomainCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SetOrganizationDefaultDomain", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public int SetOrganizationDefaultDomain(int itemId, int domainId) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SetOrganizationDefaultDomain", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int SetOrganizationDefaultDomain(int itemId, int domainId) + { object[] results = this.Invoke("SetOrganizationDefaultDomain", new object[] { itemId, domainId}); return ((int)(results[0])); } - + /// - public System.IAsyncResult BeginSetOrganizationDefaultDomain(int itemId, int domainId, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginSetOrganizationDefaultDomain(int itemId, int domainId, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("SetOrganizationDefaultDomain", new object[] { itemId, domainId}, callback, asyncState); } - + /// - public int EndSetOrganizationDefaultDomain(System.IAsyncResult asyncResult) { + public int EndSetOrganizationDefaultDomain(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((int)(results[0])); } - + /// - public void SetOrganizationDefaultDomainAsync(int itemId, int domainId) { + public void SetOrganizationDefaultDomainAsync(int itemId, int domainId) + { this.SetOrganizationDefaultDomainAsync(itemId, domainId, null); } - + /// - public void SetOrganizationDefaultDomainAsync(int itemId, int domainId, object userState) { - if ((this.SetOrganizationDefaultDomainOperationCompleted == null)) { + public void SetOrganizationDefaultDomainAsync(int itemId, int domainId, object userState) + { + if ((this.SetOrganizationDefaultDomainOperationCompleted == null)) + { this.SetOrganizationDefaultDomainOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetOrganizationDefaultDomainOperationCompleted); } this.InvokeAsync("SetOrganizationDefaultDomain", new object[] { itemId, domainId}, this.SetOrganizationDefaultDomainOperationCompleted, userState); } - - private void OnSetOrganizationDefaultDomainOperationCompleted(object arg) { - if ((this.SetOrganizationDefaultDomainCompleted != null)) { + + private void OnSetOrganizationDefaultDomainOperationCompleted(object arg) + { + if ((this.SetOrganizationDefaultDomainCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.SetOrganizationDefaultDomainCompleted(this, new SetOrganizationDefaultDomainCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [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(int itemId, string displayName, string name, string domain, string password, string subscriberNumber, bool sendNotification, string to) { + [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(int itemId, string displayName, string name, string domain, string password, string subscriberNumber, bool sendNotification, string to) + { object[] results = this.Invoke("CreateUser", new object[] { itemId, displayName, @@ -950,9 +1119,10 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { to}); return ((int)(results[0])); } - + /// - public System.IAsyncResult BeginCreateUser(int itemId, string displayName, string name, string domain, string password, string subscriberNumber, bool sendNotification, string to, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginCreateUser(int itemId, string displayName, string name, string domain, string password, string subscriberNumber, bool sendNotification, string to, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("CreateUser", new object[] { itemId, displayName, @@ -963,21 +1133,25 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { sendNotification, to}, 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(int itemId, string displayName, string name, string domain, string password, string subscriberNumber, bool sendNotification, string to) { + public void CreateUserAsync(int itemId, string displayName, string name, string domain, string password, string subscriberNumber, bool sendNotification, string to) + { this.CreateUserAsync(itemId, displayName, name, domain, password, subscriberNumber, sendNotification, to, null); } - + /// - public void CreateUserAsync(int itemId, string displayName, string name, string domain, string password, string subscriberNumber, bool sendNotification, string to, object userState) { - if ((this.CreateUserOperationCompleted == null)) { + public void CreateUserAsync(int itemId, string displayName, string name, string domain, string password, string subscriberNumber, bool sendNotification, string to, object userState) + { + if ((this.CreateUserOperationCompleted == null)) + { this.CreateUserOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateUserOperationCompleted); } this.InvokeAsync("CreateUser", new object[] { @@ -990,17 +1164,20 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { sendNotification, to}, 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.SoapDocumentMethodAttribute("http://tempuri.org/ImportUser", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public int ImportUser(int itemId, string accountName, string displayName, string name, string domain, string password, string subscriberNumber) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/ImportUser", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int ImportUser(int itemId, string accountName, string displayName, string name, string domain, string password, string subscriberNumber) + { object[] results = this.Invoke("ImportUser", new object[] { itemId, accountName, @@ -1011,9 +1188,10 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { subscriberNumber}); return ((int)(results[0])); } - + /// - public System.IAsyncResult BeginImportUser(int itemId, string accountName, string displayName, string name, string domain, string password, string subscriberNumber, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginImportUser(int itemId, string accountName, string displayName, string name, string domain, string password, string subscriberNumber, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("ImportUser", new object[] { itemId, accountName, @@ -1023,21 +1201,25 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { password, subscriberNumber}, callback, asyncState); } - + /// - public int EndImportUser(System.IAsyncResult asyncResult) { + public int EndImportUser(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((int)(results[0])); } - + /// - public void ImportUserAsync(int itemId, string accountName, string displayName, string name, string domain, string password, string subscriberNumber) { + public void ImportUserAsync(int itemId, string accountName, string displayName, string name, string domain, string password, string subscriberNumber) + { this.ImportUserAsync(itemId, accountName, displayName, name, domain, password, subscriberNumber, null); } - + /// - public void ImportUserAsync(int itemId, string accountName, string displayName, string name, string domain, string password, string subscriberNumber, object userState) { - if ((this.ImportUserOperationCompleted == null)) { + public void ImportUserAsync(int itemId, string accountName, string displayName, string name, string domain, string password, string subscriberNumber, object userState) + { + if ((this.ImportUserOperationCompleted == null)) + { this.ImportUserOperationCompleted = new System.Threading.SendOrPostCallback(this.OnImportUserOperationCompleted); } this.InvokeAsync("ImportUser", new object[] { @@ -1049,17 +1231,20 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { password, subscriberNumber}, this.ImportUserOperationCompleted, userState); } - - private void OnImportUserOperationCompleted(object arg) { - if ((this.ImportUserCompleted != null)) { + + private void OnImportUserOperationCompleted(object arg) + { + if ((this.ImportUserCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.ImportUserCompleted(this, new ImportUserCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganizationUsersPaged", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public OrganizationUsersPaged GetOrganizationUsersPaged(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganizationUsersPaged", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public OrganizationUsersPaged GetOrganizationUsersPaged(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { object[] results = this.Invoke("GetOrganizationUsersPaged", new object[] { itemId, filterColumn, @@ -1069,9 +1254,10 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { maximumRows}); return ((OrganizationUsersPaged)(results[0])); } - + /// - public System.IAsyncResult BeginGetOrganizationUsersPaged(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginGetOrganizationUsersPaged(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("GetOrganizationUsersPaged", new object[] { itemId, filterColumn, @@ -1080,21 +1266,25 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { startRow, maximumRows}, callback, asyncState); } - + /// - public OrganizationUsersPaged EndGetOrganizationUsersPaged(System.IAsyncResult asyncResult) { + public OrganizationUsersPaged EndGetOrganizationUsersPaged(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((OrganizationUsersPaged)(results[0])); } - + /// - public void GetOrganizationUsersPagedAsync(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) { + public void GetOrganizationUsersPagedAsync(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { this.GetOrganizationUsersPagedAsync(itemId, filterColumn, filterValue, sortColumn, startRow, maximumRows, null); } - + /// - public void GetOrganizationUsersPagedAsync(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, object userState) { - if ((this.GetOrganizationUsersPagedOperationCompleted == null)) { + public void GetOrganizationUsersPagedAsync(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, object userState) + { + if ((this.GetOrganizationUsersPagedOperationCompleted == null)) + { this.GetOrganizationUsersPagedOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetOrganizationUsersPagedOperationCompleted); } this.InvokeAsync("GetOrganizationUsersPaged", new object[] { @@ -1105,90 +1295,101 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { startRow, maximumRows}, this.GetOrganizationUsersPagedOperationCompleted, userState); } - - private void OnGetOrganizationUsersPagedOperationCompleted(object arg) { - if ((this.GetOrganizationUsersPagedCompleted != null)) { + + private void OnGetOrganizationUsersPagedOperationCompleted(object arg) + { + if ((this.GetOrganizationUsersPagedCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetOrganizationUsersPagedCompleted(this, new GetOrganizationUsersPagedCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [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(int itemId, int accountId) { + [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(int itemId, int accountId) + { object[] results = this.Invoke("GetUserGeneralSettings", new object[] { itemId, accountId}); return ((OrganizationUser)(results[0])); } - + /// - public System.IAsyncResult BeginGetUserGeneralSettings(int itemId, int accountId, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginGetUserGeneralSettings(int itemId, int accountId, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("GetUserGeneralSettings", new object[] { itemId, accountId}, 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(int itemId, int accountId) { + public void GetUserGeneralSettingsAsync(int itemId, int accountId) + { this.GetUserGeneralSettingsAsync(itemId, accountId, null); } - + /// - public void GetUserGeneralSettingsAsync(int itemId, int accountId, object userState) { - if ((this.GetUserGeneralSettingsOperationCompleted == null)) { + public void GetUserGeneralSettingsAsync(int itemId, int accountId, object userState) + { + if ((this.GetUserGeneralSettingsOperationCompleted == null)) + { this.GetUserGeneralSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetUserGeneralSettingsOperationCompleted); } this.InvokeAsync("GetUserGeneralSettings", new object[] { itemId, accountId}, 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.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 int SetUserGeneralSettings( - int itemId, - int accountId, - string displayName, - string password, - bool hideAddressBook, - 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 subscriberNumber) { + int itemId, + int accountId, + string displayName, + string password, + bool hideAddressBook, + 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 subscriberNumber) + { object[] results = this.Invoke("SetUserGeneralSettings", new object[] { itemId, accountId, @@ -1221,40 +1422,41 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { subscriberNumber}); return ((int)(results[0])); } - + /// public System.IAsyncResult BeginSetUserGeneralSettings( - int itemId, - int accountId, - string displayName, - string password, - bool hideAddressBook, - 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 subscriberNumber, - System.AsyncCallback callback, - object asyncState) { + int itemId, + int accountId, + string displayName, + string password, + bool hideAddressBook, + 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 subscriberNumber, + System.AsyncCallback callback, + object asyncState) + { return this.BeginInvoke("SetUserGeneralSettings", new object[] { itemId, accountId, @@ -1286,80 +1488,84 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { externalEmail, subscriberNumber}, callback, asyncState); } - + /// - public int EndSetUserGeneralSettings(System.IAsyncResult asyncResult) { + public int EndSetUserGeneralSettings(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((int)(results[0])); } - + /// public void SetUserGeneralSettingsAsync( - int itemId, - int accountId, - string displayName, - string password, - bool hideAddressBook, - 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 subscriberNumber) { + int itemId, + int accountId, + string displayName, + string password, + bool hideAddressBook, + 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 subscriberNumber) + { this.SetUserGeneralSettingsAsync(itemId, accountId, displayName, password, hideAddressBook, disabled, locked, firstName, initials, lastName, address, city, state, zip, country, jobTitle, company, department, office, managerAccountName, businessPhone, fax, homePhone, mobilePhone, pager, webPage, notes, externalEmail, subscriberNumber, null); } - + /// public void SetUserGeneralSettingsAsync( - int itemId, - int accountId, - string displayName, - string password, - bool hideAddressBook, - 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 subscriberNumber, - object userState) { - if ((this.SetUserGeneralSettingsOperationCompleted == null)) { + int itemId, + int accountId, + string displayName, + string password, + bool hideAddressBook, + 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 subscriberNumber, + object userState) + { + if ((this.SetUserGeneralSettingsOperationCompleted == null)) + { this.SetUserGeneralSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetUserGeneralSettingsOperationCompleted); } this.InvokeAsync("SetUserGeneralSettings", new object[] { @@ -1393,17 +1599,20 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { externalEmail, subscriberNumber}, 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 SetUserGeneralSettingsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [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 int SetUserPrincipalName(int itemId, int accountId, string userPrincipalName, bool inherit) { + [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 int SetUserPrincipalName(int itemId, int accountId, string userPrincipalName, bool inherit) + { object[] results = this.Invoke("SetUserPrincipalName", new object[] { itemId, accountId, @@ -1411,30 +1620,35 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { inherit}); return ((int)(results[0])); } - + /// - public System.IAsyncResult BeginSetUserPrincipalName(int itemId, int accountId, string userPrincipalName, bool inherit, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginSetUserPrincipalName(int itemId, int accountId, string userPrincipalName, bool inherit, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("SetUserPrincipalName", new object[] { itemId, accountId, userPrincipalName, inherit}, callback, asyncState); } - + /// - public int EndSetUserPrincipalName(System.IAsyncResult asyncResult) { + public int EndSetUserPrincipalName(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((int)(results[0])); } - + /// - public void SetUserPrincipalNameAsync(int itemId, int accountId, string userPrincipalName, bool inherit) { + public void SetUserPrincipalNameAsync(int itemId, int accountId, string userPrincipalName, bool inherit) + { this.SetUserPrincipalNameAsync(itemId, accountId, userPrincipalName, inherit, null); } - + /// - public void SetUserPrincipalNameAsync(int itemId, int accountId, string userPrincipalName, bool inherit, object userState) { - if ((this.SetUserPrincipalNameOperationCompleted == null)) { + public void SetUserPrincipalNameAsync(int itemId, int accountId, string userPrincipalName, bool inherit, object userState) + { + if ((this.SetUserPrincipalNameOperationCompleted == null)) + { this.SetUserPrincipalNameOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetUserPrincipalNameOperationCompleted); } this.InvokeAsync("SetUserPrincipalName", new object[] { @@ -1443,46 +1657,54 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { userPrincipalName, inherit}, 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 SetUserPrincipalNameCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [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 int SetUserPassword(int itemId, int accountId, 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 int SetUserPassword(int itemId, int accountId, string password) + { object[] results = this.Invoke("SetUserPassword", new object[] { itemId, accountId, password}); return ((int)(results[0])); } - + /// - public System.IAsyncResult BeginSetUserPassword(int itemId, int accountId, string password, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginSetUserPassword(int itemId, int accountId, string password, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("SetUserPassword", new object[] { itemId, accountId, password}, callback, asyncState); } - + /// - public int EndSetUserPassword(System.IAsyncResult asyncResult) { + public int EndSetUserPassword(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((int)(results[0])); } - + /// - public void SetUserPasswordAsync(int itemId, int accountId, string password) { + public void SetUserPasswordAsync(int itemId, int accountId, string password) + { this.SetUserPasswordAsync(itemId, accountId, password, null); } - + /// - public void SetUserPasswordAsync(int itemId, int accountId, string password, object userState) { - if ((this.SetUserPasswordOperationCompleted == null)) { + public void SetUserPasswordAsync(int itemId, int accountId, string password, object userState) + { + if ((this.SetUserPasswordOperationCompleted == null)) + { this.SetUserPasswordOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetUserPasswordOperationCompleted); } this.InvokeAsync("SetUserPassword", new object[] { @@ -1490,17 +1712,20 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { accountId, 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 SetUserPasswordCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SearchAccounts", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public OrganizationUser[] SearchAccounts(int itemId, string filterColumn, string filterValue, string sortColumn, bool includeMailboxes) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SearchAccounts", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public OrganizationUser[] SearchAccounts(int itemId, string filterColumn, string filterValue, string sortColumn, bool includeMailboxes) + { object[] results = this.Invoke("SearchAccounts", new object[] { itemId, filterColumn, @@ -1509,9 +1734,10 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { includeMailboxes}); return ((OrganizationUser[])(results[0])); } - + /// - public System.IAsyncResult BeginSearchAccounts(int itemId, string filterColumn, string filterValue, string sortColumn, bool includeMailboxes, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginSearchAccounts(int itemId, string filterColumn, string filterValue, string sortColumn, bool includeMailboxes, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("SearchAccounts", new object[] { itemId, filterColumn, @@ -1519,21 +1745,25 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { sortColumn, includeMailboxes}, callback, asyncState); } - + /// - public OrganizationUser[] EndSearchAccounts(System.IAsyncResult asyncResult) { + public OrganizationUser[] EndSearchAccounts(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((OrganizationUser[])(results[0])); } - + /// - public void SearchAccountsAsync(int itemId, string filterColumn, string filterValue, string sortColumn, bool includeMailboxes) { + public void SearchAccountsAsync(int itemId, string filterColumn, string filterValue, string sortColumn, bool includeMailboxes) + { this.SearchAccountsAsync(itemId, filterColumn, filterValue, sortColumn, includeMailboxes, null); } - + /// - public void SearchAccountsAsync(int itemId, string filterColumn, string filterValue, string sortColumn, bool includeMailboxes, object userState) { - if ((this.SearchAccountsOperationCompleted == null)) { + public void SearchAccountsAsync(int itemId, string filterColumn, string filterValue, string sortColumn, bool includeMailboxes, object userState) + { + if ((this.SearchAccountsOperationCompleted == null)) + { this.SearchAccountsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSearchAccountsOperationCompleted); } this.InvokeAsync("SearchAccounts", new object[] { @@ -1543,101 +1773,624 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { sortColumn, includeMailboxes}, this.SearchAccountsOperationCompleted, userState); } - - private void OnSearchAccountsOperationCompleted(object arg) { - if ((this.SearchAccountsCompleted != null)) { + + private void OnSearchAccountsOperationCompleted(object arg) + { + if ((this.SearchAccountsCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.SearchAccountsCompleted(this, new SearchAccountsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [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 int DeleteUser(int itemId, int accountId) { + [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 int DeleteUser(int itemId, int accountId) + { object[] results = this.Invoke("DeleteUser", new object[] { itemId, accountId}); return ((int)(results[0])); } - + /// - public System.IAsyncResult BeginDeleteUser(int itemId, int accountId, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginDeleteUser(int itemId, int accountId, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("DeleteUser", new object[] { itemId, accountId}, callback, asyncState); } - + /// - public int EndDeleteUser(System.IAsyncResult asyncResult) { + public int EndDeleteUser(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((int)(results[0])); } - + /// - public void DeleteUserAsync(int itemId, int accountId) { + public void DeleteUserAsync(int itemId, int accountId) + { this.DeleteUserAsync(itemId, accountId, null); } - + /// - public void DeleteUserAsync(int itemId, int accountId, object userState) { - if ((this.DeleteUserOperationCompleted == null)) { + public void DeleteUserAsync(int itemId, int accountId, object userState) + { + if ((this.DeleteUserOperationCompleted == null)) + { this.DeleteUserOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteUserOperationCompleted); } this.InvokeAsync("DeleteUser", new object[] { itemId, accountId}, 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 DeleteUserCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [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(int itemId) { + [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(int itemId) + { object[] results = this.Invoke("GetPasswordPolicy", new object[] { itemId}); return ((PasswordPolicyResult)(results[0])); } - + /// - public System.IAsyncResult BeginGetPasswordPolicy(int itemId, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginGetPasswordPolicy(int itemId, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("GetPasswordPolicy", new object[] { itemId}, 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(int itemId) { + public void GetPasswordPolicyAsync(int itemId) + { this.GetPasswordPolicyAsync(itemId, null); } - + /// - public void GetPasswordPolicyAsync(int itemId, object userState) { - if ((this.GetPasswordPolicyOperationCompleted == null)) { + public void GetPasswordPolicyAsync(int itemId, object userState) + { + if ((this.GetPasswordPolicyOperationCompleted == null)) + { this.GetPasswordPolicyOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetPasswordPolicyOperationCompleted); } this.InvokeAsync("GetPasswordPolicy", new object[] { itemId}, 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)); } } - + /// - public new void CancelAsync(object 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) + { + object[] results = this.Invoke("CreateSecurityGroup", new object[] { + itemId, + displayName}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginCreateSecurityGroup(int itemId, string displayName, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("CreateSecurityGroup", new object[] { + itemId, + displayName}, callback, asyncState); + } + + /// + public int EndCreateSecurityGroup(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void CreateSecurityGroupAsync(int itemId, string displayName) + { + this.CreateSecurityGroupAsync(itemId, displayName, null); + } + + /// + public void CreateSecurityGroupAsync(int itemId, string displayName, object userState) + { + if ((this.CreateSecurityGroupOperationCompleted == null)) + { + this.CreateSecurityGroupOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateSecurityGroupOperationCompleted); + } + this.InvokeAsync("CreateSecurityGroup", new object[] { + itemId, + displayName}, this.CreateSecurityGroupOperationCompleted, userState); + } + + 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.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(int itemId, int accountId) + { + object[] results = this.Invoke("GetSecurityGroupGeneralSettings", new object[] { + itemId, + accountId}); + return ((OrganizationSecurityGroup)(results[0])); + } + + /// + public System.IAsyncResult BeginGetSecurityGroupGeneralSettings(int itemId, int accountId, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("GetSecurityGroupGeneralSettings", new object[] { + itemId, + accountId}, callback, asyncState); + } + + /// + public OrganizationSecurityGroup EndGetSecurityGroupGeneralSettings(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((OrganizationSecurityGroup)(results[0])); + } + + /// + public void GetSecurityGroupGeneralSettingsAsync(int itemId, int accountId) + { + this.GetSecurityGroupGeneralSettingsAsync(itemId, accountId, null); + } + + /// + public void GetSecurityGroupGeneralSettingsAsync(int itemId, int accountId, object userState) + { + if ((this.GetSecurityGroupGeneralSettingsOperationCompleted == null)) + { + this.GetSecurityGroupGeneralSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetSecurityGroupGeneralSettingsOperationCompleted); + } + this.InvokeAsync("GetSecurityGroupGeneralSettings", new object[] { + itemId, + accountId}, this.GetSecurityGroupGeneralSettingsOperationCompleted, userState); + } + + 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.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 int DeleteSecurityGroup(int itemId, int accountId) + { + object[] results = this.Invoke("DeleteSecurityGroup", new object[] { + itemId, + accountId}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginDeleteSecurityGroup(int itemId, int accountId, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("DeleteSecurityGroup", new object[] { + itemId, + accountId}, callback, asyncState); + } + + /// + public int EndDeleteSecurityGroup(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void DeleteSecurityGroupAsync(int itemId, int accountId) + { + this.DeleteSecurityGroupAsync(itemId, accountId, null); + } + + /// + public void DeleteSecurityGroupAsync(int itemId, int accountId, object userState) + { + if ((this.DeleteSecurityGroupOperationCompleted == null)) + { + this.DeleteSecurityGroupOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteSecurityGroupOperationCompleted); + } + this.InvokeAsync("DeleteSecurityGroup", new object[] { + itemId, + accountId}, this.DeleteSecurityGroupOperationCompleted, userState); + } + + 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 DeleteSecurityGroupCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [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 int SetSecurityGroupGeneralSettings(int itemId, int accountId, string displayName, string[] memberAccounts, string notes) + { + object[] results = this.Invoke("SetSecurityGroupGeneralSettings", new object[] { + itemId, + accountId, + displayName, + memberAccounts, + notes}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginSetSecurityGroupGeneralSettings(int itemId, int accountId, string displayName, string[] memberAccounts, string notes, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("SetSecurityGroupGeneralSettings", new object[] { + itemId, + accountId, + displayName, + memberAccounts, + notes}, callback, asyncState); + } + + /// + public int EndSetSecurityGroupGeneralSettings(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void SetSecurityGroupGeneralSettingsAsync(int itemId, int accountId, string displayName, string[] memberAccounts, string notes) + { + this.SetSecurityGroupGeneralSettingsAsync(itemId, accountId, displayName, memberAccounts, notes, null); + } + + /// + public void SetSecurityGroupGeneralSettingsAsync(int itemId, int accountId, string displayName, string[] memberAccounts, string notes, object userState) + { + if ((this.SetSecurityGroupGeneralSettingsOperationCompleted == null)) + { + this.SetSecurityGroupGeneralSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetSecurityGroupGeneralSettingsOperationCompleted); + } + this.InvokeAsync("SetSecurityGroupGeneralSettings", new object[] { + itemId, + accountId, + displayName, + memberAccounts, + notes}, this.SetSecurityGroupGeneralSettingsOperationCompleted, userState); + } + + 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 SetSecurityGroupGeneralSettingsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganizationSecurityGroupsPaged", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ExchangeAccountsPaged GetOrganizationSecurityGroupsPaged(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { + object[] results = this.Invoke("GetOrganizationSecurityGroupsPaged", new object[] { + itemId, + filterColumn, + filterValue, + sortColumn, + startRow, + maximumRows}); + return ((ExchangeAccountsPaged)(results[0])); + } + + /// + public System.IAsyncResult BeginGetOrganizationSecurityGroupsPaged(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("GetOrganizationSecurityGroupsPaged", new object[] { + itemId, + filterColumn, + filterValue, + sortColumn, + startRow, + maximumRows}, callback, asyncState); + } + + /// + public ExchangeAccountsPaged EndGetOrganizationSecurityGroupsPaged(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((ExchangeAccountsPaged)(results[0])); + } + + /// + public void GetOrganizationSecurityGroupsPagedAsync(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { + this.GetOrganizationSecurityGroupsPagedAsync(itemId, filterColumn, filterValue, sortColumn, startRow, maximumRows, null); + } + + /// + public void GetOrganizationSecurityGroupsPagedAsync(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, object userState) + { + if ((this.GetOrganizationSecurityGroupsPagedOperationCompleted == null)) + { + this.GetOrganizationSecurityGroupsPagedOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetOrganizationSecurityGroupsPagedOperationCompleted); + } + this.InvokeAsync("GetOrganizationSecurityGroupsPaged", new object[] { + itemId, + filterColumn, + filterValue, + sortColumn, + startRow, + maximumRows}, this.GetOrganizationSecurityGroupsPagedOperationCompleted, userState); + } + + private void OnGetOrganizationSecurityGroupsPagedOperationCompleted(object arg) + { + if ((this.GetOrganizationSecurityGroupsPagedCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetOrganizationSecurityGroupsPagedCompleted(this, new GetOrganizationSecurityGroupsPagedCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/AddUserToSecurityGroup", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int AddUserToSecurityGroup(int itemId, int userAccountId, string groupName) + { + object[] results = this.Invoke("AddUserToSecurityGroup", new object[] { + itemId, + userAccountId, + groupName}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginAddUserToSecurityGroup(int itemId, int userAccountId, string groupName, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("AddUserToSecurityGroup", new object[] { + itemId, + userAccountId, + groupName}, callback, asyncState); + } + + /// + public int EndAddUserToSecurityGroup(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void AddUserToSecurityGroupAsync(int itemId, int userAccountId, string groupName) + { + this.AddUserToSecurityGroupAsync(itemId, userAccountId, groupName, null); + } + + /// + public void AddUserToSecurityGroupAsync(int itemId, int userAccountId, string groupName, object userState) + { + if ((this.AddUserToSecurityGroupOperationCompleted == null)) + { + this.AddUserToSecurityGroupOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddUserToSecurityGroupOperationCompleted); + } + this.InvokeAsync("AddUserToSecurityGroup", new object[] { + itemId, + userAccountId, + groupName}, this.AddUserToSecurityGroupOperationCompleted, userState); + } + + private void OnAddUserToSecurityGroupOperationCompleted(object arg) + { + if ((this.AddUserToSecurityGroupCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.AddUserToSecurityGroupCompleted(this, new AddUserToSecurityGroupCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteUserFromSecurityGroup", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int DeleteUserFromSecurityGroup(int itemId, int userAccountId, string groupName) + { + object[] results = this.Invoke("DeleteUserFromSecurityGroup", new object[] { + itemId, + userAccountId, + groupName}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginDeleteUserFromSecurityGroup(int itemId, int userAccountId, string groupName, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("DeleteUserFromSecurityGroup", new object[] { + itemId, + userAccountId, + groupName}, callback, asyncState); + } + + /// + public int EndDeleteUserFromSecurityGroup(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void DeleteUserFromSecurityGroupAsync(int itemId, int userAccountId, string groupName) + { + this.DeleteUserFromSecurityGroupAsync(itemId, userAccountId, groupName, null); + } + + /// + public void DeleteUserFromSecurityGroupAsync(int itemId, int userAccountId, string groupName, object userState) + { + if ((this.DeleteUserFromSecurityGroupOperationCompleted == null)) + { + this.DeleteUserFromSecurityGroupOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteUserFromSecurityGroupOperationCompleted); + } + this.InvokeAsync("DeleteUserFromSecurityGroup", new object[] { + itemId, + userAccountId, + groupName}, this.DeleteUserFromSecurityGroupOperationCompleted, userState); + } + + private void OnDeleteUserFromSecurityGroupOperationCompleted(object arg) + { + if ((this.DeleteUserFromSecurityGroupCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.DeleteUserFromSecurityGroupCompleted(this, new DeleteUserFromSecurityGroupCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetSecurityGroupsByMember", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ExchangeAccount[] GetSecurityGroupsByMember(int itemId, int accountId) + { + object[] results = this.Invoke("GetSecurityGroupsByMember", new object[] { + itemId, + accountId}); + return ((ExchangeAccount[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetSecurityGroupsByMember(int itemId, int accountId, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("GetSecurityGroupsByMember", new object[] { + itemId, + accountId}, callback, asyncState); + } + + /// + public ExchangeAccount[] EndGetSecurityGroupsByMember(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((ExchangeAccount[])(results[0])); + } + + /// + public void GetSecurityGroupsByMemberAsync(int itemId, int accountId) + { + this.GetSecurityGroupsByMemberAsync(itemId, accountId, null); + } + + /// + public void GetSecurityGroupsByMemberAsync(int itemId, int accountId, object userState) + { + if ((this.GetSecurityGroupsByMemberOperationCompleted == null)) + { + this.GetSecurityGroupsByMemberOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetSecurityGroupsByMemberOperationCompleted); + } + this.InvokeAsync("GetSecurityGroupsByMember", new object[] { + itemId, + accountId}, this.GetSecurityGroupsByMemberOperationCompleted, userState); + } + + private void OnGetSecurityGroupsByMemberOperationCompleted(object arg) + { + if ((this.GetSecurityGroupsByMemberCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetSecurityGroupsByMemberCompleted(this, new GetSecurityGroupsByMemberCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SearchOrganizationAccounts", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ExchangeAccount[] SearchOrganizationAccounts(int itemId, string filterColumn, string filterValue, string sortColumn, bool includeOnlySecurityGroups) + { + object[] results = this.Invoke("SearchOrganizationAccounts", new object[] { + itemId, + filterColumn, + filterValue, + sortColumn, + includeOnlySecurityGroups}); + return ((ExchangeAccount[])(results[0])); + } + + /// + public System.IAsyncResult BeginSearchOrganizationAccounts(int itemId, string filterColumn, string filterValue, string sortColumn, bool includeOnlySecurityGroups, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("SearchOrganizationAccounts", new object[] { + itemId, + filterColumn, + filterValue, + sortColumn, + includeOnlySecurityGroups}, callback, asyncState); + } + + /// + public ExchangeAccount[] EndSearchOrganizationAccounts(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((ExchangeAccount[])(results[0])); + } + + /// + public void SearchOrganizationAccountsAsync(int itemId, string filterColumn, string filterValue, string sortColumn, bool includeOnlySecurityGroups) + { + this.SearchOrganizationAccountsAsync(itemId, filterColumn, filterValue, sortColumn, includeOnlySecurityGroups, null); + } + + /// + public void SearchOrganizationAccountsAsync(int itemId, string filterColumn, string filterValue, string sortColumn, bool includeOnlySecurityGroups, object userState) + { + if ((this.SearchOrganizationAccountsOperationCompleted == null)) + { + this.SearchOrganizationAccountsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSearchOrganizationAccountsOperationCompleted); + } + this.InvokeAsync("SearchOrganizationAccounts", new object[] { + itemId, + filterColumn, + filterValue, + sortColumn, + includeOnlySecurityGroups}, this.SearchOrganizationAccountsOperationCompleted, userState); + } + + private void OnSearchOrganizationAccountsOperationCompleted(object arg) + { + if ((this.SearchOrganizationAccountsCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.SearchOrganizationAccountsCompleted(this, new SearchOrganizationAccountsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + public new void CancelAsync(object userState) + { base.CancelAsync(userState); } } @@ -1671,654 +2424,1024 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { } } } - + /// [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 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 GetRawOrganizationsPagedCompletedEventHandler(object sender, GetRawOrganizationsPagedCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetRawOrganizationsPagedCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class GetRawOrganizationsPagedCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal GetRawOrganizationsPagedCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal GetRawOrganizationsPagedCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public System.Data.DataSet Result { - get { + public System.Data.DataSet Result + { + get + { this.RaiseExceptionIfNecessary(); return ((System.Data.DataSet)(this.results[0])); } } } - + /// [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.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetOrganizationsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class GetOrganizationsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal GetOrganizationsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal GetOrganizationsCompletedEventArgs(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 GetOrganizationUserSummuryLetterCompletedEventHandler(object sender, GetOrganizationUserSummuryLetterCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetOrganizationUserSummuryLetterCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class GetOrganizationUserSummuryLetterCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal GetOrganizationUserSummuryLetterCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal GetOrganizationUserSummuryLetterCompletedEventArgs(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 SendOrganizationUserSummuryLetterCompletedEventHandler(object sender, SendOrganizationUserSummuryLetterCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class SendOrganizationUserSummuryLetterCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class SendOrganizationUserSummuryLetterCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal SendOrganizationUserSummuryLetterCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal SendOrganizationUserSummuryLetterCompletedEventArgs(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 DeleteOrganizationCompletedEventHandler(object sender, DeleteOrganizationCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class DeleteOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class DeleteOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal DeleteOrganizationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal DeleteOrganizationCompletedEventArgs(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 GetOrganizationStatisticsCompletedEventHandler(object sender, GetOrganizationStatisticsCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetOrganizationStatisticsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class GetOrganizationStatisticsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal GetOrganizationStatisticsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal GetOrganizationStatisticsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public OrganizationStatistics Result { - get { + public OrganizationStatistics Result + { + get + { this.RaiseExceptionIfNecessary(); return ((OrganizationStatistics)(this.results[0])); } } } - + /// [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.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetOrganizationStatisticsByOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class GetOrganizationStatisticsByOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal GetOrganizationStatisticsByOrganizationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal GetOrganizationStatisticsByOrganizationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public OrganizationStatistics Result { - get { + public OrganizationStatistics Result + { + get + { this.RaiseExceptionIfNecessary(); return ((OrganizationStatistics)(this.results[0])); } } } - + /// [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.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class GetOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal GetOrganizationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal GetOrganizationCompletedEventArgs(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 GetAccountIdByUserPrincipalNameCompletedEventHandler(object sender, GetAccountIdByUserPrincipalNameCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetAccountIdByUserPrincipalNameCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class GetAccountIdByUserPrincipalNameCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal GetAccountIdByUserPrincipalNameCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal GetAccountIdByUserPrincipalNameCompletedEventArgs(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 AddOrganizationDomainCompletedEventHandler(object sender, AddOrganizationDomainCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class AddOrganizationDomainCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class AddOrganizationDomainCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal AddOrganizationDomainCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal AddOrganizationDomainCompletedEventArgs(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 ChangeOrganizationDomainTypeCompletedEventHandler(object sender, ChangeOrganizationDomainTypeCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class ChangeOrganizationDomainTypeCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class ChangeOrganizationDomainTypeCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal ChangeOrganizationDomainTypeCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal ChangeOrganizationDomainTypeCompletedEventArgs(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 GetOrganizationDomainsCompletedEventHandler(object sender, GetOrganizationDomainsCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetOrganizationDomainsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class GetOrganizationDomainsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal GetOrganizationDomainsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal GetOrganizationDomainsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public OrganizationDomainName[] Result { - get { + public OrganizationDomainName[] Result + { + get + { this.RaiseExceptionIfNecessary(); return ((OrganizationDomainName[])(this.results[0])); } } } - + /// [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.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class DeleteOrganizationDomainCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class DeleteOrganizationDomainCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal DeleteOrganizationDomainCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal DeleteOrganizationDomainCompletedEventArgs(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 SetOrganizationDefaultDomainCompletedEventHandler(object sender, SetOrganizationDefaultDomainCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class SetOrganizationDefaultDomainCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class SetOrganizationDefaultDomainCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal SetOrganizationDefaultDomainCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal SetOrganizationDefaultDomainCompletedEventArgs(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 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 ImportUserCompletedEventHandler(object sender, ImportUserCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class ImportUserCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class ImportUserCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal ImportUserCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal ImportUserCompletedEventArgs(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 GetOrganizationUsersPagedCompletedEventHandler(object sender, GetOrganizationUsersPagedCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetOrganizationUsersPagedCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class GetOrganizationUsersPagedCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal GetOrganizationUsersPagedCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal GetOrganizationUsersPagedCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public OrganizationUsersPaged Result { - get { + public OrganizationUsersPaged Result + { + get + { this.RaiseExceptionIfNecessary(); return ((OrganizationUsersPaged)(this.results[0])); } } } - + /// [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, SetUserGeneralSettingsCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class SetUserGeneralSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class SetUserGeneralSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal SetUserGeneralSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal SetUserGeneralSettingsCompletedEventArgs(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 SetUserPrincipalNameCompletedEventHandler(object sender, SetUserPrincipalNameCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class SetUserPrincipalNameCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class SetUserPrincipalNameCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal SetUserPrincipalNameCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal SetUserPrincipalNameCompletedEventArgs(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 SetUserPasswordCompletedEventHandler(object sender, SetUserPasswordCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class SetUserPasswordCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class SetUserPasswordCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal SetUserPasswordCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal SetUserPasswordCompletedEventArgs(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 SearchAccountsCompletedEventHandler(object sender, SearchAccountsCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class SearchAccountsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class SearchAccountsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal SearchAccountsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal SearchAccountsCompletedEventArgs(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 DeleteUserCompletedEventHandler(object sender, DeleteUserCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class DeleteUserCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class DeleteUserCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal DeleteUserCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal DeleteUserCompletedEventArgs(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 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 CreateSecurityGroupCompletedEventHandler(object sender, CreateSecurityGroupCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + 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) + { + this.results = results; + } + + /// + public int Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((int)(this.results[0])); + } + } + } + + /// + [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.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + 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) + { + this.results = results; + } + + /// + public OrganizationSecurityGroup Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((OrganizationSecurityGroup)(this.results[0])); + } + } + } + + /// + [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.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class DeleteSecurityGroupCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal DeleteSecurityGroupCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public int Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((int)(this.results[0])); + } + } + } + + /// + [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.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class SetSecurityGroupGeneralSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal SetSecurityGroupGeneralSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public int Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((int)(this.results[0])); + } + } + } + + /// + [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.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetOrganizationSecurityGroupsPagedCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal GetOrganizationSecurityGroupsPagedCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public ExchangeAccountsPaged Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((ExchangeAccountsPaged)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void AddUserToSecurityGroupCompletedEventHandler(object sender, AddUserToSecurityGroupCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class AddUserToSecurityGroupCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal AddUserToSecurityGroupCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public int Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((int)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void DeleteUserFromSecurityGroupCompletedEventHandler(object sender, DeleteUserFromSecurityGroupCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class DeleteUserFromSecurityGroupCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal DeleteUserFromSecurityGroupCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public int Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((int)(this.results[0])); + } + } + } + + /// + [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.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetSecurityGroupsByMemberCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal GetSecurityGroupsByMemberCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public ExchangeAccount[] Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((ExchangeAccount[])(this.results[0])); + } + } + } + + /// + [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.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class SearchOrganizationAccountsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal SearchOrganizationAccountsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public ExchangeAccount[] Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((ExchangeAccount[])(this.results[0])); + } + } + } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs index 1db00f99..5aab5932 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs @@ -1868,7 +1868,7 @@ namespace WebsitePanel.EnterpriseServer public static IDataReader GetProcessBackgroundTasks(BackgroundTaskStatus status) { return SqlHelper.ExecuteReader(ConnectionString, CommandType.StoredProcedure, - ObjectQualifier + "GetProcessBackgroundTasks", + ObjectQualifier + "GetProcessBackgroundTasks", new SqlParameter("@status", (int)status)); } @@ -1952,7 +1952,7 @@ namespace WebsitePanel.EnterpriseServer new SqlParameter("@finishDate", finishDate == DateTime.MinValue ? DBNull.Value - : (object) finishDate), + : (object)finishDate), new SqlParameter("@indicatorCurrent", indicatorCurrent), new SqlParameter("@indicatorMaximum", indicatorMaximum), new SqlParameter("@maximumExecutionTime", maximumExecutionTime), @@ -2636,6 +2636,38 @@ namespace WebsitePanel.EnterpriseServer ); } + public static IDataReader SearchExchangeAccountsByTypes(int actorId, int itemId, string accountTypes, + string filterColumn, string filterValue, string sortColumn) + { + // check input parameters + string[] types = accountTypes.Split(','); + for (int i = 0; i < types.Length; i++) + { + try + { + int type = Int32.Parse(types[i]); + } + catch + { + throw new ArgumentException("Wrong patameter", "accountTypes"); + } + } + + string searchTypes = String.Join(",", types); + + return SqlHelper.ExecuteReader( + ConnectionString, + CommandType.StoredProcedure, + "SearchExchangeAccountsByTypes", + new SqlParameter("@ActorID", actorId), + new SqlParameter("@ItemID", itemId), + new SqlParameter("@AccountTypes", searchTypes), + new SqlParameter("@FilterColumn", VerifyColumnName(filterColumn)), + new SqlParameter("@FilterValue", VerifyColumnValue(filterValue)), + new SqlParameter("@SortColumn", VerifyColumnName(sortColumn)) + ); + } + public static DataSet GetExchangeAccountsPaged(int actorId, int itemId, string accountTypes, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) { @@ -2672,7 +2704,7 @@ namespace WebsitePanel.EnterpriseServer public static IDataReader SearchExchangeAccounts(int actorId, int itemId, bool includeMailboxes, bool includeContacts, bool includeDistributionLists, bool includeRooms, bool includeEquipment, - string filterColumn, string filterValue, string sortColumn) + bool includeSecurityGroups, string filterColumn, string filterValue, string sortColumn) { return SqlHelper.ExecuteReader( ConnectionString, @@ -2685,6 +2717,7 @@ namespace WebsitePanel.EnterpriseServer new SqlParameter("@IncludeDistributionLists", includeDistributionLists), new SqlParameter("@IncludeRooms", includeRooms), new SqlParameter("@IncludeEquipment", includeEquipment), + new SqlParameter("@IncludeSecurityGroups", includeSecurityGroups), new SqlParameter("@FilterColumn", VerifyColumnName(filterColumn)), new SqlParameter("@FilterValue", VerifyColumnValue(filterValue)), new SqlParameter("@SortColumn", VerifyColumnName(sortColumn)) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs index c15f832c..47d067fb 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs @@ -44,70 +44,70 @@ using WebsitePanel.Providers.ResultObjects; namespace WebsitePanel.EnterpriseServer { - public class ExchangeServerController - { - #region Organizations - public static DataSet GetRawExchangeOrganizationsPaged(int packageId, bool recursive, - string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) - { - #region Demo Mode - if (IsDemoMode) - { - DataSet ds = new DataSet(); + public class ExchangeServerController + { + #region Organizations + public static DataSet GetRawExchangeOrganizationsPaged(int packageId, bool recursive, + string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { + #region Demo Mode + if (IsDemoMode) + { + DataSet ds = new DataSet(); - // total records - DataTable dtTotal = ds.Tables.Add(); - dtTotal.Columns.Add("Records", typeof(int)); - dtTotal.Rows.Add(3); + // total records + DataTable dtTotal = ds.Tables.Add(); + dtTotal.Columns.Add("Records", typeof(int)); + dtTotal.Rows.Add(3); - // organizations - DataTable dtItems = ds.Tables.Add(); - dtItems.Columns.Add("ItemID", typeof(int)); - dtItems.Columns.Add("OrganizationID", typeof(string)); - dtItems.Columns.Add("ItemName", typeof(string)); - dtItems.Columns.Add("PackageName", typeof(string)); - dtItems.Columns.Add("PackageID", typeof(int)); - dtItems.Columns.Add("Username", typeof(string)); - dtItems.Columns.Add("UserID", typeof(int)); - dtItems.Rows.Add(1, "fabrikam", "Fabrikam Inc", "Hosted Exchange", 1, "Customer", 1); - dtItems.Rows.Add(1, "contoso", "Contoso", "Hosted Exchange", 1, "Customer", 1); - dtItems.Rows.Add(1, "gencons", "General Consultants", "Hosted Exchange", 1, "Customer", 1); + // organizations + DataTable dtItems = ds.Tables.Add(); + dtItems.Columns.Add("ItemID", typeof(int)); + dtItems.Columns.Add("OrganizationID", typeof(string)); + dtItems.Columns.Add("ItemName", typeof(string)); + dtItems.Columns.Add("PackageName", typeof(string)); + dtItems.Columns.Add("PackageID", typeof(int)); + dtItems.Columns.Add("Username", typeof(string)); + dtItems.Columns.Add("UserID", typeof(int)); + dtItems.Rows.Add(1, "fabrikam", "Fabrikam Inc", "Hosted Exchange", 1, "Customer", 1); + dtItems.Rows.Add(1, "contoso", "Contoso", "Hosted Exchange", 1, "Customer", 1); + dtItems.Rows.Add(1, "gencons", "General Consultants", "Hosted Exchange", 1, "Customer", 1); - return ds; - } - #endregion + return ds; + } + #endregion - return PackageController.GetRawPackageItemsPaged( - packageId, ResourceGroups.Exchange, typeof(Organization), - recursive, filterColumn, filterValue, sortColumn, startRow, maximumRows); - } + return PackageController.GetRawPackageItemsPaged( + packageId, ResourceGroups.Exchange, typeof(Organization), + recursive, filterColumn, filterValue, sortColumn, startRow, maximumRows); + } - public static OrganizationsPaged GetExchangeOrganizationsPaged(int packageId, bool recursive, - string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) - { - ServiceItemsPaged items = PackageController.GetPackageItemsPaged( - packageId, ResourceGroups.Exchange, typeof(Organization), - recursive, filterColumn, filterValue, sortColumn, startRow, maximumRows); + public static OrganizationsPaged GetExchangeOrganizationsPaged(int packageId, bool recursive, + string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { + ServiceItemsPaged items = PackageController.GetPackageItemsPaged( + packageId, ResourceGroups.Exchange, typeof(Organization), + recursive, filterColumn, filterValue, sortColumn, startRow, maximumRows); - OrganizationsPaged orgs = new OrganizationsPaged(); - orgs.RecordsCount = items.RecordsCount; - orgs.PageItems = new Organization[items.PageItems.Length]; + OrganizationsPaged orgs = new OrganizationsPaged(); + orgs.RecordsCount = items.RecordsCount; + orgs.PageItems = new Organization[items.PageItems.Length]; - for (int i = 0; i < orgs.PageItems.Length; i++) - orgs.PageItems[i] = (Organization)items.PageItems[i]; + for (int i = 0; i < orgs.PageItems.Length; i++) + orgs.PageItems[i] = (Organization)items.PageItems[i]; - return orgs; - } + return orgs; + } - public static List GetExchangeOrganizations(int packageId, bool recursive) - { - List items = PackageController.GetPackageItemsByType( - packageId, typeof(Organization), recursive); + public static List GetExchangeOrganizations(int packageId, bool recursive) + { + List items = PackageController.GetPackageItemsByType( + packageId, typeof(Organization), recursive); - return items.ConvertAll( - new Converter( - delegate(ServiceProviderItem item) { return (Organization)item; })); - } + return items.ConvertAll( + new Converter( + delegate(ServiceProviderItem item) { return (Organization)item; })); + } public static List GetExchangeOrganizationsInternal(int packageId, bool recursive) { @@ -118,29 +118,29 @@ namespace WebsitePanel.EnterpriseServer delegate(ServiceProviderItem item) { return (Organization)item; })); } - public static Organization GetOrganization(int itemId) - { - #region Demo Mode - if (IsDemoMode) - { - // load package by user - Organization org = new Organization(); - org.PackageId = 0; - org.Id = 1; - org.OrganizationId = "fabrikam"; - org.Name = "Fabrikam Inc"; - org.KeepDeletedItemsDays = 14; - return org; - } - #endregion + public static Organization GetOrganization(int itemId) + { + #region Demo Mode + if (IsDemoMode) + { + // load package by user + Organization org = new Organization(); + org.PackageId = 0; + org.Id = 1; + org.OrganizationId = "fabrikam"; + org.Name = "Fabrikam Inc"; + org.KeepDeletedItemsDays = 14; + return org; + } + #endregion - return (Organization)PackageController.GetPackageItem(itemId); - } + return (Organization)PackageController.GetPackageItem(itemId); + } - public static OrganizationStatistics GetOrganizationStatistics(int itemId) - { + public static OrganizationStatistics GetOrganizationStatistics(int itemId) + { return GetOrganizationStatisticsInternal(itemId, false); - } + } public static OrganizationStatistics GetOrganizationStatisticsByOrganization(int itemId) { @@ -252,58 +252,58 @@ namespace WebsitePanel.EnterpriseServer - public static int CalculateOrganizationDiskspace(int itemId) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo); - if (accountCheck < 0) return accountCheck; + public static int CalculateOrganizationDiskspace(int itemId) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo); + if (accountCheck < 0) return accountCheck; - // place log record - TaskManager.StartTask("EXCHANGE", "CALCULATE_DISKSPACE", itemId); + // place log record + TaskManager.StartTask("EXCHANGE", "CALCULATE_DISKSPACE", itemId); - try - { - // create thread parameters - ThreadStartParameters prms = new ThreadStartParameters(); - prms.UserId = SecurityContext.User.UserId; - prms.Parameters = new object[] { itemId }; + try + { + // create thread parameters + ThreadStartParameters prms = new ThreadStartParameters(); + prms.UserId = SecurityContext.User.UserId; + prms.Parameters = new object[] { itemId }; - Thread t = new Thread(CalculateOrganizationDiskspaceAsync); - t.Start(prms); - return 0; + Thread t = new Thread(CalculateOrganizationDiskspaceAsync); + t.Start(prms); + return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } - private static void CalculateOrganizationDiskspaceAsync(object objPrms) - { - ThreadStartParameters prms = (ThreadStartParameters)objPrms; + private static void CalculateOrganizationDiskspaceAsync(object objPrms) + { + ThreadStartParameters prms = (ThreadStartParameters)objPrms; - // impersonate thread - SecurityContext.SetThreadPrincipal(prms.UserId); + // impersonate thread + SecurityContext.SetThreadPrincipal(prms.UserId); - int itemId = (int)prms.Parameters[0]; - - // calculate disk space - CalculateOrganizationDiskspaceInternal(itemId); - } + int itemId = (int)prms.Parameters[0]; - internal static void CalculateOrganizationDiskspaceInternal(int itemId) - { - try - { - // calculate disk space - Organization org = (Organization)PackageController.GetPackageItem(itemId); - if (org == null) - return; + // calculate disk space + CalculateOrganizationDiskspaceInternal(itemId); + } + + internal static void CalculateOrganizationDiskspaceInternal(int itemId) + { + try + { + // calculate disk space + Organization org = (Organization)PackageController.GetPackageItem(itemId); + if (org == null) + return; SoapServiceProviderItem soapOrg = SoapServiceProviderItem.Wrap(org); @@ -326,50 +326,50 @@ namespace WebsitePanel.EnterpriseServer UpdateOrganization(org); } } - } - catch (Exception ex) - { - // write to audit log - TaskManager.WriteError(ex); - } - } + } + catch (Exception ex) + { + // write to audit log + TaskManager.WriteError(ex); + } + } + + private static bool OrganizationIdentifierExists(string organizationId) + { + return DataProvider.ExchangeOrganizationExists(organizationId); + } + + - private static bool OrganizationIdentifierExists(string organizationId) - { - return DataProvider.ExchangeOrganizationExists(organizationId); - } - - - private static int ExtendToExchangeOrganization(ref Organization org) - { + { // place log record TaskManager.StartTask("EXCHANGE", "CREATE_ORG", org.Name, new BackgroundTaskParameter("Organization ID", org.OrganizationId)); try - { + { // provision organization in Exchange int serviceId = GetExchangeServiceID(org.PackageId); int[] hubTransportServiceIds; int[] clientAccessServiceIds; - + GetExchangeServices(serviceId, out hubTransportServiceIds, out clientAccessServiceIds); - - ExchangeServer mailboxRole = GetExchangeServer(serviceId, org.ServiceId); - - - bool authDomainCreated = false; - int itemId = 0; + + ExchangeServer mailboxRole = GetExchangeServer(serviceId, org.ServiceId); + + + bool authDomainCreated = false; + int itemId = 0; bool organizationExtended = false; List domains = null; try { PackageContext cntx = PackageController.GetPackageContext(org.PackageId); - + // 1) Create Organization (Mailbox) // ================================ Organization exchangeOrganization = mailboxRole.ExtendToExchangeOrganization(org.OrganizationId, @@ -408,17 +408,17 @@ namespace WebsitePanel.EnterpriseServer { clientAccessRole = GetExchangeServer(id, org.ServiceId); } - catch(Exception ex) + catch (Exception ex) { TaskManager.WriteError(ex); continue; } oabVirtualDirs.Add(clientAccessRole.GetOABVirtualDirectory()); } - + Organization orgOAB = mailboxRole.CreateOrganizationOfflineAddressBook(org.OrganizationId, org.SecurityGroup, string.Join(",", oabVirtualDirs.ToArray())); org.OfflineAddressBook = orgOAB.OfflineAddressBook; - + // 3) Add organization domains (Hub Transport) domains = OrganizationController.GetOrganizationDomains(org.Id); @@ -430,12 +430,12 @@ namespace WebsitePanel.EnterpriseServer { hubTransportRole = GetExchangeServer(id, org.ServiceId); } - catch(Exception ex) + catch (Exception ex) { TaskManager.WriteError(ex); - continue; + continue; } - + string[] existingDomains = hubTransportRole.GetAuthoritativeDomains(); if (existingDomains != null) Array.Sort(existingDomains); @@ -483,41 +483,41 @@ namespace WebsitePanel.EnterpriseServer org.AddressBookPolicy = OrgTmp.AddressBookPolicy; - StringDictionary settings = ServerController.GetServiceSettings(serviceId); - org.KeepDeletedItemsDays = Utils.ParseInt(settings["KeepDeletedItemsDays"], 14); - + StringDictionary settings = ServerController.GetServiceSettings(serviceId); + org.KeepDeletedItemsDays = Utils.ParseInt(settings["KeepDeletedItemsDays"], 14); + } catch (Exception ex) { - + // rollback organization creation if (organizationExtended) mailboxRole.DeleteOrganization(org.OrganizationId, org.DistinguishedName, org.GlobalAddressList, org.AddressList, org.RoomsAddressList, org.OfflineAddressBook, org.SecurityGroup, org.AddressBookPolicy); - // rollback domain - if (authDomainCreated) - foreach (int id in hubTransportServiceIds) + // rollback domain + if (authDomainCreated) + foreach (int id in hubTransportServiceIds) + { + ExchangeServer hubTransportRole = null; + try { - ExchangeServer hubTransportRole = null; - try - { - hubTransportRole = GetExchangeServer(id, org.ServiceId); - } - catch (Exception exe) - { - TaskManager.WriteError(exe); - continue; - } - - foreach (OrganizationDomainName domain in domains) - { - hubTransportRole.DeleteAuthoritativeDomain(domain.DomainName); - - } - - break; + hubTransportRole = GetExchangeServer(id, org.ServiceId); } + catch (Exception exe) + { + TaskManager.WriteError(exe); + continue; + } + + foreach (OrganizationDomainName domain in domains) + { + hubTransportRole.DeleteAuthoritativeDomain(domain.DomainName); + + } + + break; + } throw TaskManager.WriteError(ex); } @@ -534,53 +534,53 @@ namespace WebsitePanel.EnterpriseServer } } - private static int[] ParseMultiSetting(int mailboxServiceId, string settingName) - { + private static int[] ParseMultiSetting(int mailboxServiceId, string settingName) + { List retIds = new List(); StringDictionary settings = ServerController.GetServiceSettings(mailboxServiceId); if (!String.IsNullOrEmpty(settings[settingName])) { string[] ids = settings[settingName].Split(','); - + int res; foreach (string id in ids) { if (int.TryParse(id, out res)) retIds.Add(res); - } + } } if (retIds.Count == 0) retIds.Add(mailboxServiceId); - + return retIds.ToArray(); - - } - + + } + private static void GetExchangeServices(int mailboxServiceId, - out int[] hubTransportServiceIds, out int[] clientAccessServiceIds) - { + out int[] hubTransportServiceIds, out int[] clientAccessServiceIds) + { hubTransportServiceIds = ParseMultiSetting(mailboxServiceId, "HubTransportServiceID"); - clientAccessServiceIds = ParseMultiSetting(mailboxServiceId, "ClientAccessServiceID"); - } + clientAccessServiceIds = ParseMultiSetting(mailboxServiceId, "ClientAccessServiceID"); + } - public static int DeleteOrganization(int itemId) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; + public static int DeleteOrganization(int itemId) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; - // place log record - TaskManager.StartTask("EXCHANGE", "DELETE_ORG", itemId); + // place log record + TaskManager.StartTask("EXCHANGE", "DELETE_ORG", itemId); - try - { - // delete organization in Exchange - //System.Threading.Thread.Sleep(5000); - Organization org = (Organization)PackageController.GetPackageItem(itemId); + try + { + // delete organization in Exchange + //System.Threading.Thread.Sleep(5000); + Organization org = (Organization)PackageController.GetPackageItem(itemId); - int exchangeServiceId = GetExchangeServiceID(org.PackageId); + int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); bool successful = exchange.DeleteOrganization( @@ -592,156 +592,156 @@ namespace WebsitePanel.EnterpriseServer org.OfflineAddressBook, org.SecurityGroup, org.AddressBookPolicy); - - - return successful ? 0 : BusinessErrorCodes.ERROR_EXCHANGE_DELETE_SOME_PROBLEMS; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } - public static Organization GetOrganizationStorageLimits(int itemId) - { - // place log record - TaskManager.StartTask("EXCHANGE", "GET_ORG_LIMITS", itemId); - try - { - return GetOrganization(itemId); - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + return successful ? 0 : BusinessErrorCodes.ERROR_EXCHANGE_DELETE_SOME_PROBLEMS; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } - public static int SetOrganizationStorageLimits(int itemId, int issueWarningKB, int prohibitSendKB, - int prohibitSendReceiveKB, int keepDeletedItemsDays, bool applyToMailboxes) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; + public static Organization GetOrganizationStorageLimits(int itemId) + { + // place log record + TaskManager.StartTask("EXCHANGE", "GET_ORG_LIMITS", itemId); - // place log record + try + { + return GetOrganization(itemId); + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + public static int SetOrganizationStorageLimits(int itemId, int issueWarningKB, int prohibitSendKB, + int prohibitSendReceiveKB, int keepDeletedItemsDays, bool applyToMailboxes) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; + + // place log record TaskManager.StartTask("EXCHANGE", "SET_ORG_LIMITS", itemId); - try - { - Organization org = (Organization)PackageController.GetPackageItem(itemId); - if (org == null) - return 0; + try + { + Organization org = (Organization)PackageController.GetPackageItem(itemId); + if (org == null) + return 0; - // load package context - PackageContext cntx = PackageController.GetPackageContext(org.PackageId); + // load package context + PackageContext cntx = PackageController.GetPackageContext(org.PackageId); - int maxDiskSpace = 0; - if (cntx.Quotas.ContainsKey(Quotas.EXCHANGE2007_DISKSPACE) - && cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue > 0) - maxDiskSpace = cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue * 1024; + int maxDiskSpace = 0; + if (cntx.Quotas.ContainsKey(Quotas.EXCHANGE2007_DISKSPACE) + && cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue > 0) + maxDiskSpace = cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue * 1024; if (maxDiskSpace > 0 && (issueWarningKB > maxDiskSpace || prohibitSendKB > maxDiskSpace || prohibitSendReceiveKB > maxDiskSpace || issueWarningKB == -1 || prohibitSendKB == -1 || prohibitSendReceiveKB == -1)) return BusinessErrorCodes.ERROR_EXCHANGE_STORAGE_QUOTAS_EXCEED_HOST_VALUES; - // set limits - org.KeepDeletedItemsDays = keepDeletedItemsDays; + // set limits + org.KeepDeletedItemsDays = keepDeletedItemsDays; - // save organization - UpdateOrganization(org); + // save organization + UpdateOrganization(org); - if (applyToMailboxes) - { + if (applyToMailboxes) + { int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - exchange.SetOrganizationStorageLimits(org.DistinguishedName, - issueWarningKB, - prohibitSendKB, - prohibitSendReceiveKB, - keepDeletedItemsDays); - } + exchange.SetOrganizationStorageLimits(org.DistinguishedName, + issueWarningKB, + prohibitSendKB, + prohibitSendReceiveKB, + keepDeletedItemsDays); + } - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } - public static ExchangeItemStatistics[] GetMailboxesStatistics(int itemId) - { - #region Demo Mode - if (IsDemoMode) - { - List items = new List(); - ExchangeItemStatistics item1 = new ExchangeItemStatistics(); - item1.ItemName = "John Smith"; - item1.TotalItems = 105; - item1.TotalSizeMB = 14; - item1.LastLogon = DateTime.Now; - item1.LastLogoff = DateTime.Now; - items.Add(item1); + public static ExchangeItemStatistics[] GetMailboxesStatistics(int itemId) + { + #region Demo Mode + if (IsDemoMode) + { + List items = new List(); + ExchangeItemStatistics item1 = new ExchangeItemStatistics(); + item1.ItemName = "John Smith"; + item1.TotalItems = 105; + item1.TotalSizeMB = 14; + item1.LastLogon = DateTime.Now; + item1.LastLogoff = DateTime.Now; + items.Add(item1); - ExchangeItemStatistics item2 = new ExchangeItemStatistics(); - item2.ItemName = "Jack Brown"; - item2.TotalItems = 5; - item2.TotalSizeMB = 2; - item2.LastLogon = DateTime.Now; - item2.LastLogoff = DateTime.Now; - items.Add(item2); + ExchangeItemStatistics item2 = new ExchangeItemStatistics(); + item2.ItemName = "Jack Brown"; + item2.TotalItems = 5; + item2.TotalSizeMB = 2; + item2.LastLogon = DateTime.Now; + item2.LastLogoff = DateTime.Now; + items.Add(item2); - ExchangeItemStatistics item3 = new ExchangeItemStatistics(); - item3.ItemName = "Marry Smith"; - item3.TotalItems = 1302; - item3.TotalSizeMB = 45; - item3.LastLogon = DateTime.Now; - item3.LastLogoff = DateTime.Now; - items.Add(item3); + ExchangeItemStatistics item3 = new ExchangeItemStatistics(); + item3.ItemName = "Marry Smith"; + item3.TotalItems = 1302; + item3.TotalSizeMB = 45; + item3.LastLogon = DateTime.Now; + item3.LastLogoff = DateTime.Now; + items.Add(item3); - return items.ToArray(); - } - #endregion + return items.ToArray(); + } + #endregion - // place log record + // place log record TaskManager.StartTask("EXCHANGE", "GET_MAILBOXES_STATS", itemId); - try - { - Organization org = (Organization)PackageController.GetPackageItem(itemId); - if (org == null) - return null; + try + { + Organization org = (Organization)PackageController.GetPackageItem(itemId); + if (org == null) + return null; + - // get stats int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - return exchange.GetMailboxesStatistics(org.DistinguishedName); - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + return exchange.GetMailboxesStatistics(org.DistinguishedName); + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } public static ExchangeMailboxStatistics GetMailboxStatistics(int itemId, int accountId) { @@ -775,69 +775,69 @@ namespace WebsitePanel.EnterpriseServer } - public static ExchangeItemStatistics[] GetPublicFoldersStatistics(int itemId) - { - #region Demo Mode - if (IsDemoMode) - { - List items = new List(); - ExchangeItemStatistics item1 = new ExchangeItemStatistics(); - item1.ItemName = "\\fabrikam\\Documents"; - item1.TotalItems = 6; - item1.TotalSizeMB = 56; - item1.LastModificationTime = DateTime.Now; - item1.LastAccessTime = DateTime.Now; - items.Add(item1); + public static ExchangeItemStatistics[] GetPublicFoldersStatistics(int itemId) + { + #region Demo Mode + if (IsDemoMode) + { + List items = new List(); + ExchangeItemStatistics item1 = new ExchangeItemStatistics(); + item1.ItemName = "\\fabrikam\\Documents"; + item1.TotalItems = 6; + item1.TotalSizeMB = 56; + item1.LastModificationTime = DateTime.Now; + item1.LastAccessTime = DateTime.Now; + items.Add(item1); - ExchangeItemStatistics item2 = new ExchangeItemStatistics(); - item2.ItemName = "\\fabrikam\\Documents\\Legal"; - item2.TotalItems = 5; - item2.TotalSizeMB = 4; - item2.LastModificationTime = DateTime.Now; - item2.LastAccessTime = DateTime.Now; - items.Add(item2); + ExchangeItemStatistics item2 = new ExchangeItemStatistics(); + item2.ItemName = "\\fabrikam\\Documents\\Legal"; + item2.TotalItems = 5; + item2.TotalSizeMB = 4; + item2.LastModificationTime = DateTime.Now; + item2.LastAccessTime = DateTime.Now; + items.Add(item2); - ExchangeItemStatistics item3 = new ExchangeItemStatistics(); - item3.ItemName = "\\fabrikam\\Documents\\Contracts"; - item3.TotalItems = 8; - item3.TotalSizeMB = 2; - item3.LastModificationTime = DateTime.Now; - item3.LastAccessTime = DateTime.Now; - items.Add(item3); + ExchangeItemStatistics item3 = new ExchangeItemStatistics(); + item3.ItemName = "\\fabrikam\\Documents\\Contracts"; + item3.TotalItems = 8; + item3.TotalSizeMB = 2; + item3.LastModificationTime = DateTime.Now; + item3.LastAccessTime = DateTime.Now; + items.Add(item3); - return items.ToArray(); - } - #endregion + return items.ToArray(); + } + #endregion - // place log record + // place log record TaskManager.StartTask("EXCHANGE", "GET_FOLDERS_STATS", itemId); - try - { - Organization org = (Organization)PackageController.GetPackageItem(itemId); - if (org == null) - return null; + try + { + Organization org = (Organization)PackageController.GetPackageItem(itemId); + if (org == null) + return null; - // get the list of all public folders - List folderNames = new List(); - List folders = GetAccounts(itemId, ExchangeAccountType.PublicFolder); - foreach (ExchangeAccount folder in folders) - folderNames.Add(folder.DisplayName); + // get the list of all public folders + List folderNames = new List(); + List folders = GetAccounts(itemId, ExchangeAccountType.PublicFolder); + foreach (ExchangeAccount folder in folders) + folderNames.Add(folder.DisplayName); - // get stats + // get stats int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); return exchange.GetPublicFoldersStatistics(org.OrganizationId, folderNames.ToArray()); - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } public static ExchangeActiveSyncPolicy GetActiveSyncPolicy(int itemId) { @@ -920,7 +920,7 @@ namespace WebsitePanel.EnterpriseServer ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); exchange.SetActiveSyncPolicy(org.OrganizationId, allowNonProvisionableDevices, attachmentsEnabled, maxAttachmentSizeKB, uncAccessEnabled, wssAccessEnabled, devicePasswordEnabled, alphanumericPasswordRequired, - passwordRecoveryEnabled, deviceEncryptionEnabled, allowSimplePassword, maxPasswordFailedAttempts, + passwordRecoveryEnabled, deviceEncryptionEnabled, allowSimplePassword, maxPasswordFailedAttempts, minPasswordLength, inactivityLockMin, passwordExpirationDays, passwordHistory, refreshInterval); return 0; @@ -935,93 +935,93 @@ namespace WebsitePanel.EnterpriseServer } } - private static void UpdateOrganization(Organization organization) - { - PackageController.UpdatePackageItem(organization); - } - #endregion + private static void UpdateOrganization(Organization organization) + { + PackageController.UpdatePackageItem(organization); + } + #endregion - #region Accounts + #region Accounts - private static bool AccountExists(string accountName) - { - return DataProvider.ExchangeAccountExists(accountName); - } + private static bool AccountExists(string accountName) + { + return DataProvider.ExchangeAccountExists(accountName); + } - public static ExchangeAccountsPaged GetAccountsPaged(int itemId, string accountTypes, - string filterColumn, string filterValue, string sortColumn, - int startRow, int maximumRows) - { - #region Demo Mode - if (IsDemoMode) - { - string []parseedAccountTypes = Utils.ParseDelimitedString(accountTypes, ','); - - ExchangeAccountsPaged res = new ExchangeAccountsPaged(); + public static ExchangeAccountsPaged GetAccountsPaged(int itemId, string accountTypes, + string filterColumn, string filterValue, string sortColumn, + int startRow, int maximumRows) + { + #region Demo Mode + if (IsDemoMode) + { + string[] parseedAccountTypes = Utils.ParseDelimitedString(accountTypes, ','); + + ExchangeAccountsPaged res = new ExchangeAccountsPaged(); res.PageItems = GetAccounts(itemId, (ExchangeAccountType)Utils.ParseInt(parseedAccountTypes[0], 1)).ToArray(); - res.RecordsCount = res.PageItems.Length; - return res; - } - #endregion + res.RecordsCount = res.PageItems.Length; + return res; + } + #endregion - DataSet ds = DataProvider.GetExchangeAccountsPaged(SecurityContext.User.UserId, itemId, + DataSet ds = DataProvider.GetExchangeAccountsPaged(SecurityContext.User.UserId, itemId, accountTypes, filterColumn, filterValue, sortColumn, startRow, maximumRows); - ExchangeAccountsPaged result = new ExchangeAccountsPaged(); - result.RecordsCount = (int)ds.Tables[0].Rows[0][0]; - - List accounts = new List(); - ObjectUtils.FillCollectionFromDataView(accounts, ds.Tables[1].DefaultView); - result.PageItems = accounts.ToArray(); - return result; - } + ExchangeAccountsPaged result = new ExchangeAccountsPaged(); + result.RecordsCount = (int)ds.Tables[0].Rows[0][0]; - public static List GetAccounts(int itemId, ExchangeAccountType accountType) - { - #region Demo Mode - if (IsDemoMode) - { - if (accountType == ExchangeAccountType.Mailbox) - return SearchAccounts(0, true, false, false, true, true, "", "", ""); - else if (accountType == ExchangeAccountType.Contact) - return SearchAccounts(0, false, true, false, false, false, "", "", ""); - else if (accountType == ExchangeAccountType.DistributionList) - return SearchAccounts(0, false, false, true, false, false, "", "", ""); - else - { - List demoAccounts = new List(); - ExchangeAccount f1 = new ExchangeAccount(); - f1.AccountId = 7; - f1.AccountName = "documents_fabrikam"; - f1.AccountType = ExchangeAccountType.PublicFolder; - f1.DisplayName = "\\fabrikam\\Documents"; - f1.PrimaryEmailAddress = "documents@fabrikam.net"; - f1.MailEnabledPublicFolder = true; - demoAccounts.Add(f1); + List accounts = new List(); + ObjectUtils.FillCollectionFromDataView(accounts, ds.Tables[1].DefaultView); + result.PageItems = accounts.ToArray(); + return result; + } - ExchangeAccount f2 = new ExchangeAccount(); - f2.AccountId = 8; - f2.AccountName = "documents_fabrikam"; - f2.AccountType = ExchangeAccountType.PublicFolder; - f2.DisplayName = "\\fabrikam\\Documents\\Legal"; - f2.PrimaryEmailAddress = ""; - demoAccounts.Add(f2); + public static List GetAccounts(int itemId, ExchangeAccountType accountType) + { + #region Demo Mode + if (IsDemoMode) + { + if (accountType == ExchangeAccountType.Mailbox) + return SearchAccounts(0, true, false, false, true, true, false, "", "", ""); + else if (accountType == ExchangeAccountType.Contact) + return SearchAccounts(0, false, true, false, false, false, false, "", "", ""); + else if (accountType == ExchangeAccountType.DistributionList) + return SearchAccounts(0, false, false, true, false, false, false, "", "", ""); + else + { + List demoAccounts = new List(); + ExchangeAccount f1 = new ExchangeAccount(); + f1.AccountId = 7; + f1.AccountName = "documents_fabrikam"; + f1.AccountType = ExchangeAccountType.PublicFolder; + f1.DisplayName = "\\fabrikam\\Documents"; + f1.PrimaryEmailAddress = "documents@fabrikam.net"; + f1.MailEnabledPublicFolder = true; + demoAccounts.Add(f1); - ExchangeAccount f3 = new ExchangeAccount(); - f3.AccountId = 9; - f3.AccountName = "documents_fabrikam"; - f3.AccountType = ExchangeAccountType.PublicFolder; - f3.DisplayName = "\\fabrikam\\Documents\\Contracts"; - f3.PrimaryEmailAddress = ""; - demoAccounts.Add(f3); - return demoAccounts; - } - } - #endregion + ExchangeAccount f2 = new ExchangeAccount(); + f2.AccountId = 8; + f2.AccountName = "documents_fabrikam"; + f2.AccountType = ExchangeAccountType.PublicFolder; + f2.DisplayName = "\\fabrikam\\Documents\\Legal"; + f2.PrimaryEmailAddress = ""; + demoAccounts.Add(f2); - return ObjectUtils.CreateListFromDataReader( - DataProvider.GetExchangeAccounts(itemId, (int)accountType)); - } + ExchangeAccount f3 = new ExchangeAccount(); + f3.AccountId = 9; + f3.AccountName = "documents_fabrikam"; + f3.AccountType = ExchangeAccountType.PublicFolder; + f3.DisplayName = "\\fabrikam\\Documents\\Contracts"; + f3.PrimaryEmailAddress = ""; + demoAccounts.Add(f3); + return demoAccounts; + } + } + #endregion + + return ObjectUtils.CreateListFromDataReader( + DataProvider.GetExchangeAccounts(itemId, (int)accountType)); + } public static List GetExchangeAccountByMailboxPlanId(int itemId, int mailboxPlanId) @@ -1035,36 +1035,36 @@ namespace WebsitePanel.EnterpriseServer return ObjectUtils.CreateListFromDataReader(DataProvider.GetExchangeMailboxes(itemId)); } - public static List SearchAccounts(int itemId, - bool includeMailboxes, bool includeContacts, bool includeDistributionLists, - bool includeRooms, bool includeEquipment, - string filterColumn, string filterValue, string sortColumn) - { - #region Demo Mode - if (IsDemoMode) - { - List demoAccounts = new List(); + public static List SearchAccounts(int itemId, + bool includeMailboxes, bool includeContacts, bool includeDistributionLists, + bool includeRooms, bool includeEquipment, bool includeSecurityGroups, + string filterColumn, string filterValue, string sortColumn) + { + #region Demo Mode + if (IsDemoMode) + { + List demoAccounts = new List(); - if (includeMailboxes) - { - ExchangeAccount m1 = new ExchangeAccount(); - m1.AccountId = 1; - m1.AccountName = "john_fabrikam"; - m1.AccountType = ExchangeAccountType.Mailbox; - m1.DisplayName = "John Smith"; - m1.PrimaryEmailAddress = "john@fabrikam.net"; - demoAccounts.Add(m1); + if (includeMailboxes) + { + ExchangeAccount m1 = new ExchangeAccount(); + m1.AccountId = 1; + m1.AccountName = "john_fabrikam"; + m1.AccountType = ExchangeAccountType.Mailbox; + m1.DisplayName = "John Smith"; + m1.PrimaryEmailAddress = "john@fabrikam.net"; + demoAccounts.Add(m1); - - ExchangeAccount m3 = new ExchangeAccount(); - m3.AccountId = 3; - m3.AccountName = "marry_fabrikam"; - m3.AccountType = ExchangeAccountType.Mailbox; - m3.DisplayName = "Marry Smith"; - m3.PrimaryEmailAddress = "marry@fabrikam.net"; - demoAccounts.Add(m3); - } + + ExchangeAccount m3 = new ExchangeAccount(); + m3.AccountId = 3; + m3.AccountName = "marry_fabrikam"; + m3.AccountType = ExchangeAccountType.Mailbox; + m3.DisplayName = "Marry Smith"; + m3.PrimaryEmailAddress = "marry@fabrikam.net"; + demoAccounts.Add(m3); + } if (includeRooms) { @@ -1088,65 +1088,75 @@ namespace WebsitePanel.EnterpriseServer demoAccounts.Add(e1); } - if (includeContacts) - { - ExchangeAccount c1 = new ExchangeAccount(); - c1.AccountId = 4; - c1.AccountName = "pntr1_fabrikam"; - c1.AccountType = ExchangeAccountType.Contact; - c1.DisplayName = "WebsitePanel Support"; - c1.PrimaryEmailAddress = "support@websitepanel.net"; - demoAccounts.Add(c1); + if (includeContacts) + { + ExchangeAccount c1 = new ExchangeAccount(); + c1.AccountId = 4; + c1.AccountName = "pntr1_fabrikam"; + c1.AccountType = ExchangeAccountType.Contact; + c1.DisplayName = "WebsitePanel Support"; + c1.PrimaryEmailAddress = "support@websitepanel.net"; + demoAccounts.Add(c1); - ExchangeAccount c2 = new ExchangeAccount(); - c2.AccountId = 5; - c2.AccountName = "acc1_fabrikam"; - c2.AccountType = ExchangeAccountType.Contact; - c2.DisplayName = "John Home Account"; - c2.PrimaryEmailAddress = "john@yahoo.com"; - demoAccounts.Add(c2); - } + ExchangeAccount c2 = new ExchangeAccount(); + c2.AccountId = 5; + c2.AccountName = "acc1_fabrikam"; + c2.AccountType = ExchangeAccountType.Contact; + c2.DisplayName = "John Home Account"; + c2.PrimaryEmailAddress = "john@yahoo.com"; + demoAccounts.Add(c2); + } - if (includeDistributionLists) - { - ExchangeAccount d1 = new ExchangeAccount(); - d1.AccountId = 6; - d1.AccountName = "sales_fabrikam"; - d1.AccountType = ExchangeAccountType.DistributionList; - d1.DisplayName = "Fabrikam Sales Dept"; - d1.PrimaryEmailAddress = "sales@fabrikam.net"; - demoAccounts.Add(d1); - } + if (includeDistributionLists) + { + ExchangeAccount d1 = new ExchangeAccount(); + d1.AccountId = 6; + d1.AccountName = "sales_fabrikam"; + d1.AccountType = ExchangeAccountType.DistributionList; + d1.DisplayName = "Fabrikam Sales Dept"; + d1.PrimaryEmailAddress = "sales@fabrikam.net"; + demoAccounts.Add(d1); + } - return demoAccounts; - } - #endregion + if (includeSecurityGroups) + { + ExchangeAccount g1 = new ExchangeAccount(); + g1.AccountId = 7; + g1.AccountName = "group_fabrikam"; + g1.AccountType = ExchangeAccountType.SecurityGroup; + g1.DisplayName = "Fabrikam Sales Dept"; + demoAccounts.Add(g1); + } - return ObjectUtils.CreateListFromDataReader( - DataProvider.SearchExchangeAccounts(SecurityContext.User.UserId, itemId, includeMailboxes, includeContacts, - includeDistributionLists, includeRooms, includeEquipment, + return demoAccounts; + } + #endregion + + return ObjectUtils.CreateListFromDataReader( + DataProvider.SearchExchangeAccounts(SecurityContext.User.UserId, itemId, includeMailboxes, includeContacts, + includeDistributionLists, includeRooms, includeEquipment, includeSecurityGroups, filterColumn, filterValue, sortColumn)); - } + } - public static ExchangeAccount GetAccount(int itemId, int accountId) - { - #region Demo Mode - if (IsDemoMode) - { - ExchangeAccount m1 = new ExchangeAccount(); - m1.AccountId = 1; - m1.AccountName = "john_fabrikam"; - m1.AccountType = ExchangeAccountType.Mailbox; - m1.DisplayName = "John Smith"; - m1.PrimaryEmailAddress = "john@fabrikam.net"; - return m1; - } - #endregion + public static ExchangeAccount GetAccount(int itemId, int accountId) + { + #region Demo Mode + if (IsDemoMode) + { + ExchangeAccount m1 = new ExchangeAccount(); + m1.AccountId = 1; + m1.AccountName = "john_fabrikam"; + m1.AccountType = ExchangeAccountType.Mailbox; + m1.DisplayName = "John Smith"; + m1.PrimaryEmailAddress = "john@fabrikam.net"; + return m1; + } + #endregion - ExchangeAccount account = ObjectUtils.FillObjectFromDataReader( - DataProvider.GetExchangeAccount(itemId, accountId)); + ExchangeAccount account = ObjectUtils.FillObjectFromDataReader( + DataProvider.GetExchangeAccount(itemId, accountId)); if (account == null) return null; @@ -1155,7 +1165,7 @@ namespace WebsitePanel.EnterpriseServer account.AccountPassword = CryptoUtils.Decrypt(account.AccountPassword); return account; - } + } public static bool CheckAccountCredentials(int itemId, string email, string password) { @@ -1217,14 +1227,14 @@ namespace WebsitePanel.EnterpriseServer (string.IsNullOrEmpty(account.SubscriberNumber) ? null : account.SubscriberNumber.Trim())); } - private static void DeleteAccount(int itemId, int accountId) - { - // try to get organization - if (GetOrganization(itemId) == null) - return; + private static void DeleteAccount(int itemId, int accountId) + { + // try to get organization + if (GetOrganization(itemId) == null) + return; - DataProvider.DeleteExchangeAccount(itemId, accountId); - } + DataProvider.DeleteExchangeAccount(itemId, accountId); + } private static string BuildAccountName(string orgId, string name) { @@ -1263,119 +1273,119 @@ namespace WebsitePanel.EnterpriseServer } - #endregion + #endregion - #region Account Email Addresses - private static bool EmailAddressExists(string emailAddress) - { - return DataProvider.ExchangeAccountEmailAddressExists(emailAddress); - } + #region Account Email Addresses + private static bool EmailAddressExists(string emailAddress) + { + return DataProvider.ExchangeAccountEmailAddressExists(emailAddress); + } - - private static ExchangeEmailAddress[] GetAccountEmailAddresses(int itemId, int accountId) - { - #region Demo Mode - if (IsDemoMode) - { - List demoEmails = new List(); - ExchangeEmailAddress e1 = new ExchangeEmailAddress(); - e1.EmailAddress = "john@fabrikam.net"; - e1.IsPrimary = true; - demoEmails.Add(e1); - ExchangeEmailAddress e2 = new ExchangeEmailAddress(); - e2.EmailAddress = "john.smith@fabrikam.net"; - demoEmails.Add(e2); + private static ExchangeEmailAddress[] GetAccountEmailAddresses(int itemId, int accountId) + { + #region Demo Mode + if (IsDemoMode) + { + List demoEmails = new List(); + ExchangeEmailAddress e1 = new ExchangeEmailAddress(); + e1.EmailAddress = "john@fabrikam.net"; + e1.IsPrimary = true; + demoEmails.Add(e1); - ExchangeEmailAddress e3 = new ExchangeEmailAddress(); - e3.EmailAddress = "john@fabrikam.hosted-exchange.com"; - demoEmails.Add(e3); - return demoEmails.ToArray(); - } - #endregion + ExchangeEmailAddress e2 = new ExchangeEmailAddress(); + e2.EmailAddress = "john.smith@fabrikam.net"; + demoEmails.Add(e2); - List emails = ObjectUtils.CreateListFromDataReader( - DataProvider.GetExchangeAccountEmailAddresses(accountId)); + ExchangeEmailAddress e3 = new ExchangeEmailAddress(); + e3.EmailAddress = "john@fabrikam.hosted-exchange.com"; + demoEmails.Add(e3); + return demoEmails.ToArray(); + } + #endregion - // load account - ExchangeAccount account = GetAccount(itemId, accountId); + List emails = ObjectUtils.CreateListFromDataReader( + DataProvider.GetExchangeAccountEmailAddresses(accountId)); - foreach (ExchangeEmailAddress email in emails) - { - if (String.Compare(account.PrimaryEmailAddress, email.EmailAddress, true) == 0) - { - email.IsPrimary = true; - } + // load account + ExchangeAccount account = GetAccount(itemId, accountId); + + foreach (ExchangeEmailAddress email in emails) + { + if (String.Compare(account.PrimaryEmailAddress, email.EmailAddress, true) == 0) + { + email.IsPrimary = true; + } if (String.Compare(account.UserPrincipalName, email.EmailAddress, true) == 0) { email.IsUserPrincipalName = true; } - } + } - return emails.ToArray(); - } + return emails.ToArray(); + } - private static void AddAccountEmailAddress(int accountId, string emailAddress) - { - DataProvider.AddExchangeAccountEmailAddress(accountId, emailAddress); - } + private static void AddAccountEmailAddress(int accountId, string emailAddress) + { + DataProvider.AddExchangeAccountEmailAddress(accountId, emailAddress); + } - private static void DeleteAccountEmailAddresses(int accountId, string[] emailAddresses) - { - foreach (string emailAddress in emailAddresses) - DataProvider.DeleteExchangeAccountEmailAddress(accountId, emailAddress); - } + private static void DeleteAccountEmailAddresses(int accountId, string[] emailAddresses) + { + foreach (string emailAddress in emailAddresses) + DataProvider.DeleteExchangeAccountEmailAddress(accountId, emailAddress); + } - #endregion + #endregion - #region Domains - public static List GetOrganizationDomains(int itemId) - { - #region Demo Mode - if (IsDemoMode) - { - List demoDomains = new List(); - ExchangeDomainName d1 = new ExchangeDomainName(); - d1.DomainId = 1; - d1.DomainName = "fabrikam.hosted-exchange.com"; - d1.IsDefault = false; - d1.IsHost = true; - demoDomains.Add(d1); + #region Domains + public static List GetOrganizationDomains(int itemId) + { + #region Demo Mode + if (IsDemoMode) + { + List demoDomains = new List(); + ExchangeDomainName d1 = new ExchangeDomainName(); + d1.DomainId = 1; + d1.DomainName = "fabrikam.hosted-exchange.com"; + d1.IsDefault = false; + d1.IsHost = true; + demoDomains.Add(d1); - ExchangeDomainName d2 = new ExchangeDomainName(); - d2.DomainId = 2; - d2.DomainName = "fabrikam.net"; - d2.IsDefault = true; - d2.IsHost = false; - demoDomains.Add(d2); + ExchangeDomainName d2 = new ExchangeDomainName(); + d2.DomainId = 2; + d2.DomainName = "fabrikam.net"; + d2.IsDefault = true; + d2.IsHost = false; + demoDomains.Add(d2); - return demoDomains; - } - #endregion + return demoDomains; + } + #endregion - // load organization - Organization org = (Organization)PackageController.GetPackageItem(itemId); - if (org == null) - return null; + // load organization + Organization org = (Organization)PackageController.GetPackageItem(itemId); + if (org == null) + return null; - // load all domains - List domains = ObjectUtils.CreateListFromDataReader( - DataProvider.GetExchangeOrganizationDomains(itemId)); + // load all domains + List domains = ObjectUtils.CreateListFromDataReader( + DataProvider.GetExchangeOrganizationDomains(itemId)); - // set default domain - foreach (ExchangeDomainName domain in domains) - { - if (String.Compare(domain.DomainName, org.DefaultDomain, true) == 0) - { - domain.IsDefault = true; - break; - } - } + // set default domain + foreach (ExchangeDomainName domain in domains) + { + if (String.Compare(domain.DomainName, org.DefaultDomain, true) == 0) + { + domain.IsDefault = true; + break; + } + } - return domains; - } + return domains; + } public static int AddAuthoritativeDomain(int itemId, int domainId) { @@ -1435,7 +1445,7 @@ namespace WebsitePanel.EnterpriseServer ServerController.AddServiceDNSRecords(org.PackageId, ResourceGroups.Exchange, domain, ""); } } - + return 0; } catch (Exception ex) @@ -1463,7 +1473,7 @@ namespace WebsitePanel.EnterpriseServer TaskManager.StartTask("EXCHANGE", "CHANGE_DOMAIN_TYPE", itemId, parameters); try - { + { // load organization Organization org = (Organization)PackageController.GetPackageItem(itemId); if (org == null) @@ -1507,38 +1517,38 @@ namespace WebsitePanel.EnterpriseServer TaskManager.CompleteTask(); } } - - public static int DeleteAuthoritativeDomain(int itemId, int domainId) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; - // place log record - TaskManager.StartTask("EXCHANGE", "DELETE_DOMAIN", itemId, new BackgroundTaskParameter("Domain ID", domainId)); + public static int DeleteAuthoritativeDomain(int itemId, int domainId) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; - try - { - // load organization - Organization org = (Organization)PackageController.GetPackageItem(itemId); - if (org == null) - return -1; + // place log record + TaskManager.StartTask("EXCHANGE", "DELETE_DOMAIN", itemId, new BackgroundTaskParameter("Domain ID", domainId)); - // load domain - DomainInfo domain = ServerController.GetDomain(domainId); - if(domain == null) - return -1; + try + { + // load organization + Organization org = (Organization)PackageController.GetPackageItem(itemId); + if (org == null) + return -1; + + // load domain + DomainInfo domain = ServerController.GetDomain(domainId); + if (domain == null) + return -1; if (DataProvider.CheckDomainUsedByHostedOrganization(domain.DomainName) == 1) { return -1; } - - // delete domain on Exchange - int[] hubTransportServiceIds; - int[] clientAccessServiceIds; + + // delete domain on Exchange + int[] hubTransportServiceIds; + int[] clientAccessServiceIds; int exchangeServiceId = GetExchangeServiceID(org.PackageId); - GetExchangeServices(exchangeServiceId, out hubTransportServiceIds, out clientAccessServiceIds); + GetExchangeServices(exchangeServiceId, out hubTransportServiceIds, out clientAccessServiceIds); foreach (int id in hubTransportServiceIds) { @@ -1569,22 +1579,22 @@ namespace WebsitePanel.EnterpriseServer - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } - #endregion + #endregion - #region Mailboxes + #region Mailboxes private static void UpdateExchangeAccount(int accountId, string accountName, ExchangeAccountType accountType, string displayName, string primaryEmailAddress, bool mailEnabledPublicFolder, @@ -1701,7 +1711,7 @@ namespace WebsitePanel.EnterpriseServer if (cntx.Quotas.ContainsKey(Quotas.EXCHANGE2007_RECOVERABLEITEMSSPACE) && cntx.Quotas[Quotas.EXCHANGE2007_RECOVERABLEITEMSSPACE].QuotaAllocatedValue > 0) { - maxRecoverableItemsSpace = cntx.Quotas[Quotas.EXCHANGE2007_RECOVERABLEITEMSSPACE].QuotaAllocatedValue; + maxRecoverableItemsSpace = cntx.Quotas[Quotas.EXCHANGE2007_RECOVERABLEITEMSSPACE].QuotaAllocatedValue; quotaRecoverableItemsUsed = cntx.Quotas[Quotas.EXCHANGE2007_RECOVERABLEITEMSSPACE].QuotaUsedValue; } @@ -1826,18 +1836,18 @@ namespace WebsitePanel.EnterpriseServer { BlackBerryController.DeleteBlackBerryUser(itemId, accountId); } - + // delete mailbox int serviceExchangeId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(serviceExchangeId, org.ServiceId); exchange.DisableMailbox(account.UserPrincipalName); - account.AccountType = ExchangeAccountType.User; + account.AccountType = ExchangeAccountType.User; account.MailEnabledPublicFolder = false; account.AccountPassword = null; UpdateAccount(account); DataProvider.DeleteUserEmailAddresses(account.AccountId, account.PrimaryEmailAddress); - + return 0; } catch (Exception ex) @@ -1850,120 +1860,120 @@ namespace WebsitePanel.EnterpriseServer } } - - public static int DeleteMailbox(int itemId, int accountId) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; - // place log record + public static int DeleteMailbox(int itemId, int accountId) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; + + // place log record TaskManager.StartTask("EXCHANGE", "DELETE_MAILBOX", itemId); - try - { - // load organization - Organization org = GetOrganization(itemId); - if (org == null) - return -1; + try + { + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return -1; - // load account - ExchangeAccount account = GetAccount(itemId, accountId); + // load account + ExchangeAccount account = GetAccount(itemId, accountId); if (BlackBerryController.CheckBlackBerryUserExists(accountId)) { BlackBerryController.DeleteBlackBerryUser(itemId, accountId); } - - // delete mailbox - int serviceExchangeId = GetExchangeServiceID(org.PackageId); + + // delete mailbox + int serviceExchangeId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(serviceExchangeId, org.ServiceId); - exchange.DeleteMailbox(account.UserPrincipalName); + exchange.DeleteMailbox(account.UserPrincipalName); + + - - // unregister account - DeleteAccount(itemId, accountId); + DeleteAccount(itemId, accountId); - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } - private static ExchangeMailbox GetDemoMailboxSettings() - { - ExchangeMailbox mb = new ExchangeMailbox(); - mb.DisplayName = "John Smith"; - mb.Domain = "HSTDEXCH1"; - mb.AccountName = "john_fabrikam"; - mb.EnableForwarding = true; - mb.EnableIMAP = true; - mb.EnableMAPI = true; - mb.EnablePOP = true; - mb.FirstName = "John"; - mb.LastName = "Smith"; - mb.ForwardingAccount = GetAccounts(0, ExchangeAccountType.Mailbox)[1]; - mb.EnableForwarding = true; - mb.IssueWarningKB = 150000; - mb.KeepDeletedItemsDays = 14; - mb.LastLogoff = DateTime.Now; - mb.LastLogon = DateTime.Now; - mb.ManagerAccount = GetAccounts(0, ExchangeAccountType.Mailbox)[1]; - mb.MaxReceiveMessageSizeKB = 20000; - mb.MaxRecipients = 30; - mb.MaxSendMessageSizeKB = 10000; - mb.ProhibitSendKB = 160000; - mb.ProhibitSendReceiveKB = 170000; - mb.TotalItems = 5; - mb.TotalSizeMB = 4; - return mb; - } + private static ExchangeMailbox GetDemoMailboxSettings() + { + ExchangeMailbox mb = new ExchangeMailbox(); + mb.DisplayName = "John Smith"; + mb.Domain = "HSTDEXCH1"; + mb.AccountName = "john_fabrikam"; + mb.EnableForwarding = true; + mb.EnableIMAP = true; + mb.EnableMAPI = true; + mb.EnablePOP = true; + mb.FirstName = "John"; + mb.LastName = "Smith"; + mb.ForwardingAccount = GetAccounts(0, ExchangeAccountType.Mailbox)[1]; + mb.EnableForwarding = true; + mb.IssueWarningKB = 150000; + mb.KeepDeletedItemsDays = 14; + mb.LastLogoff = DateTime.Now; + mb.LastLogon = DateTime.Now; + mb.ManagerAccount = GetAccounts(0, ExchangeAccountType.Mailbox)[1]; + mb.MaxReceiveMessageSizeKB = 20000; + mb.MaxRecipients = 30; + mb.MaxSendMessageSizeKB = 10000; + mb.ProhibitSendKB = 160000; + mb.ProhibitSendReceiveKB = 170000; + mb.TotalItems = 5; + mb.TotalSizeMB = 4; + return mb; + } - public static ExchangeMailbox GetMailboxGeneralSettings(int itemId, int accountId) - { - #region Demo Mode - if (IsDemoMode) - { - return GetDemoMailboxSettings(); - } - #endregion + public static ExchangeMailbox GetMailboxGeneralSettings(int itemId, int accountId) + { + #region Demo Mode + if (IsDemoMode) + { + return GetDemoMailboxSettings(); + } + #endregion - // place log record + // place log record TaskManager.StartTask("EXCHANGE", "GET_MAILBOX_GENERAL", itemId); - try - { - // load organization - Organization org = GetOrganization(itemId); - if (org == null) - return null; + try + { + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return null; - // load account - ExchangeAccount account = GetAccount(itemId, accountId); + // load account + ExchangeAccount account = GetAccount(itemId, accountId); - // get mailbox settings + // get mailbox settings - int exchangeServiceId = GetExchangeServiceID(org.PackageId); + int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - return exchange.GetMailboxGeneralSettings(account.UserPrincipalName); - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + return exchange.GetMailboxGeneralSettings(account.UserPrincipalName); + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } public static int SetMailboxGeneralSettings(int itemId, int accountId, bool hideAddressBook, bool disabled) { @@ -2015,74 +2025,74 @@ namespace WebsitePanel.EnterpriseServer } } - public static ExchangeEmailAddress[] GetMailboxEmailAddresses(int itemId, int accountId) - { - // place log record + public static ExchangeEmailAddress[] GetMailboxEmailAddresses(int itemId, int accountId) + { + // place log record TaskManager.StartTask("EXCHANGE", "GET_MAILBOX_ADDRESSES", itemId); - try - { - return GetAccountEmailAddresses(itemId, accountId); - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + try + { + return GetAccountEmailAddresses(itemId, accountId); + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } - public static int AddMailboxEmailAddress(int itemId, int accountId, string emailAddress) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; + public static int AddMailboxEmailAddress(int itemId, int accountId, string emailAddress) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; - // place log record + // place log record TaskManager.StartTask("EXCHANGE", "ADD_MAILBOX_ADDRESS", itemId); - try - { - // check - if (EmailAddressExists(emailAddress)) - return BusinessErrorCodes.ERROR_EXCHANGE_EMAIL_EXISTS; + try + { + // check + if (EmailAddressExists(emailAddress)) + return BusinessErrorCodes.ERROR_EXCHANGE_EMAIL_EXISTS; - // load organization - Organization org = GetOrganization(itemId); - if (org == null) - return -1; + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return -1; - // check package - int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) return packageCheck; + // check package + int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; - // load account - ExchangeAccount account = GetAccount(itemId, accountId); + // load account + ExchangeAccount account = GetAccount(itemId, accountId); - // add e-mail - AddAccountEmailAddress(accountId, emailAddress); + // add e-mail + AddAccountEmailAddress(accountId, emailAddress); - // update e-mail addresses - int exchangeServiceId = GetExchangeServiceID(org.PackageId); + // update e-mail addresses + int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); exchange.SetMailboxEmailAddresses( - account.UserPrincipalName, - GetAccountSimpleEmailAddresses(itemId, accountId)); + account.UserPrincipalName, + GetAccountSimpleEmailAddresses(itemId, accountId)); - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } private static OCSServer GetOCSProxy(int itemId) { @@ -2095,37 +2105,37 @@ namespace WebsitePanel.EnterpriseServer return ocs; } - - public static int SetMailboxPrimaryEmailAddress(int itemId, int accountId, string emailAddress) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; - // place log record + public static int SetMailboxPrimaryEmailAddress(int itemId, int accountId, string emailAddress) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; + + // place log record TaskManager.StartTask("EXCHANGE", "SET_PRIMARY_MAILBOX_ADDRESS", itemId); - try - { - // get account - ExchangeAccount account = GetAccount(itemId, accountId); - account.PrimaryEmailAddress = emailAddress; + try + { + // get account + ExchangeAccount account = GetAccount(itemId, accountId); + account.PrimaryEmailAddress = emailAddress; - // update exchange - Organization org = GetOrganization(itemId); - if (org == null) - return -1; + // update exchange + Organization org = GetOrganization(itemId); + if (org == null) + return -1; - // check package - int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) return packageCheck; + // check package + int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - - exchange.SetMailboxPrimaryEmailAddress( - account.UserPrincipalName, - emailAddress); + + exchange.SetMailboxPrimaryEmailAddress( + account.UserPrincipalName, + emailAddress); if (DataProvider.CheckOCSUserExists(account.AccountId)) { @@ -2139,111 +2149,111 @@ namespace WebsitePanel.EnterpriseServer LyncController.SetLyncUserGeneralSettings(itemId, accountId, emailAddress, null); } - // save account + // save account account.AccountPassword = null; - UpdateAccount(account); + UpdateAccount(account); - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } - public static int DeleteMailboxEmailAddresses(int itemId, int accountId, string[] emailAddresses) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; + public static int DeleteMailboxEmailAddresses(int itemId, int accountId, string[] emailAddresses) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; - // place log record + // place log record TaskManager.StartTask("EXCHANGE", "DELETE_MAILBOX_ADDRESSES", itemId); - try - { - // get account - ExchangeAccount account = GetAccount(itemId, accountId); + try + { + // get account + ExchangeAccount account = GetAccount(itemId, accountId); - // delete e-mail addresses - List toDelete = new List(); - foreach (string emailAddress in emailAddresses) - { - if ((String.Compare(account.PrimaryEmailAddress, emailAddress, true) != 0) & + // delete e-mail addresses + List toDelete = new List(); + foreach (string emailAddress in emailAddresses) + { + if ((String.Compare(account.PrimaryEmailAddress, emailAddress, true) != 0) & (String.Compare(account.UserPrincipalName, emailAddress, true) != 0)) - toDelete.Add(emailAddress); - } + toDelete.Add(emailAddress); + } - // delete from meta-base - DeleteAccountEmailAddresses(accountId, toDelete.ToArray()); + // delete from meta-base + DeleteAccountEmailAddresses(accountId, toDelete.ToArray()); - // delete from Exchange - Organization org = GetOrganization(itemId); - if (org == null) - return -1; + // delete from Exchange + Organization org = GetOrganization(itemId); + if (org == null) + return -1; - // update e-mail addresses + // update e-mail addresses int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - - exchange.SetMailboxEmailAddresses( - account.UserPrincipalName, - GetAccountSimpleEmailAddresses(itemId, accountId)); - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + exchange.SetMailboxEmailAddresses( + account.UserPrincipalName, + GetAccountSimpleEmailAddresses(itemId, accountId)); - public static ExchangeMailbox GetMailboxMailFlowSettings(int itemId, int accountId) - { - #region Demo Mode - if (IsDemoMode) - { - return GetDemoMailboxSettings(); - } - #endregion + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } - // place log record + public static ExchangeMailbox GetMailboxMailFlowSettings(int itemId, int accountId) + { + #region Demo Mode + if (IsDemoMode) + { + return GetDemoMailboxSettings(); + } + #endregion + + // place log record TaskManager.StartTask("EXCHANGE", "GET_MAILBOX_MAILFLOW", itemId); - try - { - // load organization - Organization org = GetOrganization(itemId); - if (org == null) - return null; + try + { + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return null; - // load account - ExchangeAccount account = GetAccount(itemId, accountId); + // load account + ExchangeAccount account = GetAccount(itemId, accountId); - // get mailbox settings + // get mailbox settings int exchangeServiceId = GetExchangeServiceID(org.PackageId); - ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - ExchangeMailbox mailbox = exchange.GetMailboxMailFlowSettings(account.UserPrincipalName); - mailbox.DisplayName = account.DisplayName; - return mailbox; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); + ExchangeMailbox mailbox = exchange.GetMailboxMailFlowSettings(account.UserPrincipalName); + mailbox.DisplayName = account.DisplayName; + return mailbox; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } public static int SetMailboxMailFlowSettings(int itemId, int accountId, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, @@ -2297,44 +2307,44 @@ namespace WebsitePanel.EnterpriseServer } - public static ExchangeMailbox GetMailboxAdvancedSettings(int itemId, int accountId) - { - #region Demo Mode - if (IsDemoMode) - { - return GetDemoMailboxSettings(); - } - #endregion + public static ExchangeMailbox GetMailboxAdvancedSettings(int itemId, int accountId) + { + #region Demo Mode + if (IsDemoMode) + { + return GetDemoMailboxSettings(); + } + #endregion - // place log record + // place log record TaskManager.StartTask("EXCHANGE", "GET_MAILBOX_ADVANCED", itemId); - try - { - // load organization - Organization org = GetOrganization(itemId); - if (org == null) - return null; + try + { + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return null; - // load account - ExchangeAccount account = GetAccount(itemId, accountId); + // load account + ExchangeAccount account = GetAccount(itemId, accountId); - // get mailbox settings + // get mailbox settings int exchangeServiceId = GetExchangeServiceID(org.PackageId); - ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - ExchangeMailbox mailbox = exchange.GetMailboxAdvancedSettings(account.UserPrincipalName); - mailbox.DisplayName = account.DisplayName; - return mailbox; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); + ExchangeMailbox mailbox = exchange.GetMailboxAdvancedSettings(account.UserPrincipalName); + mailbox.DisplayName = account.DisplayName; + return mailbox; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } public static int SetMailboxManagerSettings(int itemId, int accountId, bool pmmAllowed, MailboxManagerActions action) { @@ -2387,7 +2397,7 @@ namespace WebsitePanel.EnterpriseServer return string.Empty; } #endregion - + // load organization Organization org = GetOrganization(itemId); if (org == null) @@ -2528,7 +2538,7 @@ namespace WebsitePanel.EnterpriseServer // get mailbox settings int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - ExchangeMailbox mailbox = exchange.GetMailboxPermissions(org.OrganizationId, account.UserPrincipalName); + ExchangeMailbox mailbox = exchange.GetMailboxPermissions(org.OrganizationId, account.UserPrincipalName); mailbox.DisplayName = account.DisplayName; return mailbox; } @@ -2539,7 +2549,7 @@ namespace WebsitePanel.EnterpriseServer finally { TaskManager.CompleteTask(); - } + } } public static int SetMailboxPermissions(int itemId, int accountId, string[] sendAsaccounts, string[] fullAccessAcounts) @@ -2568,9 +2578,9 @@ namespace WebsitePanel.EnterpriseServer // get mailbox settings int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - + exchange.SetMailboxPermissions(org.OrganizationId, account.UserPrincipalName, sendAsaccounts, fullAccessAcounts); - + return 0; } @@ -2581,12 +2591,12 @@ namespace WebsitePanel.EnterpriseServer finally { TaskManager.CompleteTask(); - } - + } + } - #endregion + #endregion #region Mailbox plan @@ -2743,7 +2753,7 @@ namespace WebsitePanel.EnterpriseServer } } - private static void GetExchangeMailboxPlansByUser(int itemId, UserInfo user, ref ListmailboxPlans) + private static void GetExchangeMailboxPlansByUser(int itemId, UserInfo user, ref List mailboxPlans) { if ((user != null)) { @@ -2752,7 +2762,7 @@ namespace WebsitePanel.EnterpriseServer if (user.UserId != 1) { List Packages = PackageController.GetPackages(user.UserId); - + if ((Packages != null) & (Packages.Count > 0)) { orgs = GetExchangeOrganizationsInternal(Packages[0].PackageId, false); @@ -2995,7 +3005,7 @@ namespace WebsitePanel.EnterpriseServer #region Contacts public static int CreateContact(int itemId, string displayName, string email) - { + { //if (EmailAddressExists(email)) // return BusinessErrorCodes.ERROR_EXCHANGE_EMAIL_EXISTS; @@ -3071,103 +3081,103 @@ namespace WebsitePanel.EnterpriseServer } } - public static int DeleteContact(int itemId, int accountId) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; + public static int DeleteContact(int itemId, int accountId) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; - // place log record + // place log record TaskManager.StartTask("EXCHANGE", "DELETE_CONTACT", itemId); try - { - // load organization - Organization org = GetOrganization(itemId); - if (org == null) - return -1; + { + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return -1; - // load account - ExchangeAccount account = GetAccount(itemId, accountId); + // load account + ExchangeAccount account = GetAccount(itemId, accountId); - // delete contact + // delete contact int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - - exchange.DeleteContact(account.AccountName); - // remove meta-item - DeleteAccount(itemId, accountId); + exchange.DeleteContact(account.AccountName); - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + // remove meta-item + DeleteAccount(itemId, accountId); - private static ExchangeContact GetDemoContactSettings() - { - ExchangeContact c = new ExchangeContact(); - c.DisplayName = "WebsitePanel Support"; - c.AccountName = "wsp_fabrikam"; - c.FirstName = "WebsitePanel"; - c.LastName = "Support"; - c.EmailAddress = "support@websitepanel.net"; - c.AcceptAccounts = GetAccounts(0, ExchangeAccountType.Mailbox).ToArray(); - return c; - } + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } - public static ExchangeContact GetContactGeneralSettings(int itemId, int accountId) - { - #region Demo Mode - if (IsDemoMode) - { - return GetDemoContactSettings(); - } - #endregion + private static ExchangeContact GetDemoContactSettings() + { + ExchangeContact c = new ExchangeContact(); + c.DisplayName = "WebsitePanel Support"; + c.AccountName = "wsp_fabrikam"; + c.FirstName = "WebsitePanel"; + c.LastName = "Support"; + c.EmailAddress = "support@websitepanel.net"; + c.AcceptAccounts = GetAccounts(0, ExchangeAccountType.Mailbox).ToArray(); + return c; + } - // place log record + public static ExchangeContact GetContactGeneralSettings(int itemId, int accountId) + { + #region Demo Mode + if (IsDemoMode) + { + return GetDemoContactSettings(); + } + #endregion + + // place log record TaskManager.StartTask("EXCHANGE", "GET_CONTACT_GENERAL", itemId); - try - { - // load organization - Organization org = GetOrganization(itemId); - if (org == null) - return null; + try + { + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return null; - // load account - ExchangeAccount account = GetAccount(itemId, accountId); + // load account + ExchangeAccount account = GetAccount(itemId, accountId); - // get mailbox settings + // get mailbox settings int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - - return exchange.GetContactGeneralSettings(account.AccountName); - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } - public static int SetContactGeneralSettings(int itemId, int accountId, string displayName, string emailAddress, - bool hideAddressBook, 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, + return exchange.GetContactGeneralSettings(account.AccountName); + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + public static int SetContactGeneralSettings(int itemId, int accountId, string displayName, string emailAddress, + bool hideAddressBook, 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, int useMapiRichTextFormat) - { + { // check account int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); if (accountCheck < 0) return accountCheck; @@ -3243,95 +3253,95 @@ namespace WebsitePanel.EnterpriseServer } } - public static ExchangeContact GetContactMailFlowSettings(int itemId, int accountId) - { - #region Demo Mode - if (IsDemoMode) - { - return GetDemoContactSettings(); - } - #endregion + public static ExchangeContact GetContactMailFlowSettings(int itemId, int accountId) + { + #region Demo Mode + if (IsDemoMode) + { + return GetDemoContactSettings(); + } + #endregion - // place log record + // place log record TaskManager.StartTask("EXCHANGE", "GET_CONTACT_MAILFLOW", itemId); - try - { - // load organization - Organization org = GetOrganization(itemId); - if (org == null) - return null; + try + { + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return null; - // load account - ExchangeAccount account = GetAccount(itemId, accountId); + // load account + ExchangeAccount account = GetAccount(itemId, accountId); - // get mailbox settings + // get mailbox settings int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - - ExchangeContact contact = exchange.GetContactMailFlowSettings(account.AccountName); - contact.DisplayName = account.DisplayName; - return contact; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } - public static int SetContactMailFlowSettings(int itemId, int accountId, - string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; + ExchangeContact contact = exchange.GetContactMailFlowSettings(account.AccountName); + contact.DisplayName = account.DisplayName; + return contact; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } - // place log record + public static int SetContactMailFlowSettings(int itemId, int accountId, + string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; + + // place log record TaskManager.StartTask("EXCHANGE", "UPDATE_CONTACT_MAILFLOW", itemId); - try - { - // load organization - Organization org = GetOrganization(itemId); - if (org == null) - return -1; + try + { + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return -1; - // check package - int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) return packageCheck; + // check package + int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; - // load account - ExchangeAccount account = GetAccount(itemId, accountId); + // load account + ExchangeAccount account = GetAccount(itemId, accountId); - // get mailbox settings + // get mailbox settings int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - - exchange.SetContactMailFlowSettings(account.AccountName, - acceptAccounts, - rejectAccounts, - requireSenderAuthentication); - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } - #endregion + exchange.SetContactMailFlowSettings(account.AccountName, + acceptAccounts, + rejectAccounts, + requireSenderAuthentication); - #region Distribution Lists - public static int CreateDistributionList(int itemId, string displayName, string name, string domain, int managerId) - { + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + #endregion + + #region Distribution Lists + public static int CreateDistributionList(int itemId, string displayName, string name, string domain, int managerId) + { // check account int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); if (accountCheck < 0) return accountCheck; @@ -3416,99 +3426,99 @@ namespace WebsitePanel.EnterpriseServer } } - public static int DeleteDistributionList(int itemId, int accountId) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; + public static int DeleteDistributionList(int itemId, int accountId) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; - // place log record + // place log record TaskManager.StartTask("EXCHANGE", "DELETE_DISTR_LIST", itemId); - try - { - // load organization - Organization org = GetOrganization(itemId); - if (org == null) - return -1; + try + { + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return -1; - // load account - ExchangeAccount account = GetAccount(itemId, accountId); + // load account + ExchangeAccount account = GetAccount(itemId, accountId); - // delete mailbox + // delete mailbox int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - - exchange.DeleteDistributionList(account.AccountName); - // unregister account - DeleteAccount(itemId, accountId); + exchange.DeleteDistributionList(account.AccountName); - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + // unregister account + DeleteAccount(itemId, accountId); - private static ExchangeDistributionList GetDemoDistributionListSettings() - { - ExchangeDistributionList c = new ExchangeDistributionList(); - c.DisplayName = "Fabrikam Sales"; - c.AccountName = "sales_fabrikam"; - c.ManagerAccount = GetAccounts(0, ExchangeAccountType.Mailbox)[0]; - c.MembersAccounts = GetAccounts(0, ExchangeAccountType.Mailbox).ToArray(); - c.AcceptAccounts = GetAccounts(0, ExchangeAccountType.Mailbox).ToArray(); - return c; - } + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } - public static ExchangeDistributionList GetDistributionListGeneralSettings(int itemId, int accountId) - { - #region Demo Mode - if (IsDemoMode) - { - return GetDemoDistributionListSettings(); - } - #endregion + private static ExchangeDistributionList GetDemoDistributionListSettings() + { + ExchangeDistributionList c = new ExchangeDistributionList(); + c.DisplayName = "Fabrikam Sales"; + c.AccountName = "sales_fabrikam"; + c.ManagerAccount = GetAccounts(0, ExchangeAccountType.Mailbox)[0]; + c.MembersAccounts = GetAccounts(0, ExchangeAccountType.Mailbox).ToArray(); + c.AcceptAccounts = GetAccounts(0, ExchangeAccountType.Mailbox).ToArray(); + return c; + } - // place log record + public static ExchangeDistributionList GetDistributionListGeneralSettings(int itemId, int accountId) + { + #region Demo Mode + if (IsDemoMode) + { + return GetDemoDistributionListSettings(); + } + #endregion + + // place log record TaskManager.StartTask("EXCHANGE", "GET_DISTR_LIST_GENERAL", itemId); - try - { - // load organization - Organization org = GetOrganization(itemId); - if (org == null) - return null; + try + { + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return null; - // load account - ExchangeAccount account = GetAccount(itemId, accountId); + // load account + ExchangeAccount account = GetAccount(itemId, accountId); - // get mailbox settings + // get mailbox settings int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - - return exchange.GetDistributionListGeneralSettings(account.AccountName); - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } - public static int SetDistributionListGeneralSettings(int itemId, int accountId, string displayName, - bool hideAddressBook, string managerAccount, string[] memberAccounts, - string notes) - { + return exchange.GetDistributionListGeneralSettings(account.AccountName); + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + public static int SetDistributionListGeneralSettings(int itemId, int accountId, string displayName, + bool hideAddressBook, string managerAccount, string[] memberAccounts, + string notes) + { // check account int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); if (accountCheck < 0) return accountCheck; @@ -3566,49 +3576,49 @@ namespace WebsitePanel.EnterpriseServer } } - public static ExchangeDistributionList GetDistributionListMailFlowSettings(int itemId, int accountId) - { - #region Demo Mode - if (IsDemoMode) - { - return GetDemoDistributionListSettings(); - } - #endregion + public static ExchangeDistributionList GetDistributionListMailFlowSettings(int itemId, int accountId) + { + #region Demo Mode + if (IsDemoMode) + { + return GetDemoDistributionListSettings(); + } + #endregion - // place log record + // place log record TaskManager.StartTask("EXCHANGE", "GET_DISTR_LIST_MAILFLOW", itemId); - try - { - // load organization - Organization org = GetOrganization(itemId); - if (org == null) - return null; + try + { + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return null; - // load account - ExchangeAccount account = GetAccount(itemId, accountId); + // load account + ExchangeAccount account = GetAccount(itemId, accountId); - // get mailbox settings + // get mailbox settings int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - - ExchangeDistributionList list = exchange.GetDistributionListMailFlowSettings(account.AccountName); - list.DisplayName = account.DisplayName; - return list; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } - public static int SetDistributionListMailFlowSettings(int itemId, int accountId, - string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) - { + ExchangeDistributionList list = exchange.GetDistributionListMailFlowSettings(account.AccountName); + list.DisplayName = account.DisplayName; + return list; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + public static int SetDistributionListMailFlowSettings(int itemId, int accountId, + string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) + { // check account int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); if (accountCheck < 0) return accountCheck; @@ -3657,27 +3667,27 @@ namespace WebsitePanel.EnterpriseServer } } - public static ExchangeEmailAddress[] GetDistributionListEmailAddresses(int itemId, int accountId) - { - // place log record + public static ExchangeEmailAddress[] GetDistributionListEmailAddresses(int itemId, int accountId) + { + // place log record TaskManager.StartTask("EXCHANGE", "GET_DISTR_LIST_ADDRESSES", itemId); - try - { - return GetAccountEmailAddresses(itemId, accountId); - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + try + { + return GetAccountEmailAddresses(itemId, accountId); + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } - public static int AddDistributionListEmailAddress(int itemId, int accountId, string emailAddress) - { + public static int AddDistributionListEmailAddress(int itemId, int accountId, string emailAddress) + { // check account int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); if (accountCheck < 0) return accountCheck; @@ -3730,8 +3740,8 @@ namespace WebsitePanel.EnterpriseServer } } - public static int SetDistributionListPrimaryEmailAddress(int itemId, int accountId, string emailAddress) - { + public static int SetDistributionListPrimaryEmailAddress(int itemId, int accountId, string emailAddress) + { // check account int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); if (accountCheck < 0) return accountCheck; @@ -3782,8 +3792,8 @@ namespace WebsitePanel.EnterpriseServer } } - public static int DeleteDistributionListEmailAddresses(int itemId, int accountId, string[] emailAddresses) - { + public static int DeleteDistributionListEmailAddresses(int itemId, int accountId, string[] emailAddresses) + { // check account int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); if (accountCheck < 0) return accountCheck; @@ -3847,7 +3857,7 @@ namespace WebsitePanel.EnterpriseServer if (org == null) throw new ApplicationException("Organization is null"); } - catch(Exception ex) + catch (Exception ex) { TaskManager.CompleteResultTask(res, ErrorCodes.CANNOT_GET_ORGANIZATION_BY_ITEM_ID, ex); return res; @@ -3860,7 +3870,7 @@ namespace WebsitePanel.EnterpriseServer int exchangeServiceId = GetExchangeServiceID(org.PackageId); exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); } - catch(Exception ex) + catch (Exception ex) { TaskManager.CompleteResultTask(res, ErrorCodes.CANNOT_GET_ORGANIZATION_PROXY, ex); return res; @@ -3872,7 +3882,7 @@ namespace WebsitePanel.EnterpriseServer { account = GetAccount(itemId, accountId); } - catch(Exception ex) + catch (Exception ex) { TaskManager.CompleteResultTask(res, ErrorCodes.CANNOT_GET_ACCOUNT, ex); return res; @@ -3887,7 +3897,7 @@ namespace WebsitePanel.EnterpriseServer exchange.SetDistributionListPermissions(org.OrganizationId, account.AccountName, sendAsAccounts, sendOnBehalfAccounts, addressLists.ToArray()); } - catch(Exception ex) + catch (Exception ex) { TaskManager.CompleteResultTask(res, ErrorCodes.CANNOT_SET_DISTRIBUTION_LIST_PERMISSIONS, ex); return res; @@ -3897,20 +3907,20 @@ namespace WebsitePanel.EnterpriseServer return res; } - public static ExchangeDistributionListResult GetDistributionListPermissions(int itemId, int accountId) + public static ExchangeDistributionListResult GetDistributionListPermissions(int itemId, int accountId) { Organization org; ExchangeDistributionListResult res = TaskManager.StartResultTask("EXCHANGE", "GET_DISTRIBUTION_LIST_RESULT"); - + try { org = GetOrganization(itemId); if (org == null) throw new ApplicationException("Organization is null"); } - catch(Exception ex) + catch (Exception ex) { - TaskManager.CompleteResultTask(res, ErrorCodes.CANNOT_GET_ORGANIZATION_BY_ITEM_ID, ex); + TaskManager.CompleteResultTask(res, ErrorCodes.CANNOT_GET_ORGANIZATION_BY_ITEM_ID, ex); return res; } @@ -3920,18 +3930,18 @@ namespace WebsitePanel.EnterpriseServer int exchangeServiceId = GetExchangeServiceID(org.PackageId); exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); } - catch(Exception ex) + catch (Exception ex) { TaskManager.CompleteResultTask(res, ErrorCodes.CANNOT_GET_ORGANIZATION_PROXY, ex); return res; } - + ExchangeAccount account; try { account = GetAccount(itemId, accountId); } - catch(Exception ex) + catch (Exception ex) { TaskManager.CompleteResultTask(res, ErrorCodes.CANNOT_GET_ACCOUNT, ex); return res; @@ -3942,12 +3952,12 @@ namespace WebsitePanel.EnterpriseServer res.Value = exchange.GetDistributionListPermissions(org.OrganizationId, account.AccountName); res.Value.DisplayName = account.DisplayName; } - catch(Exception ex) + catch (Exception ex) { TaskManager.CompleteResultTask(res, ErrorCodes.CANNOT_GET_DISTRIBUTION_LIST_PERMISSIONS, ex); return res; } - + TaskManager.CompleteTask(); return res; } @@ -4113,65 +4123,65 @@ namespace WebsitePanel.EnterpriseServer } return 0; - } + } - #endregion + #endregion - #region Public Folders - public static int CreatePublicFolder(int itemId, string parentFolder, string folderName, - bool mailEnabled, string name, string domain) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; + #region Public Folders + public static int CreatePublicFolder(int itemId, string parentFolder, string folderName, + bool mailEnabled, string name, string domain) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; - // check mailbox quota - OrganizationStatistics orgStats = GetOrganizationStatistics(itemId); - if (orgStats.AllocatedPublicFolders > -1 - && orgStats.CreatedPublicFolders >= orgStats.AllocatedPublicFolders) - return BusinessErrorCodes.ERROR_EXCHANGE_PFOLDERS_QUOTA_LIMIT; + // check mailbox quota + OrganizationStatistics orgStats = GetOrganizationStatistics(itemId); + if (orgStats.AllocatedPublicFolders > -1 + && orgStats.CreatedPublicFolders >= orgStats.AllocatedPublicFolders) + return BusinessErrorCodes.ERROR_EXCHANGE_PFOLDERS_QUOTA_LIMIT; - // place log record + // place log record TaskManager.StartTask("EXCHANGE", "CREATE_PUBLIC_FOLDER", itemId); - try - { - // e-mail - string email = ""; - if (mailEnabled && !String.IsNullOrEmpty(name)) - { - email = name + "@" + domain; + try + { + // e-mail + string email = ""; + if (mailEnabled && !String.IsNullOrEmpty(name)) + { + email = name + "@" + domain; - // check e-mail - if (EmailAddressExists(email)) - return BusinessErrorCodes.ERROR_EXCHANGE_EMAIL_EXISTS; - } + // check e-mail + if (EmailAddressExists(email)) + return BusinessErrorCodes.ERROR_EXCHANGE_EMAIL_EXISTS; + } - // full folder name - string normParent = parentFolder; - if (!normParent.StartsWith("\\")) - normParent = "\\" + normParent; - if (!normParent.EndsWith("\\")) - normParent = normParent + "\\"; + // full folder name + string normParent = parentFolder; + if (!normParent.StartsWith("\\")) + normParent = "\\" + normParent; + if (!normParent.EndsWith("\\")) + normParent = normParent + "\\"; - string folderPath = normParent + folderName; + string folderPath = normParent + folderName; - // load organization - Organization org = GetOrganization(itemId); - if (org == null) - return -1; + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return -1; - // check package - int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) return packageCheck; + // check package + int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; - if (String.IsNullOrEmpty(name)) - name = Utils.CleanIdentifier(folderName); + if (String.IsNullOrEmpty(name)) + name = Utils.CleanIdentifier(folderName); - string accountName = BuildAccountName(org.OrganizationId, name); + string accountName = BuildAccountName(org.OrganizationId, name); - // add mailbox + // add mailbox int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); @@ -4183,195 +4193,195 @@ namespace WebsitePanel.EnterpriseServer PackageController.UpdatePackageItem(org); } - exchange.CreatePublicFolder(org.DistinguishedName, - org.OrganizationId, - org.SecurityGroup, - parentFolder, - folderName, - mailEnabled, - accountName, - name, - domain); + exchange.CreatePublicFolder(org.DistinguishedName, + org.OrganizationId, + org.SecurityGroup, + parentFolder, + folderName, + mailEnabled, + accountName, + name, + domain); ExchangePublicFolder folder = exchange.GetPublicFolderGeneralSettings(org.OrganizationId, parentFolder + "\\" + folderName); - // add meta-item - int accountId = AddAccount(itemId, ExchangeAccountType.PublicFolder, accountName, - folderPath, email, mailEnabled, - 0, folder.NETBIOS+"\\"+accountName, null, 0, null); + // add meta-item + int accountId = AddAccount(itemId, ExchangeAccountType.PublicFolder, accountName, + folderPath, email, mailEnabled, + 0, folder.NETBIOS + "\\" + accountName, null, 0, null); - // register email address - if(mailEnabled) - AddAccountEmailAddress(accountId, email); + // register email address + if (mailEnabled) + AddAccountEmailAddress(accountId, email); - return accountId; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + return accountId; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } - public static int DeletePublicFolders(int itemId, int[] accountIds) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; + public static int DeletePublicFolders(int itemId, int[] accountIds) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; - if (accountIds != null) - foreach (int accountId in accountIds) - { - int result = DeletePublicFolder(itemId, accountId); - if (result < 0) - return result; - } - return 0; - } + if (accountIds != null) + foreach (int accountId in accountIds) + { + int result = DeletePublicFolder(itemId, accountId); + if (result < 0) + return result; + } + return 0; + } - public static int DeletePublicFolder(int itemId, int accountId) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; + public static int DeletePublicFolder(int itemId, int accountId) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; - // place log record + // place log record TaskManager.StartTask("EXCHANGE", "DELETE_PUBLIC_FOLDER", itemId); - try - { - // load organization - Organization org = GetOrganization(itemId); - if (org == null) - return -1; + try + { + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return -1; - // load account - ExchangeAccount account = GetAccount(itemId, accountId); + // load account + ExchangeAccount account = GetAccount(itemId, accountId); - // delete folder + // delete folder int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); exchange.DeletePublicFolder(org.OrganizationId, account.DisplayName); - // unregister account - DeleteAccount(itemId, accountId); + // unregister account + DeleteAccount(itemId, accountId); - // delete all nested folder meta-items - List folders = GetAccounts(itemId, ExchangeAccountType.PublicFolder); - foreach (ExchangeAccount folder in folders) - { - if (folder.DisplayName.ToLower().StartsWith(account.DisplayName.ToLower() + "\\")) - DeleteAccount(itemId, folder.AccountId); - } + // delete all nested folder meta-items + List folders = GetAccounts(itemId, ExchangeAccountType.PublicFolder); + foreach (ExchangeAccount folder in folders) + { + if (folder.DisplayName.ToLower().StartsWith(account.DisplayName.ToLower() + "\\")) + DeleteAccount(itemId, folder.AccountId); + } - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } - public static int EnableMailPublicFolder(int itemId, int accountId, - string name, string domain) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; + public static int EnableMailPublicFolder(int itemId, int accountId, + string name, string domain) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; - // place log record + // place log record TaskManager.StartTask("EXCHANGE", "ENABLE_MAIL_PUBLIC_FOLDER", itemId); - try - { - // load organization - Organization org = GetOrganization(itemId); - if (org == null) - return -1; + try + { + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return -1; - // check package - int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) return packageCheck; + // check package + int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; - // load account - ExchangeAccount account = GetAccount(itemId, accountId); - if (account.MailEnabledPublicFolder) - return 0; + // load account + ExchangeAccount account = GetAccount(itemId, accountId); + if (account.MailEnabledPublicFolder) + return 0; - // check email - string email = name + "@" + domain; + // check email + string email = name + "@" + domain; - // check e-mail - if (EmailAddressExists(email)) - return BusinessErrorCodes.ERROR_EXCHANGE_EMAIL_EXISTS; + // check e-mail + if (EmailAddressExists(email)) + return BusinessErrorCodes.ERROR_EXCHANGE_EMAIL_EXISTS; - string accountName = BuildAccountName(org.OrganizationId, name); + string accountName = BuildAccountName(org.OrganizationId, name); int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - - exchange.EnableMailPublicFolder( - org.OrganizationId, - account.DisplayName, - account.AccountName, - name, - domain); - // update and save account - account.AccountName = accountName; - account.MailEnabledPublicFolder = true; - account.PrimaryEmailAddress = email; + exchange.EnableMailPublicFolder( + org.OrganizationId, + account.DisplayName, + account.AccountName, + name, + domain); + + // update and save account + account.AccountName = accountName; + account.MailEnabledPublicFolder = true; + account.PrimaryEmailAddress = email; account.AccountPassword = null; - UpdateAccount(account); + UpdateAccount(account); - // register e-mail - AddAccountEmailAddress(accountId, email); + // register e-mail + AddAccountEmailAddress(accountId, email); - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } - public static int DisableMailPublicFolder(int itemId, int accountId) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; + public static int DisableMailPublicFolder(int itemId, int accountId) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; - // place log record + // place log record TaskManager.StartTask("EXCHANGE", "DISABLE_MAIL_PUBLIC_FOLDER", itemId); - try - { - // load organization - Organization org = GetOrganization(itemId); - if (org == null) - return -1; + try + { + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return -1; - // check package - int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) return packageCheck; + // check package + int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; - // load account - ExchangeAccount account = GetAccount(itemId, accountId); - if (!account.MailEnabledPublicFolder) - return 0; + // load account + ExchangeAccount account = GetAccount(itemId, accountId); + if (!account.MailEnabledPublicFolder) + return 0; int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); @@ -4379,416 +4389,416 @@ namespace WebsitePanel.EnterpriseServer exchange.DisableMailPublicFolder(org.OrganizationId, account.DisplayName); - // update and save account - account.MailEnabledPublicFolder = false; - account.PrimaryEmailAddress = ""; + // update and save account + account.MailEnabledPublicFolder = false; + account.PrimaryEmailAddress = ""; account.AccountPassword = null; - UpdateAccount(account); + UpdateAccount(account); - // delete all mail accounts - List addrs = new List(); - ExchangeEmailAddress[] emails = GetAccountEmailAddresses(itemId, accountId); - foreach (ExchangeEmailAddress email in emails) - addrs.Add(email.EmailAddress); + // delete all mail accounts + List addrs = new List(); + ExchangeEmailAddress[] emails = GetAccountEmailAddresses(itemId, accountId); + foreach (ExchangeEmailAddress email in emails) + addrs.Add(email.EmailAddress); - DeleteAccountEmailAddresses(accountId, addrs.ToArray()); + DeleteAccountEmailAddresses(accountId, addrs.ToArray()); - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } - private static ExchangePublicFolder GetDemoPublicFolderSettings() - { - ExchangePublicFolder c = new ExchangePublicFolder(); - c.DisplayName = "\\fabrikam\\Documents"; - c.MailEnabled = true; - c.Name = "Documents"; - c.Accounts = GetAccounts(0, ExchangeAccountType.Mailbox).ToArray(); - c.AcceptAccounts = GetAccounts(0, ExchangeAccountType.Mailbox).ToArray(); - return c; - } + private static ExchangePublicFolder GetDemoPublicFolderSettings() + { + ExchangePublicFolder c = new ExchangePublicFolder(); + c.DisplayName = "\\fabrikam\\Documents"; + c.MailEnabled = true; + c.Name = "Documents"; + c.Accounts = GetAccounts(0, ExchangeAccountType.Mailbox).ToArray(); + c.AcceptAccounts = GetAccounts(0, ExchangeAccountType.Mailbox).ToArray(); + return c; + } - public static ExchangePublicFolder GetPublicFolderGeneralSettings(int itemId, int accountId) - { - #region Demo Mode - if (IsDemoMode) - { - return GetDemoPublicFolderSettings(); - } - #endregion + public static ExchangePublicFolder GetPublicFolderGeneralSettings(int itemId, int accountId) + { + #region Demo Mode + if (IsDemoMode) + { + return GetDemoPublicFolderSettings(); + } + #endregion - // place log record + // place log record TaskManager.StartTask("EXCHANGE", "GET_PUBLIC_FOLDER_GENERAL", itemId); - try - { - // load organization - Organization org = GetOrganization(itemId); - if (org == null) - return null; + try + { + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return null; - // load account - ExchangeAccount account = GetAccount(itemId, accountId); + // load account + ExchangeAccount account = GetAccount(itemId, accountId); int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); ExchangePublicFolder folder = exchange.GetPublicFolderGeneralSettings(org.OrganizationId, account.DisplayName); - folder.MailEnabled = account.MailEnabledPublicFolder; - folder.DisplayName = account.DisplayName; - return folder; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + folder.MailEnabled = account.MailEnabledPublicFolder; + folder.DisplayName = account.DisplayName; + return folder; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } - public static int SetPublicFolderGeneralSettings(int itemId, int accountId, string newName, - bool hideAddressBook, ExchangeAccount[] accounts) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; + public static int SetPublicFolderGeneralSettings(int itemId, int accountId, string newName, + bool hideAddressBook, ExchangeAccount[] accounts) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; - // place log record + // place log record TaskManager.StartTask("EXCHANGE", "UPDATE_PUBLIC_FOLDER_GENERAL", itemId); - try - { - // load organization - Organization org = GetOrganization(itemId); - if (org == null) - return -1; + try + { + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return -1; - // check package - int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) return packageCheck; + // check package + int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; - // load account - ExchangeAccount account = GetAccount(itemId, accountId); + // load account + ExchangeAccount account = GetAccount(itemId, accountId); - // get mailbox settings + // get mailbox settings int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - - exchange.SetPublicFolderGeneralSettings( + + exchange.SetPublicFolderGeneralSettings( org.OrganizationId, - account.DisplayName, - newName, - hideAddressBook, + account.DisplayName, + newName, + hideAddressBook, accounts ); - // update folder name - string origName = account.DisplayName; - string newFullName = origName.Substring(0, origName.LastIndexOf("\\") + 1) + newName; + // update folder name + string origName = account.DisplayName; + string newFullName = origName.Substring(0, origName.LastIndexOf("\\") + 1) + newName; - if (String.Compare(origName, newFullName, true) != 0) - { - // rename original folder - account.DisplayName = newFullName; + if (String.Compare(origName, newFullName, true) != 0) + { + // rename original folder + account.DisplayName = newFullName; account.AccountPassword = null; - UpdateAccount(account); + UpdateAccount(account); - // rename nested folders - List folders = GetAccounts(itemId, ExchangeAccountType.PublicFolder); - foreach (ExchangeAccount folder in folders) - { - if (folder.DisplayName.ToLower().StartsWith(origName.ToLower() + "\\")) - { - folder.DisplayName = newFullName + folder.DisplayName.Substring(origName.Length); - UpdateAccount(folder); - } - } - } + // rename nested folders + List folders = GetAccounts(itemId, ExchangeAccountType.PublicFolder); + foreach (ExchangeAccount folder in folders) + { + if (folder.DisplayName.ToLower().StartsWith(origName.ToLower() + "\\")) + { + folder.DisplayName = newFullName + folder.DisplayName.Substring(origName.Length); + UpdateAccount(folder); + } + } + } - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } - public static ExchangePublicFolder GetPublicFolderMailFlowSettings(int itemId, int accountId) - { - #region Demo Mode - if (IsDemoMode) - { - return GetDemoPublicFolderSettings(); - } - #endregion + public static ExchangePublicFolder GetPublicFolderMailFlowSettings(int itemId, int accountId) + { + #region Demo Mode + if (IsDemoMode) + { + return GetDemoPublicFolderSettings(); + } + #endregion - // place log record + // place log record TaskManager.StartTask("EXCHANGE", "GET_PUBLIC_FOLDER_MAILFLOW", itemId); - try - { - // load organization - Organization org = GetOrganization(itemId); - if (org == null) - return null; + try + { + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return null; - // load account - ExchangeAccount account = GetAccount(itemId, accountId); + // load account + ExchangeAccount account = GetAccount(itemId, accountId); - // get mailbox settings + // get mailbox settings int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); ExchangePublicFolder folder = exchange.GetPublicFolderMailFlowSettings(org.OrganizationId, account.DisplayName); - folder.DisplayName = account.DisplayName; - return folder; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + folder.DisplayName = account.DisplayName; + return folder; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } - public static int SetPublicFolderMailFlowSettings(int itemId, int accountId, - string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; + public static int SetPublicFolderMailFlowSettings(int itemId, int accountId, + string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; - // place log record + // place log record TaskManager.StartTask("EXCHANGE", "UPDATE_PUBLIC_FOLDER_MAILFLOW", itemId); - try - { - // load organization - Organization org = GetOrganization(itemId); - if (org == null) - return -1; + try + { + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return -1; - // check package - int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) return packageCheck; + // check package + int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; - // load account - ExchangeAccount account = GetAccount(itemId, accountId); + // load account + ExchangeAccount account = GetAccount(itemId, accountId); - // get mailbox settings + // get mailbox settings int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); exchange.SetPublicFolderMailFlowSettings(org.OrganizationId, account.DisplayName, - acceptAccounts, - rejectAccounts, - requireSenderAuthentication); + acceptAccounts, + rejectAccounts, + requireSenderAuthentication); - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } - public static ExchangeEmailAddress[] GetPublicFolderEmailAddresses(int itemId, int accountId) - { - // place log record + public static ExchangeEmailAddress[] GetPublicFolderEmailAddresses(int itemId, int accountId) + { + // place log record TaskManager.StartTask("EXCHANGE", "GET_PUBLIC_FOLDER_ADDRESSES", itemId); - try - { - return GetAccountEmailAddresses(itemId, accountId); - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + try + { + return GetAccountEmailAddresses(itemId, accountId); + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } - public static int AddPublicFolderEmailAddress(int itemId, int accountId, string emailAddress) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; + public static int AddPublicFolderEmailAddress(int itemId, int accountId, string emailAddress) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; - // place log record + // place log record TaskManager.StartTask("EXCHANGE", "ADD_PUBLIC_FOLDER_ADDRESS", itemId); - try - { - // check - if (EmailAddressExists(emailAddress)) - return BusinessErrorCodes.ERROR_EXCHANGE_EMAIL_EXISTS; + try + { + // check + if (EmailAddressExists(emailAddress)) + return BusinessErrorCodes.ERROR_EXCHANGE_EMAIL_EXISTS; - // load organization - Organization org = GetOrganization(itemId); - if (org == null) - return -1; + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return -1; - // check package - int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) return packageCheck; + // check package + int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; - // load account - ExchangeAccount account = GetAccount(itemId, accountId); + // load account + ExchangeAccount account = GetAccount(itemId, accountId); - // add e-mail - AddAccountEmailAddress(accountId, emailAddress); + // add e-mail + AddAccountEmailAddress(accountId, emailAddress); - // update e-mail addresses + // update e-mail addresses int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - - exchange.SetPublicFolderEmailAddresses( + + exchange.SetPublicFolderEmailAddresses( org.OrganizationId, - account.DisplayName, - GetAccountSimpleEmailAddresses(itemId, accountId)); + account.DisplayName, + GetAccountSimpleEmailAddresses(itemId, accountId)); - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } - public static int SetPublicFolderPrimaryEmailAddress(int itemId, int accountId, string emailAddress) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; + public static int SetPublicFolderPrimaryEmailAddress(int itemId, int accountId, string emailAddress) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; - // place log record + // place log record TaskManager.StartTask("EXCHANGE", "SET_PRIMARY_PUBLIC_FOLDER_ADDRESS", itemId); - try - { - // get account - ExchangeAccount account = GetAccount(itemId, accountId); - account.PrimaryEmailAddress = emailAddress; + try + { + // get account + ExchangeAccount account = GetAccount(itemId, accountId); + account.PrimaryEmailAddress = emailAddress; - // update exchange - Organization org = GetOrganization(itemId); - if (org == null) - return -1; + // update exchange + Organization org = GetOrganization(itemId); + if (org == null) + return -1; - // check package - int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) return packageCheck; + // check package + int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - - exchange.SetPublicFolderPrimaryEmailAddress( + + exchange.SetPublicFolderPrimaryEmailAddress( org.OrganizationId, - account.DisplayName, - emailAddress); + account.DisplayName, + emailAddress); - // save account + // save account account.AccountPassword = null; - UpdateAccount(account); + UpdateAccount(account); - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } - public static int DeletePublicFolderEmailAddresses(int itemId, int accountId, string[] emailAddresses) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; + public static int DeletePublicFolderEmailAddresses(int itemId, int accountId, string[] emailAddresses) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; - // place log record + // place log record TaskManager.StartTask("EXCHANGE", "DELETE_PUBLIC_FOLDER_ADDRESSES", itemId); - try - { - // get account - ExchangeAccount account = GetAccount(itemId, accountId); + try + { + // get account + ExchangeAccount account = GetAccount(itemId, accountId); - // delete e-mail addresses - List toDelete = new List(); - foreach (string emailAddress in emailAddresses) - { - if (String.Compare(account.PrimaryEmailAddress, emailAddress, true) != 0) - toDelete.Add(emailAddress); - } + // delete e-mail addresses + List toDelete = new List(); + foreach (string emailAddress in emailAddresses) + { + if (String.Compare(account.PrimaryEmailAddress, emailAddress, true) != 0) + toDelete.Add(emailAddress); + } - // delete from meta-base - DeleteAccountEmailAddresses(accountId, toDelete.ToArray()); + // delete from meta-base + DeleteAccountEmailAddresses(accountId, toDelete.ToArray()); - // delete from Exchange - Organization org = GetOrganization(itemId); - if (org == null) - return -1; + // delete from Exchange + Organization org = GetOrganization(itemId); + if (org == null) + return -1; - // update e-mail addresses + // update e-mail addresses int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - - exchange.SetPublicFolderEmailAddresses( + + exchange.SetPublicFolderEmailAddresses( org.OrganizationId, - account.DisplayName, - GetAccountSimpleEmailAddresses(itemId, accountId)); + account.DisplayName, + GetAccountSimpleEmailAddresses(itemId, accountId)); - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } - #endregion + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + #endregion - #region Private Helpers + #region Private Helpers private static string GetPrimaryDomainController(int organizationServiceId) { - + Organizations orgProxy = new Organizations(); ServiceProviderProxy.Init(orgProxy, organizationServiceId); @@ -4835,35 +4845,35 @@ namespace WebsitePanel.EnterpriseServer { ServiceProvider ws = new ServiceProvider(); - ServiceProviderProxy.Init(ws, exchangeServiceId); + ServiceProviderProxy.Init(ws, exchangeServiceId); string[] exchangeSettings = ws.ServiceProviderSettingsSoapHeaderValue.Settings; List resSettings = new List(exchangeSettings); string orgPrimaryDomainController = GetPrimaryDomainController(organizationServiceId); - + ExtendExchangeSettings(resSettings, orgPrimaryDomainController); ws.ServiceProviderSettingsSoapHeaderValue.Settings = resSettings.ToArray(); return ws; } - - internal static ExchangeServer GetExchangeServer(int exchangeServiceId, int organizationServiceId) - { - ExchangeServer ws = new ExchangeServer(); - - ServiceProviderProxy.Init(ws, exchangeServiceId); - string []exchangeSettings = ws.ServiceProviderSettingsSoapHeaderValue.Settings; + internal static ExchangeServer GetExchangeServer(int exchangeServiceId, int organizationServiceId) + { + ExchangeServer ws = new ExchangeServer(); + + ServiceProviderProxy.Init(ws, exchangeServiceId); + + string[] exchangeSettings = ws.ServiceProviderSettingsSoapHeaderValue.Settings; List resSettings = new List(exchangeSettings); string orgPrimaryDomainController = GetPrimaryDomainController(organizationServiceId); - + ExtendExchangeSettings(resSettings, orgPrimaryDomainController); ws.ServiceProviderSettingsSoapHeaderValue.Settings = resSettings.ToArray(); return ws; - } + } internal static ServiceProvider GetExchangeServiceProvider(int exchangeServiceId, int organizationServiceId) { @@ -4880,40 +4890,40 @@ namespace WebsitePanel.EnterpriseServer ExtendExchangeSettings(resSettings, orgPrimaryDomainController); ws.ServiceProviderSettingsSoapHeaderValue.Settings = resSettings.ToArray(); return ws; - } + } - private static int GetExchangeServiceID(int packageId) - { - return PackageController.GetPackageServiceId(packageId, ResourceGroups.Exchange); - } + private static int GetExchangeServiceID(int packageId) + { + return PackageController.GetPackageServiceId(packageId, ResourceGroups.Exchange); + } - private static string[] GetAccountSimpleEmailAddresses(int itemId, int accountId) - { - ExchangeEmailAddress[] emails = GetAccountEmailAddresses(itemId, accountId); - List result = new List(); - foreach (ExchangeEmailAddress email in emails) - { - string prefix = email.IsPrimary ? "SMTP:" : "smtp:"; - result.Add(prefix + email.EmailAddress); - } + private static string[] GetAccountSimpleEmailAddresses(int itemId, int accountId) + { + ExchangeEmailAddress[] emails = GetAccountEmailAddresses(itemId, accountId); + List result = new List(); + foreach (ExchangeEmailAddress email in emails) + { + string prefix = email.IsPrimary ? "SMTP:" : "smtp:"; + result.Add(prefix + email.EmailAddress); + } - return result.ToArray(); - } + return result.ToArray(); + } - private static bool QuotaEnabled(PackageContext cntx, string quotaName) - { - return cntx.Quotas.ContainsKey(quotaName) && !cntx.Quotas[quotaName].QuotaExhausted; - } + private static bool QuotaEnabled(PackageContext cntx, string quotaName) + { + return cntx.Quotas.ContainsKey(quotaName) && !cntx.Quotas[quotaName].QuotaExhausted; + } - private static bool IsDemoMode - { - get - { - return (SecurityContext.CheckAccount(DemandAccount.NotDemo) < 0); - } - } - #endregion + private static bool IsDemoMode + { + get + { + return (SecurityContext.CheckAccount(DemandAccount.NotDemo) < 0); + } + } + #endregion public static ExchangeMobileDevice[] GetMobileDevices(int itemId, int accountId) { diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs index 95d5da6f..d2fb54ce 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs @@ -42,6 +42,7 @@ using WebsitePanel.Providers.SharePoint; using WebsitePanel.Providers.Common; using WebsitePanel.Providers.DNS; using WebsitePanel.Providers.OCS; +using System.Linq; using System.IO; using System.Xml; @@ -57,14 +58,14 @@ namespace WebsitePanel.EnterpriseServer { errorCode = 0; OrganizationStatistics stats = GetOrganizationStatistics(orgId); - - - if (stats.AllocatedUsers != -1 && (stats.CreatedUsers >= stats.AllocatedUsers) ) + + + if (stats.AllocatedUsers != -1 && (stats.CreatedUsers >= stats.AllocatedUsers)) { errorCode = BusinessErrorCodes.ERROR_USERS_RESOURCE_QUOTA_LIMIT; return false; } - + return true; } @@ -80,14 +81,14 @@ namespace WebsitePanel.EnterpriseServer // add organization items["Organization"] = org; OrganizationUser user = GetAccount(itemId, accountId); - + items["account"] = user; - + // evaluate template return PackageController.EvaluateTemplate(template, items); } - + public static string GetOrganizationUserSummuryLetter(int itemId, int accountId, bool pmm, bool emailMode, bool signup) { // load organization @@ -109,7 +110,7 @@ namespace WebsitePanel.EnterpriseServer string result = EvaluateMailboxTemplate(itemId, accountId, pmm, false, false, body); return user.HtmlMail ? result : result.Replace("\n", "
"); } - + public static int SendSummaryLetter(int itemId, int accountId, bool signup, string to, string cc) { // check account @@ -151,10 +152,10 @@ namespace WebsitePanel.EnterpriseServer // send message return MailHelper.SendMessage(from, to, cc, subject, body, priority, isHtml); } - + private static bool CheckQuotas(int packageId, out int errorCode) { - + // check account errorCode = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); if (errorCode < 0) return false; @@ -164,7 +165,7 @@ namespace WebsitePanel.EnterpriseServer if (errorCode < 0) return false; // check organizations quota - QuotaValueInfo quota = PackageController.GetPackageQuota(packageId, Quotas.ORGANIZATIONS ); + QuotaValueInfo quota = PackageController.GetPackageQuota(packageId, Quotas.ORGANIZATIONS); if (quota.QuotaExhausted) { errorCode = BusinessErrorCodes.ERROR_ORGS_RESOURCE_QUOTA_LIMIT; @@ -179,32 +180,32 @@ namespace WebsitePanel.EnterpriseServer errorCode = BusinessErrorCodes.ERROR_SUBDOMAIN_QUOTA_LIMIT; return false; } - - - return true; + + + return true; } private static string CreateTemporyDomainName(int serviceId, string organizationId) { // load service settings StringDictionary serviceSettings = ServerController.GetServiceSettings(serviceId); - + string tempDomain = serviceSettings[TemporyDomainName]; - return String.IsNullOrEmpty(tempDomain) ? null : organizationId + "."+ tempDomain; + return String.IsNullOrEmpty(tempDomain) ? null : organizationId + "." + tempDomain; } - + private static DomainInfo CreateNewDomain(int packageId, string domainName) - { + { // new domain DomainInfo domain = new DomainInfo(); domain.PackageId = packageId; domain.DomainName = domainName; domain.IsInstantAlias = true; domain.IsSubDomain = true; - + return domain; } - + private static int CreateDomain(string domainName, int packageId, out bool domainCreated) { // trying to locate (register) temp domain @@ -250,18 +251,18 @@ namespace WebsitePanel.EnterpriseServer return domainId; } - + private static int AddOrganizationToPackageItems(Organization org, int serviceId, int packageId, string organizationName, string organizationId, string domainName) - { + { org.ServiceId = serviceId; org.PackageId = packageId; org.Name = organizationName; org.OrganizationId = organizationId; org.DefaultDomain = domainName; - + int itemId = PackageController.AddPackageItem(org); - - + + return itemId; } @@ -270,26 +271,26 @@ namespace WebsitePanel.EnterpriseServer return DataProvider.ExchangeOrganizationExists(organizationId); } - private static void RollbackOrganization(int packageId, string organizationId) - { - try - { - int serviceId = PackageController.GetPackageServiceId(packageId, ResourceGroups.HostedOrganizations); - Organizations orgProxy = GetOrganizationProxy(serviceId); - orgProxy.DeleteOrganization(organizationId); - } - catch (Exception ex) - { - TaskManager.WriteError(ex); - } - } - public static int CreateOrganization(int packageId, string organizationId, string organizationName, string domainName) + private static void RollbackOrganization(int packageId, string organizationId) + { + try + { + int serviceId = PackageController.GetPackageServiceId(packageId, ResourceGroups.HostedOrganizations); + Organizations orgProxy = GetOrganizationProxy(serviceId); + orgProxy.DeleteOrganization(organizationId); + } + catch (Exception ex) + { + TaskManager.WriteError(ex); + } + } + public static int CreateOrganization(int packageId, string organizationId, string organizationName, string domainName) { int itemId; int errorCode; if (!CheckQuotas(packageId, out errorCode)) return errorCode; - + // place log record List parameters = new List(); parameters.Add(new BackgroundTaskParameter("Organization ID", organizationId)); @@ -297,49 +298,49 @@ namespace WebsitePanel.EnterpriseServer TaskManager.StartTask("ORGANIZATION", "CREATE_ORG", organizationName, parameters); - try - { - // Check if organization exitsts. - if (OrganizationIdentifierExists(organizationId)) - return BusinessErrorCodes.ERROR_ORG_ID_EXISTS; + try + { + // Check if organization exitsts. + if (OrganizationIdentifierExists(organizationId)) + return BusinessErrorCodes.ERROR_ORG_ID_EXISTS; - // Create Organization Unit - int serviceId = PackageController.GetPackageServiceId(packageId, ResourceGroups.HostedOrganizations); + // Create Organization Unit + int serviceId = PackageController.GetPackageServiceId(packageId, ResourceGroups.HostedOrganizations); - Organizations orgProxy = GetOrganizationProxy(serviceId); - Organization org = null; - if (!orgProxy.OrganizationExists(organizationId)) - { - org = orgProxy.CreateOrganization(organizationId); - } - else - return BusinessErrorCodes.ERROR_ORG_ID_EXISTS; + Organizations orgProxy = GetOrganizationProxy(serviceId); + Organization org = null; + if (!orgProxy.OrganizationExists(organizationId)) + { + org = orgProxy.CreateOrganization(organizationId); + } + else + return BusinessErrorCodes.ERROR_ORG_ID_EXISTS; - //create temporary domain name; + //create temporary domain name; if (string.IsNullOrEmpty(domainName)) { string tmpDomainName = CreateTemporyDomainName(serviceId, organizationId); if (!string.IsNullOrEmpty(tmpDomainName)) domainName = tmpDomainName; } - - if (string.IsNullOrEmpty(domainName)) - { - domainName = organizationName; - //RollbackOrganization(packageId, organizationId); - //return BusinessErrorCodes.ERROR_ORGANIZATION_TEMP_DOMAIN_IS_NOT_SPECIFIED; - } - - bool domainCreated; - int domainId = CreateDomain(domainName, packageId, out domainCreated); - //create domain - if (domainId < 0) - { - RollbackOrganization(packageId, organizationId); - return domainId; - } - + if (string.IsNullOrEmpty(domainName)) + { + domainName = organizationName; + //RollbackOrganization(packageId, organizationId); + //return BusinessErrorCodes.ERROR_ORGANIZATION_TEMP_DOMAIN_IS_NOT_SPECIFIED; + } + + + bool domainCreated; + int domainId = CreateDomain(domainName, packageId, out domainCreated); + //create domain + if (domainId < 0) + { + RollbackOrganization(packageId, organizationId); + return domainId; + } + DomainInfo domain = ServerController.GetDomain(domainId); if (domain != null) { @@ -351,58 +352,63 @@ namespace WebsitePanel.EnterpriseServer } - PackageContext cntx = PackageController.GetPackageContext(packageId); + PackageContext cntx = PackageController.GetPackageContext(packageId); - if (cntx.Quotas[Quotas.HOSTED_SHAREPOINT_STORAGE_SIZE] != null) - org.MaxSharePointStorage = cntx.Quotas[Quotas.HOSTED_SHAREPOINT_STORAGE_SIZE].QuotaAllocatedValue; - + if (cntx.Quotas[Quotas.HOSTED_SHAREPOINT_STORAGE_SIZE] != null) + org.MaxSharePointStorage = cntx.Quotas[Quotas.HOSTED_SHAREPOINT_STORAGE_SIZE].QuotaAllocatedValue; - if (cntx.Quotas[Quotas.HOSTED_SHAREPOINT_STORAGE_SIZE] != null) - org.WarningSharePointStorage = cntx.Quotas[Quotas.HOSTED_SHAREPOINT_STORAGE_SIZE].QuotaAllocatedValue; - - //add organization to package items - itemId = AddOrganizationToPackageItems(org, serviceId, packageId, organizationName, organizationId, domainName); + if (cntx.Quotas[Quotas.HOSTED_SHAREPOINT_STORAGE_SIZE] != null) + org.WarningSharePointStorage = cntx.Quotas[Quotas.HOSTED_SHAREPOINT_STORAGE_SIZE].QuotaAllocatedValue; - // register org ID - DataProvider.AddExchangeOrganization(itemId, organizationId); + //add organization to package items + itemId = AddOrganizationToPackageItems(org, serviceId, packageId, organizationName, organizationId, domainName); - // register domain - DataProvider.AddExchangeOrganizationDomain(itemId, domainId, true); + // register org ID - // register organization domain service item - OrganizationDomain orgDomain = new OrganizationDomain - { - Name = domainName, - PackageId = packageId, - ServiceId = serviceId - }; + DataProvider.AddExchangeOrganization(itemId, organizationId); - PackageController.AddPackageItem(orgDomain); + // register domain + DataProvider.AddExchangeOrganizationDomain(itemId, domainId, true); + + //add to exchangeAcounts + AddAccount(itemId, ExchangeAccountType.DefaultSecurityGroup, org.GroupName, + org.GroupName, null, false, + 0, org.GroupName, null, 0, null); + + // register organization domain service item + OrganizationDomain orgDomain = new OrganizationDomain + { + Name = domainName, + PackageId = packageId, + ServiceId = serviceId + }; + + PackageController.AddPackageItem(orgDomain); - } - catch (Exception ex) - { - //rollback organization - try - { - RollbackOrganization(packageId, organizationId); - } - catch (Exception rollbackException) - { - TaskManager.WriteError(rollbackException); - } + } + catch (Exception ex) + { + //rollback organization + try + { + RollbackOrganization(packageId, organizationId); + } + catch (Exception rollbackException) + { + TaskManager.WriteError(rollbackException); + } - throw TaskManager.WriteError(ex); - } + throw TaskManager.WriteError(ex); + } finally { TaskManager.CompleteTask(); } - + return itemId; } @@ -434,7 +440,7 @@ namespace WebsitePanel.EnterpriseServer return -1; } } - + // unregister domain DataProvider.DeleteExchangeOrganizationDomain(itemId, domainId); @@ -471,52 +477,52 @@ namespace WebsitePanel.EnterpriseServer private static void DeleteOCSUsers(int itemId, ref bool successful) { try - { - OCSUsersPagedResult res = OCSController.GetOCSUsers(itemId, string.Empty, string.Empty, string.Empty, - string.Empty, 0, int.MaxValue); - if (res.IsSuccess) - { - foreach (OCSUser user in res.Value.PageUsers) - { - try - { - ResultObject delUserResult = OCSController.DeleteOCSUser(itemId, user.InstanceId); - if (!delUserResult.IsSuccess) - { - StringBuilder sb = new StringBuilder(); - foreach(string str in delUserResult.ErrorCodes) - { - sb.Append(str); - sb.Append('\n'); - } - - throw new ApplicationException(sb.ToString()); - } - } - catch(Exception ex) - { - successful = false; - TaskManager.WriteError(ex); - } - } - } - else - { - StringBuilder sb = new StringBuilder(); - foreach(string str in res.ErrorCodes) - { - sb.Append(str); - sb.Append('\n'); - } - - throw new ApplicationException(sb.ToString()); - } - } - catch(Exception ex) + { + OCSUsersPagedResult res = OCSController.GetOCSUsers(itemId, string.Empty, string.Empty, string.Empty, + string.Empty, 0, int.MaxValue); + if (res.IsSuccess) { - successful = false; - TaskManager.WriteError(ex); + foreach (OCSUser user in res.Value.PageUsers) + { + try + { + ResultObject delUserResult = OCSController.DeleteOCSUser(itemId, user.InstanceId); + if (!delUserResult.IsSuccess) + { + StringBuilder sb = new StringBuilder(); + foreach (string str in delUserResult.ErrorCodes) + { + sb.Append(str); + sb.Append('\n'); + } + + throw new ApplicationException(sb.ToString()); + } + } + catch (Exception ex) + { + successful = false; + TaskManager.WriteError(ex); + } + } } + else + { + StringBuilder sb = new StringBuilder(); + foreach (string str in res.ErrorCodes) + { + sb.Append(str); + sb.Append('\n'); + } + + throw new ApplicationException(sb.ToString()); + } + } + catch (Exception ex) + { + successful = false; + TaskManager.WriteError(ex); + } } @@ -605,7 +611,7 @@ namespace WebsitePanel.EnterpriseServer if (org.IsOCSOrganization) { - DeleteOCSUsers(itemId, ref successful); + DeleteOCSUsers(itemId, ref successful); } try @@ -617,10 +623,10 @@ namespace WebsitePanel.EnterpriseServer { successful = false; TaskManager.WriteError(ex); - } + } try - { + { OrganizationUsersPagedResult res = BlackBerryController.GetBlackBerryUsers(itemId, string.Empty, string.Empty, string.Empty, string.Empty, 0, int.MaxValue); if (res.IsSuccess) @@ -629,11 +635,11 @@ namespace WebsitePanel.EnterpriseServer { try { - ResultObject delUserResult = BlackBerryController.DeleteBlackBerryUser(itemId, user.AccountId); + ResultObject delUserResult = BlackBerryController.DeleteBlackBerryUser(itemId, user.AccountId); if (!delUserResult.IsSuccess) { - StringBuilder sb = new StringBuilder(); - foreach(string str in delUserResult.ErrorCodes) + StringBuilder sb = new StringBuilder(); + foreach (string str in delUserResult.ErrorCodes) { sb.Append(str); sb.Append('\n'); @@ -642,7 +648,7 @@ namespace WebsitePanel.EnterpriseServer throw new ApplicationException(sb.ToString()); } } - catch(Exception ex) + catch (Exception ex) { successful = false; TaskManager.WriteError(ex); @@ -651,8 +657,8 @@ namespace WebsitePanel.EnterpriseServer } else { - StringBuilder sb = new StringBuilder(); - foreach(string str in res.ErrorCodes) + StringBuilder sb = new StringBuilder(); + foreach (string str in res.ErrorCodes) { sb.Append(str); sb.Append('\n'); @@ -661,7 +667,7 @@ namespace WebsitePanel.EnterpriseServer throw new ApplicationException(sb.ToString()); } } - catch(Exception ex) + catch (Exception ex) { successful = false; TaskManager.WriteError(ex); @@ -693,10 +699,10 @@ namespace WebsitePanel.EnterpriseServer TaskManager.WriteError(ex); } - - - Organizations orgProxy = GetOrganizationProxy(org.ServiceId); - + + + Organizations orgProxy = GetOrganizationProxy(org.ServiceId); + try { orgProxy.DeleteOrganization(org.OrganizationId); @@ -706,8 +712,8 @@ namespace WebsitePanel.EnterpriseServer successful = false; TaskManager.WriteError(ex); } - - + + // delete organization domains List domains = GetOrganizationDomains(itemId); @@ -722,15 +728,15 @@ namespace WebsitePanel.EnterpriseServer successful = false; TaskManager.WriteError(ex); } - + } DataProvider.DeleteOrganizationUser(itemId); - + // delete meta-item PackageController.DeletePackageItem(itemId); - - + + return successful ? 0 : BusinessErrorCodes.ERROR_ORGANIZATION_DELETE_SOME_PROBLEMS; } catch (Exception ex) @@ -743,11 +749,11 @@ namespace WebsitePanel.EnterpriseServer } } - + public static Organizations GetOrganizationProxy(int serviceId) - { + { Organizations ws = new Organizations(); - ServiceProviderProxy.Init(ws, serviceId); + ServiceProviderProxy.Init(ws, serviceId); return ws; } @@ -762,7 +768,7 @@ namespace WebsitePanel.EnterpriseServer public static DataSet GetRawOrganizationsPaged(int packageId, bool recursive, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) - { + { #region Demo Mode if (IsDemoMode) { @@ -784,15 +790,15 @@ namespace WebsitePanel.EnterpriseServer dtItems.Columns.Add("UserID", typeof(int)); dtItems.Rows.Add(1, "fabrikam", "Fabrikam Inc", "Hosted Exchange", 1, "Customer", 1); - + dtItems.Rows.Add(2, "Contoso", "Contoso Ltd", "Hosted Exchange", 2, "Customer", 2); - + return ds; } #endregion - - + + return PackageController.GetRawPackageItemsPaged( packageId, ResourceGroups.HostedOrganizations, typeof(Organization), recursive, filterColumn, filterValue, sortColumn, startRow, maximumRows); @@ -807,9 +813,9 @@ namespace WebsitePanel.EnterpriseServer Organization org = GetOrganization(itemId); - return org; + return org; } - + public static Organization GetOrganization(int itemId) { #region Demo Mode @@ -1023,13 +1029,13 @@ namespace WebsitePanel.EnterpriseServer TaskManager.StartTask("ORGANIZATION", "CHANGE_DOMAIN_TYPE", domainId, itemId); try - { + { // change accepted domain type on Exchange int checkResult = ExchangeServerController.ChangeAcceptedDomainType(itemId, domainId, newDomainType); // change accepted domain type in DB - int domainTypeId= (int) newDomainType; + int domainTypeId = (int)newDomainType; DataProvider.ChangeExchangeAcceptedDomainType(itemId, domainId, domainTypeId); return checkResult; @@ -1055,7 +1061,7 @@ namespace WebsitePanel.EnterpriseServer if (orgStats.AllocatedDomains > -1 && orgStats.CreatedDomains >= orgStats.AllocatedDomains) return BusinessErrorCodes.ERROR_EXCHANGE_DOMAINS_QUOTA_LIMIT; - + // place log record TaskManager.StartTask("ORGANIZATION", "ADD_DOMAIN", domainName, itemId); @@ -1105,13 +1111,13 @@ namespace WebsitePanel.EnterpriseServer int domainId = ServerController.AddDomain(domain); if (domainId < 0) return domainId; - + // add domain domain.DomainId = domainId; } - - + + // register domain DataProvider.AddExchangeOrganizationDomain(itemId, domain.DomainId, false); @@ -1122,7 +1128,7 @@ namespace WebsitePanel.EnterpriseServer exchDomain.ServiceId = org.ServiceId; PackageController.AddPackageItem(exchDomain); - + Organizations orgProxy = GetOrganizationProxy(org.ServiceId); orgProxy.CreateOrganizationDomain(org.DistinguishedName, domainName); if (!string.IsNullOrEmpty(org.GlobalAddressList)) @@ -1181,18 +1187,18 @@ namespace WebsitePanel.EnterpriseServer #region Users - - + + public static OrganizationUsersPaged GetOrganizationUsersPaged(int itemId, string filterColumn, string filterValue, string sortColumn, - int startRow, int maximumRows) + int startRow, int maximumRows) { #region Demo Mode if (IsDemoMode) - { + { OrganizationUsersPaged res = new OrganizationUsersPaged(); List demoAccounts = SearchAccounts(1, "", "", "", true); - + OrganizationUser r1 = new OrganizationUser(); r1.AccountId = 20; r1.AccountName = "room1_fabrikam"; @@ -1200,7 +1206,7 @@ namespace WebsitePanel.EnterpriseServer r1.DisplayName = "Meeting Room 1"; r1.PrimaryEmailAddress = "room1@fabrikam.net"; demoAccounts.Add(r1); - + OrganizationUser e1 = new OrganizationUser(); e1.AccountId = 21; e1.AccountName = "projector_fabrikam"; @@ -1213,14 +1219,14 @@ namespace WebsitePanel.EnterpriseServer return res; } #endregion - + string accountTypes = string.Format("{0}, {1}, {2}, {3}", ((int)ExchangeAccountType.User), ((int)ExchangeAccountType.Mailbox), ((int)ExchangeAccountType.Room), ((int)ExchangeAccountType.Equipment)); - - + + DataSet ds = DataProvider.GetExchangeAccountsPaged(SecurityContext.User.UserId, itemId, accountTypes, filterColumn, filterValue, sortColumn, startRow, maximumRows); - + OrganizationUsersPaged result = new OrganizationUsersPaged(); result.RecordsCount = (int)ds.Tables[0].Rows[0][0]; @@ -1243,10 +1249,10 @@ namespace WebsitePanel.EnterpriseServer } - + private static bool EmailAddressExists(string emailAddress) { - return DataProvider.ExchangeAccountEmailAddressExists(emailAddress); + return DataProvider.ExchangeAccountEmailAddressExists(emailAddress); } @@ -1262,7 +1268,7 @@ namespace WebsitePanel.EnterpriseServer //string []parts = loginName.Split('@'); //return parts != null && parts.Length > 1 ? parts[0] : loginName; return loginName; - + } public static int CreateUser(int itemId, string displayName, string name, string domain, string password, string subscriberNumber, bool enabled, bool sendNotification, string to, out string accountName) @@ -1503,6 +1509,10 @@ namespace WebsitePanel.EnterpriseServer /// The account name with organization Id. private static string BuildAccountNameWithOrgId(string orgId, string name, int serviceId) { + name = ((orgId.Length + name.Length) > 19 && name.Length > 9) ? name.Substring(0, (19 - orgId.Length) < 10 ? 10 : 19 - orgId.Length) : name; + + orgId = (orgId.Length + name.Length) > 19 ? orgId.Substring(0, 19 - name.Length) : orgId; + int maxLen = 19 - orgId.Length; // try to choose name @@ -1530,6 +1540,7 @@ namespace WebsitePanel.EnterpriseServer } } + private static string genSamLogin(string login, string strCounter) { int maxLogin = 20; @@ -1572,7 +1583,7 @@ namespace WebsitePanel.EnterpriseServer try { - Guid crmUserId = CRMController.GetCrmUserId( accountId); + Guid crmUserId = CRMController.GetCrmUserId(accountId); if (crmUserId != Guid.Empty) { return BusinessErrorCodes.CURRENT_USER_IS_CRM_USER; @@ -1581,12 +1592,12 @@ namespace WebsitePanel.EnterpriseServer if (DataProvider.CheckOCSUserExists(accountId)) { - return BusinessErrorCodes.CURRENT_USER_IS_OCS_USER; + return BusinessErrorCodes.CURRENT_USER_IS_OCS_USER; } if (DataProvider.CheckLyncUserExists(accountId)) { - return BusinessErrorCodes.CURRENT_USER_IS_LYNC_USER; + return BusinessErrorCodes.CURRENT_USER_IS_LYNC_USER; } @@ -1597,11 +1608,11 @@ namespace WebsitePanel.EnterpriseServer // load account OrganizationUser user = GetAccount(itemId, accountId); - + Organizations orgProxy = GetOrganizationProxy(org.ServiceId); string account = GetAccountName(user.AccountName); - + if (user.AccountType == ExchangeAccountType.User) { //Delete user from AD @@ -1609,8 +1620,8 @@ namespace WebsitePanel.EnterpriseServer // unregister account DeleteUserFromMetabase(itemId, accountId); } - else - { + else + { //Delete mailbox with AD user ExchangeServerController.DeleteMailbox(itemId, accountId); } @@ -1627,7 +1638,7 @@ namespace WebsitePanel.EnterpriseServer } public static OrganizationUser GetAccount(int itemId, int userId) - { + { OrganizationUser account = ObjectUtils.FillObjectFromDataReader( DataProvider.GetExchangeAccount(itemId, userId)); @@ -1658,7 +1669,7 @@ namespace WebsitePanel.EnterpriseServer if (GetOrganization(itemId) == null) return; - DataProvider.DeleteExchangeAccount(itemId, accountId); + DataProvider.DeleteExchangeAccount(itemId, accountId); } public static OrganizationUser GetUserGeneralSettings(int itemId, int accountId) @@ -1686,7 +1697,7 @@ namespace WebsitePanel.EnterpriseServer // load account account = GetAccount(itemId, accountId); } - catch (Exception){} + catch (Exception) { } try { @@ -1717,7 +1728,7 @@ namespace WebsitePanel.EnterpriseServer return (account); } - + public static int SetUserGeneralSettings(int itemId, int accountId, string displayName, string password, bool hideAddressBook, bool disabled, bool locked, string firstName, string initials, string lastName, string address, string city, string state, string zip, string country, @@ -1753,10 +1764,10 @@ namespace WebsitePanel.EnterpriseServer string accountName = GetAccountName(account.AccountName); // get mailbox settings - Organizations orgProxy = GetOrganizationProxy(org.ServiceId); - // external email - string externalEmailAddress = (account.AccountType == ExchangeAccountType.User ) ? externalEmail : account.PrimaryEmailAddress; - + Organizations orgProxy = GetOrganizationProxy(org.ServiceId); + // external email + string externalEmailAddress = (account.AccountType == ExchangeAccountType.User) ? externalEmail : account.PrimaryEmailAddress; + orgProxy.SetUserGeneralSettings( org.OrganizationId, accountName, @@ -1785,21 +1796,21 @@ namespace WebsitePanel.EnterpriseServer pager, webPage, notes, - externalEmailAddress); + externalEmailAddress); // update account account.DisplayName = displayName; account.SubscriberNumber = subscriberNumber; - + //account. if (!String.IsNullOrEmpty(password)) account.AccountPassword = CryptoUtils.Encrypt(password); - else + else account.AccountPassword = null; UpdateAccount(account); - + return 0; } catch (Exception ex) @@ -1826,7 +1837,7 @@ namespace WebsitePanel.EnterpriseServer try { - + // load organization Organization org = GetOrganization(itemId); @@ -1860,7 +1871,7 @@ namespace WebsitePanel.EnterpriseServer return BusinessErrorCodes.ERROR_EXCHANGE_EMAIL_EXISTS; } } - + Organizations orgProxy = GetOrganizationProxy(org.ServiceId); orgProxy.SetUserPrincipalName(org.OrganizationId, @@ -1940,7 +1951,7 @@ namespace WebsitePanel.EnterpriseServer Organizations orgProxy = GetOrganizationProxy(org.ServiceId); - orgProxy.SetUserPassword( org.OrganizationId, + orgProxy.SetUserPassword(org.OrganizationId, accountName, password); @@ -1967,18 +1978,18 @@ namespace WebsitePanel.EnterpriseServer private static void UpdateAccount(ExchangeAccount account) - { + { DataProvider.UpdateExchangeAccount(account.AccountId, account.AccountName, account.AccountType, account.DisplayName, account.PrimaryEmailAddress, account.MailEnabledPublicFolder, - account.MailboxManagerActions.ToString(), account.SamAccountName, account.AccountPassword, account.MailboxPlanId, + account.MailboxManagerActions.ToString(), account.SamAccountName, account.AccountPassword, account.MailboxPlanId, (string.IsNullOrEmpty(account.SubscriberNumber) ? null : account.SubscriberNumber.Trim())); } public static List SearchAccounts(int itemId, - - string filterColumn, string filterValue, string sortColumn, bool includeMailboxes ) + + string filterColumn, string filterValue, string sortColumn, bool includeMailboxes) { #region Demo Mode if (IsDemoMode) @@ -1987,38 +1998,38 @@ namespace WebsitePanel.EnterpriseServer OrganizationUser m1 = new OrganizationUser(); - m1.AccountId = 1; - m1.AccountName = "john_fabrikam"; - m1.AccountType = ExchangeAccountType.Mailbox; - m1.DisplayName = "John Smith"; - m1.PrimaryEmailAddress = "john@fabrikam.net"; - - if (includeMailboxes) - demoAccounts.Add(m1); + m1.AccountId = 1; + m1.AccountName = "john_fabrikam"; + m1.AccountType = ExchangeAccountType.Mailbox; + m1.DisplayName = "John Smith"; + m1.PrimaryEmailAddress = "john@fabrikam.net"; - OrganizationUser m2 = new OrganizationUser(); - m2.AccountId = 2; - m2.AccountName = "jack_fabrikam"; - m2.AccountType = ExchangeAccountType.User; - m2.DisplayName = "Jack Brown"; - m2.PrimaryEmailAddress = "jack@fabrikam.net"; - demoAccounts.Add(m2); + if (includeMailboxes) + demoAccounts.Add(m1); + + OrganizationUser m2 = new OrganizationUser(); + m2.AccountId = 2; + m2.AccountName = "jack_fabrikam"; + m2.AccountType = ExchangeAccountType.User; + m2.DisplayName = "Jack Brown"; + m2.PrimaryEmailAddress = "jack@fabrikam.net"; + demoAccounts.Add(m2); + + OrganizationUser m3 = new OrganizationUser(); + m3.AccountId = 3; + m3.AccountName = "marry_fabrikam"; + m3.AccountType = ExchangeAccountType.Mailbox; + m3.DisplayName = "Marry Smith"; + m3.PrimaryEmailAddress = "marry@fabrikam.net"; + + if (includeMailboxes) + demoAccounts.Add(m3); - OrganizationUser m3 = new OrganizationUser(); - m3.AccountId = 3; - m3.AccountName = "marry_fabrikam"; - m3.AccountType = ExchangeAccountType.Mailbox; - m3.DisplayName = "Marry Smith"; - m3.PrimaryEmailAddress = "marry@fabrikam.net"; - - if (includeMailboxes) - demoAccounts.Add(m3); - return demoAccounts; } #endregion - + List Tmpaccounts = ObjectUtils.CreateListFromDataReader( DataProvider.SearchOrganizationAccounts(SecurityContext.User.UserId, itemId, filterColumn, filterValue, sortColumn, includeMailboxes)); @@ -2032,7 +2043,7 @@ namespace WebsitePanel.EnterpriseServer return Accounts; } - + public static int GetAccountIdByUserPrincipalName(int itemId, string userPrincipalName) { // place log record @@ -2096,8 +2107,8 @@ namespace WebsitePanel.EnterpriseServer return demoDomains; } #endregion - - + + // load organization Organization org = (Organization)PackageController.GetPackageItem(itemId); if (org == null) @@ -2123,14 +2134,14 @@ namespace WebsitePanel.EnterpriseServer private static OrganizationUser GetDemoUserGeneralSettings() { OrganizationUser user = new OrganizationUser(); - user.DisplayName = "John Smith"; + user.DisplayName = "John Smith"; user.AccountName = "john_fabrikam"; user.FirstName = "John"; user.LastName = "Smith"; - user.AccountType = ExchangeAccountType.Mailbox; + user.AccountType = ExchangeAccountType.Mailbox; return user; } - + private static bool IsDemoMode { get @@ -2142,7 +2153,7 @@ namespace WebsitePanel.EnterpriseServer public static PasswordPolicyResult GetPasswordPolicy(int itemId) { - PasswordPolicyResult res = new PasswordPolicyResult {IsSuccess = true}; + PasswordPolicyResult res = new PasswordPolicyResult { IsSuccess = true }; try { Organization org = GetOrganization(itemId); @@ -2158,7 +2169,7 @@ namespace WebsitePanel.EnterpriseServer { orgProxy = GetOrganizationProxy(org.ServiceId); } - catch(Exception ex) + catch (Exception ex) { res.IsSuccess = false; res.ErrorCodes.Add(ErrorCodes.CANNOT_GET_ORGANIZATION_PROXY); @@ -2166,17 +2177,17 @@ namespace WebsitePanel.EnterpriseServer return res; } - PasswordPolicyResult policyRes = orgProxy.GetPasswordPolicy(); - res.ErrorCodes.AddRange(policyRes.ErrorCodes); - if (!policyRes.IsSuccess) - { - res.IsSuccess = false; - return res; - } - + PasswordPolicyResult policyRes = orgProxy.GetPasswordPolicy(); + res.ErrorCodes.AddRange(policyRes.ErrorCodes); + if (!policyRes.IsSuccess) + { + res.IsSuccess = false; + return res; + } + res.Value = policyRes.Value; } - catch(Exception ex) + catch (Exception ex) { TaskManager.WriteError(ex); res.IsSuccess = false; @@ -2196,6 +2207,519 @@ namespace WebsitePanel.EnterpriseServer return ocs; } + private static int AddAccount(int itemId, ExchangeAccountType accountType, + string accountName, string displayName, string primaryEmailAddress, bool mailEnabledPublicFolder, + MailboxManagerActions mailboxManagerActions, string samAccountName, string accountPassword, int mailboxPlanId, string subscriberNumber) + { + return DataProvider.AddExchangeAccount(itemId, (int)accountType, + accountName, displayName, primaryEmailAddress, mailEnabledPublicFolder, + mailboxManagerActions.ToString(), samAccountName, CryptoUtils.Encrypt(accountPassword), mailboxPlanId, (string.IsNullOrEmpty(subscriberNumber) ? null : subscriberNumber.Trim())); + } + + public static int CreateSecurityGroup(int itemId, string displayName) + { + if (string.IsNullOrEmpty(displayName)) + throw new ArgumentNullException("displayName"); + + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; + + + // place log record + TaskManager.StartTask("ORGANIZATION", "CREATE_SECURITY_GROUP", itemId); + + TaskManager.Write("Organization ID :" + itemId); + TaskManager.Write("display name :" + displayName); + + int securityGroupId = -1; + + try + { + displayName = displayName.Trim(); + + // load organization + Organization org = GetOrganization(itemId); + + if (org == null) + { + return -1; + } + + StringDictionary serviceSettings = ServerController.GetServiceSettings(org.ServiceId); + + if (serviceSettings == null) + { + return -1; + } + + // check package + int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; + + int errorCode; + if (!CheckUserQuota(org.Id, out errorCode)) + return errorCode; + + Organizations orgProxy = GetOrganizationProxy(org.ServiceId); + + string groupName = BuildAccountNameWithOrgId(org.OrganizationId, displayName.Replace(" ", ""), org.ServiceId); + + TaskManager.Write("accountName :" + groupName); + + if (orgProxy.CreateSecurityGroup(org.OrganizationId, groupName) == 0) + { + OrganizationSecurityGroup retSecurityGroup = orgProxy.GetSecurityGroupGeneralSettings(groupName, org.OrganizationId); + TaskManager.Write("sAMAccountName :" + retSecurityGroup.SAMAccountName); + + securityGroupId = AddAccount(itemId, ExchangeAccountType.SecurityGroup, groupName, + displayName, null, false, + 0, retSecurityGroup.SAMAccountName, null, 0, null); + } + else + { + TaskManager.WriteError("Failed to create securitygroup"); + } + } + catch (Exception ex) + { + TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + + return securityGroupId; + } + + private static OrganizationSecurityGroup GetDemoSecurityGroupGeneralSettings() + { + OrganizationSecurityGroup c = new OrganizationSecurityGroup(); + c.DisplayName = "Fabrikam Sales"; + c.AccountName = "sales_fabrikam"; + + return c; + } + + public static OrganizationSecurityGroup GetSecurityGroupGeneralSettings(int itemId, int accountId) + { + #region Demo Mode + if (IsDemoMode) + { + return GetDemoSecurityGroupGeneralSettings(); + } + #endregion + + // place log record + TaskManager.StartTask("ORGANIZATION", "GET_SECURITY_GROUP_GENERAL", itemId); + + try + { + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return null; + + OrganizationUser account = GetAccount(itemId, accountId); + + // get mailbox settings + Organizations orgProxy = GetOrganizationProxy(org.ServiceId); + + OrganizationSecurityGroup securityGroup = orgProxy.GetSecurityGroupGeneralSettings(account.AccountName, org.OrganizationId); + + securityGroup.DisplayName = account.DisplayName; + + securityGroup.IsDefault = account.AccountType == ExchangeAccountType.DefaultSecurityGroup; + + List members = new List(); + + foreach (ExchangeAccount user in securityGroup.MembersAccounts) + { + OrganizationUser userAccount = GetAccountByAccountName(itemId, user.SamAccountName); + + if (userAccount != null) + { + user.AccountId = userAccount.AccountId; + user.AccountName = userAccount.AccountName; + user.DisplayName = userAccount.DisplayName; + user.PrimaryEmailAddress = userAccount.PrimaryEmailAddress; + user.AccountType = userAccount.AccountType; + + members.Add(user); + } + } + + securityGroup.MembersAccounts = members.ToArray(); + + return securityGroup; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + public static int DeleteSecurityGroup(int itemId, int accountId) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; + + // place log record + TaskManager.StartTask("ORGANIZATION", "DELETE_SECURITY_GROUP", itemId); + + try + { + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return -1; + + // load account + ExchangeAccount account = ExchangeServerController.GetAccount(itemId, accountId); + + Organizations orgProxy = GetOrganizationProxy(org.ServiceId); + + orgProxy.DeleteSecurityGroup(account.AccountName, org.OrganizationId); + + DeleteUserFromMetabase(itemId, accountId); + + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + public static int SetSecurityGroupGeneralSettings(int itemId, int accountId, string displayName, string[] memberAccounts, string notes) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; + + // place log record + TaskManager.StartTask("ORGANIZATION", "UPDATE_SECURITY_GROUP_GENERAL", itemId); + + try + { + displayName = displayName.Trim(); + + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return -1; + + // check package + int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; + + // load account + ExchangeAccount account = ExchangeServerController.GetAccount(itemId, accountId); + + string accountName = GetAccountName(account.AccountName); + // get mailbox settings + Organizations orgProxy = GetOrganizationProxy(org.ServiceId); + // external email + + orgProxy.SetSecurityGroupGeneralSettings( + org.OrganizationId, + accountName, + memberAccounts, + notes); + + // update account + account.DisplayName = displayName; + + UpdateAccount(account); + + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + public static ExchangeAccountsPaged GetOrganizationSecurityGroupsPaged(int itemId, string filterColumn, string filterValue, string sortColumn, + int startRow, int maximumRows) + { + + #region Demo Mode + if (IsDemoMode) + { + ExchangeAccountsPaged res = new ExchangeAccountsPaged(); + List demoSecurityGroups = new List(); + + ExchangeAccount r1 = new ExchangeAccount(); + r1.AccountId = 20; + r1.AccountName = "group1_fabrikam"; + r1.AccountType = ExchangeAccountType.SecurityGroup; + r1.DisplayName = "Group 1"; + demoSecurityGroups.Add(r1); + + ExchangeAccount r2 = new ExchangeAccount(); + r1.AccountId = 21; + r1.AccountName = "group2_fabrikam"; + r1.AccountType = ExchangeAccountType.SecurityGroup; + r1.DisplayName = "Group 2"; + demoSecurityGroups.Add(r2); + + + res.PageItems = demoSecurityGroups.ToArray(); + res.RecordsCount = res.PageItems.Length; + + return res; + } + #endregion + + string accountTypes = string.Format("{0}, {1}", ((int)ExchangeAccountType.SecurityGroup), ((int)ExchangeAccountType.DefaultSecurityGroup)); + + DataSet ds = + DataProvider.GetExchangeAccountsPaged(SecurityContext.User.UserId, itemId, accountTypes, filterColumn, + filterValue, sortColumn, startRow, maximumRows); + + ExchangeAccountsPaged result = new ExchangeAccountsPaged(); + result.RecordsCount = (int)ds.Tables[0].Rows[0][0]; + + List Tmpaccounts = new List(); + ObjectUtils.FillCollectionFromDataView(Tmpaccounts, ds.Tables[1].DefaultView); + result.PageItems = Tmpaccounts.ToArray(); + + List accounts = new List(); + + foreach (ExchangeAccount account in Tmpaccounts.ToArray()) + { + OrganizationSecurityGroup tmpSecurityGroup = GetSecurityGroupGeneralSettings(itemId, account.AccountId); + + if (tmpSecurityGroup != null) + accounts.Add(account); + } + + result.PageItems = accounts.ToArray(); + + return result; + } + + public static int AddUserToSecurityGroup(int itemId, int userAccountId, string groupName) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; + + // place log record + TaskManager.StartTask("ORGANIZATION", "ADD_USER_TO_SECURITY_GROUP", itemId); + + try + { + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return -1; + + // load user account + OrganizationUser userAccount = GetAccount(itemId, userAccountId); + + Organizations orgProxy = GetOrganizationProxy(org.ServiceId); + + orgProxy.AddUserToSecurityGroup(org.OrganizationId, userAccount.AccountName, groupName); + + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + public static int DeleteUserFromSecurityGroup(int itemId, int userAccountId, string groupName) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; + + // place log record + TaskManager.StartTask("ORGANIZATION", "DELETE_USER_FROM_SECURITY_GROUP", itemId); + + try + { + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return -1; + + // load user account + OrganizationUser userAccount = GetAccount(itemId, userAccountId); + + Organizations orgProxy = GetOrganizationProxy(org.ServiceId); + + orgProxy.DeleteUserFromSecurityGroup(org.OrganizationId, userAccount.AccountName, groupName); + + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + public static ExchangeAccount[] GetSecurityGroupsByMember(int itemId, int accountId) + { + #region Demo Mode + if (IsDemoMode) + { + return null; + } + #endregion + + // place log record + TaskManager.StartTask("ORGANIZATION", "GET_SECURITY_GROUPS_BYMEMBER"); + TaskManager.ItemId = itemId; + + List ret = new List(); + + try + { + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return null; + + Organizations orgProxy = GetOrganizationProxy(org.ServiceId); + + // load account + ExchangeAccount account = ExchangeServerController.GetAccount(itemId, accountId); + + List securytyGroups = ExchangeServerController.GetAccounts(itemId, ExchangeAccountType.SecurityGroup); + + //load default group + securytyGroups.AddRange(ExchangeServerController.GetAccounts(itemId, ExchangeAccountType.DefaultSecurityGroup)); + + foreach (ExchangeAccount securityGroupAccount in securytyGroups) + { + OrganizationSecurityGroup securityGroup = GetSecurityGroupGeneralSettings(itemId, securityGroupAccount.AccountId); + + foreach (ExchangeAccount member in securityGroup.MembersAccounts) + { + if (member.AccountName == account.AccountName) + { + ret.Add(securityGroupAccount); + break; + } + + } + } + + return ret.ToArray(); + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + public static List SearchOrganizationAccounts(int itemId, string filterColumn, string filterValue, + string sortColumn, bool includeOnlySecurityGroups) + { + #region Demo Mode + + if (IsDemoMode) + { + List demoAccounts = new List(); + + ExchangeAccount m1 = new ExchangeAccount(); + m1.AccountId = 1; + m1.AccountName = "john_fabrikam"; + m1.AccountType = ExchangeAccountType.Mailbox; + m1.DisplayName = "John Smith"; + m1.PrimaryEmailAddress = "john@fabrikam.net"; + demoAccounts.Add(m1); + + ExchangeAccount m2 = new ExchangeAccount(); + m2.AccountId = 2; + m2.AccountName = "jack_fabrikam"; + m2.AccountType = ExchangeAccountType.User; + m2.DisplayName = "Jack Brown"; + m2.PrimaryEmailAddress = "jack@fabrikam.net"; + demoAccounts.Add(m2); + + ExchangeAccount m3 = new ExchangeAccount(); + m3.AccountId = 3; + m3.AccountName = "marry_fabrikam"; + m3.AccountType = ExchangeAccountType.Mailbox; + m3.DisplayName = "Marry Smith"; + m3.PrimaryEmailAddress = "marry@fabrikam.net"; + demoAccounts.Add(m3); + + ExchangeAccount r1 = new ExchangeAccount(); + r1.AccountId = 20; + r1.AccountName = "group1_fabrikam"; + r1.AccountType = ExchangeAccountType.SecurityGroup; + r1.DisplayName = "Group 1"; + demoAccounts.Add(r1); + + ExchangeAccount r2 = new ExchangeAccount(); + r1.AccountId = 21; + r1.AccountName = "group2_fabrikam"; + r1.AccountType = ExchangeAccountType.SecurityGroup; + r1.DisplayName = "Group 2"; + demoAccounts.Add(r2); + + return demoAccounts; + } + + #endregion + + string accountTypes = string.Format("{0}", ((int)ExchangeAccountType.SecurityGroup)); + + if (!includeOnlySecurityGroups) + { + accountTypes = string.Format("{0}, {1}, {2}, {3}, {4}", accountTypes, ((int)ExchangeAccountType.User), ((int)ExchangeAccountType.Mailbox), + ((int)ExchangeAccountType.Room), ((int)ExchangeAccountType.Equipment)); + } + + List tmpAccounts = ObjectUtils.CreateListFromDataReader( + DataProvider.SearchExchangeAccountsByTypes(SecurityContext.User.UserId, itemId, + accountTypes, filterColumn, filterValue, sortColumn)); + + List accounts = new List(); + + foreach (ExchangeAccount tmpAccount in tmpAccounts.ToArray()) + { + if (tmpAccount.AccountType == ExchangeAccountType.SecurityGroup + ? GetSecurityGroupGeneralSettings(itemId, tmpAccount.AccountId) != null + : GetUserGeneralSettings(itemId, tmpAccount.AccountId) != null) + { + accounts.Add(tmpAccount); + } + } + + return accounts; + } } - } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esExchangeServer.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esExchangeServer.asmx.cs index 0d43f107..0e201812 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esExchangeServer.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esExchangeServer.asmx.cs @@ -190,12 +190,12 @@ namespace WebsitePanel.EnterpriseServer [WebMethod] public List SearchAccounts(int itemId, bool includeMailboxes, bool includeContacts, bool includeDistributionLists, - bool includeRooms, bool includeEquipment, + bool includeRooms, bool includeEquipment, bool includeSecurityGroups, string filterColumn, string filterValue, string sortColumn) { return ExchangeServerController.SearchAccounts(itemId, includeMailboxes, includeContacts, includeDistributionLists, - includeRooms, includeEquipment, + includeRooms, includeEquipment, includeSecurityGroups, filterColumn, filterValue, sortColumn); } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs index ac5a1e38..54d3fa82 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs @@ -214,7 +214,7 @@ namespace WebsitePanel.EnterpriseServer { return OrganizationController.SetUserPassword(itemId, accountId, password); } - + [WebMethod] @@ -242,5 +242,66 @@ namespace WebsitePanel.EnterpriseServer #endregion + #region Security Groups + + [WebMethod] + public int CreateSecurityGroup(int itemId, string displayName) + { + return OrganizationController.CreateSecurityGroup(itemId, displayName); + } + + [WebMethod] + public OrganizationSecurityGroup GetSecurityGroupGeneralSettings(int itemId, int accountId) + { + return OrganizationController.GetSecurityGroupGeneralSettings(itemId, accountId); + } + + [WebMethod] + public int DeleteSecurityGroup(int itemId, int accountId) + { + return OrganizationController.DeleteSecurityGroup(itemId, accountId); + } + + [WebMethod] + public int SetSecurityGroupGeneralSettings(int itemId, int accountId, string displayName, string[] memberAccounts, string notes) + { + return OrganizationController.SetSecurityGroupGeneralSettings(itemId, accountId, displayName, memberAccounts, notes); + } + + [WebMethod] + public ExchangeAccountsPaged GetOrganizationSecurityGroupsPaged(int itemId, string filterColumn, string filterValue, string sortColumn, + int startRow, int maximumRows) + { + return OrganizationController.GetOrganizationSecurityGroupsPaged(itemId, filterColumn, filterValue, sortColumn, startRow, maximumRows); + } + + [WebMethod] + public int AddUserToSecurityGroup(int itemId, int userAccountId, string groupName) + { + return OrganizationController.AddUserToSecurityGroup(itemId, userAccountId, groupName); + } + + [WebMethod] + public int DeleteUserFromSecurityGroup(int itemId, int userAccountId, string groupName) + { + return OrganizationController.DeleteUserFromSecurityGroup(itemId, userAccountId, groupName); + } + + [WebMethod] + public ExchangeAccount[] GetSecurityGroupsByMember(int itemId, int accountId) + { + return OrganizationController.GetSecurityGroupsByMember(itemId, accountId); + } + + [WebMethod] + public List SearchOrganizationAccounts(int itemId, string filterColumn, string filterValue, + string sortColumn, bool includeOnlySecurityGroups) + { + return OrganizationController.SearchOrganizationAccounts(itemId, filterColumn, filterValue, sortColumn, + includeOnlySecurityGroups); + } + + #endregion + } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ADAttributes.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ADAttributes.cs index 9ef289cb..2f4cad16 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ADAttributes.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ADAttributes.cs @@ -58,7 +58,7 @@ namespace WebsitePanel.Providers.HostedSolution public const string UserPrincipalName = "UserPrincipalName"; public const string GroupType = "GroupType"; public const string Name = "Name"; - public const string ExternalEmail = "mail"; + public const string ExternalEmail = "mail"; public const string CustomAttribute2 = "extensionAttribute2"; public const string DistinguishedName = "distinguishedName"; diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ActiveDirectoryUtils.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ActiveDirectoryUtils.cs index 99703719..b6dc0c92 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ActiveDirectoryUtils.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ActiveDirectoryUtils.cs @@ -44,6 +44,45 @@ namespace WebsitePanel.Providers.HostedSolution return de; } + public static string[] GetGroupObjects(string group, string objectType) + { + List rets = new List(); + + DirectorySearcher deSearch = new DirectorySearcher + { + Filter = + "(&(objectClass=" + objectType + "))" + }; + + SearchResultCollection srcObjects = deSearch.FindAll(); + + foreach (SearchResult srcObject in srcObjects) + { + DirectoryEntry de = srcObject.GetDirectoryEntry(); + PropertyValueCollection props = de.Properties["memberOf"]; + + foreach (string str in props) + { + string groupName = ""; + + string[] parts = str.Split(','); + for (int i = 0; i < parts.Length; i++) + { + if (parts[i].StartsWith("CN=")) + { + if (parts[i].Substring(3) == group) + { + rets.Add(de.Path); + } + break; + } + } + } + } + + return rets.ToArray(); + } + public static bool IsUserInGroup(string samAccountName, string group) { bool res = false; @@ -328,15 +367,24 @@ namespace WebsitePanel.Providers.HostedSolution newGroupObject.Properties[ADAttributes.SAMAccountName].Add(group); newGroupObject.Properties[ADAttributes.GroupType].Add(-2147483640); + newGroupObject.CommitChanges(); } - public static void AddUserToGroup(string userPath, string groupPath) + public static void AddObjectToGroup(string objectPath, string groupPath) { - DirectoryEntry user = new DirectoryEntry(userPath); + DirectoryEntry obj = new DirectoryEntry(objectPath); DirectoryEntry group = new DirectoryEntry(groupPath); - group.Invoke("Add", user.Path); + group.Invoke("Add", obj.Path); + } + + public static void RemoveObjectFromGroup(string obejctPath, string groupPath) + { + DirectoryEntry obj = new DirectoryEntry(obejctPath); + DirectoryEntry group = new DirectoryEntry(groupPath); + + group.Invoke("Remove", obj.Path); } public static bool AdObjectExists(string path) diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeAccountType.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeAccountType.cs index a72ef690..c8e3c3da 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeAccountType.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeAccountType.cs @@ -37,7 +37,9 @@ namespace WebsitePanel.Providers.HostedSolution PublicFolder = 4, Room = 5, Equipment = 6, - User = 7 + User = 7, + SecurityGroup = 8, + DefaultSecurityGroup = 9 } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/IOrganization.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/IOrganization.cs index 6da1e71a..02a86255 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/IOrganization.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/IOrganization.cs @@ -42,6 +42,18 @@ namespace WebsitePanel.Providers.HostedSolution OrganizationUser GetUserGeneralSettings(string loginName, string organizationId); + int CreateSecurityGroup(string organizationId, string groupName); + + OrganizationSecurityGroup GetSecurityGroupGeneralSettings(string groupName, string organizationId); + + void DeleteSecurityGroup(string groupName, string organizationId); + + void SetSecurityGroupGeneralSettings(string organizationId, string groupName, string[] memberAccounts, string notes); + + void AddUserToSecurityGroup(string organizationId, string loginName, string groupName); + + void DeleteUserFromSecurityGroup(string organizationId, string loginName, string groupName); + void SetUserGeneralSettings(string organizationId, string accountName, string displayName, string password, bool hideFromAddressBook, bool disabled, bool locked, string firstName, string initials, string lastName, @@ -54,7 +66,7 @@ namespace WebsitePanel.Providers.HostedSolution void SetUserPassword(string organizationId, string accountName, string password); void SetUserPrincipalName(string organizationId, string accountName, string userPrincipalName); - + bool OrganizationExists(string organizationId); void DeleteOrganizationDomain(string organizationDistinguishedName, string domain); diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncPolicyType.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncPolicyType.cs index d1971d37..5a069a48 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncPolicyType.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncPolicyType.cs @@ -1,4 +1,32 @@ -using System; +// Copyright (c) 2011, 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.Linq; using System.Text; diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationSecurityGroup.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationSecurityGroup.cs new file mode 100644 index 00000000..ab410547 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationSecurityGroup.cs @@ -0,0 +1,46 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace WebsitePanel.Providers.HostedSolution +{ + public class OrganizationSecurityGroup + { + public string DisplayName + { + get; + set; + } + + public string AccountName + { + get; + set; + } + + public ExchangeAccount[] MembersAccounts + { + get; + set; + } + + public string Notes + { + get; + set; + } + + public string SAMAccountName + { + get; + set; + } + + public bool IsDefault + { + get; + set; + } + } +} \ 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 1e1c8954..2fb310a5 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj @@ -102,6 +102,7 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs index 53689f1d..82bba885 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs @@ -27,10 +27,10 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using System; +using System.Collections.Generic; using System.DirectoryServices; using System.Globalization; using System.Text; - using WebsitePanel.Providers.Common; using WebsitePanel.Providers.ResultObjects; @@ -102,6 +102,34 @@ namespace WebsitePanel.Providers.HostedSolution return sb.ToString(); } + private string GetObjectPath(string organizationId, string objName) + { + StringBuilder sb = new StringBuilder(); + // append provider + AppendProtocol(sb); + AppendDomainController(sb); + AppendCNPath(sb, objName); + AppendOUPath(sb, organizationId); + AppendOUPath(sb, RootOU); + AppendDomainPath(sb, RootDomain); + + return sb.ToString(); + } + + private string GetGroupPath(string organizationId, string groupName) + { + StringBuilder sb = new StringBuilder(); + // append provider + AppendProtocol(sb); + AppendDomainController(sb); + AppendCNPath(sb, groupName); + AppendOUPath(sb, organizationId); + AppendOUPath(sb, RootOU); + AppendDomainPath(sb, RootDomain); + + return sb.ToString(); + } + private string GetRootOU() { StringBuilder sb = new StringBuilder(); @@ -213,6 +241,7 @@ namespace WebsitePanel.Providers.HostedSolution org.OrganizationId = organizationId; org.DistinguishedName = ActiveDirectoryUtils.RemoveADPrefix(orgPath); org.SecurityGroup = ActiveDirectoryUtils.RemoveADPrefix(GetGroupPath(organizationId)); + org.GroupName = organizationId; } catch (Exception ex) { @@ -389,7 +418,7 @@ namespace WebsitePanel.Providers.HostedSolution HostedSolutionLog.DebugInfo("Group retrieved: {0}", groupPath); - ActiveDirectoryUtils.AddUserToGroup(userPath, groupPath); + ActiveDirectoryUtils.AddObjectToGroup(userPath, groupPath); HostedSolutionLog.DebugInfo("Added to group: {0}", groupPath); } catch (Exception e) @@ -498,10 +527,19 @@ namespace WebsitePanel.Providers.HostedSolution throw new ArgumentNullException("loginName"); string path = GetUserPath(organizationId, loginName); - DirectoryEntry entry = ActiveDirectoryUtils.GetADObject(path); + OrganizationUser retUser = GetUser(path); + + HostedSolutionLog.LogEnd("GetUserGeneralSettingsInternal"); + return retUser; + } + + private OrganizationUser GetUser(string path) + { OrganizationUser retUser = new OrganizationUser(); + DirectoryEntry entry = ActiveDirectoryUtils.GetADObject(path); + retUser.FirstName = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.FirstName); retUser.LastName = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.LastName); retUser.DisplayName = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.DisplayName); @@ -524,14 +562,13 @@ namespace WebsitePanel.Providers.HostedSolution retUser.Notes = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.Notes); retUser.ExternalEmail = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.ExternalEmail); retUser.Disabled = (bool)entry.InvokeGet(ADAttributes.AccountDisabled); - retUser.Manager = GetManager(entry); + retUser.Manager = GetManager(entry, ADAttributes.Manager); retUser.SamAccountName = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.SAMAccountName); retUser.DomainUserName = GetDomainName(ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.SAMAccountName)); retUser.DistinguishedName = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.DistinguishedName); retUser.Locked = (bool)entry.InvokeGet(ADAttributes.AccountLocked); - retUser.UserPrincipalName= (string)entry.InvokeGet(ADAttributes.UserPrincipalName); + retUser.UserPrincipalName = (string)entry.InvokeGet(ADAttributes.UserPrincipalName); - HostedSolutionLog.LogEnd("GetUserGeneralSettingsInternal"); return retUser; } @@ -542,10 +579,10 @@ namespace WebsitePanel.Providers.HostedSolution return ret; } - private OrganizationUser GetManager(DirectoryEntry entry) + private OrganizationUser GetManager(DirectoryEntry entry, string adAttribute) { OrganizationUser retUser = null; - string path = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.Manager); + string path = ActiveDirectoryUtils.GetADObjectStringProperty(entry, adAttribute); if (!string.IsNullOrEmpty(path)) { path = ActiveDirectoryUtils.AddADPrefix(path, PrimaryDomainController); @@ -645,7 +682,7 @@ namespace WebsitePanel.Providers.HostedSolution { string path = GetUserPath(organizationId, accountName); DirectoryEntry entry = ActiveDirectoryUtils.GetADObject(path); - + if (!string.IsNullOrEmpty(password)) entry.Invoke(ADAttributes.SetPassword, password); @@ -737,8 +774,8 @@ namespace WebsitePanel.Providers.HostedSolution SearchResult resCollection = searcher.FindOne(); if (resCollection != null) { - if(resCollection.Properties["samaccountname"] != null) - bFound = true; + if (resCollection.Properties["samaccountname"] != null) + bFound = true; } } catch (Exception e) @@ -800,6 +837,254 @@ namespace WebsitePanel.Providers.HostedSolution } #endregion + #region Security Groups + + public int CreateSecurityGroup(string organizationId, string groupName) + { + return CreateSecurityGroupInternal(organizationId, groupName); + } + + internal int CreateSecurityGroupInternal(string organizationId, string groupName) + { + HostedSolutionLog.LogStart("CreateSecurityGroupInternal"); + HostedSolutionLog.DebugInfo("organizationId : {0}", organizationId); + HostedSolutionLog.DebugInfo("groupName : {0}", groupName); + + if (string.IsNullOrEmpty(organizationId)) + throw new ArgumentNullException("organizationId"); + + if (string.IsNullOrEmpty(groupName)) + throw new ArgumentNullException("groupName"); + + bool groupCreated = false; + string groupPath = null; + try + { + string path = GetOrganizationPath(organizationId); + groupPath = GetGroupPath(organizationId, groupName); + + if (!ActiveDirectoryUtils.AdObjectExists(groupPath)) + { + ActiveDirectoryUtils.CreateGroup(path, groupName); + + groupCreated = true; + + HostedSolutionLog.DebugInfo("Security Group created: {0}", groupName); + } + else + { + HostedSolutionLog.DebugInfo("AD_OBJECT_ALREADY_EXISTS: {0}", groupPath); + HostedSolutionLog.LogEnd("CreateSecurityGroupInternal"); + + return Errors.AD_OBJECT_ALREADY_EXISTS; + } + } + catch (Exception e) + { + HostedSolutionLog.LogError(e); + try + { + if (groupCreated) + ActiveDirectoryUtils.DeleteADObject(groupPath); + } + catch (Exception ex) + { + HostedSolutionLog.LogError(ex); + } + + return Errors.AD_OBJECT_ALREADY_EXISTS; + } + + HostedSolutionLog.LogEnd("CreateSecurityGroupInternal"); + + return Errors.OK; + } + + public OrganizationSecurityGroup GetSecurityGroupGeneralSettings(string groupName, string organizationId) + { + return GetSecurityGroupGeneralSettingsInternal(groupName, organizationId); + } + + internal OrganizationSecurityGroup GetSecurityGroupGeneralSettingsInternal(string groupName, string organizationId) + { + HostedSolutionLog.LogStart("GetSecurityGroupGeneralSettingsInternal"); + HostedSolutionLog.DebugInfo("groupName : {0}", groupName); + HostedSolutionLog.DebugInfo("organizationId : {0}", organizationId); + + if (string.IsNullOrEmpty(organizationId)) + throw new ArgumentNullException("organizationId"); + + if (string.IsNullOrEmpty(groupName)) + throw new ArgumentNullException("groupName"); + + string path = GetGroupPath(organizationId, groupName); + + DirectoryEntry entry = ActiveDirectoryUtils.GetADObject(path); + + OrganizationSecurityGroup securityGroup = new OrganizationSecurityGroup(); + + securityGroup.Notes = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.Notes); + + securityGroup.AccountName = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.SAMAccountName); + securityGroup.SAMAccountName = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.SAMAccountName); + + List members = new List(); + + foreach (string userPath in ActiveDirectoryUtils.GetGroupObjects(groupName, "user")) + { + OrganizationUser tmpUser = GetUser(userPath); + + members.Add(new ExchangeAccount + { + AccountName = tmpUser.AccountName, + SamAccountName = tmpUser.SamAccountName + }); + } + + foreach (string groupPath in ActiveDirectoryUtils.GetGroupObjects(groupName, "group")) + { + DirectoryEntry groupEntry = ActiveDirectoryUtils.GetADObject(groupPath); + + members.Add(new ExchangeAccount + { + AccountName = ActiveDirectoryUtils.GetADObjectStringProperty(groupEntry, ADAttributes.SAMAccountName), + SamAccountName = ActiveDirectoryUtils.GetADObjectStringProperty(groupEntry, ADAttributes.SAMAccountName) + }); + } + + securityGroup.MembersAccounts = members.ToArray(); + + HostedSolutionLog.LogEnd("GetSecurityGroupGeneralSettingsInternal"); + + return securityGroup; + } + + public void DeleteSecurityGroup(string groupName, string organizationId) + { + DeleteSecurityGroupInternal(groupName, organizationId); + } + + internal void DeleteSecurityGroupInternal(string groupName, string organizationId) + { + HostedSolutionLog.LogStart("DeleteSecurityGroupInternal"); + HostedSolutionLog.DebugInfo("groupName : {0}", groupName); + HostedSolutionLog.DebugInfo("organizationId : {0}", organizationId); + + if (string.IsNullOrEmpty(organizationId)) + throw new ArgumentNullException("organizationId"); + + if (string.IsNullOrEmpty(groupName)) + throw new ArgumentNullException("groupName"); + + string path = GetGroupPath(organizationId, groupName); + + if (ActiveDirectoryUtils.AdObjectExists(path)) + ActiveDirectoryUtils.DeleteADObject(path, true); + + HostedSolutionLog.LogEnd("DeleteSecurityGroupInternal"); + } + + public void SetSecurityGroupGeneralSettings(string organizationId, string groupName, string[] memberAccounts, string notes) + { + + SetSecurityGroupGeneralSettingsInternal(organizationId, groupName, memberAccounts, notes); + } + + internal void SetSecurityGroupGeneralSettingsInternal(string organizationId, string groupName, string[] memberAccounts, string notes) + { + HostedSolutionLog.LogStart("SetSecurityGroupGeneralSettingsInternal"); + HostedSolutionLog.DebugInfo("organizationId : {0}", organizationId); + HostedSolutionLog.DebugInfo("groupName : {0}", groupName); + + if (string.IsNullOrEmpty(organizationId)) + throw new ArgumentNullException("organizationId"); + + if (string.IsNullOrEmpty(groupName)) + throw new ArgumentNullException("groupName"); + + string path = GetGroupPath(organizationId, groupName); + + DirectoryEntry entry = ActiveDirectoryUtils.GetADObject(path); + + ActiveDirectoryUtils.SetADObjectProperty(entry, ADAttributes.Notes, notes); + + foreach (string userPath in ActiveDirectoryUtils.GetGroupObjects(groupName, "user")) + { + ActiveDirectoryUtils.RemoveObjectFromGroup(userPath, path); + } + + foreach (string groupPath in ActiveDirectoryUtils.GetGroupObjects(groupName, "group")) + { + ActiveDirectoryUtils.RemoveObjectFromGroup(groupPath, path); + } + + foreach (string obj in memberAccounts) + { + string objPath = GetObjectPath(organizationId, obj); + ActiveDirectoryUtils.AddObjectToGroup(objPath, path); + } + + entry.CommitChanges(); + } + + public void AddUserToSecurityGroup(string organizationId, string loginName, string groupName) + { + AddUserToSecurityGroupInternal(organizationId, loginName, groupName); + } + + internal void AddUserToSecurityGroupInternal(string organizationId, string loginName, string groupName) + { + HostedSolutionLog.LogStart("AddUserToSecurityGroupInternal"); + HostedSolutionLog.DebugInfo("organizationId : {0}", organizationId); + HostedSolutionLog.DebugInfo("loginName : {0}", loginName); + HostedSolutionLog.DebugInfo("groupName : {0}", groupName); + + if (string.IsNullOrEmpty(organizationId)) + throw new ArgumentNullException("organizationId"); + + if (string.IsNullOrEmpty(loginName)) + throw new ArgumentNullException("loginName"); + + if (string.IsNullOrEmpty(groupName)) + throw new ArgumentNullException("groupName"); + + string userPath = GetUserPath(organizationId, loginName); + + string groupPath = GetGroupPath(organizationId, groupName); + + ActiveDirectoryUtils.AddObjectToGroup(userPath, groupPath); + } + + public void DeleteUserFromSecurityGroup(string organizationId, string loginName, string groupName) + { + DeleteUserFromSecurityGroupInternal(organizationId, loginName, groupName); + } + + internal void DeleteUserFromSecurityGroupInternal(string organizationId, string loginName, string groupName) + { + HostedSolutionLog.LogStart("AddUserToSecurityGroupInternal"); + HostedSolutionLog.DebugInfo("organizationId : {0}", organizationId); + HostedSolutionLog.DebugInfo("loginName : {0}", loginName); + HostedSolutionLog.DebugInfo("groupName : {0}", groupName); + + if (string.IsNullOrEmpty(organizationId)) + throw new ArgumentNullException("organizationId"); + + if (string.IsNullOrEmpty(loginName)) + throw new ArgumentNullException("loginName"); + + if (string.IsNullOrEmpty(groupName)) + throw new ArgumentNullException("groupName"); + + string userPath = GetUserPath(organizationId, loginName); + + string groupPath = GetGroupPath(organizationId, groupName); + + ActiveDirectoryUtils.RemoveObjectFromGroup(userPath, groupPath); + } + + #endregion + public override bool IsInstalled() { return Environment.UserDomainName != Environment.MachineName; diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/OrganizationProxy.cs b/WebsitePanel/Sources/WebsitePanel.Server.Client/OrganizationProxy.cs index eb607e66..260fba07 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.Client/OrganizationProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/OrganizationProxy.cs @@ -51,7 +51,7 @@ namespace WebsitePanel.Providers.HostedSolution using WebsitePanel.Providers.Common; using WebsitePanel.Providers.ResultObjects; - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] @@ -77,6 +77,18 @@ namespace WebsitePanel.Providers.HostedSolution 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 AddUserToSecurityGroupOperationCompleted; + + private System.Threading.SendOrPostCallback DeleteUserFromSecurityGroupOperationCompleted; + private System.Threading.SendOrPostCallback SetUserGeneralSettingsOperationCompleted; private System.Threading.SendOrPostCallback SetUserPasswordOperationCompleted; @@ -117,6 +129,24 @@ namespace WebsitePanel.Providers.HostedSolution /// public event GetUserGeneralSettingsCompletedEventHandler GetUserGeneralSettingsCompleted; + /// + public event CreateSecurityGroupCompletedEventHandler CreateSecurityGroupCompleted; + + /// + public event GetSecurityGroupGeneralSettingsCompletedEventHandler GetSecurityGroupGeneralSettingsCompleted; + + /// + public event DeleteSecurityGroupCompletedEventHandler DeleteSecurityGroupCompleted; + + /// + public event SetSecurityGroupGeneralSettingsCompletedEventHandler SetSecurityGroupGeneralSettingsCompleted; + + /// + public event AddUserToSecurityGroupCompletedEventHandler AddUserToSecurityGroupCompleted; + + /// + public event DeleteUserFromSecurityGroupCompletedEventHandler DeleteUserFromSecurityGroupCompleted; + /// public event SetUserGeneralSettingsCompletedEventHandler SetUserGeneralSettingsCompleted; @@ -458,6 +488,328 @@ namespace WebsitePanel.Providers.HostedSolution } } + /// + [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) + { + 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) + { + return this.BeginInvoke("CreateSecurityGroup", new object[] { + organizationId, + groupName}, callback, asyncState); + } + + /// + public int EndCreateSecurityGroup(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + 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)) + { + 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)) + { + 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) + { + 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) + { + return this.BeginInvoke("GetSecurityGroupGeneralSettings", new object[] { + groupName, + organizationId}, callback, asyncState); + } + + /// + public OrganizationSecurityGroup EndGetSecurityGroupGeneralSettings(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((OrganizationSecurityGroup)(results[0])); + } + + /// + 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)) + { + 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)) + { + 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) + { + this.Invoke("DeleteSecurityGroup", new object[] { + groupName, + organizationId}); + } + + /// + 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) + { + this.EndInvoke(asyncResult); + } + + /// + 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)) + { + 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)) + { + 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) + { + 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) + { + return this.BeginInvoke("SetSecurityGroupGeneralSettings", new object[] { + organizationId, + groupName, + memberAccounts, + notes}, callback, asyncState); + } + + /// + public void EndSetSecurityGroupGeneralSettings(System.IAsyncResult asyncResult) + { + this.EndInvoke(asyncResult); + } + + /// + 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)) + { + this.SetSecurityGroupGeneralSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetSecurityGroupGeneralSettingsOperationCompleted); + } + this.InvokeAsync("SetSecurityGroupGeneralSettings", new object[] { + organizationId, + groupName, + memberAccounts, + notes}, this.SetSecurityGroupGeneralSettingsOperationCompleted, userState); + } + + 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/AddUserToSecurityGroup", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void AddUserToSecurityGroup(string organizationId, string loginName, string groupName) + { + this.Invoke("AddUserToSecurityGroup", new object[] { + organizationId, + loginName, + groupName}); + } + + /// + public System.IAsyncResult BeginAddUserToSecurityGroup(string organizationId, string loginName, string groupName, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("AddUserToSecurityGroup", new object[] { + organizationId, + loginName, + groupName}, callback, asyncState); + } + + /// + public void EndAddUserToSecurityGroup(System.IAsyncResult asyncResult) + { + this.EndInvoke(asyncResult); + } + + /// + public void AddUserToSecurityGroupAsync(string organizationId, string loginName, string groupName) + { + this.AddUserToSecurityGroupAsync(organizationId, loginName, groupName, null); + } + + /// + public void AddUserToSecurityGroupAsync(string organizationId, string loginName, string groupName, object userState) + { + if ((this.AddUserToSecurityGroupOperationCompleted == null)) + { + this.AddUserToSecurityGroupOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddUserToSecurityGroupOperationCompleted); + } + this.InvokeAsync("AddUserToSecurityGroup", new object[] { + organizationId, + loginName, + groupName}, this.AddUserToSecurityGroupOperationCompleted, userState); + } + + private void OnAddUserToSecurityGroupOperationCompleted(object arg) + { + if ((this.AddUserToSecurityGroupCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.AddUserToSecurityGroupCompleted(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/DeleteUserFromSecurityGroup", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void DeleteUserFromSecurityGroup(string organizationId, string loginName, string groupName) + { + this.Invoke("DeleteUserFromSecurityGroup", new object[] { + organizationId, + loginName, + groupName}); + } + + /// + public System.IAsyncResult BeginDeleteUserFromSecurityGroup(string organizationId, string loginName, string groupName, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("DeleteUserFromSecurityGroup", new object[] { + organizationId, + loginName, + groupName}, callback, asyncState); + } + + /// + public void EndDeleteUserFromSecurityGroup(System.IAsyncResult asyncResult) + { + this.EndInvoke(asyncResult); + } + + /// + public void DeleteUserFromSecurityGroupAsync(string organizationId, string loginName, string groupName) + { + this.DeleteUserFromSecurityGroupAsync(organizationId, loginName, groupName, null); + } + + /// + public void DeleteUserFromSecurityGroupAsync(string organizationId, string loginName, string groupName, object userState) + { + if ((this.DeleteUserFromSecurityGroupOperationCompleted == null)) + { + this.DeleteUserFromSecurityGroupOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteUserFromSecurityGroupOperationCompleted); + } + this.InvokeAsync("DeleteUserFromSecurityGroup", new object[] { + organizationId, + loginName, + groupName}, this.DeleteUserFromSecurityGroupOperationCompleted, userState); + } + + private void OnDeleteUserFromSecurityGroupOperationCompleted(object arg) + { + if ((this.DeleteUserFromSecurityGroupCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.DeleteUserFromSecurityGroupCompleted(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)] @@ -1197,6 +1549,82 @@ namespace WebsitePanel.Providers.HostedSolution } } + /// + [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.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + 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) + { + this.results = results; + } + + /// + public int Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((int)(this.results[0])); + } + } + } + + /// + [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.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + 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) + { + this.results = results; + } + + /// + public OrganizationSecurityGroup Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((OrganizationSecurityGroup)(this.results[0])); + } + } + } + + /// + [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.3038")] + public delegate void SetSecurityGroupGeneralSettingsCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void AddUserToSecurityGroupCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void DeleteUserFromSecurityGroupCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void SetUserGeneralSettingsCompletedEventHandler(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 1e814394..33d87aed 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/Organizations.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server/Organizations.asmx.cs @@ -110,6 +110,42 @@ namespace WebsitePanel.Server return Organization.GetUserGeneralSettings(loginName, organizationId); } + [WebMethod, SoapHeader("settings")] + public int CreateSecurityGroup(string organizationId, string groupName) + { + return Organization.CreateSecurityGroup(organizationId, groupName); + } + + [WebMethod, SoapHeader("settings")] + public OrganizationSecurityGroup GetSecurityGroupGeneralSettings(string groupName, string organizationId) + { + return Organization.GetSecurityGroupGeneralSettings(groupName, organizationId); + } + + [WebMethod, SoapHeader("settings")] + public void DeleteSecurityGroup(string groupName, string organizationId) + { + Organization.DeleteSecurityGroup(groupName, organizationId); + } + + [WebMethod, SoapHeader("settings")] + public void SetSecurityGroupGeneralSettings(string organizationId, string groupName, string[] memberAccounts, string notes) + { + Organization.SetSecurityGroupGeneralSettings(organizationId, groupName, memberAccounts, notes); + } + + [WebMethod, SoapHeader("settings")] + public void AddUserToSecurityGroup(string organizationId, string loginName, string groupName) + { + Organization.AddUserToSecurityGroup(organizationId, loginName, groupName); + } + + [WebMethod, SoapHeader("settings")] + public void DeleteUserFromSecurityGroup(string organizationId, string loginName, string groupName) + { + Organization.DeleteUserFromSecurityGroup(organizationId, loginName, groupName); + } + [WebMethod, SoapHeader("settings")] public void SetUserGeneralSettings(string organizationId, string accountName, string displayName, string password, bool hideFromAddressBook, bool disabled, bool locked, string firstName, string initials, string lastName, diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config index fd56bbb9..cdbb540b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config @@ -545,6 +545,10 @@ + + + + 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 4b0e94ac..2a2994d6 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx @@ -3301,6 +3301,9 @@ Domains per Organization + + Allow Security Group Management + Hosted SharePoint diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Helpers/OrganizationsHelper.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Helpers/OrganizationsHelper.cs index f6790dde..6537ad67 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Helpers/OrganizationsHelper.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Helpers/OrganizationsHelper.cs @@ -83,5 +83,30 @@ namespace WebsitePanel.Portal } #endregion + + #region Security Groups + + ExchangeAccountsPaged accounts; + + public int GetOrganizationSecurityGroupsPagedCount(int itemId, string accountTypes, + string filterColumn, string filterValue) + { + return accounts.RecordsCount; + } + + public ExchangeAccount[] GetOrganizationSecurityGroupsPaged(int itemId, string accountTypes, + string filterColumn, string filterValue, + int maximumRows, int startRowIndex, string sortColumn) + { + if (!String.IsNullOrEmpty(filterValue)) + filterValue = filterValue + "%"; + + accounts = ES.Services.Organizations.GetOrganizationSecurityGroupsPaged(itemId, + filterColumn, filterValue, sortColumn, startRowIndex, maximumRows); + + return accounts.PageItems; + } + + #endregion } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationCreateSecurityGroup.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationCreateSecurityGroup.ascx.resx new file mode 100644 index 00000000..248dbc90 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationCreateSecurityGroup.ascx.resx @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + ShowProgressDialog('Creating group ...'); + + + Create Group + + + + + + Display Name: * + + + Create New Group + + + Groups + + + Enter Display Name + + + * + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationSecurityGroupGeneralSettings.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationSecurityGroupGeneralSettings.ascx.resx new file mode 100644 index 00000000..324edb44 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationSecurityGroupGeneralSettings.ascx.resx @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ShowProgressDialog('Updating group settings...'); + + + Save Changes + + + Hide from Address Book + + + + + + Members: + + + Notes: + + + Edit Group + + + Groups + + + Enter Display Name + + + * + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationSecurityGroups.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationSecurityGroups.ascx.resx new file mode 100644 index 00000000..e549521d --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationSecurityGroups.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 + + + Create New Group + + + if(!confirm('Are you sure you want to delete this group?')) return false; else ShowProgressDialog('Deleting group...'); + + + Delete + + + Delete Group + + + Search + + + Display Name + + + + + + No groups have been created. To create a new group click "Create New Group" button. + + + Display Name + + + Groups + + + Groups + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDisclaimerGeneralSettings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDisclaimerGeneralSettings.ascx.designer.cs index d6b1088f..e7de40fb 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDisclaimerGeneralSettings.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDisclaimerGeneralSettings.ascx.designer.cs @@ -1,3 +1,31 @@ +// Copyright (c) 2011, 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. diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListMemberOf.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListMemberOf.ascx index 3ee22461..e55e65e6 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListMemberOf.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListMemberOf.ascx @@ -39,7 +39,8 @@ MailboxesEnabled="false" EnableMailboxOnly="true" ContactsEnabled="false" - DistributionListsEnabled="true" /> + DistributionListsEnabled="true" + SecurityGroupsEnabled="true" /> diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMemberOf.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMemberOf.ascx index aa56e6a5..9e8c82cb 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMemberOf.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMemberOf.ascx @@ -41,7 +41,8 @@ MailboxesEnabled="false" EnableMailboxOnly="true" ContactsEnabled="false" - DistributionListsEnabled="true" /> + DistributionListsEnabled="true" + SecurityGroupsEnabled="true" /> diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateSecurityGroup.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateSecurityGroup.ascx new file mode 100644 index 00000000..04c27a4a --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateSecurityGroup.ascx @@ -0,0 +1,44 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="OrganizationCreateSecurityGroup.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.OrganizationCreateSecurityGroup" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/EmailAddress.ascx" TagName="EmailAddress" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" 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/OrganizationCreateSecurityGroup.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateSecurityGroup.ascx.cs new file mode 100644 index 00000000..455af2fa --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateSecurityGroup.ascx.cs @@ -0,0 +1,78 @@ +// Copyright (c) 2012, 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.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; +using WebsitePanel.EnterpriseServer; + +namespace WebsitePanel.Portal.ExchangeServer +{ + public partial class OrganizationCreateSecurityGroup : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + } + + protected void btnCreate_Click(object sender, EventArgs e) + { + CreateSecurityGroup(); + } + + private void CreateSecurityGroup() + { + if (!Page.IsValid) + return; + try + { + int accountId = ES.Services.Organizations.CreateSecurityGroup(PanelRequest.ItemID, txtDisplayName.Text); + + if (accountId < 0) + { + messageBox.ShowResultMessage(accountId); + return; + } + + Response.Redirect(EditUrl("AccountID", accountId.ToString(), "secur_group_settings", + "SpaceID=" + PanelSecurity.PackageId.ToString(), + "ItemID=" + PanelRequest.ItemID.ToString())); + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("ORGANIZATION_CREATE_SECURITY_GROUP", ex); + } + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateSecurityGroup.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateSecurityGroup.ascx.designer.cs new file mode 100644 index 00000000..b466faaa --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateSecurityGroup.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 OrganizationCreateSecurityGroup { + + /// + /// 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.ExchangeServer.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Menu menu; + + /// + /// 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; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// locDisplayName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locDisplayName; + + /// + /// txtDisplayName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtDisplayName; + + /// + /// valRequireDisplayName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireDisplayName; + + /// + /// btnCreate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCreate; + + /// + /// ValidationSummary1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ValidationSummary ValidationSummary1; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroupGeneralSettings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroupGeneralSettings.ascx new file mode 100644 index 00000000..2a5e3112 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroupGeneralSettings.ascx @@ -0,0 +1,71 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="OrganizationSecurityGroupGeneralSettings.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.OrganizationSecurityGroupGeneralSettings" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/UsersList.ascx" TagName="UsersList" TagPrefix="wsp"%> +<%@ Register Src="UserControls/SecurityGroupTabs.ascx" TagName="SecurityGroupTabs" TagPrefix="wsp"%> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register TagPrefix="wsp" TagName="CollapsiblePanel" Src="../UserControls/CollapsiblePanel.ascx" %> +<%@ 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/OrganizationSecurityGroupGeneralSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroupGeneralSettings.ascx.cs new file mode 100644 index 00000000..1c0d244b --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroupGeneralSettings.ascx.cs @@ -0,0 +1,122 @@ +// Copyright (c) 2012, 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.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; + +using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.EnterpriseServer; + +namespace WebsitePanel.Portal.ExchangeServer +{ + public partial class OrganizationSecurityGroupGeneralSettings : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + BindSettings(); + } + } + + private void BindSettings() + { + try + { + // get settings + OrganizationSecurityGroup securityGroup = ES.Services.Organizations.GetSecurityGroupGeneralSettings( + PanelRequest.ItemID, PanelRequest.AccountID); + + litDisplayName.Text = PortalAntiXSS.Encode(securityGroup.DisplayName); + + // bind form + txtDisplayName.Text = securityGroup.DisplayName; + + members.SetAccounts(securityGroup.MembersAccounts); + + txtNotes.Text = securityGroup.Notes; + + if (securityGroup.IsDefault) + { + txtDisplayName.ReadOnly = true; + txtNotes.ReadOnly = true; + members.Enabled = false; + + btnSave.Visible = false; + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("ORGANIZATION_GET_SECURITY_GROUP_SETTINGS", ex); + } + } + + private void SaveSettings() + { + if (!Page.IsValid) + return; + + try + { + int result = ES.Services.Organizations.SetSecurityGroupGeneralSettings( + PanelRequest.ItemID, + PanelRequest.AccountID, + txtDisplayName.Text, + members.GetAccounts(), + txtNotes.Text); + + if (result < 0) + { + messageBox.ShowResultMessage(result); + return; + } + + litDisplayName.Text = PortalAntiXSS.Encode(txtDisplayName.Text); + + messageBox.ShowSuccessMessage("ORGANIZATION_UPDATE_SECURITY_GROUP_SETTINGS"); + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("ORGANIZATION_UPDATE_SECURITY_GROUP_SETTINGS", ex); + } + } + + protected void btnSave_Click(object sender, EventArgs e) + { + SaveSettings(); + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroupGeneralSettings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroupGeneralSettings.ascx.designer.cs new file mode 100644 index 00000000..5507f981 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroupGeneralSettings.ascx.designer.cs @@ -0,0 +1,197 @@ +// Copyright (c) 2012, 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. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.ExchangeServer { + + + public partial class OrganizationSecurityGroupGeneralSettings { + + /// + /// 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.ExchangeServer.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Menu menu; + + /// + /// 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; + + /// + /// tabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.SecurityGroupTabs 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; + + /// + /// locDisplayName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locDisplayName; + + /// + /// txtDisplayName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtDisplayName; + + /// + /// valRequireDisplayName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireDisplayName; + + /// + /// locMembers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locMembers; + + /// + /// members control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.UsersList members; + + /// + /// locNotes control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locNotes; + + /// + /// txtNotes control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtNotes; + + /// + /// btnSave control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnSave; + + /// + /// ValidationSummary1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ValidationSummary ValidationSummary1; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroups.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroups.ascx new file mode 100644 index 00000000..13dcbc4c --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroups.ascx @@ -0,0 +1,90 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="OrganizationSecurityGroups.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.OrganizationSecurityGroups" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + +
+
+
+ +
+
+ +
+
+
+
+ + +
+ +
+ +
+
+ +
+
+ + + + 10 + 20 + 50 + 100 + + + + DisplayName + + +
+
+ + + + + + + + <%# Eval("DisplayName") %> + + + + + + + + + + + + + + + + + + +
+
+
+
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroups.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroups.ascx.cs new file mode 100644 index 00000000..6719af20 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroups.ascx.cs @@ -0,0 +1,114 @@ +// Copyright (c) 2012, 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.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; + +using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.EnterpriseServer; + +namespace WebsitePanel.Portal.ExchangeServer +{ + public partial class OrganizationSecurityGroups : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + + } + + protected void btnCreateGroup_Click(object sender, EventArgs e) + { + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "create_secur_group", + "SpaceID=" + PanelSecurity.PackageId.ToString())); + } + + public string GetListEditUrl(string accountId) + { + return EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "secur_group_settings", + "AccountID=" + accountId, + "ItemID=" + PanelRequest.ItemID.ToString()); + } + + public bool IsNotDefault(string accountType) + { + return (ExchangeAccountType)Enum.Parse(typeof(ExchangeAccountType), accountType) != ExchangeAccountType.DefaultSecurityGroup; + } + + protected void odsSecurityGroupsPaged_Selected(object sender, ObjectDataSourceStatusEventArgs e) + { + if (e.Exception != null) + { + messageBox.ShowErrorMessage("ORGANIZATION_GET_SECURITY_GROUP", e.Exception); + e.ExceptionHandled = true; + } + } + + protected void gvSecurityGroups_RowCommand(object sender, GridViewCommandEventArgs e) + { + if (e.CommandName == "DeleteItem") + { + // delete security group + int accountId = Utils.ParseInt(e.CommandArgument.ToString(), 0); + + try + { + int result = ES.Services.Organizations.DeleteSecurityGroup(PanelRequest.ItemID, accountId); + if (result < 0) + { + messageBox.ShowResultMessage(result); + return; + } + + // rebind grid + gvGroups.DataBind(); + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("ORGANIZATION_DELETE_SECURITY_GROUP", ex); + } + } + } + + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + gvGroups.PageSize = Convert.ToInt16(ddlPageSize.SelectedValue); + + // rebind grid + gvGroups.DataBind(); + + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroups.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroups.ascx.designer.cs new file mode 100644 index 00000000..1c8e4bc9 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroups.ascx.designer.cs @@ -0,0 +1,150 @@ +//------------------------------------------------------------------------------ +// +// 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 OrganizationSecurityGroups { + + /// + /// 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.ExchangeServer.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Menu menu; + + /// + /// 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; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// btnCreateGroup control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCreateGroup; + + /// + /// SearchPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel SearchPanel; + + /// + /// locSearch control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locSearch; + + /// + /// ddlPageSize control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlPageSize; + + /// + /// ddlSearchColumn control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlSearchColumn; + + /// + /// txtSearchValue control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtSearchValue; + + /// + /// cmdSearch control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ImageButton cmdSearch; + + /// + /// gvGroups control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvGroups; + + /// + /// odsSecurityGroupsPaged control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ObjectDataSource odsSecurityGroupsPaged; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserMemberOf.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserMemberOf.ascx index b2479926..36c12744 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserMemberOf.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserMemberOf.ascx @@ -10,6 +10,7 @@ <%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> <%@ Register Src="UserControls/EmailAddress.ascx" TagName="EmailAddress" TagPrefix="wsp" %> <%@ Register Src="UserControls/AccountsList.ascx" TagName="AccountsList" TagPrefix="wsp" %> +<%@ Register Src="UserControls/GroupsList.ascx" TagName="GroupsList" TagPrefix="wsp" %> @@ -42,9 +43,9 @@ - - - + + + + + + + + + + + + +
newDistributionLists = new List(distrlists.GetAccounts()); foreach (ExchangeAccount oldlist in oldDistributionLists) @@ -90,7 +97,29 @@ namespace WebsitePanel.Portal.HostedSolution foreach (string newlist in newDistributionLists) ES.Services.ExchangeServer.AddDistributionListMember(PanelRequest.ItemID, newlist, PanelRequest.AccountID); + //Security Groups + ExchangeAccount[] oldDSecurityGroups = ES.Services.Organizations.GetSecurityGroupsByMember(PanelRequest.ItemID, PanelRequest.AccountID); + List newSecurityGroups = new List(securegroups.GetAccounts()); + foreach (ExchangeAccount oldgroup in oldDSecurityGroups) + { + if (newSecurityGroups.Contains(oldgroup.AccountName)) + { + newSecurityGroups.Remove(oldgroup.AccountName); + } + else + { + ES.Services.Organizations.DeleteUserFromSecurityGroup(PanelRequest.ItemID, PanelRequest.AccountID, oldgroup.AccountName); + } + } + + foreach (string newgroup in newSecurityGroups) + { + ES.Services.Organizations.AddUserToSecurityGroup(PanelRequest.ItemID, PanelRequest.AccountID, newgroup); + } + messageBox.ShowSuccessMessage("EXCHANGE_UPDATE_MAILBOX_SETTINGS"); + + BindSettings(); } catch (Exception ex) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserMemberOf.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserMemberOf.ascx.designer.cs index 72bbeccd..07a67d81 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserMemberOf.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserMemberOf.ascx.designer.cs @@ -1,3 +1,32 @@ +// Copyright (c) 2012, 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. @@ -103,22 +132,22 @@ namespace WebsitePanel.Portal.HostedSolution { protected global::WebsitePanel.Portal.CollapsiblePanel secDistributionLists; /// - /// DistributionLists control. + /// DistributionListsPanel control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.Panel DistributionLists; + protected global::System.Web.UI.WebControls.Panel DistributionListsPanel; /// - /// GeneralUpdatePanel control. + /// DLGeneralUpdatePanel control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.UpdatePanel GeneralUpdatePanel; + protected global::System.Web.UI.UpdatePanel DLGeneralUpdatePanel; /// /// distrlists control. @@ -129,6 +158,42 @@ namespace WebsitePanel.Portal.HostedSolution { /// protected global::WebsitePanel.Portal.ExchangeServer.UserControls.AccountsList distrlists; + /// + /// secSecurityGroups control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secSecurityGroups; + + /// + /// SecurityGroupsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel SecurityGroupsPanel; + + /// + /// SCGeneralUpdatePanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UpdatePanel SCGeneralUpdatePanel; + + /// + /// securegroups control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.GroupsList securegroups; + /// /// btnSave control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/AccountsList.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/AccountsList.ascx index 4b772a77..d0a54064 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/AccountsList.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/AccountsList.ascx @@ -69,6 +69,8 @@ meta:resourcekey="chkIncludeContacts" AutoPostBack="true" CssClass="Normal" OnCheckedChanged="chkIncludeMailboxes_CheckedChanged" /> +
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/AccountsList.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/AccountsList.ascx.cs index 24b053ee..6884ce2c 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/AccountsList.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/AccountsList.ascx.cs @@ -67,6 +67,12 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls set { ViewState["DistributionListsEnabled"] = value; } } + public bool SecurityGroupsEnabled + { + get { return ViewState["SecurityGroupsEnabled"] != null ? (bool)ViewState["SecurityGroupsEnabled"] : false; } + set { ViewState["SecurityGroupsEnabled"] = value; } + } + public int ExcludeAccountId { get { return PanelRequest.AccountID; } @@ -109,6 +115,9 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls chkIncludeContacts.Checked = ContactsEnabled; chkIncludeLists.Visible = DistributionListsEnabled; chkIncludeLists.Checked = DistributionListsEnabled; + + chkIncludeGroups.Visible = SecurityGroupsEnabled; + chkIncludeGroups.Checked = SecurityGroupsEnabled; } // register javascript @@ -131,14 +140,16 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls { ExchangeAccountType accountType = (ExchangeAccountType)accountTypeId; string imgName = "mailbox_16.gif"; - if (accountType == ExchangeAccountType.Contact) - imgName = "contact_16.gif"; - else if (accountType == ExchangeAccountType.DistributionList) - imgName = "dlist_16.gif"; + if (accountType == ExchangeAccountType.Contact) + imgName = "contact_16.gif"; + else if (accountType == ExchangeAccountType.DistributionList) + imgName = "dlist_16.gif"; else if (accountType == ExchangeAccountType.Room) imgName = "room_16.gif"; else if (accountType == ExchangeAccountType.Equipment) imgName = "equipment_16.gif"; + else if (accountType == ExchangeAccountType.Equipment) + imgName = "dlist_16.gif"; return GetThemedImage("Exchange/" + imgName); } @@ -174,7 +185,7 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls { ExchangeAccount[] accounts = ES.Services.ExchangeServer.SearchAccounts(PanelRequest.ItemID, chkIncludeMailboxes.Checked, chkIncludeContacts.Checked, chkIncludeLists.Checked, - chkIncludeRooms.Checked, chkIncludeEquipment.Checked, + chkIncludeRooms.Checked, chkIncludeEquipment.Checked, chkIncludeGroups.Checked, ddlSearchColumn.SelectedValue, txtSearchValue.Text + "%", ""); if (ExcludeAccountId > 0) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/AccountsList.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/AccountsList.ascx.designer.cs index 706f9ee3..e85c7542 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/AccountsList.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/AccountsList.ascx.designer.cs @@ -1,22 +1,43 @@ +// Copyright (c) 2012, 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. -// Runtime Version:2.0.50727.832 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace WebsitePanel.Portal.ExchangeServer.UserControls { - /// - /// AccountsList class. - /// - /// - /// Auto-generated class. - /// public partial class AccountsList { /// @@ -136,6 +157,15 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls { /// protected global::System.Web.UI.WebControls.CheckBox chkIncludeLists; + /// + /// chkIncludeGroups control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkIncludeGroups; + /// /// SearchPanel control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/AccountsListWithPermissions.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/AccountsListWithPermissions.ascx.cs index 3cc8f1a4..94351768 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/AccountsListWithPermissions.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/AccountsListWithPermissions.ascx.cs @@ -184,7 +184,7 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls { ExchangeAccount[] accounts = ES.Services.ExchangeServer.SearchAccounts(PanelRequest.ItemID, chkIncludeMailboxes.Checked, chkIncludeContacts.Checked, chkIncludeLists.Checked, - chkIncludeRooms.Checked, chkIncludeEquipment.Checked, + chkIncludeRooms.Checked, chkIncludeEquipment.Checked, false, ddlSearchColumn.SelectedValue, txtSearchValue.Text + "%", ""); if (ExcludeAccountId > 0) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/AccountsList.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/AccountsList.ascx.resx index 624c5b9d..e8f53b78 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/AccountsList.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/AccountsList.ascx.resx @@ -112,10 +112,10 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Add... @@ -135,6 +135,9 @@ Equipment + + Groups + Distribution Lists diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/GroupsList.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/GroupsList.ascx.resx new file mode 100644 index 00000000..58447d25 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/GroupsList.ascx.resx @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + Add... + + + Add Groups + + + Cancel + + + Delete + + + Display Name + + + The list of groups is empty. Click "Add..." button to add groups. + + + Display Name + + + No groups found. + + + Groups + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/Menu.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/Menu.ascx.resx index 88b4cd31..aac6db39 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/Menu.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/Menu.ascx.resx @@ -201,4 +201,7 @@ Lync Federation Domains + + Groups + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/SecurityGroupTabs.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/SecurityGroupTabs.ascx.resx new file mode 100644 index 00000000..54222974 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/SecurityGroupTabs.ascx.resx @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + E-mail Addresses + + + Mail Flow Settings + + + General + + + Permissions + + + Member Of + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/UsersList.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/UsersList.ascx.resx new file mode 100644 index 00000000..54fc0f61 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/UsersList.ascx.resx @@ -0,0 +1,171 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + Add... + + + Add Accounts + + + Cancel + + + Delete + + + Contacts + + + Equipment + + + Distribution Lists + + + Mailboxes + + + Rooms + + + Display Name + + + E-mail Address + + + The list of accounts is empty. Click "Add..." button to add accounts. + + + Display Name + + + E-mail Address + + + No accounts found. + + + Organization Users + + + Include in search: + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/GroupsList.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/GroupsList.ascx new file mode 100644 index 00000000..185955d8 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/GroupsList.ascx @@ -0,0 +1,105 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="GroupsList.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.UserControls.GroupsList" %> +<%@ Register Src="../../UserControls/PopupHeader.ascx" TagName="PopupHeader" TagPrefix="wsp" %> + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/GroupsList.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/GroupsList.ascx.cs new file mode 100644 index 00000000..ffc23fdf --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/GroupsList.ascx.cs @@ -0,0 +1,232 @@ +// Copyright (c) 2012, 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.UI; +using System.Web.UI.WebControls; +using WebsitePanel.Providers.HostedSolution; +using System.Linq; + +namespace WebsitePanel.Portal.ExchangeServer.UserControls +{ + public partial class GroupsList : WebsitePanelControlBase + { + private enum SelectedState + { + All, + Selected, + Unselected + } + + public void SetAccounts(ExchangeAccount[] accounts) + { + BindAccounts(accounts, false); + } + + public string[] GetAccounts() + { + // get selected accounts + List selectedAccounts = GetGridViewAccounts(gvGroups, SelectedState.All); + + List accountNames = new List(); + foreach (ExchangeAccount account in selectedAccounts) + accountNames.Add(account.AccountName); + + return accountNames.ToArray(); + } + + protected void Page_Load(object sender, EventArgs e) + { + // register javascript + if (!Page.ClientScript.IsClientScriptBlockRegistered("SelectAllCheckboxes")) + { + string script = @" function SelectAllCheckboxes(box) + { + var state = box.checked; + var elm = box.parentElement.parentElement.parentElement.parentElement.getElementsByTagName(""INPUT""); + for(i = 0; i < elm.length; i++) + if(elm[i].type == ""checkbox"" && elm[i].id != box.id && elm[i].checked != state && !elm[i].disabled) + elm[i].checked = state; + }"; + Page.ClientScript.RegisterClientScriptBlock(typeof(AccountsList), "SelectAllCheckboxes", + script, true); + } + } + + public string GetAccountImage(int accountTypeId) + { + ExchangeAccountType accountType = (ExchangeAccountType)accountTypeId; + string imgName = "dlist_16.gif"; + + return GetThemedImage("Exchange/" + imgName); + } + + protected void btnAdd_Click(object sender, EventArgs e) + { + // bind all accounts + BindPopupAccounts(); + + // show modal + AddGroupsModal.Show(); + } + + protected void btnDelete_Click(object sender, EventArgs e) + { + // get selected accounts + List selectedAccounts = GetGridViewAccounts(gvGroups, SelectedState.Unselected); + + // add to the main list + BindAccounts(selectedAccounts.ToArray(), false); + } + + protected void btnAddSelected_Click(object sender, EventArgs e) + { + // get selected accounts + List selectedAccounts = GetGridViewAccounts(gvPopupGroups, SelectedState.Selected); + + // add to the main list + BindAccounts(selectedAccounts.ToArray(), true); + } + + private void BindPopupAccounts() + { + ExchangeAccount[] accounts = ES.Services.Organizations.SearchOrganizationAccounts(PanelRequest.ItemID, + ddlSearchColumn.SelectedValue, txtSearchValue.Text + "%", "", true); + + accounts = accounts.Where(x => !GetAccounts().Contains(x.AccountName)).ToArray(); + + gvPopupGroups.DataSource = accounts; + gvPopupGroups.DataBind(); + } + + private void BindAccounts(ExchangeAccount[] newAccounts, bool preserveExisting) + { + // get binded addresses + List accounts = new List(); + if(preserveExisting) + accounts.AddRange(GetGridViewAccounts(gvGroups, SelectedState.All)); + + // add new accounts + if (newAccounts != null) + { + foreach (ExchangeAccount newAccount in newAccounts) + { + // check if exists + bool exists = false; + foreach (ExchangeAccount account in accounts) + { + if (String.Compare(newAccount.AccountName, account.AccountName, true) == 0) + { + exists = true; + break; + } + } + + if (exists) + continue; + + accounts.Add(newAccount); + } + } + + gvGroups.DataSource = accounts; + gvGroups.DataBind(); + + UpdateGridViewAccounts(gvGroups); + + btnDelete.Visible = gvGroups.Rows.Count > 0; + } + + private List GetGridViewAccounts(GridView gv, SelectedState state) + { + List accounts = new List(); + for (int i = 0; i < gv.Rows.Count; i++) + { + GridViewRow row = gv.Rows[i]; + CheckBox chkSelect = (CheckBox)row.FindControl("chkSelect"); + if (chkSelect == null) + continue; + + ExchangeAccount account = new ExchangeAccount(); + account.AccountType = (ExchangeAccountType)Enum.Parse(typeof(ExchangeAccountType), ((Literal)row.FindControl("litAccountType")).Text); + account.AccountName = (string)gv.DataKeys[i][0]; + account.DisplayName = ((Literal)row.FindControl("litDisplayName")).Text; + + if(state == SelectedState.All || + (state == SelectedState.Selected && chkSelect.Checked) || + (state == SelectedState.Unselected && !chkSelect.Checked)) + accounts.Add(account); + } + return accounts; + } + + private void UpdateGridViewAccounts(GridView gv) + { + CheckBox chkSelectAll = (CheckBox)gv.HeaderRow.FindControl("chkSelectAll"); + + for (int i = 0; i < gv.Rows.Count; i++) + { + GridViewRow row = gv.Rows[i]; + CheckBox chkSelect = (CheckBox)row.FindControl("chkSelect"); + if (chkSelect == null) + { + continue; + } + + ExchangeAccountType exAccountType = (ExchangeAccountType)Enum.Parse(typeof(ExchangeAccountType), ((Literal)row.FindControl("litAccountType")).Text); + + if (exAccountType != ExchangeAccountType.DefaultSecurityGroup) + { + chkSelectAll = null; + chkSelect.Enabled = true; + } + else + { + chkSelect.Enabled = false; + } + } + + if (chkSelectAll != null) + { + chkSelectAll.Enabled = false; + } + + } + + protected void chkIncludeMailboxes_CheckedChanged(object sender, EventArgs e) + { + BindPopupAccounts(); + } + + protected void cmdSearch_Click(object sender, ImageClickEventArgs e) + { + BindPopupAccounts(); + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/GroupsList.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/GroupsList.ascx.designer.cs new file mode 100644 index 00000000..b23a8c5d --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/GroupsList.ascx.designer.cs @@ -0,0 +1,188 @@ +// Copyright (c) 2012, 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. +// +// 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 GroupsList { + + /// + /// GroupsUpdatePanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UpdatePanel GroupsUpdatePanel; + + /// + /// btnAdd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnAdd; + + /// + /// btnDelete control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnDelete; + + /// + /// gvGroups control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvGroups; + + /// + /// AddGroupsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel AddGroupsPanel; + + /// + /// headerAddGroups control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize headerAddGroups; + + /// + /// AddGroupsUpdatePanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UpdatePanel AddGroupsUpdatePanel; + + /// + /// SearchPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel SearchPanel; + + /// + /// ddlSearchColumn control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlSearchColumn; + + /// + /// txtSearchValue control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtSearchValue; + + /// + /// cmdSearch control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ImageButton cmdSearch; + + /// + /// gvPopupGroups control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvPopupGroups; + + /// + /// btnAddSelected control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnAddSelected; + + /// + /// btnCancelAdd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCancelAdd; + + /// + /// btnAddAccountsFake control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnAddAccountsFake; + + /// + /// AddGroupsModal control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::AjaxControlToolkit.ModalPopupExtender AddGroupsModal; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/MailboxSelector.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/MailboxSelector.ascx.cs index 62431785..561d897c 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/MailboxSelector.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/MailboxSelector.ascx.cs @@ -157,7 +157,7 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls { ExchangeAccount[] accounts = ES.Services.ExchangeServer.SearchAccounts(PanelRequest.ItemID, chkIncludeMailboxes.Checked, chkIncludeContacts.Checked, chkIncludeLists.Checked, - chkIncludeRooms.Checked, chkIncludeEquipment.Checked, + chkIncludeRooms.Checked, chkIncludeEquipment.Checked, false, ddlSearchColumn.SelectedValue, txtSearchValue.Text + "%", ""); if (ExcludeAccountId > 0) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs index 3792ae03..639a8fed 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs @@ -178,6 +178,9 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls if (Utils.CheckQouta(Quotas.ORGANIZATION_USERS, cntx)) organizationGroup.MenuItems.Add(CreateMenuItem("Users", "users")); + if (Utils.CheckQouta(Quotas.ORGANIZATION_SECURITYGROUPMANAGEMENT, cntx)) + organizationGroup.MenuItems.Add(CreateMenuItem("SecurityGroups", "secur_groups")); + if (organizationGroup.MenuItems.Count > 0) groups.Add(organizationGroup); } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/SecurityGroupTabs.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/SecurityGroupTabs.ascx new file mode 100644 index 00000000..9a1082e8 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/SecurityGroupTabs.ascx @@ -0,0 +1,24 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SecurityGroupTabs.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.UserControls.SecurityGroupTabs" %> + + + + +
+    + + + + + <%# Eval("Name") %> + + + + + + <%# Eval("Name") %> + + + +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/SecurityGroupTabs.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/SecurityGroupTabs.ascx.cs new file mode 100644 index 00000000..e99be105 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/SecurityGroupTabs.ascx.cs @@ -0,0 +1,81 @@ +// Copyright (c) 2012, 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 WebsitePanel.Portal.Code.UserControls; +using WebsitePanel.WebPortal; +using WebsitePanel.EnterpriseServer; + + +namespace WebsitePanel.Portal.ExchangeServer.UserControls +{ + public partial class SecurityGroupTabs : WebsitePanelControlBase + { + private string selectedTab; + public string SelectedTab + { + get { return selectedTab; } + set { selectedTab = value; } + } + + protected void Page_Load(object sender, EventArgs e) + { + BindTabs(); + } + + private void BindTabs() + { + List tabsList = new List(); + tabsList.Add(CreateTab("secur_group_settings", "Tab.Settings")); + + PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); + + // find selected menu item + int idx = 0; + foreach (Tab tab in tabsList) + { + if (String.Compare(tab.Id, SelectedTab, true) == 0) + break; + idx++; + } + dlTabs.SelectedIndex = idx; + + dlTabs.DataSource = tabsList; + dlTabs.DataBind(); + } + + private Tab CreateTab(string id, string text) + { + return new Tab(id, GetLocalizedString(text), + HostModule.EditUrl("AccountID", PanelRequest.AccountID.ToString(), id, + "SpaceID=" + PanelSecurity.PackageId.ToString(), + "ItemID=" + PanelRequest.ItemID.ToString())); + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/SecurityGroupTabs.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/SecurityGroupTabs.ascx.designer.cs new file mode 100644 index 00000000..90b558b3 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/SecurityGroupTabs.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 SecurityGroupTabs { + + /// + /// dlTabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DataList dlTabs; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserSelector.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserSelector.ascx index a5c22ab2..de8190df 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserSelector.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserSelector.ascx @@ -4,6 +4,7 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserTabs.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserTabs.ascx.cs index cdedb8aa..99d73a43 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserTabs.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserTabs.ascx.cs @@ -59,7 +59,7 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); - if (Utils.CheckQouta(Quotas.EXCHANGE2007_DISTRIBUTIONLISTS, cntx)) + if (Utils.CheckQouta(Quotas.ORGANIZATION_SECURITYGROUPMANAGEMENT, cntx) || Utils.CheckQouta(Quotas.EXCHANGE2007_DISTRIBUTIONLISTS, cntx)) tabsList.Add(CreateTab("user_memberof", "Tab.MemberOf")); // find selected menu item diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UsersList.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UsersList.ascx new file mode 100644 index 00000000..5e68681b --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UsersList.ascx @@ -0,0 +1,119 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UsersList.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.UserControls.UsersList" %> +<%@ Register Src="../../UserControls/PopupHeader.ascx" TagName="PopupHeader" TagPrefix="wsp" %> + + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UsersList.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UsersList.ascx.cs new file mode 100644 index 00000000..ec47b2e2 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UsersList.ascx.cs @@ -0,0 +1,261 @@ +// Copyright (c) 2012, 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.UI; +using System.Web.UI.WebControls; +using WebsitePanel.Providers.HostedSolution; +using System.Linq; + +namespace WebsitePanel.Portal.ExchangeServer.UserControls +{ + public partial class UsersList : WebsitePanelControlBase + { + public const string DirectionString = "DirectionString"; + + private bool _enabled = true; + + public bool Enabled + { + get { return _enabled; } + set { _enabled = value; } + } + + private enum SelectedState + { + All, + Selected, + Unselected + } + + public int ExcludeAccountId + { + get { return PanelRequest.AccountID; } + } + + public void SetAccounts(ExchangeAccount[] accounts) + { + BindAccounts(accounts, false); + } + + public string[] GetAccounts() + { + // get selected accounts + List selectedAccounts = GetGridViewAccounts(gvAccounts, SelectedState.All); + + List accountNames = new List(); + foreach (ExchangeAccount account in selectedAccounts) + accountNames.Add(account.AccountName); + + return accountNames.ToArray(); + } + + protected void Page_Load(object sender, EventArgs e) + { + // register javascript + if (!Page.ClientScript.IsClientScriptBlockRegistered("SelectAllCheckboxes")) + { + string script = @" function SelectAllCheckboxes(box) + { + var state = box.checked; + var elm = box.parentElement.parentElement.parentElement.parentElement.getElementsByTagName(""INPUT""); + for(i = 0; i < elm.length; i++) + if(elm[i].type == ""checkbox"" && elm[i].id != box.id && elm[i].checked != state && !elm[i].disabled) + elm[i].checked = state; + }"; + Page.ClientScript.RegisterClientScriptBlock(typeof(AccountsList), "SelectAllCheckboxes", + script, true); + } + + btnAdd.Visible = Enabled; + btnDelete.Visible = Enabled; + + gvAccounts.Columns[0].Visible = Enabled; + } + + protected void btnAdd_Click(object sender, EventArgs e) + { + // bind all accounts + BindPopupAccounts(); + + // show modal + AddAccountsModal.Show(); + } + + protected void btnDelete_Click(object sender, EventArgs e) + { + // get selected accounts + List selectedAccounts = GetGridViewAccounts(gvAccounts, SelectedState.Unselected); + + // add to the main list + BindAccounts(selectedAccounts.ToArray(), false); + } + + protected void btnAddSelected_Click(object sender, EventArgs e) + { + // get selected accounts + List selectedAccounts = GetGridViewAccounts(gvPopupAccounts, SelectedState.Selected); + + // add to the main list + BindAccounts(selectedAccounts.ToArray(), true); + } + + public string GetAccountImage(int accountTypeId) + { + string imgName = string.Empty; + + ExchangeAccountType accountType = (ExchangeAccountType)accountTypeId; + switch (accountType) + { + case ExchangeAccountType.Room: + imgName = "room_16.gif"; + break; + case ExchangeAccountType.Equipment: + imgName = "equipment_16.gif"; + break; + case ExchangeAccountType.SecurityGroup: + imgName = "dlist_16.gif"; + break; + default: + imgName = "admin_16.png"; + break; + } + + return GetThemedImage("Exchange/" + imgName); + } + + private void BindPopupAccounts() + { + ExchangeAccount[] accounts = ES.Services.Organizations.SearchOrganizationAccounts(PanelRequest.ItemID, + ddlSearchColumn.SelectedValue, txtSearchValue.Text + "%", "", false); + + List newAccounts = new List(); + + accounts = accounts.Where(x => !GetAccounts().Contains(x.AccountName)).ToArray(); + + if (ExcludeAccountId > 0) + { + List updatedAccounts = new List(); + foreach (ExchangeAccount account in accounts) + if (account.AccountId != ExcludeAccountId) + updatedAccounts.Add(account); + + accounts = updatedAccounts.ToArray(); + } + + Array.Sort(accounts, CompareAccount); + if (Direction == SortDirection.Ascending) + { + Array.Reverse(accounts); + Direction = SortDirection.Descending; + } + else + Direction = SortDirection.Ascending; + + gvPopupAccounts.DataSource = accounts; + gvPopupAccounts.DataBind(); + } + + private void BindAccounts(ExchangeAccount[] newAccounts, bool preserveExisting) + { + // get binded addresses + List accounts = new List(); + if(preserveExisting) + accounts.AddRange(GetGridViewAccounts(gvAccounts, SelectedState.All)); + + // add new accounts + if (newAccounts != null) + { + foreach (ExchangeAccount newAccount in newAccounts) + { + // check if exists + bool exists = false; + foreach (ExchangeAccount account in accounts) + { + if (String.Compare(newAccount.AccountName, account.AccountName, true) == 0) + { + exists = true; + break; + } + } + + if (exists) + continue; + + accounts.Add(newAccount); + } + } + + gvAccounts.DataSource = accounts; + gvAccounts.DataBind(); + + btnDelete.Visible = gvAccounts.Rows.Count > 0; + } + + private List GetGridViewAccounts(GridView gv, SelectedState state) + { + List accounts = new List(); + for (int i = 0; i < gv.Rows.Count; i++) + { + GridViewRow row = gv.Rows[i]; + CheckBox chkSelect = (CheckBox)row.FindControl("chkSelect"); + if (chkSelect == null) + continue; + + ExchangeAccount account = new ExchangeAccount(); + account.AccountType = (ExchangeAccountType)Enum.Parse(typeof(ExchangeAccountType), ((Literal)row.FindControl("litAccountType")).Text); + account.AccountName = (string)gv.DataKeys[i][0]; + account.DisplayName = ((Literal)row.FindControl("litDisplayName")).Text; + account.PrimaryEmailAddress = ((Literal)row.FindControl("litPrimaryEmailAddress")).Text; + + if(state == SelectedState.All || + (state == SelectedState.Selected && chkSelect.Checked) || + (state == SelectedState.Unselected && !chkSelect.Checked)) + accounts.Add(account); + } + return accounts; + } + + protected void cmdSearch_Click(object sender, ImageClickEventArgs e) + { + BindPopupAccounts(); + } + + private SortDirection Direction + { + get { return ViewState[DirectionString] == null ? SortDirection.Descending : (SortDirection)ViewState[DirectionString]; } + set { ViewState[DirectionString] = value; } + } + + private static int CompareAccount(ExchangeAccount user1, ExchangeAccount user2) + { + return string.Compare(user1.DisplayName, user2.DisplayName); + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UsersList.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UsersList.ascx.designer.cs new file mode 100644 index 00000000..d78039bf --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UsersList.ascx.designer.cs @@ -0,0 +1,159 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.ExchangeServer.UserControls { + + + public partial class UsersList { + + /// + /// AccountsUpdatePanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UpdatePanel AccountsUpdatePanel; + + /// + /// btnAdd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnAdd; + + /// + /// btnDelete control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnDelete; + + /// + /// gvAccounts control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvAccounts; + + /// + /// AddAccountsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel AddAccountsPanel; + + /// + /// headerAddAccounts control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize headerAddAccounts; + + /// + /// AddAccountsUpdatePanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UpdatePanel AddAccountsUpdatePanel; + + /// + /// SearchPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel SearchPanel; + + /// + /// ddlSearchColumn control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlSearchColumn; + + /// + /// txtSearchValue control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtSearchValue; + + /// + /// cmdSearch control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ImageButton cmdSearch; + + /// + /// gvPopupAccounts control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvPopupAccounts; + + /// + /// btnAddSelected control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnAddSelected; + + /// + /// btnCancelAdd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCancelAdd; + + /// + /// btnAddAccountsFake control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnAddAccountsFake; + + /// + /// AddAccountsModal control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::AjaxControlToolkit.ModalPopupExtender AddAccountsModal; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncAddLyncUserPlan.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncAddLyncUserPlan.ascx.designer.cs index 9c0a6814..bee30dfa 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncAddLyncUserPlan.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncAddLyncUserPlan.ascx.designer.cs @@ -1,3 +1,31 @@ +// Copyright (c) 2011, 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. diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncCreateUser.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncCreateUser.ascx.designer.cs index 9960aea1..54da4375 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncCreateUser.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncCreateUser.ascx.designer.cs @@ -1,4 +1,32 @@ -//------------------------------------------------------------------------------ +// Copyright (c) 2011, 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. // Runtime Version:2.0.50727.3074 diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.designer.cs index 0c138b8f..6e4bb3e6 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.designer.cs @@ -1,4 +1,32 @@ -//------------------------------------------------------------------------------ +// Copyright (c) 2011, 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. // Runtime Version:2.0.50727.3074 diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserPlanSelector.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserPlanSelector.ascx.designer.cs index 00a2ed12..8863bb48 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserPlanSelector.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserPlanSelector.ascx.designer.cs @@ -1,3 +1,31 @@ +// Copyright (c) 2011, 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. diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/LyncAllocatePhoneNumbers.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/LyncAllocatePhoneNumbers.ascx.designer.cs index 75726b99..cbaf20c5 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/LyncAllocatePhoneNumbers.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/LyncAllocatePhoneNumbers.ascx.designer.cs @@ -1,4 +1,32 @@ -//------------------------------------------------------------------------------ +// Copyright (c) 2011, 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. // Runtime Version:2.0.50727.3074 diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/LyncPhoneNumbers.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/LyncPhoneNumbers.ascx.designer.cs index c1274840..a320a71e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/LyncPhoneNumbers.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/LyncPhoneNumbers.ascx.designer.cs @@ -1,4 +1,32 @@ -//------------------------------------------------------------------------------ +// Copyright (c) 2011, 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. // Runtime Version:2.0.50727.3074 diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PhoneNumbers.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PhoneNumbers.ascx.designer.cs index 27c0d5f2..661ba9f5 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PhoneNumbers.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PhoneNumbers.ascx.designer.cs @@ -1,3 +1,31 @@ +// Copyright (c) 2011, 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. diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PhoneNumbersAddPhoneNumber.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PhoneNumbersAddPhoneNumber.ascx.designer.cs index 83b5948b..fddbcef1 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PhoneNumbersAddPhoneNumber.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PhoneNumbersAddPhoneNumber.ascx.designer.cs @@ -1,3 +1,31 @@ +// Copyright (c) 2011, 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. diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PhoneNumbersEditPhoneNumber.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PhoneNumbersEditPhoneNumber.ascx.designer.cs index 988c728e..eea14e36 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PhoneNumbersEditPhoneNumber.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PhoneNumbersEditPhoneNumber.ascx.designer.cs @@ -1,3 +1,31 @@ +// Copyright (c) 2011, 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. diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/CRM2011_Settings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/CRM2011_Settings.ascx.designer.cs index a7e103dc..86ec4040 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/CRM2011_Settings.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/CRM2011_Settings.ascx.designer.cs @@ -1,3 +1,31 @@ +// Copyright (c) 2011, 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. diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsLyncUserPlansPolicy.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsLyncUserPlansPolicy.ascx.designer.cs index c9c1b3b8..1f50b581 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsLyncUserPlansPolicy.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsLyncUserPlansPolicy.ascx.designer.cs @@ -1,4 +1,32 @@ -//------------------------------------------------------------------------------ +// Copyright (c) 2011, 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. // Runtime Version:2.0.50727.3074 diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/AllocatePackagePhoneNumbers.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/AllocatePackagePhoneNumbers.ascx.designer.cs index 49a18e99..e69c0bd6 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/AllocatePackagePhoneNumbers.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/AllocatePackagePhoneNumbers.ascx.designer.cs @@ -1,4 +1,32 @@ -//------------------------------------------------------------------------------ +// Copyright (c) 2011, 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. // Runtime Version:2.0.50727.3074 diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/PackagePhoneNumbers.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/PackagePhoneNumbers.ascx.designer.cs index dbbb5945..7239db9f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/PackagePhoneNumbers.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/PackagePhoneNumbers.ascx.designer.cs @@ -1,4 +1,32 @@ -//------------------------------------------------------------------------------ +// Copyright (c) 2011, 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. // Runtime Version:2.0.50727.3074 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 689afdc0..975475c9 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj @@ -230,6 +230,13 @@ OrganizationAddDomainName.ascx + + ASPXCodeBehind + OrganizationCreateSecurityGroup.ascx + + + OrganizationCreateSecurityGroup.ascx + OrganizationDomainNames.ascx ASPXCodeBehind @@ -251,6 +258,20 @@ ExchangeMailboxPlans.ascx + + ASPXCodeBehind + OrganizationSecurityGroupGeneralSettings.ascx + + + OrganizationSecurityGroupGeneralSettings.ascx + + + ASPXCodeBehind + OrganizationSecurityGroups.ascx + + + OrganizationSecurityGroups.ascx + OrganizationUserMemberOf.ascx ASPXCodeBehind @@ -262,6 +283,13 @@ AccountsListWithPermissions.ascx ASPXCodeBehind + + GroupsList.ascx + ASPXCodeBehind + + + GroupsList.ascx + MailboxPlanSelector.ascx ASPXCodeBehind @@ -269,6 +297,20 @@ MailboxPlanSelector.ascx + + SecurityGroupTabs.ascx + ASPXCodeBehind + + + SecurityGroupTabs.ascx + + + ASPXCodeBehind + UsersList.ascx + + + UsersList.ascx + UserTabs.ascx ASPXCodeBehind @@ -3934,11 +3976,17 @@ + + + + + + @@ -5143,6 +5191,15 @@ + + + + + + + + Designer + Designer