diff --git a/WebsitePanel.Installer/Sources/VersionInfo.cs b/WebsitePanel.Installer/Sources/VersionInfo.cs index ee7d4a52..bc5f49ca 100644 --- a/WebsitePanel.Installer/Sources/VersionInfo.cs +++ b/WebsitePanel.Installer/Sources/VersionInfo.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.17929 +// Runtime Version:4.0.30319.18010 // // 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 c3d64463..7812a335 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/Database/install_db.sql b/WebsitePanel/Database/install_db.sql index 8eb8ed16..25b32209 100644 --- a/WebsitePanel/Database/install_db.sql +++ b/WebsitePanel/Database/install_db.sql @@ -6220,7 +6220,7 @@ GO CREATE PROCEDURE [dbo].[GetItemIdByOrganizationId] - @OrganizationId nvarchar(10) + @OrganizationId nvarchar(128) AS BEGIN SET NOCOUNT ON; diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index 77da0e45..0b3bc716 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -559,6 +559,30 @@ GO UPDATE [dbo].[ResourceGroups] SET ShowGroup=1 GO +IF NOT EXISTS(select 1 from sys.columns COLS INNER JOIN sys.objects OBJS ON OBJS.object_id=COLS.object_id and OBJS.type='U' AND OBJS.name='Quotas' AND COLS.name='HideQuota') +BEGIN +ALTER TABLE [dbo].[Quotas] ADD [HideQuota] [bit] NULL +END +GO + +UPDATE [dbo].[Quotas] SET [HideQuota] = 1 WHERE [QuotaName] = N'OS.DomainPointers' +GO + + +/****** Object: Table [dbo].[ExchangeAccounts] Extend Exchange Accounts with UserPrincipalName ******/ +IF NOT EXISTS(select 1 from sys.columns COLS INNER JOIN sys.objects OBJS ON OBJS.object_id=COLS.object_id and OBJS.type='U' AND OBJS.name='ExchangeAccounts' AND COLS.name='UserPrincipalName') +BEGIN +ALTER TABLE [dbo].[ExchangeAccounts] ADD + [UserPrincipalName] [nvarchar] (300) COLLATE Latin1_General_CI_AS NULL +END +GO + +IF NOT EXISTS(SELECT * FROM [dbo].[ExchangeAccounts] WHERE UserPrincipalName IS NOT NULL) +BEGIN + UPDATE [dbo].[ExchangeAccounts] SET [UserPrincipalName] = PrimaryEmailAddress +END +GO + /****** Object: Table [dbo].[ExchangeAccounts] Extend Exchange Accounts with SubscriberNumber ******/ IF NOT EXISTS(select 1 from sys.columns COLS INNER JOIN sys.objects OBJS ON OBJS.object_id=COLS.object_id and OBJS.type='U' AND OBJS.name='Users' AND COLS.name='SubscriberNumber') @@ -1457,7 +1481,8 @@ INSERT INTO ExchangeAccounts SamAccountName, AccountPassword, MailboxPlanId, - SubscriberNumber + SubscriberNumber, + UserPrincipalName ) VALUES ( @@ -1471,7 +1496,8 @@ VALUES @SamAccountName, @AccountPassword, @MailboxPlanId, - @SubscriberNumber + @SubscriberNumber, + @PrimaryEmailAddress ) SET @AccountID = SCOPE_IDENTITY() @@ -1802,7 +1828,9 @@ AS 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.MailboxPlanId IS NOT NULL) + 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 @@ -2144,7 +2172,8 @@ SELECT E.MailEnabledPublicFolder, E.MailboxPlanId, P.MailboxPlan, - E.SubscriberNumber + E.SubscriberNumber, + E.UserPrincipalName FROM ExchangeAccounts AS E LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId @@ -2229,7 +2258,8 @@ WITH Accounts AS ( EA.PrimaryEmailAddress, EA.MailEnabledPublicFolder, EA.MailboxPlanId, - EA.SubscriberNumber ' + @joincondition + + EA.SubscriberNumber, + EA.UserPrincipalName ' + @joincondition + ' WHERE ' + @condition + ' ) @@ -2278,7 +2308,8 @@ SELECT E.AccountPassword, E.MailboxPlanId, P.MailboxPlan, - E.SubscriberNumber + E.SubscriberNumber, + E.UserPrincipalName FROM ExchangeAccounts AS E LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId @@ -2291,6 +2322,37 @@ GO +ALTER PROCEDURE [dbo].[GetExchangeAccountByAccountName] +( + @ItemID int, + @AccountName nvarchar(300) +) +AS +SELECT + E.AccountID, + E.ItemID, + E.AccountType, + E.AccountName, + E.DisplayName, + E.PrimaryEmailAddress, + E.MailEnabledPublicFolder, + E.MailboxManagerActions, + E.SamAccountName, + E.AccountPassword, + E.MailboxPlanId, + P.MailboxPlan, + E.SubscriberNumber, + E.UserPrincipalName +FROM + ExchangeAccounts AS E +LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId +WHERE + E.ItemID = @ItemID AND + E.AccountName = @AccountName +RETURN +GO + + IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'GetExchangeAccountByMailboxPlanId') @@ -2317,7 +2379,8 @@ SELECT E.AccountPassword, E.MailboxPlanId, P.MailboxPlan, - E.SubscriberNumber + E.SubscriberNumber, + E.UserPrincipalName FROM ExchangeAccounts AS E LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId @@ -2344,7 +2407,8 @@ SELECT E.AccountPassword, E.MailboxPlanId, P.MailboxPlan, - E.SubscriberNumber + E.SubscriberNumber, + E.UserPrincipalName FROM ExchangeAccounts AS E LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId @@ -2367,7 +2431,8 @@ SELECT E.AccountPassword, E.MailboxPlanId, P.MailboxPlan, - E.SubscriberNumber + E.SubscriberNumber, + E.UserPrincipalName FROM ExchangeAccounts AS E LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId @@ -2407,7 +2472,8 @@ SELECT E.AccountPassword, E.MailboxPlanId, P.MailboxPlan, - E.SubscriberNumber + E.SubscriberNumber, + E.UserPrincipalName FROM ExchangeAccounts AS E LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId @@ -2434,7 +2500,8 @@ SELECT E.AccountPassword, E.MailboxPlanId, P.MailboxPlan, - E.SubscriberNumber + E.SubscriberNumber, + E.UserPrincipalName FROM ExchangeAccounts AS E LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId @@ -2457,7 +2524,8 @@ SELECT E.AccountPassword, E.MailboxPlanId, P.MailboxPlan, - E.SubscriberNumber + E.SubscriberNumber, + E.UserPrincipalName FROM ExchangeAccounts AS E LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId @@ -2904,7 +2972,8 @@ SELECT E.AccountPassword, E.MailboxPlanId, P.MailboxPlan, - E.SubscriberNumber + E.SubscriberNumber, + E.UserPrincipalName FROM ExchangeAccounts AS E LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId @@ -2934,7 +3003,8 @@ SELECT DisplayName, PrimaryEmailAddress, MailEnabledPublicFolder, - SubscriberNumber + SubscriberNumber, + UserPrincipalName FROM ExchangeAccounts WHERE @@ -2996,7 +3066,8 @@ SELECT MailboxManagerActions, SamAccountName, AccountPassword, - SubscriberNumber + SubscriberNumber, + UserPrincipalName FROM ExchangeAccounts WHERE AccountID = @AccountID @@ -3065,7 +3136,8 @@ SELECT EA.DisplayName, EA.PrimaryEmailAddress, EA.MailEnabledPublicFolder, - EA.SubscriberNumber + EA.SubscriberNumber, + EA.UserPrincipalName FROM ExchangeAccounts AS EA WHERE ' + @condition @@ -3138,7 +3210,8 @@ SELECT EA.AccountName, EA.DisplayName, EA.PrimaryEmailAddress, - EA.SubscriberNumber + EA.SubscriberNumber, + EA.UserPrincipalName FROM ExchangeAccounts AS EA WHERE ' + @condition @@ -3198,7 +3271,7 @@ AS ea.ItemID, ea.AccountName, ea.DisplayName, - ea.PrimaryEmailAddress, + ea.UserPrincipalName, ea.SamAccountName, ou.LyncUserPlanId, lp.LyncUserPlanName @@ -3236,7 +3309,7 @@ AS ea.ItemID, ea.AccountName, ea.DisplayName, - ea.PrimaryEmailAddress, + ea.UserPrincipalName, ea.SamAccountName, ou.LyncUserPlanId, lp.LyncUserPlanName @@ -3665,6 +3738,13 @@ RETURN GO +IF NOT EXISTS(select 1 from sys.columns COLS INNER JOIN sys.objects OBJS ON OBJS.object_id=COLS.object_id and OBJS.type='U' AND OBJS.name='LyncUsers' AND COLS.name='SipAddress') +BEGIN +ALTER TABLE [dbo].[LyncUsers] ADD + [SipAddress] [nvarchar] (300) COLLATE Latin1_General_CI_AS NULL +END +GO + IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'GetLyncUsers') @@ -3686,7 +3766,8 @@ CREATE TABLE #TempLyncUsers [ItemID] [int] NOT NULL, [AccountName] [nvarchar](300) NOT NULL, [DisplayName] [nvarchar](300) NOT NULL, - [PrimaryEmailAddress] [nvarchar](300) NULL, + [UserPrincipalName] [nvarchar](300) NULL, + [SipAddress] [nvarchar](300) NULL, [SamAccountName] [nvarchar](100) NULL, [LyncUserPlanId] [int] NOT NULL, [LyncUserPlanName] [nvarchar] (300) NOT NULL, @@ -3701,11 +3782,17 @@ BEGIN SET @condition = ''ORDER BY ea.DisplayName'' END -IF (@SortColumn = ''PrimaryEmailAddress'') +IF (@SortColumn = ''UserPrincipalName'') BEGIN - SET @condition = ''ORDER BY ea.PrimaryEmailAddress'' + SET @condition = ''ORDER BY ea.UserPrincipalName'' END +IF (@SortColumn = ''SipAddress'') +BEGIN + SET @condition = ''ORDER BY ou.SipAddress'' +END + + IF (@SortColumn = ''LyncUserPlanName'') BEGIN SET @condition = ''ORDER BY lp.LyncUserPlanName'' @@ -3721,7 +3808,8 @@ set @sql = '' ea.ItemID, ea.AccountName, ea.DisplayName, - ea.PrimaryEmailAddress, + ea.UserPrincipalName, + ou.SipAddress, ea.SamAccountName, ou.LyncUserPlanId, lp.LyncUserPlanName @@ -3757,11 +3845,17 @@ BEGIN SELECT * FROM #TempLyncUsers WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY DisplayName DESC END - IF (@SortColumn = ''PrimaryEmailAddress'') + IF (@SortColumn = ''UserPrincipalName'') BEGIN SELECT * FROM #TempLyncUsers - WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY PrimaryEmailAddress DESC + WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY UserPrincipalName DESC END + IF (@SortColumn = ''SipAddress'') + BEGIN + SELECT * FROM #TempLyncUsers + WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY SipAddress DESC + END + IF (@SortColumn = ''LyncUserPlanName'') BEGIN SELECT * FROM #TempLyncUsers @@ -3771,7 +3865,7 @@ BEGIN ELSE BEGIN SELECT * FROM #TempLyncUsers - WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY PrimaryEmailAddress DESC + WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY UserPrincipalName DESC END @@ -3784,6 +3878,134 @@ GO +ALTER PROCEDURE [dbo].[GetLyncUsers] +( + @ItemID int, + @SortColumn nvarchar(40), + @SortDirection nvarchar(20), + @StartRow int, + @Count int +) +AS + +CREATE TABLE #TempLyncUsers +( + [ID] [int] IDENTITY(1,1) NOT NULL, + [AccountID] [int], + [ItemID] [int] NOT NULL, + [AccountName] [nvarchar](300) NOT NULL, + [DisplayName] [nvarchar](300) NOT NULL, + [UserPrincipalName] [nvarchar](300) NULL, + [SipAddress] [nvarchar](300) NULL, + [SamAccountName] [nvarchar](100) NULL, + [LyncUserPlanId] [int] NOT NULL, + [LyncUserPlanName] [nvarchar] (300) NOT NULL, +) + + +DECLARE @condition nvarchar(700) +SET @condition = '' + +IF (@SortColumn = 'DisplayName') +BEGIN + SET @condition = 'ORDER BY ea.DisplayName' +END + +IF (@SortColumn = 'UserPrincipalName') +BEGIN + SET @condition = 'ORDER BY ea.UserPrincipalName' +END + +IF (@SortColumn = 'SipAddress') +BEGIN + SET @condition = 'ORDER BY ou.SipAddress' +END + + +IF (@SortColumn = 'LyncUserPlanName') +BEGIN + SET @condition = 'ORDER BY lp.LyncUserPlanName' +END + +DECLARE @sql nvarchar(3500) + +set @sql = '' + INSERT INTO + #TempLyncUsers + SELECT + ea.AccountID, + ea.ItemID, + ea.AccountName, + ea.DisplayName, + ea.UserPrincipalName, + ou.SipAddress, + ea.SamAccountName, + ou.LyncUserPlanId, + lp.LyncUserPlanName + FROM + ExchangeAccounts ea + INNER JOIN + LyncUsers ou + INNER JOIN + LyncUserPlans lp + ON + ou.LyncUserPlanId = lp.LyncUserPlanId + ON + ea.AccountID = ou.AccountID + WHERE + ea.ItemID = @ItemID + @condition + +exec sp_executesql @sql, N'@ItemID int',@ItemID + +DECLARE @RetCount int +SELECT @RetCount = COUNT(ID) FROM #TempLyncUsers + +IF (@SortDirection = 'ASC') +BEGIN + SELECT * FROM #TempLyncUsers + WHERE ID > @StartRow AND ID <= (@StartRow + @Count) +END +ELSE +BEGIN + IF @SortColumn <> '' AND @SortColumn IS NOT NULL + BEGIN + IF (@SortColumn = 'DisplayName') + BEGIN + SELECT * FROM #TempLyncUsers + WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY DisplayName DESC + END + IF (@SortColumn = 'UserPrincipalName') + BEGIN + SELECT * FROM #TempLyncUsers + WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY UserPrincipalName DESC + END + + IF (@SortColumn = 'SipAddress') + BEGIN + SELECT * FROM #TempLyncUsers + WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY SipAddress DESC + END + + IF (@SortColumn = 'LyncUserPlanName') + BEGIN + SELECT * FROM #TempLyncUsers + WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY LyncUserPlanName DESC + END + END + ELSE + BEGIN + SELECT * FROM #TempLyncUsers + WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY UserPrincipalName DESC + END + + +END + +DROP TABLE #TempLyncUsers +GO + + + @@ -3925,6 +4147,7 @@ SELECT dbo.GetPackageAllocatedQuota(@PackageID, Q.QuotaID) AS ParentQuotaValue FROM Quotas AS Q LEFT OUTER JOIN HostingPlanQuotas AS HPQ ON Q.QuotaID = HPQ.QuotaID AND HPQ.PlanID = @PlanID +WHERE Q.HideQuota IS NULL OR Q.HideQuota = 0 ORDER BY Q.QuotaOrder RETURN GO @@ -6419,9 +6642,293 @@ GO +IF NOT EXISTS (SELECT * FROM [dbo].[ScheduleTaskParameters] WHERE [ParameterID] = 'LYNC_REPORT') +BEGIN +INSERT [dbo].[ScheduleTaskParameters] ([TaskID], [ParameterID], [DataTypeID], [DefaultValue], [ParameterOrder]) VALUES (N'SCHEDULE_TASK_HOSTED_SOLUTION_REPORT', N'LYNC_REPORT', N'Boolean', N'true', 5) +END +GO +ALTER PROCEDURE [dbo].[GetItemIdByOrganizationId] + @OrganizationId nvarchar(128) +AS +BEGIN + SET NOCOUNT ON; + + SELECT + ItemID + FROM + dbo.ExchangeOrganizations + WHERE + OrganizationId = @OrganizationId +END +GO + + + + + + +ALTER PROCEDURE [dbo].[SearchServiceItemsPaged] +( + @ActorID int, + @UserID int, + @ItemTypeID int, + @FilterValue nvarchar(50) = '', + @SortColumn nvarchar(50), + @StartRow int, + @MaximumRows int +) +AS + + +-- check rights +IF dbo.CheckActorUserRights(@ActorID, @UserID) = 0 +RAISERROR('You are not allowed to access this account', 16, 1) + +-- build query and run it to the temporary table +DECLARE @sql nvarchar(2000) + +IF @ItemTypeID <> 13 +BEGIN + SET @sql = ' + DECLARE @EndRow int + SET @EndRow = @StartRow + @MaximumRows + DECLARE @Items TABLE + ( + ItemPosition int IDENTITY(1,1), + ItemID int + ) + INSERT INTO @Items (ItemID) + SELECT + SI.ItemID + FROM ServiceItems AS SI + INNER JOIN Packages AS P ON P.PackageID = SI.PackageID + INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID + WHERE + dbo.CheckUserParent(@UserID, P.UserID) = 1 + AND SI.ItemTypeID = @ItemTypeID + ' + + IF @FilterValue <> '' + SET @sql = @sql + ' AND SI.ItemName LIKE @FilterValue ' + + IF @SortColumn = '' OR @SortColumn IS NULL + SET @SortColumn = 'ItemName' + + SET @sql = @sql + ' ORDER BY ' + @SortColumn + ' ' + + SET @sql = @sql + ' SELECT COUNT(ItemID) FROM @Items; + SELECT + + SI.ItemID, + SI.ItemName, + + P.PackageID, + P.PackageName, + P.StatusID, + P.PurchaseDate, + + -- user + P.UserID, + U.Username, + U.FirstName, + U.LastName, + U.FullName, + U.RoleID, + U.Email + FROM @Items AS I + INNER JOIN ServiceItems AS SI ON I.ItemID = SI.ItemID + INNER JOIN Packages AS P ON SI.PackageID = P.PackageID + INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID + WHERE I.ItemPosition BETWEEN @StartRow AND @EndRow' +END +ELSE +BEGIN + + SET @SortColumn = REPLACE(@SortColumn, 'ItemName', 'DomainName') + + SET @sql = ' + DECLARE @EndRow int + SET @EndRow = @StartRow + @MaximumRows + DECLARE @Items TABLE + ( + ItemPosition int IDENTITY(1,1), + ItemID int + ) + INSERT INTO @Items (ItemID) + SELECT + D.DomainID + FROM Domains AS D + INNER JOIN Packages AS P ON P.PackageID = D.PackageID + INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID + WHERE + dbo.CheckUserParent(@UserID, P.UserID) = 1 + ' + + IF @FilterValue <> '' + SET @sql = @sql + ' AND D.DomainName LIKE @FilterValue ' + + IF @SortColumn = '' OR @SortColumn IS NULL + SET @SortColumn = 'DomainName' + + SET @sql = @sql + ' ORDER BY ' + @SortColumn + ' ' + + SET @sql = @sql + ' SELECT COUNT(ItemID) FROM @Items; + SELECT + + D.DomainID AS ItemID, + D.DomainName AS ItemName, + + P.PackageID, + P.PackageName, + P.StatusID, + P.PurchaseDate, + + -- user + P.UserID, + U.Username, + U.FirstName, + U.LastName, + U.FullName, + U.RoleID, + U.Email + FROM @Items AS I + INNER JOIN Domains AS D ON I.ItemID = D.DomainID + INNER JOIN Packages AS P ON D.PackageID = P.PackageID + INNER JOIN UsersDetailed AS U ON P.UserID = U.UserID + WHERE I.ItemPosition BETWEEN @StartRow AND @EndRow AND D.IsDomainPointer=0' +END + +exec sp_executesql @sql, N'@StartRow int, @MaximumRows int, @UserID int, @FilterValue nvarchar(50), @ItemTypeID int, @ActorID int', +@StartRow, @MaximumRows, @UserID, @FilterValue, @ItemTypeID, @ActorID + +RETURN +GO + + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'LyncUserExists') +BEGIN +EXEC sp_executesql N' +CREATE PROCEDURE [dbo].[LyncUserExists] +( + @AccountID int, + @SipAddress nvarchar(300), + @Exists bit OUTPUT +) +AS + + SET @Exists = 0 + IF EXISTS(SELECT * FROM [dbo].[ExchangeAccountEmailAddresses] WHERE [EmailAddress] = @SipAddress AND [AccountID] <> @AccountID) + BEGIN + SET @Exists = 1 + END + ELSE IF EXISTS(SELECT * FROM [dbo].[ExchangeAccounts] WHERE [PrimaryEmailAddress] = @SipAddress AND [AccountID] <> @AccountID) + BEGIN + SET @Exists = 1 + END + ELSE IF EXISTS(SELECT * FROM [dbo].[ExchangeAccounts] WHERE [UserPrincipalName] = @SipAddress AND [AccountID] <> @AccountID) + BEGIN + SET @Exists = 1 + END + ELSE IF EXISTS(SELECT * FROM [dbo].[ExchangeAccounts] WHERE [AccountName] = @SipAddress AND [AccountID] <> @AccountID) + BEGIN + SET @Exists = 1 + END + ELSE IF EXISTS(SELECT * FROM [dbo].[LyncUsers] WHERE [SipAddress] = @SipAddress) + BEGIN + SET @Exists = 1 + END + + + RETURN' +END +GO + + + + +ALTER PROCEDURE [dbo].[LyncUserExists] +( + @AccountID int, + @SipAddress nvarchar(300), + @Exists bit OUTPUT +) +AS + + SET @Exists = 0 + IF EXISTS(SELECT * FROM [dbo].[ExchangeAccountEmailAddresses] WHERE [EmailAddress] = @SipAddress AND [AccountID] <> @AccountID) + BEGIN + SET @Exists = 1 + END + ELSE IF EXISTS(SELECT * FROM [dbo].[ExchangeAccounts] WHERE [PrimaryEmailAddress] = @SipAddress AND [AccountID] <> @AccountID) + BEGIN + SET @Exists = 1 + END + ELSE IF EXISTS(SELECT * FROM [dbo].[ExchangeAccounts] WHERE [UserPrincipalName] = @SipAddress AND [AccountID] <> @AccountID) + BEGIN + SET @Exists = 1 + END + ELSE IF EXISTS(SELECT * FROM [dbo].[ExchangeAccounts] WHERE [AccountName] = @SipAddress AND [AccountID] <> @AccountID) + BEGIN + SET @Exists = 1 + END + ELSE IF EXISTS(SELECT * FROM [dbo].[LyncUsers] WHERE [SipAddress] = @SipAddress) + BEGIN + SET @Exists = 1 + END + + + RETURN +GO + + + + + +ALTER PROCEDURE [dbo].[AddLyncUser] + @AccountID int, + @LyncUserPlanID int, + @SipAddress nvarchar(300) +AS +INSERT INTO + dbo.LyncUsers + (AccountID, + LyncUserPlanID, + CreatedDate, + ModifiedDate, + SipAddress) +VALUES +( + @AccountID, + @LyncUserPlanID, + getdate(), + getdate(), + @SipAddress +) +GO + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'UpdateLyncUser') +BEGIN +EXEC sp_executesql N'CREATE PROCEDURE [dbo].[UpdateLyncUser] +( + @AccountID int, + @SipAddress nvarchar(300) +) +AS + +UPDATE LyncUsers SET + SipAddress = @SipAddress +WHERE + AccountID = @AccountID AND AccountType IN (1,7) + +RETURN' +END +GO -- Version 2.1 section @@ -6434,4 +6941,3 @@ BEGIN UPDATE [dbo].[Providers] SET [DisableAutoDiscovery] = NULL WHERE [DisplayName] = 'Hosted Microsoft Exchange Server 2013' END GO - diff --git a/WebsitePanel/Sources/Tools/WebsitePanel.Import.Enterprise/ApplicationForm.cs b/WebsitePanel/Sources/Tools/WebsitePanel.Import.Enterprise/ApplicationForm.cs index 1e1984c2..fb403a0a 100644 --- a/WebsitePanel/Sources/Tools/WebsitePanel.Import.Enterprise/ApplicationForm.cs +++ b/WebsitePanel/Sources/Tools/WebsitePanel.Import.Enterprise/ApplicationForm.cs @@ -100,6 +100,7 @@ namespace WebsitePanel.Import.Enterprise Global.TempDomain = serviceSettings["TempDomain"]; ServerInfo serverInfo = ServerController.GetServerById(serviceInfo.ServerId); Global.ADRootDomain = serverInfo.ADRootDomain; + Global.NetBiosDomain = ActiveDirectoryUtils.GetNETBIOSDomainName(Global.ADRootDomain); } private void OnBrowseOU(object sender, EventArgs e) diff --git a/WebsitePanel/Sources/Tools/WebsitePanel.Import.Enterprise/Global.cs b/WebsitePanel/Sources/Tools/WebsitePanel.Import.Enterprise/Global.cs index 0b279f17..1e5a928d 100644 --- a/WebsitePanel/Sources/Tools/WebsitePanel.Import.Enterprise/Global.cs +++ b/WebsitePanel/Sources/Tools/WebsitePanel.Import.Enterprise/Global.cs @@ -58,6 +58,13 @@ namespace WebsitePanel.Import.Enterprise set { aDRootDomain = value; } } + private static string netBiosDomain; + public static string NetBiosDomain + { + get { return netBiosDomain; } + set { netBiosDomain = value; } + } + public static PackageInfo Space; public static string TempDomain; diff --git a/WebsitePanel/Sources/Tools/WebsitePanel.Import.Enterprise/OrganizationImporter.cs b/WebsitePanel/Sources/Tools/WebsitePanel.Import.Enterprise/OrganizationImporter.cs index 7b3ff1bb..21b1c5f5 100644 --- a/WebsitePanel/Sources/Tools/WebsitePanel.Import.Enterprise/OrganizationImporter.cs +++ b/WebsitePanel/Sources/Tools/WebsitePanel.Import.Enterprise/OrganizationImporter.cs @@ -757,15 +757,19 @@ namespace WebsitePanel.Import.Enterprise if (EmailAddressExists(email)) return BusinessErrorCodes.ERROR_EXCHANGE_EMAIL_EXISTS; - - if (AccountExists(accountName)) throw new Exception(string.Format("Account {0} already exists", accountName)); string displayName = (string)entry.Properties["displayName"].Value; + string samName = (string)entry.Properties["sAMAccountName"].Value; + // this should really NEVER happen - an AD account without sAMAccountName?! + if (string.IsNullOrEmpty(samName)) + throw new Exception("SAMAccountName is not specified"); + // add Netbios-Domainname before samAccountName - format in the database + samName = Global.NetBiosDomain + "\\" + samName; - int userId = AddOrganizationUser(itemId, accountName, displayName, email, string.Empty); + int userId = AddOrganizationUser(itemId, accountName, displayName, email, samName, string.Empty); AddAccountEmailAddress(userId, email); //account type @@ -796,7 +800,7 @@ namespace WebsitePanel.Import.Enterprise return userId; } - UpdateExchangeAccount(userId, accountName, accountType, displayName, email, false, string.Empty, string.Empty, string.Empty); + UpdateExchangeAccount(userId, accountName, accountType, displayName, email, false, string.Empty, samName, string.Empty); string defaultEmail = (string)entry.Properties["extensionAttribute3"].Value; @@ -847,7 +851,7 @@ namespace WebsitePanel.Import.Enterprise if (email != null && email.ToLower().StartsWith("smtp:")) email = email.Substring(5); - + // no sAMAccountName for contacts - so String.Empty is OK int accountId = AddAccount(itemId, ExchangeAccountType.Contact, accountName, displayName, email, false, 0, string.Empty, null); Log.WriteEnd("Contact imported"); @@ -886,7 +890,14 @@ namespace WebsitePanel.Import.Enterprise if (EmailAddressExists(email)) return BusinessErrorCodes.ERROR_EXCHANGE_EMAIL_EXISTS; - int accountId = AddAccount(itemId, ExchangeAccountType.DistributionList, accountName, displayName, email, false, 0, string.Empty, null); + string samName = (string)entry.Properties["sAMAccountName"].Value; + // this should really NEVER happen - an AD group without sAMAccountName?! + if (string.IsNullOrEmpty(samName)) + throw new Exception("SAMAccountName is not specified"); + // add Netbios-Domainname before samAccountName - format in the database + samName = Global.NetBiosDomain + "\\" + samName; + + int accountId = AddAccount(itemId, ExchangeAccountType.DistributionList, accountName, displayName, email, false, 0, samName, null); AddAccountEmailAddress(accountId, email); string defaultEmail = (string)entry.Properties["extensionAttribute3"].Value; @@ -938,10 +949,10 @@ namespace WebsitePanel.Import.Enterprise mailboxManagerActions.ToString(), samAccountName, CryptoUtils.Encrypt(accountPassword),0, string.Empty); } - private static int AddOrganizationUser(int itemId, string accountName, string displayName, string email, string accountPassword) + private static int AddOrganizationUser(int itemId, string accountName, string displayName, string email, string samAccountName, string accountPassword) { return DataProvider.AddExchangeAccount(itemId, (int)ExchangeAccountType.User, accountName, displayName, email, false, string.Empty, - string.Empty, CryptoUtils.Encrypt(accountPassword),0 , string.Empty); + samAccountName, CryptoUtils.Encrypt(accountPassword), 0 , string.Empty); } diff --git a/WebsitePanel/Sources/VersionInfo.cs b/WebsitePanel/Sources/VersionInfo.cs index ee7d4a52..bc5f49ca 100644 --- a/WebsitePanel/Sources/VersionInfo.cs +++ b/WebsitePanel/Sources/VersionInfo.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.17929 +// Runtime Version:4.0.30319.18010 // // 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 ded96cbd..d2c94d8f 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.17929 +' Runtime Version:4.0.30319.18010 ' ' 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/Common/BusinessErrorCodes.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Common/BusinessErrorCodes.cs index f6f8dfd8..9bad6958 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Common/BusinessErrorCodes.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Common/BusinessErrorCodes.cs @@ -115,6 +115,7 @@ namespace WebsitePanel.EnterpriseServer public const int ERROR_WEB_SITE_SHARED_IP_ADDRESS_NOT_SPECIFIED = -608; public const int ERROR_WEB_SHARED_SSL_QUOTA_LIMIT = -609; public const int ERROR_GLOBALDNS_FOR_DEDICATEDIP = -610; + public const int ERROR_PUBLICSHAREDIP_FOR_SHAREDIP = -611; #endregion #region Mail @@ -323,6 +324,7 @@ namespace WebsitePanel.EnterpriseServer public const int ERROR_USERS_RESOURCE_QUOTA_LIMIT = -2707; public const int CURRENT_USER_IS_CRM_USER = -2708; public const int CURRENT_USER_IS_OCS_USER = -2709; + public const int CURRENT_USER_IS_LYNC_USER = -2710; #endregion diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/LyncProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/LyncProxy.cs index 3e960f56..cce2aeac 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/LyncProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/LyncProxy.cs @@ -29,7 +29,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.6387 +// Runtime Version:2.0.50727.6400 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -51,7 +51,6 @@ namespace WebsitePanel.EnterpriseServer { using WebsitePanel.Providers.HostedSolution; using WebsitePanel.Providers.ResultObjects; - /// @@ -85,6 +84,8 @@ namespace WebsitePanel.EnterpriseServer { private System.Threading.SendOrPostCallback GetLyncUserGeneralSettingsOperationCompleted; + private System.Threading.SendOrPostCallback SetLyncUserGeneralSettingsOperationCompleted; + private System.Threading.SendOrPostCallback SetUserLyncPlanOperationCompleted; private System.Threading.SendOrPostCallback GetFederationDomainsOperationCompleted; @@ -134,6 +135,9 @@ namespace WebsitePanel.EnterpriseServer { /// public event GetLyncUserGeneralSettingsCompletedEventHandler GetLyncUserGeneralSettingsCompleted; + /// + public event SetLyncUserGeneralSettingsCompletedEventHandler SetLyncUserGeneralSettingsCompleted; + /// public event SetUserLyncPlanCompletedEventHandler SetUserLyncPlanCompleted; @@ -680,6 +684,56 @@ namespace WebsitePanel.EnterpriseServer { } } + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SetLyncUserGeneralSettings", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public LyncUserResult SetLyncUserGeneralSettings(int itemId, int accountId, string sipAddress, string lineUri) { + object[] results = this.Invoke("SetLyncUserGeneralSettings", new object[] { + itemId, + accountId, + sipAddress, + lineUri}); + return ((LyncUserResult)(results[0])); + } + + /// + public System.IAsyncResult BeginSetLyncUserGeneralSettings(int itemId, int accountId, string sipAddress, string lineUri, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("SetLyncUserGeneralSettings", new object[] { + itemId, + accountId, + sipAddress, + lineUri}, callback, asyncState); + } + + /// + public LyncUserResult EndSetLyncUserGeneralSettings(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((LyncUserResult)(results[0])); + } + + /// + public void SetLyncUserGeneralSettingsAsync(int itemId, int accountId, string sipAddress, string lineUri) { + this.SetLyncUserGeneralSettingsAsync(itemId, accountId, sipAddress, lineUri, null); + } + + /// + public void SetLyncUserGeneralSettingsAsync(int itemId, int accountId, string sipAddress, string lineUri, object userState) { + if ((this.SetLyncUserGeneralSettingsOperationCompleted == null)) { + this.SetLyncUserGeneralSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetLyncUserGeneralSettingsOperationCompleted); + } + this.InvokeAsync("SetLyncUserGeneralSettings", new object[] { + itemId, + accountId, + sipAddress, + lineUri}, this.SetLyncUserGeneralSettingsOperationCompleted, userState); + } + + private void OnSetLyncUserGeneralSettingsOperationCompleted(object arg) { + if ((this.SetLyncUserGeneralSettingsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.SetLyncUserGeneralSettingsCompleted(this, new SetLyncUserGeneralSettingsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SetUserLyncPlan", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] public LyncUserResult SetUserLyncPlan(int itemId, int accountId, int lyncUserPlanId) { @@ -1177,6 +1231,32 @@ namespace WebsitePanel.EnterpriseServer { } } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void SetLyncUserGeneralSettingsCompletedEventHandler(object sender, SetLyncUserGeneralSettingsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class SetLyncUserGeneralSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal SetLyncUserGeneralSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public LyncUserResult Result { + get { + this.RaiseExceptionIfNecessary(); + return ((LyncUserResult)(this.results[0])); + } + } + } + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void SetUserLyncPlanCompletedEventHandler(object sender, SetUserLyncPlanCompletedEventArgs e); diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Data/DataProvider.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Data/DataProvider.cs index 892546ea..f7ab7cf4 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Data/DataProvider.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Data/DataProvider.cs @@ -3257,7 +3257,7 @@ namespace WebsitePanel.EnterpriseServer #region Lync - public static void AddLyncUser(int accountId, int lyncUserPlanId) + public static void AddLyncUser(int accountId, int lyncUserPlanId, string sipAddress) { SqlHelper.ExecuteNonQuery(ConnectionString, CommandType.StoredProcedure, @@ -3265,10 +3265,24 @@ namespace WebsitePanel.EnterpriseServer new[] { new SqlParameter("@AccountID", accountId), - new SqlParameter("@LyncUserPlanID", lyncUserPlanId) + new SqlParameter("@LyncUserPlanID", lyncUserPlanId), + new SqlParameter("@SipAddress", sipAddress) }); } + public static void UpdateLyncUser(int accountId, string sipAddress) + { + SqlHelper.ExecuteNonQuery(ConnectionString, + CommandType.StoredProcedure, + "UpdateLyncUser", + new[] + { + new SqlParameter("@AccountID", accountId), + new SqlParameter("@SipAddress", sipAddress) + }); + } + + public static bool CheckLyncUserExists(int accountId) { int res = (int)SqlHelper.ExecuteScalar(ConnectionString, CommandType.StoredProcedure, "CheckLyncUserExists", @@ -3276,6 +3290,25 @@ namespace WebsitePanel.EnterpriseServer return res > 0; } + public static bool LyncUserExists(int accountId, string sipAddress) + { + SqlParameter outParam = new SqlParameter("@Exists", SqlDbType.Bit); + outParam.Direction = ParameterDirection.Output; + + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "LyncUserExists", + new SqlParameter("@AccountID", accountId), + new SqlParameter("@SipAddress", sipAddress), + outParam + ); + + return Convert.ToBoolean(outParam.Value); + } + + + public static IDataReader GetLyncUsers(int itemId, string sortColumn, string sortDirection, int startRow, int count) { SqlParameter[] sqlParams = new SqlParameter[] diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/ExchangeServer/ExchangeServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/ExchangeServer/ExchangeServerController.cs index 22be24bb..486e2519 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/ExchangeServer/ExchangeServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/ExchangeServer/ExchangeServerController.cs @@ -2119,6 +2119,11 @@ namespace WebsitePanel.EnterpriseServer ocs.SetUserPrimaryUri(instanceId, emailAddress); } + if (DataProvider.CheckLyncUserExists(account.AccountId)) + { + LyncController.SetLyncUserGeneralSettings(itemId, accountId, emailAddress, null); + } + // save account UpdateAccount(account); diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/LyncController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/LyncController.cs index dbbdb260..a72d5b59 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/LyncController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/LyncController.cs @@ -228,7 +228,7 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution LyncUserPlan plan = GetLyncUserPlan(itemId, lyncUserPlanId); - if (!lync.CreateUser(org.OrganizationId, user.PrimaryEmailAddress, plan)) + if (!lync.CreateUser(org.OrganizationId, user.UserPrincipalName, plan)) { TaskManager.CompleteResultTask(res, LyncErrorCodes.CANNOT_ADD_LYNC_USER); return res; @@ -250,7 +250,7 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution try { - DataProvider.AddLyncUser(accountId, lyncUserPlanId); + DataProvider.AddLyncUser(accountId, lyncUserPlanId, user.UserPrincipalName); } catch (Exception ex) { @@ -318,7 +318,7 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution usr = OrganizationController.GetAccount(itemId, accountId); if (usr != null) - user = lync.GetLyncUserGeneralSettings(org.OrganizationId, usr.PrimaryEmailAddress); + user = lync.GetLyncUserGeneralSettings(org.OrganizationId, usr.UserPrincipalName); if (user != null) { @@ -341,6 +341,77 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution } + public static LyncUserResult SetLyncUserGeneralSettings(int itemId, int accountId, string sipAddress, string lineUri) + { + LyncUserResult res = TaskManager.StartResultTask("LYNC", "SET_LYNC_USER_GENERAL_SETTINGS"); + + LyncUser user = null; + + try + { + Organization org = (Organization)PackageController.GetPackageItem(itemId); + if (org == null) + { + throw new ApplicationException( + string.Format("Organization is null. ItemId={0}", itemId)); + } + + int lyncServiceId = GetLyncServiceID(org.PackageId); + LyncServer lync = GetLyncServer(lyncServiceId, org.ServiceId); + + OrganizationUser usr; + usr = OrganizationController.GetAccount(itemId, accountId); + + if (usr != null) + user = lync.GetLyncUserGeneralSettings(org.OrganizationId, usr.UserPrincipalName); + + if (user != null) + { + LyncUserPlan plan = ObjectUtils.FillObjectFromDataReader(DataProvider.GetLyncUserPlanByAccountId(accountId)); + + if (plan != null) + { + user.LyncUserPlanId = plan.LyncUserPlanId; + user.LyncUserPlanName = plan.LyncUserPlanName; + } + + + if (!string.IsNullOrEmpty(sipAddress)) + { + if (sipAddress != usr.UserPrincipalName) + { + if (DataProvider.LyncUserExists(accountId, sipAddress)) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.ADDRESS_ALREADY_USED); + return res; + } + } + + user.SipAddress = sipAddress; + + } + + if (!string.IsNullOrEmpty(lineUri)) user.LineUri = lineUri; + + lync.SetLyncUserGeneralSettings(org.OrganizationId, usr.UserPrincipalName, user); + + DataProvider.UpdateLyncUser(accountId, sipAddress); + } + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.FAILED_SET_SETTINGS, ex); + return res; + } + + res.IsSuccess = true; + TaskManager.CompleteResultTask(); + return res; + + } + + + public static int DeleteOrganization(int itemId) { // check account @@ -403,7 +474,7 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution OrganizationUser user; user = OrganizationController.GetAccount(itemId, accountId); - if (!lync.SetLyncUserPlan(org.OrganizationId, user.PrimaryEmailAddress, plan)) + if (!lync.SetLyncUserPlan(org.OrganizationId, user.UserPrincipalName, plan)) { TaskManager.CompleteResultTask(res, LyncErrorCodes.CANNOT_ADD_LYNC_USER); return res; @@ -431,7 +502,12 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution } - public static LyncUsersPagedResult GetLyncUsers(int itemId, string sortColumn, string sortDirection, int startRow, int count) + public static LyncUsersPagedResult GetLyncUsers(int itemId) + { + return GetLyncUsersPaged(itemId, string.Empty, string.Empty, 0, int.MaxValue); + } + + public static LyncUsersPagedResult GetLyncUsersPaged(int itemId, string sortColumn, string sortDirection, int startRow, int count) { LyncUsersPagedResult res = TaskManager.StartResultTask("LYNC", "GET_LYNC_USERS"); @@ -513,7 +589,7 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution user = OrganizationController.GetAccount(itemId, accountId); if (user != null) - lync.DeleteUser(user.PrimaryEmailAddress); + lync.DeleteUser(user.UserPrincipalName); } catch (Exception ex) { diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs index 3cf73181..00662bce 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs @@ -517,7 +517,7 @@ namespace WebsitePanel.EnterpriseServer try { - LyncUsersPagedResult res = LyncController.GetLyncUsers(itemId, string.Empty, string.Empty, 0, int.MaxValue); + LyncUsersPagedResult res = LyncController.GetLyncUsers(itemId); if (res.IsSuccess) { @@ -1125,6 +1125,14 @@ namespace WebsitePanel.EnterpriseServer ExchangeServerController.AddAuthoritativeDomain(itemId, domain.DomainId); } + OrganizationStatistics orgStatsExchange = ExchangeServerController.GetOrganizationStatistics(itemId); + + if (orgStatsExchange.AllocatedMailboxes == 0) + { + ExchangeAcceptedDomainType newDomainType = ExchangeAcceptedDomainType.InternalRelay; + ChangeOrganizationDomainType(org.ServiceId, domain.DomainId, newDomainType); + } + if (org.IsOCSOrganization) { OCSController.AddDomain(domain.DomainName, itemId); @@ -1500,8 +1508,15 @@ 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; + } + + // load organization Organization org = GetOrganization(itemId); if (org == null) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/ReportController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/ReportController.cs index 3692a9c6..adad212f 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/ReportController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/ReportController.cs @@ -123,8 +123,25 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution delegate(CRMOrganizationStatistics stats) { return stats.OrganizationID == org.OrganizationId; }); item.TotalCRMUsers = crmOrganizationStatistics.Count; + } + + item.TotalLyncUsers = 0; + item.TotalLyncEVUsers = 0; + + if (report.LyncReport != null) + { + List lyncOrganizationStatistics = + report.LyncReport.Items.FindAll( + delegate(LyncUserStatistics stats) { return stats.OrganizationID == org.OrganizationId; }); + + foreach (LyncUserStatistics current in lyncOrganizationStatistics) + { + if (current.EnterpriseVoice) item.TotalLyncEVUsers++; + } + + item.TotalLyncUsers = lyncOrganizationStatistics.Count; } - + report.OrganizationReport.Items.Add(item); } @@ -296,7 +313,19 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution { TaskManager.WriteError(ex); } - } + } + + if (report.LyncReport != null) + { + try + { + PopulateLyncReportItems(org, report, topReseller); + } + catch (Exception ex) + { + TaskManager.WriteError(ex); + } + } if (report.OrganizationReport != null) { @@ -308,7 +337,9 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution { TaskManager.WriteError(ex); } - } + } + + } private static int GetExchangeServiceID(int packageId) @@ -316,6 +347,10 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution return PackageController.GetPackageServiceId(packageId, ResourceGroups.Exchange); } + private static int GetLyncServiceID(int packageId) + { + return PackageController.GetPackageServiceId(packageId, ResourceGroups.Lync); + } private static void PopulateSharePointItem(Organization org, EnterpriseSolutionStatisticsReport report, string topReseller) @@ -422,7 +457,13 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution { PopulateBaseItem(stats, org, topReseller); stats.MailboxType = mailbox.AccountType; + if (mailbox.AccountType == ExchangeAccountType.Mailbox) + { + ExchangeAccount a = ExchangeServerController.GetAccount(mailbox.ItemId, mailbox.AccountId); + stats.MailboxPlan = a.MailboxPlan; + } + stats.BlackberryEnabled = BlackBerryController.CheckBlackBerryUserExists(mailbox.AccountId); report.ExchangeReport.Items.Add(stats); } @@ -436,6 +477,74 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution } + + + private static void PopulateLyncReportItems(Organization org, EnterpriseSolutionStatisticsReport report, string topReseller) + { + + //Check if lync organization + if (string.IsNullOrEmpty(org.LyncTenantId)) + return; + + LyncUser[] lyncUsers = null; + + try + { + LyncUsersPagedResult res = LyncController.GetLyncUsers(org.Id); + if (res.IsSuccess) lyncUsers = res.Value.PageUsers; + } + catch (Exception ex) + { + throw new ApplicationException( + string.Format("Could not get lync users for current organization {0}", org.Id), ex); + } + + + if (lyncUsers == null) + return; + + foreach (LyncUser lyncUser in lyncUsers) + { + try + { + LyncUserStatistics stats = new LyncUserStatistics(); + + try + { + stats.SipAddress = lyncUser.SipAddress; + if (string.IsNullOrEmpty(lyncUser.LineUri)) stats.PhoneNumber = string.Empty; else stats.PhoneNumber = lyncUser.LineUri; + + LyncUserPlan plan = LyncController.GetLyncUserPlan(org.Id, lyncUser.LyncUserPlanId); + stats.Conferencing = plan.Conferencing; + stats.EnterpriseVoice = plan.EnterpriseVoice; + stats.Federation = plan.Federation; + stats.InstantMessaing = plan.IM; + stats.MobileAccess = plan.Mobility; + stats.LyncUserPlan = plan.LyncUserPlanName; + stats.DisplayName = lyncUser.DisplayName; + } + catch (Exception ex) + { + TaskManager.WriteError(ex, "Could not get lync statistics. AccountName: {0}", + lyncUser.DisplayName); + } + + + if (stats != null) + { + PopulateBaseItem(stats, org, topReseller); + report.LyncReport.Items.Add(stats); + } + } + catch (Exception ex) + { + TaskManager.WriteError(ex); + } + } + + } + + private static void PopulateSpaceData(int packageId, EnterpriseSolutionStatisticsReport report, string topReseller) { List organizations; @@ -489,8 +598,8 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution } } - - private static void GetUsersData(EnterpriseSolutionStatisticsReport report, int userId, bool generateExchangeReport, bool generateSharePointReport, bool generateCRMReport, bool generateOrganizationReport, string topReseller) + + private static void GetUsersData(EnterpriseSolutionStatisticsReport report, int userId, bool generateExchangeReport, bool generateSharePointReport, bool generateCRMReport, bool generateOrganizationReport, bool generateLyncReport, string topReseller) { List users; try @@ -514,6 +623,7 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution GetUsersData(report, user.UserId, generateExchangeReport, generateSharePointReport, generateCRMReport, generateOrganizationReport, + generateLyncReport, string.IsNullOrEmpty(topReseller) ? user.Username : topReseller); } } @@ -523,8 +633,8 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution } } } - - public static EnterpriseSolutionStatisticsReport GetEnterpriseSolutionStatisticsReport(int userId, bool generateExchangeReport, bool generateSharePointReport, bool generateCRMReport, bool generateOrganizationReport) + + public static EnterpriseSolutionStatisticsReport GetEnterpriseSolutionStatisticsReport(int userId, bool generateExchangeReport, bool generateSharePointReport, bool generateCRMReport, bool generateOrganizationReport, bool generateLyncReport) { EnterpriseSolutionStatisticsReport report = new EnterpriseSolutionStatisticsReport(); @@ -534,17 +644,20 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution if (generateSharePointReport || generateOrganizationReport) report.SharePointReport = new SharePointStatisticsReport(); + if (generateLyncReport || generateOrganizationReport) + report.LyncReport = new LyncStatisticsReport(); + + if (generateCRMReport || generateOrganizationReport) report.CRMReport = new CRMStatisticsReport(); if (generateOrganizationReport) report.OrganizationReport = new OrganizationStatisticsReport(); - - + try { GetUsersData(report, userId, generateExchangeReport, generateSharePointReport, generateCRMReport, - generateOrganizationReport, null); + generateOrganizationReport, generateLyncReport, null); } catch(Exception ex) { diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/SchedulerTasks/HostedSolutionReport.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/SchedulerTasks/HostedSolutionReport.cs index 10322c79..b82436df 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/SchedulerTasks/HostedSolutionReport.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/SchedulerTasks/HostedSolutionReport.cs @@ -42,6 +42,7 @@ namespace WebsitePanel.EnterpriseServer private static readonly string EXCHANGE_REPORT = "EXCHANGE_REPORT"; private static readonly string ORGANIZATION_REPORT = "ORGANIZATION_REPORT"; private static readonly string SHAREPOINT_REPORT = "SHAREPOINT_REPORT"; + private static readonly string LYNC_REPORT = "LYNC_REPORT"; private static readonly string CRM_REPORT = "CRM_REPORT"; private static readonly string EMAIL = "EMAIL"; @@ -52,6 +53,7 @@ namespace WebsitePanel.EnterpriseServer { bool isExchange = Utils.ParseBool(TaskManager.TaskParameters[EXCHANGE_REPORT], false); bool isSharePoint = Utils.ParseBool(TaskManager.TaskParameters[SHAREPOINT_REPORT], false); + bool isLync = Utils.ParseBool(TaskManager.TaskParameters[LYNC_REPORT], false); bool isCRM = Utils.ParseBool(TaskManager.TaskParameters[CRM_REPORT], false); bool isOrganization = Utils.ParseBool(TaskManager.TaskParameters[ORGANIZATION_REPORT], false); @@ -61,13 +63,14 @@ namespace WebsitePanel.EnterpriseServer UserInfo user = PackageController.GetPackageOwner(TaskManager.PackageId); EnterpriseSolutionStatisticsReport report = ReportController.GetEnterpriseSolutionStatisticsReport(user.UserId, isExchange, isSharePoint, isCRM, - isOrganization); + isOrganization, isLync); SendMessage(user, email, isExchange && report.ExchangeReport != null ? report.ExchangeReport.ToCSV() : string.Empty, isSharePoint && report.SharePointReport != null ? report.SharePointReport.ToCSV() : string.Empty, isCRM && report.CRMReport != null ? report.CRMReport.ToCSV() : string.Empty, - isOrganization && report.OrganizationReport != null ? report.OrganizationReport.ToCSV() : string.Empty); + isOrganization && report.OrganizationReport != null ? report.OrganizationReport.ToCSV() : string.Empty, + isLync && report.LyncReport != null ? report.LyncReport.ToCSV() : string.Empty); } catch(Exception ex) { @@ -90,11 +93,12 @@ namespace WebsitePanel.EnterpriseServer } } - private void SendMessage(UserInfo user,string email, string exchange_csv, string sharepoint_csv, string crm_csv, string organization_csv) + private void SendMessage(UserInfo user,string email, string exchange_csv, string sharepoint_csv, string crm_csv, string organization_csv, string lync_csv) { List attacments = new List(); PrepareAttament("exchange.csv", exchange_csv, attacments); PrepareAttament("sharepoint.csv", sharepoint_csv, attacments); + PrepareAttament("lync.csv", lync_csv, attacments); PrepareAttament("crm.csv", crm_csv, attacments); PrepareAttament("organization.csv", organization_csv, attacments); diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Servers/ServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Servers/ServerController.cs index 3b856795..b1cd15f0 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Servers/ServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Servers/ServerController.cs @@ -1847,8 +1847,8 @@ namespace WebsitePanel.EnterpriseServer else if (isDomainPointer) { // domain pointer - if (PackageController.GetPackageQuota(packageId, Quotas.OS_DOMAINPOINTERS).QuotaExhausted) - return BusinessErrorCodes.ERROR_DOMAIN_QUOTA_LIMIT; + //if (PackageController.GetPackageQuota(packageId, Quotas.OS_DOMAINPOINTERS).QuotaExhausted) + //return BusinessErrorCodes.ERROR_DOMAIN_QUOTA_LIMIT; } else { @@ -2495,10 +2495,20 @@ namespace WebsitePanel.EnterpriseServer instantAlias = GetDomainItem(instantAliasId); } + string parentZone = domain.ZoneName; + if (string.IsNullOrEmpty(parentZone)) + { + DomainInfo parentDomain = GetDomain(domain.DomainId); + parentZone = parentDomain.DomainName; + } + + if (domain.WebSiteId > 0) { WebServerController.AddWebSitePointer(domain.WebSiteId, - (domain.DomainName.Replace("." + domain.ZoneName, "") == domain.ZoneName) ? "" : domain.DomainName.Replace("." + domain.ZoneName, ""), + ((domain.DomainName.Replace("." + parentZone, "") == parentZone) | + (domain.DomainName == parentZone)) + ? "" : domain.DomainName.Replace("." + parentZone, ""), instantAlias.DomainId); } @@ -2507,12 +2517,14 @@ namespace WebsitePanel.EnterpriseServer List domains = GetDomainsByDomainItemId(domain.DomainId); foreach (DomainInfo d in domains) { + if (d.WebSiteId > 0) { WebServerController.AddWebSitePointer(d.WebSiteId, - (d.DomainName.Replace("." + domain.ZoneName, "") == domain.ZoneName) ? "" : d.DomainName.Replace("." + domain.ZoneName, ""), + ((d.DomainName.Replace("." + parentZone, "") == parentZone) | + (d.DomainName == parentZone)) + ? "" : d.DomainName.Replace("." + parentZone, ""), instantAlias.DomainId); - } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebServers/WebServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebServers/WebServerController.cs index 6df74480..1590849d 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebServers/WebServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/WebServers/WebServerController.cs @@ -29,6 +29,7 @@ using System; using System.IO; using System.Data; +using System.Linq; using System.Collections.Specialized; using System.Collections.Generic; using System.Text; @@ -171,15 +172,20 @@ namespace WebsitePanel.EnterpriseServer return AddWebSite(packageId, hostName, domainId, ipAddressId, false, true); } - private static Regex regIP = new Regex( - @"(?2[0-4]\d|25[0-5]|[01]?\d\d?)\.(?2[0-4]\d|25" - + @"[0-5]|[01]?\d\d?)\.(?2[0-4]\d|25[0-5]|[01]?\d\d?)\.(?" - + @"2[0-4]\d|25[0-5]|[01]?\d\d?)", - RegexOptions.IgnoreCase - | RegexOptions.CultureInvariant - | RegexOptions.IgnorePatternWhitespace - | RegexOptions.Compiled - ); + + private static bool IsValidIPAdddress(string addr) + { + System.Net.IPAddress ip; + if (System.Net.IPAddress.TryParse(addr, out ip)) + { + return ((ip.AddressFamily == System.Net.Sockets.AddressFamily.InterNetworkV6) | + (ip.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork)); + } + else + { + return false; + } + } public static int AddWebSite(int packageId, string hostName, int domainId, int packageAddressId, bool addInstantAlias, bool ignoreGlobalDNSRecords) @@ -269,14 +275,23 @@ namespace WebsitePanel.EnterpriseServer if (dedicatedIp) { - foreach (GlobalDnsRecord d in dnsRecords) + foreach (GlobalDnsRecord d in dnsRecords) { - if (!string.IsNullOrEmpty(d.ExternalIP)) - { - if (regIP.IsMatch(d.ExternalIP)) return BusinessErrorCodes.ERROR_GLOBALDNS_FOR_DEDICATEDIP; - } + if (!string.IsNullOrEmpty(d.ExternalIP)) + { + if (!IsValidIPAdddress(d.ExternalIP)) return BusinessErrorCodes.ERROR_GLOBALDNS_FOR_DEDICATEDIP; + } } - } + } + else + { + if (domain.ZoneItemId > 0) + { + StringDictionary settings = ServerController.GetServiceSettings(serviceId); + if (string.IsNullOrEmpty(settings["PublicSharedIP"])) + return BusinessErrorCodes.ERROR_PUBLICSHAREDIP_FOR_SHAREDIP; + } + } // prepare site bindings List bindings = new List(); @@ -680,7 +695,7 @@ namespace WebsitePanel.EnterpriseServer { if (!string.IsNullOrEmpty(d.ExternalIP)) { - if (regIP.IsMatch(d.ExternalIP)) return BusinessErrorCodes.ERROR_GLOBALDNS_FOR_DEDICATEDIP; + if (!IsValidIPAdddress(d.ExternalIP)) return BusinessErrorCodes.ERROR_GLOBALDNS_FOR_DEDICATEDIP; } } @@ -694,7 +709,7 @@ namespace WebsitePanel.EnterpriseServer // remove all web site pointers DomainInfo domain = ServerController.GetDomain(siteItem.Name); - DomainInfo ZoneInfo = ServerController.GetDomain(domain.ZoneName); + DomainInfo ZoneInfo = ServerController.GetDomain(domain.DomainItemId); if (ZoneInfo == null) throw new Exception("Parent zone not found"); @@ -760,18 +775,38 @@ namespace WebsitePanel.EnterpriseServer // associate IP with web site ServerController.AddItemIPAddress(siteItemId, ipAddressId); - + + + string parentZone = domain.ZoneName; + if (string.IsNullOrEmpty(parentZone)) + { + DomainInfo parentDomain = ServerController.GetDomain(domain.DomainItemId); + parentZone = parentDomain.DomainName; + } + AddWebSitePointer(siteItemId, - (domain.DomainName.Replace("." + domain.ZoneName, "") == domain.ZoneName) ? "": domain.DomainName.Replace("." + domain.ZoneName,"") + ((domain.DomainName.Replace("." + parentZone, "") == parentZone) | + (domain.DomainName == parentZone)) + ? "" : domain.DomainName.Replace("." + parentZone, "") , ZoneInfo.DomainId, true, true, true); foreach (DomainInfo pointer in pointers) { - ZoneInfo = ServerController.GetDomain(pointer.ZoneName); + string pointerParentZone = pointer.ZoneName; + if (string.IsNullOrEmpty(pointerParentZone)) + { + DomainInfo parentDomain = ServerController.GetDomain(pointer.DomainItemId); + pointerParentZone = parentDomain.DomainName; + } + + + ZoneInfo = ServerController.GetDomain(pointerParentZone); AddWebSitePointer(siteItemId, - (pointer.DomainName.Replace("." + pointer.ZoneName, "") == pointer.ZoneName) ? "" : pointer.DomainName.Replace("." + pointer.ZoneName, "") + ((pointer.DomainName.Replace("." + pointerParentZone, "") == pointerParentZone) | + (pointer.DomainName == pointerParentZone)) + ? "" : pointer.DomainName.Replace("." + pointerParentZone, "") , ZoneInfo.DomainId, true, true, true); } @@ -838,6 +873,8 @@ namespace WebsitePanel.EnterpriseServer if (siteItem == null) return BusinessErrorCodes.ERROR_WEB_SITE_PACKAGE_ITEM_NOT_FOUND; + + // place log record TaskManager.StartTask("WEB_SITE", "SWITCH_TO_SHARED_IP", siteItem.Name); TaskManager.ItemId = siteItemId; @@ -847,11 +884,20 @@ namespace WebsitePanel.EnterpriseServer IPAddressInfo ip; DomainInfo domain = ServerController.GetDomain(siteItem.Name); - DomainInfo ZoneInfo = ServerController.GetDomain(domain.ZoneName); + DomainInfo ZoneInfo = ServerController.GetDomain(domain.DomainItemId); if (ZoneInfo == null) throw new Exception("Parent zone not found"); + + if (ZoneInfo.ZoneItemId > 0) + { + StringDictionary settings = ServerController.GetServiceSettings(siteItem.ServiceId); + if (string.IsNullOrEmpty(settings["PublicSharedIP"])) + return BusinessErrorCodes.ERROR_PUBLICSHAREDIP_FOR_SHAREDIP; + + } + //cleanup certificates List certificates = GetCertificatesForSite(siteItemId); foreach (SSLCertificate c in certificates) @@ -930,16 +976,35 @@ namespace WebsitePanel.EnterpriseServer siteItem.SiteIPAddressId = 0; PackageController.UpdatePackageItem(siteItem); + string parentZone = domain.ZoneName; + if (string.IsNullOrEmpty(parentZone)) + { + DomainInfo parentDomain = ServerController.GetDomain(domain.DomainItemId); + parentZone = parentDomain.DomainName; + } + AddWebSitePointer(siteItemId, - (domain.DomainName.Replace("." + domain.ZoneName, "") == domain.ZoneName) ? "" : domain.DomainName.Replace("." + domain.ZoneName, "") + ((domain.DomainName.Replace("." + parentZone, "") == parentZone) | + (domain.DomainName == parentZone)) + ? "" : domain.DomainName.Replace("." + parentZone, "") , ZoneInfo.DomainId, true, true, true); foreach (DomainInfo pointer in pointers) { - ZoneInfo = ServerController.GetDomain(pointer.ZoneName); + string pointerParentZone = pointer.ZoneName; + if (string.IsNullOrEmpty(pointerParentZone)) + { + DomainInfo parentDomain = ServerController.GetDomain(pointer.DomainItemId); + pointerParentZone = parentDomain.DomainName; + } + + + ZoneInfo = ServerController.GetDomain(pointerParentZone); AddWebSitePointer(siteItemId, - (pointer.DomainName.Replace("." + pointer.ZoneName, "") == pointer.ZoneName) ? "" : pointer.DomainName.Replace("." + pointer.ZoneName, "") + ((pointer.DomainName.Replace("." + pointerParentZone, "") == pointerParentZone) | + (pointer.DomainName == pointerParentZone)) + ? "" : pointer.DomainName.Replace("." + pointerParentZone, "") , ZoneInfo.DomainId, true, true, true); } @@ -1213,6 +1278,17 @@ namespace WebsitePanel.EnterpriseServer DNSServer dns = new DNSServer(); ServiceProviderProxy.Init(dns, zone.ServiceId); + DnsRecord[] domainRecords = dns.GetZoneRecords(zone.Name); + var duplicateRecords = (from zoneRecord in domainRecords + from resRecord in resourceRecords + where zoneRecord.RecordName == resRecord.RecordName + where zoneRecord.RecordType == resRecord.RecordType + select zoneRecord).ToArray(); + if (duplicateRecords != null && duplicateRecords.Count() > 0) + { + dns.DeleteZoneRecords(zone.Name, duplicateRecords); + } + // add new resource records dns.AddZoneRecords(zone.Name, resourceRecords.ToArray()); } @@ -2478,7 +2554,7 @@ namespace WebsitePanel.EnterpriseServer WebServer server = GetWebServer(item.ServiceId); StringDictionary webSettings = ServerController.GetServiceSettings(item.ServiceId); - if (webSettings["WmSvc.NETBIOS"] != null) + if (!String.IsNullOrEmpty(webSettings["WmSvc.NETBIOS"])) { accountName = webSettings["WmSvc.NETBIOS"].ToString() + "\\" + accountName; } @@ -3246,7 +3322,7 @@ namespace WebsitePanel.EnterpriseServer WebServer server = GetWebServer(item.ServiceId); StringDictionary webSettings = ServerController.GetServiceSettings(item.ServiceId); - if (webSettings["WmSvc.NETBIOS"] != null) + if (!String.IsNullOrEmpty(webSettings["WmSvc.NETBIOS"])) { accountName = webSettings["WmSvc.NETBIOS"].ToString() + "\\" + accountName; } @@ -3716,6 +3792,7 @@ Please ensure the space has been allocated {0} IP address as a dedicated one and DomainInfo newDomain = new DomainInfo(); newDomain.DomainName = b.Host.ToLower(); newDomain.PackageId = domain.PackageId; + newDomain.IsDomainPointer = true; int newDomainID = ServerController.AddDomain(newDomain, domain.IsInstantAlias, false); if (newDomainID > 0) @@ -3726,7 +3803,6 @@ Please ensure the space has been allocated {0} IP address as a dedicated one and newDomain.WebSiteId = siteId; newDomain.ZoneItemId = domain.ZoneItemId; newDomain.DomainItemId = domain.DomainId; - newDomain.IsDomainPointer = true; ServerController.UpdateDomain(newDomain); } } @@ -3760,19 +3836,21 @@ Please ensure the space has been allocated {0} IP address as a dedicated one and private static int FindDomainForHeader(string header, List domains) { int domainId = 0; - - while (header.IndexOf(".") != -1) + int counter = 0; + while ((header.IndexOf(".") != -1) & (counter < 2)) { - header = header.Substring(header.IndexOf(".") + 1); foreach (DomainInfo d in domains) { if ((header == d.DomainName.ToLower()) && (!d.IsDomainPointer)) { - domainId = d.DomainId; - break; + return d.DomainId; } } + + header = header.Substring(header.IndexOf(".") + 1); + counter++; + } return domainId; diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/WebsitePanel.EnterpriseServer.csproj b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/WebsitePanel.EnterpriseServer.csproj index daa3547c..8ba3e5cb 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/WebsitePanel.EnterpriseServer.csproj +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/WebsitePanel.EnterpriseServer.csproj @@ -434,7 +434,7 @@ - True + False False 9002 / diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esLync.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esLync.asmx.cs index 9996fb3d..8006be54 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esLync.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esLync.asmx.cs @@ -59,7 +59,7 @@ namespace WebsitePanel.EnterpriseServer [WebMethod] public LyncUsersPagedResult GetLyncUsersPaged(int itemId, string sortColumn, string sortDirection, int startRow, int maximumRows) { - return LyncController.GetLyncUsers(itemId, sortColumn, sortDirection, startRow, maximumRows); + return LyncController.GetLyncUsersPaged(itemId, sortColumn, sortDirection, startRow, maximumRows); } [WebMethod] @@ -119,6 +119,13 @@ namespace WebsitePanel.EnterpriseServer return LyncController.GetLyncUserGeneralSettings(itemId, accountId); } + [WebMethod] + public LyncUserResult SetLyncUserGeneralSettings(int itemId, int accountId, string sipAddress, string lineUri) + { + return LyncController.SetLyncUserGeneralSettings(itemId, accountId, sipAddress, lineUri); + } + + [WebMethod] public LyncUserResult SetUserLyncPlan(int itemId, int accountId, int lyncUserPlanId) { diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ActiveDirectoryUtils.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ActiveDirectoryUtils.cs index 3c460dbb..5e608f88 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ActiveDirectoryUtils.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ActiveDirectoryUtils.cs @@ -113,7 +113,8 @@ namespace WebsitePanel.Providers.HostedSolution DirectoryEntry parent = entry.Parent; if (parent != null) { - parent.Children.Remove(entry); + //parent.Children.Remove(entry); + entry.DeleteTree(); parent.CommitChanges(); } } @@ -159,6 +160,14 @@ namespace WebsitePanel.Providers.HostedSolution collection.Value = value; } + public static void SetADObjectPropertyValue(DirectoryEntry oDE, string name, string[] values) + { + PropertyValueCollection collection = oDE.Properties[name]; + collection.Value = values; + } + + + public static void SetADObjectPropertyValue(DirectoryEntry oDE, string name, Guid value) { PropertyValueCollection collection = oDE.Properties[name]; @@ -177,6 +186,19 @@ namespace WebsitePanel.Providers.HostedSolution return entry.Properties.Contains(name) ? entry.Properties[name][0] : null; } + public static string[] GetADObjectPropertyMultiValue(DirectoryEntry entry, string name) + { + if (!entry.Properties.Contains(name)) + return null; + + List returnList = new List(); + for (int i = 0; i < entry.Properties[name].Count; i++) + returnList.Add(entry.Properties[name][i].ToString()); + + return returnList.ToArray(); + } + + public static string GetADObjectStringProperty(DirectoryEntry entry, string name) { object ret = GetADObjectProperty(entry, name); diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/EnterpriseSolutionStatisticsReport.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/EnterpriseSolutionStatisticsReport.cs index 707c0531..f69dd959 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/EnterpriseSolutionStatisticsReport.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/EnterpriseSolutionStatisticsReport.cs @@ -34,6 +34,6 @@ public SharePointStatisticsReport SharePointReport { get; set; } public CRMStatisticsReport CRMReport { get; set; } public OrganizationStatisticsReport OrganizationReport { get; set; } - + public LyncStatisticsReport LyncReport { get; set; } } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeAccount.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeAccount.cs index 36fbfdde..c3299d67 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeAccount.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeAccount.cs @@ -49,6 +49,7 @@ namespace WebsitePanel.Providers.HostedSolution int mailboxPlanId; string mailboxPlan; string publicFolderPermission; + string userPrincipalName; public int AccountId { @@ -142,5 +143,11 @@ namespace WebsitePanel.Providers.HostedSolution } + public string UserPrincipalName + { + get { return this.userPrincipalName; } + set { this.userPrincipalName = value; } + } + } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeMailboxStatistics.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeMailboxStatistics.cs index 7583893e..7b408e10 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeMailboxStatistics.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeMailboxStatistics.cs @@ -50,5 +50,6 @@ namespace WebsitePanel.Providers.HostedSolution public bool Enabled { get; set; } public ExchangeAccountType MailboxType { get; set; } public bool BlackberryEnabled { get; set; } + public string MailboxPlan { get; set; } } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeStatisticsReport.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeStatisticsReport.cs index 7366c029..111dbae4 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeStatisticsReport.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeStatisticsReport.cs @@ -67,6 +67,7 @@ namespace WebsitePanel.Providers.HostedSolution sb.AppendFormat("{0},", ToCsvString(item.Enabled, "Enabled", "Disabled")); sb.AppendFormat("{0},", ToCsvString(item.MailboxType)); sb.AppendFormat("{0}", ToCsvString(item.BlackberryEnabled)); + sb.AppendFormat("{0}", ToCsvString(item.MailboxPlan)); mainBuilder.Append(sb.ToString()); } return mainBuilder.ToString(); @@ -74,7 +75,7 @@ namespace WebsitePanel.Providers.HostedSolution private void AddCSVHeader(StringBuilder sb) { - sb.Append("Top Reseller,Reseller,Customer,Customer Created,Hosting Space,Hosting Space Created,Ogranization Name,Ogranization Created,Organization ID,Mailbox Display Name,Account Created,Primary E-mail Address,MAPI,OWA,ActiveSync,POP 3,IMAP,Mailbox Size (Mb),Max Mailbox Size (Mb),Last Logon,Enabled,Mailbox Type, BlackBerry"); + sb.Append("Top Reseller,Reseller,Customer,Customer Created,Hosting Space,Hosting Space Created,Ogranization Name,Organization Created,Organization ID,Mailbox Display Name,Account Created,Primary E-mail Address,MAPI,OWA,ActiveSync,POP 3,IMAP,Mailbox Size (Mb),Max Mailbox Size (Mb),Last Logon,Enabled,Mailbox Type, BlackBerry, Mailbox Plan"); } } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ILyncServer.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ILyncServer.cs index ef1047a0..16d7e005 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ILyncServer.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ILyncServer.cs @@ -39,6 +39,7 @@ namespace WebsitePanel.Providers.HostedSolution bool CreateUser(string organizationId, string userUpn, LyncUserPlan plan); LyncUser GetLyncUserGeneralSettings(string organizationId, string userUpn); + bool SetLyncUserGeneralSettings(string organizationId, string userUpn, LyncUser lyncUser); bool SetLyncUserPlan(string organizationId, string userUpn, LyncUserPlan plan); bool DeleteUser(string userUpn); diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncErrorCodes.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncErrorCodes.cs index 15cfbae8..4f792ea3 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncErrorCodes.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncErrorCodes.cs @@ -70,5 +70,8 @@ public const string CANNOT_REMOVE_LYNC_FEDERATIONDOMAIN = "CANNOT_REMOVE_LYNC_FEDERATIONDOMAIN"; + public const string FAILED_SET_SETTINGS = "FAILED_SET_SETTINGS"; + + public const string ADDRESS_ALREADY_USED = "ADDRESS_ALREADY_USED"; } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncOrganizationStatistics.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncOrganizationStatistics.cs new file mode 100644 index 00000000..9b747767 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncOrganizationStatistics.cs @@ -0,0 +1,72 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace WebsitePanel.Providers.HostedSolution +{ + public class LyncOrganizationStatistics + { + private int allocatedLyncUsers; + private int createdLyncUsers; + + private int allocatedLyncEVUsers; + private int createdLyncEVUsers; + + + public int AllocatedLyncUsers + { + get { return this.allocatedLyncUsers; } + set { this.allocatedLyncUsers = value; } + } + + public int CreatedLyncUsers + { + get { return this.createdLyncUsers; } + set { this.createdLyncUsers = value; } + } + + + public int AllocatedLyncEVUsers + { + get { return this.allocatedLyncEVUsers; } + set { this.allocatedLyncEVUsers = value; } + } + + public int CreatedLyncEVUsers + { + get { return this.createdLyncEVUsers; } + set { this.createdLyncEVUsers = value; } + } + + + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncStatisticsReport.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncStatisticsReport.cs new file mode 100644 index 00000000..104cb4a5 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncStatisticsReport.cs @@ -0,0 +1,77 @@ +// 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.Text; + +namespace WebsitePanel.Providers.HostedSolution +{ + public class LyncStatisticsReport : BaseReport + { + public override string ToCSV() + { + StringBuilder mainBuilder = new StringBuilder(); + StringBuilder sb = null; + AddCSVHeader(mainBuilder); + foreach (LyncUserStatistics item in Items) + { + sb = new StringBuilder(); + sb.Append("\n"); + sb.AppendFormat("{0},", ToCsvString(item.TopResellerName)); + sb.AppendFormat("{0},", ToCsvString(item.ResellerName)); + sb.AppendFormat("{0},", ToCsvString(item.CustomerName)); + sb.AppendFormat("{0},", ToCsvString(item.CustomerCreated)); + sb.AppendFormat("{0},", ToCsvString(item.HostingSpace)); + sb.AppendFormat("{0},", ToCsvString(item.HostingSpaceCreated)); + sb.AppendFormat("{0},", ToCsvString(item.OrganizationName)); + sb.AppendFormat("{0},", ToCsvString(item.OrganizationCreated)); + sb.AppendFormat("{0},", ToCsvString(item.OrganizationID)); + + sb.AppendFormat("{0},", ToCsvString(item.DisplayName)); + + sb.AppendFormat("{0},", ToCsvString(item.SipAddress)); + sb.AppendFormat("{0},", ToCsvString(item.PhoneNumber)); + sb.AppendFormat("{0},", ToCsvString(item.Conferencing)); + sb.AppendFormat("{0},", ToCsvString(item.EnterpriseVoice)); + sb.AppendFormat("{0},", ToCsvString(item.Federation)); + sb.AppendFormat("{0},", ToCsvString(item.InstantMessaing)); + sb.AppendFormat("{0},", ToCsvString(item.MobileAccess)); + sb.AppendFormat("{0},", ToCsvString(item.LyncUserPlan)); + + mainBuilder.Append(sb.ToString()); + } + + return mainBuilder.ToString(); + + } + + private static void AddCSVHeader(StringBuilder sb) + { + sb.Append("Top Reseller,Reseller,Customer,Customer Created,Hosting Space,Hosting Space Created,Ogranization Name,Organization Created,Organization ID,Display Name,SipAddress,PhoneNumber,Conferencing,EnterpriseVoice,Federation,InstantMessaging,MobileAccess"); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUser.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUser.cs index 1a4dd851..e95a9436 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUser.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUser.cs @@ -34,8 +34,8 @@ namespace WebsitePanel.Providers.HostedSolution { public class LyncUser { - public string PrimaryUri { get; set; } - public string PrimaryEmailAddress { get; set; } + public string SipAddress { get; set; } + public string UserPrincipalName { get; set; } public string DisplayName { get; set; } public string LineUri { get; set; } public int AccountID { get; set; } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUserStatistics.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUserStatistics.cs new file mode 100644 index 00000000..2604f3b7 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUserStatistics.cs @@ -0,0 +1,49 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +using System; +using System.Collections.Generic; +using System.Text; + +namespace WebsitePanel.Providers.HostedSolution +{ + public class LyncUserStatistics : BaseStatistics + { + public string DisplayName { get; set; } + public DateTime AccountCreated { get; set; } + public string SipAddress { get; set; } + public bool InstantMessaing{ get; set; } + public bool MobileAccess { get; set; } + public bool Federation { get; set; } + public bool Conferencing { get; set; } + public bool EnterpriseVoice { get; set; } + public string EVPolicy { get; set; } + public string PhoneNumber { get; set; } + public string LyncUserPlan { get; set; } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationStatisticsReport.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationStatisticsReport.cs index 3d94d8be..c9f85f26 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationStatisticsReport.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationStatisticsReport.cs @@ -56,7 +56,9 @@ namespace WebsitePanel.Providers.HostedSolution sb.AppendFormat("{0},", ToCsvString(item.TotalPublicFoldersSize / 1024.0 / 1024.0)); sb.AppendFormat("{0},", ToCsvString(item.TotalSharePointSiteCollections)); sb.AppendFormat("{0},", ToCsvString(item.TotalSharePointSiteCollectionsSize / 1024.0 / 1024.0)); - sb.AppendFormat("{0}", ToCsvString(item.TotalCRMUsers)); + sb.AppendFormat("{0},", ToCsvString(item.TotalCRMUsers)); + sb.AppendFormat("{0},", ToCsvString(item.TotalLyncUsers)); + sb.AppendFormat("{0}", ToCsvString(item.TotalLyncEVUsers)); mainBuilder.Append(sb.ToString()); } @@ -65,7 +67,7 @@ namespace WebsitePanel.Providers.HostedSolution private static void AddCSVHeader(StringBuilder sb) { - sb.Append("Top Reseller,Reseller,Customer,Customer Created,Hosting Space,Hosting Space Created,Ogranization Name,Ogranization Created,Organization ID,Total mailboxes,Total mailboxes size(Mb),Total Public Folders size(Mb),Total SharePoint site collections,Total SharePoint site collections size(Mb),Total CRM users"); + sb.Append("Top Reseller,Reseller,Customer,Customer Created,Hosting Space,Hosting Space Created,Ogranization Name,Ogranization Created,Organization ID,Total mailboxes,Total mailboxes size(Mb),Total Public Folders size(Mb),Total SharePoint site collections,Total SharePoint site collections size(Mb),Total CRM users,Total Lync users,Total Lync EV users"); } } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationStatisticsRepotItem.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationStatisticsRepotItem.cs index d7009b80..b240c79f 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationStatisticsRepotItem.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationStatisticsRepotItem.cs @@ -66,5 +66,18 @@ set; } + public int TotalLyncUsers + { + get; + set; + } + + public int TotalLyncEVUsers + { + get; + set; + } + + } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationUser.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationUser.cs index d3e2b62c..4502328f 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationUser.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationUser.cs @@ -64,6 +64,7 @@ namespace WebsitePanel.Providers.HostedSolution private string country; private string notes; private string domainUserName; + private string userPrincipalName; private bool disabled; private bool locked; @@ -305,6 +306,11 @@ namespace WebsitePanel.Providers.HostedSolution set { subscriberNumber = value; } } + public string UserPrincipalName + { + get { return userPrincipalName; } + set { userPrincipalName = value; } + } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj index e13eb0be..f65c7c25 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj @@ -88,6 +88,9 @@ + + + diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs index e52511ff..85d755c3 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs @@ -2591,8 +2591,8 @@ namespace WebsitePanel.Providers.HostedSolution Command cmd = new Command("Set-Mailbox"); cmd.Parameters.Add("Identity", accountName); cmd.Parameters.Add("PrimarySmtpAddress", primaryEmail); - cmd.Parameters.Add("UserPrincipalName", primaryEmail); - cmd.Parameters.Add("WindowsEmailAddress", primaryEmail); + //cmd.Parameters.Add("UserPrincipalName", primaryEmail); + //cmd.Parameters.Add("WindowsEmailAddress", primaryEmail); ExecuteShellCommand(runSpace, cmd); } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2010SP2.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2010SP2.cs index 4994f64f..d34b74c9 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2010SP2.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2010SP2.cs @@ -607,15 +607,42 @@ namespace WebsitePanel.Providers.HostedSolution ExchangeLog.LogStart("GetDatabase"); ExchangeLog.LogInfo("DAG: " + dagName); - //Get Dag Servers + // this part of code handles mailboxnames like in the old 2007 provider + // check if DAG is in reality DAG\mailboxdatabase + string dagNameDAG = string.Empty; + string dagNameMBX = string.Empty; + bool isFixedDatabase = false; + if (dagName.Contains("\\")) + { + // split the two parts and extract DAG-Name and mailboxdatabase-name + string[] parts = dagName.Split(new char[] { '\\' }, 2, StringSplitOptions.None); + dagNameDAG = parts[0]; + dagNameMBX = parts[1]; + // check that we realy have a database name + if (!String.IsNullOrEmpty(dagNameMBX)) + { + isFixedDatabase = true; + } + } + else + { + // there is no mailboxdatabase-name use the loadbalancing-code + dagNameDAG = dagName; + isFixedDatabase = false; + } + + //Get Dag Servers - with the name of the database availability group Collection dags = null; Command cmd = new Command("Get-DatabaseAvailabilityGroup"); - cmd.Parameters.Add("Identity", dagName); + cmd.Parameters.Add("Identity", dagNameDAG); dags = ExecuteShellCommand(runSpace, cmd); if (htBbalancer == null) htBbalancer = new Hashtable(); + // use fully qualified dagName for loadbalancer. Thus if there are two services and one of them + // contains only the DAG, the "fixed" database could also be used in loadbalancing. If you do not want this, + // set either IsExcludedFromProvisioning or IsSuspendedFromProvisioning - it is not evaluated for fixed databases if (htBbalancer[dagName] == null) htBbalancer.Add(dagName, 0); @@ -628,35 +655,56 @@ namespace WebsitePanel.Providers.HostedSolution { System.Collections.Generic.List lstDatabase = new System.Collections.Generic.List(); - foreach (object objServer in servers) + if (!isFixedDatabase) // "old" loadbalancing code + { + foreach (object objServer in servers) + { + Collection databases = null; + cmd = new Command("Get-MailboxDatabase"); + cmd.Parameters.Add("Server", ObjToString(objServer)); + databases = ExecuteShellCommand(runSpace, cmd); + + foreach (PSObject objDatabase in databases) + { + if (((bool)GetPSObjectProperty(objDatabase, "IsExcludedFromProvisioning") == false) && + ((bool)GetPSObjectProperty(objDatabase, "IsSuspendedFromProvisioning") == false)) + { + string db = ObjToString(GetPSObjectProperty(objDatabase, "Identity")); + + bool bAdd = true; + foreach (string s in lstDatabase) + { + if (s.ToLower() == db.ToLower()) + { + bAdd = false; + break; + } + } + + if (bAdd) + { + lstDatabase.Add(db); + ExchangeLog.LogInfo("AddDatabase: " + db); + } + } + } + } + } + else // new fixed database code { Collection databases = null; cmd = new Command("Get-MailboxDatabase"); - cmd.Parameters.Add("Server", ObjToString(objServer)); + cmd.Parameters.Add("Identity", dagNameMBX); databases = ExecuteShellCommand(runSpace, cmd); + // do not check "IsExcludedFromProvisioning" or "IsSuspended", just check if it is a member of the DAG foreach (PSObject objDatabase in databases) { - if (((bool)GetPSObjectProperty(objDatabase, "IsExcludedFromProvisioning") == false) && - ((bool)GetPSObjectProperty(objDatabase, "IsSuspendedFromProvisioning") == false)) + string dagSetting = ObjToString(GetPSObjectProperty(objDatabase, "MasterServerOrAvailabilityGroup")); + if (dagNameDAG.Equals(dagSetting, StringComparison.OrdinalIgnoreCase)) { - string db = ObjToString(GetPSObjectProperty(objDatabase, "Identity")); - - bool bAdd = true; - foreach (string s in lstDatabase) - { - if (s.ToLower() == db.ToLower()) - { - bAdd = false; - break; - } - } - - if (bAdd) - { - lstDatabase.Add(db); - ExchangeLog.LogInfo("AddDatabase: " + db); - } + lstDatabase.Add(dagNameMBX); + ExchangeLog.LogInfo("AddFixedDatabase: " + dagNameMBX); } } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Lync2010.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Lync2010.cs index 33c56efe..be5e9397 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Lync2010.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Lync2010.cs @@ -127,6 +127,12 @@ namespace WebsitePanel.Providers.HostedSolution return GetLyncUserGeneralSettingsInternal(organizationId, userUpn); } + public bool SetLyncUserGeneralSettings(string organizationId, string userUpn, LyncUser lyncUser) + { + return SetLyncUserGeneralSettingsInternal(organizationId, userUpn, lyncUser); + } + + public bool SetLyncUserPlan(string organizationId, string userUpn, LyncUserPlan plan) { return SetLyncUserPlanInternal(organizationId, userUpn, plan, null); @@ -288,11 +294,14 @@ namespace WebsitePanel.Providers.HostedSolution Guid tenantId = (Guid)GetPSObjectProperty(result[0], "TenantId"); // create sip domain - DeleteSipDomain(runSpace, sipDomain); - - //clear the msRTCSIP-Domains, TenantID, ObjectID string path = AddADPrefix(GetOrganizationPath(organizationId)); DirectoryEntry ou = ActiveDirectoryUtils.GetADObject(path); + string[] sipDs = (string[])ActiveDirectoryUtils.GetADObjectPropertyMultiValue(ou, "msRTCSIP-Domains"); + + foreach (string sipD in sipDs) + DeleteSipDomain(runSpace, sipD); + + //clear the msRTCSIP-Domains, TenantID, ObjectID ActiveDirectoryUtils.ClearADObjectPropertyValue(ou, "msRTCSIP-Domains"); ActiveDirectoryUtils.ClearADObjectPropertyValue(ou, "msRTCSIP-TenantId"); ActiveDirectoryUtils.ClearADObjectPropertyValue(ou, "msRTCSIP-ObjectId"); @@ -383,6 +392,51 @@ namespace WebsitePanel.Providers.HostedSolution { tenantId = (Guid)GetPSObjectProperty(result[0], "TenantId"); + string[] tmp = userUpn.Split('@'); + if (tmp.Length < 2) return false; + + // Get SipDomains and verify existence + bool bSipDomainExists = false; + cmd = new Command("Get-CsSipDomain"); + Collection sipDomains = ExecuteShellCommand(runSpace, cmd, false); + + foreach (PSObject domain in sipDomains) + { + string d = (string)GetPSObjectProperty(domain, "Name"); + if (d.ToLower() == tmp[1].ToLower()) + { + bSipDomainExists = true; + break; + } + } + + string path = string.Empty; + + if (!bSipDomainExists) + { + // Create Sip Domain + cmd = new Command("New-CsSipDomain"); + cmd.Parameters.Add("Identity", tmp[1].ToLower()); + ExecuteShellCommand(runSpace, cmd, false); + + transaction.RegisterNewSipDomain(tmp[1].ToLower()); + + + path = AddADPrefix(GetOrganizationPath(organizationId)); + DirectoryEntry ou = ActiveDirectoryUtils.GetADObject(path); + string[] sipDs = (string[])ActiveDirectoryUtils.GetADObjectPropertyMultiValue(ou, "msRTCSIP-Domains"); + List listSipDs = new List(); + listSipDs.AddRange(sipDs); + listSipDs.Add(tmp[1]); + + ActiveDirectoryUtils.SetADObjectPropertyValue(ou, "msRTCSIP-Domains", listSipDs.ToArray()); + ou.CommitChanges(); + + //Create simpleurls + CreateSimpleUrl(runSpace, tmp[1].ToLower(), tenantId); + transaction.RegisterNewSimpleUrl(tmp[1].ToLower(), tenantId.ToString()); + } + //enable for lync cmd = new Command("Enable-CsUser"); cmd.Parameters.Add("Identity", userUpn); @@ -397,13 +451,11 @@ namespace WebsitePanel.Providers.HostedSolution cmd.Parameters.Add("Identity", userUpn); result = ExecuteShellCommand(runSpace, cmd); - - string path = AddADPrefix(GetResultObjectDN(result)); + path = AddADPrefix(GetResultObjectDN(result)); DirectoryEntry user = ActiveDirectoryUtils.GetADObject(path); ActiveDirectoryUtils.SetADObjectPropertyValue(user, "msRTCSIP-GroupingID", tenantId); ActiveDirectoryUtils.SetADObjectPropertyValue(user, "msRTCSIP-TenantId", tenantId); - string[] tmp = userUpn.Split('@'); if (tmp.Length > 0) { string Url = SimpleUrlRoot + tmp[1]; @@ -462,8 +514,10 @@ namespace WebsitePanel.Providers.HostedSolution PSObject user = result[0]; lyncUser.DisplayName = (string)GetPSObjectProperty(user, "DisplayName"); - lyncUser.PrimaryUri = (string)GetPSObjectProperty(user, "SipAddress"); + lyncUser.SipAddress = (string)GetPSObjectProperty(user, "SipAddress"); lyncUser.LineUri = (string)GetPSObjectProperty(user, "LineURI"); + + lyncUser.SipAddress = lyncUser.SipAddress.ToLower().Replace("sip:", ""); } catch (Exception ex) { @@ -478,6 +532,114 @@ namespace WebsitePanel.Providers.HostedSolution return lyncUser; } + private bool SetLyncUserGeneralSettingsInternal(string organizationId, string userUpn, LyncUser lyncUser) + { + HostedSolutionLog.LogStart("SetLyncUserGeneralSettingsInternal"); + HostedSolutionLog.DebugInfo("organizationId: {0}", organizationId); + HostedSolutionLog.DebugInfo("userUpn: {0}", userUpn); + + bool ret = true; + Runspace runSpace = null; + Guid tenantId = Guid.Empty; + LyncTransaction transaction = StartTransaction(); + + try + { + runSpace = OpenRunspace(); + Command cmd = new Command("Get-CsTenant"); + cmd.Parameters.Add("Identity", GetOrganizationPath(organizationId)); + Collection result = ExecuteShellCommand(runSpace, cmd, false); + if ((result != null) && (result.Count > 0)) + { + tenantId = (Guid)GetPSObjectProperty(result[0], "TenantId"); + + string[] tmp = userUpn.Split('@'); + if (tmp.Length < 2) return false; + + // Get SipDomains and verify existence + bool bSipDomainExists = false; + cmd = new Command("Get-CsSipDomain"); + Collection sipDomains = ExecuteShellCommand(runSpace, cmd, false); + + foreach (PSObject domain in sipDomains) + { + string d = (string)GetPSObjectProperty(domain, "Name"); + if (d.ToLower() == tmp[1].ToLower()) + { + bSipDomainExists = true; + break; + } + } + + string path = string.Empty; + + if (!bSipDomainExists) + { + // Create Sip Domain + cmd = new Command("New-CsSipDomain"); + cmd.Parameters.Add("Identity", tmp[1].ToLower()); + ExecuteShellCommand(runSpace, cmd, false); + + transaction.RegisterNewSipDomain(tmp[1].ToLower()); + + + path = AddADPrefix(GetOrganizationPath(organizationId)); + DirectoryEntry ou = ActiveDirectoryUtils.GetADObject(path); + string[] sipDs = (string[])ActiveDirectoryUtils.GetADObjectPropertyMultiValue(ou, "msRTCSIP-Domains"); + List listSipDs = new List(); + listSipDs.AddRange(sipDs); + listSipDs.Add(tmp[1]); + + ActiveDirectoryUtils.SetADObjectPropertyValue(ou, "msRTCSIP-Domains", listSipDs.ToArray()); + ou.CommitChanges(); + + //Create simpleurls + CreateSimpleUrl(runSpace, tmp[1].ToLower(), tenantId); + transaction.RegisterNewSimpleUrl(tmp[1].ToLower(), tenantId.ToString()); + + path = AddADPrefix(GetResultObjectDN(result)); + DirectoryEntry user = ActiveDirectoryUtils.GetADObject(path); + + if (tmp.Length > 0) + { + string Url = SimpleUrlRoot + tmp[1]; + ActiveDirectoryUtils.SetADObjectPropertyValue(user, "msRTCSIP-BaseSimpleUrl", Url.ToLower()); + } + user.CommitChanges(); + } + } + + cmd = new Command("Set-CsUser"); + cmd.Parameters.Add("Identity", userUpn); + if (!string.IsNullOrEmpty(lyncUser.SipAddress)) cmd.Parameters.Add("SipAddress", "SIP:"+lyncUser.SipAddress); + if (!string.IsNullOrEmpty(lyncUser.SipAddress)) cmd.Parameters.Add("LineUri", lyncUser.LineUri); + + ExecuteShellCommand(runSpace, cmd, false); + + //initiate addressbook generation + cmd = new Command("Update-CsAddressBook"); + ExecuteShellCommand(runSpace, cmd, false); + + //initiate user database replication + cmd = new Command("Update-CsUserDatabase"); + ExecuteShellCommand(runSpace, cmd, false); + + } + catch (Exception ex) + { + ret = false; + HostedSolutionLog.LogError("SetLyncUserGeneralSettingsInternal", ex); + RollbackTransaction(transaction); + } + finally + { + CloseRunspace(runSpace); + } + HostedSolutionLog.LogEnd("SetLyncUserGeneralSettingsInternal"); + return ret; + } + + private bool SetLyncUserPlanInternal(string organizationId, string userUpn, LyncUserPlan plan, Runspace runSpace) { diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs index 9b78cd77..147bfdd1 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs @@ -529,6 +529,7 @@ namespace WebsitePanel.Providers.HostedSolution retUser.DomainUserName = GetDomainName(ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.SAMAccountName)); retUser.DistinguishedName = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.DistinguishedName); retUser.Locked = (bool)entry.InvokeGet(ADAttributes.AccountLocked); + retUser.UserPrincipalName = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.UserPrincipalName); HostedSolutionLog.LogEnd("GetUserGeneralSettingsInternal"); return retUser; diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/LyncServerProxy.cs b/WebsitePanel/Sources/WebsitePanel.Server.Client/LyncServerProxy.cs index 846a78f8..299ccff6 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.Client/LyncServerProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/LyncServerProxy.cs @@ -26,11 +26,10 @@ // (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.5456 +// Runtime Version:2.0.50727.6400 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -38,91 +37,93 @@ //------------------------------------------------------------------------------ // -// This source code was auto-generated by wsdl, Version=2.0.50727.42. +// This source code was auto-generated by wsdl, Version=2.0.50727.3038. // + using WebsitePanel.Providers.HostedSolution; -namespace WebsitePanel.Providers.Lync -{ +namespace WebsitePanel.Providers.Lync { using System.Xml.Serialization; using System.Web.Services; using System.ComponentModel; using System.Web.Services.Protocols; using System; using System.Diagnostics; - - + + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Web.Services.WebServiceBindingAttribute(Name = "LyncServerSoap", Namespace = "http://smbsaas/websitepanel/server/")] - public partial class LyncServer : Microsoft.Web.Services3.WebServicesClientProtocol - { - + [System.Web.Services.WebServiceBindingAttribute(Name="LyncServerSoap", Namespace="http://smbsaas/websitepanel/server/")] + public partial class LyncServer : Microsoft.Web.Services3.WebServicesClientProtocol { + public ServiceProviderSettingsSoapHeader ServiceProviderSettingsSoapHeaderValue; - + private System.Threading.SendOrPostCallback CreateOrganizationOperationCompleted; - + private System.Threading.SendOrPostCallback DeleteOrganizationOperationCompleted; - + private System.Threading.SendOrPostCallback CreateUserOperationCompleted; - + private System.Threading.SendOrPostCallback GetLyncUserGeneralSettingsOperationCompleted; - + + private System.Threading.SendOrPostCallback SetLyncUserGeneralSettingsOperationCompleted; + private System.Threading.SendOrPostCallback SetLyncUserPlanOperationCompleted; - + private System.Threading.SendOrPostCallback DeleteUserOperationCompleted; - + private System.Threading.SendOrPostCallback GetFederationDomainsOperationCompleted; - + private System.Threading.SendOrPostCallback AddFederationDomainOperationCompleted; - + private System.Threading.SendOrPostCallback RemoveFederationDomainOperationCompleted; - + private System.Threading.SendOrPostCallback ReloadConfigurationOperationCompleted; - + /// - public LyncServer() - { + public LyncServer() { this.Url = "http://localhost:9003/LyncServer.asmx"; } - + /// public event CreateOrganizationCompletedEventHandler CreateOrganizationCompleted; - + /// public event DeleteOrganizationCompletedEventHandler DeleteOrganizationCompleted; - + /// public event CreateUserCompletedEventHandler CreateUserCompleted; - + /// public event GetLyncUserGeneralSettingsCompletedEventHandler GetLyncUserGeneralSettingsCompleted; - + + /// + public event SetLyncUserGeneralSettingsCompletedEventHandler SetLyncUserGeneralSettingsCompleted; + /// public event SetLyncUserPlanCompletedEventHandler SetLyncUserPlanCompleted; - + /// public event DeleteUserCompletedEventHandler DeleteUserCompleted; - + /// public event GetFederationDomainsCompletedEventHandler GetFederationDomainsCompleted; - + /// public event AddFederationDomainCompletedEventHandler AddFederationDomainCompleted; - + /// public event RemoveFederationDomainCompletedEventHandler RemoveFederationDomainCompleted; - + /// public event ReloadConfigurationCompletedEventHandler ReloadConfigurationCompleted; - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateOrganization", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public string CreateOrganization(string organizationId, string sipDomain, bool enableConferencing, bool enableConferencingVideo, int maxConferenceSize, bool enabledFederation, bool enabledEnterpriseVoice) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateOrganization", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string CreateOrganization(string organizationId, string sipDomain, bool enableConferencing, bool enableConferencingVideo, int maxConferenceSize, bool enabledFederation, bool enabledEnterpriseVoice) { object[] results = this.Invoke("CreateOrganization", new object[] { organizationId, sipDomain, @@ -133,10 +134,9 @@ namespace WebsitePanel.Providers.Lync enabledEnterpriseVoice}); return ((string)(results[0])); } - + /// - public System.IAsyncResult BeginCreateOrganization(string organizationId, string sipDomain, bool enableConferencing, bool enableConferencingVideo, int maxConferenceSize, bool enabledFederation, bool enabledEnterpriseVoice, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginCreateOrganization(string organizationId, string sipDomain, bool enableConferencing, bool enableConferencingVideo, int maxConferenceSize, bool enabledFederation, bool enabledEnterpriseVoice, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("CreateOrganization", new object[] { organizationId, sipDomain, @@ -146,25 +146,21 @@ namespace WebsitePanel.Providers.Lync enabledFederation, enabledEnterpriseVoice}, callback, asyncState); } - + /// - public string EndCreateOrganization(System.IAsyncResult asyncResult) - { + public string EndCreateOrganization(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((string)(results[0])); } - + /// - public void CreateOrganizationAsync(string organizationId, string sipDomain, bool enableConferencing, bool enableConferencingVideo, int maxConferenceSize, bool enabledFederation, bool enabledEnterpriseVoice) - { + public void CreateOrganizationAsync(string organizationId, string sipDomain, bool enableConferencing, bool enableConferencingVideo, int maxConferenceSize, bool enabledFederation, bool enabledEnterpriseVoice) { this.CreateOrganizationAsync(organizationId, sipDomain, enableConferencing, enableConferencingVideo, maxConferenceSize, enabledFederation, enabledEnterpriseVoice, null); } - + /// - public void CreateOrganizationAsync(string organizationId, string sipDomain, bool enableConferencing, bool enableConferencingVideo, int maxConferenceSize, bool enabledFederation, bool enabledEnterpriseVoice, object userState) - { - if ((this.CreateOrganizationOperationCompleted == null)) - { + public void CreateOrganizationAsync(string organizationId, string sipDomain, bool enableConferencing, bool enableConferencingVideo, int maxConferenceSize, bool enabledFederation, bool enabledEnterpriseVoice, object userState) { + if ((this.CreateOrganizationOperationCompleted == null)) { this.CreateOrganizationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateOrganizationOperationCompleted); } this.InvokeAsync("CreateOrganization", new object[] { @@ -176,108 +172,92 @@ namespace WebsitePanel.Providers.Lync enabledFederation, enabledEnterpriseVoice}, this.CreateOrganizationOperationCompleted, userState); } - - private void OnCreateOrganizationOperationCompleted(object arg) - { - if ((this.CreateOrganizationCompleted != null)) - { + + private void OnCreateOrganizationOperationCompleted(object arg) { + if ((this.CreateOrganizationCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.CreateOrganizationCompleted(this, new CreateOrganizationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/DeleteOrganization", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public bool DeleteOrganization(string organizationId, string sipDomain) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/DeleteOrganization", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public bool DeleteOrganization(string organizationId, string sipDomain) { object[] results = this.Invoke("DeleteOrganization", new object[] { organizationId, sipDomain}); return ((bool)(results[0])); } - + /// - public System.IAsyncResult BeginDeleteOrganization(string organizationId, string sipDomain, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginDeleteOrganization(string organizationId, string sipDomain, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("DeleteOrganization", new object[] { organizationId, sipDomain}, callback, asyncState); } - + /// - public bool EndDeleteOrganization(System.IAsyncResult asyncResult) - { + public bool EndDeleteOrganization(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((bool)(results[0])); } - + /// - public void DeleteOrganizationAsync(string organizationId, string sipDomain) - { + public void DeleteOrganizationAsync(string organizationId, string sipDomain) { this.DeleteOrganizationAsync(organizationId, sipDomain, null); } - + /// - public void DeleteOrganizationAsync(string organizationId, string sipDomain, object userState) - { - if ((this.DeleteOrganizationOperationCompleted == null)) - { + public void DeleteOrganizationAsync(string organizationId, string sipDomain, object userState) { + if ((this.DeleteOrganizationOperationCompleted == null)) { this.DeleteOrganizationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteOrganizationOperationCompleted); } this.InvokeAsync("DeleteOrganization", new object[] { organizationId, sipDomain}, this.DeleteOrganizationOperationCompleted, userState); } - - private void OnDeleteOrganizationOperationCompleted(object arg) - { - if ((this.DeleteOrganizationCompleted != null)) - { + + private void OnDeleteOrganizationOperationCompleted(object arg) { + if ((this.DeleteOrganizationCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.DeleteOrganizationCompleted(this, new DeleteOrganizationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateUser", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public bool CreateUser(string organizationId, string userUpn, LyncUserPlan plan) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateUser", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public bool CreateUser(string organizationId, string userUpn, LyncUserPlan plan) { object[] results = this.Invoke("CreateUser", new object[] { organizationId, userUpn, plan}); return ((bool)(results[0])); } - + /// - public System.IAsyncResult BeginCreateUser(string organizationId, string userUpn, LyncUserPlan plan, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginCreateUser(string organizationId, string userUpn, LyncUserPlan plan, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("CreateUser", new object[] { organizationId, userUpn, plan}, callback, asyncState); } - + /// - public bool EndCreateUser(System.IAsyncResult asyncResult) - { + public bool EndCreateUser(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((bool)(results[0])); } - + /// - public void CreateUserAsync(string organizationId, string userUpn, LyncUserPlan plan) - { + public void CreateUserAsync(string organizationId, string userUpn, LyncUserPlan plan) { this.CreateUserAsync(organizationId, userUpn, plan, null); } - + /// - public void CreateUserAsync(string organizationId, string userUpn, LyncUserPlan plan, object userState) - { - if ((this.CreateUserOperationCompleted == null)) - { + public void CreateUserAsync(string organizationId, string userUpn, LyncUserPlan plan, object userState) { + if ((this.CreateUserOperationCompleted == null)) { this.CreateUserOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateUserOperationCompleted); } this.InvokeAsync("CreateUser", new object[] { @@ -285,108 +265,140 @@ namespace WebsitePanel.Providers.Lync userUpn, plan}, this.CreateUserOperationCompleted, userState); } - - private void OnCreateUserOperationCompleted(object arg) - { - if ((this.CreateUserCompleted != null)) - { + + private void OnCreateUserOperationCompleted(object arg) { + if ((this.CreateUserCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.CreateUserCompleted(this, new CreateUserCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetLyncUserGeneralSettings", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public LyncUser GetLyncUserGeneralSettings(string organizationId, string userUpn) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetLyncUserGeneralSettings", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public LyncUser GetLyncUserGeneralSettings(string organizationId, string userUpn) { object[] results = this.Invoke("GetLyncUserGeneralSettings", new object[] { organizationId, userUpn}); return ((LyncUser)(results[0])); } - + /// - public System.IAsyncResult BeginGetLyncUserGeneralSettings(string organizationId, string userUpn, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginGetLyncUserGeneralSettings(string organizationId, string userUpn, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("GetLyncUserGeneralSettings", new object[] { organizationId, userUpn}, callback, asyncState); } - + /// - public LyncUser EndGetLyncUserGeneralSettings(System.IAsyncResult asyncResult) - { + public LyncUser EndGetLyncUserGeneralSettings(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((LyncUser)(results[0])); } - + /// - public void GetLyncUserGeneralSettingsAsync(string organizationId, string userUpn) - { + public void GetLyncUserGeneralSettingsAsync(string organizationId, string userUpn) { this.GetLyncUserGeneralSettingsAsync(organizationId, userUpn, null); } - + /// - public void GetLyncUserGeneralSettingsAsync(string organizationId, string userUpn, object userState) - { - if ((this.GetLyncUserGeneralSettingsOperationCompleted == null)) - { + public void GetLyncUserGeneralSettingsAsync(string organizationId, string userUpn, object userState) { + if ((this.GetLyncUserGeneralSettingsOperationCompleted == null)) { this.GetLyncUserGeneralSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetLyncUserGeneralSettingsOperationCompleted); } this.InvokeAsync("GetLyncUserGeneralSettings", new object[] { organizationId, userUpn}, this.GetLyncUserGeneralSettingsOperationCompleted, userState); } - - private void OnGetLyncUserGeneralSettingsOperationCompleted(object arg) - { - if ((this.GetLyncUserGeneralSettingsCompleted != null)) - { + + private void OnGetLyncUserGeneralSettingsOperationCompleted(object arg) { + if ((this.GetLyncUserGeneralSettingsCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetLyncUserGeneralSettingsCompleted(this, new GetLyncUserGeneralSettingsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SetLyncUserPlan", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public bool SetLyncUserPlan(string organizationId, string userUpn, LyncUserPlan plan) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SetLyncUserGeneralSettings", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public bool SetLyncUserGeneralSettings(string organizationId, string userUpn, LyncUser lyncUser) { + object[] results = this.Invoke("SetLyncUserGeneralSettings", new object[] { + organizationId, + userUpn, + lyncUser}); + return ((bool)(results[0])); + } + + /// + public System.IAsyncResult BeginSetLyncUserGeneralSettings(string organizationId, string userUpn, LyncUser lyncUser, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("SetLyncUserGeneralSettings", new object[] { + organizationId, + userUpn, + lyncUser}, callback, asyncState); + } + + /// + public bool EndSetLyncUserGeneralSettings(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((bool)(results[0])); + } + + /// + public void SetLyncUserGeneralSettingsAsync(string organizationId, string userUpn, LyncUser lyncUser) { + this.SetLyncUserGeneralSettingsAsync(organizationId, userUpn, lyncUser, null); + } + + /// + public void SetLyncUserGeneralSettingsAsync(string organizationId, string userUpn, LyncUser lyncUser, object userState) { + if ((this.SetLyncUserGeneralSettingsOperationCompleted == null)) { + this.SetLyncUserGeneralSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetLyncUserGeneralSettingsOperationCompleted); + } + this.InvokeAsync("SetLyncUserGeneralSettings", new object[] { + organizationId, + userUpn, + lyncUser}, this.SetLyncUserGeneralSettingsOperationCompleted, userState); + } + + private void OnSetLyncUserGeneralSettingsOperationCompleted(object arg) { + if ((this.SetLyncUserGeneralSettingsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.SetLyncUserGeneralSettingsCompleted(this, new SetLyncUserGeneralSettingsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SetLyncUserPlan", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public bool SetLyncUserPlan(string organizationId, string userUpn, LyncUserPlan plan) { object[] results = this.Invoke("SetLyncUserPlan", new object[] { organizationId, userUpn, plan}); return ((bool)(results[0])); } - + /// - public System.IAsyncResult BeginSetLyncUserPlan(string organizationId, string userUpn, LyncUserPlan plan, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginSetLyncUserPlan(string organizationId, string userUpn, LyncUserPlan plan, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("SetLyncUserPlan", new object[] { organizationId, userUpn, plan}, callback, asyncState); } - + /// - public bool EndSetLyncUserPlan(System.IAsyncResult asyncResult) - { + public bool EndSetLyncUserPlan(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((bool)(results[0])); } - + /// - public void SetLyncUserPlanAsync(string organizationId, string userUpn, LyncUserPlan plan) - { + public void SetLyncUserPlanAsync(string organizationId, string userUpn, LyncUserPlan plan) { this.SetLyncUserPlanAsync(organizationId, userUpn, plan, null); } - + /// - public void SetLyncUserPlanAsync(string organizationId, string userUpn, LyncUserPlan plan, object userState) - { - if ((this.SetLyncUserPlanOperationCompleted == null)) - { + public void SetLyncUserPlanAsync(string organizationId, string userUpn, LyncUserPlan plan, object userState) { + if ((this.SetLyncUserPlanOperationCompleted == null)) { this.SetLyncUserPlanOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetLyncUserPlanOperationCompleted); } this.InvokeAsync("SetLyncUserPlan", new object[] { @@ -394,155 +406,131 @@ namespace WebsitePanel.Providers.Lync userUpn, plan}, this.SetLyncUserPlanOperationCompleted, userState); } - - private void OnSetLyncUserPlanOperationCompleted(object arg) - { - if ((this.SetLyncUserPlanCompleted != null)) - { + + private void OnSetLyncUserPlanOperationCompleted(object arg) { + if ((this.SetLyncUserPlanCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.SetLyncUserPlanCompleted(this, new SetLyncUserPlanCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/DeleteUser", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public bool DeleteUser(string userUpn) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/DeleteUser", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public bool DeleteUser(string userUpn) { object[] results = this.Invoke("DeleteUser", new object[] { userUpn}); return ((bool)(results[0])); } - + /// - public System.IAsyncResult BeginDeleteUser(string userUpn, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginDeleteUser(string userUpn, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("DeleteUser", new object[] { userUpn}, callback, asyncState); } - + /// - public bool EndDeleteUser(System.IAsyncResult asyncResult) - { + public bool EndDeleteUser(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((bool)(results[0])); } - + /// - public void DeleteUserAsync(string userUpn) - { + public void DeleteUserAsync(string userUpn) { this.DeleteUserAsync(userUpn, null); } - + /// - public void DeleteUserAsync(string userUpn, object userState) - { - if ((this.DeleteUserOperationCompleted == null)) - { + public void DeleteUserAsync(string userUpn, object userState) { + if ((this.DeleteUserOperationCompleted == null)) { this.DeleteUserOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteUserOperationCompleted); } this.InvokeAsync("DeleteUser", new object[] { userUpn}, this.DeleteUserOperationCompleted, userState); } - - private void OnDeleteUserOperationCompleted(object arg) - { - if ((this.DeleteUserCompleted != null)) - { + + private void OnDeleteUserOperationCompleted(object arg) { + if ((this.DeleteUserCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.DeleteUserCompleted(this, new DeleteUserCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetFederationDomains", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public LyncFederationDomain[] GetFederationDomains(string organizationId) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetFederationDomains", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public LyncFederationDomain[] GetFederationDomains(string organizationId) { object[] results = this.Invoke("GetFederationDomains", new object[] { organizationId}); return ((LyncFederationDomain[])(results[0])); } - + /// - public System.IAsyncResult BeginGetFederationDomains(string organizationId, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginGetFederationDomains(string organizationId, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("GetFederationDomains", new object[] { organizationId}, callback, asyncState); } - + /// - public LyncFederationDomain[] EndGetFederationDomains(System.IAsyncResult asyncResult) - { + public LyncFederationDomain[] EndGetFederationDomains(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((LyncFederationDomain[])(results[0])); } - + /// - public void GetFederationDomainsAsync(string organizationId) - { + public void GetFederationDomainsAsync(string organizationId) { this.GetFederationDomainsAsync(organizationId, null); } - + /// - public void GetFederationDomainsAsync(string organizationId, object userState) - { - if ((this.GetFederationDomainsOperationCompleted == null)) - { + public void GetFederationDomainsAsync(string organizationId, object userState) { + if ((this.GetFederationDomainsOperationCompleted == null)) { this.GetFederationDomainsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetFederationDomainsOperationCompleted); } this.InvokeAsync("GetFederationDomains", new object[] { organizationId}, this.GetFederationDomainsOperationCompleted, userState); } - - private void OnGetFederationDomainsOperationCompleted(object arg) - { - if ((this.GetFederationDomainsCompleted != null)) - { + + private void OnGetFederationDomainsOperationCompleted(object arg) { + if ((this.GetFederationDomainsCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetFederationDomainsCompleted(this, new GetFederationDomainsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/AddFederationDomain", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public bool AddFederationDomain(string organizationId, string domainName, string proxyFqdn) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/AddFederationDomain", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public bool AddFederationDomain(string organizationId, string domainName, string proxyFqdn) { object[] results = this.Invoke("AddFederationDomain", new object[] { organizationId, domainName, proxyFqdn}); return ((bool)(results[0])); } - + /// - public System.IAsyncResult BeginAddFederationDomain(string organizationId, string domainName, string proxyFqdn, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginAddFederationDomain(string organizationId, string domainName, string proxyFqdn, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("AddFederationDomain", new object[] { organizationId, domainName, proxyFqdn}, callback, asyncState); } - + /// - public bool EndAddFederationDomain(System.IAsyncResult asyncResult) - { + public bool EndAddFederationDomain(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((bool)(results[0])); } - + /// - public void AddFederationDomainAsync(string organizationId, string domainName, string proxyFqdn) - { + public void AddFederationDomainAsync(string organizationId, string domainName, string proxyFqdn) { this.AddFederationDomainAsync(organizationId, domainName, proxyFqdn, null); } - + /// - public void AddFederationDomainAsync(string organizationId, string domainName, string proxyFqdn, object userState) - { - if ((this.AddFederationDomainOperationCompleted == null)) - { + public void AddFederationDomainAsync(string organizationId, string domainName, string proxyFqdn, object userState) { + if ((this.AddFederationDomainOperationCompleted == null)) { this.AddFederationDomainOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddFederationDomainOperationCompleted); } this.InvokeAsync("AddFederationDomain", new object[] { @@ -550,392 +538,363 @@ namespace WebsitePanel.Providers.Lync domainName, proxyFqdn}, this.AddFederationDomainOperationCompleted, userState); } - - private void OnAddFederationDomainOperationCompleted(object arg) - { - if ((this.AddFederationDomainCompleted != null)) - { + + private void OnAddFederationDomainOperationCompleted(object arg) { + if ((this.AddFederationDomainCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.AddFederationDomainCompleted(this, new AddFederationDomainCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/RemoveFederationDomain", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public bool RemoveFederationDomain(string organizationId, string domainName) - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/RemoveFederationDomain", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public bool RemoveFederationDomain(string organizationId, string domainName) { object[] results = this.Invoke("RemoveFederationDomain", new object[] { organizationId, domainName}); return ((bool)(results[0])); } - + /// - public System.IAsyncResult BeginRemoveFederationDomain(string organizationId, string domainName, System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginRemoveFederationDomain(string organizationId, string domainName, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("RemoveFederationDomain", new object[] { organizationId, domainName}, callback, asyncState); } - + /// - public bool EndRemoveFederationDomain(System.IAsyncResult asyncResult) - { + public bool EndRemoveFederationDomain(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((bool)(results[0])); } - + /// - public void RemoveFederationDomainAsync(string organizationId, string domainName) - { + public void RemoveFederationDomainAsync(string organizationId, string domainName) { this.RemoveFederationDomainAsync(organizationId, domainName, null); } - + /// - public void RemoveFederationDomainAsync(string organizationId, string domainName, object userState) - { - if ((this.RemoveFederationDomainOperationCompleted == null)) - { + public void RemoveFederationDomainAsync(string organizationId, string domainName, object userState) { + if ((this.RemoveFederationDomainOperationCompleted == null)) { this.RemoveFederationDomainOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRemoveFederationDomainOperationCompleted); } this.InvokeAsync("RemoveFederationDomain", new object[] { organizationId, domainName}, this.RemoveFederationDomainOperationCompleted, userState); } - - private void OnRemoveFederationDomainOperationCompleted(object arg) - { - if ((this.RemoveFederationDomainCompleted != null)) - { + + private void OnRemoveFederationDomainOperationCompleted(object arg) { + if ((this.RemoveFederationDomainCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.RemoveFederationDomainCompleted(this, new RemoveFederationDomainCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/ReloadConfiguration", RequestNamespace = "http://smbsaas/websitepanel/server/", ResponseNamespace = "http://smbsaas/websitepanel/server/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void ReloadConfiguration() - { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/ReloadConfiguration", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void ReloadConfiguration() { this.Invoke("ReloadConfiguration", new object[0]); } - + /// - public System.IAsyncResult BeginReloadConfiguration(System.AsyncCallback callback, object asyncState) - { + public System.IAsyncResult BeginReloadConfiguration(System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("ReloadConfiguration", new object[0], callback, asyncState); } - + /// - public void EndReloadConfiguration(System.IAsyncResult asyncResult) - { + public void EndReloadConfiguration(System.IAsyncResult asyncResult) { this.EndInvoke(asyncResult); } - + /// - public void ReloadConfigurationAsync() - { + public void ReloadConfigurationAsync() { this.ReloadConfigurationAsync(null); } - + /// - public void ReloadConfigurationAsync(object userState) - { - if ((this.ReloadConfigurationOperationCompleted == null)) - { + public void ReloadConfigurationAsync(object userState) { + if ((this.ReloadConfigurationOperationCompleted == null)) { this.ReloadConfigurationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnReloadConfigurationOperationCompleted); } this.InvokeAsync("ReloadConfiguration", new object[0], this.ReloadConfigurationOperationCompleted, userState); } - - private void OnReloadConfigurationOperationCompleted(object arg) - { - if ((this.ReloadConfigurationCompleted != null)) - { + + private void OnReloadConfigurationOperationCompleted(object arg) { + if ((this.ReloadConfigurationCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.ReloadConfigurationCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - public new void CancelAsync(object userState) - { + public new void CancelAsync(object userState) { base.CancelAsync(userState); } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void CreateOrganizationCompletedEventHandler(object sender, CreateOrganizationCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class CreateOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class CreateOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal CreateOrganizationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal CreateOrganizationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public string Result - { - get - { + public string Result { + get { this.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void DeleteOrganizationCompletedEventHandler(object sender, DeleteOrganizationCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class DeleteOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class DeleteOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal DeleteOrganizationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal DeleteOrganizationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public bool Result - { - get - { + public bool Result { + get { this.RaiseExceptionIfNecessary(); return ((bool)(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void CreateUserCompletedEventHandler(object sender, CreateUserCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class CreateUserCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class CreateUserCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal CreateUserCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal CreateUserCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public bool Result - { - get - { + public bool Result { + get { this.RaiseExceptionIfNecessary(); return ((bool)(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetLyncUserGeneralSettingsCompletedEventHandler(object sender, GetLyncUserGeneralSettingsCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetLyncUserGeneralSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class GetLyncUserGeneralSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal GetLyncUserGeneralSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal GetLyncUserGeneralSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public LyncUser Result - { - get - { + public LyncUser Result { + get { this.RaiseExceptionIfNecessary(); return ((LyncUser)(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void SetLyncUserGeneralSettingsCompletedEventHandler(object sender, SetLyncUserGeneralSettingsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class SetLyncUserGeneralSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal SetLyncUserGeneralSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public bool Result { + get { + this.RaiseExceptionIfNecessary(); + return ((bool)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void SetLyncUserPlanCompletedEventHandler(object sender, SetLyncUserPlanCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class SetLyncUserPlanCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class SetLyncUserPlanCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal SetLyncUserPlanCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal SetLyncUserPlanCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public bool Result - { - get - { + public bool Result { + get { this.RaiseExceptionIfNecessary(); return ((bool)(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void DeleteUserCompletedEventHandler(object sender, DeleteUserCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class DeleteUserCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class DeleteUserCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal DeleteUserCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal DeleteUserCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public bool Result - { - get - { + public bool Result { + get { this.RaiseExceptionIfNecessary(); return ((bool)(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void GetFederationDomainsCompletedEventHandler(object sender, GetFederationDomainsCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetFederationDomainsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class GetFederationDomainsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal GetFederationDomainsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal GetFederationDomainsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public LyncFederationDomain[] Result - { - get - { + public LyncFederationDomain[] Result { + get { this.RaiseExceptionIfNecessary(); return ((LyncFederationDomain[])(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void AddFederationDomainCompletedEventHandler(object sender, AddFederationDomainCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class AddFederationDomainCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class AddFederationDomainCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal AddFederationDomainCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal AddFederationDomainCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public bool Result - { - get - { + public bool Result { + get { this.RaiseExceptionIfNecessary(); return ((bool)(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void RemoveFederationDomainCompletedEventHandler(object sender, RemoveFederationDomainCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class RemoveFederationDomainCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs - { - + public partial class RemoveFederationDomainCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + private object[] results; - - internal RemoveFederationDomainCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) - { + + internal RemoveFederationDomainCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { this.results = results; } - + /// - public bool Result - { - get - { + public bool Result { + get { this.RaiseExceptionIfNecessary(); return ((bool)(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void ReloadConfigurationCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); } diff --git a/WebsitePanel/Sources/WebsitePanel.Server/LyncServer.asmx.cs b/WebsitePanel/Sources/WebsitePanel.Server/LyncServer.asmx.cs index 8f04045d..b55428ec 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/LyncServer.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server/LyncServer.asmx.cs @@ -124,6 +124,24 @@ namespace WebsitePanel.Server } } + [WebMethod, SoapHeader("settings")] + public bool SetLyncUserGeneralSettings(string organizationId, string userUpn, LyncUser lyncUser) + { + try + { + Log.WriteStart("{0}.SetLyncUserGeneralSettings", ProviderSettings.ProviderName); + bool ret = Lync.SetLyncUserGeneralSettings(organizationId, userUpn, lyncUser); + Log.WriteEnd("{0}.SetLyncUserGeneralSettings", ProviderSettings.ProviderName); + return ret; + } + catch (Exception ex) + { + Log.WriteError(String.Format("Error: {0}.SetLyncUserGeneralSettings", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] public bool SetLyncUserPlan(string organizationId, string userUpn, LyncUserPlan plan) { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config index e8d06e78..73475696 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config @@ -481,7 +481,9 @@ - + + + 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 c7c849f9..fc7a3c5b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx @@ -1059,6 +1059,9 @@ Invalid Global DNS entries in platform server configuration for dedicated IP address usage. Contact you platform administrator + + Invalid public shared ip address in platform server configuration for shared IP address usage. Contact you platform administrator + Specified mail domain already exists on the service @@ -3173,6 +3176,9 @@ Cannot delete user account as it is used in OCS. + + Cannot delete user account as it is used in Lync. + B2B Primary Zones Allowed diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsAddDomain.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsAddDomain.ascx.cs index 4a2dab6d..9fe39c8f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsAddDomain.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsAddDomain.ascx.cs @@ -106,7 +106,7 @@ namespace WebsitePanel.Portal WebSitesList.DataBind(); } - if ((type == DomainType.DomainPointer || (type == DomainType.Domain && cntx.Quotas[Quotas.OS_DOMAINPOINTERS].QuotaAllocatedValue == 0)) && !IsPostBack) + if ((type == DomainType.DomainPointer || (type == DomainType.Domain && !cntx.Quotas[Quotas.OS_DOMAINPOINTERS].QuotaExhausted)) && !IsPostBack) { // bind mail domains MailDomainsList.DataSource = ES.Services.MailServers.GetMailDomains(PanelSecurity.PackageId, false); @@ -135,7 +135,7 @@ namespace WebsitePanel.Portal WebSitesList.Enabled = PointWebSite.Checked; // point mail domain - PointMailDomainPanel.Visible = (type == DomainType.DomainPointer || (type == DomainType.Domain && cntx.Quotas[Quotas.OS_DOMAINPOINTERS].QuotaAllocatedValue == 0)) + PointMailDomainPanel.Visible = (type == DomainType.DomainPointer || (type == DomainType.Domain && !cntx.Quotas[Quotas.OS_DOMAINPOINTERS].QuotaExhausted)) && cntx.Groups.ContainsKey(ResourceGroups.Mail) && MailDomainsList.Items.Count > 0; MailDomainsList.Enabled = PointMailDomain.Checked; @@ -212,7 +212,7 @@ namespace WebsitePanel.Portal pointWebSiteId = Utils.ParseInt(WebSitesList.SelectedValue, 0); } - if (type == DomainType.DomainPointer || (type == DomainType.Domain && cntx.Quotas[Quotas.OS_DOMAINPOINTERS].QuotaAllocatedValue == 0)) + if (type == DomainType.DomainPointer || (type == DomainType.Domain && !cntx.Quotas[Quotas.OS_DOMAINPOINTERS].QuotaExhausted)) { if (PointMailDomain.Checked && MailDomainsList.Items.Count > 0) pointMailDomainId = Utils.ParseInt(MailDomainsList.SelectedValue, 0); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsSelectDomainControl.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsSelectDomainControl.ascx.cs index 5678f285..7c52e8f0 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsSelectDomainControl.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/DomainsSelectDomainControl.ascx.cs @@ -62,6 +62,13 @@ namespace WebsitePanel.Portal set { ViewState["HideMailDomains"] = value; } } + public bool HideMailDomainPointers + { + get { return (ViewState["HideMailDomainPointers"] != null) ? (bool)ViewState["HideMailDomainPointers"] : false; } + set { ViewState["HideMailDomainPointers"] = value; } + } + + public bool HideDomainPointers { get { return (ViewState["HideDomainPointers"] != null) ? (bool)ViewState["HideDomainPointers"] : false; } @@ -111,6 +118,7 @@ namespace WebsitePanel.Portal WebSite[] sites = null; Hashtable htSites = new Hashtable(); + Hashtable htMailDomainPointers = new Hashtable(); if (HideWebSites) { sites = ES.Services.WebServers.GetWebSites(PackageId, false); @@ -127,6 +135,25 @@ namespace WebsitePanel.Portal } } + if (HideMailDomainPointers) + { + Providers.Mail.MailDomain[] mailDomains = ES.Services.MailServers.GetMailDomains(PackageId, false); + + foreach (Providers.Mail.MailDomain mailDomain in mailDomains) + { + DomainInfo[] pointers = ES.Services.MailServers.GetMailDomainPointers(mailDomain.Id); + if (pointers != null) + { + foreach (DomainInfo p in pointers) + { + if (htMailDomainPointers[p.DomainName.ToLower()] == null) htMailDomainPointers.Add(p.DomainName.ToLower(), 1); + + } + } + } + } + + ddlDomains.Items.Clear(); // add "select" item @@ -148,7 +175,15 @@ namespace WebsitePanel.Portal } } } - else if (HideInstantAlias && domain.IsInstantAlias) + + + if (HideMailDomainPointers) + { + if (htMailDomainPointers[domain.DomainName.ToLower()] != null) continue; + } + + + if (HideInstantAlias && domain.IsInstantAlias) continue; else if (HideMailDomains && domain.MailDomainId > 0) continue; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxes.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxes.ascx.resx index 1aaeac3a..a254bede 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxes.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxes.ascx.resx @@ -174,4 +174,10 @@ Mailboxes + + Login + + + Login + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationAddDomainName.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationAddDomainName.ascx.resx new file mode 100644 index 00000000..1b687b23 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationAddDomainName.ascx.resx @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + Cancel + + + Select a domain name, e.g. "mydomain.com" or "sub.mydomain.com" + + + Add Domain Name + + + Domain Names + + + Please enter correct domain name, e.g. "mydomain.com" or "sub.mydomain.com" + + + * + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationDomainNames.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationDomainNames.ascx.resx new file mode 100644 index 00000000..8775c057 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationDomainNames.ascx.resx @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Add New Domain + + + Set Default Domain + + + if(!confirm('Are you sure you want to delete selected domain?')) return false; else ShowProgressDialog('Deleting Domain...'); + + + Delete + + + Delete Domain Name + + + No domains have been added yet. To add a new domain click "Add New Domain" button. + + + Default Domain + + + Domain Name + + + <p>Each organization can have several domain names. These domain names are used as part of the primary e-mail address (UPN) of the new accounts. Exchange-enabled organizations use domain name when creating e-mail addresses for mailboxes, and distribution lists. Domain name is also used when creating new site collection in SharePoint.</p> +<p>Default domain name is selected by default when creating a new e-mail address. You can always change default domain name and it will not affect existing accounts.</p> +<p>For each domain name a corresponding DNS Zone is created. You can edit DNS zone records by clicking domain name link. If you are unsure about the structure of DNS zone, please do not modify zone records.</p> + + + Total Domain Names Used: + + + Domain Names + + + Domain Names + + + Domain Type + + + Change Type + + + Change + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUserGeneralSettings.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUserGeneralSettings.ascx.resx index 7e4229e9..6946695e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUserGeneralSettings.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUserGeneralSettings.ascx.resx @@ -236,4 +236,7 @@ * + + Login Name: + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUsers.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUsers.ascx.resx index 581e06b6..3923f30b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUsers.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUsers.ascx.resx @@ -180,4 +180,10 @@ Total Users Created for this Tenant: + + Login + + + Login + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx index 62e671f9..b2deb2cf 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx @@ -147,7 +147,15 @@ - + + + + + +
+ +
+
// This code was generated by a tool. @@ -327,6 +355,24 @@ namespace WebsitePanel.Portal.ExchangeServer { /// protected global::WebsitePanel.Portal.ExchangeServer.UserControls.MailboxPlanSelector mailboxPlanSelector; + /// + /// chkSendInstructions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkSendInstructions; + + /// + /// sendInstructionEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.EmailControl sendInstructionEmail; + /// /// btnCreate control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx index 851a9b78..35443356 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx @@ -46,6 +46,7 @@ Email AccountName Account Number + Login @@ -67,6 +68,15 @@ + + + + + <%# Eval("UserPrincipalName") %> + + + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.cs index 6a970dc9..f225eb71 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx.cs @@ -47,7 +47,7 @@ namespace WebsitePanel.Portal.ExchangeServer { if (cntx.Quotas[Quotas.EXCHANGE2007_ISCONSUMER].QuotaAllocatedValue != 1) { - gvMailboxes.Columns[2].Visible = false; + gvMailboxes.Columns[3].Visible = false; } } } @@ -139,7 +139,15 @@ namespace WebsitePanel.Portal.ExchangeServer // bind stats BindStats(); - } + } + + public string GetOrganizationUserEditUrl(string accountId) + { + return EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "edit_user", + "AccountID=" + accountId, + "ItemID=" + PanelRequest.ItemID, + "Context=User"); + } } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationAddDomainName.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationAddDomainName.ascx new file mode 100644 index 00000000..dd55b0ef --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationAddDomainName.ascx @@ -0,0 +1,44 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="OrganizationAddDomainName.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.OrganizationAddDomainName" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + +
+
+
+ +
+
+ +
+
+
+
+ + +
+
+ + + + + + +
+ +
+
+
+ + + +
+
+
+ +
+
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationAddDomainName.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationAddDomainName.ascx.cs new file mode 100644 index 00000000..e5046171 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationAddDomainName.ascx.cs @@ -0,0 +1,121 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +using System; +using System.Data; +using System.Text; +using System.Collections.Generic; + +using WebsitePanel.EnterpriseServer; +using WebsitePanel.Providers.HostedSolution; + +namespace WebsitePanel.Portal.ExchangeServer +{ + public partial class OrganizationAddDomainName : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + DomainInfo[] domains = ES.Services.Servers.GetMyDomains(PanelSecurity.PackageId); + + Organization[] orgs = ES.Services.Organizations.GetOrganizations(PanelSecurity.PackageId, false); + + List list = new List(); + + foreach (Organization o in orgs) + { + OrganizationDomainName[] tmpList = ES.Services.Organizations.GetOrganizationDomains(o.Id); + + foreach (OrganizationDomainName name in tmpList) list.Add(name); + } + + foreach (DomainInfo d in domains) + { + if (!d.IsDomainPointer) + { + bool bAdd = true; + foreach (OrganizationDomainName acceptedDomain in list) + { + if (d.DomainName.ToLower() == acceptedDomain.DomainName.ToLower()) + { + bAdd = false; + break; + } + + } + if (bAdd) ddlDomains.Items.Add(d.DomainName.ToLower()); + } + } + + if (ddlDomains.Items.Count == 0) + { + ddlDomains.Visible= btnAdd.Enabled = false; + } + + + + } + + protected void btnAdd_Click(object sender, EventArgs e) + { + AddDomain(); + } + + protected void btnCancel_Click(object sender, EventArgs e) + { + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "org_domains", "SpaceID=" + PanelSecurity.PackageId)); + + } + + + private void AddDomain() + { + if (!Page.IsValid) + return; + + try + { + + int result = ES.Services.Organizations.AddOrganizationDomain(PanelRequest.ItemID, + ddlDomains.SelectedValue.Trim()); + + if (result < 0) + { + messageBox.ShowResultMessage(result); + return; + } + + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "org_domains", + "SpaceID=" + PanelSecurity.PackageId)); + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("EXCHANGE_ADD_DOMAIN", ex); + } + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationAddDomainName.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationAddDomainName.ascx.designer.cs new file mode 100644 index 00000000..8f1f82e4 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationAddDomainName.ascx.designer.cs @@ -0,0 +1,142 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.ExchangeServer { + + + public partial class OrganizationAddDomainName { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Menu menu; + + /// + /// Image1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image Image1; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// locDomainName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locDomainName; + + /// + /// ddlDomains control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlDomains; + + /// + /// btnAdd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnAdd; + + /// + /// 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; + + /// + /// btnCancel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCancel; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx index 187d5a08..4c8ea62f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx @@ -91,6 +91,15 @@ + + + + + + +
+ +
// This code was generated by a tool. @@ -219,6 +247,24 @@ namespace WebsitePanel.Portal.HostedSolution { /// protected global::WebsitePanel.Portal.PasswordControl password; + /// + /// chkSendInstructions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkSendInstructions; + + /// + /// sendInstructionEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.EmailControl sendInstructionEmail; + /// /// btnCreate control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx new file mode 100644 index 00000000..388c12be --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx @@ -0,0 +1,76 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="OrganizationDomainNames.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.OrganizationDomainNames" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/QuotaViewer.ascx" TagName="QuotaViewer" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + +
+
+
+ +
+
+ +
+
+
+
+ + +
+
+ + +
+ +
+ + + + + + + + <%# Eval("DomainName") %> + + + + + +
+ /> +
+
+
+ + +   + + +
+
+
+
+ +
+ +
+ +     + + + +
+
+
+
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx.cs new file mode 100644 index 00000000..1fd56a34 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx.cs @@ -0,0 +1,148 @@ +// 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 WebsitePanel.EnterpriseServer; +using WebsitePanel.Providers.HostedSolution; + +namespace WebsitePanel.Portal.ExchangeServer +{ + public partial class OrganizationDomainNames : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + BindStats(); + + // bind domain names + BindDomainNames(); + } + + + } + + private void BindStats() + { + // set quotas + OrganizationStatistics stats = ES.Services.Organizations.GetOrganizationStatisticsByOrganization(PanelRequest.ItemID); + OrganizationStatistics tenantStats = ES.Services.Organizations.GetOrganizationStatistics(PanelRequest.ItemID); + domainsQuota.QuotaUsedValue = stats.CreatedDomains; + domainsQuota.QuotaValue = stats.AllocatedDomains; + if (stats.AllocatedDomains != -1) domainsQuota.QuotaAvailable = tenantStats.AllocatedDomains - tenantStats.CreatedDomains; + } + + public string GetDomainRecordsEditUrl(string domainId) + { + return EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "domain_records", + "DomainID=" + domainId, + "ItemID=" + PanelRequest.ItemID); + } + + private void BindDomainNames() + { + OrganizationDomainName[] list = ES.Services.Organizations.GetOrganizationDomains(PanelRequest.ItemID); + + gvDomains.DataSource = list; + gvDomains.DataBind(); + + //check if organization has only one default domain + if (gvDomains.Rows.Count == 1) + { + btnSetDefaultDomain.Enabled = false; + } + } + + public string IsChecked(bool val) + { + return val ? "checked" : ""; + } + + protected void btnAddDomain_Click(object sender, EventArgs e) + { + btnSetDefaultDomain.Enabled = true; + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "org_add_domain", + "SpaceID=" + PanelSecurity.PackageId)); + } + + protected void gvDomains_RowCommand(object sender, GridViewCommandEventArgs e) + { + if (e.CommandName == "DeleteItem") + { + // delete domain + int domainId = Utils.ParseInt(e.CommandArgument.ToString(), 0); + + try + { + int result = ES.Services.Organizations.DeleteOrganizationDomain(PanelRequest.ItemID, domainId); + if (result < 0) + { + messageBox.ShowResultMessage(result); + return; + } + + // rebind domains + BindDomainNames(); + + BindStats(); + } + catch (Exception ex) + { + ShowErrorMessage("EXCHANGE_DELETE_DOMAIN", ex); + } + } + } + + protected void btnSetDefaultDomain_Click(object sender, EventArgs e) + { + // get domain + int domainId = Utils.ParseInt(Request.Form["DefaultDomain"], 0); + + try + { + int result = ES.Services.Organizations.SetOrganizationDefaultDomain(PanelRequest.ItemID, domainId); + if (result < 0) + { + messageBox.ShowResultMessage(result); + if (BusinessErrorCodes.ERROR_USER_ACCOUNT_DEMO == result) + BindDomainNames(); + return; + } + + // rebind domains + BindDomainNames(); + } + catch (Exception ex) + { + ShowErrorMessage("EXCHANGE_SET_DEFAULT_DOMAIN", ex); + } + } + + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx.designer.cs new file mode 100644 index 00000000..6e8feaab --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationDomainNames.ascx.designer.cs @@ -0,0 +1,142 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.ExchangeServer { + + + public partial class OrganizationDomainNames { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Menu menu; + + /// + /// Image1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image Image1; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// btnAddDomain control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnAddDomain; + + /// + /// gvDomains control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvDomains; + + /// + /// btnSetDefaultDomain control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnSetDefaultDomain; + + /// + /// locQuota control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locQuota; + + /// + /// domainsQuota control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.QuotaViewer domainsQuota; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx index 407ab8c2..4ee2563c 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx @@ -41,6 +41,11 @@ + + + + + +
@@ -95,6 +100,7 @@
// This code was generated by a tool. @@ -93,6 +121,24 @@ namespace WebsitePanel.Portal.HostedSolution { /// protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + /// + /// locUserPrincipalName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locUserPrincipalName; + + /// + /// lblUserPrincipalName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblUserPrincipalName; + /// /// locDisplayName control. /// @@ -668,14 +714,5 @@ namespace WebsitePanel.Portal.HostedSolution { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.ValidationSummary ValidationSummary1; - - /// - /// FormComments control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize FormComments; } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx index c6b5f5bf..8db4b2f5 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx @@ -47,6 +47,7 @@ Email AccountName Account Number + Login @@ -74,14 +75,15 @@ - - + + + - - - - + /> + /> + /> + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx.cs index 60d76797..07b88d06 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx.cs @@ -48,7 +48,7 @@ namespace WebsitePanel.Portal.HostedSolution { if (cntx.Quotas[Quotas.EXCHANGE2007_ISCONSUMER].QuotaAllocatedValue != 1) { - gvUsers.Columns[3].Visible = false; + gvUsers.Columns[4].Visible = false; } } @@ -115,6 +115,52 @@ namespace WebsitePanel.Portal.HostedSolution messageBox.ShowErrorMessage("ORGANIZATIONS_DELETE_USERS", ex); } } + + if (e.CommandName == "OpenMailProperties") + { + int accountId = Utils.ParseInt(e.CommandArgument.ToString(), 0); + + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "mailbox_settings", + "AccountID=" + accountId, + "ItemID=" + PanelRequest.ItemID)); + } + + if (e.CommandName == "OpenBlackBerryProperties") + { + int accountId = Utils.ParseInt(e.CommandArgument.ToString(), 0); + + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "edit_blackberry_user", + "AccountID=" + accountId, + "ItemID=" + PanelRequest.ItemID)); + } + + if (e.CommandName == "OpenCRMProperties") + { + int accountId = Utils.ParseInt(e.CommandArgument.ToString(), 0); + + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "mailbox_settings", + "AccountID=" + accountId, + "ItemID=" + PanelRequest.ItemID)); + } + + if (e.CommandName == "OpenUCProperties") + { + string[] Tmp = e.CommandArgument.ToString().Split('|'); + + int accountId = Utils.ParseInt(Tmp[0], 0); + if (Tmp[1] == "True") + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "edit_ocs_user", + "AccountID=" + accountId, + "ItemID=" + PanelRequest.ItemID)); + else + if (Tmp[2] == "True") + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "edit_lync_user", + "AccountID=" + accountId, + "ItemID=" + PanelRequest.ItemID)); + + + + } } @@ -208,7 +254,52 @@ namespace WebsitePanel.Portal.HostedSolution // bind stats BindStats(); - } + } + + + public bool EnableMailImageButton(int accountTypeId) + { + bool imgName = true; + + ExchangeAccountType accountType = (ExchangeAccountType)accountTypeId; + + if (accountType == ExchangeAccountType.User) + imgName = false; + + return imgName; + } + + public bool EnableOCSImageButton(bool IsOCSUser, bool IsLyncUser) + { + bool imgName = false; + + if (IsLyncUser) + imgName = true; + else + if ((IsOCSUser)) + imgName = true; + + return imgName; + } + + public bool EnableBlackBerryImageButton(bool IsBlackBerryUser) + { + bool imgName = false; + + if (IsBlackBerryUser) + imgName = true; + + return imgName; + } + + + public string GetOCSArgument(int accountID, bool IsOCS, bool IsLync) + { + return accountID.ToString() + "|" + IsOCS.ToString() + "|" + IsLync.ToString(); + } + + + } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/Menu.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/Menu.ascx.resx index ea488c1d..0f2f1e19 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/Menu.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/Menu.ascx.resx @@ -127,6 +127,9 @@ Distribution Lists + Domains + + Accepted Domains diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs index d0817799..9f3475ae 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs @@ -138,10 +138,11 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls exchangeGroup.MenuItems.Add(CreateMenuItem("MailboxPlans", "mailboxplans")); if (!hideItems) - if (Utils.CheckQouta(Quotas.ORGANIZATION_DOMAINS, cntx)) - exchangeGroup.MenuItems.Add(CreateMenuItem("DomainNames", "domains")); + if (Utils.CheckQouta(Quotas.EXCHANGE2007_MAILBOXES, cntx)) + exchangeGroup.MenuItems.Add(CreateMenuItem("ExchangeDomainNames", "domains")); if (!hideItems) + if (Utils.CheckQouta(Quotas.EXCHANGE2007_MAILBOXES, cntx)) exchangeGroup.MenuItems.Add(CreateMenuItem("StorageUsage", "storage_usage")); if (exchangeGroup.MenuItems.Count > 0) @@ -164,8 +165,12 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls if (!hideItems) { MenuGroup organizationGroup = new MenuGroup(GetLocalizedString("Text.OrganizationGroup"), imagePath + "company24.png"); - //if (CheckQouta(Quotas.ORGANIZATION_DOMAINS, cntx)) - // organizationGroup.MenuItems.Add(CreateMenuItem("DomainNames", "domains")); + + if (Utils.CheckQouta(Quotas.EXCHANGE2007_MAILBOXES, cntx) == false) + { + if (Utils.CheckQouta(Quotas.ORGANIZATION_DOMAINS, cntx)) + organizationGroup.MenuItems.Add(CreateMenuItem("DomainNames", "org_domains")); + } if (Utils.CheckQouta(Quotas.ORGANIZATION_USERS, cntx)) organizationGroup.MenuItems.Add(CreateMenuItem("Users", "users")); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserTabs.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserTabs.ascx.cs index 91bf372d..da968986 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserTabs.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserTabs.ascx.cs @@ -50,7 +50,10 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls { List tabsList = new List(); tabsList.Add(CreateTab("edit_user", "Tab.General")); - //tabsList.Add(CreateTab("organization_user_setup", "Tab.Setup")); + + string instructions = ES.Services.Organizations.GetOrganizationUserSummuryLetter(PanelRequest.ItemID, PanelRequest.AccountID, false, false, false); + if (!string.IsNullOrEmpty(instructions)) + tabsList.Add(CreateTab("organization_user_setup", "Tab.Setup")); // find selected menu item int idx = 0; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/App_LocalResources/LyncEditUser.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/App_LocalResources/LyncEditUser.ascx.resx index bad6c174..efcae705 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/App_LocalResources/LyncEditUser.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/App_LocalResources/LyncEditUser.ascx.resx @@ -135,4 +135,7 @@ Plan Name : + + SIP Address: + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/App_LocalResources/LyncUsers.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/App_LocalResources/LyncUsers.ascx.resx index 9114e730..748a13ee 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/App_LocalResources/LyncUsers.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/App_LocalResources/LyncUsers.ascx.resx @@ -126,8 +126,8 @@ Display name - - Sign-in name + + Login <p>Microsoft Lync Server delivers unified communications to the users, including software-powered VoIP, Web and audio/video conferencing, and enterprise instant messaging.</p> @@ -138,7 +138,7 @@ Display name - Sign-in name + SIP Address Lync Users @@ -152,4 +152,7 @@ No users have been Lync enabled. To enable a user for Lync click "Create Lync User" button. + + Login + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncCreateUser.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncCreateUser.ascx index cea3d2cd..4d36dcf4 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncCreateUser.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncCreateUser.ascx @@ -28,7 +28,7 @@ - + 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 c1083b65..af2c5bee 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 @@ -26,7 +26,6 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - //------------------------------------------------------------------------------ // // This code was generated by a tool. @@ -148,14 +147,5 @@ namespace WebsitePanel.Portal.Lync { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Button btnCreate; - - /// - /// FormComments control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize FormComments; } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx index bcb77a8f..64305427 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx @@ -7,6 +7,7 @@ <%@ Register Src="../UserControls/QuotaViewer.ascx" TagName="QuotaViewer" TagPrefix="wsp" %> <%@ Register src="../ExchangeServer/UserControls/MailboxSelector.ascx" tagname="MailboxSelector" tagprefix="uc1" %> <%@ Register Src="UserControls/LyncUserPlanSelector.ascx" TagName="LyncUserPlanSelector" TagPrefix="wsp" %> +<%@ Register Src="UserControls/LyncUserSettings.ascx" TagName="LyncUserSettings" TagPrefix="wsp" %>
@@ -38,6 +39,15 @@ + + + + + + + + +
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 aa3b96fa..b3b2782b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.cs @@ -52,6 +52,8 @@ namespace WebsitePanel.Portal.Lync litDisplayName.Text = lyncUser.DisplayName; planSelector.planId = lyncUser.LyncUserPlanId.ToString(); + lyncUserSettings.sipAddress = lyncUser.SipAddress; + } protected void btnSave_Click(object sender, EventArgs e) @@ -61,11 +63,18 @@ namespace WebsitePanel.Portal.Lync try { 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, string.Empty); + } + if (res.IsSuccess && res.ErrorCodes.Count == 0) { messageBox.ShowSuccessMessage("UPDATE_LYNC_USER"); return; } + else + messageBox.ShowMessage(res, "UPDATE_LYNC_USER", "LYNC"); } catch(Exception ex) { 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 2b64cf15..52aaa081 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.designer.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2012, Outercurve Foundation. +// Copyright (c) 2011, Outercurve Foundation. // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, @@ -26,7 +26,6 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - //------------------------------------------------------------------------------ // // This code was generated by a tool. @@ -122,6 +121,24 @@ namespace WebsitePanel.Portal.Lync { /// protected global::WebsitePanel.Portal.Lync.UserControls.LyncUserPlanSelector planSelector; + /// + /// locSipAddress control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locSipAddress; + + /// + /// lyncUserSettings control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.Lync.UserControls.LyncUserSettings lyncUserSettings; + /// /// btnSave control. /// @@ -130,14 +147,5 @@ namespace WebsitePanel.Portal.Lync { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.Button btnSave; - - /// - /// FormComments control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize FormComments; } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncUsers.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncUsers.ascx index d0320faa..f94d5abd 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncUsers.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncUsers.ascx @@ -41,7 +41,7 @@ DisplayName - Email + Email - - + + + + + <%# Eval("UserPrincipalName") %> + + + + + // This code was generated by a tool. // @@ -155,14 +183,5 @@ namespace WebsitePanel.Portal.Lync { /// To modify move field declaration from designer file to code-behind file. /// protected global::WebsitePanel.Portal.QuotaViewer usersQuota; - - /// - /// FormComments control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize FormComments; } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserSettings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserSettings.ascx new file mode 100644 index 00000000..5da9df82 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserSettings.ascx @@ -0,0 +1,2 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="LyncUserSettings.ascx.cs" Inherits="WebsitePanel.Portal.Lync.UserControls.LyncUserSettings" %> + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserSettings.ascx.cs new file mode 100644 index 00000000..c7b45afa --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserSettings.ascx.cs @@ -0,0 +1,102 @@ +// Copyright (c) 2011, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +using System; +using System.Web.UI.WebControls; +using EntServer = WebsitePanel.EnterpriseServer; + +namespace WebsitePanel.Portal.Lync.UserControls +{ + public partial class LyncUserSettings : WebsitePanelControlBase + { + + private string sipAddressToSelect; + + public string sipAddress + { + + get { return ddlSipAddresses.SelectedItem.Value; } + set + { + sipAddressToSelect = value; + foreach (ListItem li in ddlSipAddresses.Items) + { + if (li.Value == value) + { + ddlSipAddresses.ClearSelection(); + li.Selected = true; + break; + } + } + } + } + + public int plansCount + { + get + { + return this.ddlSipAddresses.Items.Count; + } + } + + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + BindAddresses(); + } + } + + private void BindAddresses() + { + + EntServer.ExchangeEmailAddress[] emails = ES.Services.ExchangeServer.GetMailboxEmailAddresses(PanelRequest.ItemID, PanelRequest.AccountID); + + foreach (EntServer.ExchangeEmailAddress email in emails) + { + ListItem li = new ListItem(); + li.Text = email.EmailAddress; + li.Value = email.EmailAddress; + li.Selected = email.IsPrimary; + ddlSipAddresses.Items.Add(li); + } + + foreach (ListItem li in ddlSipAddresses.Items) + { + if (li.Value == sipAddressToSelect) + { + ddlSipAddresses.ClearSelection(); + li.Selected = true; + break; + } + } + + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserSettings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserSettings.ascx.designer.cs new file mode 100644 index 00000000..202d581f --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserSettings.ascx.designer.cs @@ -0,0 +1,52 @@ +// Copyright (c) 2011, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.Lync.UserControls { + + + public partial class LyncUserSettings { + + /// + /// ddlSipAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlSipAddresses; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/MailDomainsAddPointer.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/MailDomainsAddPointer.ascx index 18ba579f..1f57cb0f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/MailDomainsAddPointer.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/MailDomainsAddPointer.ascx @@ -6,7 +6,7 @@ + HideMailDomains="true" HideDomainsSubDomains="false" HideInstantAlias="false" HideDomainPointers="true"/> diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/MailEditAddress.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/MailEditAddress.ascx index bb808b7a..6037cbc1 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/MailEditAddress.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/MailEditAddress.ascx @@ -9,7 +9,7 @@  @  - + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/Exchange_Settings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/Exchange_Settings.ascx.cs index 60ebd64b..944b4d94 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/Exchange_Settings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/Exchange_Settings.ascx.cs @@ -45,6 +45,7 @@ namespace WebsitePanel.Portal.ProviderControls public const int EXCHANGE2010SP2_PROVIDER_ID = 90; public const int EXCHANGE2013_PROVIDER_ID = 91; + public string HubTransports { get @@ -112,7 +113,6 @@ namespace WebsitePanel.Portal.ProviderControls locMailboxDatabase.Visible = false; break; - default: storageGroup.Visible = true; txtStorageGroup.Text = settings["StorageGroup"]; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/App_LocalResources/HostedSolutionReport.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/App_LocalResources/HostedSolutionReport.ascx.resx index f7088cc4..211bf742 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/App_LocalResources/HostedSolutionReport.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/App_LocalResources/HostedSolutionReport.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 CRM Report @@ -123,6 +123,9 @@ Exchange Report + + Lync Report + Organization Report diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/HostedSolutionReport.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/HostedSolutionReport.ascx index 58374f7b..4dd58eaa 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/HostedSolutionReport.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/HostedSolutionReport.ascx @@ -19,6 +19,11 @@ + + + + + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/HostedSolutionReport.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/HostedSolutionReport.ascx.cs index 56ae7708..d458ebce 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/HostedSolutionReport.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/HostedSolutionReport.ascx.cs @@ -37,6 +37,7 @@ namespace WebsitePanel.Portal.ScheduleTaskControls private static readonly string EXCHANGE_REPORT = "EXCHANGE_REPORT"; private static readonly string ORGANIZATION_REPORT = "ORGANIZATION_REPORT"; private static readonly string SHAREPOINT_REPORT = "SHAREPOINT_REPORT"; + private static readonly string LYNC_REPORT = "LYNC_REPORT"; private static readonly string CRM_REPORT = "CRM_REPORT"; private static readonly string EMAIL = "EMAIL"; @@ -51,6 +52,7 @@ namespace WebsitePanel.Portal.ScheduleTaskControls base.SetParameters(parameters); SetParameter(cbExchange, EXCHANGE_REPORT); SetParameter(cbSharePoint, SHAREPOINT_REPORT); + SetParameter(cbLync, LYNC_REPORT); SetParameter(cbCRM, CRM_REPORT); SetParameter(cbOrganization, ORGANIZATION_REPORT); SetParameter(txtMail, EMAIL); @@ -61,12 +63,13 @@ namespace WebsitePanel.Portal.ScheduleTaskControls { ScheduleTaskParameterInfo exchange = GetParameter(cbExchange, EXCHANGE_REPORT); ScheduleTaskParameterInfo sharepoint = GetParameter(cbSharePoint, SHAREPOINT_REPORT); + ScheduleTaskParameterInfo lync = GetParameter(cbLync, LYNC_REPORT); ScheduleTaskParameterInfo crm = GetParameter(cbCRM, CRM_REPORT); ScheduleTaskParameterInfo organization = GetParameter(cbOrganization, ORGANIZATION_REPORT); ScheduleTaskParameterInfo email = GetParameter(txtMail, EMAIL); - return new ScheduleTaskParameterInfo[5] { exchange, sharepoint, crm , organization, email}; + return new ScheduleTaskParameterInfo[6] { exchange, sharepoint, lync, crm , organization, email}; } } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/HostedSolutionReport.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/HostedSolutionReport.ascx.designer.cs index 7ecf5644..926f9f18 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/HostedSolutionReport.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ScheduleTaskControls/HostedSolutionReport.ascx.designer.cs @@ -1,10 +1,37 @@ -//------------------------------------------------------------------------------ +// 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.1433 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ @@ -49,6 +76,15 @@ namespace WebsitePanel.Portal.ScheduleTaskControls { /// protected global::System.Web.UI.WebControls.CheckBox cbSharePoint; + /// + /// cbLync control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox cbLync; + /// /// cbCRM control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsLyncUserPlansPolicy.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsLyncUserPlansPolicy.ascx.cs index 76d92469..51fbf72a 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsLyncUserPlansPolicy.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsLyncUserPlansPolicy.ascx.cs @@ -219,7 +219,7 @@ namespace WebsitePanel.Portal } - result = ES.Services.ExchangeServer.DeleteExchangeMailboxPlan(orgs[0].Id, planId); + result = ES.Services.Lync.DeleteLyncUserPlan(orgs[0].Id, planId); if (result < 0) { messageBox.ShowResultMessage(result); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx index 52e6606c..366ff2ec 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx @@ -99,7 +99,7 @@ - + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx.cs index bfec236e..5e92633c 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx.cs @@ -86,6 +86,7 @@ namespace WebsitePanel.Portal bool webEnabled = false; bool ftpEnabled = false; bool mailEnabled = false; + bool integratedOUEnabled = false; // load hosting context if (planId > 0) @@ -111,6 +112,11 @@ namespace WebsitePanel.Portal ftpEnabled = cntx.Groups.ContainsKey(ResourceGroups.Ftp); mailEnabled = cntx.Groups.ContainsKey(ResourceGroups.Mail); + + if (Utils.CheckQouta(Quotas.ORGANIZATION_DOMAINS, cntx)) + { + integratedOUEnabled = true; + } } } @@ -129,7 +135,7 @@ namespace WebsitePanel.Portal ftpAccountName.Visible = (rbFtpAccountName.SelectedIndex == 1); - chkIntegratedOUProvisioning.Visible = chkCreateResources.Visible; + chkIntegratedOUProvisioning.Checked = chkIntegratedOUProvisioning.Visible = (chkCreateResources.Visible && integratedOUEnabled); } private void CreateHostingSpace() 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 2044722b..bea7dc26 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj @@ -202,6 +202,20 @@ + + OrganizationAddDomainName.ascx + ASPXCodeBehind + + + OrganizationAddDomainName.ascx + + + OrganizationDomainNames.ascx + ASPXCodeBehind + + + OrganizationDomainNames.ascx + ExchangeAddMailboxPlan.ascx ASPXCodeBehind @@ -283,6 +297,13 @@ LyncUsers.ascx + + LyncUserSettings.ascx + ASPXCodeBehind + + + LyncUserSettings.ascx + LyncUserPlanSelector.ascx ASPXCodeBehind @@ -3790,7 +3811,10 @@ + + + @@ -4945,6 +4969,12 @@ + + Designer + + + Designer + Designer diff --git a/WebsitePanel/Sources/generate_es_proxies.bat b/WebsitePanel/Sources/generate_es_proxies.bat index a6c063c5..0f50b419 100644 --- a/WebsitePanel/Sources/generate_es_proxies.bat +++ b/WebsitePanel/Sources/generate_es_proxies.bat @@ -65,8 +65,8 @@ REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\PackagesProxy.cs REM %WSDL% %SERVER_URL%/esScheduler.asmx /out:.\WebsitePanel.EnterpriseServer.Client\SchedulerProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\SchedulerProxy.cs -%WSDL% %SERVER_URL%/esServers.asmx /out:.\WebsitePanel.EnterpriseServer.Client\ServersProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient -%WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\ServersProxy.cs +REM %WSDL% %SERVER_URL%/esServers.asmx /out:.\WebsitePanel.EnterpriseServer.Client\ServersProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient +REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\ServersProxy.cs REM %WSDL% %SERVER_URL%/esSharePointServers.asmx /out:.\WebsitePanel.EnterpriseServer.Client\SharePointServersProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\SharePointServersProxy.cs @@ -92,8 +92,8 @@ REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\WebServersProxy.cs REM %WSDL% %SERVER_URL%/esVirtualizationServerForPrivateCloud.asmx /out:.\WebsitePanel.EnterpriseServer.Client\VirtualizationServerProxyForPrivateCloud.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\VirtualizationServerProxyForPrivateCloud.cs -REM %WSDL% %SERVER_URL%/esLync.asmx /out:.\WebsitePanel.EnterpriseServer.Client\LyncProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient -REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\LyncProxy.cs +%WSDL% %SERVER_URL%/esLync.asmx /out:.\WebsitePanel.EnterpriseServer.Client\LyncProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient +%WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\LyncProxy.cs diff --git a/WebsitePanel/Sources/generate_server_proxies.bat b/WebsitePanel/Sources/generate_server_proxies.bat index 1d02b7f0..8c3cfdee 100644 --- a/WebsitePanel/Sources/generate_server_proxies.bat +++ b/WebsitePanel/Sources/generate_server_proxies.bat @@ -50,13 +50,13 @@ REM %WSE_CLEAN% .\WebsitePanel.Server.Client\VirtualizationServerProxy.cs REM %WSDL% %SERVER_URL%/VirtualizationServerForPrivateCloud.asmx /out:.\WebsitePanel.Server.Client\VirtualizationServerForPrivateCloudProxy.cs /namespace:WebsitePanel.Providers.VirtualizationForPC /type:webClient /fields REM %WSE_CLEAN% .\WebsitePanel.Server.Client\VirtualizationServerForPrivateCloudProxy.cs -%WSDL% %SERVER_URL%/WebServer.asmx /out:.\WebsitePanel.Server.Client\WebServerProxy.cs /namespace:WebsitePanel.Providers.Web /type:webClient /fields -%WSE_CLEAN% .\WebsitePanel.Server.Client\WebServerProxy.cs +REM %WSDL% %SERVER_URL%/WebServer.asmx /out:.\WebsitePanel.Server.Client\WebServerProxy.cs /namespace:WebsitePanel.Providers.Web /type:webClient /fields +REM %WSE_CLEAN% .\WebsitePanel.Server.Client\WebServerProxy.cs REM %WSDL% %SERVER_URL%/WindowsServer.asmx /out:.\WebsitePanel.Server.Client\WindowsServerProxy.cs /namespace:WebsitePanel.Server /type:webClient /fields REM %WSE_CLEAN% .\WebsitePanel.Server.Client\WindowsServerProxy.cs -REM %WSDL% %SERVER_URL%/LyncServer.asmx /out:.\WebsitePanel.Server.Client\LyncServerProxy.cs /namespace:WebsitePanel.Providers.Lync /type:webClient /fields -REM %WSE_CLEAN% .\WebsitePanel.Server.Client\LyncServerProxy.cs +%WSDL% %SERVER_URL%/LyncServer.asmx /out:.\WebsitePanel.Server.Client\LyncServerProxy.cs /namespace:WebsitePanel.Providers.Lync /type:webClient /fields +%WSE_CLEAN% .\WebsitePanel.Server.Client\LyncServerProxy.cs