diff --git a/WebsitePanel/Database/install_db.sql b/WebsitePanel/Database/install_db.sql index be7e742f..e260326d 100644 --- a/WebsitePanel/Database/install_db.sql +++ b/WebsitePanel/Database/install_db.sql @@ -3641,7 +3641,7 @@ INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDe GO INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (75, 1, 8, N'OS.ExtraApplications', N'Extra Application Packs', 1, 0, NULL) GO -INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (77, 12, 2, N'Exchange2007.DiskSpace', N'Organization Disk Space, MB', 21, 0, NULL) +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (77, 12, 2, N'Exchange2007.DiskSpace', N'Organization Disk Space, MB', 2, 0, NULL) GO INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (78, 12, 3, N'Exchange2007.Mailboxes', N'Mailboxes per Organization', 2, 0, NULL) GO @@ -3851,6 +3851,26 @@ INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDe GO INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (368, 12, 1, N'Exchange2007.IsConsumer',N'Is Consumer Organization',1, 0 , NULL) GO +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (370, 41, 1, N'Lync.Users', N'Users',2 ,0 , NULL) +GO +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (371, 41, 2, N'Lync.Federation' , N'Allow Federation', 1, 0, NULL) +GO +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (372, 41, 3, N'Lync.Conferencing', N'Allow Conferencing', 1, 0, NULL) +GO +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (373, 41, 4, N'Lync.MaxParticipants', N'Maximum Conference Particiapants', 3, 0, NULL) +GO +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (374, 41, 5, N'Lync.AllowVideo', N'Allow Video in Conference', 1, 0, NULL) +GO +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (375, 41, 6, N'Lync.EnterpriseVoice', N'Allow EnterpriseVoice', 1, 0, NULL) +GO +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (376, 41, 7, N'Lync.EVUsers', N'Number of Enterprise Voice Users', 2, 0, NULL) +GO +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (377, 41, 8, N'Lync.EVNational', N'Allow National Calls', 1, 0, NULL) +GO +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (378, 41, 9, N'Lync.EVMobile', N'Allow Mobile Calls', 1, 0, NULL) +GO +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (379, 41, 10, N'Lync.EVInternational', N'Allow International Calls', 1, 0, NULL) +GO INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (400, 20, 3, N'HostedSharePoint.UseSharedSSL', N'Use shared SSL Root', 1, 0, NULL) GO @@ -10631,6 +10651,8 @@ INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupContr GO INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController]) VALUES (32, N'OCS', 22, NULL) GO +INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController]) VALUES (41, N'Lync',23, NULL) +GO INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController]) VALUES (40, N'VPSForPC', 20, NULL) GO SET ANSI_NULLS ON @@ -13237,6 +13259,62 @@ GO +CREATE TABLE [dbo].[LyncUserPlans]( + [LyncUserPlanId] [int] IDENTITY(1,1) NOT NULL, + [ItemID] [int] NOT NULL, + [LyncUserPlanName] [nvarchar](300) COLLATE Latin1_General_CI_AS NOT NULL, + [IM] [bit] NOT NULL, + [Mobility] [bit] NOT NULL, + [MobilityEnableOutsideVoice] [bit] NOT NULL, + [Federation] [bit] NOT NULL, + [Conferencing] [bit] NOT NULL, + [EnterpriseVoice] [bit] NOT NULL, + [VoicePolicy] [int] NOT NULL, + [IsDefault] [bit] NOT NULL, + CONSTRAINT [PK_LyncUserPlans] PRIMARY KEY CLUSTERED +( + [LyncUserPlanId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO + + + + + + + + + +CREATE TABLE [dbo].[LyncUsers]( + [LyncUserID] [int] IDENTITY(1,1) NOT NULL, + [AccountID] [int] NOT NULL, + [LyncUserPlanID] [int] NOT NULL, + [CreatedDate] [datetime] NOT NULL, + [ModifiedDate] [datetime] NOT NULL, + CONSTRAINT [PK_LyncUsers] PRIMARY KEY CLUSTERED +( + [LyncUserID] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +GO + + + + + + + + + + + + + + + @@ -23372,6 +23450,8 @@ INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName] GO INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (209, 23, N'MsSQL', N'Microsoft SQL Server 2012', N'WebsitePanel.Providers.Database.MsSqlServer2012, WebsitePanel.Providers.Database.SqlServer', N'MSSQL', NULL) GO +INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (250, 41, N'Lync2010', N'Microsoft Lync Server 2010 Multitenant Hosting Pack', 'WebsitePanel.Providers.HostedSolution.Lync2010, WebsitePanel.Providers.HostedSolution', 'Lync', 1) +GO INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (300, 30, N'HyperV', N'Microsoft Hyper-V', N'WebsitePanel.Providers.Virtualization.HyperV, WebsitePanel.Providers.Virtualization.HyperV', N'HyperV', 1) GO INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (301, 11, N'MySQL', N'MySQL Server 5.5', N'WebsitePanel.Providers.Database.MySqlServer55, WebsitePanel.Providers.Database.MySQL', N'MySQL', NULL) @@ -25882,6 +25962,19 @@ AS INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID WHERE pt.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 370 -- Lync.Users + SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts AS ea + INNER JOIN LyncUsers lu ON ea.AccountID = lu.AccountID + INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID + INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID + WHERE pt.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 376 -- Lync.EVUsers + SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts AS ea + INNER JOIN LyncUsers lu ON ea.AccountID = lu.AccountID + INNER JOIN LyncUserPlans lp ON lu.LyncUserPlanId = lp.LyncUserPlanId + INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID + INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID + WHERE pt.ParentPackageID = @PackageID AND lp.EnterpriseVoice = 1) ELSE SET @Result = (SELECT COUNT(SI.ItemID) FROM Quotas AS Q INNER JOIN ServiceItems AS SI ON SI.ItemTypeID = Q.ItemTypeID @@ -44831,6 +44924,496 @@ WHERE MailboxPlanId = @MailboxPlanId RETURN GO + + + + + + + + + + + +CREATE PROCEDURE [dbo].[AddLyncUser] + @AccountID int, + @LyncUserPlanID int +AS +BEGIN + SET NOCOUNT ON; + +INSERT INTO + dbo.LyncUsers + ( + + AccountID, + LyncUserPlanID, + CreatedDate, + ModifiedDate) +VALUES +( + @AccountID, + @LyncUserPlanID, + getdate(), + getdate() +) +END +GO + + + + + + + + +CREATE PROCEDURE [dbo].[AddLyncUserPlan] +( + @LyncUserPlanId int OUTPUT, + @ItemID int, + @LyncUserPlanName nvarchar(300), + @IM bit, + @Mobility bit, + @MobilityEnableOutsideVoice bit, + @Federation bit, + @Conferencing bit, + @EnterpriseVoice bit, + @VoicePolicy int, + @IsDefault bit +) +AS + +INSERT INTO LyncUserPlans +( + ItemID, + LyncUserPlanName, + IM, + Mobility, + MobilityEnableOutsideVoice, + Federation, + Conferencing, + EnterpriseVoice, + VoicePolicy, + IsDefault +) +VALUES +( + @ItemID, + @LyncUserPlanName, + @IM, + @Mobility, + @MobilityEnableOutsideVoice, + @Federation, + @Conferencing, + @EnterpriseVoice, + @VoicePolicy, + @IsDefault +) + +SET @LyncUserPlanId = SCOPE_IDENTITY() + +RETURN +GO + + + + + + + + + + +CREATE PROCEDURE [dbo].[CheckLyncUserExists] + @AccountID int +AS +BEGIN + SELECT + COUNT(AccountID) + FROM + dbo.LyncUsers + WHERE AccountID = @AccountID +END +GO + + + + + + + + + + +CREATE PROCEDURE [dbo].[DeleteLyncUser] +( + @AccountId int +) +AS + +DELETE FROM + LyncUsers +WHERE + AccountId = @AccountId + +RETURN +GO + + + + + + + + + + +CREATE PROCEDURE [dbo].[DeleteLyncUserPlan] +( + @LyncUserPlanId int +) +AS + +-- delete lyncuserplan +DELETE FROM LyncUserPlans +WHERE LyncUserPlanId = @LyncUserPlanId + +RETURN +GO + + + + + + + + + + + + + + + + + + + +CREATE PROCEDURE [dbo].[GetLyncUserPlan] +( + @LyncUserPlanId int +) +AS +SELECT + LyncUserPlanId, + ItemID, + LyncUserPlanName, + IM, + Mobility, + MobilityEnableOutsideVoice, + Federation, + Conferencing, + EnterpriseVoice, + VoicePolicy, + IsDefault +FROM + LyncUserPlans +WHERE + LyncUserPlanId = @LyncUserPlanId +RETURN +GO + + + + + + + + + + + + +CREATE PROCEDURE [dbo].[GetLyncUserPlanByAccountId] +( + @AccountID int +) +AS +SELECT + LyncUserPlanId, + ItemID, + LyncUserPlanName, + IM, + Mobility, + MobilityEnableOutsideVoice, + Federation, + Conferencing, + EnterpriseVoice, + VoicePolicy, + IsDefault +FROM + LyncUserPlans +WHERE + LyncUserPlanId IN (SELECT LyncUserPlanId FROM LyncUsers WHERE AccountID = @AccountID) +RETURN +GO + + + + + + + + + + + +CREATE PROCEDURE [dbo].[GetLyncUserPlans] +( + @ItemID int +) +AS +SELECT + LyncUserPlanId, + ItemID, + LyncUserPlanName, + IM, + Mobility, + MobilityEnableOutsideVoice, + Federation, + Conferencing, + EnterpriseVoice, + VoicePolicy, + IsDefault +FROM + LyncUserPlans +WHERE + ItemID = @ItemID +ORDER BY LyncUserPlanName +RETURN +GO + + + + + + + + + + + +CREATE 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, + [PrimaryEmailAddress] [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 = 'PrimaryEmailAddress') +BEGIN + SET @condition = 'ORDER BY ea.PrimaryEmailAddress' +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.PrimaryEmailAddress, + 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 = 'PrimaryEmailAddress') + BEGIN + SELECT * FROM #TempLyncUsers + WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY PrimaryEmailAddress 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 PrimaryEmailAddress DESC + END + + +END + + +DROP TABLE #TempLyncUsers +GO + + + + + + + + + + +CREATE PROCEDURE [dbo].[GetLyncUsersCount] +( + @ItemID int +) +AS + +SELECT + COUNT(ea.AccountID) +FROM + ExchangeAccounts ea +INNER JOIN + LyncUsers ou +ON + ea.AccountID = ou.AccountID +WHERE + ea.ItemID = @ItemID +GO + + + + + + + + + +CREATE PROCEDURE [dbo].[SetLyncUserLyncUserPlan] +( + @AccountID int, + @LyncUserPlanId int +) +AS + +UPDATE LyncUsers SET + LyncUserPlanId = @LyncUserPlanId +WHERE + AccountID = @AccountID + +RETURN +GO + + + + + + + + + + + +CREATE PROCEDURE [dbo].[SetOrganizationDefaultLyncUserPlan] +( + @ItemId int, + @LyncUserPlanId int +) +AS + +UPDATE LyncUserPlans SET IsDefault=0 WHERE ItemId=@ItemId +UPDATE LyncUserPlans SET IsDefault=1 WHERE LyncUserPlanId=@LyncUserPlanId + +RETURN +GO + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -45502,5 +46085,34 @@ ON DELETE CASCADE GO ALTER TABLE [dbo].[ServiceProperties] CHECK CONSTRAINT [FK_ServiceProperties_Services] GO - + +ALTER TABLE [dbo].[LyncUsers] ADD CONSTRAINT [DF_LyncUsers_CreatedDate] DEFAULT (getdate()) FOR [CreatedDate] +GO + +ALTER TABLE [dbo].[LyncUsers] ADD CONSTRAINT [DF_LyncUsers_ChangedDate] DEFAULT (getdate()) FOR [ModifiedDate] +GO + +ALTER TABLE [dbo].[LyncUsers] WITH CHECK ADD CONSTRAINT [FK_LyncUsers_LyncUserPlans] FOREIGN KEY([LyncUserPlanId]) +REFERENCES [dbo].[LyncUserPlans] ([LyncUserPlanId]) +GO + +ALTER TABLE [dbo].[LyncUsers] CHECK CONSTRAINT [FK_LyncUsers_LyncUserPlans] +GO + +ALTER TABLE dbo.LyncUserPlans ADD CONSTRAINT + IX_LyncUserPlans UNIQUE NONCLUSTERED + ( + LyncUserPlanId + ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] + +GO +ALTER TABLE dbo.LyncUserPlans ADD CONSTRAINT + FK_LyncUserPlans_ExchangeOrganizations FOREIGN KEY + ( + ItemID + ) REFERENCES dbo.ExchangeOrganizations + ( + ItemID + ) ON UPDATE NO ACTION + ON DELETE CASCADE diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index eb5435ba..3ad8ad99 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -1,18 +1,4 @@ -USE [${install.database}] -GO - --- update database version -DECLARE @build_version nvarchar(10), @build_date datetime -SET @build_version = N'${release.version}' -SET @build_date = '${release.date}T00:00:00' -- ISO 8601 Format (YYYY-MM-DDTHH:MM:SS) - -IF NOT EXISTS (SELECT * FROM [dbo].[Versions] WHERE [DatabaseVersion] = @build_version) -BEGIN - INSERT [dbo].[Versions] ([DatabaseVersion], [BuildDate]) VALUES (@build_version, @build_date) -END -GO - -IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE ([UserID] = 1) AND ([SettingsName] = 'WebPolicy') AND ([PropertyName] = 'EnableParkingPageTokens')) +IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE ([UserID] = 1) AND ([SettingsName] = 'WebPolicy') AND ([PropertyName] = 'EnableParkingPageTokens')) BEGIN INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'WebPolicy', N'EnableParkingPageTokens', N'False') END @@ -66,6 +52,14 @@ GO UPDATE [dbo].[ResourceGroups] SET [GroupOrder] = 21 WHERE [GroupName] = N'OCS' GO +IF NOT EXISTS (SELECT * FROM [dbo].[ResourceGroups] WHERE [GroupName] = 'Lync') +BEGIN +INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController]) VALUES (41, N'Lync',22, NULL) +END +GO + + + IF NOT EXISTS (SELECT * FROM [dbo].[ServiceItemTypes] WHERE [DisplayName] = 'MsSQL2012Database') BEGIN INSERT [dbo].[ServiceItemTypes] ([ItemTypeID], [GroupID], [DisplayName], [TypeName], [TypeOrder], [CalculateDiskspace], [CalculateBandwidth], [Suspendable], [Disposable], [Searchable], [Importable], [Backupable]) VALUES (37, 23, N'MsSQL2012Database', N'WebsitePanel.Providers.Database.SqlDatabase, WebsitePanel.Providers.Base', 1, 1, 0, 0, 1, 1, 1, 1) @@ -164,6 +158,72 @@ INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDe END GO +IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Lync.Users') +BEGIN +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (370, 41, 1, N'Lync.Users', N'Users',2 ,0 , NULL) +END +GO + +IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Lync.Federation') +BEGIN +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (371, 41, 2, N'Lync.Federation' , N'Allow Federation', 1, 0, NULL) +END +GO + +IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Lync.Conferencing') +BEGIN +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (372, 41, 3, N'Lync.Conferencing', N'Allow Conferencing', 1, 0, NULL) +END +GO + +IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Lync.MaxParticipants') +BEGIN +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (373, 41, 4, N'Lync.MaxParticipants', N'Maximum Conference Particiapants', 3, 0, NULL) +END +GO + +IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Lync.AllowVideo') +BEGIN +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (374, 41, 5, N'Lync.AllowVideo', N'Allow Video in Conference', 1, 0, NULL) +END +GO + +IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Lync.EnterpriseVoice') +BEGIN +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (375, 41, 6, N'Lync.EnterpriseVoice', N'Allow EnterpriseVoice', 1, 0, NULL) +END +GO + +IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Lync.EVUsers') +BEGIN +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (376, 41, 7, N'Lync.EVUsers', N'Number of Enterprise Voice Users', 2, 0, NULL) +END +GO + +IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Lync.EVNational') +BEGIN +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (377, 41, 8, N'Lync.EVNational', N'Allow National Calls', 1, 0, NULL) +END +GO + +IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Lync.EVMobile') +BEGIN +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (378, 41, 9, N'Lync.EVMobile', N'Allow Mobile Calls', 1, 0, NULL) +END +GO + +IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Lync.EVInternational') +BEGIN +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (379, 41, 10, N'Lync.EVInternational', N'Allow International Calls', 1, 0, NULL) +END +GO + +IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'HostedSharePoint.UseSharedSSL') +BEGIN +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (400, 20, 3, N'HostedSharePoint.UseSharedSSL', N'Use shared SSL Root', 1, 0, NULL) +END +GO + IF NOT EXISTS (SELECT * FROM [dbo].[Providers] WHERE [DisplayName] = 'Hosted Microsoft Exchange Server 2010 SP2') @@ -172,6 +232,16 @@ INSERT [dbo].[Providers] ([ProviderId], [GroupId], [ProviderName], [DisplayName] END GO + +IF NOT EXISTS (SELECT * FROM [dbo].[Providers] WHERE [DisplayName] = 'Microsoft Lync Server 2010 Multitenant Hosting Pack') +BEGIN +INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (250, 41, N'Lync2010', N'Microsoft Lync Server 2010 Multitenant Hosting Pack', 'WebsitePanel.Providers.HostedSolution.Lync2010, WebsitePanel.Providers.HostedSolution', 'Lync', 1) +END +GO + + + + DELETE FROM [dbo].[HostingPlanQuotas] WHERE [QuotaID] IN (SELECT [QuotaID] FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.POP3Enabled') DELETE FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.POP3Enabled' DELETE FROM [dbo].[HostingPlanQuotas] WHERE [QuotaID] IN (SELECT [QuotaID] FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.IMAPEnabled') @@ -1683,6 +1753,82 @@ ALTER TABLE [dbo].[ExchangeOrganizations] ALTER COLUMN [OrganizationID] [nvarcha GO + +-- LyncUsers +IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[LyncUsers]') AND type in (N'U')) +BEGIN +CREATE TABLE [dbo].[LyncUsers]( + [LyncUserID] [int] IDENTITY(1,1) NOT NULL, + [AccountID] [int] NOT NULL, + [LyncUserPlanID] [int] NOT NULL, + [CreatedDate] [datetime] NOT NULL, + [ModifiedDate] [datetime] NOT NULL, + CONSTRAINT [PK_LyncUsers] PRIMARY KEY CLUSTERED +( + [LyncUserID] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + + +ALTER TABLE [dbo].[LyncUsers] ADD CONSTRAINT [DF_LyncUsers_CreatedDate] DEFAULT (getdate()) FOR [CreatedDate] + +ALTER TABLE [dbo].[LyncUsers] ADD CONSTRAINT [DF_LyncUsers_ChangedDate] DEFAULT (getdate()) FOR [ModifiedDate] + +END +GO + + + + + +-- LyncUserPlans +IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[LyncUserPlans]') AND type in (N'U')) +BEGIN +CREATE TABLE [dbo].[LyncUserPlans]( + [LyncUserPlanId] [int] IDENTITY(1,1) NOT NULL, + [ItemID] [int] NOT NULL, + [LyncUserPlanName] [nvarchar](300) NOT NULL, + [IM] [bit] NOT NULL, + [Mobility] [bit] NOT NULL, + [MobilityEnableOutsideVoice] [bit] NOT NULL, + [Federation] [bit] NOT NULL, + [Conferencing] [bit] NOT NULL, + [EnterpriseVoice] [bit] NOT NULL, + [VoicePolicy] [int] NOT NULL, + [IsDefault] [bit] NOT NULL, + CONSTRAINT [PK_LyncUserPlans] PRIMARY KEY CLUSTERED +( + [LyncUserPlanId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +ALTER TABLE dbo.LyncUserPlans ADD CONSTRAINT + IX_LyncUserPlans UNIQUE NONCLUSTERED + ( + LyncUserPlanId + ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] + +ALTER TABLE dbo.LyncUserPlans ADD CONSTRAINT + FK_LyncUserPlans_ExchangeOrganizations FOREIGN KEY + ( + ItemID + ) REFERENCES dbo.ExchangeOrganizations + ( + ItemID + ) ON UPDATE NO ACTION + ON DELETE CASCADE + +ALTER TABLE [dbo].[LyncUsers] WITH CHECK ADD CONSTRAINT [FK_LyncUsers_LyncUserPlans] FOREIGN KEY([LyncUserPlanId]) +REFERENCES [dbo].[LyncUserPlans] ([LyncUserPlanId]) + +ALTER TABLE [dbo].[LyncUsers] CHECK CONSTRAINT [FK_LyncUsers_LyncUserPlans] + +END +GO + + + + /****** Object: Table [dbo].[AddExchangeAccount] ******/ ALTER PROCEDURE [dbo].[AddExchangeAccount] ( @@ -1955,6 +2101,19 @@ AS INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID WHERE pt.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 370 -- Lync.Users + SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts AS ea + INNER JOIN LyncUsers lu ON ea.AccountID = lu.AccountID + INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID + INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID + WHERE pt.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 376 -- Lync.EVUsers + SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts AS ea + INNER JOIN LyncUsers lu ON ea.AccountID = lu.AccountID + INNER JOIN LyncUserPlans lp ON lu.LyncUserPlanId = lp.LyncUserPlanId + INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID + INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID + WHERE pt.ParentPackageID = @PackageID AND lp.EnterpriseVoice = 1) ELSE SET @Result = (SELECT COUNT(SI.ItemID) FROM Quotas AS Q INNER JOIN ServiceItems AS SI ON SI.ItemTypeID = Q.ItemTypeID @@ -2808,5 +2967,480 @@ exec sp_executesql @sql, N'@ItemID int, @IncludeMailboxes bit', RETURN +GO + + + + + + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'AddLyncUser') +BEGIN +EXEC sp_executesql N'CREATE PROCEDURE [dbo].[AddLyncUser] + @AccountID int, + @LyncUserPlanID int +AS +INSERT INTO + dbo.LyncUsers + (AccountID, + LyncUserPlanID, + CreatedDate, + ModifiedDate) +VALUES +( + @AccountID, + @LyncUserPlanID, + getdate(), + getdate() +)' +END +GO + + + + + + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'AddLyncUserPlan') +BEGIN +EXEC sp_executesql N'CREATE PROCEDURE [dbo].[AddLyncUserPlan] +( + @LyncUserPlanId int OUTPUT, + @ItemID int, + @LyncUserPlanName nvarchar(300), + @IM bit, + @Mobility bit, + @MobilityEnableOutsideVoice bit, + @Federation bit, + @Conferencing bit, + @EnterpriseVoice bit, + @VoicePolicy int, + @IsDefault bit +) +AS + +INSERT INTO LyncUserPlans +( + ItemID, + LyncUserPlanName, + IM, + Mobility, + MobilityEnableOutsideVoice, + Federation, + Conferencing, + EnterpriseVoice, + VoicePolicy, + IsDefault +) +VALUES +( + @ItemID, + @LyncUserPlanName, + @IM, + @Mobility, + @MobilityEnableOutsideVoice, + @Federation, + @Conferencing, + @EnterpriseVoice, + @VoicePolicy, + @IsDefault +) + +SET @LyncUserPlanId = SCOPE_IDENTITY() + +RETURN' +END +GO + + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'CheckLyncUserExists') +BEGIN +EXEC sp_executesql N'CREATE PROCEDURE [dbo].[CheckLyncUserExists] + @AccountID int +AS + SELECT + COUNT(AccountID) + FROM + dbo.LyncUsers + WHERE AccountID = @AccountID' +END +GO + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'CheckLyncUserExists') +BEGIN +EXEC sp_executesql N'CREATE PROCEDURE [dbo].[CheckLyncUserExists] + @AccountID int +AS +BEGIN + SELECT + COUNT(AccountID) + FROM + dbo.LyncUsers + WHERE AccountID = @AccountID' +END +GO + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'DeleteLyncUser') +BEGIN +EXEC sp_executesql N'CREATE PROCEDURE [dbo].[DeleteLyncUser] +( + @AccountId int +) +AS + +DELETE FROM + LyncUsers +WHERE + AccountId = @AccountId + +RETURN' +END +GO + + + + + + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'DeleteLyncUserPlan') +BEGIN +EXEC sp_executesql N'CREATE PROCEDURE [dbo].[DeleteLyncUserPlan] +( + @LyncUserPlanId int +) +AS + +-- delete lyncuserplan +DELETE FROM LyncUserPlans +WHERE LyncUserPlanId = @LyncUserPlanId + +RETURN' +END +GO + + + + + + + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'GetLyncUserPlan') +BEGIN +EXEC sp_executesql N'CREATE PROCEDURE [dbo].[GetLyncUserPlan] +( + @LyncUserPlanId int +) +AS +SELECT + LyncUserPlanId, + ItemID, + LyncUserPlanName, + IM, + Mobility, + MobilityEnableOutsideVoice, + Federation, + Conferencing, + EnterpriseVoice, + VoicePolicy, + IsDefault +FROM + LyncUserPlans +WHERE + LyncUserPlanId = @LyncUserPlanId +RETURN' +END +GO + + + + + + + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'GetLyncUserPlanByAccountId') +BEGIN +EXEC sp_executesql N'CREATE PROCEDURE [dbo].[GetLyncUserPlanByAccountId] +( + @AccountID int +) +AS +SELECT + LyncUserPlanId, + ItemID, + LyncUserPlanName, + IM, + Mobility, + MobilityEnableOutsideVoice, + Federation, + Conferencing, + EnterpriseVoice, + VoicePolicy, + IsDefault +FROM + LyncUserPlans +WHERE + LyncUserPlanId IN (SELECT LyncUserPlanId FROM LyncUsers WHERE AccountID = @AccountID) +RETURN' +END +GO + + + + + + + + + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'GetLyncUserPlans') +BEGIN +EXEC sp_executesql N'CREATE PROCEDURE [dbo].[GetLyncUserPlans] +( + @ItemID int +) +AS +SELECT + LyncUserPlanId, + ItemID, + LyncUserPlanName, + IM, + Mobility, + MobilityEnableOutsideVoice, + Federation, + Conferencing, + EnterpriseVoice, + VoicePolicy, + IsDefault +FROM + LyncUserPlans +WHERE + ItemID = @ItemID +ORDER BY LyncUserPlanName +RETURN' +END +GO + + + + + + + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'GetLyncUsers') +BEGIN +EXEC sp_executesql N'CREATE 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, + [PrimaryEmailAddress] [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 = ''PrimaryEmailAddress'') +BEGIN + SET @condition = ''ORDER BY ea.PrimaryEmailAddress'' +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.PrimaryEmailAddress, + 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 = ''PrimaryEmailAddress'') + BEGIN + SELECT * FROM #TempLyncUsers + WHERE ID >@RetCount - @Count - @StartRow AND ID <= @RetCount- @StartRow ORDER BY PrimaryEmailAddress 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 PrimaryEmailAddress DESC + END + + +END + +DROP TABLE #TempLyncUsers' +END +GO + + + + + + + + + + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'GetLyncUsersCount') +BEGIN +EXEC sp_executesql N'CREATE PROCEDURE [dbo].[GetLyncUsersCount] +( + @ItemID int +) +AS + +SELECT + COUNT(ea.AccountID) +FROM + ExchangeAccounts ea +INNER JOIN + LyncUsers ou +ON + ea.AccountID = ou.AccountID +WHERE + ea.ItemID = @ItemID' +END +GO + + + + + + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'SetLyncUserLyncUserPlan') +BEGIN +EXEC sp_executesql N'CREATE PROCEDURE [dbo].[SetLyncUserLyncUserPlan] +( + @AccountID int, + @LyncUserPlanId int +) +AS + +UPDATE LyncUsers SET + LyncUserPlanId = @LyncUserPlanId +WHERE + AccountID = @AccountID + +RETURN' +END +GO + + + + + + + + + + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'SetOrganizationDefaultLyncUserPlan') +BEGIN +EXEC sp_executesql N'CREATE PROCEDURE [dbo].[SetOrganizationDefaultLyncUserPlan] +( + @ItemId int, + @LyncUserPlanId int +) +AS + +UPDATE LyncUserPlans SET IsDefault=0 WHERE ItemId=@ItemId +UPDATE LyncUserPlans SET IsDefault=1 WHERE LyncUserPlanId=@LyncUserPlanId + +RETURN' +END +GO diff --git a/WebsitePanel/Lib/References/Microsoft/Microsoft.Rtc.Management.Core.dll b/WebsitePanel/Lib/References/Microsoft/Microsoft.Rtc.Management.Core.dll new file mode 100644 index 00000000..beb6e4ab Binary files /dev/null and b/WebsitePanel/Lib/References/Microsoft/Microsoft.Rtc.Management.Core.dll differ diff --git a/WebsitePanel/Lib/References/Microsoft/Microsoft.Rtc.Management.Hosted.dll b/WebsitePanel/Lib/References/Microsoft/Microsoft.Rtc.Management.Hosted.dll new file mode 100644 index 00000000..fb643522 Binary files /dev/null and b/WebsitePanel/Lib/References/Microsoft/Microsoft.Rtc.Management.Hosted.dll differ diff --git a/WebsitePanel/Lib/References/Microsoft/Microsoft.Rtc.Management.WritableConfig.dll b/WebsitePanel/Lib/References/Microsoft/Microsoft.Rtc.Management.WritableConfig.dll new file mode 100644 index 00000000..aec9421d Binary files /dev/null and b/WebsitePanel/Lib/References/Microsoft/Microsoft.Rtc.Management.WritableConfig.dll differ diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Common/BusinessErrorCodes.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Common/BusinessErrorCodes.cs index 8cc0a9c6..f709a65b 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Common/BusinessErrorCodes.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Common/BusinessErrorCodes.cs @@ -336,6 +336,10 @@ namespace WebsitePanel.EnterpriseServer public const int ERROR_FILE_MOVE_PATH_ALREADY_EXISTS = -3004; #endregion + #region Lync Server + public const int ERROR_LYNC_DELETE_SOME_PROBLEMS = -2806; + #endregion + public static string ToText(int code) { switch (code) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs index 8a242db2..0915862a 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs @@ -207,7 +207,19 @@ order by rg.groupOrder public const string OCS_PresenceAllowed = "OCS.PresenceAllowed"; public const string OCS_PresenceAllowedByDefault = "OCS.PresenceAllowedByDefault"; - + + + public const string LYNC_USERS = "Lync.Users"; + public const string LYNC_FEDERATION = "Lync.Federation"; + public const string LYNC_CONFERENCING = "Lync.Conferencing"; + public const string LYNC_MAXPARTICIPANTS = "Lync.MaxParticipants"; + public const string LYNC_ALLOWVIDEO = "Lync.AllowVideo"; + public const string LYNC_ENTERPRISEVOICE = "Lync.EnterpriseVoice"; + public const string LYNC_EVUSERS = "Lync.EVUsers"; + public const string LYNC_EVNATIONAL = "Lync.EVNational"; + public const string LYNC_EVMOBILE = "Lync.EVMobile"; + public const string LYNC_EVINTERNATIONAL = "Lync.EVInternational"; + } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Servers/ResourceGroups.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Servers/ResourceGroups.cs index c9ad1502..e1a569e1 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Servers/ResourceGroups.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Servers/ResourceGroups.cs @@ -51,5 +51,6 @@ namespace WebsitePanel.EnterpriseServer public const string BlackBerry = "BlackBerry"; public const string OCS = "OCS"; public const string VPSForPC = "VPSForPC"; + public const string Lync = "Lync"; } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/LyncProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/LyncProxy.cs new file mode 100644 index 00000000..f564e385 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/LyncProxy.cs @@ -0,0 +1,1103 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.5456 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +// +// This source code was auto-generated by wsdl, Version=2.0.50727.42. +// +namespace WebsitePanel.EnterpriseServer { + using System.Xml.Serialization; + using System.Web.Services; + using System.ComponentModel; + using System.Web.Services.Protocols; + using System; + using System.Diagnostics; + + using WebsitePanel.Providers.Common; + using WebsitePanel.Providers.HostedSolution; + using WebsitePanel.Providers.ResultObjects; + + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name="esLyncSoap", Namespace="http://tempuri.org/")] + public partial class esLync : Microsoft.Web.Services3.WebServicesClientProtocol { + + private System.Threading.SendOrPostCallback CreateLyncUserOperationCompleted; + + private System.Threading.SendOrPostCallback DeleteLyncUserOperationCompleted; + + private System.Threading.SendOrPostCallback GetLyncUsersPagedOperationCompleted; + + private System.Threading.SendOrPostCallback GetLyncUserCountOperationCompleted; + + private System.Threading.SendOrPostCallback GetLyncUserPlansOperationCompleted; + + private System.Threading.SendOrPostCallback GetLyncUserPlanOperationCompleted; + + private System.Threading.SendOrPostCallback AddLyncUserPlanOperationCompleted; + + private System.Threading.SendOrPostCallback DeleteLyncUserPlanOperationCompleted; + + private System.Threading.SendOrPostCallback SetOrganizationDefaultLyncUserPlanOperationCompleted; + + private System.Threading.SendOrPostCallback GetLyncUserGeneralSettingsOperationCompleted; + + private System.Threading.SendOrPostCallback SetUserLyncPlanOperationCompleted; + + private System.Threading.SendOrPostCallback GetFederationDomainsOperationCompleted; + + private System.Threading.SendOrPostCallback AddFederationDomainOperationCompleted; + + private System.Threading.SendOrPostCallback RemoveFederationDomainOperationCompleted; + + /// + public esLync() { + this.Url = "http://localhost:9005/esLync.asmx"; + } + + /// + public event CreateLyncUserCompletedEventHandler CreateLyncUserCompleted; + + /// + public event DeleteLyncUserCompletedEventHandler DeleteLyncUserCompleted; + + /// + public event GetLyncUsersPagedCompletedEventHandler GetLyncUsersPagedCompleted; + + /// + public event GetLyncUserCountCompletedEventHandler GetLyncUserCountCompleted; + + /// + public event GetLyncUserPlansCompletedEventHandler GetLyncUserPlansCompleted; + + /// + public event GetLyncUserPlanCompletedEventHandler GetLyncUserPlanCompleted; + + /// + public event AddLyncUserPlanCompletedEventHandler AddLyncUserPlanCompleted; + + /// + public event DeleteLyncUserPlanCompletedEventHandler DeleteLyncUserPlanCompleted; + + /// + public event SetOrganizationDefaultLyncUserPlanCompletedEventHandler SetOrganizationDefaultLyncUserPlanCompleted; + + /// + public event GetLyncUserGeneralSettingsCompletedEventHandler GetLyncUserGeneralSettingsCompleted; + + /// + public event SetUserLyncPlanCompletedEventHandler SetUserLyncPlanCompleted; + + /// + public event GetFederationDomainsCompletedEventHandler GetFederationDomainsCompleted; + + /// + public event AddFederationDomainCompletedEventHandler AddFederationDomainCompleted; + + /// + public event RemoveFederationDomainCompletedEventHandler RemoveFederationDomainCompleted; + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CreateLyncUser", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public LyncUserResult CreateLyncUser(int itemId, int accountId, int lyncUserPlanId) { + object[] results = this.Invoke("CreateLyncUser", new object[] { + itemId, + accountId, + lyncUserPlanId}); + return ((LyncUserResult)(results[0])); + } + + /// + public System.IAsyncResult BeginCreateLyncUser(int itemId, int accountId, int lyncUserPlanId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("CreateLyncUser", new object[] { + itemId, + accountId, + lyncUserPlanId}, callback, asyncState); + } + + /// + public LyncUserResult EndCreateLyncUser(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((LyncUserResult)(results[0])); + } + + /// + public void CreateLyncUserAsync(int itemId, int accountId, int lyncUserPlanId) { + this.CreateLyncUserAsync(itemId, accountId, lyncUserPlanId, null); + } + + /// + public void CreateLyncUserAsync(int itemId, int accountId, int lyncUserPlanId, object userState) { + if ((this.CreateLyncUserOperationCompleted == null)) { + this.CreateLyncUserOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateLyncUserOperationCompleted); + } + this.InvokeAsync("CreateLyncUser", new object[] { + itemId, + accountId, + lyncUserPlanId}, this.CreateLyncUserOperationCompleted, userState); + } + + private void OnCreateLyncUserOperationCompleted(object arg) { + if ((this.CreateLyncUserCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.CreateLyncUserCompleted(this, new CreateLyncUserCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteLyncUser", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ResultObject DeleteLyncUser(int itemId, int accountId) { + object[] results = this.Invoke("DeleteLyncUser", new object[] { + itemId, + accountId}); + return ((ResultObject)(results[0])); + } + + /// + public System.IAsyncResult BeginDeleteLyncUser(int itemId, int accountId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("DeleteLyncUser", new object[] { + itemId, + accountId}, callback, asyncState); + } + + /// + public ResultObject EndDeleteLyncUser(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ResultObject)(results[0])); + } + + /// + public void DeleteLyncUserAsync(int itemId, int accountId) { + this.DeleteLyncUserAsync(itemId, accountId, null); + } + + /// + public void DeleteLyncUserAsync(int itemId, int accountId, object userState) { + if ((this.DeleteLyncUserOperationCompleted == null)) { + this.DeleteLyncUserOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteLyncUserOperationCompleted); + } + this.InvokeAsync("DeleteLyncUser", new object[] { + itemId, + accountId}, this.DeleteLyncUserOperationCompleted, userState); + } + + private void OnDeleteLyncUserOperationCompleted(object arg) { + if ((this.DeleteLyncUserCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.DeleteLyncUserCompleted(this, new DeleteLyncUserCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetLyncUsersPaged", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public LyncUsersPagedResult GetLyncUsersPaged(int itemId, string sortColumn, string sortDirection, int startRow, int maximumRows) { + object[] results = this.Invoke("GetLyncUsersPaged", new object[] { + itemId, + sortColumn, + sortDirection, + startRow, + maximumRows}); + return ((LyncUsersPagedResult)(results[0])); + } + + /// + public System.IAsyncResult BeginGetLyncUsersPaged(int itemId, string sortColumn, string sortDirection, int startRow, int maximumRows, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetLyncUsersPaged", new object[] { + itemId, + sortColumn, + sortDirection, + startRow, + maximumRows}, callback, asyncState); + } + + /// + public LyncUsersPagedResult EndGetLyncUsersPaged(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((LyncUsersPagedResult)(results[0])); + } + + /// + public void GetLyncUsersPagedAsync(int itemId, string sortColumn, string sortDirection, int startRow, int maximumRows) { + this.GetLyncUsersPagedAsync(itemId, sortColumn, sortDirection, startRow, maximumRows, null); + } + + /// + public void GetLyncUsersPagedAsync(int itemId, string sortColumn, string sortDirection, int startRow, int maximumRows, object userState) { + if ((this.GetLyncUsersPagedOperationCompleted == null)) { + this.GetLyncUsersPagedOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetLyncUsersPagedOperationCompleted); + } + this.InvokeAsync("GetLyncUsersPaged", new object[] { + itemId, + sortColumn, + sortDirection, + startRow, + maximumRows}, this.GetLyncUsersPagedOperationCompleted, userState); + } + + private void OnGetLyncUsersPagedOperationCompleted(object arg) { + if ((this.GetLyncUsersPagedCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetLyncUsersPagedCompleted(this, new GetLyncUsersPagedCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetLyncUserCount", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public IntResult GetLyncUserCount(int itemId) { + object[] results = this.Invoke("GetLyncUserCount", new object[] { + itemId}); + return ((IntResult)(results[0])); + } + + /// + public System.IAsyncResult BeginGetLyncUserCount(int itemId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetLyncUserCount", new object[] { + itemId}, callback, asyncState); + } + + /// + public IntResult EndGetLyncUserCount(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((IntResult)(results[0])); + } + + /// + public void GetLyncUserCountAsync(int itemId) { + this.GetLyncUserCountAsync(itemId, null); + } + + /// + public void GetLyncUserCountAsync(int itemId, object userState) { + if ((this.GetLyncUserCountOperationCompleted == null)) { + this.GetLyncUserCountOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetLyncUserCountOperationCompleted); + } + this.InvokeAsync("GetLyncUserCount", new object[] { + itemId}, this.GetLyncUserCountOperationCompleted, userState); + } + + private void OnGetLyncUserCountOperationCompleted(object arg) { + if ((this.GetLyncUserCountCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetLyncUserCountCompleted(this, new GetLyncUserCountCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetLyncUserPlans", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public LyncUserPlan[] GetLyncUserPlans(int itemId) { + object[] results = this.Invoke("GetLyncUserPlans", new object[] { + itemId}); + return ((LyncUserPlan[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetLyncUserPlans(int itemId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetLyncUserPlans", new object[] { + itemId}, callback, asyncState); + } + + /// + public LyncUserPlan[] EndGetLyncUserPlans(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((LyncUserPlan[])(results[0])); + } + + /// + public void GetLyncUserPlansAsync(int itemId) { + this.GetLyncUserPlansAsync(itemId, null); + } + + /// + public void GetLyncUserPlansAsync(int itemId, object userState) { + if ((this.GetLyncUserPlansOperationCompleted == null)) { + this.GetLyncUserPlansOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetLyncUserPlansOperationCompleted); + } + this.InvokeAsync("GetLyncUserPlans", new object[] { + itemId}, this.GetLyncUserPlansOperationCompleted, userState); + } + + private void OnGetLyncUserPlansOperationCompleted(object arg) { + if ((this.GetLyncUserPlansCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetLyncUserPlansCompleted(this, new GetLyncUserPlansCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetLyncUserPlan", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public LyncUserPlan GetLyncUserPlan(int itemId, int lyncUserPlanId) { + object[] results = this.Invoke("GetLyncUserPlan", new object[] { + itemId, + lyncUserPlanId}); + return ((LyncUserPlan)(results[0])); + } + + /// + public System.IAsyncResult BeginGetLyncUserPlan(int itemId, int lyncUserPlanId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetLyncUserPlan", new object[] { + itemId, + lyncUserPlanId}, callback, asyncState); + } + + /// + public LyncUserPlan EndGetLyncUserPlan(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((LyncUserPlan)(results[0])); + } + + /// + public void GetLyncUserPlanAsync(int itemId, int lyncUserPlanId) { + this.GetLyncUserPlanAsync(itemId, lyncUserPlanId, null); + } + + /// + public void GetLyncUserPlanAsync(int itemId, int lyncUserPlanId, object userState) { + if ((this.GetLyncUserPlanOperationCompleted == null)) { + this.GetLyncUserPlanOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetLyncUserPlanOperationCompleted); + } + this.InvokeAsync("GetLyncUserPlan", new object[] { + itemId, + lyncUserPlanId}, this.GetLyncUserPlanOperationCompleted, userState); + } + + private void OnGetLyncUserPlanOperationCompleted(object arg) { + if ((this.GetLyncUserPlanCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetLyncUserPlanCompleted(this, new GetLyncUserPlanCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/AddLyncUserPlan", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int AddLyncUserPlan(int itemId, LyncUserPlan lyncUserPlan) { + object[] results = this.Invoke("AddLyncUserPlan", new object[] { + itemId, + lyncUserPlan}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginAddLyncUserPlan(int itemId, LyncUserPlan lyncUserPlan, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("AddLyncUserPlan", new object[] { + itemId, + lyncUserPlan}, callback, asyncState); + } + + /// + public int EndAddLyncUserPlan(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void AddLyncUserPlanAsync(int itemId, LyncUserPlan lyncUserPlan) { + this.AddLyncUserPlanAsync(itemId, lyncUserPlan, null); + } + + /// + public void AddLyncUserPlanAsync(int itemId, LyncUserPlan lyncUserPlan, object userState) { + if ((this.AddLyncUserPlanOperationCompleted == null)) { + this.AddLyncUserPlanOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddLyncUserPlanOperationCompleted); + } + this.InvokeAsync("AddLyncUserPlan", new object[] { + itemId, + lyncUserPlan}, this.AddLyncUserPlanOperationCompleted, userState); + } + + private void OnAddLyncUserPlanOperationCompleted(object arg) { + if ((this.AddLyncUserPlanCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.AddLyncUserPlanCompleted(this, new AddLyncUserPlanCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteLyncUserPlan", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int DeleteLyncUserPlan(int itemId, int lyncUserPlanId) { + object[] results = this.Invoke("DeleteLyncUserPlan", new object[] { + itemId, + lyncUserPlanId}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginDeleteLyncUserPlan(int itemId, int lyncUserPlanId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("DeleteLyncUserPlan", new object[] { + itemId, + lyncUserPlanId}, callback, asyncState); + } + + /// + public int EndDeleteLyncUserPlan(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void DeleteLyncUserPlanAsync(int itemId, int lyncUserPlanId) { + this.DeleteLyncUserPlanAsync(itemId, lyncUserPlanId, null); + } + + /// + public void DeleteLyncUserPlanAsync(int itemId, int lyncUserPlanId, object userState) { + if ((this.DeleteLyncUserPlanOperationCompleted == null)) { + this.DeleteLyncUserPlanOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteLyncUserPlanOperationCompleted); + } + this.InvokeAsync("DeleteLyncUserPlan", new object[] { + itemId, + lyncUserPlanId}, this.DeleteLyncUserPlanOperationCompleted, userState); + } + + private void OnDeleteLyncUserPlanOperationCompleted(object arg) { + if ((this.DeleteLyncUserPlanCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.DeleteLyncUserPlanCompleted(this, new DeleteLyncUserPlanCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SetOrganizationDefaultLyncUserPlan", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int SetOrganizationDefaultLyncUserPlan(int itemId, int lyncUserPlanId) { + object[] results = this.Invoke("SetOrganizationDefaultLyncUserPlan", new object[] { + itemId, + lyncUserPlanId}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginSetOrganizationDefaultLyncUserPlan(int itemId, int lyncUserPlanId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("SetOrganizationDefaultLyncUserPlan", new object[] { + itemId, + lyncUserPlanId}, callback, asyncState); + } + + /// + public int EndSetOrganizationDefaultLyncUserPlan(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void SetOrganizationDefaultLyncUserPlanAsync(int itemId, int lyncUserPlanId) { + this.SetOrganizationDefaultLyncUserPlanAsync(itemId, lyncUserPlanId, null); + } + + /// + public void SetOrganizationDefaultLyncUserPlanAsync(int itemId, int lyncUserPlanId, object userState) { + if ((this.SetOrganizationDefaultLyncUserPlanOperationCompleted == null)) { + this.SetOrganizationDefaultLyncUserPlanOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetOrganizationDefaultLyncUserPlanOperationCompleted); + } + this.InvokeAsync("SetOrganizationDefaultLyncUserPlan", new object[] { + itemId, + lyncUserPlanId}, this.SetOrganizationDefaultLyncUserPlanOperationCompleted, userState); + } + + private void OnSetOrganizationDefaultLyncUserPlanOperationCompleted(object arg) { + if ((this.SetOrganizationDefaultLyncUserPlanCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.SetOrganizationDefaultLyncUserPlanCompleted(this, new SetOrganizationDefaultLyncUserPlanCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetLyncUserGeneralSettings", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public LyncUser GetLyncUserGeneralSettings(int itemId, int accountId) { + object[] results = this.Invoke("GetLyncUserGeneralSettings", new object[] { + itemId, + accountId}); + return ((LyncUser)(results[0])); + } + + /// + public System.IAsyncResult BeginGetLyncUserGeneralSettings(int itemId, int accountId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetLyncUserGeneralSettings", new object[] { + itemId, + accountId}, callback, asyncState); + } + + /// + public LyncUser EndGetLyncUserGeneralSettings(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((LyncUser)(results[0])); + } + + /// + public void GetLyncUserGeneralSettingsAsync(int itemId, int accountId) { + this.GetLyncUserGeneralSettingsAsync(itemId, accountId, null); + } + + /// + public void GetLyncUserGeneralSettingsAsync(int itemId, int accountId, object userState) { + if ((this.GetLyncUserGeneralSettingsOperationCompleted == null)) { + this.GetLyncUserGeneralSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetLyncUserGeneralSettingsOperationCompleted); + } + this.InvokeAsync("GetLyncUserGeneralSettings", new object[] { + itemId, + accountId}, this.GetLyncUserGeneralSettingsOperationCompleted, userState); + } + + 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.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) { + object[] results = this.Invoke("SetUserLyncPlan", new object[] { + itemId, + accountId, + lyncUserPlanId}); + return ((LyncUserResult)(results[0])); + } + + /// + public System.IAsyncResult BeginSetUserLyncPlan(int itemId, int accountId, int lyncUserPlanId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("SetUserLyncPlan", new object[] { + itemId, + accountId, + lyncUserPlanId}, callback, asyncState); + } + + /// + public LyncUserResult EndSetUserLyncPlan(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((LyncUserResult)(results[0])); + } + + /// + public void SetUserLyncPlanAsync(int itemId, int accountId, int lyncUserPlanId) { + this.SetUserLyncPlanAsync(itemId, accountId, lyncUserPlanId, null); + } + + /// + public void SetUserLyncPlanAsync(int itemId, int accountId, int lyncUserPlanId, object userState) { + if ((this.SetUserLyncPlanOperationCompleted == null)) { + this.SetUserLyncPlanOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetUserLyncPlanOperationCompleted); + } + this.InvokeAsync("SetUserLyncPlan", new object[] { + itemId, + accountId, + lyncUserPlanId}, this.SetUserLyncPlanOperationCompleted, userState); + } + + private void OnSetUserLyncPlanOperationCompleted(object arg) { + if ((this.SetUserLyncPlanCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.SetUserLyncPlanCompleted(this, new SetUserLyncPlanCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetFederationDomains", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public LyncFederationDomain[] GetFederationDomains(int itemId) { + object[] results = this.Invoke("GetFederationDomains", new object[] { + itemId}); + return ((LyncFederationDomain[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetFederationDomains(int itemId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetFederationDomains", new object[] { + itemId}, callback, asyncState); + } + + /// + public LyncFederationDomain[] EndGetFederationDomains(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((LyncFederationDomain[])(results[0])); + } + + /// + public void GetFederationDomainsAsync(int itemId) { + this.GetFederationDomainsAsync(itemId, null); + } + + /// + public void GetFederationDomainsAsync(int itemId, object userState) { + if ((this.GetFederationDomainsOperationCompleted == null)) { + this.GetFederationDomainsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetFederationDomainsOperationCompleted); + } + this.InvokeAsync("GetFederationDomains", new object[] { + itemId}, this.GetFederationDomainsOperationCompleted, userState); + } + + 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.SoapDocumentMethodAttribute("http://tempuri.org/AddFederationDomain", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public LyncUserResult AddFederationDomain(int itemId, string domainName, string proxyFqdn) { + object[] results = this.Invoke("AddFederationDomain", new object[] { + itemId, + domainName, + proxyFqdn}); + return ((LyncUserResult)(results[0])); + } + + /// + public System.IAsyncResult BeginAddFederationDomain(int itemId, string domainName, string proxyFqdn, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("AddFederationDomain", new object[] { + itemId, + domainName, + proxyFqdn}, callback, asyncState); + } + + /// + public LyncUserResult EndAddFederationDomain(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((LyncUserResult)(results[0])); + } + + /// + public void AddFederationDomainAsync(int itemId, string domainName, string proxyFqdn) { + this.AddFederationDomainAsync(itemId, domainName, proxyFqdn, null); + } + + /// + public void AddFederationDomainAsync(int itemId, string domainName, string proxyFqdn, object userState) { + if ((this.AddFederationDomainOperationCompleted == null)) { + this.AddFederationDomainOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddFederationDomainOperationCompleted); + } + this.InvokeAsync("AddFederationDomain", new object[] { + itemId, + domainName, + proxyFqdn}, this.AddFederationDomainOperationCompleted, userState); + } + + 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.SoapDocumentMethodAttribute("http://tempuri.org/RemoveFederationDomain", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public LyncUserResult RemoveFederationDomain(int itemId, string domainName) { + object[] results = this.Invoke("RemoveFederationDomain", new object[] { + itemId, + domainName}); + return ((LyncUserResult)(results[0])); + } + + /// + public System.IAsyncResult BeginRemoveFederationDomain(int itemId, string domainName, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("RemoveFederationDomain", new object[] { + itemId, + domainName}, callback, asyncState); + } + + /// + public LyncUserResult EndRemoveFederationDomain(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((LyncUserResult)(results[0])); + } + + /// + public void RemoveFederationDomainAsync(int itemId, string domainName) { + this.RemoveFederationDomainAsync(itemId, domainName, null); + } + + /// + public void RemoveFederationDomainAsync(int itemId, string domainName, object userState) { + if ((this.RemoveFederationDomainOperationCompleted == null)) { + this.RemoveFederationDomainOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRemoveFederationDomainOperationCompleted); + } + this.InvokeAsync("RemoveFederationDomain", new object[] { + itemId, + domainName}, this.RemoveFederationDomainOperationCompleted, userState); + } + + 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)); + } + } + + /// + public new void CancelAsync(object userState) { + base.CancelAsync(userState); + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void CreateLyncUserCompletedEventHandler(object sender, CreateLyncUserCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class CreateLyncUserCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal CreateLyncUserCompletedEventArgs(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.42")] + public delegate void DeleteLyncUserCompletedEventHandler(object sender, DeleteLyncUserCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class DeleteLyncUserCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal DeleteLyncUserCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ResultObject Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ResultObject)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetLyncUsersPagedCompletedEventHandler(object sender, GetLyncUsersPagedCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetLyncUsersPagedCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetLyncUsersPagedCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public LyncUsersPagedResult Result { + get { + this.RaiseExceptionIfNecessary(); + return ((LyncUsersPagedResult)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetLyncUserCountCompletedEventHandler(object sender, GetLyncUserCountCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetLyncUserCountCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetLyncUserCountCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public IntResult Result { + get { + this.RaiseExceptionIfNecessary(); + return ((IntResult)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetLyncUserPlansCompletedEventHandler(object sender, GetLyncUserPlansCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetLyncUserPlansCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetLyncUserPlansCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public LyncUserPlan[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((LyncUserPlan[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetLyncUserPlanCompletedEventHandler(object sender, GetLyncUserPlanCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetLyncUserPlanCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetLyncUserPlanCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public LyncUserPlan Result { + get { + this.RaiseExceptionIfNecessary(); + return ((LyncUserPlan)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void AddLyncUserPlanCompletedEventHandler(object sender, AddLyncUserPlanCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class AddLyncUserPlanCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal AddLyncUserPlanCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public int Result { + get { + this.RaiseExceptionIfNecessary(); + return ((int)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void DeleteLyncUserPlanCompletedEventHandler(object sender, DeleteLyncUserPlanCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class DeleteLyncUserPlanCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal DeleteLyncUserPlanCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public int Result { + get { + this.RaiseExceptionIfNecessary(); + return ((int)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void SetOrganizationDefaultLyncUserPlanCompletedEventHandler(object sender, SetOrganizationDefaultLyncUserPlanCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class SetOrganizationDefaultLyncUserPlanCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal SetOrganizationDefaultLyncUserPlanCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public int Result { + get { + this.RaiseExceptionIfNecessary(); + return ((int)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetLyncUserGeneralSettingsCompletedEventHandler(object sender, GetLyncUserGeneralSettingsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + 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) { + this.results = results; + } + + /// + public LyncUser Result { + get { + this.RaiseExceptionIfNecessary(); + return ((LyncUser)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void SetUserLyncPlanCompletedEventHandler(object sender, SetUserLyncPlanCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class SetUserLyncPlanCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal SetUserLyncPlanCompletedEventArgs(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.42")] + public delegate void GetFederationDomainsCompletedEventHandler(object sender, GetFederationDomainsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + 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) { + this.results = results; + } + + /// + public LyncFederationDomain[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((LyncFederationDomain[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void AddFederationDomainCompletedEventHandler(object sender, AddFederationDomainCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + 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) { + this.results = results; + } + + /// + public LyncUserResult Result { + get { + this.RaiseExceptionIfNecessary(); + return ((LyncUserResult)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void RemoveFederationDomainCompletedEventHandler(object sender, RemoveFederationDomainCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + 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) { + this.results = results; + } + + /// + public LyncUserResult Result { + get { + this.RaiseExceptionIfNecessary(); + return ((LyncUserResult)(this.results[0])); + } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/WebsitePanel.EnterpriseServer.Client.csproj b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/WebsitePanel.EnterpriseServer.Client.csproj index dfd4d020..1390dff3 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/WebsitePanel.EnterpriseServer.Client.csproj +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/WebsitePanel.EnterpriseServer.Client.csproj @@ -87,6 +87,7 @@ code + diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Data/DataProvider.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Data/DataProvider.cs index 714b0165..92a6c70e 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Data/DataProvider.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Data/DataProvider.cs @@ -3140,5 +3140,163 @@ namespace WebsitePanel.EnterpriseServer return Convert.ToBoolean(prmId.Value); } #endregion + + #region Lync + + public static void AddLyncUser(int accountId, int lyncUserPlanId) + { + SqlHelper.ExecuteNonQuery(ConnectionString, + CommandType.StoredProcedure, + "AddLyncUser", + new[] + { + new SqlParameter("@AccountID", accountId), + new SqlParameter("@LyncUserPlanID", lyncUserPlanId) + }); + } + + public static bool CheckLyncUserExists(int accountId) + { + int res = (int)SqlHelper.ExecuteScalar(ConnectionString, CommandType.StoredProcedure, "CheckLyncUserExists", + new SqlParameter("@AccountID", accountId)); + return res > 0; + } + + public static IDataReader GetLyncUsers(int itemId, string sortColumn, string sortDirection, int startRow, int count) + { + SqlParameter[] sqlParams = new SqlParameter[] + { + new SqlParameter("@ItemID", itemId), + new SqlParameter("@SortColumn", sortColumn), + new SqlParameter("@SortDirection", sortDirection), + new SqlParameter("@StartRow", startRow), + new SqlParameter("Count", count) + }; + + + return SqlHelper.ExecuteReader( + ConnectionString, + CommandType.StoredProcedure, + "GetLyncUsers", sqlParams); + } + + public static int GetLyncUsersCount(int itemId) + { + SqlParameter[] sqlParams = new SqlParameter[] + { + new SqlParameter("@ItemID", itemId) + }; + + return + (int) + SqlHelper.ExecuteScalar(ConnectionString, CommandType.StoredProcedure, "GetLyncUsersCount", sqlParams); + } + + public static void DeleteLyncUser(int accountId) + { + SqlHelper.ExecuteNonQuery(ConnectionString, + CommandType.StoredProcedure, + "DeleteLyncUser", + new[] + { + new SqlParameter("@AccountId", accountId) + }); + + } + + public static int AddLyncUserPlan(int itemID, LyncUserPlan lyncUserPlan) + { + SqlParameter outParam = new SqlParameter("@LyncUserPlanId", SqlDbType.Int); + outParam.Direction = ParameterDirection.Output; + + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "AddLyncUserPlan", + outParam, + + new SqlParameter("@ItemID", itemID), + new SqlParameter("@LyncUserPlanName", lyncUserPlan.LyncUserPlanName), + new SqlParameter("@IM", lyncUserPlan.IM), + new SqlParameter("@Mobility", lyncUserPlan.Mobility), + new SqlParameter("@MobilityEnableOutsideVoice", lyncUserPlan.MobilityEnableOutsideVoice), + new SqlParameter("@Federation", lyncUserPlan.Federation), + new SqlParameter("@Conferencing", lyncUserPlan.Conferencing), + new SqlParameter("@EnterpriseVoice", lyncUserPlan.EnterpriseVoice), + new SqlParameter("@VoicePolicy", lyncUserPlan.VoicePolicy), + new SqlParameter("@IsDefault", lyncUserPlan.IsDefault) + ); + + return Convert.ToInt32(outParam.Value); + } + + public static void DeleteLyncUserPlan(int lyncUserPlanId) + { + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "DeleteLyncUserPlan", + new SqlParameter("@LyncUserPlanId", lyncUserPlanId) + ); + } + + public static IDataReader GetLyncUserPlan(int lyncUserPlanId) + { + return SqlHelper.ExecuteReader( + ConnectionString, + CommandType.StoredProcedure, + "GetLyncUserPlan", + new SqlParameter("@LyncUserPlanId", lyncUserPlanId) + ); + } + + + public static IDataReader GetLyncUserPlans(int itemId) + { + return SqlHelper.ExecuteReader( + ConnectionString, + CommandType.StoredProcedure, + "GetLyncUserPlans", + new SqlParameter("@ItemID", itemId) + ); + } + + + public static void SetOrganizationDefaultLyncUserPlan(int itemId, int lyncUserPlanId) + { + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "SetOrganizationDefaultLyncUserPlan", + new SqlParameter("@ItemID", itemId), + new SqlParameter("@LyncUserPlanId", lyncUserPlanId) + ); + } + + public static IDataReader GetLyncUserPlanByAccountId(int AccountId) + { + return SqlHelper.ExecuteReader( + ConnectionString, + CommandType.StoredProcedure, + "GetLyncUserPlanByAccountId", + new SqlParameter("@AccountID", AccountId) + ); + } + + + public static void SetLyncUserLyncUserplan(int accountId, int lyncUserPlanId) + { + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "SetLyncUserLyncUserplan", + new SqlParameter("@AccountID", accountId), + new SqlParameter("@LyncUserPlanId", (lyncUserPlanId == 0) ? (object)DBNull.Value : (object)lyncUserPlanId) + ); + } + + + #endregion + } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/LyncController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/LyncController.cs new file mode 100644 index 00000000..a91d80f8 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/LyncController.cs @@ -0,0 +1,821 @@ +// 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.Collections.Specialized; +using System.Data; +using System.Xml; +using WebsitePanel.Providers; +using WebsitePanel.Providers.Common; +using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.Providers.ResultObjects; +using WebsitePanel.Providers.Lync; + +namespace WebsitePanel.EnterpriseServer.Code.HostedSolution +{ + public class LyncController + { + + + public static LyncServer GetLyncServer(int lyncServiceId, int organizationServiceId) + { + LyncServer ws = new LyncServer(); + + ServiceProviderProxy.Init(ws, lyncServiceId); + + string[] lyncSettings = ws.ServiceProviderSettingsSoapHeaderValue.Settings; + + List resSettings = new List(lyncSettings); + + ExtendLyncSettings(resSettings, "primarydomaincontroller", GetProviderProperty(organizationServiceId, "primarydomaincontroller")); + ExtendLyncSettings(resSettings, "rootou", GetProviderProperty(organizationServiceId, "rootou")); + ws.ServiceProviderSettingsSoapHeaderValue.Settings = resSettings.ToArray(); + return ws; + } + + private static string GetProviderProperty(int organizationServiceId, string property) + { + + Organizations orgProxy = new Organizations(); + + ServiceProviderProxy.Init(orgProxy, organizationServiceId); + + string[] organizationSettings = orgProxy.ServiceProviderSettingsSoapHeaderValue.Settings; + + string value = string.Empty; + foreach (string str in organizationSettings) + { + string[] props = str.Split('='); + if (props[0].ToLower() == property) + { + value = str; + break; + } + } + + return value; + } + + private static void ExtendLyncSettings(List lyncSettings, string property, string value) + { + bool isAdded = false; + for (int i = 0; i < lyncSettings.Count; i++) + { + string[] props = lyncSettings[i].Split('='); + if (props[0].ToLower() == property) + { + lyncSettings[i] = value; + isAdded = true; + break; + } + } + + if (!isAdded) + { + lyncSettings.Add(value); + } + } + + private static int GetLyncServiceID(int packageId) + { + return PackageController.GetPackageServiceId(packageId, ResourceGroups.Lync); + } + + + private static bool CheckQuota(int itemId) + { + Organization org = OrganizationController.GetOrganization(itemId); + PackageContext cntx = PackageController.GetPackageContext(org.PackageId); + + IntResult userCount = GetLyncUsersCount(itemId); + + int allocatedUsers = cntx.Quotas[Quotas.LYNC_USERS].QuotaAllocatedValue; + + return allocatedUsers == -1 || allocatedUsers > userCount.Value; + } + + + public static LyncUserResult CreateLyncUser(int itemId, int accountId, int lyncUserPlanId) + { + LyncUserResult res = TaskManager.StartResultTask("LYNC", "CREATE_LYNC_USER"); + + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.NOT_AUTHORIZED); + return res; + } + + + LyncUser retLyncUser = new LyncUser(); + bool isLyncUser; + + isLyncUser = DataProvider.CheckLyncUserExists(accountId); + if (isLyncUser) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.USER_IS_ALREADY_LYNC_USER); + return res; + } + + OrganizationUser user; + user = OrganizationController.GetAccount(itemId, accountId); + if (user == null) + { + TaskManager.CompleteResultTask(res, ErrorCodes.CANNOT_GET_ACCOUNT); + return res; + } + + user = OrganizationController.GetUserGeneralSettings(itemId, accountId); + if (string.IsNullOrEmpty(user.FirstName)) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.USER_FIRST_NAME_IS_NOT_SPECIFIED); + return res; + } + + if (string.IsNullOrEmpty(user.LastName)) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.USER_LAST_NAME_IS_NOT_SPECIFIED); + return res; + } + + bool quota = CheckQuota(itemId); + if (!quota) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.USER_QUOTA_HAS_BEEN_REACHED); + return res; + } + + + LyncServer lync; + + try + { + + bool bReloadConfiguration = false; + + 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); + lync = GetLyncServer(lyncServiceId, org.ServiceId); + + if (string.IsNullOrEmpty(org.LyncTenantId)) + { + PackageContext cntx = PackageController.GetPackageContext(org.PackageId); + + org.LyncTenantId = lync.CreateOrganization(org.OrganizationId, + org.DefaultDomain, + Convert.ToBoolean(cntx.Quotas[Quotas.LYNC_CONFERENCING].QuotaAllocatedValue), + Convert.ToBoolean(cntx.Quotas[Quotas.LYNC_ALLOWVIDEO].QuotaAllocatedValue), + Convert.ToInt32(cntx.Quotas[Quotas.LYNC_MAXPARTICIPANTS].QuotaAllocatedValue), + Convert.ToBoolean(cntx.Quotas[Quotas.LYNC_CONFERENCING].QuotaAllocatedValue), + Convert.ToBoolean(cntx.Quotas[Quotas.LYNC_CONFERENCING].QuotaAllocatedValue)); + + if (string.IsNullOrEmpty(org.LyncTenantId)) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.CANNOT_ENABLE_ORG); + return res; + } + else + { + PackageController.UpdatePackageItem(org); + + bReloadConfiguration = true; + } + } + + LyncUserPlan plan = GetLyncUserPlan(itemId, lyncUserPlanId); + + if (!lync.CreateUser(org.OrganizationId, user.PrimaryEmailAddress, plan)) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.CANNOT_ADD_LYNC_USER); + return res; + } + + if (bReloadConfiguration) + { + LyncControllerAsync userWorker = new LyncControllerAsync(); + userWorker.LyncServiceId = lyncServiceId; + userWorker.OrganizationServiceId = org.ServiceId; + userWorker.Enable_CsComputerAsync(); + } + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.CANNOT_ADD_LYNC_USER, ex); + return res; + } + + try + { + DataProvider.AddLyncUser(accountId, lyncUserPlanId); + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.CANNOT_ADD_LYNC_USER_TO_DATABASE, ex); + return res; + } + + res.IsSuccess = true; + TaskManager.CompleteResultTask(); + return res; + + } + + + private static int[] ParseMultiSetting(int lyncServiceId, string settingName) + { + List retIds = new List(); + StringDictionary settings = ServerController.GetServiceSettings(lyncServiceId); + if (!String.IsNullOrEmpty(settings[settingName])) + { + string[] ids = settings[settingName].Split(','); + + int res; + foreach (string id in ids) + { + if (int.TryParse(id, out res)) + retIds.Add(res); + } + } + + if (retIds.Count == 0) + retIds.Add(lyncServiceId); + + return retIds.ToArray(); + + } + + + public static void GetLyncServices(int lyncServiceId, out int[] lyncServiceIds) + { + lyncServiceIds = ParseMultiSetting(lyncServiceId, "LyncServersServiceID"); + } + + + + public static LyncUser GetLyncUserGeneralSettings(int itemId, int accountId) + { + TaskManager.StartTask("LYNC", "GET_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.PrimaryEmailAddress); + + if (user != null) + { + LyncUserPlan plan = ObjectUtils.FillObjectFromDataReader(DataProvider.GetLyncUserPlanByAccountId(accountId)); + + if (plan != null) + { + user.LyncUserPlanId = plan.LyncUserPlanId; + user.LyncUserPlanName = plan.LyncUserPlanName; + } + } + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + + } + TaskManager.CompleteTask(); + return user; + + } + + public static int DeleteOrganization(int itemId) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; + + // place log record + TaskManager.StartTask("LYNC", "DELETE_ORG"); + TaskManager.ItemId = itemId; + + try + { + // delete organization in Exchange + //System.Threading.Thread.Sleep(5000); + Organization org = (Organization)PackageController.GetPackageItem(itemId); + + int lyncServiceId = GetLyncServiceID(org.PackageId); + LyncServer lync = GetLyncServer(lyncServiceId, org.ServiceId); + + bool successful = lync.DeleteOrganization(org.OrganizationId, org.DefaultDomain); + + return successful ? 0 : BusinessErrorCodes.ERROR_LYNC_DELETE_SOME_PROBLEMS; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + + public static LyncUserResult SetUserLyncPlan(int itemId, int accountId, int lyncUserPlanId) + { + LyncUserResult res = TaskManager.StartResultTask("LYNC", "SET_LYNC_USER_LYNCPLAN"); + + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.NOT_AUTHORIZED); + return res; + } + + 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); + + LyncUserPlan plan = GetLyncUserPlan(itemId, lyncUserPlanId); + + OrganizationUser user; + user = OrganizationController.GetAccount(itemId, accountId); + + if (!lync.SetLyncUserPlan(org.OrganizationId, user.PrimaryEmailAddress, plan)) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.CANNOT_ADD_LYNC_USER); + return res; + } + + try + { + DataProvider.SetLyncUserLyncUserplan(accountId, lyncUserPlanId); + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.CANNOT_ADD_LYNC_USER_TO_DATABASE, ex); + return res; + } + + res.IsSuccess = true; + TaskManager.CompleteResultTask(); + return res; + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.CANNOT_UPDATE_LYNC_USER, ex); + return res; + } + + } + + public static LyncUsersPagedResult GetLyncUsers(int itemId, string sortColumn, string sortDirection, int startRow, int count) + { + LyncUsersPagedResult res = TaskManager.StartResultTask("LYNC", "GET_LYNC_USERS"); + + try + { + IDataReader reader = + DataProvider.GetLyncUsers(itemId, sortColumn, sortDirection, startRow, count); + List accounts = new List(); + ObjectUtils.FillCollectionFromDataReader(accounts, reader); + res.Value = new LyncUsersPaged { PageUsers = accounts.ToArray() }; + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.GET_LYNC_USERS, ex); + return res; + } + + IntResult intRes = GetLyncUsersCount(itemId); + res.ErrorCodes.AddRange(intRes.ErrorCodes); + if (!intRes.IsSuccess) + { + TaskManager.CompleteResultTask(res); + return res; + } + res.Value.RecordsCount = intRes.Value; + + TaskManager.CompleteResultTask(); + return res; + } + + public static IntResult GetLyncUsersCount(int itemId) + { + IntResult res = TaskManager.StartResultTask("LYNC", "GET_LYNC_USERS_COUNT"); + try + { + res.Value = DataProvider.GetLyncUsersCount(itemId); + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.GET_LYNC_USER_COUNT, ex); + return res; + } + + TaskManager.CompleteResultTask(); + return res; + } + + public static LyncUserResult DeleteLyncUser(int itemId, int accountId) + { + LyncUserResult res = TaskManager.StartResultTask("LYNC", "DELETE_LYNC_USER"); + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + + if (accountCheck < 0) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.NOT_AUTHORIZED); + return res; + } + + LyncServer lync; + + 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); + lync = GetLyncServer(lyncServiceId, org.ServiceId); + + OrganizationUser user; + user = OrganizationController.GetAccount(itemId, accountId); + + if (user != null) + lync.DeleteUser(user.PrimaryEmailAddress); + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.CANNOT_DELETE_LYNC_USER, ex); + return res; + } + + try + { + DataProvider.DeleteLyncUser(accountId); + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.CANNOT_DELETE_LYNC_USER_FROM_METADATA, ex); + return res; + } + + TaskManager.CompleteResultTask(); + return res; + } + + + public static Organization GetOrganization(int itemId) + { + return (Organization)PackageController.GetPackageItem(itemId); + } + + + #region Lync Plans + public static List GetLyncUserPlans(int itemId) + { + // place log record + TaskManager.StartTask("LYNC", "GET_LYNC_LYNCUSERPLANS"); + TaskManager.ItemId = itemId; + + try + { + return ObjectUtils.CreateListFromDataReader( + DataProvider.GetLyncUserPlans(itemId)); + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + public static LyncUserPlan GetLyncUserPlan(int itemID, int lyncUserPlanId) + { + + // place log record + TaskManager.StartTask("LYNC", "GET_LYNC_LYNCUSERPLAN"); + TaskManager.ItemId = lyncUserPlanId; + + try + { + return ObjectUtils.FillObjectFromDataReader( + DataProvider.GetLyncUserPlan(lyncUserPlanId)); + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + public static int AddLyncUserPlan(int itemID, LyncUserPlan lyncUserPlan) + { + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; + + // place log record + TaskManager.StartTask("LYNC", "ADD_LYNC_LYNCUSERPLAN"); + TaskManager.ItemId = itemID; + + try + { + Organization org = GetOrganization(itemID); + if (org == null) + return -1; + + // load package context + PackageContext cntx = PackageController.GetPackageContext(org.PackageId); + + lyncUserPlan.Conferencing = lyncUserPlan.Conferencing & Convert.ToBoolean(cntx.Quotas[Quotas.LYNC_CONFERENCING].QuotaAllocatedValue); + lyncUserPlan.EnterpriseVoice = lyncUserPlan.EnterpriseVoice & Convert.ToBoolean(cntx.Quotas[Quotas.LYNC_ENTERPRISEVOICE].QuotaAllocatedValue); + if (!lyncUserPlan.EnterpriseVoice) + lyncUserPlan.VoicePolicy = LyncVoicePolicyType.None; + lyncUserPlan.IM = true; + + return DataProvider.AddLyncUserPlan(itemID, lyncUserPlan); + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + + } + + public static int DeleteLyncUserPlan(int itemID, int lyncUserPlanId) + { + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; + + TaskManager.StartTask("LYNC", "DELETE_LYNC_LYNCPLAN"); + TaskManager.ItemId = itemID; + + try + { + DataProvider.DeleteLyncUserPlan(lyncUserPlanId); + + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + + } + + public static int SetOrganizationDefaultLyncUserPlan(int itemId, int lyncUserPlanId) + { + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; + + TaskManager.StartTask("LYNC", "SET_LYNC_LYNCUSERPLAN"); + TaskManager.ItemId = itemId; + + try + { + DataProvider.SetOrganizationDefaultLyncUserPlan(itemId, lyncUserPlanId); + + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + + return 1; + + } + + #endregion + + #region Federation Domains + public static LyncFederationDomain[] GetFederationDomains(int itemId) + { + // place log record + TaskManager.StartTask("LYNC", "GET_LYNC_FEDERATIONDOMAINS"); + TaskManager.ItemId = itemId; + + LyncFederationDomain[] lyncFederationDomains = null; + + try + { + Organization org = (Organization)PackageController.GetPackageItem(itemId); + + int lyncServiceId = GetLyncServiceID(org.PackageId); + LyncServer lync = GetLyncServer(lyncServiceId, org.ServiceId); + + lyncFederationDomains = lync.GetFederationDomains(org.OrganizationId); + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + + return lyncFederationDomains; + } + + public static LyncUserResult AddFederationDomain(int itemId, string domainName, string proxyFqdn) + { + LyncUserResult res = TaskManager.StartResultTask("LYNC", "ADD_LYNC_FEDERATIONDOMAIN"); + TaskManager.ItemId = itemId; + TaskManager.TaskParameters["domainName"] = domainName; + TaskManager.TaskParameters["proxyFqdn"] = proxyFqdn; + + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + + if (accountCheck < 0) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.NOT_AUTHORIZED); + return res; + } + + + 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); + + if (string.IsNullOrEmpty(org.LyncTenantId)) + { + PackageContext cntx = PackageController.GetPackageContext(org.PackageId); + + org.LyncTenantId = lync.CreateOrganization(org.OrganizationId, + org.DefaultDomain, + Convert.ToBoolean(cntx.Quotas[Quotas.LYNC_CONFERENCING].QuotaAllocatedValue), + Convert.ToBoolean(cntx.Quotas[Quotas.LYNC_ALLOWVIDEO].QuotaAllocatedValue), + Convert.ToInt32(cntx.Quotas[Quotas.LYNC_MAXPARTICIPANTS].QuotaAllocatedValue), + Convert.ToBoolean(cntx.Quotas[Quotas.LYNC_CONFERENCING].QuotaAllocatedValue), + Convert.ToBoolean(cntx.Quotas[Quotas.LYNC_CONFERENCING].QuotaAllocatedValue)); + + if (string.IsNullOrEmpty(org.LyncTenantId)) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.CANNOT_ENABLE_ORG); + return res; + } + else + PackageController.UpdatePackageItem(org); + } + + lync = GetLyncServer(lyncServiceId, org.ServiceId); + + lync.AddFederationDomain(org.OrganizationId, domainName, proxyFqdn); + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.CANNOT_ADD_LYNC_FEDERATIONDOMAIN, ex); + return res; + } + + TaskManager.CompleteResultTask(); + return res; + } + + public static LyncUserResult RemoveFederationDomain(int itemId, string domainName) + { + LyncUserResult res = TaskManager.StartResultTask("LYNC", "REMOVE_LYNC_FEDERATIONDOMAIN"); + TaskManager.ItemId = itemId; + TaskManager.TaskParameters["domainName"] = domainName; + + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + + if (accountCheck < 0) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.NOT_AUTHORIZED); + return res; + } + + 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); + + if (org.OrganizationId.ToLower() == domainName.ToLower()) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.CANNOT_REMOVE_LYNC_FEDERATIONDOMAIN); + return res; + } + + lync.RemoveFederationDomain(org.OrganizationId, domainName); + } + catch (Exception ex) + { + TaskManager.CompleteResultTask(res, LyncErrorCodes.CANNOT_REMOVE_LYNC_FEDERATIONDOMAIN, ex); + return res; + } + + TaskManager.CompleteResultTask(); + return res; + } + + + #endregion + + + #region Private methods + public static UInt64 ConvertPhoneNumberToLong(string ip) + { + return Convert.ToUInt64(ip); + } + + public static string ConvertLongToPhoneNumber(UInt64 ip) + { + if (ip == 0) + return ""; + + return ip.ToString(); + } + #endregion + + + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/LyncControllerAsync.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/LyncControllerAsync.cs new file mode 100644 index 00000000..f30dc4f6 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/LyncControllerAsync.cs @@ -0,0 +1,97 @@ +// 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.Threading; +using System.Collections.Generic; +using System.Text; +using WebsitePanel.Providers; +using WebsitePanel.Providers.Common; +using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.Providers.ResultObjects; +using WebsitePanel.Providers.Lync; +using WebsitePanel.EnterpriseServer.Code.HostedSolution; + + +namespace WebsitePanel.EnterpriseServer.Code.HostedSolution +{ + public class LyncControllerAsync + { + private int lyncServiceId; + private int organizationServiceId; + + public int LyncServiceId + { + get { return this.lyncServiceId; } + set { this.lyncServiceId = value; } + } + + public int OrganizationServiceId + { + get { return this.organizationServiceId; } + set { this.organizationServiceId = value; } + } + + + public void Enable_CsComputerAsync() + { + // start asynchronously + Thread t = new Thread(new ThreadStart(Enable_CsComputer)); + t.Start(); + } + + private void Enable_CsComputer() + { + int[] lyncServiceIds; + + LyncController.GetLyncServices(lyncServiceId, out lyncServiceIds); + + foreach (int id in lyncServiceIds) + { + LyncServer lync = null; + try + { + lync = LyncController.GetLyncServer(id, organizationServiceId); + if (lync != null) + { + lync.ReloadConfiguration(); + } + } + catch (Exception exe) + { + TaskManager.WriteError(exe); + continue; + } + } + + + } + + + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs index 07672218..b3856eba 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs @@ -482,6 +482,66 @@ namespace WebsitePanel.EnterpriseServer } } + + private static bool DeleteLyncUsers(int itemId) + { + bool successful = false; + + try + { + LyncUsersPagedResult res = LyncController.GetLyncUsers(itemId, string.Empty, string.Empty, 0, int.MaxValue); + + if (res.IsSuccess) + { + successful = true; + foreach (LyncUser user in res.Value.PageUsers) + { + try + { + ResultObject delUserResult = LyncController.DeleteLyncUser(itemId, user.AccountID); + if (!delUserResult.IsSuccess) + { + StringBuilder sb = new StringBuilder(); + foreach (string str in delUserResult.ErrorCodes) + { + sb.Append(str); + sb.Append('\n'); + } + + throw new ApplicationException(sb.ToString()); + } + } + catch (Exception ex) + { + successful = false; + TaskManager.WriteError(ex); + } + } + + return successful; + } + else + { + StringBuilder sb = new StringBuilder(); + foreach (string str in res.ErrorCodes) + { + sb.Append(str); + sb.Append('\n'); + } + + throw new ApplicationException(sb.ToString()); + } + } + catch (Exception ex) + { + successful = false; + TaskManager.WriteError(ex); + } + + return successful; + } + + public static int DeleteOrganization(int itemId) { // check account @@ -570,7 +630,22 @@ namespace WebsitePanel.EnterpriseServer successful = false; TaskManager.WriteError(ex); } - + + //Cleanup Lync + try + { + if (!string.IsNullOrEmpty(org.LyncTenantId)) + if (DeleteLyncUsers(itemId)) + LyncController.DeleteOrganization(itemId); + } + catch (Exception ex) + { + successful = false; + TaskManager.WriteError(ex); + } + + + //Cleanup Exchange try { if (!string.IsNullOrEmpty(org.GlobalAddressList)) @@ -791,6 +866,11 @@ namespace WebsitePanel.EnterpriseServer stats.AllocatedOCSUsers = cntx.Quotas[Quotas.OCS_USERS].QuotaAllocatedValue; } + if (cntx.Groups.ContainsKey(ResourceGroups.Lync)) + { + stats.CreatedLyncUsers = LyncController.GetLyncUsersCount(org.Id).Value; + stats.AllocatedLyncUsers = cntx.Quotas[Quotas.LYNC_USERS].QuotaAllocatedValue; + } return stats; } @@ -1371,7 +1451,7 @@ namespace WebsitePanel.EnterpriseServer retUser.AccountType = account.AccountType; retUser.CrmUserId = CRMController.GetCrmUserId(accountId); retUser.IsOCSUser = DataProvider.CheckOCSUserExists(accountId); - //retUser.IsLyncUser = DataProvider.CheckLyncUserExists(accountId); + retUser.IsLyncUser = DataProvider.CheckLyncUserExists(accountId); retUser.IsBlackBerryUser = BlackBerryController.CheckBlackBerryUserExists(accountId); retUser.SubscriberNumber = account.SubscriberNumber; diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/WebsitePanel.EnterpriseServer.csproj b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/WebsitePanel.EnterpriseServer.csproj index a2556f80..cb74773e 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/WebsitePanel.EnterpriseServer.csproj +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/WebsitePanel.EnterpriseServer.csproj @@ -78,6 +78,7 @@ + @@ -130,6 +131,8 @@ + + @@ -235,6 +238,10 @@ + + esLync.asmx + Component + esVirtualizationServerForPrivateCloud.asmx Component diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esLync.asmx b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esLync.asmx new file mode 100644 index 00000000..a481f74b --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esLync.asmx @@ -0,0 +1 @@ +<%@ WebService Language="C#" CodeBehind="esLync.asmx.cs" Class="WebsitePanel.EnterpriseServer.esLync" %> diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esLync.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esLync.asmx.cs new file mode 100644 index 00000000..56ba913b --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esLync.asmx.cs @@ -0,0 +1,135 @@ +// 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.Web.Services; +using WebsitePanel.EnterpriseServer.Code.HostedSolution; +using WebsitePanel.Providers.Common; +using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.Providers.ResultObjects; +using System.Collections.Generic; + +namespace WebsitePanel.EnterpriseServer +{ + /// + /// Summary description for esLync + /// + [WebService(Namespace = "http://tempuri.org/")] + [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] + [System.ComponentModel.ToolboxItem(false)] + public class esLync : WebService + { + + [WebMethod] + public LyncUserResult CreateLyncUser(int itemId, int accountId, int lyncUserPlanId) + { + return LyncController.CreateLyncUser(itemId, accountId, lyncUserPlanId); + } + + [WebMethod] + public ResultObject DeleteLyncUser(int itemId, int accountId) + { + return LyncController.DeleteLyncUser(itemId, accountId); + } + + [WebMethod] + public LyncUsersPagedResult GetLyncUsersPaged(int itemId, string sortColumn, string sortDirection, int startRow, int maximumRows) + { + return LyncController.GetLyncUsers(itemId, sortColumn, sortDirection, startRow, maximumRows); + } + + [WebMethod] + public IntResult GetLyncUserCount(int itemId) + { + return LyncController.GetLyncUsersCount(itemId); + } + + + #region Lync User Plans + [WebMethod] + public List GetLyncUserPlans(int itemId) + { + return LyncController.GetLyncUserPlans(itemId); + } + + [WebMethod] + public LyncUserPlan GetLyncUserPlan(int itemId, int lyncUserPlanId) + { + return LyncController.GetLyncUserPlan(itemId, lyncUserPlanId); + } + + [WebMethod] + public int AddLyncUserPlan(int itemId, LyncUserPlan lyncUserPlan) + { + return LyncController.AddLyncUserPlan(itemId, lyncUserPlan); + } + + [WebMethod] + public int DeleteLyncUserPlan(int itemId, int lyncUserPlanId) + { + return LyncController.DeleteLyncUserPlan(itemId, lyncUserPlanId); + } + + [WebMethod] + public int SetOrganizationDefaultLyncUserPlan(int itemId, int lyncUserPlanId) + { + return LyncController.SetOrganizationDefaultLyncUserPlan(itemId, lyncUserPlanId); + } + + [WebMethod] + public LyncUser GetLyncUserGeneralSettings(int itemId, int accountId) + { + return LyncController.GetLyncUserGeneralSettings(itemId, accountId); + } + + [WebMethod] + public LyncUserResult SetUserLyncPlan(int itemId, int accountId, int lyncUserPlanId) + { + return LyncController.SetUserLyncPlan(itemId, accountId, lyncUserPlanId); + } + + [WebMethod] + public LyncFederationDomain[] GetFederationDomains(int itemId) + { + return LyncController.GetFederationDomains(itemId); + } + + [WebMethod] + public LyncUserResult AddFederationDomain(int itemId, string domainName, string proxyFqdn) + { + return LyncController.AddFederationDomain(itemId, domainName, proxyFqdn); + } + + [WebMethod] + public LyncUserResult RemoveFederationDomain(int itemId, string domainName) + { + return LyncController.RemoveFederationDomain(itemId, domainName); + } + + #endregion + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ILyncServer.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ILyncServer.cs new file mode 100644 index 00000000..ef1047a0 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ILyncServer.cs @@ -0,0 +1,51 @@ +// 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 interface ILyncServer + { + string CreateOrganization(string organizationId, string sipDomain, bool enableConferencing, bool enableConferencingVideo, int maxConferenceSize, bool enabledFederation, bool enabledEnterpriseVoice); + bool DeleteOrganization(string organizationId, string sipDomain); + + bool CreateUser(string organizationId, string userUpn, LyncUserPlan plan); + LyncUser GetLyncUserGeneralSettings(string organizationId, string userUpn); + bool SetLyncUserPlan(string organizationId, string userUpn, LyncUserPlan plan); + bool DeleteUser(string userUpn); + + LyncFederationDomain[] GetFederationDomains(string organizationId); + bool AddFederationDomain(string organizationId, string domainName, string proxyFqdn); + bool RemoveFederationDomain(string organizationId, string domainName); + + void ReloadConfiguration(); + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncConstants.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncConstants.cs new file mode 100644 index 00000000..4da82007 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncConstants.cs @@ -0,0 +1,36 @@ +// 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. + +namespace WebsitePanel.Providers.HostedSolution + { + public class LyncConstants + { + public const string PoolFQDN = "PoolFQDN"; + public const string SimpleUrlRoot = "SimpleUrlRoot"; + } + } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncErrorCodes.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncErrorCodes.cs new file mode 100644 index 00000000..15cfbae8 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncErrorCodes.cs @@ -0,0 +1,74 @@ +// 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. + +namespace WebsitePanel.Providers.HostedSolution + { + public class LyncErrorCodes + { + public const string CANNOT_CHECK_IF_LYNC_USER_EXISTS = "CANNOT_CHECK_IF_LYNC_USER_EXISTS"; + + public const string USER_IS_ALREADY_LYNC_USER = "USER_IS_ALREADY_LYNC_USER"; + + public const string USER_FIRST_NAME_IS_NOT_SPECIFIED = "USER_FIRST_NAME_IS_NOT_SPECIFIED"; + + public const string USER_LAST_NAME_IS_NOT_SPECIFIED = "USER_LAST_NAME_IS_NOT_SPECIFIED"; + + public const string CANNOT_GET_USER_GENERAL_SETTINGS = "CANNOT_GET_USER_GENERAL_SETTINGS"; + + public const string CANNOT_ADD_LYNC_USER_TO_DATABASE = "CANNOT_ADD_LYNC_USER_TO_DATABASE"; + + public const string GET_LYNC_USER_COUNT = "GET_LYNC_USER_COUNT"; + + public const string GET_LYNC_USERS = "GET_LYNC_USERS"; + + public const string CANNOT_DELETE_LYNC_USER_FROM_METADATA = "CANNOT_DELETE_LYNC_USER_FROM_METADATA"; + + public const string CANNOT_DELETE_LYNC_USER = "CANNOT_DELETE_LYNC_USER"; + + public const string CANNOT_GET_LYNC_PROXY = "CANNOT_GET_LYNC_PROXY"; + + public const string USER_QUOTA_HAS_BEEN_REACHED = "USER_QUOTA_HAS_BEEN_REACHED"; + + public const string CANNOT_CHECK_QUOTA = "CANNOT_CHECK_QUOTA"; + + public const string CANNOT_SET_DEFAULT_SETTINGS = "CANNOT_SET_DEFAULT_SETTINGS"; + + public const string CANNOT_ADD_LYNC_USER = "CANNOT_ADD_LYNC_USER"; + + public const string CANNOT_UPDATE_LYNC_USER = "CANNOT_UPDATE_LYNC_USER"; + + public const string CANNOT_ENABLE_ORG = "CANNOT_ENABLE_ORG"; + + public const string NOT_AUTHORIZED = "NOT_AUTHORIZED"; + + public const string CANNOT_ADD_LYNC_FEDERATIONDOMAIN = "CANNOT_ADD_LYNC_FEDERATIONDOMAIN"; + + public const string CANNOT_REMOVE_LYNC_FEDERATIONDOMAIN = "CANNOT_REMOVE_LYNC_FEDERATIONDOMAIN"; + + } + } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncFederationDomain.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncFederationDomain.cs new file mode 100644 index 00000000..f5ac4498 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncFederationDomain.cs @@ -0,0 +1,66 @@ +// 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 LyncFederationDomain + { + string domainName; + string comment; + bool markForMonitoring; + string proxyFqdn; + + public string DomainName + { + get { return this.domainName; } + set { this.domainName = value; } + } + + public string Comment + { + get { return this.comment; } + set { this.comment = value; } + } + + public bool MarkForMonitoring + { + get { return this.markForMonitoring; } + set { this.markForMonitoring = value; } + } + + public string ProxyFqdn + { + get { return this.proxyFqdn; } + set { this.proxyFqdn = value; } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUser.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUser.cs new file mode 100644 index 00000000..1a4dd851 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUser.cs @@ -0,0 +1,45 @@ +// 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 LyncUser + { + public string PrimaryUri { get; set; } + public string PrimaryEmailAddress { get; set; } + public string DisplayName { get; set; } + public string LineUri { get; set; } + public int AccountID { get; set; } + public int LyncUserPlanId { get; set; } + public string LyncUserPlanName { get; set; } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUserPlan.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUserPlan.cs new file mode 100644 index 00000000..27b236ec --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUserPlan.cs @@ -0,0 +1,112 @@ +// 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 LyncUserPlan + { + int lyncUserPlanId; + string lyncUserPlanName; + + bool im; + bool federation; + bool conferencing; + bool enterpriseVoice; + bool mobility; + bool mobilityEnableOutsideVoice; + LyncVoicePolicyType voicePolicy; + + bool isDefault; + + public int LyncUserPlanId + { + get { return this.lyncUserPlanId; } + set { this.lyncUserPlanId = value; } + } + + public string LyncUserPlanName + { + get { return this.lyncUserPlanName; } + set { this.lyncUserPlanName = value; } + } + + public bool IM + { + get { return this.im; } + set { this.im = value; } + } + + public bool IsDefault + { + get { return this.isDefault; } + set { this.isDefault = value; } + } + + public bool Federation + { + get { return this.federation; } + set { this.federation = value; } + } + + public bool Conferencing + { + get { return this.conferencing; } + set { this.conferencing = value; } + } + + public bool EnterpriseVoice + { + get { return this.enterpriseVoice; } + set { this.enterpriseVoice = value; } + } + + public bool Mobility + { + get { return this.mobility; } + set { this.mobility = value; } + } + + public bool MobilityEnableOutsideVoice + { + get { return this.mobilityEnableOutsideVoice; } + set { this.mobilityEnableOutsideVoice = value; } + } + + public LyncVoicePolicyType VoicePolicy + { + get { return this.voicePolicy; } + set { this.voicePolicy = value; } + } + + + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUsersPaged.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUsersPaged.cs new file mode 100644 index 00000000..6df0867c --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncUsersPaged.cs @@ -0,0 +1,50 @@ +// 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. + + + +namespace WebsitePanel.Providers.HostedSolution +{ + public class LyncUsersPaged + { + int recordsCount; + LyncUser[] pageUsers; + + public int RecordsCount + { + get { return recordsCount; } + set { recordsCount = value; } + } + + public LyncUser[] PageUsers + { + get { return pageUsers; } + set { pageUsers = value; } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncVoicePolicyType.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncVoicePolicyType.cs new file mode 100644 index 00000000..fc203a67 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/LyncVoicePolicyType.cs @@ -0,0 +1,39 @@ +// 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. + +namespace WebsitePanel.Providers.HostedSolution +{ + public enum LyncVoicePolicyType + { + None = 0, + Emergency = 1, + National = 2, + Mobile = 3, + International = 4 + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationStatistics.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationStatistics.cs index bc322dd4..50981d9e 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationStatistics.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationStatistics.cs @@ -173,6 +173,8 @@ namespace WebsitePanel.Providers.HostedSolution public int CreatedOCSUsers { get; set; } public int AllocatedOCSUsers { get; set; } + public int CreatedLyncUsers { get; set; } + public int AllocatedLyncUsers { get; set; } } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/ResultObjects/LyncUserResult.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/ResultObjects/LyncUserResult.cs new file mode 100644 index 00000000..bf5e64fd --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/ResultObjects/LyncUserResult.cs @@ -0,0 +1,36 @@ +// 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 WebsitePanel.Providers.HostedSolution; + +namespace WebsitePanel.Providers.ResultObjects +{ + public class LyncUserResult : ValueResultObject + { + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/ResultObjects/LyncUsersPagedResult.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/ResultObjects/LyncUsersPagedResult.cs new file mode 100644 index 00000000..169b13cd --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/ResultObjects/LyncUsersPagedResult.cs @@ -0,0 +1,36 @@ +// 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 WebsitePanel.Providers.HostedSolution; + +namespace WebsitePanel.Providers.ResultObjects +{ + public class LyncUsersPagedResult : ValueResultObject + { + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj index a74bff15..d5f41672 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj @@ -80,6 +80,14 @@ + + + + + + + + @@ -118,6 +126,8 @@ + + diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Lync2010.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Lync2010.cs new file mode 100644 index 00000000..21887292 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Lync2010.cs @@ -0,0 +1,1248 @@ +// 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.IO; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Text; +using System.Reflection; +using System.Globalization; +using System.DirectoryServices; + +using Microsoft.Win32; + +using WebsitePanel.Providers; +using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.Providers.Utils; +using WebsitePanel.Server.Utils; + +using System.Management; +using System.Management.Automation; +using System.Management.Automation.Runspaces; + +using Microsoft.Rtc.Management.Hosted; +using Microsoft.Rtc.Management.WritableConfig.Settings.Edge; +using Microsoft.Rtc.Management.WritableConfig.Settings.SimpleUrl; + + +namespace WebsitePanel.Providers.HostedSolution +{ + public class Lync2010 : HostingServiceProviderBase, ILyncServer + { + + #region Static constructor + static Lync2010() + { + LyncRegistryPath = "SOFTWARE\\Microsoft\\Real-Time Communications"; + } + + internal static string LyncRegistryPath + { + get; + set; + } + + #endregion + + + #region Properties + + /// + /// Pool FQDN + /// + private string PoolFQDN + { + get { return ProviderSettings[LyncConstants.PoolFQDN]; } + } + + private string SimpleUrlRoot + { + get { return ProviderSettings[LyncConstants.SimpleUrlRoot]; } + } + + internal string PrimaryDomainController + { + get { return ProviderSettings["PrimaryDomainController"]; } + } + + private string RootOU + { + get { return ProviderSettings["RootOU"]; } + } + + private string RootDomain + { + get { return ServerSettings.ADRootDomain; } + } + + + #endregion + + #region ILyncServer implementation + + public string CreateOrganization(string organizationId, string sipDomain, bool enableConferencing, bool enableConferencingVideo, int maxConferenceSize, bool enabledFederation, bool enabledEnterpriseVoice) + { + return CreateOrganizationInternal(organizationId, sipDomain, enableConferencing, enableConferencingVideo, maxConferenceSize, enabledFederation, enabledEnterpriseVoice); + } + + public bool DeleteOrganization(string organizationId, string sipDomain) + { + return DeleteOrganizationInternal(organizationId, sipDomain); + } + + public bool CreateUser(string organizationId, string userUpn, LyncUserPlan plan) + { + return CreateUserInternal(organizationId, userUpn, plan); + } + + public LyncUser GetLyncUserGeneralSettings(string organizationId, string userUpn) + { + return GetLyncUserGeneralSettingsInternal(organizationId, userUpn); + } + + public bool SetLyncUserPlan(string organizationId, string userUpn, LyncUserPlan plan) + { + return SetLyncUserPlanInternal(organizationId, userUpn, plan, null); + } + + public bool DeleteUser(string userUpn) + { + return DeleteUserInternal(userUpn); + } + + public LyncFederationDomain[] GetFederationDomains(string organizationId) + { + return GetFederationDomainsInternal(organizationId); + } + + public bool AddFederationDomain(string organizationId, string domainName, string proxyFqdn) + { + return AddFederationDomainInternal(organizationId, domainName, proxyFqdn); + } + + public bool RemoveFederationDomain(string organizationId, string domainName) + { + return RemoveFederationDomainInternal(organizationId, domainName); + } + + public void ReloadConfiguration() + { + ReloadConfigurationInternal(); + } + + #endregion + + #region organization + private string CreateOrganizationInternal(string organizationId, string sipDomain, bool enableConferencing, bool enableConferencingVideo, int maxConferenceSize, bool enabledFederation, bool enabledEnterpriseVoice) + { + HostedSolutionLog.LogStart("CreateOrganizationInternal"); + HostedSolutionLog.DebugInfo("organizationId: {0}", organizationId); + HostedSolutionLog.DebugInfo("sipDomain: {0}", sipDomain); + + string TenantId = string.Empty; + + LyncTransaction transaction = StartTransaction(); + + Runspace runSpace = null; + try + { + runSpace = OpenRunspace(); + + // create sip domain + Command cmd = new Command("New-CsSipDomain"); + cmd.Parameters.Add("Identity", sipDomain); + ExecuteShellCommand(runSpace, cmd, false); + + transaction.RegisterNewSipDomain(sipDomain); + + //set the msRTCSIP-Domains, TenantID, ObjectID + Guid id = Guid.NewGuid(); + + string path = AddADPrefix(GetOrganizationPath(organizationId)); + DirectoryEntry ou = ActiveDirectoryUtils.GetADObject(path); + ActiveDirectoryUtils.SetADObjectPropertyValue(ou, "msRTCSIP-Domains", sipDomain); + ActiveDirectoryUtils.SetADObjectPropertyValue(ou, "msRTCSIP-TenantId", id); + ActiveDirectoryUtils.SetADObjectPropertyValue(ou, "msRTCSIP-ObjectId", id); + ou.CommitChanges(); + + //Create simpleurls + CreateSimpleUrl(runSpace, sipDomain, id); + transaction.RegisterNewSimpleUrl(sipDomain, id.ToString()); + + //create conferencing policy + cmd = new Command("New-CsConferencingPolicy"); + cmd.Parameters.Add("Identity", organizationId); + cmd.Parameters.Add("MaxMeetingSize", maxConferenceSize); + cmd.Parameters.Add("AllowIPVideo", enableConferencingVideo); + ExecuteShellCommand(runSpace, cmd, false); + transaction.RegisterNewConferencingPolicy(organizationId); + + //create external access policy + cmd = new Command("New-CsExternalAccessPolicy"); + cmd.Parameters.Add("Identity", organizationId); + cmd.Parameters.Add("EnableFederationAccess", true); + cmd.Parameters.Add("EnableOutsideAccess", true); + cmd.Parameters.Add("EnablePublicCloudAccess", false); + cmd.Parameters.Add("EnablePublicCloudAudioVideoAccess", false); + ExecuteShellCommand(runSpace, cmd, false); + transaction.RegisterNewCsExternalAccessPolicy(organizationId); + + //Enable for federation + AllowList allowList = new AllowList(); + DomainPattern domain = new DomainPattern(sipDomain); + allowList.AllowedDomain.Add(domain); + + cmd = new Command("Set-CsTenantFederationConfiguration"); + cmd.Parameters.Add("Tenant", id); + cmd.Parameters.Add("AllowFederatedUsers", true); + cmd.Parameters.Add("AllowedDomains", allowList); + ExecuteShellCommand(runSpace, cmd, false); + + //create mobility policy + cmd = new Command("New-CsMobilityPolicy"); + cmd.Parameters.Add("Identity", organizationId + " EnableOutSideVoice"); + cmd.Parameters.Add("EnableMobility", true); + cmd.Parameters.Add("EnableOutsideVoice", true); + ExecuteShellCommand(runSpace, cmd, false); + transaction.RegisterNewCsMobilityPolicy(organizationId + " EnableOutSideVoice"); + + cmd = new Command("New-CsMobilityPolicy"); + cmd.Parameters.Add("Identity", organizationId + " DisableOutSideVoice"); + cmd.Parameters.Add("EnableMobility", true); + cmd.Parameters.Add("EnableOutsideVoice", false); + ExecuteShellCommand(runSpace, cmd, false); + transaction.RegisterNewCsMobilityPolicy(organizationId + " DisableOutSideVoice"); + + cmd = new Command("Invoke-CsManagementStoreReplication"); + ExecuteShellCommand(runSpace, cmd, false); + + + TenantId = id.ToString(); + } + catch (Exception ex) + { + HostedSolutionLog.LogError("CreateOrganizationInternal", ex); + RollbackTransaction(transaction); + throw; + } + finally + { + + CloseRunspace(runSpace); + } + + HostedSolutionLog.LogEnd("CreateOrganizationInternal"); + + return TenantId; + } + + + + private bool DeleteOrganizationInternal(string organizationId, string sipDomain) + { + HostedSolutionLog.LogStart("DeleteOrganizationInternal"); + HostedSolutionLog.DebugInfo("organizationId: {0}", organizationId); + HostedSolutionLog.DebugInfo("sipDomain: {0}", sipDomain); + + bool ret = true; + + Runspace runSpace = null; + 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)) + { + 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); + ActiveDirectoryUtils.ClearADObjectPropertyValue(ou, "msRTCSIP-Domains"); + ActiveDirectoryUtils.ClearADObjectPropertyValue(ou, "msRTCSIP-TenantId"); + ActiveDirectoryUtils.ClearADObjectPropertyValue(ou, "msRTCSIP-ObjectId"); + ou.CommitChanges(); + + try + { + DeleteConferencingPolicy(runSpace, organizationId); + } + catch (Exception) + { + } + + try + { + DeleteExternalAccessPolicy(runSpace, organizationId); + } + catch (Exception) + { + } + + try + { + DeleteMobilityPolicy(runSpace, organizationId + " EnableOutSideVoice"); + } + catch (Exception) + { + } + + try + { + DeleteMobilityPolicy(runSpace, organizationId + " DisableOutSideVoice"); + } + catch (Exception) + { + } + + try + { + DeleteSimpleUrl(runSpace, sipDomain, tenantId); + } + catch (Exception) + { + } + } + + cmd = new Command("Invoke-CsManagementStoreReplication"); + ExecuteShellCommand(runSpace, cmd, false); + + } + catch (Exception ex) + { + ret = false; + HostedSolutionLog.LogError("DeleteOrganizationInternal", ex); + throw; + } + finally + { + + CloseRunspace(runSpace); + } + HostedSolutionLog.LogEnd("DeleteOrganizationInternal"); + return ret; + } + #endregion + + #region Users + private bool CreateUserInternal(string organizationId, string userUpn, LyncUserPlan plan) + { + HostedSolutionLog.LogStart("CreateUserInternal"); + HostedSolutionLog.DebugInfo("organizationId: {0}", organizationId); + HostedSolutionLog.DebugInfo("userUpn: {0}", userUpn); + + bool ret = true; + Guid tenantId = Guid.Empty; + + LyncTransaction transaction = StartTransaction(); + + Runspace runSpace = null; + 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"); + + //enable for lync + cmd = new Command("Enable-CsUser"); + cmd.Parameters.Add("Identity", userUpn); + cmd.Parameters.Add("RegistrarPool", PoolFQDN); + cmd.Parameters.Add("SipAddressType", "UserPrincipalName"); + ExecuteShellCommand(runSpace, cmd); + + transaction.RegisterNewCsUser(userUpn); + + //set groupingID and tenantID + cmd = new Command("Get-CsAdUser"); + cmd.Parameters.Add("Identity", userUpn); + result = ExecuteShellCommand(runSpace, cmd); + + + string 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]; + ActiveDirectoryUtils.SetADObjectPropertyValue(user, "msRTCSIP-BaseSimpleUrl", Url); + } + user.CommitChanges(); + + //set-plan + SetLyncUserPlanInternal(organizationId, userUpn, plan, runSpace); + + //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); + } + else + { + ret = false; + HostedSolutionLog.LogError("Failed to retrieve tenantID", null); + } + } + catch (Exception ex) + { + ret = false; + HostedSolutionLog.LogError("CreateUserInternal", ex); + RollbackTransaction(transaction); + throw; + } + finally + { + + CloseRunspace(runSpace); + } + HostedSolutionLog.LogEnd("CreateUserInternal"); + return ret; + } + + private LyncUser GetLyncUserGeneralSettingsInternal(string organizationId, string userUpn) + { + HostedSolutionLog.LogStart("GetLyncUserGeneralSettingsInternal"); + HostedSolutionLog.DebugInfo("organizationId: {0}", organizationId); + HostedSolutionLog.DebugInfo("userUpn: {0}", userUpn); + + LyncUser lyncUser = new LyncUser(); + Runspace runSpace = null; + try + { + runSpace = OpenRunspace(); + + Command cmd = new Command("Get-CsUser"); + cmd.Parameters.Add("Identity", userUpn); + Collection result = ExecuteShellCommand(runSpace, cmd); + PSObject user = result[0]; + + lyncUser.DisplayName = (string)GetPSObjectProperty(user, "DisplayName"); + lyncUser.PrimaryUri = (string)GetPSObjectProperty(user, "SipAddress"); + lyncUser.LineUri = (string)GetPSObjectProperty(user, "LineURI"); + } + catch (Exception ex) + { + HostedSolutionLog.LogError("GetLyncUserGeneralSettingsInternal", ex); + throw; + } + finally + { + CloseRunspace(runSpace); + } + HostedSolutionLog.LogEnd("GetLyncUserGeneralSettingsInternal"); + return lyncUser; + } + + + private bool SetLyncUserPlanInternal(string organizationId, string userUpn, LyncUserPlan plan, Runspace runSpace) + { + HostedSolutionLog.LogStart("SetLyncUserPlanInternal"); + HostedSolutionLog.DebugInfo("organizationId: {0}", organizationId); + HostedSolutionLog.DebugInfo("userUpn: {0}", userUpn); + bool ret = true; + bool bCloseRunSpace = false; + + try + { + if (runSpace == null) + { + runSpace = OpenRunspace(); + bCloseRunSpace = true; + } + + //CsExternalAccessPolicy + Command cmd = new Command("Grant-CsExternalAccessPolicy"); + cmd.Parameters.Add("Identity", userUpn); + cmd.Parameters.Add("PolicyName", plan.Federation ? organizationId : null); + ExecuteShellCommand(runSpace, cmd); + + //CsConferencingPolicy + cmd = new Command("Grant-CsConferencingPolicy"); + cmd.Parameters.Add("Identity", userUpn); + cmd.Parameters.Add("PolicyName", plan.Federation ? organizationId : null); + ExecuteShellCommand(runSpace, cmd); + + //CsMobilityPolicy + cmd = new Command("Grant-CsMobilityPolicy"); + cmd.Parameters.Add("Identity", userUpn); + if (plan.Mobility) + cmd.Parameters.Add("PolicyName", plan.MobilityEnableOutsideVoice ? organizationId + " EnableOutSideVoice" : organizationId + " DisableOutSideVoice"); + else + cmd.Parameters.Add("PolicyName", null); + ExecuteShellCommand(runSpace, cmd); + + //initiate user database replication + cmd = new Command("Update-CsUserDatabase"); + ExecuteShellCommand(runSpace, cmd, false); + } + catch (Exception ex) + { + ret = false; + HostedSolutionLog.LogError("SetLyncUserPlanInternal", ex); + throw; + } + finally + { + + if (bCloseRunSpace) CloseRunspace(runSpace); + } + HostedSolutionLog.LogEnd("SetLyncUserPlanInternal"); + return ret; + } + + + private bool DeleteUserInternal(string userUpn) + { + HostedSolutionLog.LogStart("DeleteUserInternal"); + HostedSolutionLog.DebugInfo("userUpn: {0}", userUpn); + + bool ret = true; + + Runspace runSpace = null; + try + { + runSpace = OpenRunspace(); + + //Delete User + DeleteUser(runSpace, userUpn); + + //Clear groupingID and tenantID + Command cmd = new Command("Get-CsAdUser"); + cmd.Parameters.Add("Identity", userUpn); + Collection result = ExecuteShellCommand(runSpace, cmd); + + string path = AddADPrefix(GetResultObjectDN(result)); + DirectoryEntry user = ActiveDirectoryUtils.GetADObject(path); + ActiveDirectoryUtils.ClearADObjectPropertyValue(user, "msRTCSIP-GroupingID"); + ActiveDirectoryUtils.ClearADObjectPropertyValue(user, "msRTCSIP-TenantId"); + ActiveDirectoryUtils.ClearADObjectPropertyValue(user, "msRTCSIP-BaseSimpleUrl"); + user.CommitChanges(); + + //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("DeleteUserInternal", ex); + throw; + } + finally + { + + CloseRunspace(runSpace); + } + HostedSolutionLog.LogEnd("DeleteUserInternal"); + return ret; + } + + internal void DeleteUser(Runspace runSpace, string userUpn) + { + HostedSolutionLog.LogStart("DeleteUser"); + HostedSolutionLog.DebugInfo("userUpn : {0}", userUpn); + Command cmd = new Command("Disable-CsUser"); + cmd.Parameters.Add("Identity", userUpn); + cmd.Parameters.Add("Confirm", false); + ExecuteShellCommand(runSpace, cmd, false); + HostedSolutionLog.LogEnd("DeleteUser"); + } + + #endregion + + #region SipDomains + internal void DeleteSipDomain(Runspace runSpace, string id) + { + HostedSolutionLog.LogStart("DeleteSipDomain"); + HostedSolutionLog.DebugInfo("SipDomain : {0}", id); + Command cmd = new Command("Remove-CsSipDomain"); + cmd.Parameters.Add("Identity", id); + cmd.Parameters.Add("Confirm", false); + cmd.Parameters.Add("Force", true); + ExecuteShellCommand(runSpace, cmd, false); + HostedSolutionLog.LogEnd("DeleteSipDomain"); + } + + private void CreateSimpleUrl(Runspace runSpace, string sipDomain, Guid id) + { + //Create the simpleUrlEntry + Command cmd = new Command("Get-CsSipDomain"); + Collection sipDomains = ExecuteShellCommand(runSpace, cmd, false); + + IList SimpleUrls = new List(); + + + foreach (PSObject domain in sipDomains) + { + string d = (string)GetPSObjectProperty(domain, "Name"); + string Url = SimpleUrlRoot + d; + + + //Create the simpleUrlEntry + cmd = new Command("New-CsSimpleUrlEntry"); + cmd.Parameters.Add("Url", Url); + Collection simpleUrlEntry = ExecuteShellCommand(runSpace, cmd, false); + + //Create the simpleUrl + cmd = new Command("New-CsSimpleUrl"); + cmd.Parameters.Add("Component", "meet"); + cmd.Parameters.Add("Domain", d); + cmd.Parameters.Add("SimpleUrl", simpleUrlEntry[0]); + cmd.Parameters.Add("ActiveUrl", Url); + Collection simpleUrl = ExecuteShellCommand(runSpace, cmd, false); + + SimpleUrls.Add(simpleUrl[0]); + } + + Hashtable properties = new Hashtable(); + properties.Add("Add", SimpleUrls); + + //PSListModifier + cmd = new Command("Set-CsSimpleUrlConfiguration"); + cmd.Parameters.Add("Identity", "Global"); + cmd.Parameters.Add("Tenant", id); + cmd.Parameters.Add("SimpleUrl", SimpleUrls); + ExecuteShellCommand(runSpace, cmd, false); + } + + + internal void DeleteSimpleUrl(Runspace runSpace, string sipDomain, Guid id) + { + /* + //build the url + string Url = SimpleUrlRoot + sipDomain; + + //Create the simpleUrlEntry + Command cmd = new Command("New-CsSimpleUrlEntry"); + cmd.Parameters.Add("Url", Url); + Collection simpleUrlEntry = ExecuteShellCommand(runSpace, cmd, false); + + //Create the simpleUrl + cmd = new Command("New-CsSimpleUrl"); + cmd.Parameters.Add("Component", "meet"); + cmd.Parameters.Add("Domain", sipDomain); + cmd.Parameters.Add("SimpleUrl", simpleUrlEntry[0]); + cmd.Parameters.Add("ActiveUrl", Url); + Collection simpleUrl = ExecuteShellCommand(runSpace, cmd, false); + + //PSListModifier + + Hashtable properties = new Hashtable(); + properties.Add("Remove", simpleUrl[0]); + + cmd = new Command("Set-CsSimpleUrlConfiguration"); + cmd.Parameters.Add("Identity", "Global"); + cmd.Parameters.Add("Tenant", id); + cmd.Parameters.Add("SimpleUrl", properties); + ExecuteShellCommand(runSpace, cmd, false); + */ + } + + + #endregion + + #region Policies + + internal void DeleteConferencingPolicy(Runspace runSpace, string policyName) + { + HostedSolutionLog.LogStart("DeleteConferencingPolicy"); + HostedSolutionLog.DebugInfo("policyName : {0}", policyName); + Command cmd = new Command("Remove-CsConferencingPolicy"); + cmd.Parameters.Add("Identity", policyName); + cmd.Parameters.Add("Confirm", false); + cmd.Parameters.Add("Force", true); + ExecuteShellCommand(runSpace, cmd, false); + HostedSolutionLog.LogEnd("DeleteConferencingPolicy"); + } + + internal void DeleteExternalAccessPolicy(Runspace runSpace, string policyName) + { + HostedSolutionLog.LogStart("DeleteExternalAccessPolicy"); + HostedSolutionLog.DebugInfo("policyName : {0}", policyName); + Command cmd = new Command("Remove-CsExternalAccessPolicy"); + cmd.Parameters.Add("Identity", policyName); + cmd.Parameters.Add("Confirm", false); + cmd.Parameters.Add("Force", true); + ExecuteShellCommand(runSpace, cmd, false); + HostedSolutionLog.LogEnd("DeleteExternalAccessPolicy"); + } + + internal void DeleteMobilityPolicy(Runspace runSpace, string policyName) + { + HostedSolutionLog.LogStart("DeleteMobilityPolicy"); + HostedSolutionLog.DebugInfo("policyName : {0}", policyName); + Command cmd = new Command("Remove-CsMobilityPolicy"); + cmd.Parameters.Add("Identity", policyName); + cmd.Parameters.Add("Confirm", false); + cmd.Parameters.Add("Force", true); + ExecuteShellCommand(runSpace, cmd, false); + HostedSolutionLog.LogEnd("DeleteMobilityPolicy"); + } + + #endregion + + #region Sytsem Related Methods + private void ReloadConfigurationInternal() + { + HostedSolutionLog.LogStart("ReloadConfigurationInternal"); + Runspace runSpace = null; + try + { + runSpace = OpenRunspace(); + + Command cmd = new Command("Enable-CsComputer"); + ExecuteShellCommand(runSpace, cmd, false); + } + catch (Exception ex) + { + HostedSolutionLog.LogError("ReloadConfigurationInternal", ex); + throw; + } + finally + { + + CloseRunspace(runSpace); + } + HostedSolutionLog.LogEnd("ReloadConfigurationInternal"); + } + + + #endregion + + #region Federation Domains + private LyncFederationDomain[] GetFederationDomainsInternal(string organizationId) + { + + HostedSolutionLog.LogStart("GetFederationDomainsInternal"); + HostedSolutionLog.DebugInfo("organizationId: {0}", organizationId); + + + LyncFederationDomain[] domains = null; + + Runspace runSpace = null; + try + { + runSpace = OpenRunspace(); + + Guid tenantId = Guid.Empty; + + domains = GetFederationDomainsInternal(runSpace, organizationId, ref tenantId); + + } + catch (Exception ex) + { + HostedSolutionLog.LogError("GetFederationDomainsInternal", ex); + throw; + } + finally + { + + CloseRunspace(runSpace); + } + HostedSolutionLog.LogEnd("GetFederationDomainsInternal"); + + return domains; + } + + private LyncFederationDomain[] GetFederationDomainsInternal(Runspace runSpace, string organizationId, ref Guid tenantId) + { + //Get TenantID + List domains = null; + 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"); + + //Get-CSTenantFederationConfiguration (AllowedDomains) + cmd = new Command("Get-CsTenantFederationConfiguration"); + cmd.Parameters.Add("Tenant", tenantId); + result = ExecuteShellCommand(runSpace, cmd, false); + + if ((result != null) && (result.Count > 0)) + { + domains = new List(); + + if (GetPSObjectProperty(result[0], "AllowedDomains").GetType().ToString() == "Microsoft.Rtc.Management.WritableConfig.Settings.Edge.AllowList") + { + AllowList allowList = (AllowList)GetPSObjectProperty(result[0], "AllowedDomains"); + + foreach (DomainPattern d in allowList.AllowedDomain) + { + LyncFederationDomain domain = new LyncFederationDomain(); + domain.DomainName = d.Domain.ToString(); + domains.Add(domain); + } + } + } + } + + if (domains != null) + return domains.ToArray(); + else + return null; + } + + + private bool AddFederationDomainInternal(string organizationId, string domainName, string proxyFqdn) + { + HostedSolutionLog.LogStart("AddFederationDomainInternal"); + HostedSolutionLog.DebugInfo("organizationId: {0}", organizationId); + HostedSolutionLog.DebugInfo("domainName: {0}", domainName); + + Runspace runSpace = null; + try + { + runSpace = OpenRunspace(); + + Guid tenantId = Guid.Empty; + 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"); + + //Get-CSTenantFederationConfiguration (AllowedDomains) + cmd = new Command("Get-CsTenantFederationConfiguration"); + cmd.Parameters.Add("Tenant", tenantId); + result = ExecuteShellCommand(runSpace, cmd, false); + + if ((result != null) && (result.Count > 0)) + { + AllowList allowList = null; + + if (GetPSObjectProperty(result[0], "AllowedDomains").GetType().ToString() == "Microsoft.Rtc.Management.WritableConfig.Settings.Edge.AllowList") + { + allowList = (AllowList)GetPSObjectProperty(result[0], "AllowedDomains"); + DomainPattern domain = new DomainPattern(domainName); + allowList.AllowedDomain.Add(domain); + } + else + { + allowList = new AllowList(); + DomainPattern domain = new DomainPattern(domainName); + allowList.AllowedDomain.Add(domain); + } + + cmd = new Command("Set-CsTenantFederationConfiguration"); + cmd.Parameters.Add("Tenant", tenantId); + cmd.Parameters.Add("AllowedDomains", allowList); + ExecuteShellCommand(runSpace, cmd, false); + } + } + } + catch (Exception ex) + { + HostedSolutionLog.LogError("AddFederationDomainInternal", ex); + throw; + } + finally + { + + CloseRunspace(runSpace); + } + HostedSolutionLog.LogEnd("AddFederationDomainInternal"); + + return true; + } + + private bool RemoveFederationDomainInternal(string organizationId, string domainName) + { + HostedSolutionLog.LogStart("RemoveFederationDomainInternal"); + HostedSolutionLog.DebugInfo("organizationId: {0}", organizationId); + HostedSolutionLog.DebugInfo("domainName: {0}", domainName); + + Runspace runSpace = null; + try + { + runSpace = OpenRunspace(); + + Guid tenantId = Guid.Empty; + 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"); + + //Get-CSTenantFederationConfiguration (AllowedDomains) + cmd = new Command("Get-CsTenantFederationConfiguration"); + cmd.Parameters.Add("Tenant", tenantId); + result = ExecuteShellCommand(runSpace, cmd, false); + + if ((result != null) && (result.Count > 0)) + { + AllowList allowList = null; + + if (GetPSObjectProperty(result[0], "AllowedDomains").GetType().ToString() == "Microsoft.Rtc.Management.WritableConfig.Settings.Edge.AllowList") + { + allowList = (AllowList)GetPSObjectProperty(result[0], "AllowedDomains"); + DomainPattern domain = new DomainPattern(domainName); + allowList.AllowedDomain.Remove(domain); + } + + cmd = new Command("Set-CsTenantFederationConfiguration"); + cmd.Parameters.Add("Tenant", tenantId); + cmd.Parameters.Add("AllowedDomains", allowList); + ExecuteShellCommand(runSpace, cmd, false); + } + } + } + catch (Exception ex) + { + HostedSolutionLog.LogError("RemoveFederationDomainInternal", ex); + throw; + } + finally + { + + CloseRunspace(runSpace); + } + HostedSolutionLog.LogEnd("RemoveFederationDomainInternal"); + + return true; + } + + + + + #endregion + + #region PowerShell integration + private static InitialSessionState session = null; + + internal virtual Runspace OpenRunspace() + { + HostedSolutionLog.LogStart("OpenRunspace"); + + if (session == null) + { + session = InitialSessionState.CreateDefault(); + session.ImportPSModule(new string[] { "ActiveDirectory", "Lync", "LyncOnline" }); + } + Runspace runSpace = RunspaceFactory.CreateRunspace(session); + // + runSpace.Open(); + // + runSpace.SessionStateProxy.SetVariable("ConfirmPreference", "none"); + HostedSolutionLog.LogEnd("OpenRunspace"); + return runSpace; + } + + internal void CloseRunspace(Runspace runspace) + { + try + { + if (runspace != null && runspace.RunspaceStateInfo.State == RunspaceState.Opened) + { + runspace.Close(); + } + } + catch (Exception ex) + { + HostedSolutionLog.LogError("Runspace error", ex); + } + } + + internal Collection ExecuteShellCommand(Runspace runSpace, Command cmd) + { + return ExecuteShellCommand(runSpace, cmd, true); + } + + internal Collection ExecuteShellCommand(Runspace runSpace, Command cmd, bool useDomainController) + { + object[] errors; + return ExecuteShellCommand(runSpace, cmd, useDomainController, out errors); + } + + internal Collection ExecuteShellCommand(Runspace runSpace, Command cmd, out object[] errors) + { + return ExecuteShellCommand(runSpace, cmd, true, out errors); + } + + internal Collection ExecuteShellCommand(Runspace runSpace, Command cmd, bool useDomainController, out object[] errors) + { + HostedSolutionLog.LogStart("ExecuteShellCommand"); + List errorList = new List(); + + if (useDomainController) + { + CommandParameter dc = new CommandParameter("DomainController", PrimaryDomainController); + if (!cmd.Parameters.Contains(dc)) + { + cmd.Parameters.Add(dc); + } + } + + HostedSolutionLog.DebugCommand(cmd); + Collection results = null; + // Create a pipeline + Pipeline pipeLine = runSpace.CreatePipeline(); + using (pipeLine) + { + // Add the command + pipeLine.Commands.Add(cmd); + // Execute the pipeline and save the objects returned. + results = pipeLine.Invoke(); + + // Log out any errors in the pipeline execution + // NOTE: These errors are NOT thrown as exceptions! + // Be sure to check this to ensure that no errors + // happened while executing the command. + if (pipeLine.Error != null && pipeLine.Error.Count > 0) + { + foreach (object item in pipeLine.Error.ReadToEnd()) + { + errorList.Add(item); + string errorMessage = string.Format("Invoke error: {0}", item); + HostedSolutionLog.LogWarning(errorMessage); + } + } + } + pipeLine = null; + errors = errorList.ToArray(); + HostedSolutionLog.LogEnd("ExecuteShellCommand"); + return results; + } + + internal object GetPSObjectProperty(PSObject obj, string name) + { + return obj.Members[name].Value; + } + + /// + /// Returns the identity of the object from the shell execution result + /// + /// + /// + internal string GetResultObjectIdentity(Collection result) + { + HostedSolutionLog.LogStart("GetResultObjectIdentity"); + if (result == null) + throw new ArgumentNullException("result", "Execution result is not specified"); + + if (result.Count < 1) + throw new ArgumentException("Execution result is empty", "result"); + + if (result.Count > 1) + throw new ArgumentException("Execution result contains more than one object", "result"); + + PSMemberInfo info = result[0].Members["Identity"]; + if (info == null) + throw new ArgumentException("Execution result does not contain Identity property", "result"); + + string ret = info.Value.ToString(); + HostedSolutionLog.LogEnd("GetResultObjectIdentity"); + return ret; + } + + internal string GetResultObjectDN(Collection result) + { + HostedSolutionLog.LogStart("GetResultObjectDN"); + if (result == null) + throw new ArgumentNullException("result", "Execution result is not specified"); + + if (result.Count < 1) + throw new ArgumentException("Execution result does not contain any object"); + + if (result.Count > 1) + throw new ArgumentException("Execution result contains more than one object"); + + PSMemberInfo info = result[0].Members["DistinguishedName"]; + if (info == null) + throw new ArgumentException("Execution result does not contain DistinguishedName property", "result"); + + string ret = info.Value.ToString(); + HostedSolutionLog.LogEnd("GetResultObjectDN"); + return ret; + } + + + #endregion + + #region Transactions + + internal LyncTransaction StartTransaction() + { + return new LyncTransaction(); + } + + internal void RollbackTransaction(LyncTransaction transaction) + { + HostedSolutionLog.LogStart("RollbackTransaction"); + Runspace runSpace = null; + try + { + runSpace = OpenRunspace(); + + + for (int i = transaction.Actions.Count - 1; i > -1; i--) + { + //reverse order + try + { + RollbackAction(transaction.Actions[i], runSpace); + } + catch (Exception ex) + { + HostedSolutionLog.LogError("Rollback error", ex); + } + } + } + catch (Exception ex) + { + HostedSolutionLog.LogError("Rollback error", ex); + } + finally + { + + CloseRunspace(runSpace); + } + HostedSolutionLog.LogEnd("RollbackTransaction"); + } + + private void RollbackAction(TransactionAction action, Runspace runspace) + { + HostedSolutionLog.LogInfo("Rollback action: {0}", action.ActionType); + switch (action.ActionType) + { + case TransactionAction.TransactionActionTypes.LyncNewSipDomain: + DeleteSipDomain(runspace, action.Id); + break; + //case TransactionAction.TransactionActionTypes.LyncNewSimpleUrl: + //DeleteSimpleUrl(runspace, action.Id); + //break; + case TransactionAction.TransactionActionTypes.LyncNewUser: + DeleteUser(runspace, action.Id); + break; + case TransactionAction.TransactionActionTypes.LyncNewConferencingPolicy: + DeleteConferencingPolicy(runspace, action.Id); + break; + case TransactionAction.TransactionActionTypes.LyncNewExternalAccessPolicy: + DeleteExternalAccessPolicy(runspace, action.Id); + break; + case TransactionAction.TransactionActionTypes.LyncNewMobilityPolicy: + DeleteMobilityPolicy(runspace, action.Id); + break; + } + } + + #endregion + + #region helpers + private string GetOrganizationPath(string organizationId) + { + StringBuilder sb = new StringBuilder(); + // append provider + AppendOUPath(sb, organizationId); + AppendOUPath(sb, RootOU); + AppendDomainPath(sb, RootDomain); + + return sb.ToString(); + } + + private static void AppendOUPath(StringBuilder sb, string ou) + { + if (string.IsNullOrEmpty(ou)) + return; + + string path = ou.Replace("/", "\\"); + string[] parts = path.Split('\\'); + for (int i = parts.Length - 1; i != -1; i--) + sb.Append("OU=").Append(parts[i]).Append(","); + } + + private static void AppendDomainPath(StringBuilder sb, string domain) + { + if (string.IsNullOrEmpty(domain)) + return; + + string[] parts = domain.Split('.'); + for (int i = 0; i < parts.Length; i++) + { + sb.Append("DC=").Append(parts[i]); + + if (i < (parts.Length - 1)) + sb.Append(","); + } + } + + internal string AddADPrefix(string path) + { + string dn = path; + if (!dn.ToUpper().StartsWith("LDAP://")) + { + dn = string.Format("LDAP://{0}/{1}", PrimaryDomainController, dn); + } + return dn; + } + + #endregion + + public override bool IsInstalled() + { + string value = ""; + bool bResult = false; + RegistryKey root = Registry.LocalMachine; + RegistryKey rk = root.OpenSubKey(LyncRegistryPath); + if (rk != null) + { + value = (string)rk.GetValue("ProductVersion", null); + if (value == "4.0.7577.0") + bResult = true; + + rk.Close(); + } + return bResult; + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/LyncTransaction.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/LyncTransaction.cs new file mode 100644 index 00000000..811a93ec --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/LyncTransaction.cs @@ -0,0 +1,97 @@ +// 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.Collections.Generic; + +namespace WebsitePanel.Providers.HostedSolution +{ + internal class LyncTransaction + { + List actions = null; + + public LyncTransaction() + { + actions = new List(); + } + + internal List Actions + { + get { return actions; } + } + + internal void RegisterNewSipDomain(string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.LyncNewSipDomain; + action.Id = id; + Actions.Add(action); + } + + internal void RegisterNewSimpleUrl(string sipDomain, string tenantID) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.LyncNewSimpleUrl; + action.Id = sipDomain; + action.Account = tenantID; + Actions.Add(action); + } + + + internal void RegisterNewConferencingPolicy(string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.LyncNewConferencingPolicy; + action.Id = id; + Actions.Add(action); + } + + internal void RegisterNewCsExternalAccessPolicy(string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.LyncNewExternalAccessPolicy; + action.Id = id; + Actions.Add(action); + } + + internal void RegisterNewCsMobilityPolicy(string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.LyncNewMobilityPolicy; + action.Id = id; + Actions.Add(action); + } + + internal void RegisterNewCsUser(string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.LyncNewUser; + action.Id = id; + Actions.Add(action); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/WebsitePanel.Providers.HostedSolution.csproj b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/WebsitePanel.Providers.HostedSolution.csproj index a1441425..20a414bf 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/WebsitePanel.Providers.HostedSolution.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/WebsitePanel.Providers.HostedSolution.csproj @@ -106,6 +106,15 @@ False ..\..\Lib\References\Microsoft\Microsoft.Exchange.Net.dll + + ..\..\Lib\References\Microsoft\Microsoft.Rtc.Management.Core.dll + + + ..\..\Lib\References\Microsoft\Microsoft.Rtc.Management.Hosted.dll + + + ..\..\Lib\References\Microsoft\Microsoft.Rtc.Management.WritableConfig.dll + ..\..\Lib\References\Microsoft\Microsoft.SharePoint.dll False @@ -133,6 +142,8 @@ + + diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/LyncServerProxy.cs b/WebsitePanel/Sources/WebsitePanel.Server.Client/LyncServerProxy.cs new file mode 100644 index 00000000..49a11f35 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/LyncServerProxy.cs @@ -0,0 +1,912 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:2.0.50727.5456 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +// +// This source code was auto-generated by wsdl, Version=2.0.50727.42. +// +using WebsitePanel.Providers.HostedSolution; + +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.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 + { + + 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 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() + { + 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 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) + { + object[] results = this.Invoke("CreateOrganization", new object[] { + organizationId, + sipDomain, + enableConferencing, + enableConferencingVideo, + maxConferenceSize, + enabledFederation, + 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) + { + return this.BeginInvoke("CreateOrganization", new object[] { + organizationId, + sipDomain, + enableConferencing, + enableConferencingVideo, + maxConferenceSize, + enabledFederation, + enabledEnterpriseVoice}, callback, asyncState); + } + + /// + 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) + { + 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)) + { + this.CreateOrganizationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateOrganizationOperationCompleted); + } + this.InvokeAsync("CreateOrganization", new object[] { + organizationId, + sipDomain, + enableConferencing, + enableConferencingVideo, + maxConferenceSize, + enabledFederation, + enabledEnterpriseVoice}, this.CreateOrganizationOperationCompleted, userState); + } + + 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) + { + 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) + { + return this.BeginInvoke("DeleteOrganization", new object[] { + organizationId, + sipDomain}, callback, asyncState); + } + + /// + public bool EndDeleteOrganization(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((bool)(results[0])); + } + + /// + 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)) + { + 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)) + { + 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) + { + 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) + { + return this.BeginInvoke("CreateUser", new object[] { + organizationId, + userUpn, + plan}, callback, asyncState); + } + + /// + public bool EndCreateUser(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((bool)(results[0])); + } + + /// + 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)) + { + this.CreateUserOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateUserOperationCompleted); + } + this.InvokeAsync("CreateUser", new object[] { + organizationId, + userUpn, + plan}, this.CreateUserOperationCompleted, userState); + } + + 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) + { + 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) + { + return this.BeginInvoke("GetLyncUserGeneralSettings", new object[] { + organizationId, + userUpn}, callback, asyncState); + } + + /// + public LyncUser EndGetLyncUserGeneralSettings(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((LyncUser)(results[0])); + } + + /// + 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)) + { + 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)) + { + 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) + { + 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) + { + return this.BeginInvoke("SetLyncUserPlan", new object[] { + organizationId, + userUpn, + plan}, callback, asyncState); + } + + /// + public bool EndSetLyncUserPlan(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((bool)(results[0])); + } + + /// + 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)) + { + this.SetLyncUserPlanOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetLyncUserPlanOperationCompleted); + } + this.InvokeAsync("SetLyncUserPlan", new object[] { + organizationId, + userUpn, + plan}, this.SetLyncUserPlanOperationCompleted, userState); + } + + 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) + { + object[] results = this.Invoke("DeleteUser", new object[] { + userUpn}); + return ((bool)(results[0])); + } + + /// + 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) + { + object[] results = this.EndInvoke(asyncResult); + return ((bool)(results[0])); + } + + /// + public void DeleteUserAsync(string userUpn) + { + this.DeleteUserAsync(userUpn, 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)) + { + 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) + { + object[] results = this.Invoke("GetFederationDomains", new object[] { + organizationId}); + return ((LyncFederationDomain[])(results[0])); + } + + /// + 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) + { + object[] results = this.EndInvoke(asyncResult); + return ((LyncFederationDomain[])(results[0])); + } + + /// + public void GetFederationDomainsAsync(string organizationId) + { + this.GetFederationDomainsAsync(organizationId, 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)) + { + 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) + { + 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) + { + return this.BeginInvoke("AddFederationDomain", new object[] { + organizationId, + domainName, + proxyFqdn}, callback, asyncState); + } + + /// + public bool EndAddFederationDomain(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((bool)(results[0])); + } + + /// + 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)) + { + this.AddFederationDomainOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddFederationDomainOperationCompleted); + } + this.InvokeAsync("AddFederationDomain", new object[] { + organizationId, + domainName, + proxyFqdn}, this.AddFederationDomainOperationCompleted, userState); + } + + 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) + { + 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) + { + return this.BeginInvoke("RemoveFederationDomain", new object[] { + organizationId, + domainName}, callback, asyncState); + } + + /// + public bool EndRemoveFederationDomain(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((bool)(results[0])); + } + + /// + 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)) + { + 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)) + { + 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() + { + this.Invoke("ReloadConfiguration", new object[0]); + } + + /// + public System.IAsyncResult BeginReloadConfiguration(System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("ReloadConfiguration", new object[0], callback, asyncState); + } + + /// + public void EndReloadConfiguration(System.IAsyncResult asyncResult) + { + this.EndInvoke(asyncResult); + } + + /// + public void ReloadConfigurationAsync() + { + this.ReloadConfigurationAsync(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)) + { + 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) + { + base.CancelAsync(userState); + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void CreateOrganizationCompletedEventHandler(object sender, CreateOrganizationCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + 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) + { + this.results = results; + } + + /// + public string Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void DeleteOrganizationCompletedEventHandler(object sender, DeleteOrganizationCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + 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) + { + this.results = results; + } + + /// + public bool Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((bool)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void CreateUserCompletedEventHandler(object sender, CreateUserCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + 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) + { + this.results = results; + } + + /// + public bool Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((bool)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetLyncUserGeneralSettingsCompletedEventHandler(object sender, GetLyncUserGeneralSettingsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + 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) + { + this.results = results; + } + + /// + public LyncUser Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((LyncUser)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void SetLyncUserPlanCompletedEventHandler(object sender, SetLyncUserPlanCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + 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) + { + this.results = results; + } + + /// + public bool Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((bool)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void DeleteUserCompletedEventHandler(object sender, DeleteUserCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + 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) + { + this.results = results; + } + + /// + public bool Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((bool)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetFederationDomainsCompletedEventHandler(object sender, GetFederationDomainsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + 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) + { + this.results = results; + } + + /// + public LyncFederationDomain[] Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((LyncFederationDomain[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void AddFederationDomainCompletedEventHandler(object sender, AddFederationDomainCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + 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) + { + this.results = results; + } + + /// + public bool Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((bool)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void RemoveFederationDomainCompletedEventHandler(object sender, RemoveFederationDomainCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + 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) + { + this.results = results; + } + + /// + public bool Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((bool)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void ReloadConfigurationCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); +} diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/WebsitePanel.Server.Client.csproj b/WebsitePanel/Sources/WebsitePanel.Server.Client/WebsitePanel.Server.Client.csproj index 0ac386bf..44b375f0 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.Client/WebsitePanel.Server.Client.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/WebsitePanel.Server.Client.csproj @@ -81,6 +81,7 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.Server/LyncServer.asmx b/WebsitePanel/Sources/WebsitePanel.Server/LyncServer.asmx new file mode 100644 index 00000000..8233e3df --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Server/LyncServer.asmx @@ -0,0 +1 @@ +<%@ WebService Language="C#" CodeBehind="LyncServer.asmx.cs" Class="WebsitePanel.Server.LyncServer" %> diff --git a/WebsitePanel/Sources/WebsitePanel.Server/LyncServer.asmx.cs b/WebsitePanel/Sources/WebsitePanel.Server/LyncServer.asmx.cs new file mode 100644 index 00000000..8f04045d --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Server/LyncServer.asmx.cs @@ -0,0 +1,236 @@ +// 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.ComponentModel; +using System.Web.Services; +using System.Web.Services.Protocols; +using WebsitePanel.Providers; +using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.Server.Utils; +using Microsoft.Web.Services3; + +namespace WebsitePanel.Server +{ + /// + /// OCS Web Service + /// + [WebService(Namespace = "http://smbsaas/websitepanel/server/")] + [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] + [Policy("ServerPolicy")] + [ToolboxItem(false)] + public class LyncServer : HostingServiceProviderWebService + { + private ILyncServer Lync + { + get { return (ILyncServer)Provider; } + } + + + #region Organization + [WebMethod, SoapHeader("settings")] + public string CreateOrganization(string organizationId, string sipDomain, bool enableConferencing, bool enableConferencingVideo, int maxConferenceSize, bool enabledFederation, bool enabledEnterpriseVoice) + { + try + { + Log.WriteStart("{0}.CreateOrganization", ProviderSettings.ProviderName); + string ret = Lync.CreateOrganization(organizationId, sipDomain, enableConferencing, enableConferencingVideo, maxConferenceSize, enabledFederation, enabledEnterpriseVoice); + Log.WriteEnd("{0}.CreateOrganization", ProviderSettings.ProviderName); + return ret; + } + catch (Exception ex) + { + Log.WriteError(String.Format("Error: {0}.CreateOrganization", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public bool DeleteOrganization(string organizationId, string sipDomain) + { + try + { + Log.WriteStart("{0}.DeleteOrganization", ProviderSettings.ProviderName); + bool ret = Lync.DeleteOrganization(organizationId, sipDomain); + Log.WriteEnd("{0}.DeleteOrganization", ProviderSettings.ProviderName); + return ret; + } + catch (Exception ex) + { + Log.WriteError(String.Format("Error: {0}.DeleteOrganization", ProviderSettings.ProviderName), ex); + throw; + } + } + #endregion + + #region Users + + [WebMethod, SoapHeader("settings")] + public bool CreateUser(string organizationId, string userUpn, LyncUserPlan plan) + { + try + { + Log.WriteStart("{0}.CreateUser", ProviderSettings.ProviderName); + bool ret = Lync.CreateUser(organizationId, userUpn, plan); + Log.WriteEnd("{0}.CreateUser", ProviderSettings.ProviderName); + return ret; + } + catch (Exception ex) + { + Log.WriteError(String.Format("Error: {0}.CreateUser", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public LyncUser GetLyncUserGeneralSettings(string organizationId, string userUpn) + { + try + { + Log.WriteStart("{0}.GetLyncUserGeneralSettings", ProviderSettings.ProviderName); + LyncUser ret = Lync.GetLyncUserGeneralSettings(organizationId, userUpn); + Log.WriteEnd("{0}.GetLyncUserGeneralSettings", ProviderSettings.ProviderName); + return ret; + } + catch (Exception ex) + { + Log.WriteError(String.Format("Error: {0}.GetLyncUserGeneralSettings", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public bool SetLyncUserPlan(string organizationId, string userUpn, LyncUserPlan plan) + { + try + { + Log.WriteStart("{0}.SetLyncUserPlan", ProviderSettings.ProviderName); + bool ret = Lync.SetLyncUserPlan(organizationId, userUpn, plan); + Log.WriteEnd("{0}.SetLyncUserPlan", ProviderSettings.ProviderName); + return ret; + } + catch (Exception ex) + { + Log.WriteError(String.Format("Error: {0}.SetLyncUserPlan", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public bool DeleteUser(string userUpn) + { + try + { + Log.WriteStart("{0}.DeleteUser", ProviderSettings.ProviderName); + bool ret = Lync.DeleteUser(userUpn); + Log.WriteEnd("{0}.DeleteUser", ProviderSettings.ProviderName); + return ret; + } + catch (Exception ex) + { + Log.WriteError(String.Format("Error: {0}.DeleteUser", ProviderSettings.ProviderName), ex); + throw; + } + } + + #endregion + + #region Federation + [WebMethod, SoapHeader("settings")] + public LyncFederationDomain[] GetFederationDomains(string organizationId) + { + try + { + Log.WriteStart("{0}.GetFederationDomains", ProviderSettings.ProviderName); + LyncFederationDomain[] ret = Lync.GetFederationDomains(organizationId); + Log.WriteEnd("{0}.GetFederationDomains", ProviderSettings.ProviderName); + return ret; + } + catch (Exception ex) + { + Log.WriteError(String.Format("Error: {0}.GetFederationDomains", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public bool AddFederationDomain(string organizationId, string domainName, string proxyFqdn) + { + try + { + Log.WriteStart("{0}.AddFederationDomain", ProviderSettings.ProviderName); + bool ret = Lync.AddFederationDomain(organizationId, domainName, proxyFqdn); + Log.WriteEnd("{0}.AddFederationDomain", ProviderSettings.ProviderName); + return ret; + } + catch (Exception ex) + { + Log.WriteError(String.Format("Error: {0}.AddFederationDomain", ProviderSettings.ProviderName), ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public bool RemoveFederationDomain(string organizationId, string domainName) + { + try + { + Log.WriteStart("{0}.RemoveFederationDomain", ProviderSettings.ProviderName); + bool ret = Lync.RemoveFederationDomain(organizationId, domainName); + Log.WriteEnd("{0}.RemoveFederationDomain", ProviderSettings.ProviderName); + return ret; + } + catch (Exception ex) + { + Log.WriteError(String.Format("Error: {0}.RemoveFederationDomain", ProviderSettings.ProviderName), ex); + throw; + } + } + #endregion + + [WebMethod, SoapHeader("settings")] + public void ReloadConfiguration() + { + try + { + Log.WriteStart("{0}.ReloadConfiguration", ProviderSettings.ProviderName); + Lync.ReloadConfiguration(); + Log.WriteEnd("{0}.ReloadConfiguration", ProviderSettings.ProviderName); + } + catch (Exception ex) + { + Log.WriteError(String.Format("Error: {0}.ReloadConfiguration", ProviderSettings.ProviderName), ex); + throw; + } + } + + + + + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Server/WebsitePanel.Server.csproj b/WebsitePanel/Sources/WebsitePanel.Server/WebsitePanel.Server.csproj index affbf40f..4ae2bf2d 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/WebsitePanel.Server.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Server/WebsitePanel.Server.csproj @@ -68,6 +68,7 @@ + @@ -108,6 +109,10 @@ + + LyncServer.asmx + Component + OCSEdgeServer.asmx Component diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config index 76798152..e15f3f0a 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config @@ -511,7 +511,15 @@ - + + + + + + + + + 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 c04ed97a..d0195f36 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx @@ -5005,4 +5005,133 @@ Consumer Organization Support + + Error deleting organization domain name. See audit log for more details. + + + Lync successfully enabled for this user + + + Cannot enable Lync User. The following errors have been occured: + + + Lync successfully added the federation domain + + + Cannot add federation domain. The following errors have been occured: + + + Lync successfully disabled for this user + + + Cannot delete Lync User, the following errors have been occured: + + + General Lync User settings have been successfully updated. + + + Error updating general Lync User settings. + + + Unable to add Lync user. + + + Unable to add Lync User to database. + + + Unable to check quota + + + Unable to delete Lync User. + + + Unable to delete Lync User from metadata. + + + Unable to get Lync proxy. + + + Unable to get user general settings. + + + Unable to set default settings. + + + Unable to get Lync Users. + + + Unable to get Lync Users count. + + + User first name is not specified. + + + Current user account is already enabled for Office Communications Server. + + + User last name is not specified. + + + Lync users quota has been reached. + + + Federation Allowed + + + Lync Users per Organization + + + Conferencing Allowed + + + Maximum participants per conference + + + Conference Video Allowed + + + Enterprise Voice Allowed + + + Enterprise Voice users + + + National Calls Allowed + + + Mobile Calls Allowed + + + International Calls Allowed + + + Lync Server + + + General Lync User settings have been successfully updated. + + + Lync User has been successfully created but the following errors have been occured: + + + Lync federation domain has been successfully created but the following errors have been occured: + + + Lync User has been successfully deleted but the following errors have been occured: + + + Error setting default organization lync user plan. See audit log for more details. + + + Add organization lync user plan + + + Delete plan + + + Unable to delete plan. Make sure the plan is not assigned to any user + + + Error creating organization plan. See audit log for more details. + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Icons.skin b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Icons.skin index 63089f09..5f9f29c4 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Icons.skin +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Icons.skin @@ -66,6 +66,13 @@ Default skin template. The following skins are provided as examples only. +<%-- Lync Icons --%> + + + + + + <%-- BlackBerry Icons --%> <%-- VPS Icons --%> diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/Exchange/lync16.png b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/Exchange/lync16.png new file mode 100644 index 00000000..e068fcbf Binary files /dev/null and b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/Exchange/lync16.png differ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/lync16.png b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/lync16.png new file mode 100644 index 00000000..e068fcbf Binary files /dev/null and b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/lync16.png differ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/lync48.png b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/lync48.png new file mode 100644 index 00000000..3e31fe51 Binary files /dev/null and b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/lync48.png differ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/lyncfederationdomains48.png b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/lyncfederationdomains48.png new file mode 100644 index 00000000..6eb49bc5 Binary files /dev/null and b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/lyncfederationdomains48.png differ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/lyncuser.png b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/lyncuser.png new file mode 100644 index 00000000..cbcbd3d5 Binary files /dev/null and b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/lyncuser.png differ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/lyncuserplan48.png b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/lyncuserplan48.png new file mode 100644 index 00000000..3c76aa7f Binary files /dev/null and b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/lyncuserplan48.png differ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/lyncuserplanadd48.png b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/lyncuserplanadd48.png new file mode 100644 index 00000000..5e1af53e Binary files /dev/null and b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/lyncuserplanadd48.png differ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SpaceQuotas.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SpaceQuotas.ascx.resx index 6c3b4ae4..3e12319d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SpaceQuotas.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SpaceQuotas.ascx.resx @@ -171,4 +171,22 @@ Number of VM: + + BlackBerry Users: + + + Databases: + + + OCS Users: + + + Sharepoint Sites: + + + User Accounts: + + + Lync Users: + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Framework/ES.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Framework/ES.cs index 845c52e4..aae6f6d5 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Framework/ES.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Framework/ES.cs @@ -82,7 +82,14 @@ namespace WebsitePanel.Portal { get { return GetCachedProxy(); } } - + + + public esLync Lync + { + get { return GetCachedProxy(); } + } + + public esOrganizations Organizations { get diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Helpers/LyncHelper.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Helpers/LyncHelper.cs new file mode 100644 index 00000000..2724433e --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Helpers/LyncHelper.cs @@ -0,0 +1,85 @@ +// 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 WebsitePanel.Providers.HostedSolution; +using WebsitePanel.Providers.ResultObjects; + +namespace WebsitePanel.Portal +{ + public class LyncHelper + { + + public LyncUser[] GetLyncUsersPaged(int itemId, + string filterColumn, string filterValue, + int maximumRows, int startRowIndex, string sortColumn) + { + if (!String.IsNullOrEmpty(filterValue)) + filterValue = filterValue + "%"; + if (maximumRows == 0) + { + maximumRows = Int32.MaxValue; + } + + string name = string.Empty; + string email = string.Empty; + + if (filterColumn == "DisplayName") + name = filterValue; + else + email = filterValue; + + + string[] data = sortColumn.Split(' '); + string direction = data.Length > 1 ? "DESC" : "ASC"; + LyncUsersPagedResult res = + ES.Services.Lync.GetLyncUsersPaged(itemId, data[0], direction, startRowIndex, maximumRows); + + return res.Value.PageUsers; + } + + + public int GetLyncUsersPagedCount(int itemId, string filterColumn, string filterValue) + { + string name = string.Empty; + string email = string.Empty; + + if (!string.IsNullOrEmpty(filterValue)) + filterValue = filterValue + "%"; + + if (filterColumn == "DisplayName") + name = filterValue; + else + email = filterValue; + + IntResult res = ES.Services.Lync.GetLyncUserCount(itemId); + return res.Value; + } + + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.cs index 544d78cf..4334509c 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.cs @@ -143,14 +143,13 @@ namespace WebsitePanel.Portal.ExchangeServer } else besStatsPanel.Visible = false; -/* + if (cntx.Groups.ContainsKey(ResourceGroups.Lync)) { lyncStatsPanel.Visible = true; BindLyncStats(); } else - */ lyncStatsPanel.Visible = false; 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 91cf60e9..ea488c1d 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 @@ -183,4 +183,16 @@ Mailbox Plans + + Lync + + + Lync User Plans + + + Lync Users + + + Lync Federation Domains + \ No newline at end of file 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 baa30d3a..dcb79f7e 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 @@ -202,6 +202,21 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls groups.Add(ocsGroup); } + private void PrepareLyncMenu(PackageContext cntx, List groups, string imagePath) + { + MenuGroup lyncGroup = + new MenuGroup(GetLocalizedString("Text.LyncGroup"), imagePath + "lync16.png"); + lyncGroup.MenuItems.Add(CreateMenuItem("LyncUsers", "lync_users")); + + lyncGroup.MenuItems.Add(CreateMenuItem("LyncUserPlans", "lync_userplans")); + + + if (CheckQouta(Quotas.LYNC_FEDERATION, cntx)) + lyncGroup.MenuItems.Add(CreateMenuItem("LyncFederationDomains", "lync_federationdomains")); + + groups.Add(lyncGroup); + } + private List PrepareMenu() { PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); @@ -238,6 +253,9 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls if (cntx.Groups.ContainsKey(ResourceGroups.OCS)) PrepareOCSMenu(cntx, groups, imagePath); + //Lync Menu + if (cntx.Groups.ContainsKey(ResourceGroups.Lync)) + PrepareLyncMenu(cntx, groups, imagePath); return groups; } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/App_LocalResources/LyncAddFederationDomain.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/App_LocalResources/LyncAddFederationDomain.ascx.resx new file mode 100644 index 00000000..e777f6ab --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/App_LocalResources/LyncAddFederationDomain.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 + + + Add Domain + + + Cancel + + + Please, enter correct domain name, for example "mydomain.com" or "sub.mydomain.com". + + + * + + + Please enter domain name + + + * + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/App_LocalResources/LyncAddLyncUserPlan.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/App_LocalResources/LyncAddLyncUserPlan.ascx.resx new file mode 100644 index 00000000..daee76c2 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/App_LocalResources/LyncAddLyncUserPlan.ascx.resx @@ -0,0 +1,183 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + <p> A plan is a template that defines the characteristics of a lync users </p> <p>The plan name needs to be unique. A plan cannot be modified. In case a user needs a plan with another characteristics, a new plan needs to be created and assigned to the user. A plan can only be deleted when the plan is not assigned to any users. </p> + + + Add Lync User Plan + + + Lync User Plan + + + Please enter correct plan + + + * + + + Instant Messaging + + + Conferencing + + + Enterprise Voice + + + Emergency Calls + + + National Calls + + + Plan Features + + + Lync User Plan + + + Federation + + + Conferencing Settings + + + Add New Plan + + + International Calls + + + Mobile Calls + + + None + + + Maximum Conference Size + + + Enterprise Voice Policy + + + Mobile Access + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/App_LocalResources/LyncCreateUser.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/App_LocalResources/LyncCreateUser.ascx.resx new file mode 100644 index 00000000..fd626cd7 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/App_LocalResources/LyncCreateUser.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 + + + Create Lync User + + + Create + + + Select an existing Organization user and click the “Create” button to enable an individual user account for Microsoft Lync Server. + + + Display name* : + + + Create Lync User + + + Plan Name* : + + \ No newline at end of file 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 new file mode 100644 index 00000000..bad6c174 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/App_LocalResources/LyncEditUser.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 + + + Edit Lync User + + + Save changes + + + <p> A plan is a template that defines the capabilities of a lync user. In order to change the plan assigned to this user, select a plan and click the Save Changes button </p> + + + Display name: + + + Edit Lync User + + + Plan Name : + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/App_LocalResources/LyncFederationDomains.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/App_LocalResources/LyncFederationDomains.ascx.resx new file mode 100644 index 00000000..e60864dd --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/App_LocalResources/LyncFederationDomains.ascx.resx @@ -0,0 +1,151 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + if(!confirm('Are you sure you want to delete selected federation domain?')) return false; else ShowProgressDialog('Deleting Federation Domain...'); + + + Delete + + + Delete Federation DOmain + + + No domains have been added yet. To add a new domain click "Add New Domain" button. + + + Domain Name + + + <p>By adding a federation domain you allow your users, that are enabled for federation, to interact through Lync with users from the specified domain. Your users as well as the users from the federated domain will see eachother status. </p> + +<p>Federation is a mutual agreement between you and your federation partner (owner of the domain you want to federate with). Once you have added the federation domain to your list, your partner will need to do the same from his side</p> + + + + + Lync Federation Domains + + + Lync Federation Domains + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/App_LocalResources/LyncUserPlans.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/App_LocalResources/LyncUserPlans.ascx.resx new file mode 100644 index 00000000..536a1d01 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/App_LocalResources/LyncUserPlans.ascx.resx @@ -0,0 +1,153 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Add New Plan + + + Set Default Plan + + + if(!confirm('Are you sure you want to delete selected plan?')) return false; else ShowProgressDialog('Deleting plan...'); + + + Delete + + + Delete Plan + + + No plans have been added yet. To add a new plan click "Add New Plan" button. + + + Default Plan + + + Plan + + + <p> A plan is a template that defines the capabilities of a lync users </p> <p>The plan name needs to be unique. A plan cannot be modified. In case a lync user needs a plan with another characteristics, a new plan needs to be created and assigned to the lync user. A plan can only be deleted when the plan is not assigned to any lync users. </p> + + + Lync User Plans + + + Lync User Plans + + \ 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 new file mode 100644 index 00000000..9114e730 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/App_LocalResources/LyncUsers.ascx.resx @@ -0,0 +1,155 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + Lync Users + + + Create Lync User + + + Display name + + + Sign-in name + + + <p>Microsoft Lync Server delivers unified communications to the users, including software-powered VoIP, Web and audio/video conferencing, and enterprise instant messaging.</p> +<p>Click the “Create Lync User” button to enable a user account for Microsoft Lync Server. </p> +<p>If you delete an account in Microsoft Lync Server, the account is no longer available for use with Microsoft Lync Server unless you enable the account again. When you delete an account, all Lync Server settings for the account are lost, so you must configure the account again after enabling.</p> + + + Display name + + + Sign-in name + + + Lync Users + + + return confirm('Are you sure you want to delete Lync User?'); + + + Lync User Plan + + + No users have been Lync enabled. To enable a user for Lync click "Create Lync User" button. + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncAddFederationDomain.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncAddFederationDomain.ascx new file mode 100644 index 00000000..759710c9 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncAddFederationDomain.ascx @@ -0,0 +1,64 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="LyncAddFederationDomain.ascx.cs" Inherits="WebsitePanel.Portal.LyncAddFederationDomain" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> +<%@ Register Src="../ExchangeServer/UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="../ExchangeServer/UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> + + + +
+
+
+ +
+
+ +
+
+
+
+ + +
+
+ + + + + + + + + + +
+ + + + + +
+ + + + +
+
+
+ + + +
+
+
+
+ +
+
+
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncAddFederationDomain.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncAddFederationDomain.ascx.cs new file mode 100644 index 00000000..642cf496 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncAddFederationDomain.ascx.cs @@ -0,0 +1,82 @@ +// 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 WebsitePanel.Providers.ResultObjects; +using WebsitePanel.EnterpriseServer; + +namespace WebsitePanel.Portal +{ + public partial class LyncAddFederationDomain : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + ProxyFQDN.Visible = ProxyFQDN.Enabled = false; + locProxyFQDN.Visible = false; + } + + private void AddDomain() + { + if (!Page.IsValid) + return; + + + // get domain name + string domainName = DomainName.Text.Trim(); + string proxyFQDN = ProxyFQDN.Text.Trim(); + + + LyncUserResult res = ES.Services.Lync.AddFederationDomain(PanelRequest.ItemID, domainName, proxyFQDN); + if (!(res.IsSuccess && res.ErrorCodes.Count == 0)) + { + messageBox.ShowMessage(res, "ADD_LYNC_FEDERATIONDOMAIN", "LYNC"); + } + + + // return + RedirectBack(); + } + + private void RedirectBack() + { + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "lync_federationdomains", + "SpaceID=" + PanelSecurity.PackageId)); + + } + + protected void btnCancel_Click(object sender, EventArgs e) + { + // return + RedirectBack(); + } + protected void btnAdd_Click(object sender, EventArgs e) + { + AddDomain(); + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncAddFederationDomain.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncAddFederationDomain.ascx.designer.cs new file mode 100644 index 00000000..f244efeb --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncAddFederationDomain.ascx.designer.cs @@ -0,0 +1,177 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal { + + + public partial class LyncAddFederationDomain { + + /// + /// 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; + + /// + /// AddFederationDomain control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTable AddFederationDomain; + + /// + /// 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; + + /// + /// DomainName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox DomainName; + + /// + /// DomainRequiredValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator DomainRequiredValidator; + + /// + /// DomainFormatValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator DomainFormatValidator; + + /// + /// locProxyFQDN control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locProxyFQDN; + + /// + /// ProxyFQDN control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox ProxyFQDN; + + /// + /// ProxyFqdnFormatValidator control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator ProxyFqdnFormatValidator; + + /// + /// 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; + + /// + /// 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; + + /// + /// 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; + + /// + /// 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/LyncAddLyncUserPlan.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncAddLyncUserPlan.ascx new file mode 100644 index 00000000..d8c55723 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncAddLyncUserPlan.ascx @@ -0,0 +1,132 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="LyncAddLyncUserPlan.ascx.cs" Inherits="WebsitePanel.Portal.Lync.LyncAddLyncUserPlan" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="../ExchangeServer/UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="../ExchangeServer/UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="../ExchangeServer/UserControls/SizeBox.ascx" TagName="SizeBox" TagPrefix="wsp" %> +<%@ Register Src="../ExchangeServer/UserControls/DaysBox.ascx" TagName="DaysBox" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" 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/Lync/LyncAddLyncUserPlan.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncAddLyncUserPlan.ascx.cs new file mode 100644 index 00000000..64b99076 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncAddLyncUserPlan.ascx.cs @@ -0,0 +1,157 @@ +// 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 WebsitePanel.EnterpriseServer; +using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.Providers.ResultObjects; + +namespace WebsitePanel.Portal.Lync +{ + public partial class LyncAddLyncUserPlan : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + + if (!IsPostBack) + { + if (PanelRequest.GetInt("LyncUserPlanId") != 0) + { + Providers.HostedSolution.LyncUserPlan plan = ES.Services.Lync.GetLyncUserPlan(PanelRequest.ItemID, PanelRequest.GetInt("LyncUserPlanId")); + + txtPlan.Text = plan.LyncUserPlanName; + chkIM.Checked = plan.IM; + chkIM.Enabled = false; + chkFederation.Checked = plan.Federation; + chkConferencing.Checked = plan.Conferencing; + chkMobility.Checked = plan.Mobility; + chkEnterpriseVoice.Checked = plan.EnterpriseVoice; + switch (plan.VoicePolicy) + { + case LyncVoicePolicyType.None: + break; + case LyncVoicePolicyType.Emergency: + chkEmergency.Checked = true; + break; + case LyncVoicePolicyType.National: + chkNational.Checked = true; + break; + case LyncVoicePolicyType.Mobile: + chkMobile.Checked = true; + break; + case LyncVoicePolicyType.International: + chkInternational.Checked = true; + break; + default: + chkNone.Checked = true; + break; + } + + locTitle.Text = plan.LyncUserPlanName; + this.DisableControls = true; + + } + else + { + chkIM.Checked = true; + chkIM.Enabled = false; + chkNone.Checked = true; + PackageContext cntx = ES.Services.Packages.GetPackageContext(PanelSecurity.PackageId); + if (cntx != null) + { + foreach (QuotaValueInfo quota in cntx.QuotasArray) + { + switch (quota.QuotaId) + { + case 371: + chkFederation.Checked = Convert.ToBoolean(quota.QuotaAllocatedValue); + chkFederation.Enabled = Convert.ToBoolean(quota.QuotaAllocatedValue); + break; + case 372: + chkConferencing.Checked = Convert.ToBoolean(quota.QuotaAllocatedValue); + chkConferencing.Enabled = Convert.ToBoolean(quota.QuotaAllocatedValue); + break; + case 375: + chkEnterpriseVoice.Checked = Convert.ToBoolean(quota.QuotaAllocatedValue); + chkEnterpriseVoice.Enabled = Convert.ToBoolean(quota.QuotaAllocatedValue); + break; + } + } + } + else + this.DisableControls = true; + } + } + + } + + protected void btnAdd_Click(object sender, EventArgs e) + { + AddPlan(); + } + + private void AddPlan() + { + try + { + Providers.HostedSolution.LyncUserPlan plan = new Providers.HostedSolution.LyncUserPlan(); + plan.LyncUserPlanName = txtPlan.Text; + plan.IsDefault = false; + + plan.IM = true; + plan.Mobility = chkMobility.Checked; + plan.Federation = chkFederation.Checked; + plan.Conferencing = chkConferencing.Checked; + + + plan.EnterpriseVoice = chkEnterpriseVoice.Checked; + if (!plan.EnterpriseVoice) + { + plan.VoicePolicy = LyncVoicePolicyType.None; + } + + int result = ES.Services.Lync.AddLyncUserPlan( PanelRequest.ItemID, + plan); + + + if (result < 0) + { + messageBox.ShowResultMessage(result); + return; + } + + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "lync_userplans", + "SpaceID=" + PanelSecurity.PackageId)); + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("LYNC_ADD_PLAN", ex); + } + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncAddLyncUserPlan.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncAddLyncUserPlan.ascx.designer.cs new file mode 100644 index 00000000..6ad8557f --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncAddLyncUserPlan.ascx.designer.cs @@ -0,0 +1,258 @@ +//------------------------------------------------------------------------------ +// +// 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 { + + + public partial class LyncAddLyncUserPlan { + + /// + /// 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; + + /// + /// secPlan control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secPlan; + + /// + /// Plan control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel Plan; + + /// + /// txtPlan control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtPlan; + + /// + /// valRequirePlan control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequirePlan; + + /// + /// secPlanFeatures control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secPlanFeatures; + + /// + /// PlanFeatures control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel PlanFeatures; + + /// + /// chkIM control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkIM; + + /// + /// chkMobility control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkMobility; + + /// + /// chkFederation control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkFederation; + + /// + /// chkConferencing control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkConferencing; + + /// + /// chkEnterpriseVoice control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkEnterpriseVoice; + + /// + /// secEnterpriseVoice control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secEnterpriseVoice; + + /// + /// EnterpriseVoice control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel EnterpriseVoice; + + /// + /// chkNone control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButton chkNone; + + /// + /// chkEmergency control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButton chkEmergency; + + /// + /// chkNational control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButton chkNational; + + /// + /// chkMobile control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButton chkMobile; + + /// + /// chkInternational control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RadioButton chkInternational; + + /// + /// 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; + + /// + /// 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/LyncCreateUser.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncCreateUser.ascx new file mode 100644 index 00000000..93d2389d --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncCreateUser.ascx @@ -0,0 +1,62 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="LyncCreateUser.ascx.cs" Inherits="WebsitePanel.Portal.Lync.CreateLyncUser" %> +<%@ Register Src="../ExchangeServer/UserControls/UserSelector.ascx" TagName="UserSelector" TagPrefix="wsp" %> +<%@ Register Src="../ExchangeServer/UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="../ExchangeServer/UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/QuotaViewer.ascx" TagName="QuotaViewer" TagPrefix="wsp" %> +<%@ Register Src="UserControls/LyncUserPlanSelector.ascx" TagName="LyncUserPlanSelector" TagPrefix="wsp" %> + + +
+
+
+ +
+
+ +
+
+
+
+ + +
+
+ + + + + + + +
+ +
+ + + + + + +
+ + + +
+ + +
+ +
+
+
+
+ +
+
+
+
+ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncCreateUser.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncCreateUser.ascx.cs new file mode 100644 index 00000000..eabe3e15 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncCreateUser.ascx.cs @@ -0,0 +1,66 @@ +// 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 WebsitePanel.Providers.ResultObjects; +using WebsitePanel.EnterpriseServer; + +namespace WebsitePanel.Portal.Lync +{ + public partial class CreateLyncUser : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + WebsitePanel.Providers.HostedSolution.LyncUserPlan[] plans = ES.Services.Lync.GetLyncUserPlans(PanelRequest.ItemID); + + if (plans.Length == 0) + btnCreate.Enabled = false; + } + + + } + + protected void btnCreate_Click(object sender, EventArgs e) + { + int accountId = userSelector.GetAccountId(); + LyncUserResult res = ES.Services.Lync.CreateLyncUser(PanelRequest.ItemID, accountId, Convert.ToInt32(planSelector.planId)); + if (res.IsSuccess && res.ErrorCodes.Count == 0) + { + Response.Redirect(EditUrl("AccountID", accountId.ToString(), "edit_lync_user", + "SpaceID=" + PanelSecurity.PackageId, + "ItemID=" + PanelRequest.ItemID)); + } + else + { + messageBox.ShowMessage(res, "CREATE_LYNC_USER", "LYNC"); + } + } + } +} \ No newline at end of file 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 new file mode 100644 index 00000000..4b7232df --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncCreateUser.ascx.designer.cs @@ -0,0 +1,132 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.Lync { + + + public partial class CreateLyncUser { + + /// + /// 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; + + /// + /// ExistingUserTable control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTable ExistingUserTable; + + /// + /// Localize1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize Localize1; + + /// + /// userSelector control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.UserSelector userSelector; + + /// + /// locPlanName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locPlanName; + + /// + /// planSelector control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.Lync.UserControls.LyncUserPlanSelector planSelector; + + /// + /// btnCreate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCreate; + + /// + /// 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 new file mode 100644 index 00000000..b1017e85 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx @@ -0,0 +1,54 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="LyncEditUser.ascx.cs" Inherits="WebsitePanel.Portal.Lync.EditLyncUser" %> +<%@ Register Src="../ExchangeServer/UserControls/UserSelector.ascx" TagName="UserSelector" TagPrefix="wsp" %> +<%@ Register Src="../ExchangeServer/UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="../ExchangeServer/UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> +<%@ 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" %> + + +
+
+
+ +
+
+ +
+
+
+
+ + + - + +
+
+ + + + + + + + +
+ + + +
+ +
+ +
+
+
+
+ +
+
+
+
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.cs new file mode 100644 index 00000000..aa3b96fa --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.cs @@ -0,0 +1,76 @@ +// 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 WebsitePanel.EnterpriseServer; +using WebsitePanel.Providers.ResultObjects; +using WebsitePanel.Providers.HostedSolution; + +namespace WebsitePanel.Portal.Lync +{ + public partial class EditLyncUser : WebsitePanelModuleBase + { + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + BindItems(); + + } + + private void BindItems() + { + // get settings + LyncUser lyncUser = ES.Services.Lync.GetLyncUserGeneralSettings(PanelRequest.ItemID, PanelRequest.AccountID); + + // title + litDisplayName.Text = lyncUser.DisplayName; + + planSelector.planId = lyncUser.LyncUserPlanId.ToString(); + } + + protected void btnSave_Click(object sender, EventArgs e) + { + if (!Page.IsValid) + return; + try + { + LyncUserResult res = ES.Services.Lync.SetUserLyncPlan(PanelRequest.ItemID, PanelRequest.AccountID, Convert.ToInt32(planSelector.planId)); + if (res.IsSuccess && res.ErrorCodes.Count == 0) + { + messageBox.ShowSuccessMessage("UPDATE_LYNC_USER"); + return; + } + } + catch(Exception ex) + { + messageBox.ShowErrorMessage("UPDATE_LYNC_USER", ex); + } + } + } +} \ No newline at end of file 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 new file mode 100644 index 00000000..4d44e037 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncEditUser.ascx.designer.cs @@ -0,0 +1,114 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.Lync { + + + public partial class EditLyncUser { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Menu menu; + + /// + /// Image1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image Image1; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// litDisplayName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litDisplayName; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// locPlanName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locPlanName; + + /// + /// planSelector control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.Lync.UserControls.LyncUserPlanSelector planSelector; + + /// + /// btnSave control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnSave; + + /// + /// 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/LyncFederationDomains.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncFederationDomains.ascx new file mode 100644 index 00000000..df871012 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncFederationDomains.ascx @@ -0,0 +1,63 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="LyncFederationDomains.ascx.cs" Inherits="WebsitePanel.Portal.Lync.LyncFederationDomains" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="../ExchangeServer/UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="../ExchangeServer/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/Lync/LyncFederationDomains.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncFederationDomains.ascx.cs new file mode 100644 index 00000000..9a74216a --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncFederationDomains.ascx.cs @@ -0,0 +1,87 @@ +// 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 WebsitePanel.EnterpriseServer; +using WebsitePanel.Providers.ResultObjects; +using WebsitePanel.Providers.HostedSolution; + +namespace WebsitePanel.Portal.Lync +{ + public partial class LyncFederationDomains : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + // bind domain names + BindDomainNames(); + } + + } + + private void BindDomainNames() + { + LyncFederationDomain[] list = ES.Services.Lync.GetFederationDomains(PanelRequest.ItemID); + + gvDomains.DataSource = list; + gvDomains.DataBind(); + + } + + protected void btnAddDomain_Click(object sender, EventArgs e) + { + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "add_lyncfederation_domain", + "SpaceID=" + PanelSecurity.PackageId)); + } + + protected void gvDomains_RowCommand(object sender, GridViewCommandEventArgs e) + { + if (e.CommandName == "DeleteItem") + { + try + { + LyncUserResult res = ES.Services.Lync.RemoveFederationDomain(PanelRequest.ItemID, e.CommandArgument.ToString()); + if (!(res.IsSuccess && res.ErrorCodes.Count == 0)) + { + messageBox.ShowMessage(res, "DELETE_LYNC_FEDERATIONDOMAIN", "LYNC"); + return; + } + + // rebind domains + BindDomainNames(); + } + catch (Exception ex) + { + ShowErrorMessage("LYNC_DELETE_DOMAIN", ex); + } + } + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncFederationDomains.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncFederationDomains.ascx.designer.cs new file mode 100644 index 00000000..8492606b --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncFederationDomains.ascx.designer.cs @@ -0,0 +1,96 @@ +//------------------------------------------------------------------------------ +// +// 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 { + + + public partial class LyncFederationDomains { + + /// + /// 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; + + /// + /// 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/LyncUserPlans.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncUserPlans.ascx new file mode 100644 index 00000000..e91be256 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncUserPlans.ascx @@ -0,0 +1,73 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="LyncUserPlans.ascx.cs" Inherits="WebsitePanel.Portal.Lync.LyncUserPlans" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="../ExchangeServer/UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="../ExchangeServer/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("LyncUserPlanName")%> + + + + + +
+ /> +
+
+
+ + +   + + +
+
+
+
+ +
+ +
+
+
+ +
+
+
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncUserPlans.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncUserPlans.ascx.cs new file mode 100644 index 00000000..3137598d --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncUserPlans.ascx.cs @@ -0,0 +1,125 @@ +// 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 WebsitePanel.EnterpriseServer; +using WebsitePanel.Providers.HostedSolution; + +namespace WebsitePanel.Portal.Lync +{ + public partial class LyncUserPlans : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + BindPlans(); + } + + } + + public string GetPlanDisplayUrl(string LyncUserPlanId) + { + return EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "add_lyncuserplan", + "LyncUserPlanId=" + LyncUserPlanId, + "ItemID=" + PanelRequest.ItemID); + } + + + private void BindPlans() + { + LyncUserPlan[] list = ES.Services.Lync.GetLyncUserPlans(PanelRequest.ItemID); + + gvPlans.DataSource = list; + gvPlans.DataBind(); + + //check if organization has only one default domain + if (gvPlans.Rows.Count == 1) + { + btnSetDefaultPlan.Enabled = false; + } + } + + public string IsChecked(bool val) + { + return val ? "checked" : ""; + } + + protected void btnAddPlan_Click(object sender, EventArgs e) + { + btnSetDefaultPlan.Enabled = true; + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "add_lyncuserplan", + "SpaceID=" + PanelSecurity.PackageId)); + } + + protected void gvPlan_RowCommand(object sender, GridViewCommandEventArgs e) + { + if (e.CommandName == "DeleteItem") + { + int planId = Utils.ParseInt(e.CommandArgument.ToString(), 0); + + try + { + int result = ES.Services.Lync.DeleteLyncUserPlan(PanelRequest.ItemID, planId); + + if (result < 0) + { + messageBox.ShowResultMessage(result); + return; + } + + } + catch (Exception) + { + messageBox.ShowErrorMessage("LYNC_DELETE_PLAN"); + } + + BindPlans(); + } + } + + protected void btnSetDefaultPlan_Click(object sender, EventArgs e) + { + // get domain + int planId = Utils.ParseInt(Request.Form["DefaultPlan"], 0); + + try + { + ES.Services.Lync.SetOrganizationDefaultLyncUserPlan(PanelRequest.ItemID, planId); + + // rebind domains + BindPlans(); + } + catch (Exception ex) + { + ShowErrorMessage("LYNC_SET_DEFAULT_PLAN", ex); + } + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncUserPlans.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncUserPlans.ascx.designer.cs new file mode 100644 index 00000000..7cde581a --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncUserPlans.ascx.designer.cs @@ -0,0 +1,105 @@ +//------------------------------------------------------------------------------ +// +// 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 { + + + public partial class LyncUserPlans { + + /// + /// 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; + + /// + /// btnAddPlan control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnAddPlan; + + /// + /// gvPlans control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvPlans; + + /// + /// btnSetDefaultPlan control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnSetDefaultPlan; + + /// + /// 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 new file mode 100644 index 00000000..0fe66529 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncUsers.ascx @@ -0,0 +1,91 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="LyncUsers.ascx.cs" Inherits="WebsitePanel.Portal.Lync.LyncUsers" %> +<%@ Register Src="../ExchangeServer/UserControls/UserSelector.ascx" TagName="UserSelector" TagPrefix="wsp" %> +<%@ Register Src="../ExchangeServer/UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="../ExchangeServer/UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/QuotaViewer.ascx" TagName="QuotaViewer" TagPrefix="wsp" %> + + +
+
+
+ +
+
+ +
+
+
+
+ + +
+
+ + +
+
+ +
+
+ + + DisplayName + Email + + + +
+
+ + + + + + + + + <%# Eval("DisplayName") %> + + + + + + + + + + + + + + + + + + + +
+ +     + +
+
+
+ +
+
+
+
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncUsers.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncUsers.ascx.cs new file mode 100644 index 00000000..cefe0967 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncUsers.ascx.cs @@ -0,0 +1,100 @@ +// 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 WebsitePanel.Providers.Common; +using WebsitePanel.Providers.HostedSolution; + +namespace WebsitePanel.Portal.Lync +{ + public partial class LyncUsers : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + BindStats(); + } + + private void BindStats() + { + OrganizationStatistics stats = ES.Services.Organizations.GetOrganizationStatistics(PanelRequest.ItemID); + int allocatedLyncUsers = stats.AllocatedLyncUsers; + int usedUsers = stats.CreatedLyncUsers; + usersQuota.QuotaUsedValue = usedUsers; + usersQuota.QuotaValue = allocatedLyncUsers; + } + + protected void btnCreateUser_Click(object sender, EventArgs e) + { + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "create_new_lync_user", + "SpaceID=" + PanelSecurity.PackageId)); + } + + public string GetAccountImage() + { + + return GetThemedImage("Exchange/admin_16.png"); + } + + public string GetUserEditUrl(string accountId) + { + return EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "edit_lync_user", + "AccountID=" + accountId, + "ItemID=" + PanelRequest.ItemID); + } + + + + protected void odsAccountsPaged_Selected(object sender, System.Web.UI.WebControls.ObjectDataSourceStatusEventArgs e) + { + + } + + protected void gvUsers_RowCommand(object sender, System.Web.UI.WebControls.GridViewCommandEventArgs e) + { + if (e.CommandName == "DeleteItem") + { + try + { + ResultObject res = ES.Services.Lync.DeleteLyncUser(PanelRequest.ItemID, Convert.ToInt32(e.CommandArgument)); + + messageBox.ShowMessage(res, "DELETE_LYNC_USER", "LYNC"); + + // rebind grid + gvUsers.DataBind(); + BindStats(); + + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("DELETE_LYNC_USERS", ex); + } + } + } + + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncUsers.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncUsers.ascx.designer.cs new file mode 100644 index 00000000..dea6472f --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/LyncUsers.ascx.designer.cs @@ -0,0 +1,159 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.Lync { + + + public partial class LyncUsers { + + /// + /// 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; + + /// + /// btnCreateUser control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCreateUser; + + /// + /// SearchPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel SearchPanel; + + /// + /// ddlSearchColumn control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlSearchColumn; + + /// + /// txtSearchValue control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtSearchValue; + + /// + /// cmdSearch control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ImageButton cmdSearch; + + /// + /// gvUsers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvUsers; + + /// + /// odsAccountsPaged control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ObjectDataSource odsAccountsPaged; + + /// + /// 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; + + /// + /// usersQuota control. + /// + /// + /// Auto-generated field. + /// 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/LyncUserPlanSelector.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserPlanSelector.ascx new file mode 100644 index 00000000..c6d336f8 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserPlanSelector.ascx @@ -0,0 +1,2 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="LyncUserPlanSelector.ascx.cs" Inherits="WebsitePanel.Portal.Lync.UserControls.LyncUserPlanSelector" %> + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserPlanSelector.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserPlanSelector.ascx.cs new file mode 100644 index 00000000..31ba7eef --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserPlanSelector.ascx.cs @@ -0,0 +1,100 @@ +// 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; + +namespace WebsitePanel.Portal.Lync.UserControls +{ + public partial class LyncUserPlanSelector : WebsitePanelControlBase + { + + private string planToSelect; + + public string planId + { + + get { return ddlPlan.SelectedItem.Value; } + set + { + planToSelect = value; + foreach(ListItem li in ddlPlan.Items) + { + if (li.Value == value) + { + ddlPlan.ClearSelection(); + li.Selected = true; + break; + } + } + } + } + + public int plansCount + { + get + { + return this.ddlPlan.Items.Count; + } + } + + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + BindPlans(); + } + } + + private void BindPlans() + { + WebsitePanel.Providers.HostedSolution.LyncUserPlan[] plans = ES.Services.Lync.GetLyncUserPlans(PanelRequest.ItemID); + + foreach (WebsitePanel.Providers.HostedSolution.LyncUserPlan plan in plans) + { + ListItem li = new ListItem(); + li.Text = plan.LyncUserPlanName; + li.Value = plan.LyncUserPlanId.ToString(); + li.Selected = plan.IsDefault; + ddlPlan.Items.Add(li); + } + + foreach (ListItem li in ddlPlan.Items) + { + if (li.Value == planToSelect) + { + ddlPlan.ClearSelection(); + li.Selected = true; + break; + } + } + + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserPlanSelector.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserPlanSelector.ascx.designer.cs new file mode 100644 index 00000000..db7df3f3 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Lync/UserControls/LyncUserPlanSelector.ascx.designer.cs @@ -0,0 +1,24 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.Lync.UserControls { + + + public partial class LyncUserPlanSelector { + + /// + /// ddlPlan control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlPlan; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/App_LocalResources/Lync_Settings.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/App_LocalResources/Lync_Settings.ascx.resx new file mode 100644 index 00000000..79fdeff7 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/App_LocalResources/Lync_Settings.ascx.resx @@ -0,0 +1,144 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Add + + + Located on the same server + + + Lync Servers + + + Root OU: + + + Lync Frontend and Director Servers + + + Enterprise pool or <br/>Standard Edition Server name: + + + Simple Url Base: + + + <Located on the same server> + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/Lync_Settings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/Lync_Settings.ascx new file mode 100644 index 00000000..0d569521 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/Lync_Settings.ascx @@ -0,0 +1,54 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Lync_Settings.ascx.cs" Inherits="WebsitePanel.Portal.ProviderControls.Lync_Settings" %> + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + + + + + + + + + + + + +
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/Lync_Settings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/Lync_Settings.ascx.cs new file mode 100644 index 00000000..0d7110ef --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/Lync_Settings.ascx.cs @@ -0,0 +1,181 @@ +// Copyright (c) 2011, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +using System; +using System.Collections.Generic; +using System.Data; +using System.Web.UI.WebControls; +using WebsitePanel.EnterpriseServer; +using WebsitePanel.Providers.HostedSolution; + +namespace WebsitePanel.Portal.ProviderControls +{ + public partial class Lync_Settings : WebsitePanelControlBase, IHostingServiceProviderSettings + { + + public const string LyncServersData = "LyncServersData"; + + protected void Page_Load(object sender, EventArgs e) + { + + } + + + + public void BindSettings(System.Collections.Specialized.StringDictionary settings) + { + txtServerName.Text = settings[LyncConstants.PoolFQDN]; + txtSimpleUrlBase.Text = settings[LyncConstants.SimpleUrlRoot]; + + + LyncServers = settings["LyncServersServiceID"]; + + BindLyncServices(ddlLyncServers); + + Utils.SelectListItem(ddlLyncServers, settings["LyncServersServiceID"]); + + UpdateLyncServersGrid(); + } + + public void SaveSettings(System.Collections.Specialized.StringDictionary settings) + { + settings[LyncConstants.PoolFQDN] = txtServerName.Text.Trim(); + settings[LyncConstants.SimpleUrlRoot] = txtSimpleUrlBase.Text.Trim(); + + settings["LyncServersServiceID"] = LyncServers; + } + + + public string LyncServers + { + get + { + return ViewState[LyncServersData] != null ? ViewState[LyncServersData].ToString() : string.Empty; + } + set + { + ViewState[LyncServersData] = value; + } + } + + + protected void btnAddLyncServer_Click(object sender, EventArgs e) + { + if (!string.IsNullOrEmpty(LyncServers)) + LyncServers += ","; + + LyncServers += ddlLyncServers.SelectedItem.Value; + + UpdateLyncServersGrid(); + BindLyncServices(ddlLyncServers); + + } + + public List GetServices(string data) + { + if (string.IsNullOrEmpty(data)) + return null; + List list = new List(); + string[] servicesIds = data.Split(','); + foreach (string current in servicesIds) + { + ServiceInfo serviceInfo = ES.Services.Servers.GetServiceInfo(Utils.ParseInt(current)); + list.Add(serviceInfo); + } + + + return list; + } + + private void UpdateLyncServersGrid() + { + gvLyncServers.DataSource = GetServices(LyncServers); + gvLyncServers.DataBind(); + } + + + public void BindLyncServices(DropDownList ddl) + { + ddl.Items.Clear(); + + ServiceInfo serviceInfo = ES.Services.Servers.GetServiceInfo(PanelRequest.ServiceId); + DataView dvServices = ES.Services.Servers.GetRawServicesByGroupName(ResourceGroups.Lync).Tables[0].DefaultView; + + foreach (DataRowView dr in dvServices) + { + int serviceId = (int)dr["ServiceID"]; + ServiceInfo currentServiceInfo = ES.Services.Servers.GetServiceInfo(serviceId); + + if (currentServiceInfo == null || currentServiceInfo.ProviderId != serviceInfo.ProviderId) + continue; + + List services = GetServices(LyncServers); + bool exists = false; + if (services != null) + foreach (ServiceInfo current in services) + { + if (current != null && current.ServiceId == serviceId) + { + exists = true; + break; + } + } + + if (!exists) + ddl.Items.Add(new ListItem(dr["FullServiceName"].ToString(), serviceId.ToString())); + + } + + ddl.Visible = ddl.Items.Count != 0; + btnAddLyncServer.Visible = ddl.Items.Count != 0; + + } + + protected void gvLyncServers_RowCommand(object sender, GridViewCommandEventArgs e) + { + if (e.CommandName == "RemoveServer") + { + string str = string.Empty; + List services = GetServices(LyncServers); + foreach (ServiceInfo current in services) + { + if (current.ServiceId == Utils.ParseInt(e.CommandArgument.ToString())) + continue; + + + str += current.ServiceId + ","; + } + + LyncServers = str.TrimEnd(','); + UpdateLyncServersGrid(); + BindLyncServices(ddlLyncServers); + } + } + + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/Lync_Settings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/Lync_Settings.ascx.designer.cs new file mode 100644 index 00000000..78c838e3 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/Lync_Settings.ascx.designer.cs @@ -0,0 +1,105 @@ +//------------------------------------------------------------------------------ +// +// 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.ProviderControls { + + + public partial class Lync_Settings { + + /// + /// locServerName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locServerName; + + /// + /// txtServerName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtServerName; + + /// + /// RequiredFieldValidator2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator2; + + /// + /// locSimpleUrlBase control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locSimpleUrlBase; + + /// + /// txtSimpleUrlBase control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtSimpleUrlBase; + + /// + /// RequiredFieldValidator1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator1; + + /// + /// locLynServers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locLynServers; + + /// + /// ddlLyncServers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlLyncServers; + + /// + /// btnAddLyncServer control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnAddLyncServer; + + /// + /// gvLyncServers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvLyncServers; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx index 6ef28dbf..66a65218 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx @@ -26,6 +26,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + @@ -34,9 +59,9 @@ - - - + + + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx.cs index 211953ad..173489f7 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx.cs @@ -54,13 +54,18 @@ namespace WebsitePanel.Portal { // QUOTA CONTROL ID <=> TABLE ROW CONTROL ID { "quotaDiskspace", "pnlDiskspace" }, - { "quotaBandwidth", "pnlBandwidth" }, - { "quotaFtpAccounts", "pnlFtpAccounts" }, + { "quotaBandwidth", "pnlBandwidth" }, { "quotaDomains", "pnlDomains" }, { "quotaSubDomains", "pnlSubDomains" }, { "quotaDomainPointers", "pnlDomainPointers" }, - { "quotaMailAccounts", "pnlMailAccounts" }, + { "quotaUserAccounts", "pnlUserAccounts" }, + { "quotaMailAccounts", "pnlMailboxes" }, + { "quotaOCSUsers", "pnlOCSUsers" }, + { "quotaLyncUsers", "pnlLyncUsers" }, + { "quotaBlackBerryUsers", "pnlBlackBerryUsers" }, + { "quotaSharepointSites", "pnlSharepointSites" }, { "quotaWebSites", "pnlWebSites" }, + { "quotaDatabases", "pnlDatabases" }, { "quotaNumberOfVm", "pnlHyperVForPC" } }; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx.designer.cs index 3f4f3b9c..f6478bd6 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SpaceQuotas.ascx.designer.cs @@ -147,6 +147,168 @@ namespace WebsitePanel.Portal { ///
protected global::WebsitePanel.Portal.Quota quotaDomainPointers; + /// + /// pnlUserAccounts control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow pnlUserAccounts; + + /// + /// lblUserAccounts control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblUserAccounts; + + /// + /// quotaUserAccounts control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.Quota quotaUserAccounts; + + /// + /// pnlMailAccounts control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow pnlMailAccounts; + + /// + /// lblMailAccounts control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblMailAccounts; + + /// + /// quotaMailAccounts control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.Quota quotaMailAccounts; + + /// + /// pnlOCSUsers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow pnlOCSUsers; + + /// + /// lblOCSUsers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblOCSUsers; + + /// + /// quotaOCSUsers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.Quota quotaOCSUsers; + + /// + /// pnlLyncUsers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow pnlLyncUsers; + + /// + /// lblLyncUsers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblLyncUsers; + + /// + /// quotaLyncUsers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.Quota quotaLyncUsers; + + /// + /// pnlBlackBerryUsers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow pnlBlackBerryUsers; + + /// + /// lblBlackBerryUsers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblBlackBerryUsers; + + /// + /// quotaBlackBerryUsers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.Quota quotaBlackBerryUsers; + + /// + /// pnlSharepointSites control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow pnlSharepointSites; + + /// + /// lblSharepointSites control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblSharepointSites; + + /// + /// quotaSharepointSites control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.Quota quotaSharepointSites; + /// /// pnlWebSites control. /// @@ -202,31 +364,31 @@ namespace WebsitePanel.Portal { protected global::WebsitePanel.Portal.Quota quotaFtpAccounts; /// - /// pnlMailAccounts control. + /// pnlDatabases control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.HtmlControls.HtmlTableRow pnlMailAccounts; + protected global::System.Web.UI.HtmlControls.HtmlTableRow pnlDatabases; /// - /// lblMailAccounts control. + /// lblDatabases control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.Label lblMailAccounts; + protected global::System.Web.UI.WebControls.Label lblDatabases; /// - /// quotaMailAccounts control. + /// quotaDatabases control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::WebsitePanel.Portal.Quota quotaMailAccounts; + protected global::WebsitePanel.Portal.Quota quotaDatabases; /// /// pnlHyperVForPC control. diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj index 6c2fe5c9..1e873ce9 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj @@ -161,6 +161,7 @@ + @@ -224,6 +225,62 @@ MailboxPlanSelector.ascx + + LyncAddFederationDomain.ascx + ASPXCodeBehind + + + LyncAddFederationDomain.ascx + + + LyncAddLyncUserPlan.ascx + ASPXCodeBehind + + + LyncAddLyncUserPlan.ascx + + + LyncCreateUser.ascx + ASPXCodeBehind + + + LyncCreateUser.ascx + + + LyncEditUser.ascx + ASPXCodeBehind + + + LyncEditUser.ascx + + + LyncFederationDomains.ascx + ASPXCodeBehind + + + LyncFederationDomains.ascx + + + LyncUserPlans.ascx + ASPXCodeBehind + + + LyncUserPlans.ascx + + + LyncUsers.ascx + ASPXCodeBehind + + + LyncUsers.ascx + + + LyncUserPlanSelector.ascx + ASPXCodeBehind + + + LyncUserPlanSelector.ascx + hMailServer5_EditAccount.ascx ASPXCodeBehind @@ -269,6 +326,13 @@ hMailServer5_Settings.ascx + + Lync_Settings.ascx + ASPXCodeBehind + + + Lync_Settings.ascx + NotifyOverusedDatabases.ascx ASPXCodeBehind @@ -3690,12 +3754,21 @@ + + + + + + + + + @@ -4813,6 +4886,14 @@ + + + + + + + + Designer @@ -5766,7 +5847,9 @@ Designer - + + +