diff --git a/WebsitePanel.Installer/Sources/VersionInfo.cs b/WebsitePanel.Installer/Sources/VersionInfo.cs index 9ec60861..311c3539 100644 --- a/WebsitePanel.Installer/Sources/VersionInfo.cs +++ b/WebsitePanel.Installer/Sources/VersionInfo.cs @@ -1,35 +1,7 @@ -// 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:4.0.30319.18033 +// Runtime Version:4.0.30319.18051 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/WebsitePanel.Installer/Sources/WebsitePanel.Installer/Updater.exe b/WebsitePanel.Installer/Sources/WebsitePanel.Installer/Updater.exe index 6d39ffa3..113e18c1 100644 Binary files a/WebsitePanel.Installer/Sources/WebsitePanel.Installer/Updater.exe and b/WebsitePanel.Installer/Sources/WebsitePanel.Installer/Updater.exe differ 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 74c4b09f..47b3b188 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -1964,7 +1964,145 @@ WHERE RETURN GO +-- Lync Phone Numbers Quota +IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE ([QuotaName] = N'Lync.PhoneNumbers')) +BEGIN + INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (381, 41, 12, N'Lync.PhoneNumbers', N'Phone Numbers', 2, 0, NULL, NULL) +END +GO + + +ALTER FUNCTION [dbo].[CalculateQuotaUsage] +( + @PackageID int, + @QuotaID int +) +RETURNS int +AS + BEGIN + + DECLARE @QuotaTypeID int + SELECT @QuotaTypeID = QuotaTypeID FROM Quotas + WHERE QuotaID = @QuotaID + + IF @QuotaTypeID <> 2 + RETURN 0 + + DECLARE @Result int + + IF @QuotaID = 52 -- diskspace + SET @Result = dbo.CalculatePackageDiskspace(@PackageID) + ELSE IF @QuotaID = 51 -- bandwidth + SET @Result = dbo.CalculatePackageBandwidth(@PackageID) + ELSE IF @QuotaID = 53 -- domains + SET @Result = (SELECT COUNT(D.DomainID) FROM PackagesTreeCache AS PT + INNER JOIN Domains AS D ON D.PackageID = PT.PackageID + WHERE IsSubDomain = 0 AND IsInstantAlias = 0 AND IsDomainPointer = 0 AND PT.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 54 -- sub-domains + SET @Result = (SELECT COUNT(D.DomainID) FROM PackagesTreeCache AS PT + INNER JOIN Domains AS D ON D.PackageID = PT.PackageID + WHERE IsSubDomain = 1 AND IsInstantAlias = 0 AND IsDomainPointer = 0 AND PT.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 220 -- domain pointers + SET @Result = (SELECT COUNT(D.DomainID) FROM PackagesTreeCache AS PT + INNER JOIN Domains AS D ON D.PackageID = PT.PackageID + WHERE IsDomainPointer = 1 AND PT.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 71 -- scheduled tasks + SET @Result = (SELECT COUNT(S.ScheduleID) FROM PackagesTreeCache AS PT + INNER JOIN Schedule AS S ON S.PackageID = PT.PackageID + WHERE PT.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 305 -- RAM of VPS + SET @Result = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP + INNER JOIN ServiceItems AS SI ON SIP.ItemID = SI.ItemID + INNER JOIN PackagesTreeCache AS PT ON SI.PackageID = PT.PackageID + WHERE SIP.PropertyName = 'RamSize' AND PT.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 306 -- HDD of VPS + SET @Result = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP + INNER JOIN ServiceItems AS SI ON SIP.ItemID = SI.ItemID + INNER JOIN PackagesTreeCache AS PT ON SI.PackageID = PT.PackageID + WHERE SIP.PropertyName = 'HddSize' AND PT.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 309 -- External IP addresses of VPS + SET @Result = (SELECT COUNT(PIP.PackageAddressID) FROM PackageIPAddresses AS PIP + INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID + INNER JOIN PackagesTreeCache AS PT ON PIP.PackageID = PT.PackageID + WHERE PT.ParentPackageID = @PackageID AND IP.PoolID = 3) + ELSE IF @QuotaID = 100 -- Dedicated Web IP addresses + SET @Result = (SELECT COUNT(PIP.PackageAddressID) FROM PackageIPAddresses AS PIP + INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID + INNER JOIN PackagesTreeCache AS PT ON PIP.PackageID = PT.PackageID + WHERE PT.ParentPackageID = @PackageID AND IP.PoolID = 2) + ELSE IF @QuotaID = 350 -- RAM of VPSforPc + SET @Result = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP + INNER JOIN ServiceItems AS SI ON SIP.ItemID = SI.ItemID + INNER JOIN PackagesTreeCache AS PT ON SI.PackageID = PT.PackageID + WHERE SIP.PropertyName = 'Memory' AND PT.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 351 -- HDD of VPSforPc + SET @Result = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP + INNER JOIN ServiceItems AS SI ON SIP.ItemID = SI.ItemID + INNER JOIN PackagesTreeCache AS PT ON SI.PackageID = PT.PackageID + WHERE SIP.PropertyName = 'HddSize' AND PT.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 354 -- External IP addresses of VPSforPc + SET @Result = (SELECT COUNT(PIP.PackageAddressID) FROM PackageIPAddresses AS PIP + INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID + INNER JOIN PackagesTreeCache AS PT ON PIP.PackageID = PT.PackageID + WHERE PT.ParentPackageID = @PackageID AND IP.PoolID = 3) + ELSE IF @QuotaID = 319 -- BB Users + SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts ea + INNER JOIN BlackBerryUsers bu ON ea.AccountID = bu.AccountID + INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID + INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID + WHERE pt.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 320 -- OCS Users + SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts ea + INNER JOIN OCSUsers ocs ON ea.AccountID = ocs.AccountID + INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID + INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID + WHERE pt.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 206 -- HostedSolution.Users + SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts AS ea + INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID + INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID + WHERE pt.ParentPackageID = @PackageID AND ea.AccountType IN (1,5,6,7)) + ELSE IF @QuotaID = 78 -- Exchange2007.Mailboxes + SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts AS ea + INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID + INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID + WHERE pt.ParentPackageID = @PackageID + AND ea.AccountType IN (1) + AND ea.MailboxPlanId IS NOT NULL) + ELSE IF @QuotaID = 77 -- Exchange2007.DiskSpace + SET @Result = (SELECT SUM(B.MailboxSizeMB) FROM ExchangeAccounts AS ea + INNER JOIN ExchangeMailboxPlans AS B ON ea.MailboxPlanId = B.MailboxPlanId + INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID + INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID + WHERE pt.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 370 -- Lync.Users + SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts AS ea + INNER JOIN LyncUsers lu ON ea.AccountID = lu.AccountID + INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID + INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID + WHERE pt.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 376 -- Lync.EVUsers + SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts AS ea + INNER JOIN LyncUsers lu ON ea.AccountID = lu.AccountID + INNER JOIN LyncUserPlans lp ON lu.LyncUserPlanId = lp.LyncUserPlanId + INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID + INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID + WHERE pt.ParentPackageID = @PackageID AND lp.EnterpriseVoice = 1) + ELSE IF @QuotaID = 381 -- Dedicated Lync Phone Numbers + SET @Result = (SELECT COUNT(PIP.PackageAddressID) FROM PackageIPAddresses AS PIP + INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID + INNER JOIN PackagesTreeCache AS PT ON PIP.PackageID = PT.PackageID + WHERE PT.ParentPackageID = @PackageID AND IP.PoolID = 5) + ELSE + SET @Result = (SELECT COUNT(SI.ItemID) FROM Quotas AS Q + INNER JOIN ServiceItems AS SI ON SI.ItemTypeID = Q.ItemTypeID + INNER JOIN PackagesTreeCache AS PT ON SI.PackageID = PT.PackageID AND PT.ParentPackageID = @PackageID + WHERE Q.QuotaID = @QuotaID) + + RETURN @Result + END +GO -- Enterprise Storage Provider IF NOT EXISTS (SELECT * FROM [dbo].[ResourceGroups] WHERE [GroupName] = 'EnterpriseStorage') @@ -2006,6 +2144,7 @@ ALTER PROCEDURE [dbo].[SearchExchangeAccounts] @IncludeDistributionLists bit, @IncludeRooms bit, @IncludeEquipment bit, + @IncludeSecurityGroups bit, @FilterColumn nvarchar(50) = '', @FilterValue nvarchar(50) = '', @SortColumn nvarchar(50) @@ -2027,7 +2166,7 @@ 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 (@IncludeEquipment = 0 AND @IncludeContacts = 0 AND @IncludeDistributionLists = 0 AND @IncludeRooms = 0 AND @IncludeEquipment = 0 AND EA.AccountType = 8)) +OR (@IncludeSecurityGroups = 1 AND EA.AccountType = 8)) AND EA.ItemID = @ItemID ' @@ -2057,8 +2196,77 @@ WHERE ' + @condition print @sql exec sp_executesql @sql, N'@ItemID int, @IncludeMailboxes int, @IncludeContacts int, - @IncludeDistributionLists int, @IncludeRooms bit, @IncludeEquipment bit', -@ItemID, @IncludeMailboxes, @IncludeContacts, @IncludeDistributionLists, @IncludeRooms, @IncludeEquipment + @IncludeDistributionLists int, @IncludeRooms bit, @IncludeEquipment bit, @IncludeSecurityGroups bit', +@ItemID, @IncludeMailboxes, @IncludeContacts, @IncludeDistributionLists, @IncludeRooms, @IncludeEquipment, @IncludeSecurityGroups + +RETURN +GO + + +IF EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'SearchExchangeAccountsByTypes') +DROP PROCEDURE [dbo].[SearchExchangeAccountsByTypes] +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 diff --git a/WebsitePanel/Sources/VersionInfo.cs b/WebsitePanel/Sources/VersionInfo.cs index 9ec60861..311c3539 100644 --- a/WebsitePanel/Sources/VersionInfo.cs +++ b/WebsitePanel/Sources/VersionInfo.cs @@ -1,35 +1,7 @@ -// 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:4.0.30319.18033 +// Runtime Version:4.0.30319.18051 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/WebsitePanel/Sources/VersionInfo.vb b/WebsitePanel/Sources/VersionInfo.vb index 6c033d5e..c8ca348e 100644 --- a/WebsitePanel/Sources/VersionInfo.vb +++ b/WebsitePanel/Sources/VersionInfo.vb @@ -1,7 +1,7 @@ -'------------------------------------------------------------------------------ +'------------------------------------------------------------------------------ ' ' This code was generated by a tool. -' Runtime Version:4.0.30319.18033 +' Runtime Version:4.0.30319.18051 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs index c415b5a8..6e6bad12 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs @@ -230,6 +230,7 @@ order by rg.groupOrder public const string LYNC_EVMOBILE = "Lync.EVMobile"; public const string LYNC_EVINTERNATIONAL = "Lync.EVInternational"; public const string LYNC_ENABLEDPLANSEDITING = "Lync.EnablePlansEditing"; + public const string LYNC_PHONE = "Lync.PhoneNumbers"; public const string HELICON_ZOO = "HeliconZoo.*"; 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 14c795fd..5bf2a416 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs @@ -127,13 +127,13 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution private System.Threading.SendOrPostCallback GetOrganizationSecurityGroupsPagedOperationCompleted; - private System.Threading.SendOrPostCallback AddUserToSecurityGroupOperationCompleted; + private System.Threading.SendOrPostCallback AddObjectToSecurityGroupOperationCompleted; - private System.Threading.SendOrPostCallback DeleteUserFromSecurityGroupOperationCompleted; + private System.Threading.SendOrPostCallback DeleteObjectFromSecurityGroupOperationCompleted; private System.Threading.SendOrPostCallback GetSecurityGroupsByMemberOperationCompleted; - private System.Threading.SendOrPostCallback SearchSecurityGroupsOperationCompleted; + private System.Threading.SendOrPostCallback SearchOrganizationAccountsOperationCompleted; /// public esOrganizations() @@ -235,16 +235,16 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution public event GetOrganizationSecurityGroupsPagedCompletedEventHandler GetOrganizationSecurityGroupsPagedCompleted; /// - public event AddUserToSecurityGroupCompletedEventHandler AddUserToSecurityGroupCompleted; + public event AddObjectToSecurityGroupCompletedEventHandler AddObjectToSecurityGroupCompleted; /// - public event DeleteUserFromSecurityGroupCompletedEventHandler DeleteUserFromSecurityGroupCompleted; + public event DeleteObjectFromSecurityGroupCompletedEventHandler DeleteObjectFromSecurityGroupCompleted; /// public event GetSecurityGroupsByMemberCompletedEventHandler GetSecurityGroupsByMemberCompleted; /// - public event SearchSecurityGroupsCompletedEventHandler SearchSecurityGroupsCompleted; + 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)] @@ -2166,112 +2166,112 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution } /// - [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) + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/AddObjectToSecurityGroup", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int AddObjectToSecurityGroup(int itemId, int accountId, string groupName) { - object[] results = this.Invoke("AddUserToSecurityGroup", new object[] { + object[] results = this.Invoke("AddObjectToSecurityGroup", new object[] { itemId, - userAccountId, + accountId, groupName}); return ((int)(results[0])); } /// - public System.IAsyncResult BeginAddUserToSecurityGroup(int itemId, int userAccountId, string groupName, System.AsyncCallback callback, object asyncState) + public System.IAsyncResult BeginAddObjectToSecurityGroup(int itemId, int accountId, string groupName, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("AddUserToSecurityGroup", new object[] { + return this.BeginInvoke("AddObjectToSecurityGroup", new object[] { itemId, - userAccountId, + accountId, groupName}, callback, asyncState); } /// - public int EndAddUserToSecurityGroup(System.IAsyncResult asyncResult) + public int EndAddObjectToSecurityGroup(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((int)(results[0])); } /// - public void AddUserToSecurityGroupAsync(int itemId, int userAccountId, string groupName) + public void AddObjectToSecurityGroupAsync(int itemId, int accountId, string groupName) { - this.AddUserToSecurityGroupAsync(itemId, userAccountId, groupName, null); + this.AddObjectToSecurityGroupAsync(itemId, accountId, groupName, null); } /// - public void AddUserToSecurityGroupAsync(int itemId, int userAccountId, string groupName, object userState) + public void AddObjectToSecurityGroupAsync(int itemId, int accountId, string groupName, object userState) { - if ((this.AddUserToSecurityGroupOperationCompleted == null)) + if ((this.AddObjectToSecurityGroupOperationCompleted == null)) { - this.AddUserToSecurityGroupOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddUserToSecurityGroupOperationCompleted); + this.AddObjectToSecurityGroupOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddObjectToSecurityGroupOperationCompleted); } - this.InvokeAsync("AddUserToSecurityGroup", new object[] { + this.InvokeAsync("AddObjectToSecurityGroup", new object[] { itemId, - userAccountId, - groupName}, this.AddUserToSecurityGroupOperationCompleted, userState); + accountId, + groupName}, this.AddObjectToSecurityGroupOperationCompleted, userState); } - private void OnAddUserToSecurityGroupOperationCompleted(object arg) + private void OnAddObjectToSecurityGroupOperationCompleted(object arg) { - if ((this.AddUserToSecurityGroupCompleted != null)) + if ((this.AddObjectToSecurityGroupCompleted != 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)); + this.AddObjectToSecurityGroupCompleted(this, new AddObjectToSecurityGroupCompletedEventArgs(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) + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteObjectFromSecurityGroup", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int DeleteObjectFromSecurityGroup(int itemId, int accountId, string groupName) { - object[] results = this.Invoke("DeleteUserFromSecurityGroup", new object[] { + object[] results = this.Invoke("DeleteObjectFromSecurityGroup", new object[] { itemId, - userAccountId, + accountId, groupName}); return ((int)(results[0])); } /// - public System.IAsyncResult BeginDeleteUserFromSecurityGroup(int itemId, int userAccountId, string groupName, System.AsyncCallback callback, object asyncState) + public System.IAsyncResult BeginDeleteObjectFromSecurityGroup(int itemId, int accountId, string groupName, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("DeleteUserFromSecurityGroup", new object[] { + return this.BeginInvoke("DeleteObjectFromSecurityGroup", new object[] { itemId, - userAccountId, + accountId, groupName}, callback, asyncState); } /// - public int EndDeleteUserFromSecurityGroup(System.IAsyncResult asyncResult) + public int EndDeleteObjectFromSecurityGroup(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((int)(results[0])); } /// - public void DeleteUserFromSecurityGroupAsync(int itemId, int userAccountId, string groupName) + public void DeleteObjectFromSecurityGroupAsync(int itemId, int accountId, string groupName) { - this.DeleteUserFromSecurityGroupAsync(itemId, userAccountId, groupName, null); + this.DeleteObjectFromSecurityGroupAsync(itemId, accountId, groupName, null); } /// - public void DeleteUserFromSecurityGroupAsync(int itemId, int userAccountId, string groupName, object userState) + public void DeleteObjectFromSecurityGroupAsync(int itemId, int accountId, string groupName, object userState) { - if ((this.DeleteUserFromSecurityGroupOperationCompleted == null)) + if ((this.DeleteObjectFromSecurityGroupOperationCompleted == null)) { - this.DeleteUserFromSecurityGroupOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteUserFromSecurityGroupOperationCompleted); + this.DeleteObjectFromSecurityGroupOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteObjectFromSecurityGroupOperationCompleted); } - this.InvokeAsync("DeleteUserFromSecurityGroup", new object[] { + this.InvokeAsync("DeleteObjectFromSecurityGroup", new object[] { itemId, - userAccountId, - groupName}, this.DeleteUserFromSecurityGroupOperationCompleted, userState); + accountId, + groupName}, this.DeleteObjectFromSecurityGroupOperationCompleted, userState); } - private void OnDeleteUserFromSecurityGroupOperationCompleted(object arg) + private void OnDeleteObjectFromSecurityGroupOperationCompleted(object arg) { - if ((this.DeleteUserFromSecurityGroupCompleted != null)) + if ((this.DeleteObjectFromSecurityGroupCompleted != 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)); + this.DeleteObjectFromSecurityGroupCompleted(this, new DeleteObjectFromSecurityGroupCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } @@ -2328,60 +2328,63 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution } /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SearchSecurityGroups", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public ExchangeAccount[] SearchSecurityGroups(int itemId, string filterColumn, string filterValue, string sortColumn) + [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("SearchSecurityGroups", new object[] { + object[] results = this.Invoke("SearchOrganizationAccounts", new object[] { itemId, filterColumn, filterValue, - sortColumn}); + sortColumn, + includeOnlySecurityGroups}); return ((ExchangeAccount[])(results[0])); } /// - public System.IAsyncResult BeginSearchSecurityGroups(int itemId, string filterColumn, string filterValue, string sortColumn, System.AsyncCallback callback, object asyncState) + public System.IAsyncResult BeginSearchOrganizationAccounts(int itemId, string filterColumn, string filterValue, string sortColumn, bool includeOnlySecurityGroups, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("SearchSecurityGroups", new object[] { + return this.BeginInvoke("SearchOrganizationAccounts", new object[] { itemId, filterColumn, filterValue, - sortColumn}, callback, asyncState); + sortColumn, + includeOnlySecurityGroups}, callback, asyncState); } /// - public ExchangeAccount[] EndSearchSecurityGroups(System.IAsyncResult asyncResult) + public ExchangeAccount[] EndSearchOrganizationAccounts(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((ExchangeAccount[])(results[0])); } /// - public void SearchSecurityGroupsAsync(int itemId, string filterColumn, string filterValue, string sortColumn) + public void SearchOrganizationAccountsAsync(int itemId, string filterColumn, string filterValue, string sortColumn, bool includeOnlySecurityGroups) { - this.SearchSecurityGroupsAsync(itemId, filterColumn, filterValue, sortColumn, null); + this.SearchOrganizationAccountsAsync(itemId, filterColumn, filterValue, sortColumn, includeOnlySecurityGroups, null); } /// - public void SearchSecurityGroupsAsync(int itemId, string filterColumn, string filterValue, string sortColumn, object userState) + public void SearchOrganizationAccountsAsync(int itemId, string filterColumn, string filterValue, string sortColumn, bool includeOnlySecurityGroups, object userState) { - if ((this.SearchSecurityGroupsOperationCompleted == null)) + if ((this.SearchOrganizationAccountsOperationCompleted == null)) { - this.SearchSecurityGroupsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSearchSecurityGroupsOperationCompleted); + this.SearchOrganizationAccountsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSearchOrganizationAccountsOperationCompleted); } - this.InvokeAsync("SearchSecurityGroups", new object[] { + this.InvokeAsync("SearchOrganizationAccounts", new object[] { itemId, filterColumn, filterValue, - sortColumn}, this.SearchSecurityGroupsOperationCompleted, userState); + sortColumn, + includeOnlySecurityGroups}, this.SearchOrganizationAccountsOperationCompleted, userState); } - private void OnSearchSecurityGroupsOperationCompleted(object arg) + private void OnSearchOrganizationAccountsOperationCompleted(object arg) { - if ((this.SearchSecurityGroupsCompleted != null)) + if ((this.SearchOrganizationAccountsCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.SearchSecurityGroupsCompleted(this, new SearchSecurityGroupsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + this.SearchOrganizationAccountsCompleted(this, new SearchOrganizationAccountsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } @@ -3324,18 +3327,18 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] - public delegate void AddUserToSecurityGroupCompletedEventHandler(object sender, AddUserToSecurityGroupCompletedEventArgs e); + public delegate void AddObjectToSecurityGroupCompletedEventHandler(object sender, AddObjectToSecurityGroupCompletedEventArgs e); /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class AddUserToSecurityGroupCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + public partial class AddObjectToSecurityGroupCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - internal AddUserToSecurityGroupCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + internal AddObjectToSecurityGroupCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; @@ -3354,18 +3357,18 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] - public delegate void DeleteUserFromSecurityGroupCompletedEventHandler(object sender, DeleteUserFromSecurityGroupCompletedEventArgs e); + public delegate void DeleteObjectFromSecurityGroupCompletedEventHandler(object sender, DeleteObjectFromSecurityGroupCompletedEventArgs e); /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class DeleteUserFromSecurityGroupCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + public partial class DeleteObjectFromSecurityGroupCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - internal DeleteUserFromSecurityGroupCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + internal DeleteObjectFromSecurityGroupCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; @@ -3414,18 +3417,18 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] - public delegate void SearchSecurityGroupsCompletedEventHandler(object sender, SearchSecurityGroupsCompletedEventArgs e); + 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 SearchSecurityGroupsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + public partial class SearchOrganizationAccountsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - internal SearchSecurityGroupsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + internal SearchOrganizationAccountsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Common/ObjectUtils.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Common/ObjectUtils.cs index 4359ca98..eabcbf15 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Common/ObjectUtils.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Common/ObjectUtils.cs @@ -188,6 +188,22 @@ namespace WebsitePanel.EnterpriseServer // get type properties PropertyInfo[] props = GetTypeProperties(type); + // leave only a property from the DataReader + DataTable readerSchema = reader.GetSchemaTable(); + if (readerSchema != null) + { + List propslist = new List(); + foreach (DataRow field in readerSchema.Rows) + { + string columnName = System.Convert.ToString(field["ColumnName"]); + + foreach (PropertyInfo prop in props) + if (columnName.ToLower() == prop.Name.ToLower()) + propslist.Add(prop); + } + props = propslist.ToArray(); + } + // iterate through reader while (reader.Read()) { 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 1d6e50c9..c530a91d 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs @@ -999,7 +999,7 @@ namespace WebsitePanel.EnterpriseServer 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, "", "", ""); + return SearchAccounts(0, false, false, true, false, false, false, "", "", ""); else { List demoAccounts = new List(); @@ -1050,7 +1050,7 @@ namespace WebsitePanel.EnterpriseServer public static 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) { #region Demo Mode @@ -1131,6 +1131,16 @@ namespace WebsitePanel.EnterpriseServer demoAccounts.Add(d1); } + 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 demoAccounts; } #endregion @@ -3444,7 +3454,7 @@ namespace WebsitePanel.EnterpriseServer ExchangeDistributionList dl = exchange.GetDistributionListGeneralSettings(accountName); // add meta-item - int accountId = AddAccount(itemId, ExchangeAccountType.DistributionList, email, + int accountId = AddAccount(itemId, ExchangeAccountType.DistributionList, accountName, displayName, email, false, 0, dl.SAMAccountName, null, 0, null); @@ -4039,7 +4049,8 @@ namespace WebsitePanel.EnterpriseServer List DistributionLists = GetAccounts(itemId, ExchangeAccountType.DistributionList); foreach (ExchangeAccount DistributionAccount in DistributionLists) { - ExchangeDistributionList DistributionList = exchange.GetDistributionListGeneralSettings(DistributionAccount.AccountName); + //ExchangeDistributionList DistributionList = exchange.GetDistributionListGeneralSettings(DistributionAccount.AccountName); + OrganizationSecurityGroup DistributionList = OrganizationController.GetSecurityGroupGeneralSettings(itemId, DistributionAccount.AccountId); foreach (ExchangeAccount member in DistributionList.MembersAccounts) { @@ -4169,7 +4180,7 @@ namespace WebsitePanel.EnterpriseServer } return 0; - } + } #endregion diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs index 556ca2db..b3a6199a 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs @@ -58,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; } @@ -81,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 @@ -110,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 @@ -152,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; @@ -165,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; @@ -180,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 @@ -251,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; } @@ -271,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)); @@ -298,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) { @@ -352,63 +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 + + DataProvider.AddExchangeOrganization(itemId, organizationId); + + // 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 - }; + // register organization domain service item + OrganizationDomain orgDomain = new OrganizationDomain + { + Name = domainName, + PackageId = packageId, + ServiceId = serviceId + }; - PackageController.AddPackageItem(orgDomain); + 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; } @@ -440,7 +440,7 @@ namespace WebsitePanel.EnterpriseServer return -1; } } - + // unregister domain DataProvider.DeleteExchangeOrganizationDomain(itemId, domainId); @@ -477,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); + } } @@ -611,7 +611,7 @@ namespace WebsitePanel.EnterpriseServer if (org.IsOCSOrganization) { - DeleteOCSUsers(itemId, ref successful); + DeleteOCSUsers(itemId, ref successful); } try @@ -623,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) @@ -635,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'); @@ -648,7 +648,7 @@ namespace WebsitePanel.EnterpriseServer throw new ApplicationException(sb.ToString()); } } - catch(Exception ex) + catch (Exception ex) { successful = false; TaskManager.WriteError(ex); @@ -657,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'); @@ -667,7 +667,7 @@ namespace WebsitePanel.EnterpriseServer throw new ApplicationException(sb.ToString()); } } - catch(Exception ex) + catch (Exception ex) { successful = false; TaskManager.WriteError(ex); @@ -699,10 +699,10 @@ namespace WebsitePanel.EnterpriseServer TaskManager.WriteError(ex); } - - - Organizations orgProxy = GetOrganizationProxy(org.ServiceId); - + + + Organizations orgProxy = GetOrganizationProxy(org.ServiceId); + try { orgProxy.DeleteOrganization(org.OrganizationId); @@ -712,8 +712,8 @@ namespace WebsitePanel.EnterpriseServer successful = false; TaskManager.WriteError(ex); } - - + + // delete organization domains List domains = GetOrganizationDomains(itemId); @@ -728,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) @@ -749,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; } @@ -768,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) { @@ -790,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); @@ -813,9 +813,9 @@ namespace WebsitePanel.EnterpriseServer Organization org = GetOrganization(itemId); - return org; + return org; } - + public static Organization GetOrganization(int itemId) { #region Demo Mode @@ -1029,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; @@ -1061,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); @@ -1111,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); @@ -1128,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)) @@ -1187,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"; @@ -1206,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"; @@ -1219,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]; @@ -1249,10 +1249,10 @@ namespace WebsitePanel.EnterpriseServer } - + private static bool EmailAddressExists(string emailAddress) { - return DataProvider.ExchangeAccountEmailAddressExists(emailAddress); + return DataProvider.ExchangeAccountEmailAddressExists(emailAddress); } @@ -1268,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) @@ -1509,7 +1509,7 @@ namespace WebsitePanel.EnterpriseServer /// The account name with organization Id. private static string BuildAccountNameWithOrgId(string orgId, string name, int serviceId) { - name = name.Length > 5 ? name.Substring(0, 5) : name; + 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; @@ -1583,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; @@ -1592,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; } @@ -1608,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 @@ -1620,8 +1620,8 @@ namespace WebsitePanel.EnterpriseServer // unregister account DeleteUserFromMetabase(itemId, accountId); } - else - { + else + { //Delete mailbox with AD user ExchangeServerController.DeleteMailbox(itemId, accountId); } @@ -1638,7 +1638,7 @@ namespace WebsitePanel.EnterpriseServer } public static OrganizationUser GetAccount(int itemId, int userId) - { + { OrganizationUser account = ObjectUtils.FillObjectFromDataReader( DataProvider.GetExchangeAccount(itemId, userId)); @@ -1669,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) @@ -1697,7 +1697,7 @@ namespace WebsitePanel.EnterpriseServer // load account account = GetAccount(itemId, accountId); } - catch (Exception){} + catch (Exception) { } try { @@ -1764,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, @@ -1796,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) @@ -1837,7 +1837,7 @@ namespace WebsitePanel.EnterpriseServer try { - + // load organization Organization org = GetOrganization(itemId); @@ -1871,7 +1871,7 @@ namespace WebsitePanel.EnterpriseServer return BusinessErrorCodes.ERROR_EXCHANGE_EMAIL_EXISTS; } } - + Organizations orgProxy = GetOrganizationProxy(org.ServiceId); orgProxy.SetUserPrincipalName(org.OrganizationId, @@ -1951,7 +1951,7 @@ namespace WebsitePanel.EnterpriseServer Organizations orgProxy = GetOrganizationProxy(org.ServiceId); - orgProxy.SetUserPassword( org.OrganizationId, + orgProxy.SetUserPassword(org.OrganizationId, accountName, password); @@ -1978,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) @@ -1998,42 +1998,46 @@ 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)); + return Tmpaccounts; + + // on large lists is very slow + /* List Accounts = new List(); foreach (OrganizationUser user in Tmpaccounts.ToArray()) @@ -2042,8 +2046,9 @@ namespace WebsitePanel.EnterpriseServer } return Accounts; + */ } - + public static int GetAccountIdByUserPrincipalName(int itemId, string userPrincipalName) { // place log record @@ -2107,8 +2112,8 @@ namespace WebsitePanel.EnterpriseServer return demoDomains; } #endregion - - + + // load organization Organization org = (Organization)PackageController.GetPackageItem(itemId); if (org == null) @@ -2134,14 +2139,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 @@ -2153,7 +2158,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); @@ -2169,7 +2174,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); @@ -2177,17 +2182,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; @@ -2263,7 +2268,7 @@ namespace WebsitePanel.EnterpriseServer Organizations orgProxy = GetOrganizationProxy(org.ServiceId); - string groupName = BuildAccountNameWithOrgId(org.OrganizationId, displayName, org.ServiceId); + string groupName = BuildAccountNameWithOrgId(org.OrganizationId, displayName.Replace(" ", ""), org.ServiceId); TaskManager.Write("accountName :" + groupName); @@ -2332,9 +2337,9 @@ namespace WebsitePanel.EnterpriseServer securityGroup.IsDefault = account.AccountType == ExchangeAccountType.DefaultSecurityGroup; - List members = new List(); + List members = new List(); - foreach (OrganizationUser user in securityGroup.MembersAccounts) + foreach (ExchangeAccount user in securityGroup.MembersAccounts) { OrganizationUser userAccount = GetAccountByAccountName(itemId, user.SamAccountName); @@ -2342,6 +2347,7 @@ namespace WebsitePanel.EnterpriseServer { user.AccountId = userAccount.AccountId; user.AccountName = userAccount.AccountName; + user.DisplayName = userAccount.DisplayName; user.PrimaryEmailAddress = userAccount.PrimaryEmailAddress; user.AccountType = userAccount.AccountType; @@ -2385,7 +2391,7 @@ namespace WebsitePanel.EnterpriseServer Organizations orgProxy = GetOrganizationProxy(org.ServiceId); orgProxy.DeleteSecurityGroup(account.AccountName, org.OrganizationId); - + DeleteUserFromMetabase(itemId, accountId); return 0; @@ -2480,7 +2486,7 @@ namespace WebsitePanel.EnterpriseServer res.PageItems = demoSecurityGroups.ToArray(); res.RecordsCount = res.PageItems.Length; - + return res; } #endregion @@ -2513,7 +2519,7 @@ namespace WebsitePanel.EnterpriseServer return result; } - public static int AddUserToSecurityGroup(int itemId, int userAccountId, string groupName) + public static int AddObjectToSecurityGroup(int itemId, int accountId, string groupName) { // check account int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); @@ -2530,11 +2536,11 @@ namespace WebsitePanel.EnterpriseServer return -1; // load user account - OrganizationUser userAccount = GetAccount(itemId, userAccountId); + ExchangeAccount account = ExchangeServerController.GetAccount(itemId, accountId); Organizations orgProxy = GetOrganizationProxy(org.ServiceId); - orgProxy.AddUserToSecurityGroup(org.OrganizationId, userAccount.AccountName, groupName); + orgProxy.AddObjectToSecurityGroup(org.OrganizationId, account.AccountName, groupName); return 0; } @@ -2548,7 +2554,7 @@ namespace WebsitePanel.EnterpriseServer } } - public static int DeleteUserFromSecurityGroup(int itemId, int userAccountId, string groupName) + public static int DeleteObjectFromSecurityGroup(int itemId, int accountId, string groupName) { // check account int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); @@ -2565,11 +2571,11 @@ namespace WebsitePanel.EnterpriseServer return -1; // load user account - OrganizationUser userAccount = GetAccount(itemId, userAccountId); + ExchangeAccount account = ExchangeServerController.GetAccount(itemId, accountId); Organizations orgProxy = GetOrganizationProxy(org.ServiceId); - orgProxy.DeleteUserFromSecurityGroup(org.OrganizationId, userAccount.AccountName, groupName); + orgProxy.DeleteObjectFromSecurityGroup(org.OrganizationId, account.AccountName, groupName); return 0; } @@ -2610,16 +2616,20 @@ namespace WebsitePanel.EnterpriseServer // load account ExchangeAccount account = ExchangeServerController.GetAccount(itemId, accountId); - List SecurytyGroups = ExchangeServerController.GetAccounts(itemId, ExchangeAccountType.SecurityGroup); - foreach (ExchangeAccount SecurytyGroupAccount in SecurytyGroups) - { - OrganizationSecurityGroup SecurytyGroup = GetSecurityGroupGeneralSettings(itemId, SecurytyGroupAccount.AccountId); + List securytyGroups = ExchangeServerController.GetAccounts(itemId, ExchangeAccountType.SecurityGroup); - foreach (OrganizationUser member in SecurytyGroup.MembersAccounts) + //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(SecurytyGroupAccount); + ret.Add(securityGroupAccount); break; } @@ -2638,39 +2648,96 @@ namespace WebsitePanel.EnterpriseServer } } - public static List SearchSecurityGroups(int itemId, string filterColumn, string filterValue, string sortColumn) + public static List SearchOrganizationAccounts(int itemId, string filterColumn, string filterValue, + string sortColumn, bool includeOnlySecurityGroups) { #region Demo Mode if (IsDemoMode) { - List demoSecurityGroups = new List(); + 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"; - demoSecurityGroups.Add(r1); + demoAccounts.Add(r1); ExchangeAccount r2 = new ExchangeAccount(); r1.AccountId = 21; r1.AccountName = "group2_fabrikam"; r1.AccountType = ExchangeAccountType.SecurityGroup; r1.DisplayName = "Group 2"; - demoSecurityGroups.Add(r2); + demoAccounts.Add(r2); - return demoSecurityGroups; + return demoAccounts; } #endregion - List accounts = ObjectUtils.CreateListFromDataReader( - DataProvider.SearchExchangeAccounts( - SecurityContext.User.UserId, itemId, false, false, false, false, false, filterColumn, filterValue, sortColumn)); + string accountTypes = string.Format("{0}", ((int)ExchangeAccountType.SecurityGroup)); - return accounts.Where(x => x.AccountType == ExchangeAccountType.SecurityGroup).ToList(); + if (!includeOnlySecurityGroups) + { + accountTypes = string.Format("{0}, {1}, {2}, {3}, {4}, {5}", accountTypes, ((int)ExchangeAccountType.User), ((int)ExchangeAccountType.Mailbox), + ((int)ExchangeAccountType.Room), ((int)ExchangeAccountType.Equipment), ((int)ExchangeAccountType.DistributionList)); + } + + List tmpAccounts = ObjectUtils.CreateListFromDataReader( + DataProvider.SearchExchangeAccountsByTypes(SecurityContext.User.UserId, itemId, + accountTypes, filterColumn, filterValue, sortColumn)); + + List accounts = new List(); + + foreach (ExchangeAccount tmpAccount in tmpAccounts.ToArray()) + { + bool bSuccess = false; + + switch (tmpAccount.AccountType) + { + case ExchangeAccountType.SecurityGroup: + bSuccess = GetSecurityGroupGeneralSettings(itemId, tmpAccount.AccountId) != null; + break; + case ExchangeAccountType.DistributionList: + bSuccess = ExchangeServerController.GetDistributionListGeneralSettings(itemId, tmpAccount.AccountId) != null; + break; + default: + bSuccess = GetUserGeneralSettings(itemId, tmpAccount.AccountId) != null; + break; + } + + if (bSuccess) + { + accounts.Add(tmpAccount); + } + } + + return accounts; } } - } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Servers/ServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Servers/ServerController.cs index 39e13c75..7391b19d 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Servers/ServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Servers/ServerController.cs @@ -1231,7 +1231,7 @@ namespace WebsitePanel.EnterpriseServer } // check quotas - string quotaName = GetIPAddressesQuotaByResourceGroup(groupName); + string quotaName = GetIPAddressesQuotaByResourceGroup(groupName, pool); // get maximum server IPs List ips = ServerController.GetUnallottedIPAddresses(packageId, groupName, pool); @@ -1249,15 +1249,15 @@ namespace WebsitePanel.EnterpriseServer int quotaUsed = cntx.Quotas[quotaName].QuotaUsedValue; // check the maximum allowed number - if (quotaAllocated != -1 && - (addressesNumber > (quotaAllocated - quotaUsed))) + if (addressesNumber > (quotaAllocated - quotaUsed)) { res.ErrorCodes.Add("IP_ADDRESSES_QUOTA_LIMIT_REACHED"); return res; } // check if requested more than available - if (addressesNumber > maxAvailableIPs) + if (maxAvailableIPs != -1 && + (addressesNumber > maxAvailableIPs)) addressesNumber = maxAvailableIPs; res = TaskManager.StartResultTask("IP_ADDRESS", "ALLOCATE_PACKAGE_IP", packageId); @@ -1303,7 +1303,7 @@ namespace WebsitePanel.EnterpriseServer int maxAvailableIPs = GetUnallottedIPAddresses(packageId, groupName, pool).Count; // get quota name - string quotaName = GetIPAddressesQuotaByResourceGroup(groupName); + string quotaName = GetIPAddressesQuotaByResourceGroup(groupName, pool); // get hosting plan IPs int number = 0; @@ -1415,8 +1415,11 @@ namespace WebsitePanel.EnterpriseServer return doc.InnerXml; } - private static string GetIPAddressesQuotaByResourceGroup(string groupName) + private static string GetIPAddressesQuotaByResourceGroup(string groupName, IPAddressPool pool) { + if (pool == IPAddressPool.PhoneNumbers) + return Quotas.LYNC_PHONE; + if (String.Compare(groupName, ResourceGroups.VPS, true) == 0) { return Quotas.VPS_EXTERNAL_IP_ADDRESSES_NUMBER; 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 821196d0..951ce0d9 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] @@ -276,29 +276,31 @@ namespace WebsitePanel.EnterpriseServer } [WebMethod] - public int AddUserToSecurityGroup(int itemId, int userAccountId, string groupName) + public int AddObjectToSecurityGroup(int itemId, int accountId, string groupName) { - return OrganizationController.AddUserToSecurityGroup(itemId, userAccountId, groupName); + return OrganizationController.AddObjectToSecurityGroup(itemId, accountId, groupName); } [WebMethod] - public int DeleteUserFromSecurityGroup(int itemId, int userAccountId, string groupName) + public int DeleteObjectFromSecurityGroup(int itemId, int accountId, string groupName) { - return OrganizationController.DeleteUserFromSecurityGroup(itemId, userAccountId, groupName); + return OrganizationController.DeleteObjectFromSecurityGroup(itemId, accountId, groupName); } [WebMethod] public ExchangeAccount[] GetSecurityGroupsByMember(int itemId, int accountId) { - return OrganizationController.GetSecurityGroupsByMember(itemId, accountId); + return OrganizationController.GetSecurityGroupsByMember(itemId, accountId); } [WebMethod] - public List SearchSecurityGroups(int itemId, string filterColumn, string filterValue, string sortColumn) + public List SearchOrganizationAccounts(int itemId, string filterColumn, string filterValue, + string sortColumn, bool includeOnlySecurityGroups) { - return OrganizationController.SearchSecurityGroups(itemId, filterColumn, filterValue, sortColumn); + 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 195ccdba..27b223eb 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ActiveDirectoryUtils.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ActiveDirectoryUtils.cs @@ -44,21 +44,31 @@ namespace WebsitePanel.Providers.HostedSolution return de; } - public static string[] GetUsersGroup(string group) + public static string[] GetGroupObjects(string group, string objectType) { - List rets = new List(); + return GetGroupObjects(group, objectType, null); + } + + public static string[] GetGroupObjects(string group, string objectType, DirectoryEntry entry) + { + List rets = new List(); DirectorySearcher deSearch = new DirectorySearcher { Filter = - "(&(objectClass=user))" + "(&(objectClass=" + objectType + "))" }; - SearchResultCollection srcUsers = deSearch.FindAll(); - - foreach (SearchResult srcUser in srcUsers) + if (entry != null) { - DirectoryEntry de = srcUser.GetDirectoryEntry(); + deSearch.SearchRoot = entry; + } + + SearchResultCollection srcObjects = deSearch.FindAll(); + + foreach (SearchResult srcObject in srcObjects) + { + DirectoryEntry de = srcObject.GetDirectoryEntry(); PropertyValueCollection props = de.Properties["memberOf"]; foreach (string str in props) @@ -371,20 +381,20 @@ namespace WebsitePanel.Providers.HostedSolution 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 RemoveUserFromGroup(string userPath, string groupPath) + public static void RemoveObjectFromGroup(string obejctPath, string groupPath) { - DirectoryEntry user = new DirectoryEntry(userPath); + DirectoryEntry obj = new DirectoryEntry(obejctPath); DirectoryEntry group = new DirectoryEntry(groupPath); - group.Invoke("Remove", user.Path); + group.Invoke("Remove", obj.Path); } public static bool AdObjectExists(string path) diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/IOrganization.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/IOrganization.cs index 0409fb33..6d9650b5 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/IOrganization.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/IOrganization.cs @@ -50,9 +50,9 @@ namespace WebsitePanel.Providers.HostedSolution void SetSecurityGroupGeneralSettings(string organizationId, string groupName, string[] memberAccounts, string notes); - void AddUserToSecurityGroup(string organizationId, string loginName, string groupName); + void AddObjectToSecurityGroup(string organizationId, string accountName, string groupName); - void DeleteUserFromSecurityGroup(string organizationId, string loginName, string groupName); + void DeleteObjectFromSecurityGroup(string organizationId, string accountName, string groupName); void SetUserGeneralSettings(string organizationId, string accountName, string displayName, string password, bool hideFromAddressBook, bool disabled, bool locked, string firstName, string initials, @@ -66,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/OrganizationSecurityGroup.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationSecurityGroup.cs index b1b503bc..ab410547 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationSecurityGroup.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationSecurityGroup.cs @@ -19,7 +19,7 @@ namespace WebsitePanel.Providers.HostedSolution set; } - public OrganizationUser[] MembersAccounts + public ExchangeAccount[] MembersAccounts { get; set; diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs index a21d05b7..7197eb88 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs @@ -5656,7 +5656,7 @@ namespace WebsitePanel.Providers.HostedSolution internal Collection ExecuteShellCommand(Runspace runSpace, Command cmd) { - return ExecuteShellCommand(runSpace, cmd, true); + return ExecuteShellCommand(runSpace, cmd, false); } internal Collection ExecuteShellCommand(Runspace runSpace, Command cmd, bool useDomainController) diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs index 541d4545..09089959 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs @@ -102,6 +102,20 @@ 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(); @@ -404,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) @@ -668,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); @@ -760,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) @@ -848,13 +862,13 @@ namespace WebsitePanel.Providers.HostedSolution { 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 @@ -904,21 +918,41 @@ namespace WebsitePanel.Providers.HostedSolution throw new ArgumentNullException("groupName"); string path = GetGroupPath(organizationId, groupName); + string organizationPath = GetOrganizationPath(organizationId); DirectoryEntry entry = ActiveDirectoryUtils.GetADObject(path); + DirectoryEntry organizationEntry = ActiveDirectoryUtils.GetADObject(organizationPath); + 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(); + List members = new List(); - foreach (string userPath in ActiveDirectoryUtils.GetUsersGroup(groupName)) + foreach (string userPath in ActiveDirectoryUtils.GetGroupObjects(groupName, "user", organizationEntry)) { - members.Add(GetUser(userPath)); + OrganizationUser tmpUser = GetUser(userPath); + + members.Add(new ExchangeAccount + { + AccountName = tmpUser.AccountName, + SamAccountName = tmpUser.SamAccountName + }); + } + + foreach (string groupPath in ActiveDirectoryUtils.GetGroupObjects(groupName, "group", organizationEntry)) + { + 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(); @@ -955,7 +989,7 @@ namespace WebsitePanel.Providers.HostedSolution public void SetSecurityGroupGeneralSettings(string organizationId, string groupName, string[] memberAccounts, string notes) { - + SetSecurityGroupGeneralSettingsInternal(organizationId, groupName, memberAccounts, notes); } @@ -977,72 +1011,79 @@ namespace WebsitePanel.Providers.HostedSolution ActiveDirectoryUtils.SetADObjectProperty(entry, ADAttributes.Notes, notes); - foreach(string userPath in ActiveDirectoryUtils.GetUsersGroup(groupName)) { - ActiveDirectoryUtils.RemoveUserFromGroup(userPath, path); + foreach (string userPath in ActiveDirectoryUtils.GetGroupObjects(groupName, "user")) + { + ActiveDirectoryUtils.RemoveObjectFromGroup(userPath, path); } - foreach(string user in memberAccounts) { - string userPath = GetUserPath(organizationId, user); - ActiveDirectoryUtils.AddUserToGroup(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) + public void AddObjectToSecurityGroup(string organizationId, string accountName, string groupName) { - AddUserToSecurityGroupInternal(organizationId, loginName, groupName); + AddObjectToSecurityGroupInternal(organizationId, accountName, groupName); } - internal void AddUserToSecurityGroupInternal(string organizationId, string loginName, string groupName) + internal void AddObjectToSecurityGroupInternal(string organizationId, string accountName, string groupName) { HostedSolutionLog.LogStart("AddUserToSecurityGroupInternal"); HostedSolutionLog.DebugInfo("organizationId : {0}", organizationId); - HostedSolutionLog.DebugInfo("loginName : {0}", loginName); + HostedSolutionLog.DebugInfo("accountName : {0}", accountName); HostedSolutionLog.DebugInfo("groupName : {0}", groupName); if (string.IsNullOrEmpty(organizationId)) throw new ArgumentNullException("organizationId"); - if (string.IsNullOrEmpty(loginName)) + if (string.IsNullOrEmpty(accountName)) throw new ArgumentNullException("loginName"); if (string.IsNullOrEmpty(groupName)) throw new ArgumentNullException("groupName"); - string userPath = GetUserPath(organizationId, loginName); + string objectPath = GetObjectPath(organizationId, accountName); string groupPath = GetGroupPath(organizationId, groupName); - ActiveDirectoryUtils.AddUserToGroup(userPath, groupPath); + ActiveDirectoryUtils.AddObjectToGroup(objectPath, groupPath); } - public void DeleteUserFromSecurityGroup(string organizationId, string loginName, string groupName) + public void DeleteObjectFromSecurityGroup(string organizationId, string accountName, string groupName) { - DeleteUserFromSecurityGroupInternal(organizationId, loginName, groupName); + DeleteObjectFromSecurityGroupInternal(organizationId, accountName, groupName); } - internal void DeleteUserFromSecurityGroupInternal(string organizationId, string loginName, string groupName) + internal void DeleteObjectFromSecurityGroupInternal(string organizationId, string accountName, string groupName) { HostedSolutionLog.LogStart("AddUserToSecurityGroupInternal"); HostedSolutionLog.DebugInfo("organizationId : {0}", organizationId); - HostedSolutionLog.DebugInfo("loginName : {0}", loginName); + HostedSolutionLog.DebugInfo("accountName : {0}", accountName); HostedSolutionLog.DebugInfo("groupName : {0}", groupName); if (string.IsNullOrEmpty(organizationId)) throw new ArgumentNullException("organizationId"); - if (string.IsNullOrEmpty(loginName)) + if (string.IsNullOrEmpty(accountName)) throw new ArgumentNullException("loginName"); if (string.IsNullOrEmpty(groupName)) throw new ArgumentNullException("groupName"); - string userPath = GetUserPath(organizationId, loginName); + string objectPath = GetObjectPath(organizationId, accountName); string groupPath = GetGroupPath(organizationId, groupName); - ActiveDirectoryUtils.RemoveUserFromGroup(userPath, groupPath); + ActiveDirectoryUtils.RemoveObjectFromGroup(objectPath, groupPath); } #endregion @@ -1051,7 +1092,5 @@ namespace WebsitePanel.Providers.HostedSolution { return Environment.UserDomainName != Environment.MachineName; } - - } } diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/OrganizationProxy.cs b/WebsitePanel/Sources/WebsitePanel.Server.Client/OrganizationProxy.cs index 04015f9c..ef573e31 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")] @@ -85,9 +85,9 @@ namespace WebsitePanel.Providers.HostedSolution private System.Threading.SendOrPostCallback SetSecurityGroupGeneralSettingsOperationCompleted; - private System.Threading.SendOrPostCallback AddUserToSecurityGroupOperationCompleted; + private System.Threading.SendOrPostCallback AddObjectToSecurityGroupOperationCompleted; - private System.Threading.SendOrPostCallback DeleteUserFromSecurityGroupOperationCompleted; + private System.Threading.SendOrPostCallback DeleteObjectFromSecurityGroupOperationCompleted; private System.Threading.SendOrPostCallback SetUserGeneralSettingsOperationCompleted; @@ -142,10 +142,10 @@ namespace WebsitePanel.Providers.HostedSolution public event SetSecurityGroupGeneralSettingsCompletedEventHandler SetSecurityGroupGeneralSettingsCompleted; /// - public event AddUserToSecurityGroupCompletedEventHandler AddUserToSecurityGroupCompleted; + public event AddObjectToSecurityGroupCompletedEventHandler AddObjectToSecurityGroupCompleted; /// - public event DeleteUserFromSecurityGroupCompletedEventHandler DeleteUserFromSecurityGroupCompleted; + public event DeleteObjectFromSecurityGroupCompletedEventHandler DeleteObjectFromSecurityGroupCompleted; /// public event SetUserGeneralSettingsCompletedEventHandler SetUserGeneralSettingsCompleted; @@ -704,109 +704,109 @@ namespace WebsitePanel.Providers.HostedSolution /// [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) + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/AddObjectToSecurityGroup", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void AddObjectToSecurityGroup(string organizationId, string accountName, string groupName) { - this.Invoke("AddUserToSecurityGroup", new object[] { + this.Invoke("AddObjectToSecurityGroup", new object[] { organizationId, - loginName, + accountName, groupName}); } /// - public System.IAsyncResult BeginAddUserToSecurityGroup(string organizationId, string loginName, string groupName, System.AsyncCallback callback, object asyncState) + public System.IAsyncResult BeginAddObjectToSecurityGroup(string organizationId, string accountName, string groupName, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("AddUserToSecurityGroup", new object[] { + return this.BeginInvoke("AddObjectToSecurityGroup", new object[] { organizationId, - loginName, + accountName, groupName}, callback, asyncState); } /// - public void EndAddUserToSecurityGroup(System.IAsyncResult asyncResult) + public void EndAddObjectToSecurityGroup(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } /// - public void AddUserToSecurityGroupAsync(string organizationId, string loginName, string groupName) + public void AddObjectToSecurityGroupAsync(string organizationId, string accountName, string groupName) { - this.AddUserToSecurityGroupAsync(organizationId, loginName, groupName, null); + this.AddObjectToSecurityGroupAsync(organizationId, accountName, groupName, null); } /// - public void AddUserToSecurityGroupAsync(string organizationId, string loginName, string groupName, object userState) + public void AddObjectToSecurityGroupAsync(string organizationId, string accountName, string groupName, object userState) { - if ((this.AddUserToSecurityGroupOperationCompleted == null)) + if ((this.AddObjectToSecurityGroupOperationCompleted == null)) { - this.AddUserToSecurityGroupOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddUserToSecurityGroupOperationCompleted); + this.AddObjectToSecurityGroupOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddObjectToSecurityGroupOperationCompleted); } - this.InvokeAsync("AddUserToSecurityGroup", new object[] { + this.InvokeAsync("AddObjectToSecurityGroup", new object[] { organizationId, - loginName, - groupName}, this.AddUserToSecurityGroupOperationCompleted, userState); + accountName, + groupName}, this.AddObjectToSecurityGroupOperationCompleted, userState); } - private void OnAddUserToSecurityGroupOperationCompleted(object arg) + private void OnAddObjectToSecurityGroupOperationCompleted(object arg) { - if ((this.AddUserToSecurityGroupCompleted != null)) + if ((this.AddObjectToSecurityGroupCompleted != 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)); + this.AddObjectToSecurityGroupCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/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) + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteObjectFromSecurityGroup", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void DeleteObjectFromSecurityGroup(string organizationId, string accountName, string groupName) { - this.Invoke("DeleteUserFromSecurityGroup", new object[] { + this.Invoke("DeleteObjectFromSecurityGroup", new object[] { organizationId, - loginName, + accountName, groupName}); } /// - public System.IAsyncResult BeginDeleteUserFromSecurityGroup(string organizationId, string loginName, string groupName, System.AsyncCallback callback, object asyncState) + public System.IAsyncResult BeginDeleteObjectFromSecurityGroup(string organizationId, string accountName, string groupName, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("DeleteUserFromSecurityGroup", new object[] { + return this.BeginInvoke("DeleteObjectFromSecurityGroup", new object[] { organizationId, - loginName, + accountName, groupName}, callback, asyncState); } /// - public void EndDeleteUserFromSecurityGroup(System.IAsyncResult asyncResult) + public void EndDeleteObjectFromSecurityGroup(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } /// - public void DeleteUserFromSecurityGroupAsync(string organizationId, string loginName, string groupName) + public void DeleteObjectFromSecurityGroupAsync(string organizationId, string accountName, string groupName) { - this.DeleteUserFromSecurityGroupAsync(organizationId, loginName, groupName, null); + this.DeleteObjectFromSecurityGroupAsync(organizationId, accountName, groupName, null); } /// - public void DeleteUserFromSecurityGroupAsync(string organizationId, string loginName, string groupName, object userState) + public void DeleteObjectFromSecurityGroupAsync(string organizationId, string accountName, string groupName, object userState) { - if ((this.DeleteUserFromSecurityGroupOperationCompleted == null)) + if ((this.DeleteObjectFromSecurityGroupOperationCompleted == null)) { - this.DeleteUserFromSecurityGroupOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteUserFromSecurityGroupOperationCompleted); + this.DeleteObjectFromSecurityGroupOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteObjectFromSecurityGroupOperationCompleted); } - this.InvokeAsync("DeleteUserFromSecurityGroup", new object[] { + this.InvokeAsync("DeleteObjectFromSecurityGroup", new object[] { organizationId, - loginName, - groupName}, this.DeleteUserFromSecurityGroupOperationCompleted, userState); + accountName, + groupName}, this.DeleteObjectFromSecurityGroupOperationCompleted, userState); } - private void OnDeleteUserFromSecurityGroupOperationCompleted(object arg) + private void OnDeleteObjectFromSecurityGroupOperationCompleted(object arg) { - if ((this.DeleteUserFromSecurityGroupCompleted != null)) + if ((this.DeleteObjectFromSecurityGroupCompleted != 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)); + this.DeleteObjectFromSecurityGroupCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } @@ -1619,11 +1619,11 @@ namespace WebsitePanel.Providers.HostedSolution /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] - public delegate void AddUserToSecurityGroupCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + public delegate void AddObjectToSecurityGroupCompletedEventHandler(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); + public delegate void DeleteObjectFromSecurityGroupCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] diff --git a/WebsitePanel/Sources/WebsitePanel.Server/Organizations.asmx.cs b/WebsitePanel/Sources/WebsitePanel.Server/Organizations.asmx.cs index 33d87aed..419d0ac1 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/Organizations.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server/Organizations.asmx.cs @@ -135,15 +135,15 @@ namespace WebsitePanel.Server } [WebMethod, SoapHeader("settings")] - public void AddUserToSecurityGroup(string organizationId, string loginName, string groupName) + public void AddObjectToSecurityGroup(string organizationId, string accountName, string groupName) { - Organization.AddUserToSecurityGroup(organizationId, loginName, groupName); + Organization.AddObjectToSecurityGroup(organizationId, accountName, groupName); } [WebMethod, SoapHeader("settings")] - public void DeleteUserFromSecurityGroup(string organizationId, string loginName, string groupName) + public void DeleteObjectFromSecurityGroup(string organizationId, string accountName, string groupName) { - Organization.DeleteUserFromSecurityGroup(organizationId, loginName, groupName); + Organization.DeleteObjectFromSecurityGroup(organizationId, accountName, groupName); } [WebMethod, SoapHeader("settings")] diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config index cdbb540b..26ba29ee 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config @@ -548,6 +548,7 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx index 050c451d..e99d8965 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx @@ -5341,4 +5341,22 @@ At least one Phone number must be selected. + + Phone Numbers per Organization + + + Error creating user. See audit log for more details. + + + Error creating security group. See audit log for more details. + + + Error reading group settings + + + Error updating group settings + + + Group general settings have been successfully updated. + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SpaceQuotas.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SpaceQuotas.ascx.resx index 54dee688..fd22fa9b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SpaceQuotas.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SpaceQuotas.ascx.resx @@ -198,4 +198,7 @@ Organizations: + + Lync Phone Numbers: + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationSecurityGroupMemberOf.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationSecurityGroupMemberOf.ascx.resx new file mode 100644 index 00000000..8f9aefbc --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationSecurityGroupMemberOf.ascx.resx @@ -0,0 +1,135 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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...'); + + + Save Changes + + + Edit Group + + + General + + + Groups + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListMemberOf.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListMemberOf.ascx index 3ee22461..474aaa0c 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListMemberOf.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListMemberOf.ascx @@ -2,7 +2,7 @@ <%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> <%@ Register Src="UserControls/AccountsList.ascx" TagName="AccountsList" TagPrefix="wsp" %> <%@ Register Src="UserControls/MailboxSelector.ascx" TagName="MailboxSelector" TagPrefix="wsp" %> -<%@ Register Src="UserControls/DistributionListTabs.ascx" TagName="DistributionListTabs" 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" %> @@ -27,19 +27,20 @@
- + - - + + - + DistributionListsEnabled="true" + SecurityGroupsEnabled="true" /> diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListMemberOf.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListMemberOf.ascx.cs index 0a9340e4..ec9a8933 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListMemberOf.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListMemberOf.ascx.cs @@ -67,7 +67,20 @@ namespace WebsitePanel.Portal.ExchangeServer ExchangeAccount[] dLists = ES.Services.ExchangeServer.GetDistributionListsByMember(PanelRequest.ItemID, PanelRequest.AccountID); - distrlists.SetAccounts(dLists); + ExchangeAccount[] secGroups = ES.Services.Organizations.GetSecurityGroupsByMember(PanelRequest.ItemID, PanelRequest.AccountID); + + List groupsList = new List(); + foreach (ExchangeAccount distList in dLists) + { + groupsList.Add(distList); + } + + foreach (ExchangeAccount secGroup in secGroups) + { + groupsList.Add(secGroup); + } + + groups.SetAccounts(groupsList.ToArray()); } catch (Exception ex) @@ -83,18 +96,53 @@ namespace WebsitePanel.Portal.ExchangeServer try { - ExchangeAccount[] oldDistributionLists = ES.Services.ExchangeServer.GetDistributionListsByMember(PanelRequest.ItemID, PanelRequest.AccountID); - List newDistributionLists = new List(distrlists.GetAccounts()); - foreach (ExchangeAccount oldlist in oldDistributionLists) + ExchangeAccount[] oldSecGroups = ES.Services.Organizations.GetSecurityGroupsByMember(PanelRequest.ItemID, PanelRequest.AccountID); + ExchangeAccount[] oldDistLists = ES.Services.ExchangeServer.GetDistributionListsByMember(PanelRequest.ItemID, PanelRequest.AccountID); + + IList oldGroups = new List(); + foreach (ExchangeAccount distList in oldSecGroups) { - if (newDistributionLists.Contains(oldlist.AccountName)) - newDistributionLists.Remove(oldlist.AccountName); - else - ES.Services.ExchangeServer.DeleteDistributionListMember(PanelRequest.ItemID, oldlist.AccountName, PanelRequest.AccountID); + oldGroups.Add(distList); } - foreach (string newlist in newDistributionLists) - ES.Services.ExchangeServer.AddDistributionListMember(PanelRequest.ItemID, newlist, PanelRequest.AccountID); + foreach (ExchangeAccount secGroup in oldDistLists) + { + oldGroups.Add(secGroup); + } + + IDictionary newGroups = groups.GetFullAccounts(); + foreach (ExchangeAccount oldGroup in oldGroups) + { + if (newGroups.ContainsKey(oldGroup.AccountName)) + { + newGroups.Remove(oldGroup.AccountName); + } + else + { + switch (oldGroup.AccountType) + { + case ExchangeAccountType.DistributionList: + ES.Services.ExchangeServer.DeleteDistributionListMember(PanelRequest.ItemID, oldGroup.AccountName, PanelRequest.AccountID); + break; + case ExchangeAccountType.SecurityGroup: + ES.Services.Organizations.DeleteObjectFromSecurityGroup(PanelRequest.ItemID, PanelRequest.AccountID, oldGroup.AccountName); + break; + } + } + } + + foreach (KeyValuePair newGroup in newGroups) + { + switch (newGroup.Value) + { + case ExchangeAccountType.DistributionList: + ES.Services.ExchangeServer.AddDistributionListMember(PanelRequest.ItemID, newGroup.Key, PanelRequest.AccountID); + break; + case ExchangeAccountType.SecurityGroup: + ES.Services.Organizations.AddObjectToSecurityGroup(PanelRequest.ItemID, PanelRequest.AccountID, newGroup.Key); + break; + } + } messageBox.ShowSuccessMessage("EXCHANGE_UPDATE_DLIST_SETTINGS"); BindSettings(); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListMemberOf.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListMemberOf.ascx.designer.cs index 4cd03a2d..4344aefe 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListMemberOf.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListMemberOf.ascx.designer.cs @@ -1,3 +1,31 @@ +// 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. @@ -73,7 +101,7 @@ namespace WebsitePanel.Portal.ExchangeServer { /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::WebsitePanel.Portal.ExchangeServer.UserControls.DistributionListTabs tabs; + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.SecurityGroupTabs tabs; /// /// messageBox control. @@ -85,22 +113,22 @@ namespace WebsitePanel.Portal.ExchangeServer { protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; /// - /// secDistributionLists control. + /// secGroups control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::WebsitePanel.Portal.CollapsiblePanel secDistributionLists; + protected global::WebsitePanel.Portal.CollapsiblePanel secGroups; /// - /// DistributionLists control. + /// GroupsPanel 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 GroupsPanel; /// /// GeneralUpdatePanel control. @@ -112,13 +140,13 @@ namespace WebsitePanel.Portal.ExchangeServer { protected global::System.Web.UI.UpdatePanel GeneralUpdatePanel; /// - /// distrlists control. + /// groups control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::WebsitePanel.Portal.ExchangeServer.UserControls.AccountsList distrlists; + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.AccountsList groups; /// /// btnSave control. diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMemberOf.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMemberOf.ascx index aa56e6a5..f60842ea 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMemberOf.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMemberOf.ascx @@ -32,16 +32,17 @@ - - + + - + DistributionListsEnabled="true" + SecurityGroupsEnabled="true" /> diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMemberOf.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMemberOf.ascx.cs index 1dedb147..90250d87 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMemberOf.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMemberOf.ascx.cs @@ -59,10 +59,24 @@ namespace WebsitePanel.Portal.ExchangeServer // title litDisplayName.Text = mailbox.DisplayName; - + //Distribution Lists ExchangeAccount[] dLists = ES.Services.ExchangeServer.GetDistributionListsByMember(PanelRequest.ItemID, PanelRequest.AccountID); - distrlists.SetAccounts(dLists); + //Security Groups + ExchangeAccount[] securGroups = ES.Services.Organizations.GetSecurityGroupsByMember(PanelRequest.ItemID, PanelRequest.AccountID); + + List groupsList = new List(); + foreach (ExchangeAccount distList in dLists) + { + groupsList.Add(distList); + } + + foreach (ExchangeAccount secGroup in securGroups) + { + groupsList.Add(secGroup); + } + + groups.SetAccounts(groupsList.ToArray()); } catch (Exception ex) @@ -78,18 +92,53 @@ namespace WebsitePanel.Portal.ExchangeServer try { - ExchangeAccount[] oldDistributionLists = ES.Services.ExchangeServer.GetDistributionListsByMember(PanelRequest.ItemID, PanelRequest.AccountID); - List newDistributionLists = new List(distrlists.GetAccounts()); - foreach (ExchangeAccount oldlist in oldDistributionLists) + ExchangeAccount[] oldSecGroups = ES.Services.Organizations.GetSecurityGroupsByMember(PanelRequest.ItemID, PanelRequest.AccountID); + ExchangeAccount[] oldDistLists = ES.Services.ExchangeServer.GetDistributionListsByMember(PanelRequest.ItemID, PanelRequest.AccountID); + + IList oldGroups = new List(); + foreach (ExchangeAccount distList in oldSecGroups) { - if (newDistributionLists.Contains(oldlist.AccountName)) - newDistributionLists.Remove(oldlist.AccountName); - else - ES.Services.ExchangeServer.DeleteDistributionListMember(PanelRequest.ItemID, oldlist.AccountName, PanelRequest.AccountID); + oldGroups.Add(distList); } - foreach (string newlist in newDistributionLists) - ES.Services.ExchangeServer.AddDistributionListMember(PanelRequest.ItemID, newlist, PanelRequest.AccountID); + foreach (ExchangeAccount secGroup in oldDistLists) + { + oldGroups.Add(secGroup); + } + + IDictionary newGroups = groups.GetFullAccounts(); + foreach (ExchangeAccount oldGroup in oldGroups) + { + if (newGroups.ContainsKey(oldGroup.AccountName)) + { + newGroups.Remove(oldGroup.AccountName); + } + else + { + switch (oldGroup.AccountType) + { + case ExchangeAccountType.DistributionList: + ES.Services.ExchangeServer.DeleteDistributionListMember(PanelRequest.ItemID, oldGroup.AccountName, PanelRequest.AccountID); + break; + case ExchangeAccountType.SecurityGroup: + ES.Services.Organizations.DeleteObjectFromSecurityGroup(PanelRequest.ItemID, PanelRequest.AccountID, oldGroup.AccountName); + break; + } + } + } + + foreach (KeyValuePair newGroup in newGroups) + { + switch (newGroup.Value) + { + case ExchangeAccountType.DistributionList: + ES.Services.ExchangeServer.AddDistributionListMember(PanelRequest.ItemID, newGroup.Key, PanelRequest.AccountID); + break; + case ExchangeAccountType.SecurityGroup: + ES.Services.Organizations.AddObjectToSecurityGroup(PanelRequest.ItemID, PanelRequest.AccountID, newGroup.Key); + break; + } + } messageBox.ShowSuccessMessage("EXCHANGE_UPDATE_MAILBOX_SETTINGS"); BindSettings(); @@ -104,7 +153,5 @@ namespace WebsitePanel.Portal.ExchangeServer { SaveSettings(); } - - } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMemberOf.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMemberOf.ascx.designer.cs index 8ae1757e..cf9f3e20 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMemberOf.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMemberOf.ascx.designer.cs @@ -1,3 +1,31 @@ +// 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. @@ -85,22 +113,22 @@ namespace WebsitePanel.Portal.ExchangeServer { protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; /// - /// secDistributionLists control. + /// secGroups control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::WebsitePanel.Portal.CollapsiblePanel secDistributionLists; + protected global::WebsitePanel.Portal.CollapsiblePanel secGroups; /// - /// DistributionLists control. + /// GroupsPanel 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 GroupsPanel; /// /// GeneralUpdatePanel control. @@ -112,13 +140,13 @@ namespace WebsitePanel.Portal.ExchangeServer { protected global::System.Web.UI.UpdatePanel GeneralUpdatePanel; /// - /// distrlists control. + /// groups control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::WebsitePanel.Portal.ExchangeServer.UserControls.AccountsList distrlists; + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.AccountsList groups; /// /// btnSave control. diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx.cs index 0d251711..a22efa38 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx.cs @@ -128,7 +128,7 @@ namespace WebsitePanel.Portal.HostedSolution } catch (Exception ex) { - messageBox.ShowErrorMessage("EXCHANGE_CREATE_MAILBOX", ex); + messageBox.ShowErrorMessage("ORGANIZATION_CREATE_USER", ex); } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroupGeneralSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroupGeneralSettings.ascx.cs index 1c0d244b..7ebfe3f9 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroupGeneralSettings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroupGeneralSettings.ascx.cs @@ -76,6 +76,7 @@ namespace WebsitePanel.Portal.ExchangeServer members.Enabled = false; btnSave.Visible = false; + tabs.IsDefault = true; } } catch (Exception ex) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroupMemberOf.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroupMemberOf.ascx new file mode 100644 index 00000000..936319d7 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroupMemberOf.ascx @@ -0,0 +1,59 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="OrganizationSecurityGroupMemberOf.ascx.cs" Inherits="WebsitePanel.Portal.HostedSolution.OrganizationSecurityGroupMemberOf" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> + +<%@ Register Src="../UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="UserControls/AccountsList.ascx" TagName="AccountsList" TagPrefix="wsp" %> +<%@ Register Src="UserControls/SecurityGroupTabs.ascx" TagName="SecurityGroupTabs" TagPrefix="wsp"%> + + + +
+
+
+ +
+
+ +
+
+
+
+ + + - + +
+ +
+ + + + + + + + + + + + + + +
+ + +
+
+
+
+
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroupMemberOf.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroupMemberOf.ascx.cs new file mode 100644 index 00000000..9b7fc8fa --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroupMemberOf.ascx.cs @@ -0,0 +1,140 @@ +// 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.Web.UI.WebControls; +using System.Collections.Generic; +using WebsitePanel.EnterpriseServer; +using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.Providers.ResultObjects; + +namespace WebsitePanel.Portal.HostedSolution +{ + public partial class OrganizationSecurityGroupMemberOf : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + BindSettings(); + } + } + + private void BindSettings() + { + try + { + // get settings + OrganizationSecurityGroup group = ES.Services.Organizations.GetSecurityGroupGeneralSettings(PanelRequest.ItemID, PanelRequest.AccountID); + + litDisplayName.Text = group.DisplayName; + + //Distribution Lists + ExchangeAccount[] dLists = ES.Services.ExchangeServer.GetDistributionListsByMember(PanelRequest.ItemID, PanelRequest.AccountID); + + //Security Groups + ExchangeAccount[] securGroups = ES.Services.Organizations.GetSecurityGroupsByMember(PanelRequest.ItemID, PanelRequest.AccountID); + + List groupsList = new List(); + foreach (ExchangeAccount distList in dLists) + { + groupsList.Add(distList); + } + + foreach (ExchangeAccount secGroup in securGroups) + { + groupsList.Add(secGroup); + } + + groups.SetAccounts(groupsList.ToArray()); + + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("ORGANIZATION_GET_GROUP_SETTINGS", ex); + } + } + + private void SaveSettings() + { + if (!Page.IsValid) + return; + + try + { + ExchangeAccount[] oldSecGroups = ES.Services.Organizations.GetSecurityGroupsByMember(PanelRequest.ItemID, PanelRequest.AccountID); + ExchangeAccount[] oldDistLists = ES.Services.ExchangeServer.GetDistributionListsByMember(PanelRequest.ItemID, PanelRequest.AccountID); + + IList oldGroups = new List(); + foreach (ExchangeAccount distList in oldSecGroups) + { + oldGroups.Add(distList); + } + + foreach (ExchangeAccount secGroup in oldDistLists) + { + oldGroups.Add(secGroup); + } + + IDictionary newGroups = groups.GetFullAccounts(); + foreach (ExchangeAccount oldGroup in oldGroups) + { + if (newGroups.ContainsKey(oldGroup.AccountName)) + { + newGroups.Remove(oldGroup.AccountName); + } + else + { + ES.Services.Organizations.DeleteObjectFromSecurityGroup(PanelRequest.ItemID, PanelRequest.AccountID, oldGroup.AccountName); + } + } + + foreach (KeyValuePair newGroup in newGroups) + { + ES.Services.Organizations.AddObjectToSecurityGroup(PanelRequest.ItemID, PanelRequest.AccountID, newGroup.Key); + } + + messageBox.ShowSuccessMessage("ORGANIZATION_UPDATE_SECURITY_GROUP_SETTINGS"); + + + BindSettings(); + } + 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/OrganizationSecurityGroupMemberOf.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroupMemberOf.ascx.designer.cs new file mode 100644 index 00000000..26e24876 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroupMemberOf.ascx.designer.cs @@ -0,0 +1,169 @@ +// 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.HostedSolution { + + + public partial class OrganizationSecurityGroupMemberOf { + + /// + /// 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; + + /// + /// secGroups control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secGroups; + + /// + /// GroupsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel GroupsPanel; + + /// + /// GeneralUpdatePanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UpdatePanel GeneralUpdatePanel; + + /// + /// groups control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.AccountsList groups; + + /// + /// 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/OrganizationUserMemberOf.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserMemberOf.ascx index 36c12744..03e0181c 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserMemberOf.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserMemberOf.ascx @@ -43,27 +43,17 @@ - - - + + + - - - - - - - - - - - - + DistributionListsEnabled="true" + SecurityGroupsEnabled="true" /> diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserMemberOf.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserMemberOf.ascx.cs index cf175d4a..72cbe1dc 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserMemberOf.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserMemberOf.ascx.cs @@ -44,6 +44,7 @@ namespace WebsitePanel.Portal.HostedSolution BindSettings(); MailboxTabsId.Visible = (PanelRequest.Context == "Mailbox"); + UserTabsId.Visible = (PanelRequest.Context == "User"); } } @@ -53,26 +54,37 @@ namespace WebsitePanel.Portal.HostedSolution try { // get settings - ExchangeMailbox mailbox = ES.Services.ExchangeServer.GetMailboxGeneralSettings(PanelRequest.ItemID, - PanelRequest.AccountID); + OrganizationUser user = ES.Services.Organizations.GetUserGeneralSettings(PanelRequest.ItemID, PanelRequest.AccountID); - // title - litDisplayName.Text = mailbox.DisplayName; - + groups.DistributionListsEnabled = (user.AccountType == ExchangeAccountType.Mailbox + || user.AccountType == ExchangeAccountType.Room + || user.AccountType == ExchangeAccountType.Equipment); + + litDisplayName.Text = user.DisplayName; + //Distribution Lists ExchangeAccount[] dLists = ES.Services.ExchangeServer.GetDistributionListsByMember(PanelRequest.ItemID, PanelRequest.AccountID); - distrlists.SetAccounts(dLists); - //Security Groups ExchangeAccount[] securGroups = ES.Services.Organizations.GetSecurityGroupsByMember(PanelRequest.ItemID, PanelRequest.AccountID); - securegroups.SetAccounts(securGroups); + List groupsList = new List(); + foreach (ExchangeAccount distList in dLists) + { + groupsList.Add(distList); + } + + foreach (ExchangeAccount secGroup in securGroups) + { + groupsList.Add(secGroup); + } + + groups.SetAccounts(groupsList.ToArray()); } catch (Exception ex) { - messageBox.ShowErrorMessage("EXCHANGE_GET_MAILBOX_SETTINGS", ex); + messageBox.ShowErrorMessage("ORGANIZATION_GET_USER_SETTINGS", ex); } } @@ -83,48 +95,62 @@ namespace WebsitePanel.Portal.HostedSolution try { - //Distribution Lists - ExchangeAccount[] oldDistributionLists = ES.Services.ExchangeServer.GetDistributionListsByMember(PanelRequest.ItemID, PanelRequest.AccountID); - List newDistributionLists = new List(distrlists.GetAccounts()); - foreach (ExchangeAccount oldlist in oldDistributionLists) + ExchangeAccount[] oldSecGroups = ES.Services.Organizations.GetSecurityGroupsByMember(PanelRequest.ItemID, PanelRequest.AccountID); + ExchangeAccount[] oldDistLists = ES.Services.ExchangeServer.GetDistributionListsByMember(PanelRequest.ItemID, PanelRequest.AccountID); + + IList oldGroups = new List(); + foreach (ExchangeAccount distList in oldSecGroups) { - if (newDistributionLists.Contains(oldlist.AccountName)) - newDistributionLists.Remove(oldlist.AccountName); - else - ES.Services.ExchangeServer.DeleteDistributionListMember(PanelRequest.ItemID, oldlist.AccountName, PanelRequest.AccountID); + oldGroups.Add(distList); } - 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) + foreach (ExchangeAccount secGroup in oldDistLists) { - if (newSecurityGroups.Contains(oldgroup.AccountName)) + oldGroups.Add(secGroup); + } + + IDictionary newGroups = groups.GetFullAccounts(); + foreach (ExchangeAccount oldGroup in oldGroups) + { + if (newGroups.ContainsKey(oldGroup.AccountName)) { - newSecurityGroups.Remove(oldgroup.AccountName); + newGroups.Remove(oldGroup.AccountName); } else { - ES.Services.Organizations.DeleteUserFromSecurityGroup(PanelRequest.ItemID, PanelRequest.AccountID, oldgroup.AccountName); + switch (oldGroup.AccountType) + { + case ExchangeAccountType.DistributionList: + ES.Services.ExchangeServer.DeleteDistributionListMember(PanelRequest.ItemID, oldGroup.AccountName, PanelRequest.AccountID); + break; + case ExchangeAccountType.SecurityGroup: + ES.Services.Organizations.DeleteObjectFromSecurityGroup(PanelRequest.ItemID, PanelRequest.AccountID, oldGroup.AccountName); + break; + } } } - foreach (string newgroup in newSecurityGroups) + foreach (KeyValuePair newGroup in newGroups) { - ES.Services.Organizations.AddUserToSecurityGroup(PanelRequest.ItemID, PanelRequest.AccountID, newgroup); + switch (newGroup.Value) + { + case ExchangeAccountType.DistributionList: + ES.Services.ExchangeServer.AddDistributionListMember(PanelRequest.ItemID, newGroup.Key, PanelRequest.AccountID); + break; + case ExchangeAccountType.SecurityGroup: + ES.Services.Organizations.AddObjectToSecurityGroup(PanelRequest.ItemID, PanelRequest.AccountID, newGroup.Key); + break; + } } - messageBox.ShowSuccessMessage("EXCHANGE_UPDATE_MAILBOX_SETTINGS"); + messageBox.ShowSuccessMessage("ORGANIZATION_UPDATE_USER_SETTINGS"); BindSettings(); } catch (Exception ex) { - messageBox.ShowErrorMessage("EXCHANGE_UPDATE_MAILBOX_SETTINGS", ex); + messageBox.ShowErrorMessage("ORGANIZATION_UPDATE_USER_SETTINGS", 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 07a67d81..e184f834 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 @@ -123,76 +123,40 @@ namespace WebsitePanel.Portal.HostedSolution { protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; /// - /// secDistributionLists control. + /// secGroups control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::WebsitePanel.Portal.CollapsiblePanel secDistributionLists; + protected global::WebsitePanel.Portal.CollapsiblePanel secGroups; /// - /// DistributionListsPanel control. + /// GroupsPanel control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.Panel DistributionListsPanel; + protected global::System.Web.UI.WebControls.Panel GroupsPanel; /// - /// DLGeneralUpdatePanel control. + /// GeneralUpdatePanel control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.UpdatePanel DLGeneralUpdatePanel; + protected global::System.Web.UI.UpdatePanel GeneralUpdatePanel; /// - /// distrlists control. + /// groups control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - 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; + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.AccountsList groups; /// /// 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..75e858da 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/AccountsList.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/AccountsList.ascx @@ -37,6 +37,13 @@ + + + + + + + @@ -69,6 +76,8 @@ meta:resourcekey="chkIncludeContacts" AutoPostBack="true" CssClass="Normal" OnCheckedChanged="chkIncludeMailboxes_CheckedChanged" /> +
@@ -109,6 +118,12 @@ + + + + + +
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..ae1f7d0e 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 @@ -27,6 +27,7 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using System; +using System.Linq; using System.Collections.Generic; using System.Web.UI; using System.Web.UI.WebControls; @@ -67,6 +68,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; } @@ -77,16 +84,31 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls BindAccounts(accounts, false); } - public string[] GetAccounts() + 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(); + } + + public IDictionary GetFullAccounts() { // get selected accounts List selectedAccounts = GetGridViewAccounts(gvAccounts, SelectedState.All); - List accountNames = new List(); - foreach (ExchangeAccount account in selectedAccounts) - accountNames.Add(account.AccountName); + IDictionary accounts = new Dictionary(); - return accountNames.ToArray(); + foreach (ExchangeAccount account in selectedAccounts) + { + accounts.Add(account.AccountName, account.AccountType); + } + + return accounts; } protected void Page_Load(object sender, EventArgs e) @@ -109,6 +131,11 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls chkIncludeContacts.Checked = ContactsEnabled; chkIncludeLists.Visible = DistributionListsEnabled; chkIncludeLists.Checked = DistributionListsEnabled; + + chkIncludeGroups.Visible = SecurityGroupsEnabled; + chkIncludeGroups.Checked = SecurityGroupsEnabled; + + gvAccounts.Columns[3].Visible = gvPopupAccounts.Columns[3].Visible = SecurityGroupsEnabled; } // register javascript @@ -131,10 +158,12 @@ 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 + || accountType == ExchangeAccountType.SecurityGroup + || accountType == ExchangeAccountType.DefaultSecurityGroup) + imgName = "dlist_16.gif"; else if (accountType == ExchangeAccountType.Room) imgName = "room_16.gif"; else if (accountType == ExchangeAccountType.Equipment) @@ -143,6 +172,23 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls return GetThemedImage("Exchange/" + imgName); } + public string GetType(int accountTypeId) + { + ExchangeAccountType accountType = (ExchangeAccountType)accountTypeId; + + switch(accountType) + { + case ExchangeAccountType.DistributionList: + return "Distribution"; + case ExchangeAccountType.SecurityGroup: + return "Security"; + case ExchangeAccountType.DefaultSecurityGroup: + return "Default"; + default: + return string.Empty; + } + } + protected void btnAdd_Click(object sender, EventArgs e) { // bind all accounts @@ -174,9 +220,14 @@ 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 (SecurityGroupsEnabled) + { + accounts = accounts.Where(x => !GetAccounts().Contains(x.AccountName)).ToArray(); + } + if (ExcludeAccountId > 0) { List updatedAccounts = new List(); @@ -189,6 +240,11 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls gvPopupAccounts.DataSource = accounts; gvPopupAccounts.DataBind(); + + if (gvPopupAccounts.Rows.Count > 0) + { + UpdateGridViewAccounts(gvPopupAccounts); + } } private void BindAccounts(ExchangeAccount[] newAccounts, bool preserveExisting) @@ -224,6 +280,11 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls gvAccounts.DataSource = accounts; gvAccounts.DataBind(); + if (gvAccounts.Rows.Count > 0) + { + UpdateGridViewAccounts(gvAccounts); + } + btnDelete.Visible = gvAccounts.Rows.Count > 0; } @@ -251,6 +312,38 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls 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(); 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..63976c0b 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 @@ -153,6 +156,9 @@ The list of accounts is empty. Click "Add..." button to add accounts. + + Type + Display Name 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 index 54fc0f61..c8e8b70e 100644 --- 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 @@ -153,6 +153,9 @@ The list of accounts is empty. Click "Add..." button to add accounts. + + Type + Display Name @@ -163,7 +166,7 @@ No accounts found. - Organization Users + Organization Accounts Include in search: 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 index 85508aec..a8d0ee51 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/GroupsList.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/GroupsList.ascx.cs @@ -116,8 +116,8 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls private void BindPopupAccounts() { - ExchangeAccount[] accounts = ES.Services.Organizations.SearchSecurityGroups(PanelRequest.ItemID, - ddlSearchColumn.SelectedValue, txtSearchValue.Text + "%", ""); + ExchangeAccount[] accounts = ES.Services.Organizations.SearchOrganizationAccounts(PanelRequest.ItemID, + ddlSearchColumn.SelectedValue, txtSearchValue.Text + "%", "", true); accounts = accounts.Where(x => !GetAccounts().Contains(x.AccountName)).ToArray(); @@ -158,6 +158,8 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls gvGroups.DataSource = accounts; gvGroups.DataBind(); + UpdateGridViewAccounts(gvGroups); + btnDelete.Visible = gvGroups.Rows.Count > 0; } @@ -184,6 +186,38 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls 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(); 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..655d8c20 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 @@ -104,6 +104,10 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls chkIncludeLists.Visible = DistributionListsEnabled; chkIncludeLists.Checked = DistributionListsEnabled; } + + // increase timeout + ScriptManager scriptMngr = ScriptManager.GetCurrent(this.Page); + scriptMngr.AsyncPostBackTimeout = 300; } private void BindSelectedAccount(ExchangeAccount account) @@ -157,7 +161,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/SecurityGroupTabs.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/SecurityGroupTabs.ascx.cs index e99be105..51c698f7 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/SecurityGroupTabs.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/SecurityGroupTabs.ascx.cs @@ -44,6 +44,13 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls set { selectedTab = value; } } + private bool isDefault = false; + public bool IsDefault + { + get { return isDefault; } + set { isDefault = value; } + } + protected void Page_Load(object sender, EventArgs e) { BindTabs(); @@ -53,6 +60,10 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls { List tabsList = new List(); tabsList.Add(CreateTab("secur_group_settings", "Tab.Settings")); + if (!isDefault) + { + tabsList.Add(CreateTab("secur_group_memberof", "Tab.MemberOf")); + } PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserSelector.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserSelector.ascx.cs index da7d0b53..7407ff8f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserSelector.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserSelector.ascx.cs @@ -151,7 +151,9 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls protected void Page_Load(object sender, EventArgs e) { - + // increase timeout + ScriptManager scriptMngr = ScriptManager.GetCurrent(this.Page); + scriptMngr.AsyncPostBackTimeout = 300; } private void BindSelectedAccount(OrganizationUser account) @@ -288,6 +290,8 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls if (e.CommandName == "SelectAccount") { string[] parts = e.CommandArgument.ToString().Split('|'); + + /* OrganizationUser account = new OrganizationUser(); account.AccountName = parts[0]; account.DisplayName = parts[1]; @@ -295,6 +299,11 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls account.AccountId = Utils.ParseInt(parts[3]); account.SamAccountName = parts[4]; account.SubscriberNumber = parts[5]; + */ + + int AccountId = Utils.ParseInt(parts[3]); + + OrganizationUser account = ES.Services.Organizations.GetUserGeneralSettings(PanelRequest.ItemID, AccountId); // set account BindSelectedAccount(account); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UsersList.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UsersList.ascx index 5e68681b..7d41e78e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UsersList.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UsersList.ascx @@ -23,7 +23,7 @@ - + @@ -31,11 +31,18 @@ - + + + + + + + + @@ -83,18 +90,24 @@ - + - + + + + + + +
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 index b8311fd5..9fad6965 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UsersList.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UsersList.ascx.cs @@ -54,79 +54,12 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls Unselected } - public bool IncludeMailboxes - { - get - { - object ret = ViewState["IncludeMailboxes"]; - return (ret != null) ? (bool)ret : false; - } - set - { - ViewState["IncludeMailboxes"] = value; - } - } - - public bool IncludeMailboxesOnly - { - get - { - object ret = ViewState["IncludeMailboxesOnly"]; - return (ret != null) ? (bool)ret : false; - } - set - { - ViewState["IncludeMailboxesOnly"] = value; - } - } - - - public bool ExcludeOCSUsers - { - get - { - object ret = ViewState["ExcludeOCSUsers"]; - return (ret != null) ? (bool)ret : false; - } - set - { - ViewState["ExcludeOCSUsers"] = value; - } - } - - public bool ExcludeLyncUsers - { - get - { - object ret = ViewState["ExcludeLyncUsers"]; - return (ret != null) ? (bool)ret : false; - } - set - { - ViewState["ExcludeLyncUsers"] = value; - } - } - - - public bool ExcludeBESUsers - { - get - { - object ret = ViewState["ExcludeBESUsers"]; - return (ret != null) ? (bool)ret : false; - } - set - { - ViewState["ExcludeBESUsers"] = value; - } - } - public int ExcludeAccountId { get { return PanelRequest.AccountID; } } - public void SetAccounts(OrganizationUser[] accounts) + public void SetAccounts(ExchangeAccount[] accounts) { BindAccounts(accounts, false); } @@ -134,10 +67,10 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls public string[] GetAccounts() { // get selected accounts - List selectedAccounts = GetGridViewAccounts(gvAccounts, SelectedState.All); + List selectedAccounts = GetGridViewAccounts(gvAccounts, SelectedState.All); List accountNames = new List(); - foreach (OrganizationUser account in selectedAccounts) + foreach (ExchangeAccount account in selectedAccounts) accountNames.Add(account.AccountName); return accountNames.ToArray(); @@ -178,7 +111,7 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls protected void btnDelete_Click(object sender, EventArgs e) { // get selected accounts - List selectedAccounts = GetGridViewAccounts(gvAccounts, SelectedState.Unselected); + List selectedAccounts = GetGridViewAccounts(gvAccounts, SelectedState.Unselected); // add to the main list BindAccounts(selectedAccounts.ToArray(), false); @@ -187,7 +120,7 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls protected void btnAddSelected_Click(object sender, EventArgs e) { // get selected accounts - List selectedAccounts = GetGridViewAccounts(gvPopupAccounts, SelectedState.Selected); + List selectedAccounts = GetGridViewAccounts(gvPopupAccounts, SelectedState.Selected); // add to the main list BindAccounts(selectedAccounts.ToArray(), true); @@ -206,6 +139,15 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls case ExchangeAccountType.Equipment: imgName = "equipment_16.gif"; break; + case ExchangeAccountType.DistributionList: + imgName = "dlist_16.gif"; + break; + case ExchangeAccountType.SecurityGroup: + imgName = "dlist_16.gif"; + break; + case ExchangeAccountType.DefaultSecurityGroup: + imgName = "dlist_16.gif"; + break; default: imgName = "admin_16.png"; break; @@ -214,60 +156,42 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls return GetThemedImage("Exchange/" + imgName); } + public string GetType(int accountTypeId) + { + ExchangeAccountType accountType = (ExchangeAccountType)accountTypeId; + + switch (accountType) + { + case ExchangeAccountType.DistributionList: + return "Distribution"; + case ExchangeAccountType.SecurityGroup: + return "Security"; + case ExchangeAccountType.DefaultSecurityGroup: + return "Default Group"; + default: + return accountType.ToString(); + } + } + private void BindPopupAccounts() { - OrganizationUser[] accounts = ES.Services.Organizations.SearchAccounts(PanelRequest.ItemID, - ddlSearchColumn.SelectedValue, txtSearchValue.Text + "%", "", IncludeMailboxes); + ExchangeAccount[] accounts = ES.Services.Organizations.SearchOrganizationAccounts(PanelRequest.ItemID, + ddlSearchColumn.SelectedValue, txtSearchValue.Text + "%", "", false); - List newAccounts = new List(); + List newAccounts = new List(); accounts = accounts.Where(x => !GetAccounts().Contains(x.AccountName)).ToArray(); if (ExcludeAccountId > 0) { - List updatedAccounts = new List(); - foreach (OrganizationUser account in accounts) + List updatedAccounts = new List(); + foreach (ExchangeAccount account in accounts) if (account.AccountId != ExcludeAccountId) updatedAccounts.Add(account); accounts = updatedAccounts.ToArray(); } - if (IncludeMailboxesOnly) - { - - List updatedAccounts = new List(); - foreach (OrganizationUser account in accounts) - { - bool addUser = false; - if (account.ExternalEmail != string.Empty) addUser = true; - if ((account.IsBlackBerryUser) & (ExcludeBESUsers)) addUser = false; - if ((account.IsLyncUser) & (ExcludeLyncUsers)) addUser = false; - - if (addUser) updatedAccounts.Add(account); - } - - accounts = updatedAccounts.ToArray(); - } - else - if ((ExcludeOCSUsers) | (ExcludeBESUsers) | (ExcludeLyncUsers)) - { - - List updatedAccounts = new List(); - foreach (OrganizationUser account in accounts) - { - bool addUser = true; - if ((account.IsOCSUser) & (ExcludeOCSUsers)) addUser = false; - if ((account.IsLyncUser) & (ExcludeLyncUsers)) addUser = false; - if ((account.IsBlackBerryUser) & (ExcludeBESUsers)) addUser = false; - - if (addUser) updatedAccounts.Add(account); - } - - accounts = updatedAccounts.ToArray(); - } - - Array.Sort(accounts, CompareAccount); if (Direction == SortDirection.Ascending) { @@ -281,21 +205,21 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls gvPopupAccounts.DataBind(); } - private void BindAccounts(OrganizationUser[] newAccounts, bool preserveExisting) + private void BindAccounts(ExchangeAccount[] newAccounts, bool preserveExisting) { // get binded addresses - List accounts = new List(); + List accounts = new List(); if(preserveExisting) accounts.AddRange(GetGridViewAccounts(gvAccounts, SelectedState.All)); // add new accounts if (newAccounts != null) { - foreach (OrganizationUser newAccount in newAccounts) + foreach (ExchangeAccount newAccount in newAccounts) { // check if exists bool exists = false; - foreach (OrganizationUser account in accounts) + foreach (ExchangeAccount account in accounts) { if (String.Compare(newAccount.AccountName, account.AccountName, true) == 0) { @@ -317,9 +241,9 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls btnDelete.Visible = gvAccounts.Rows.Count > 0; } - private List GetGridViewAccounts(GridView gv, SelectedState state) + private List GetGridViewAccounts(GridView gv, SelectedState state) { - List accounts = new List(); + List accounts = new List(); for (int i = 0; i < gv.Rows.Count; i++) { GridViewRow row = gv.Rows[i]; @@ -327,7 +251,7 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls if (chkSelect == null) continue; - OrganizationUser account = new OrganizationUser(); + 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; @@ -352,7 +276,7 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls set { ViewState[DirectionString] = value; } } - private static int CompareAccount(OrganizationUser user1, OrganizationUser user2) + private static int CompareAccount(ExchangeAccount user1, ExchangeAccount user2) { return string.Compare(user1.DisplayName, user2.DisplayName); } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncAddLyncUserPlan.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncAddLyncUserPlan.ascx index 3c9b8873..bf22c7d7 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncAddLyncUserPlan.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncAddLyncUserPlan.ascx @@ -90,11 +90,6 @@ - - - - -
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncAddLyncUserPlan.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncAddLyncUserPlan.ascx.cs index 684a2e06..119ebfdd 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncAddLyncUserPlan.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncAddLyncUserPlan.ascx.cs @@ -42,12 +42,10 @@ namespace WebsitePanel.Portal.Lync { protected void Page_Load(object sender, EventArgs e) { - PackageContext cntx = null; + PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); if (!IsPostBack) { - cntx = ES.Services.Packages.GetPackageContext(PanelSecurity.PackageId); - string[] archivePolicy = ES.Services.Lync.GetPolicyList(PanelRequest.ItemID, LyncPolicyType.Archiving, null); if (archivePolicy != null) { @@ -95,23 +93,15 @@ namespace WebsitePanel.Portal.Lync */ chkRemoteUserAccess.Checked = plan.RemoteUserAccess; - chkPublicIMConnectivity.Checked = plan.PublicIMConnectivity; + chkAllowOrganizeMeetingsWithExternalAnonymous.Checked = plan.AllowOrganizeMeetingsWithExternalAnonymous; - chkAllowOrganizeMeetingsWithExternalAnonymous.Checked = plan.AllowOrganizeMeetingsWithExternalAnonymous; - - ddTelephony.SelectedIndex = plan.Telephony; + Utils.SelectListItem(ddTelephony, plan.Telephony); tbServerURI.Text = plan.ServerURI; - locTitle.Text = plan.LyncUserPlanName; - this.DisableControls = true; - - string planArchivePolicy = ""; - if (plan.ArchivePolicy != null) planArchivePolicy = plan.ArchivePolicy; - string planTelephonyDialPlanPolicy = ""; - if (plan.TelephonyDialPlanPolicy != null) planTelephonyDialPlanPolicy = plan.TelephonyDialPlanPolicy; - string planTelephonyVoicePolicy = ""; - if (plan.TelephonyVoicePolicy != null) planTelephonyVoicePolicy = plan.TelephonyVoicePolicy; + string planArchivePolicy = ""; if (plan.ArchivePolicy != null) planArchivePolicy = plan.ArchivePolicy; + string planTelephonyDialPlanPolicy = ""; if (plan.TelephonyDialPlanPolicy != null) planTelephonyDialPlanPolicy = plan.TelephonyDialPlanPolicy; + string planTelephonyVoicePolicy = ""; if (plan.TelephonyVoicePolicy != null) planTelephonyVoicePolicy = plan.TelephonyVoicePolicy; ddArchivingPolicy.Items.Clear(); ddArchivingPolicy.Items.Add(new System.Web.UI.WebControls.ListItem(planArchivePolicy.Replace("Tag:", ""), planArchivePolicy)); @@ -120,12 +110,16 @@ namespace WebsitePanel.Portal.Lync ddTelephonyVoicePolicy.Items.Clear(); ddTelephonyVoicePolicy.Items.Add(new System.Web.UI.WebControls.ListItem(planTelephonyVoicePolicy.Replace("Tag:", ""), planTelephonyVoicePolicy)); + locTitle.Text = plan.LyncUserPlanName; + this.DisableControls = true; } else { chkIM.Checked = true; chkIM.Enabled = false; + // chkNone.Checked = true; because not used + if (cntx != null) { foreach (QuotaValueInfo quota in cntx.QuotasArray) @@ -140,10 +134,6 @@ namespace WebsitePanel.Portal.Lync chkConferencing.Checked = Convert.ToBoolean(quota.QuotaAllocatedValue); chkConferencing.Enabled = Convert.ToBoolean(quota.QuotaAllocatedValue); break; - case 375: - chkEnterpriseVoice.Checked = Convert.ToBoolean(quota.QuotaAllocatedValue); - chkEnterpriseVoice.Enabled = Convert.ToBoolean(quota.QuotaAllocatedValue); - break; } } } @@ -152,32 +142,29 @@ namespace WebsitePanel.Portal.Lync } } + bool enterpriseVoiceQuota = Utils.CheckQouta(Quotas.LYNC_ENTERPRISEVOICE, cntx); + + PlanFeaturesTelephony.Visible = enterpriseVoiceQuota; + secPlanFeaturesTelephony.Visible = enterpriseVoiceQuota; + if (!enterpriseVoiceQuota) Utils.SelectListItem(ddTelephony, "0"); + + bool enterpriseVoice = enterpriseVoiceQuota && (ddTelephony.SelectedValue == "2"); + chkEnterpriseVoice.Enabled = false; - chkEnterpriseVoice.Checked = false; + chkEnterpriseVoice.Checked = enterpriseVoice; + pnEnterpriseVoice.Visible = enterpriseVoice; - pnEnterpriseVoice.Visible = false; - pnServerURI.Visible = false; - - switch (ddTelephony.SelectedIndex) + switch (ddTelephony.SelectedValue) { - case 1: - break; - case 2: - pnEnterpriseVoice.Visible = true; - chkEnterpriseVoice.Checked = true; - break; - case 3: + case "3": + case "4": pnServerURI.Visible = true; - break; - case 4: - pnServerURI.Visible = true; - break; - + break; + default: + pnServerURI.Visible = false; + break; } - cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); - PlanFeaturesTelephony.Visible = Utils.CheckQouta(Quotas.LYNC_ENTERPRISEVOICE, cntx); - secPlanFeaturesTelephony.Visible = PlanFeaturesTelephony.Visible; } @@ -221,6 +208,8 @@ namespace WebsitePanel.Portal.Lync { try { + PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); + Providers.HostedSolution.LyncUserPlan plan = new Providers.HostedSolution.LyncUserPlan(); plan.LyncUserPlanName = txtPlan.Text; plan.IsDefault = false; @@ -230,8 +219,10 @@ namespace WebsitePanel.Portal.Lync plan.Federation = chkFederation.Checked; plan.Conferencing = chkConferencing.Checked; + bool enterpriseVoiceQuota = Utils.CheckQouta(Quotas.LYNC_ENTERPRISEVOICE, cntx); + bool enterpriseVoice = enterpriseVoiceQuota && (ddTelephony.SelectedValue == "2"); - plan.EnterpriseVoice = chkEnterpriseVoice.Checked; + plan.EnterpriseVoice = enterpriseVoice; plan.VoicePolicy = LyncVoicePolicyType.None; @@ -257,11 +248,12 @@ namespace WebsitePanel.Portal.Lync */ plan.RemoteUserAccess = chkRemoteUserAccess.Checked; - plan.PublicIMConnectivity = chkPublicIMConnectivity.Checked; plan.AllowOrganizeMeetingsWithExternalAnonymous = chkAllowOrganizeMeetingsWithExternalAnonymous.Checked; - plan.Telephony = ddTelephony.SelectedIndex; + int telephonyId = -1; + int.TryParse(ddTelephony.SelectedValue, out telephonyId); + plan.Telephony = telephonyId; plan.ServerURI = tbServerURI.Text; 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 1fc0acef..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 @@ -29,11 +29,13 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. +// Runtime Version:2.0.50727.3074 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ + namespace WebsitePanel.Portal.Lync { @@ -43,8 +45,9 @@ namespace WebsitePanel.Portal.Lync { /// asyncTasks control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; @@ -52,8 +55,9 @@ namespace WebsitePanel.Portal.Lync { /// breadcrumb control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Breadcrumb breadcrumb; @@ -61,8 +65,9 @@ namespace WebsitePanel.Portal.Lync { /// menu control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Menu menu; @@ -70,8 +75,9 @@ namespace WebsitePanel.Portal.Lync { /// Image1 control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Image Image1; @@ -79,8 +85,9 @@ namespace WebsitePanel.Portal.Lync { /// locTitle control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Localize locTitle; @@ -88,8 +95,9 @@ namespace WebsitePanel.Portal.Lync { /// messageBox control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; @@ -97,8 +105,9 @@ namespace WebsitePanel.Portal.Lync { /// secPlan control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::WebsitePanel.Portal.CollapsiblePanel secPlan; @@ -106,8 +115,9 @@ namespace WebsitePanel.Portal.Lync { /// Plan control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Panel Plan; @@ -115,8 +125,9 @@ namespace WebsitePanel.Portal.Lync { /// txtPlan control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.TextBox txtPlan; @@ -124,8 +135,9 @@ namespace WebsitePanel.Portal.Lync { /// valRequirePlan control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequirePlan; @@ -133,8 +145,9 @@ namespace WebsitePanel.Portal.Lync { /// secPlanFeatures control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::WebsitePanel.Portal.CollapsiblePanel secPlanFeatures; @@ -142,8 +155,9 @@ namespace WebsitePanel.Portal.Lync { /// PlanFeatures control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Panel PlanFeatures; @@ -151,8 +165,9 @@ namespace WebsitePanel.Portal.Lync { /// chkIM control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.CheckBox chkIM; @@ -160,8 +175,9 @@ namespace WebsitePanel.Portal.Lync { /// chkMobility control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.CheckBox chkMobility; @@ -169,8 +185,9 @@ namespace WebsitePanel.Portal.Lync { /// chkConferencing control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.CheckBox chkConferencing; @@ -178,8 +195,9 @@ namespace WebsitePanel.Portal.Lync { /// chkEnterpriseVoice control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.CheckBox chkEnterpriseVoice; @@ -187,8 +205,9 @@ namespace WebsitePanel.Portal.Lync { /// secPlanFeaturesFederation control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::WebsitePanel.Portal.CollapsiblePanel secPlanFeaturesFederation; @@ -196,8 +215,9 @@ namespace WebsitePanel.Portal.Lync { /// PlanFeaturesFederation control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Panel PlanFeaturesFederation; @@ -205,8 +225,9 @@ namespace WebsitePanel.Portal.Lync { /// chkFederation control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.CheckBox chkFederation; @@ -214,26 +235,19 @@ namespace WebsitePanel.Portal.Lync { /// chkRemoteUserAccess control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.CheckBox chkRemoteUserAccess; - /// - /// chkPublicIMConnectivity control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.CheckBox chkPublicIMConnectivity; - /// /// secPlanFeaturesArchiving control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::WebsitePanel.Portal.CollapsiblePanel secPlanFeaturesArchiving; @@ -241,8 +255,9 @@ namespace WebsitePanel.Portal.Lync { /// PlanFeaturesArchiving control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Panel PlanFeaturesArchiving; @@ -250,8 +265,9 @@ namespace WebsitePanel.Portal.Lync { /// locArchivingPolicy control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Localize locArchivingPolicy; @@ -259,8 +275,9 @@ namespace WebsitePanel.Portal.Lync { /// ddArchivingPolicy control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.DropDownList ddArchivingPolicy; @@ -268,8 +285,9 @@ namespace WebsitePanel.Portal.Lync { /// secPlanFeaturesMeeting control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::WebsitePanel.Portal.CollapsiblePanel secPlanFeaturesMeeting; @@ -277,8 +295,9 @@ namespace WebsitePanel.Portal.Lync { /// PlanFeaturesMeeting control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Panel PlanFeaturesMeeting; @@ -286,8 +305,9 @@ namespace WebsitePanel.Portal.Lync { /// chkAllowOrganizeMeetingsWithExternalAnonymous control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.CheckBox chkAllowOrganizeMeetingsWithExternalAnonymous; @@ -295,8 +315,9 @@ namespace WebsitePanel.Portal.Lync { /// secPlanFeaturesTelephony control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::WebsitePanel.Portal.CollapsiblePanel secPlanFeaturesTelephony; @@ -304,8 +325,9 @@ namespace WebsitePanel.Portal.Lync { /// PlanFeaturesTelephony control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Panel PlanFeaturesTelephony; @@ -313,8 +335,9 @@ namespace WebsitePanel.Portal.Lync { /// locTelephony control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Localize locTelephony; @@ -322,8 +345,9 @@ namespace WebsitePanel.Portal.Lync { /// ddTelephony control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.DropDownList ddTelephony; @@ -331,8 +355,9 @@ namespace WebsitePanel.Portal.Lync { /// pnEnterpriseVoice control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Panel pnEnterpriseVoice; @@ -340,8 +365,9 @@ namespace WebsitePanel.Portal.Lync { /// locTelephonyProvider control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Localize locTelephonyProvider; @@ -349,8 +375,9 @@ namespace WebsitePanel.Portal.Lync { /// tbTelephoneProvider control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.TextBox tbTelephoneProvider; @@ -358,8 +385,9 @@ namespace WebsitePanel.Portal.Lync { /// btnAccept control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Button btnAccept; @@ -367,8 +395,9 @@ namespace WebsitePanel.Portal.Lync { /// AcceptRequiredValidator control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.RequiredFieldValidator AcceptRequiredValidator; @@ -376,8 +405,9 @@ namespace WebsitePanel.Portal.Lync { /// locDialPlan control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Localize locDialPlan; @@ -385,8 +415,9 @@ namespace WebsitePanel.Portal.Lync { /// ddTelephonyDialPlanPolicy control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.DropDownList ddTelephonyDialPlanPolicy; @@ -394,8 +425,9 @@ namespace WebsitePanel.Portal.Lync { /// locVoicePolicy control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Localize locVoicePolicy; @@ -403,8 +435,9 @@ namespace WebsitePanel.Portal.Lync { /// ddTelephonyVoicePolicy control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.DropDownList ddTelephonyVoicePolicy; @@ -412,8 +445,9 @@ namespace WebsitePanel.Portal.Lync { /// pnServerURI control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Panel pnServerURI; @@ -421,8 +455,9 @@ namespace WebsitePanel.Portal.Lync { /// locServerURI control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Localize locServerURI; @@ -430,8 +465,9 @@ namespace WebsitePanel.Portal.Lync { /// tbServerURI control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.TextBox tbServerURI; @@ -439,8 +475,9 @@ namespace WebsitePanel.Portal.Lync { /// btnAdd control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Button btnAdd; @@ -448,8 +485,9 @@ namespace WebsitePanel.Portal.Lync { /// ValidationSummary1 control. /// /// - /// Auto-generated field. + /// 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/Lync/LyncCreateUser.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncCreateUser.ascx.cs index 74d1e604..9b0e6655 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncCreateUser.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncCreateUser.ascx.cs @@ -56,14 +56,18 @@ namespace WebsitePanel.Portal.Lync private void BindPhoneNumbers() { - - ddlPhoneNumber.Items.Add(new ListItem("", "")); + + foreach (PackageIPAddress ip in ips) + { + string phone = ip.ExternalIP; + ddlPhoneNumber.Items.Add(new ListItem(phone, ip.PackageAddressID.ToString())); + } } } @@ -71,21 +75,24 @@ namespace WebsitePanel.Portal.Lync protected void Page_PreRender(object sender, EventArgs e) { - bool EnterpriseVoice = false; + PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); + bool enterpriseVoiceQuota = Utils.CheckQouta(Quotas.LYNC_ENTERPRISEVOICE, cntx); + + bool enterpriseVoice = false; WebsitePanel.Providers.HostedSolution.LyncUserPlan plan = planSelector.plan; if (plan != null) - EnterpriseVoice = plan.EnterpriseVoice; + enterpriseVoice = plan.EnterpriseVoice && enterpriseVoiceQuota && (ddlPhoneNumber.Items.Count > 0); - pnEnterpriseVoice.Visible = EnterpriseVoice; + pnEnterpriseVoice.Visible = enterpriseVoice; - if (!EnterpriseVoice) + if (!enterpriseVoice) { ddlPhoneNumber.Text = ""; tbPin.Text = ""; } - if (EnterpriseVoice) + if (enterpriseVoice) { string[] pinPolicy = ES.Services.Lync.GetPolicyList(PanelRequest.ItemID, LyncPolicyType.Pin, "MinPasswordLength"); if (pinPolicy != null) @@ -111,9 +118,15 @@ namespace WebsitePanel.Portal.Lync if (res.IsSuccess && res.ErrorCodes.Count == 0) { + PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); + bool enterpriseVoiceQuota = Utils.CheckQouta(Quotas.LYNC_ENTERPRISEVOICE, cntx); + + string lineUri = ""; + if (enterpriseVoiceQuota) lineUri = ddlPhoneNumber.SelectedItem.Text + ":" + tbPin.Text; + //#1 LyncUser lyncUser = ES.Services.Lync.GetLyncUserGeneralSettings(PanelRequest.ItemID, accountId); - ES.Services.Lync.SetLyncUserGeneralSettings(PanelRequest.ItemID, accountId, lyncUser.SipAddress, ddlPhoneNumber.SelectedItem.Text + ":" + tbPin.Text); + ES.Services.Lync.SetLyncUserGeneralSettings(PanelRequest.ItemID, accountId, lyncUser.SipAddress, lineUri); Response.Redirect(EditUrl("AccountID", accountId.ToString(), "edit_lync_user", "SpaceID=" + PanelSecurity.PackageId, 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 12bced36..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 @@ -29,9 +29,10 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. +// Runtime Version:2.0.50727.3074 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.cs index 3656f917..b92a3b37 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.cs @@ -52,14 +52,17 @@ namespace WebsitePanel.Portal.Lync private void BindPhoneNumbers() { - - ddlPhoneNumber.Items.Add(new ListItem("", "")); + + foreach (PackageIPAddress ip in ips) + { + string phone = ip.ExternalIP; + ddlPhoneNumber.Items.Add(new ListItem(phone, phone)); + } } } @@ -67,21 +70,24 @@ namespace WebsitePanel.Portal.Lync protected void Page_PreRender(object sender, EventArgs e) { - bool EnterpriseVoice = false; + PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); + bool enterpriseVoiceQuota = Utils.CheckQouta(Quotas.LYNC_ENTERPRISEVOICE, cntx); + + bool enterpriseVoice = false; WebsitePanel.Providers.HostedSolution.LyncUserPlan plan = planSelector.plan; if (plan != null) - EnterpriseVoice = plan.EnterpriseVoice; + enterpriseVoice = plan.EnterpriseVoice && enterpriseVoiceQuota && (ddlPhoneNumber.Items.Count > 0); - pnEnterpriseVoice.Visible = EnterpriseVoice; + pnEnterpriseVoice.Visible = enterpriseVoice; - if (!EnterpriseVoice) + if (!enterpriseVoice) { ddlPhoneNumber.Text = ""; tbPin.Text = ""; } - if (EnterpriseVoice) + if (enterpriseVoice) { string[] pinPolicy = ES.Services.Lync.GetPolicyList(PanelRequest.ItemID, LyncPolicyType.Pin, "MinPasswordLength"); if (pinPolicy != null) @@ -120,10 +126,16 @@ namespace WebsitePanel.Portal.Lync return; try { + PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); + bool enterpriseVoiceQuota = Utils.CheckQouta(Quotas.LYNC_ENTERPRISEVOICE, cntx); + + string lineUri = ""; + if (enterpriseVoiceQuota) lineUri = ddlPhoneNumber.SelectedItem.Text + ":" + tbPin.Text; + LyncUserResult res = ES.Services.Lync.SetUserLyncPlan(PanelRequest.ItemID, PanelRequest.AccountID, Convert.ToInt32(planSelector.planId)); if (res.IsSuccess && res.ErrorCodes.Count == 0) { - res = ES.Services.Lync.SetLyncUserGeneralSettings(PanelRequest.ItemID, PanelRequest.AccountID, lyncUserSettings.sipAddress, ddlPhoneNumber.SelectedItem.Text + ":" + tbPin.Text); + res = ES.Services.Lync.SetLyncUserGeneralSettings(PanelRequest.ItemID, PanelRequest.AccountID, lyncUserSettings.sipAddress, lineUri); } if (res.IsSuccess && res.ErrorCodes.Count == 0) 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 73782c96..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 @@ -29,9 +29,10 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. +// Runtime Version:2.0.50727.3074 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ 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 8ed64ed4..cbaf20c5 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/LyncAllocatePhoneNumbers.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/LyncAllocatePhoneNumbers.ascx.designer.cs @@ -29,9 +29,10 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. +// Runtime Version:2.0.50727.3074 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/LyncPhoneNumbers.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/LyncPhoneNumbers.ascx index 6d0fcca5..34a709a2 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/LyncPhoneNumbers.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/LyncPhoneNumbers.ascx @@ -20,7 +20,7 @@ - +
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 11db7c69..a320a71e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/LyncPhoneNumbers.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/LyncPhoneNumbers.ascx.designer.cs @@ -29,9 +29,10 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. +// Runtime Version:2.0.50727.3074 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ 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 fc5338bd..661ba9f5 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PhoneNumbers.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PhoneNumbers.ascx.designer.cs @@ -29,11 +29,11 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. +// Runtime Version:2.0.50727.3074 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // - //------------------------------------------------------------------------------ namespace WebsitePanel.Portal { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PhoneNumbersAddPhoneNumber.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PhoneNumbersAddPhoneNumber.ascx.cs index f050f67c..a6271ed6 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PhoneNumbersAddPhoneNumber.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PhoneNumbersAddPhoneNumber.ascx.cs @@ -30,6 +30,7 @@ using System; using System.Data; using System.Configuration; using System.Collections; +using System.Collections.Generic; using System.Web; using System.Web.Security; using System.Web.UI; @@ -73,7 +74,15 @@ namespace WebsitePanel.Portal { try { - ddlServer.DataSource = ES.Services.Servers.GetServers(); + ServerInfo[] allServers = ES.Services.Servers.GetServers(); + List servers = new List(); + foreach(ServerInfo server in allServers) + { + ServiceInfo[] service = ES.Services.Servers.GetServicesByServerIdGroupName(server.ServerId, ResourceGroups.Lync); + if (service.Length>0) servers.Add(server); + } + + ddlServer.DataSource = servers; ddlServer.DataBind(); } catch (Exception ex) 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 ae27f15d..fddbcef1 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PhoneNumbersAddPhoneNumber.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PhoneNumbersAddPhoneNumber.ascx.designer.cs @@ -29,11 +29,11 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. +// Runtime Version:2.0.50727.3074 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // - //------------------------------------------------------------------------------ namespace WebsitePanel.Portal { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PhoneNumbersEditPhoneNumber.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PhoneNumbersEditPhoneNumber.ascx.cs index c056895d..97eb87ff 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PhoneNumbersEditPhoneNumber.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PhoneNumbersEditPhoneNumber.ascx.cs @@ -30,6 +30,7 @@ using System; using System.Data; using System.Configuration; using System.Collections; +using System.Collections.Generic; using System.Web; using System.Web.Security; using System.Web.UI; @@ -96,7 +97,16 @@ namespace WebsitePanel.Portal private void BindServers() { - ddlServer.DataSource = ES.Services.Servers.GetServers(); + ServerInfo[] allServers = ES.Services.Servers.GetServers(); + List servers = new List(); + foreach (ServerInfo server in allServers) + { + ServiceInfo[] service = ES.Services.Servers.GetServicesByServerIdGroupName(server.ServerId, ResourceGroups.Lync); + if (service.Length > 0) servers.Add(server); + } + + ddlServer.DataSource = servers; + ddlServer.DataBind(); ddlServer.Items.Insert(0, new ListItem(GetLocalizedString("Text.NotAssigned"), "")); } 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 43eeebb6..eea14e36 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PhoneNumbersEditPhoneNumber.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/PhoneNumbersEditPhoneNumber.ascx.designer.cs @@ -29,11 +29,11 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. +// Runtime Version:2.0.50727.3074 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // - //------------------------------------------------------------------------------ namespace WebsitePanel.Portal { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsLyncUserPlansPolicy.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsLyncUserPlansPolicy.ascx index 10eae934..33213b24 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsLyncUserPlansPolicy.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsLyncUserPlansPolicy.ascx @@ -105,11 +105,6 @@ - - - - -
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsLyncUserPlansPolicy.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsLyncUserPlansPolicy.ascx.cs index b33a0ce2..ff4771f0 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsLyncUserPlansPolicy.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsLyncUserPlansPolicy.ascx.cs @@ -173,7 +173,6 @@ namespace WebsitePanel.Portal plan.VoicePolicy = LyncVoicePolicyType.None; plan.RemoteUserAccess = chkRemoteUserAccess.Checked; - plan.PublicIMConnectivity = chkPublicIMConnectivity.Checked; plan.AllowOrganizeMeetingsWithExternalAnonymous = chkAllowOrganizeMeetingsWithExternalAnonymous.Checked; @@ -314,7 +313,6 @@ namespace WebsitePanel.Portal chkEnterpriseVoice.Checked = plan.EnterpriseVoice; chkRemoteUserAccess.Checked = plan.RemoteUserAccess; - chkPublicIMConnectivity.Checked = plan.PublicIMConnectivity; chkAllowOrganizeMeetingsWithExternalAnonymous.Checked = plan.AllowOrganizeMeetingsWithExternalAnonymous; ddTelephony.SelectedIndex = plan.Telephony; @@ -437,7 +435,6 @@ namespace WebsitePanel.Portal plan.VoicePolicy = LyncVoicePolicyType.None; plan.RemoteUserAccess = chkRemoteUserAccess.Checked; - plan.PublicIMConnectivity = chkPublicIMConnectivity.Checked; plan.AllowOrganizeMeetingsWithExternalAnonymous = chkAllowOrganizeMeetingsWithExternalAnonymous.Checked; 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 4dbc33f5..1f50b581 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsLyncUserPlansPolicy.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsLyncUserPlansPolicy.ascx.designer.cs @@ -29,11 +29,13 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. +// Runtime Version:2.0.50727.3074 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ + namespace WebsitePanel.Portal { @@ -43,8 +45,9 @@ namespace WebsitePanel.Portal { /// asyncTasks control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; @@ -52,8 +55,9 @@ namespace WebsitePanel.Portal { /// messageBox control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; @@ -61,8 +65,9 @@ namespace WebsitePanel.Portal { /// gvPlans control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.GridView gvPlans; @@ -70,8 +75,9 @@ namespace WebsitePanel.Portal { /// secPlan control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::WebsitePanel.Portal.CollapsiblePanel secPlan; @@ -79,8 +85,9 @@ namespace WebsitePanel.Portal { /// Plan control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Panel Plan; @@ -88,8 +95,9 @@ namespace WebsitePanel.Portal { /// txtPlan control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.TextBox txtPlan; @@ -97,8 +105,9 @@ namespace WebsitePanel.Portal { /// valRequirePlan control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequirePlan; @@ -106,8 +115,9 @@ namespace WebsitePanel.Portal { /// secPlanFeatures control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::WebsitePanel.Portal.CollapsiblePanel secPlanFeatures; @@ -115,8 +125,9 @@ namespace WebsitePanel.Portal { /// PlanFeatures control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Panel PlanFeatures; @@ -124,8 +135,9 @@ namespace WebsitePanel.Portal { /// chkIM control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.CheckBox chkIM; @@ -133,8 +145,9 @@ namespace WebsitePanel.Portal { /// chkMobility control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.CheckBox chkMobility; @@ -142,8 +155,9 @@ namespace WebsitePanel.Portal { /// chkConferencing control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.CheckBox chkConferencing; @@ -151,8 +165,9 @@ namespace WebsitePanel.Portal { /// chkEnterpriseVoice control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.CheckBox chkEnterpriseVoice; @@ -160,8 +175,9 @@ namespace WebsitePanel.Portal { /// secPlanFeaturesFederation control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::WebsitePanel.Portal.CollapsiblePanel secPlanFeaturesFederation; @@ -169,8 +185,9 @@ namespace WebsitePanel.Portal { /// PlanFeaturesFederation control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Panel PlanFeaturesFederation; @@ -178,8 +195,9 @@ namespace WebsitePanel.Portal { /// chkFederation control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.CheckBox chkFederation; @@ -187,26 +205,19 @@ namespace WebsitePanel.Portal { /// chkRemoteUserAccess control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.CheckBox chkRemoteUserAccess; - /// - /// chkPublicIMConnectivity control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.CheckBox chkPublicIMConnectivity; - /// /// secPlanFeaturesArchiving control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::WebsitePanel.Portal.CollapsiblePanel secPlanFeaturesArchiving; @@ -214,8 +225,9 @@ namespace WebsitePanel.Portal { /// PlanFeaturesArchiving control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Panel PlanFeaturesArchiving; @@ -223,8 +235,9 @@ namespace WebsitePanel.Portal { /// locArchivingPolicy control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Localize locArchivingPolicy; @@ -232,8 +245,9 @@ namespace WebsitePanel.Portal { /// ddArchivingPolicy control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.DropDownList ddArchivingPolicy; @@ -241,8 +255,9 @@ namespace WebsitePanel.Portal { /// secPlanFeaturesMeeting control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::WebsitePanel.Portal.CollapsiblePanel secPlanFeaturesMeeting; @@ -250,8 +265,9 @@ namespace WebsitePanel.Portal { /// PlanFeaturesMeeting control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Panel PlanFeaturesMeeting; @@ -259,8 +275,9 @@ namespace WebsitePanel.Portal { /// chkAllowOrganizeMeetingsWithExternalAnonymous control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.CheckBox chkAllowOrganizeMeetingsWithExternalAnonymous; @@ -268,8 +285,9 @@ namespace WebsitePanel.Portal { /// secPlanFeaturesTelephony control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::WebsitePanel.Portal.CollapsiblePanel secPlanFeaturesTelephony; @@ -277,8 +295,9 @@ namespace WebsitePanel.Portal { /// PlanFeaturesTelephony control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Panel PlanFeaturesTelephony; @@ -286,8 +305,9 @@ namespace WebsitePanel.Portal { /// locTelephony control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Localize locTelephony; @@ -295,8 +315,9 @@ namespace WebsitePanel.Portal { /// ddTelephony control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.DropDownList ddTelephony; @@ -304,8 +325,9 @@ namespace WebsitePanel.Portal { /// pnEnterpriseVoice control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Panel pnEnterpriseVoice; @@ -313,8 +335,9 @@ namespace WebsitePanel.Portal { /// locTelephonyProvider control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Localize locTelephonyProvider; @@ -322,8 +345,9 @@ namespace WebsitePanel.Portal { /// tbTelephoneProvider control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.TextBox tbTelephoneProvider; @@ -331,8 +355,9 @@ namespace WebsitePanel.Portal { /// btnAccept control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Button btnAccept; @@ -340,8 +365,9 @@ namespace WebsitePanel.Portal { /// AcceptRequiredValidator control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.RequiredFieldValidator AcceptRequiredValidator; @@ -349,8 +375,9 @@ namespace WebsitePanel.Portal { /// locDialPlan control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Localize locDialPlan; @@ -358,8 +385,9 @@ namespace WebsitePanel.Portal { /// ddTelephonyDialPlanPolicy control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.DropDownList ddTelephonyDialPlanPolicy; @@ -367,8 +395,9 @@ namespace WebsitePanel.Portal { /// locVoicePolicy control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Localize locVoicePolicy; @@ -376,8 +405,9 @@ namespace WebsitePanel.Portal { /// ddTelephonyVoicePolicy control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.DropDownList ddTelephonyVoicePolicy; @@ -385,8 +415,9 @@ namespace WebsitePanel.Portal { /// pnServerURI control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Panel pnServerURI; @@ -394,8 +425,9 @@ namespace WebsitePanel.Portal { /// locServerURI control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Localize locServerURI; @@ -403,8 +435,9 @@ namespace WebsitePanel.Portal { /// tbServerURI control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.TextBox tbServerURI; @@ -412,8 +445,9 @@ namespace WebsitePanel.Portal { /// btnAddPlan control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Button btnAddPlan; @@ -421,8 +455,9 @@ namespace WebsitePanel.Portal { /// btnUpdatePlan control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Button btnUpdatePlan; @@ -430,8 +465,9 @@ namespace WebsitePanel.Portal { /// txtStatus control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.TextBox txtStatus; } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx index 70a6bb26..fc4e2a8f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx @@ -57,6 +57,10 @@ + + + + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx.designer.cs index e699da6f..2c60f142 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx.designer.cs @@ -29,9 +29,10 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. +// Runtime Version:2.0.50727.3074 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ @@ -44,8 +45,9 @@ namespace WebsitePanel.Portal { /// pnlDiskspace control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.HtmlControls.HtmlTableRow pnlDiskspace; @@ -53,8 +55,9 @@ namespace WebsitePanel.Portal { /// quotaDiskspace control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::WebsitePanel.Portal.Quota quotaDiskspace; @@ -62,8 +65,9 @@ namespace WebsitePanel.Portal { /// lnkViewDiskspaceDetails control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.HyperLink lnkViewDiskspaceDetails; @@ -71,8 +75,9 @@ namespace WebsitePanel.Portal { /// pnlBandwidth control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.HtmlControls.HtmlTableRow pnlBandwidth; @@ -80,8 +85,9 @@ namespace WebsitePanel.Portal { /// quotaBandwidth control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::WebsitePanel.Portal.Quota quotaBandwidth; @@ -89,8 +95,9 @@ namespace WebsitePanel.Portal { /// lnkViewBandwidthDetails control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.HyperLink lnkViewBandwidthDetails; @@ -98,8 +105,9 @@ namespace WebsitePanel.Portal { /// pnlDomains control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.HtmlControls.HtmlTableRow pnlDomains; @@ -107,8 +115,9 @@ namespace WebsitePanel.Portal { /// lblDomains control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Label lblDomains; @@ -116,8 +125,9 @@ namespace WebsitePanel.Portal { /// quotaDomains control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::WebsitePanel.Portal.Quota quotaDomains; @@ -125,8 +135,9 @@ namespace WebsitePanel.Portal { /// pnlSubDomains control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.HtmlControls.HtmlTableRow pnlSubDomains; @@ -134,8 +145,9 @@ namespace WebsitePanel.Portal { /// lblSubDomains control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Label lblSubDomains; @@ -143,8 +155,9 @@ namespace WebsitePanel.Portal { /// quotaSubDomains control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::WebsitePanel.Portal.Quota quotaSubDomains; @@ -152,8 +165,9 @@ namespace WebsitePanel.Portal { /// pnlDomainPointers control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.HtmlControls.HtmlTableRow pnlDomainPointers; @@ -161,8 +175,9 @@ namespace WebsitePanel.Portal { /// lblDomainPointers control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Label lblDomainPointers; @@ -170,8 +185,9 @@ namespace WebsitePanel.Portal { /// quotaDomainPointers control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::WebsitePanel.Portal.Quota quotaDomainPointers; @@ -179,8 +195,9 @@ namespace WebsitePanel.Portal { /// pnlOrganizations control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.HtmlControls.HtmlTableRow pnlOrganizations; @@ -188,8 +205,9 @@ namespace WebsitePanel.Portal { /// lblOrganizations control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Label lblOrganizations; @@ -197,8 +215,9 @@ namespace WebsitePanel.Portal { /// quotaOrganizations control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::WebsitePanel.Portal.Quota quotaOrganizations; @@ -206,8 +225,9 @@ namespace WebsitePanel.Portal { /// pnlUserAccounts control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.HtmlControls.HtmlTableRow pnlUserAccounts; @@ -215,8 +235,9 @@ namespace WebsitePanel.Portal { /// lblUserAccounts control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Label lblUserAccounts; @@ -224,8 +245,9 @@ namespace WebsitePanel.Portal { /// quotaUserAccounts control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::WebsitePanel.Portal.Quota quotaUserAccounts; @@ -233,8 +255,9 @@ namespace WebsitePanel.Portal { /// pnlExchangeAccounts control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.HtmlControls.HtmlTableRow pnlExchangeAccounts; @@ -242,8 +265,9 @@ namespace WebsitePanel.Portal { /// lblExchangeAccounts control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Label lblExchangeAccounts; @@ -251,8 +275,9 @@ namespace WebsitePanel.Portal { /// quotaExchangeAccounts control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::WebsitePanel.Portal.Quota quotaExchangeAccounts; @@ -260,8 +285,9 @@ namespace WebsitePanel.Portal { /// pnlExchangeStorage control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.HtmlControls.HtmlTableRow pnlExchangeStorage; @@ -269,8 +295,9 @@ namespace WebsitePanel.Portal { /// lblExchangeStorage control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Label lblExchangeStorage; @@ -278,8 +305,9 @@ namespace WebsitePanel.Portal { /// quotaExchangeStorage control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::WebsitePanel.Portal.Quota quotaExchangeStorage; @@ -287,8 +315,9 @@ namespace WebsitePanel.Portal { /// pnlMailAccounts control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.HtmlControls.HtmlTableRow pnlMailAccounts; @@ -296,8 +325,9 @@ namespace WebsitePanel.Portal { /// lblMailAccounts control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Label lblMailAccounts; @@ -305,8 +335,9 @@ namespace WebsitePanel.Portal { /// quotaMailAccounts control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::WebsitePanel.Portal.Quota quotaMailAccounts; @@ -314,8 +345,9 @@ namespace WebsitePanel.Portal { /// pnlOCSUsers control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.HtmlControls.HtmlTableRow pnlOCSUsers; @@ -323,8 +355,9 @@ namespace WebsitePanel.Portal { /// lblOCSUsers control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Label lblOCSUsers; @@ -332,8 +365,9 @@ namespace WebsitePanel.Portal { /// quotaOCSUsers control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::WebsitePanel.Portal.Quota quotaOCSUsers; @@ -341,8 +375,9 @@ namespace WebsitePanel.Portal { /// pnlLyncUsers control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.HtmlControls.HtmlTableRow pnlLyncUsers; @@ -350,8 +385,9 @@ namespace WebsitePanel.Portal { /// lblLyncUsers control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Label lblLyncUsers; @@ -359,17 +395,49 @@ namespace WebsitePanel.Portal { /// quotaLyncUsers control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::WebsitePanel.Portal.Quota quotaLyncUsers; + /// + /// pnlLyncPhone control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow pnlLyncPhone; + + /// + /// Label1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + + /// + protected global::System.Web.UI.WebControls.Label Label1; + + /// + /// quotaLyncPhone control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + + /// + protected global::WebsitePanel.Portal.Quota quotaLyncPhone; + /// /// pnlBlackBerryUsers control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.HtmlControls.HtmlTableRow pnlBlackBerryUsers; @@ -377,8 +445,9 @@ namespace WebsitePanel.Portal { /// lblBlackBerryUsers control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Label lblBlackBerryUsers; @@ -386,8 +455,9 @@ namespace WebsitePanel.Portal { /// quotaBlackBerryUsers control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::WebsitePanel.Portal.Quota quotaBlackBerryUsers; @@ -395,8 +465,9 @@ namespace WebsitePanel.Portal { /// pnlSharepointSites control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.HtmlControls.HtmlTableRow pnlSharepointSites; @@ -404,8 +475,9 @@ namespace WebsitePanel.Portal { /// lblSharepointSites control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Label lblSharepointSites; @@ -413,8 +485,9 @@ namespace WebsitePanel.Portal { /// quotaSharepointSites control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::WebsitePanel.Portal.Quota quotaSharepointSites; @@ -422,8 +495,9 @@ namespace WebsitePanel.Portal { /// pnlWebSites control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.HtmlControls.HtmlTableRow pnlWebSites; @@ -431,8 +505,9 @@ namespace WebsitePanel.Portal { /// lblWebSites control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Label lblWebSites; @@ -440,8 +515,9 @@ namespace WebsitePanel.Portal { /// quotaWebSites control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::WebsitePanel.Portal.Quota quotaWebSites; @@ -449,8 +525,9 @@ namespace WebsitePanel.Portal { /// pnlFtpAccounts control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.HtmlControls.HtmlTableRow pnlFtpAccounts; @@ -458,8 +535,9 @@ namespace WebsitePanel.Portal { /// lblFtpAccounts control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Label lblFtpAccounts; @@ -467,8 +545,9 @@ namespace WebsitePanel.Portal { /// quotaFtpAccounts control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::WebsitePanel.Portal.Quota quotaFtpAccounts; @@ -476,8 +555,9 @@ namespace WebsitePanel.Portal { /// pnlDatabases control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.HtmlControls.HtmlTableRow pnlDatabases; @@ -485,8 +565,9 @@ namespace WebsitePanel.Portal { /// lblDatabases control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Label lblDatabases; @@ -494,8 +575,9 @@ namespace WebsitePanel.Portal { /// quotaDatabases control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::WebsitePanel.Portal.Quota quotaDatabases; @@ -503,8 +585,9 @@ namespace WebsitePanel.Portal { /// pnlHyperVForPC control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.HtmlControls.HtmlTableRow pnlHyperVForPC; @@ -512,8 +595,9 @@ namespace WebsitePanel.Portal { /// lblHyperVForPC control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Label lblHyperVForPC; @@ -521,8 +605,9 @@ namespace WebsitePanel.Portal { /// quotaNumberOfVm control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::WebsitePanel.Portal.Quota quotaNumberOfVm; @@ -530,8 +615,9 @@ namespace WebsitePanel.Portal { /// btnViewQuotas control. /// /// - /// Auto-generated field. + /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. + /// protected global::System.Web.UI.WebControls.Button btnViewQuotas; } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/AllocatePackagePhoneNumbers.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/AllocatePackagePhoneNumbers.ascx.cs index 991b7a21..d08c8828 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/AllocatePackagePhoneNumbers.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/AllocatePackagePhoneNumbers.ascx.cs @@ -90,7 +90,7 @@ namespace WebsitePanel.Portal.UserControls } int quotaAllowed = -1; - string quotaName = (String.Compare(ResourceGroup, ResourceGroups.VPS, true) == 0) ? Quotas.VPS_EXTERNAL_IP_ADDRESSES_NUMBER : Quotas.WEB_IP_ADDRESSES; + string quotaName = Quotas.LYNC_PHONE; PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); if (cntx.Quotas.ContainsKey(quotaName)) { 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 4bbd3de7..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 @@ -29,9 +29,10 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. +// Runtime Version:2.0.50727.3074 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ 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 2b4926c8..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 @@ -29,9 +29,10 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. +// Runtime Version:2.0.50727.3074 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SearchBox.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SearchBox.ascx.cs index e3a06bb8..a021d867 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SearchBox.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/SearchBox.ascx.cs @@ -79,5 +79,11 @@ namespace WebsitePanel.Portal { ddlFilterColumn.Items.Add(new ListItem(columnTitle, columnName)); } + + public override void Focus() + { + base.Focus(); + txtFilterValue.Focus(); + } } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCustomers.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCustomers.ascx.cs index 6c8337c1..4227131e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCustomers.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCustomers.ascx.cs @@ -67,8 +67,11 @@ namespace WebsitePanel.Portal gvUsers.Sort("Username", System.Web.UI.WebControls.SortDirection.Ascending); + } - } + + searchBox.Focus(); + } public string GetUserHomePageUrl(int userId) { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCustomersSummary.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCustomersSummary.ascx.cs index 95f1afe8..37ce14b1 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCustomersSummary.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCustomersSummary.ascx.cs @@ -44,6 +44,9 @@ namespace WebsitePanel.Portal this.ContainerControl.Visible = (PanelSecurity.SelectedUser.Role != UserRole.User); lnkAllCustomers.NavigateUrl = NavigatePageURL(PortalUtils.GetUserCustomersPageId(), PortalUtils.USER_ID_PARAM, PanelSecurity.SelectedUserId.ToString()); + + if (!IsPostBack) + txtFilterValue.Focus(); } private void BindGroupings() 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 4b8e408a..7cf454e4 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj @@ -209,6 +209,13 @@ + + OrganizationSecurityGroupMemberOf.ascx + ASPXCodeBehind + + + OrganizationSecurityGroupMemberOf.ascx + ExchangeDistributionListMemberOf.ascx ASPXCodeBehind @@ -3979,6 +3986,7 @@ +