diff --git a/WebsitePanel/Database/install_db.sql b/WebsitePanel/Database/install_db.sql index cebc7caf..be7e742f 100644 --- a/WebsitePanel/Database/install_db.sql +++ b/WebsitePanel/Database/install_db.sql @@ -29,7 +29,7 @@ CREATE TABLE [dbo].[ExchangeAccounts]( [AccountID] [int] IDENTITY(1,1) NOT NULL, [ItemID] [int] NOT NULL, [AccountType] [int] NOT NULL, - [AccountName] [nvarchar](20) COLLATE Latin1_General_CI_AS NOT NULL, + [AccountName] [nvarchar](300) COLLATE Latin1_General_CI_AS NOT NULL, [DisplayName] [nvarchar](300) COLLATE Latin1_General_CI_AS NOT NULL, [PrimaryEmailAddress] [nvarchar](300) COLLATE Latin1_General_CI_AS NULL, [MailEnabledPublicFolder] [bit] NULL, @@ -37,6 +37,8 @@ CREATE TABLE [dbo].[ExchangeAccounts]( [SamAccountName] [nvarchar](100) COLLATE Latin1_General_CI_AS NULL, [AccountPassword] [nvarchar](200) COLLATE Latin1_General_CI_AS NULL, [CreatedDate] [datetime] NOT NULL, + [MailboxPlanId] [int] NULL, + [SubscriberNumber] [nvarchar] (32) COLLATE Latin1_General_CI_AS NULL, CONSTRAINT [PK_ExchangeAccounts] PRIMARY KEY CLUSTERED ( [AccountID] ASC @@ -54,6 +56,32 @@ SET QUOTED_IDENTIFIER ON GO +CREATE TABLE [dbo].[ExchangeMailboxPlans]( + [MailboxPlanId] [int] IDENTITY(1,1) NOT NULL, + [ItemID] [int] NOT NULL, + [MailboxPlan] [nvarchar](300) COLLATE Latin1_General_CI_AS NOT NULL, + [EnableActiveSync] [bit] NOT NULL, + [EnableIMAP] [bit] NOT NULL, + [EnableMAPI] [bit] NOT NULL, + [EnableOWA] [bit] NOT NULL, + [EnablePOP] [bit] NOT NULL, + [IsDefault] [bit] NOT NULL, + [IssueWarningPct] [int] NOT NULL, + [KeepDeletedItemsDays] [int] NOT NULL, + [MailboxSizeMB] [int] NOT NULL, + [MaxReceiveMessageSizeKB] [int] NOT NULL, + [MaxRecipients] [int] NOT NULL, + [MaxSendMessageSizeKB] [int] NOT NULL, + [ProhibitSendPct] [int] NOT NULL, + [ProhibitSendReceivePct] [int] NOT NULL, + [HideFromAddressBook] [bit] NOT NULL, + CONSTRAINT [PK_ExchangeMailboxPlans] PRIMARY KEY CLUSTERED +( + [MailboxPlanId] 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 @@ -80,7 +108,8 @@ SELECT AccountName, DisplayName, PrimaryEmailAddress, - MailEnabledPublicFolder + MailEnabledPublicFolder, + SubscriberNumber FROM ExchangeAccounts WHERE @@ -109,6 +138,7 @@ END + GO @@ -150,21 +180,71 @@ CREATE PROCEDURE [dbo].[GetExchangeAccounts] ) AS SELECT - AccountID, - ItemID, - AccountType, - AccountName, - DisplayName, - PrimaryEmailAddress, - MailEnabledPublicFolder + E.AccountID, + E.ItemID, + E.AccountType, + E.AccountName, + E.DisplayName, + E.PrimaryEmailAddress, + E.MailEnabledPublicFolder, + E.MailboxPlanId, + P.MailboxPlan, + E.SubscriberNumber FROM - ExchangeAccounts + ExchangeAccounts AS E +INNER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId WHERE - ItemID = @ItemID AND - (AccountType = @AccountType OR @AccountType IS NULL) + E.ItemID = @ItemID AND + (E.AccountType = @AccountType OR @AccountType IS NULL) ORDER BY DisplayName RETURN +GO + + + + + + + + + + + + + + + + + + +CREATE PROCEDURE [dbo].[GetExchangeAccountByAccountName] +( + @ItemID int, + @AccountName nvarchar(300) +) +AS +SELECT + E.AccountID, + E.ItemID, + E.AccountType, + E.AccountName, + E.DisplayName, + E.PrimaryEmailAddress, + E.MailEnabledPublicFolder, + E.MailboxManagerActions, + E.SamAccountName, + E.AccountPassword, + E.MailboxPlanId, + P.MailboxPlan, + E.SubscriberNumber +FROM + ExchangeAccounts AS E +LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId +WHERE + E.ItemID = @ItemID AND + E.AccountName = @AccountName +RETURN @@ -231,21 +311,25 @@ CREATE PROCEDURE [dbo].[GetExchangeAccount] ) AS SELECT - AccountID, - ItemID, - AccountType, - AccountName, - DisplayName, - PrimaryEmailAddress, - MailEnabledPublicFolder, - MailboxManagerActions, - SamAccountName, - AccountPassword + E.AccountID, + E.ItemID, + E.AccountType, + E.AccountName, + E.DisplayName, + E.PrimaryEmailAddress, + E.MailEnabledPublicFolder, + E.MailboxManagerActions, + E.SamAccountName, + E.AccountPassword, + E.MailboxPlanId, + P.MailboxPlan, + E.SubscriberNumber FROM - ExchangeAccounts + ExchangeAccounts AS E +LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId WHERE - ItemID = @ItemID AND - AccountID = @AccountID + E.ItemID = @ItemID AND + E.AccountID = @AccountID RETURN @@ -311,14 +395,14 @@ GO -CREATE PROCEDURE ExchangeAccountExists +CREATE PROCEDURE [dbo].[ExchangeAccountExists] ( @AccountName nvarchar(20), @Exists bit OUTPUT ) AS SET @Exists = 0 -IF EXISTS(SELECT * FROM ExchangeAccounts WHERE AccountName = @AccountName) +IF EXISTS(SELECT * FROM ExchangeAccounts WHERE sAMAccountName LIKE '%\'+@AccountName) BEGIN SET @Exists = 1 END @@ -352,6 +436,10 @@ RETURN + + + + @@ -936,7 +1024,7 @@ GO -CREATE PROCEDURE SearchExchangeAccounts +CREATE PROCEDURE [dbo].[SearchExchangeAccounts] ( @ActorID int, @ItemID int, @@ -986,7 +1074,8 @@ SELECT EA.AccountName, EA.DisplayName, EA.PrimaryEmailAddress, - EA.MailEnabledPublicFolder + EA.MailEnabledPublicFolder, + EA.SubscriberNumber FROM ExchangeAccounts AS EA WHERE ' + @condition @@ -1026,6 +1115,7 @@ RETURN + GO @@ -1080,6 +1170,10 @@ END IF @SortColumn IS NULL OR @SortColumn = '' SET @SortColumn = 'EA.DisplayName ASC' +DECLARE @joincondition nvarchar(700) + SET @joincondition = ',P.MailboxPlan FROM ExchangeAccounts AS EA + LEFT OUTER JOIN ExchangeMailboxPlans AS P ON EA.MailboxPlanId = P.MailboxPlanId' + DECLARE @sql nvarchar(3500) set @sql = ' @@ -1094,9 +1188,10 @@ WITH Accounts AS ( EA.AccountName, EA.DisplayName, EA.PrimaryEmailAddress, - EA.MailEnabledPublicFolder - FROM ExchangeAccounts AS EA - WHERE ' + @condition + ' + EA.MailEnabledPublicFolder, + EA.MailboxPlanId, + EA.SubscriberNumber ' + @joincondition + + ' WHERE ' + @condition + ' ) SELECT * FROM Accounts @@ -1118,6 +1213,7 @@ RETURN + GO SET ANSI_NULLS ON GO @@ -1407,13 +1503,15 @@ CREATE PROCEDURE [dbo].[AddExchangeAccount] @AccountID int OUTPUT, @ItemID int, @AccountType int, - @AccountName nvarchar(20), + @AccountName nvarchar(300), @DisplayName nvarchar(300), @PrimaryEmailAddress nvarchar(300), @MailEnabledPublicFolder bit, @MailboxManagerActions varchar(200), @SamAccountName nvarchar(100), - @AccountPassword nvarchar(200) + @AccountPassword nvarchar(200), + @MailboxPlanId int, + @SubscriberNumber nvarchar(32) ) AS @@ -1427,7 +1525,9 @@ INSERT INTO ExchangeAccounts MailEnabledPublicFolder, MailboxManagerActions, SamAccountName, - AccountPassword + AccountPassword, + MailboxPlanId, + SubscriberNumber ) VALUES ( @@ -1439,7 +1539,9 @@ VALUES @MailEnabledPublicFolder, @MailboxManagerActions, @SamAccountName, - @AccountPassword + @AccountPassword, + @MailboxPlanId, + @SubscriberNumber ) SET @AccountID = SCOPE_IDENTITY() @@ -1475,6 +1577,7 @@ RETURN + GO @@ -3538,9 +3641,9 @@ 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', 3, 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', 21, 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', 3, 0, NULL) +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 INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (79, 12, 4, N'Exchange2007.Contacts', N'Contacts per Organization', 3, 0, NULL) GO @@ -3560,16 +3663,6 @@ INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDe GO INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (88, 12, 8, N'Exchange2007.MailEnabledPublicFolders', N'Mail Enabled Public Folders Allowed', 1, 0, NULL) GO -INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (89, 12, 10, N'Exchange2007.POP3Enabled', N'POP3 Enabled by default', 1, 0, NULL) -GO -INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (90, 12, 12, N'Exchange2007.IMAPEnabled', N'IMAP Enabled by default', 1, 0, NULL) -GO -INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (91, 12, 14, N'Exchange2007.OWAEnabled', N'OWA Enabled by default', 1, 0, NULL) -GO -INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (92, 12, 16, N'Exchange2007.MAPIEnabled', N'MAPI Enabled by default', 1, 0, NULL) -GO -INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (93, 12, 18, N'Exchange2007.ActiveSyncEnabled', N'ActiveSync Enabled by default', 1, 0, NULL) -GO INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (94, 2, 17, N'Web.ColdFusion', N'ColdFusion', 1, 0, NULL) GO INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (95, 2, 1, N'Web.WebAppGallery', N'Web Application Gallery', 1, 0, NULL) @@ -3602,7 +3695,7 @@ INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDe GO INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (205, 13, 1, N'HostedSolution.Organizations', N'Organizations', 2, 0, 29) GO -INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (206, 13, 2, N'HostedSolution.Users', N'Users', 3, 0, 30) +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (206, 13, 2, N'HostedSolution.Users', N'Users', 2, 0, 30) GO INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (207, 13, 3, N'HostedSolution.Domains', N'Domains per Organizations', 3, 0, NULL) GO @@ -3748,6 +3841,16 @@ INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDe GO INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (363, 40, 12, N'VPSForPC.Bandwidth', N'Monthly bandwidth, GB', 2, 0, NULL) GO +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (364, 12, 19, N'Exchange2007.KeepDeletedItemsDays', N'Keep Deleted Items (days)', 3, 0, NULL) +GO +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (365, 12, 20, N'Exchange2007.MaxRecipients', N'Maximum Recipients', 3, 0, NULL) +GO +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (366, 12, 21, N'Exchange2007.MaxSendMessageSizeKB', N'Maximum Send Message Size (Kb)', 3, 0, NULL) +GO +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (367, 12, 22, N'Exchange2007.MaxReceiveMessageSizeKB', N'Maximum Receive Message Size (Kb)', 3, 0, NULL) +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 (400, 20, 3, N'HostedSharePoint.UseSharedSSL', N'Use shared SSL Root', 1, 0, NULL) GO @@ -5866,7 +5969,7 @@ SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[ExchangeOrganizations]( [ItemID] [int] NOT NULL, - [OrganizationID] [nvarchar](10) COLLATE Latin1_General_CI_AS NOT NULL, + [OrganizationID] [nvarchar](128) COLLATE Latin1_General_CI_AS NOT NULL, CONSTRAINT [PK_ExchangeOrganizations] PRIMARY KEY CLUSTERED ( [ItemID] ASC @@ -5980,8 +6083,10 @@ CREATE PROCEDURE DeleteExchangeOrganization @ItemID int ) AS -DELETE FROM ExchangeOrganizations -WHERE ItemID = @ItemID +BEGIN TRAN + DELETE FROM ExchangeMailboxPlans WHERE ItemID = @ItemID + DELETE FROM ExchangeOrganizations WHERE ItemID = @ItemID +COMMIT TRAN RETURN @@ -6053,7 +6158,7 @@ GO CREATE PROCEDURE AddExchangeOrganization ( @ItemID int, - @OrganizationID nvarchar(10) + @OrganizationID nvarchar(128) ) AS @@ -6241,7 +6346,8 @@ SELECT (SELECT COUNT(*) FROM ExchangeAccounts WHERE AccountType = 2 AND ItemID = @ItemID) AS CreatedContacts, (SELECT COUNT(*) FROM ExchangeAccounts WHERE AccountType = 3 AND ItemID = @ItemID) AS CreatedDistributionLists, (SELECT COUNT(*) FROM ExchangeAccounts WHERE AccountType = 4 AND ItemID = @ItemID) AS CreatedPublicFolders, - (SELECT COUNT(*) FROM ExchangeOrganizationDomains WHERE ItemID = @ItemID) AS CreatedDomains + (SELECT COUNT(*) FROM ExchangeOrganizationDomains WHERE ItemID = @ItemID) AS CreatedDomains, + (SELECT SUM(B.MailboxSizeMB) FROM ExchangeAccounts AS A INNER JOIN ExchangeMailboxPlans AS B ON A.MailboxPlanId = B.MailboxPlanId WHERE A.ItemID=@ItemID) AS UsedDiskSpace RETURN @@ -6272,7 +6378,6 @@ RETURN - GO @@ -6611,18 +6716,26 @@ GO CREATE PROCEDURE [dbo].[UpdateExchangeAccount] ( @AccountID int, - @AccountName nvarchar(20), + @AccountName nvarchar(300), @DisplayName nvarchar(300), @PrimaryEmailAddress nvarchar(300), @AccountType int, @SamAccountName nvarchar(100), @MailEnabledPublicFolder bit, @MailboxManagerActions varchar(200), - @Password varchar(200) + @Password varchar(200), + @MailboxPlanId int, + @SubscriberNumber varchar(32) ) AS BEGIN TRAN + +IF (@MailboxPlanId = -1) +BEGIN + SET @MailboxPlanId = NULL +END + UPDATE ExchangeAccounts SET AccountName = @AccountName, DisplayName = @DisplayName, @@ -6630,7 +6743,9 @@ UPDATE ExchangeAccounts SET MailEnabledPublicFolder = @MailEnabledPublicFolder, MailboxManagerActions = @MailboxManagerActions, AccountType =@AccountType, - SamAccountName = @SamAccountName + SamAccountName = @SamAccountName, + MailboxPlanId = @MailboxPlanId, + SubscriberNumber = @SubscriberNumber WHERE AccountID = @AccountID @@ -6667,6 +6782,10 @@ RETURN + + + + GO @@ -8899,7 +9018,8 @@ SELECT EA.AccountType, EA.AccountName, EA.DisplayName, - EA.PrimaryEmailAddress + EA.PrimaryEmailAddress, + EA.SubscriberNumber FROM ExchangeAccounts AS EA WHERE ' + @condition @@ -8936,6 +9056,8 @@ RETURN + + @@ -20551,7 +20673,7 @@ GO -CREATE PROCEDURE GetPackages +CREATE PROCEDURE [dbo].[GetPackages] ( @ActorID int, @UserID int @@ -20590,8 +20712,7 @@ INNER JOIN Users AS U ON P.UserID = U.UserID INNER JOIN Servers AS S ON P.ServerID = S.ServerID INNER JOIN HostingPlans AS HP ON P.PlanID = HP.PlanID WHERE - P.UserID <> @UserID - AND dbo.CheckUserParent(@UserID, P.UserID) = 1 + P.UserID = @UserID RETURN @@ -23257,6 +23378,8 @@ INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName] GO INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (400, 40, N'HyperVForPC', N'Microsoft Hyper-V For Private Cloud', N'WebsitePanel.Providers.VirtualizationForPC.HyperVForPC, WebsitePanel.Providers.VirtualizationForPC.HyperVForPC', N'HyperVForPrivateCloud', 1) GO +INSERT [dbo].[Providers] ([ProviderId], [GroupId], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES(90, 12, N'Exchange2010SP2', N'Hosted Microsoft Exchange Server 2010 SP2', N'WebsitePanel.Providers.HostedSolution.Exchange2010SP2, WebsitePanel.Providers.HostedSolution', N'Exchange', 1) +GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON @@ -25738,21 +25861,27 @@ AS INNER JOIN PackagesTreeCache AS PT ON PIP.PackageID = PT.PackageID WHERE PT.ParentPackageID = @PackageID AND IP.PoolID = 3) ELSE IF @QuotaID = 319 -- BB Users - SET @Result = (SELECT COUNT(ea.AccountID) - FROM - ExchangeAccounts ea - INNER JOIN - BlackBerryUsers bu - ON - ea.AccountID = bu.AccountID - INNER JOIN - ServiceItems si - ON - ea.ItemID = si.ItemID - INNER JOIN - PackagesTreeCache pt ON si.PackageID = pt.PackageID - WHERE - pt.ParentPackageID = @PackageID) + SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts ea + INNER JOIN BlackBerryUsers bu ON ea.AccountID = bu.AccountID + INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID + INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID + WHERE pt.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 206 -- HostedSolution.Users + SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts AS ea + INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID + INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID + WHERE pt.ParentPackageID = @PackageID AND ea.AccountType IN (1,5,6,7)) + ELSE IF @QuotaID = 78 -- Exchange2007.Mailboxes + SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts AS ea + INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID + INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID + WHERE pt.ParentPackageID = @PackageID AND ea.MailboxPlanId IS NOT NULL) + ELSE IF @QuotaID = 77 -- Exchange2007.DiskSpace + SET @Result = (SELECT SUM(B.MailboxSizeMB) FROM ExchangeAccounts AS ea + INNER JOIN ExchangeMailboxPlans AS B ON ea.MailboxPlanId = B.MailboxPlanId + INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID + INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID + WHERE pt.ParentPackageID = @PackageID) ELSE SET @Result = (SELECT COUNT(SI.ItemID) FROM Quotas AS Q INNER JOIN ServiceItems AS SI ON SI.ItemTypeID = Q.ItemTypeID @@ -25761,14 +25890,10 @@ AS RETURN @Result END +GO -GO -SET ANSI_NULLS ON -GO -SET QUOTED_IDENTIFIER ON -GO @@ -44451,6 +44576,7 @@ EXEC sp_xml_removedocument @idoc COMMIT TRAN RETURN +GO @@ -44473,27 +44599,280 @@ RETURN +CREATE PROCEDURE [dbo].[AddExchangeMailboxPlan] +( + @MailboxPlanId int OUTPUT, + @ItemID int, + @MailboxPlan nvarchar(300), + @EnableActiveSync bit, + @EnableIMAP bit, + @EnableMAPI bit, + @EnableOWA bit, + @EnablePOP bit, + @IsDefault bit, + @IssueWarningPct int, + @KeepDeletedItemsDays int, + @MailboxSizeMB int, + @MaxReceiveMessageSizeKB int, + @MaxRecipients int, + @MaxSendMessageSizeKB int, + @ProhibitSendPct int, + @ProhibitSendReceivePct int , + @HideFromAddressBook bit +) +AS +INSERT INTO ExchangeMailboxPlans +( + ItemID, + MailboxPlan, + EnableActiveSync, + EnableIMAP, + EnableMAPI, + EnableOWA, + EnablePOP, + IsDefault, + IssueWarningPct, + KeepDeletedItemsDays, + MailboxSizeMB, + MaxReceiveMessageSizeKB, + MaxRecipients, + MaxSendMessageSizeKB, + ProhibitSendPct, + ProhibitSendReceivePct, + HideFromAddressBook +) +VALUES +( + @ItemID, + @MailboxPlan, + @EnableActiveSync, + @EnableIMAP, + @EnableMAPI, + @EnableOWA, + @EnablePOP, + @IsDefault, + @IssueWarningPct, + @KeepDeletedItemsDays, + @MailboxSizeMB, + @MaxReceiveMessageSizeKB, + @MaxRecipients, + @MaxSendMessageSizeKB, + @ProhibitSendPct, + @ProhibitSendReceivePct, + @HideFromAddressBook +) +SET @MailboxPlanId = SCOPE_IDENTITY() - - - - - - - - - - +RETURN GO + + + + + + + + + + + + + + +CREATE PROCEDURE [dbo].[SetExchangeAccountMailboxplan] +( + @AccountID int, + @MailboxPlanId int +) +AS + +UPDATE ExchangeAccounts SET + MailboxPlanId = @MailboxPlanId +WHERE + AccountID = @AccountID + +RETURN +GO + + + + + + + + + + + +CREATE PROCEDURE [dbo].[SetOrganizationDefaultExchangeMailboxPlan] +( + @ItemId int, + @MailboxPlanId int +) +AS + +UPDATE ExchangeMailboxPlans SET IsDefault=0 WHERE ItemId=@ItemId +UPDATE ExchangeMailboxPlans SET IsDefault=1 WHERE MailboxPlanId=@MailboxPlanId + +RETURN +GO + + + + + + + + + + + + + + + +CREATE PROCEDURE [dbo].[GetExchangeMailboxPlan] +( + @MailboxPlanId int +) +AS +SELECT + MailboxPlanId, + ItemID, + MailboxPlan, + EnableActiveSync, + EnableIMAP, + EnableMAPI, + EnableOWA, + EnablePOP, + IsDefault, + IssueWarningPct, + KeepDeletedItemsDays, + MailboxSizeMB, + MaxReceiveMessageSizeKB, + MaxRecipients, + MaxSendMessageSizeKB, + ProhibitSendPct, + ProhibitSendReceivePct, + HideFromAddressBook +FROM + ExchangeMailboxPlans +WHERE + MailboxPlanId = @MailboxPlanId +RETURN +GO + + + + + + + + + + + +CREATE PROCEDURE [dbo].[GetExchangeMailboxPlans] +( + @ItemID int +) +AS +SELECT + MailboxPlanId, + ItemID, + MailboxPlan, + EnableActiveSync, + EnableIMAP, + EnableMAPI, + EnableOWA, + EnablePOP, + IsDefault, + IssueWarningPct, + KeepDeletedItemsDays, + MailboxSizeMB, + MaxReceiveMessageSizeKB, + MaxRecipients, + MaxSendMessageSizeKB, + ProhibitSendPct, + ProhibitSendReceivePct, + HideFromAddressBook +FROM + ExchangeMailboxPlans +WHERE + ItemID = @ItemID +ORDER BY MailboxPlan +RETURN +GO + + + + + + + + + + + + + +CREATE PROCEDURE [dbo].[DeleteExchangeMailboxPlan] +( + @MailboxPlanId int +) +AS + +-- delete mailboxplan +DELETE FROM ExchangeMailboxPlans +WHERE MailboxPlanId = @MailboxPlanId + +RETURN +GO + + + + + + + + + + + + + ALTER TABLE [dbo].[ScheduleParameters] WITH CHECK ADD CONSTRAINT [FK_ScheduleParameters_Schedule] FOREIGN KEY([ScheduleID]) REFERENCES [dbo].[Schedule] ([ScheduleID]) ON DELETE CASCADE GO ALTER TABLE [dbo].[ScheduleParameters] CHECK CONSTRAINT [FK_ScheduleParameters_Schedule] GO +ALTER TABLE dbo.ExchangeMailboxPlans ADD CONSTRAINT + IX_ExchangeMailboxPlans UNIQUE NONCLUSTERED + ( + MailboxPlanId + ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] + +GO +ALTER TABLE dbo.ExchangeMailboxPlans ADD CONSTRAINT + FK_ExchangeMailboxPlans_ExchangeOrganizations FOREIGN KEY + ( + ItemID + ) REFERENCES dbo.ExchangeOrganizations + ( + ItemID + ) ON UPDATE NO ACTION + ON DELETE CASCADE +GO + +ALTER TABLE [dbo].[ExchangeAccounts] WITH CHECK ADD CONSTRAINT [FK_ExchangeAccounts_ExchangeMailboxPlans] FOREIGN KEY([MailboxPlanId]) +REFERENCES [dbo].[ExchangeMailboxPlans] ([MailboxPlanId]) +GO +ALTER TABLE [dbo].[ExchangeAccounts] CHECK CONSTRAINT [FK_ExchangeAccounts_ExchangeMailboxPlans] +GO ALTER TABLE [dbo].[ExchangeAccounts] WITH CHECK ADD CONSTRAINT [FK_ExchangeAccounts_ServiceItems] FOREIGN KEY([ItemID]) REFERENCES [dbo].[ServiceItems] ([ItemID]) ON DELETE CASCADE @@ -44713,6 +45092,12 @@ ON DELETE CASCADE GO ALTER TABLE [dbo].[ExchangeOrganizations] CHECK CONSTRAINT [FK_ExchangeOrganizations_ServiceItems] GO +ALTER TABLE [dbo].[ExchangeOrganizations] WITH CHECK ADD CONSTRAINT [FK_ExchangeOrganizations_ExchangeMailboxPlans] FOREIGN KEY([ItemID]) +REFERENCES [dbo].[ExchangeMailboxPlans] ([ItemID]) +ON DELETE CASCADE +GO +ALTER TABLE [dbo].[ExchangeOrganizations] CHECK CONSTRAINT [FK_ExchangeOrganizations_ExchangeMailboxPlans] +GO ALTER TABLE [dbo].[ExchangeOrganizationDomains] WITH CHECK ADD CONSTRAINT [FK_ExchangeOrganizationDomains_ServiceItems] FOREIGN KEY([ItemID]) REFERENCES [dbo].[ServiceItems] ([ItemID]) ON DELETE CASCADE @@ -45117,4 +45502,5 @@ ON DELETE CASCADE GO ALTER TABLE [dbo].[ServiceProperties] CHECK CONSTRAINT [FK_ServiceProperties_Services] GO - \ No newline at end of file + + diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index cb5595fa..eb5435ba 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -12,8 +12,7 @@ BEGIN END GO - -IF NOT EXISTS (SELECT * FROM [dbo].[UserSetting] WHERE ([GroupName] = 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 @@ -135,6 +134,56 @@ END GO +IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Exchange2007.KeepDeletedItemsDays') +BEGIN +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (364, 12, 19, N'Exchange2007.KeepDeletedItemsDays', N'Keep Deleted Items (days)', 3, 0, NULL) +END +GO + +IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Exchange2007.MaxRecipients') +BEGIN +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (365, 12, 20, N'Exchange2007.MaxRecipients', N'Maximum Recipients', 3, 0, NULL) +END +GO + +IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Exchange2007.MaxSendMessageSizeKB') +BEGIN +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (366, 12, 21, N'Exchange2007.MaxSendMessageSizeKB', N'Maximum Send Message Size (Kb)', 3, 0, NULL) +END +GO + +IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Exchange2007.MaxReceiveMessageSizeKB') +BEGIN +INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (367, 12, 22, N'Exchange2007.MaxReceiveMessageSizeKB', N'Maximum Receive Message Size (Kb)', 3, 0, NULL) +END +GO + +IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Exchange2007.IsConsumer') +BEGIN +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) +END +GO + + + +IF NOT EXISTS (SELECT * FROM [dbo].[Providers] WHERE [DisplayName] = 'Hosted Microsoft Exchange Server 2010 SP2') +BEGIN +INSERT [dbo].[Providers] ([ProviderId], [GroupId], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES(90, 12, N'Exchange2010SP2', N'Hosted Microsoft Exchange Server 2010 SP2', N'WebsitePanel.Providers.HostedSolution.Exchange2010SP2, WebsitePanel.Providers.HostedSolution', N'Exchange', 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') +DELETE FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.IMAPEnabled' +DELETE FROM [dbo].[HostingPlanQuotas] WHERE [QuotaID] IN (SELECT [QuotaID] FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.OWAEnabled') +DELETE FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.OWAEnabled' +DELETE FROM [dbo].[HostingPlanQuotas] WHERE [QuotaID] IN (SELECT [QuotaID] FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.MAPIEnabled') +DELETE FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.MAPIEnabled' +DELETE FROM [dbo].[HostingPlanQuotas] WHERE [QuotaID] IN (SELECT [QuotaID] FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.ActiveSyncEnabled') +DELETE FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.ActiveSyncEnabled' + + UPDATE [dbo].[ScheduleTaskParameters] SET DefaultValue = N'MsSQL2000=SQL Server 2000;MsSQL2005=SQL Server 2005;MsSQL2008=SQL Server 2008;MsSQL2012=SQL Server 2012;MySQL4=MySQL 4.0;MySQL5=MySQL 5.0' WHERE [ParameterID] = N'DATABASE_GROUP' GO @@ -1496,6 +1545,14 @@ GO UPDATE dbo.Quotas SET QuotaTypeID = 2 WHERE QuotaName = 'HostedSharePoint.Sites' GO +UPDATE dbo.Quotas SET QuotaTypeID = 2 WHERE QuotaName = 'HostedSolution.Users' +GO +UPDATE dbo.Quotas SET QuotaTypeID = 2 WHERE QuotaName = 'Exchange2007.Mailboxes' +GO +UPDATE dbo.Quotas SET QuotaTypeID = 2 WHERE QuotaName = 'Exchange2007.DiskSpace' +GO + + @@ -1527,6 +1584,1229 @@ DELETE FROM Providers WHERE ProviderID = 207 GO + +-- Remove ExchangeHostedEdition VirtualGroups +DELETE FROM VirtualGroups WHERE GroupID = 33 +GO + + + -- Remove ExchangeHostedEdition ResourceGroups DELETE FROM ResourceGroups WHERE GRoupID = 33 -GO \ No newline at end of file +GO + + +-- Create Exchange Mailbox Plans +IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ExchangeMailboxPlans]') AND type in (N'U')) +BEGIN +CREATE TABLE [dbo].[ExchangeMailboxPlans]( + [MailboxPlanId] [int] IDENTITY(1,1) NOT NULL, + [ItemID] [int] NOT NULL, + [MailboxPlan] [nvarchar](300) COLLATE Latin1_General_CI_AS NOT NULL, + [EnableActiveSync] [bit] NOT NULL, + [EnableIMAP] [bit] NOT NULL, + [EnableMAPI] [bit] NOT NULL, + [EnableOWA] [bit] NOT NULL, + [EnablePOP] [bit] NOT NULL, + [IsDefault] [bit] NOT NULL, + [IssueWarningPct] [int] NOT NULL, + [KeepDeletedItemsDays] [int] NOT NULL, + [MailboxSizeMB] [int] NOT NULL, + [MaxReceiveMessageSizeKB] [int] NOT NULL, + [MaxRecipients] [int] NOT NULL, + [MaxSendMessageSizeKB] [int] NOT NULL, + [ProhibitSendPct] [int] NOT NULL, + [ProhibitSendReceivePct] [int] NOT NULL, + [HideFromAddressBook] [bit] NOT NULL, + CONSTRAINT [PK_ExchangeMailboxPlans] PRIMARY KEY CLUSTERED +( + [MailboxPlanId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] +) ON [PRIMARY] + +/****** Object: Table [dbo].[ExchangeAccounts] ******/ +ALTER TABLE [dbo].[ExchangeAccounts] WITH CHECK ADD CONSTRAINT [FK_ExchangeAccounts_ExchangeMailboxPlans] FOREIGN KEY([MailboxPlanId]) +REFERENCES [dbo].[ExchangeMailboxPlans] ([MailboxPlanId]) + +/****** Object: Table [dbo].[ExchangeAccounts] ******/ +ALTER TABLE [dbo].[ExchangeOrganizations] CHECK CONSTRAINT [FK_ExchangeOrganizations_ExchangeMailboxPlans] + +/****** Object: Table [dbo].[ExchangeAccounts] ******/ +ALTER TABLE [dbo].[ExchangeOrganizations] WITH CHECK ADD CONSTRAINT [FK_ExchangeOrganizations_ExchangeMailboxPlans] FOREIGN KEY([ItemID]) +REFERENCES [dbo].[ExchangeMailboxPlans] ([ItemID]) +ON DELETE CASCADE + +/****** Object: Table [dbo].[ExchangeAccounts] ******/ +ALTER TABLE [dbo].[ExchangeAccounts] WITH CHECK ADD CONSTRAINT [FK_ExchangeAccounts_ExchangeMailboxPlans] FOREIGN KEY([MailboxPlanId]) +REFERENCES [dbo].[ExchangeMailboxPlans] ([MailboxPlanId]) + +/****** Object: Table [dbo].[ExchangeAccounts] ******/ +ALTER TABLE dbo.ExchangeMailboxPlans ADD CONSTRAINT + IX_ExchangeMailboxPlans UNIQUE NONCLUSTERED + ( + MailboxPlanId + ) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] + +/****** Object: Table [dbo].[ExchangeAccounts] ******/ +ALTER TABLE dbo.ExchangeMailboxPlans ADD CONSTRAINT + FK_ExchangeMailboxPlans_ExchangeOrganizations FOREIGN KEY + ( + ItemID + ) REFERENCES dbo.ExchangeOrganizations + ( + ItemID + ) ON UPDATE NO ACTION + ON DELETE CASCADE +END +GO + +/****** Object: Table [dbo].[ExchangeAccounts] ******/ +ALTER TABLE [dbo].[ExchangeAccounts] ALTER COLUMN [AccountName] [nvarchar](300) COLLATE Latin1_General_CI_AS NOT NULL +GO + +/****** Object: Table [dbo].[ExchangeAccounts] Extend Exchange Accounts with MailboxplanID ******/ +IF NOT EXISTS(select 1 from sys.columns COLS INNER JOIN sys.objects OBJS ON OBJS.object_id=COLS.object_id and OBJS.type='U' AND OBJS.name='ExchangeAccounts' AND COLS.name='MailboxPlanId') +BEGIN +ALTER TABLE [dbo].[ExchangeAccounts] ADD [MailboxPlanId] [int] NULL +END +GO + +/****** Object: Table [dbo].[ExchangeAccounts] Extend Exchange Accounts with SubscriberNumber ******/ +IF NOT EXISTS(select 1 from sys.columns COLS INNER JOIN sys.objects OBJS ON OBJS.object_id=COLS.object_id and OBJS.type='U' AND OBJS.name='ExchangeAccounts' AND COLS.name='SubscriberNumber') +BEGIN +ALTER TABLE [dbo].[ExchangeAccounts] ADD [SubscriberNumber] [nvarchar] (32) COLLATE Latin1_General_CI_AS NULL +END +GO + +/****** Object: Table [dbo].[ExchangeOrganizations] ******/ +ALTER TABLE [dbo].[ExchangeOrganizations] ALTER COLUMN [OrganizationID] [nvarchar](128) COLLATE Latin1_General_CI_AS NOT NULL +GO + + +/****** Object: Table [dbo].[AddExchangeAccount] ******/ +ALTER PROCEDURE [dbo].[AddExchangeAccount] +( + @AccountID int OUTPUT, + @ItemID int, + @AccountType int, + @AccountName nvarchar(300), + @DisplayName nvarchar(300), + @PrimaryEmailAddress nvarchar(300), + @MailEnabledPublicFolder bit, + @MailboxManagerActions varchar(200), + @SamAccountName nvarchar(100), + @AccountPassword nvarchar(200), + @MailboxPlanId int, + @SubscriberNumber nvarchar(32) +) +AS + +INSERT INTO ExchangeAccounts +( + ItemID, + AccountType, + AccountName, + DisplayName, + PrimaryEmailAddress, + MailEnabledPublicFolder, + MailboxManagerActions, + SamAccountName, + AccountPassword, + MailboxPlanId, + SubscriberNumber +) +VALUES +( + @ItemID, + @AccountType, + @AccountName, + @DisplayName, + @PrimaryEmailAddress, + @MailEnabledPublicFolder, + @MailboxManagerActions, + @SamAccountName, + @AccountPassword, + @MailboxPlanId, + @SubscriberNumber +) + +SET @AccountID = SCOPE_IDENTITY() + +RETURN +GO + + + + + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'AddExchangeMailboxPlan') +BEGIN +EXEC sp_executesql N' +CREATE PROCEDURE [dbo].[AddExchangeMailboxPlan] +( + @MailboxPlanId int OUTPUT, + @ItemID int, + @MailboxPlan nvarchar(300), + @EnableActiveSync bit, + @EnableIMAP bit, + @EnableMAPI bit, + @EnableOWA bit, + @EnablePOP bit, + @IsDefault bit, + @IssueWarningPct int, + @KeepDeletedItemsDays int, + @MailboxSizeMB int, + @MaxReceiveMessageSizeKB int, + @MaxRecipients int, + @MaxSendMessageSizeKB int, + @ProhibitSendPct int, + @ProhibitSendReceivePct int , + @HideFromAddressBook bit +) +AS + +INSERT INTO ExchangeMailboxPlans +( + ItemID, + MailboxPlan, + EnableActiveSync, + EnableIMAP, + EnableMAPI, + EnableOWA, + EnablePOP, + IsDefault, + IssueWarningPct, + KeepDeletedItemsDays, + MailboxSizeMB, + MaxReceiveMessageSizeKB, + MaxRecipients, + MaxSendMessageSizeKB, + ProhibitSendPct, + ProhibitSendReceivePct, + HideFromAddressBook +) +VALUES +( + @ItemID, + @MailboxPlan, + @EnableActiveSync, + @EnableIMAP, + @EnableMAPI, + @EnableOWA, + @EnablePOP, + @IsDefault, + @IssueWarningPct, + @KeepDeletedItemsDays, + @MailboxSizeMB, + @MaxReceiveMessageSizeKB, + @MaxRecipients, + @MaxSendMessageSizeKB, + @ProhibitSendPct, + @ProhibitSendReceivePct, + @HideFromAddressBook +) + +SET @MailboxPlanId = SCOPE_IDENTITY() + +RETURN' +END +GO + + + + + + + + + + + + + + + + + + +ALTER PROCEDURE [dbo].[AddExchangeOrganization] +( + @ItemID int, + @OrganizationID nvarchar(128) +) +AS + +IF NOT EXISTS(SELECT * FROM ExchangeOrganizations WHERE OrganizationID = @OrganizationID) +BEGIN + INSERT INTO ExchangeOrganizations + (ItemID, OrganizationID) + VALUES + (@ItemID, @OrganizationID) +END + +RETURN +GO + + + + + + + + + + + + +ALTER FUNCTION [dbo].[CalculateQuotaUsage] +( + @PackageID int, + @QuotaID int +) +RETURNS int +AS + BEGIN + + DECLARE @QuotaTypeID int + SELECT @QuotaTypeID = QuotaTypeID FROM Quotas + WHERE QuotaID = @QuotaID + + IF @QuotaTypeID <> 2 + RETURN 0 + + DECLARE @Result int + + IF @QuotaID = 52 -- diskspace + SET @Result = dbo.CalculatePackageDiskspace(@PackageID) + ELSE IF @QuotaID = 51 -- bandwidth + SET @Result = dbo.CalculatePackageBandwidth(@PackageID) + ELSE IF @QuotaID = 53 -- domains + SET @Result = (SELECT COUNT(D.DomainID) FROM PackagesTreeCache AS PT + INNER JOIN Domains AS D ON D.PackageID = PT.PackageID + WHERE IsSubDomain = 0 AND IsInstantAlias = 0 AND IsDomainPointer = 0 AND PT.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 54 -- sub-domains + SET @Result = (SELECT COUNT(D.DomainID) FROM PackagesTreeCache AS PT + INNER JOIN Domains AS D ON D.PackageID = PT.PackageID + WHERE IsSubDomain = 1 AND IsInstantAlias = 0 AND PT.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 220 -- domain pointers + SET @Result = (SELECT COUNT(D.DomainID) FROM PackagesTreeCache AS PT + INNER JOIN Domains AS D ON D.PackageID = PT.PackageID + WHERE IsDomainPointer = 1 AND PT.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 71 -- scheduled tasks + SET @Result = (SELECT COUNT(S.ScheduleID) FROM PackagesTreeCache AS PT + INNER JOIN Schedule AS S ON S.PackageID = PT.PackageID + WHERE PT.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 305 -- RAM of VPS + SET @Result = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP + INNER JOIN ServiceItems AS SI ON SIP.ItemID = SI.ItemID + INNER JOIN PackagesTreeCache AS PT ON SI.PackageID = PT.PackageID + WHERE SIP.PropertyName = 'RamSize' AND PT.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 306 -- HDD of VPS + SET @Result = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP + INNER JOIN ServiceItems AS SI ON SIP.ItemID = SI.ItemID + INNER JOIN PackagesTreeCache AS PT ON SI.PackageID = PT.PackageID + WHERE SIP.PropertyName = 'HddSize' AND PT.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 309 -- External IP addresses of VPS + SET @Result = (SELECT COUNT(PIP.PackageAddressID) FROM PackageIPAddresses AS PIP + INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID + INNER JOIN PackagesTreeCache AS PT ON PIP.PackageID = PT.PackageID + WHERE PT.ParentPackageID = @PackageID AND IP.PoolID = 3) + ELSE IF @QuotaID = 100 -- Dedicated Web IP addresses + SET @Result = (SELECT COUNT(PIP.PackageAddressID) FROM PackageIPAddresses AS PIP + INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID + INNER JOIN PackagesTreeCache AS PT ON PIP.PackageID = PT.PackageID + WHERE PT.ParentPackageID = @PackageID AND IP.PoolID = 2) + ELSE IF @QuotaID = 350 -- RAM of VPSforPc + SET @Result = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP + INNER JOIN ServiceItems AS SI ON SIP.ItemID = SI.ItemID + INNER JOIN PackagesTreeCache AS PT ON SI.PackageID = PT.PackageID + WHERE SIP.PropertyName = 'Memory' AND PT.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 351 -- HDD of VPSforPc + SET @Result = (SELECT SUM(CAST(SIP.PropertyValue AS int)) FROM ServiceItemProperties AS SIP + INNER JOIN ServiceItems AS SI ON SIP.ItemID = SI.ItemID + INNER JOIN PackagesTreeCache AS PT ON SI.PackageID = PT.PackageID + WHERE SIP.PropertyName = 'HddSize' AND PT.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 354 -- External IP addresses of VPSforPc + SET @Result = (SELECT COUNT(PIP.PackageAddressID) FROM PackageIPAddresses AS PIP + INNER JOIN IPAddresses AS IP ON PIP.AddressID = IP.AddressID + INNER JOIN PackagesTreeCache AS PT ON PIP.PackageID = PT.PackageID + WHERE PT.ParentPackageID = @PackageID AND IP.PoolID = 3) + ELSE IF @QuotaID = 319 -- BB Users + SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts ea + INNER JOIN BlackBerryUsers bu ON ea.AccountID = bu.AccountID + INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID + INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID + WHERE pt.ParentPackageID = @PackageID) + ELSE IF @QuotaID = 206 -- HostedSolution.Users + SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts AS ea + INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID + INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID + WHERE pt.ParentPackageID = @PackageID AND ea.AccountType IN (1,5,6,7)) + ELSE IF @QuotaID = 78 -- Exchange2007.Mailboxes + SET @Result = (SELECT COUNT(ea.AccountID) FROM ExchangeAccounts AS ea + INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID + INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID + WHERE pt.ParentPackageID = @PackageID AND ea.MailboxPlanId IS NOT NULL) + ELSE IF @QuotaID = 77 -- Exchange2007.DiskSpace + SET @Result = (SELECT SUM(B.MailboxSizeMB) FROM ExchangeAccounts AS ea + INNER JOIN ExchangeMailboxPlans AS B ON ea.MailboxPlanId = B.MailboxPlanId + INNER JOIN ServiceItems si ON ea.ItemID = si.ItemID + INNER JOIN PackagesTreeCache pt ON si.PackageID = pt.PackageID + WHERE pt.ParentPackageID = @PackageID) + ELSE + SET @Result = (SELECT COUNT(SI.ItemID) FROM Quotas AS Q + INNER JOIN ServiceItems AS SI ON SI.ItemTypeID = Q.ItemTypeID + INNER JOIN PackagesTreeCache AS PT ON SI.PackageID = PT.PackageID AND PT.ParentPackageID = @PackageID + WHERE Q.QuotaID = @QuotaID) + + RETURN @Result + END + +GO + + + + + + + + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'DeleteExchangeMailboxPlan') +BEGIN +EXEC sp_executesql N' +CREATE PROCEDURE [dbo].[DeleteExchangeMailboxPlan] +( + @MailboxPlanId int +) +AS + +-- delete mailboxplan +DELETE FROM ExchangeMailboxPlans +WHERE MailboxPlanId = @MailboxPlanId + +RETURN' +END +GO + + + + + + + + + + + + + + +ALTER PROCEDURE [dbo].[DeleteExchangeOrganization] +( + @ItemID int +) +AS +BEGIN TRAN + DELETE FROM ExchangeMailboxPlans WHERE ItemID = @ItemID + DELETE FROM ExchangeOrganizations WHERE ItemID = @ItemID +COMMIT TRAN +RETURN +GO + + + + + + + + + + + +ALTER PROCEDURE [dbo].[ExchangeAccountExists] +( + @AccountName nvarchar(20), + @Exists bit OUTPUT +) +AS +SET @Exists = 0 +IF EXISTS(SELECT * FROM ExchangeAccounts WHERE sAMAccountName LIKE '%\'+@AccountName) +BEGIN + SET @Exists = 1 +END + +RETURN + +GO + + + + + + + + + + + + +ALTER PROCEDURE [dbo].[GetExchangeAccounts] +( + @ItemID int, + @AccountType int +) +AS +SELECT + E.AccountID, + E.ItemID, + E.AccountType, + E.AccountName, + E.DisplayName, + E.PrimaryEmailAddress, + E.MailEnabledPublicFolder, + E.MailboxPlanId, + P.MailboxPlan, + E.SubscriberNumber +FROM + ExchangeAccounts AS E +INNER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId +WHERE + E.ItemID = @ItemID AND + (E.AccountType = @AccountType OR @AccountType IS NULL) +ORDER BY DisplayName +RETURN + +GO + + + + + + + + + + +ALTER PROCEDURE [dbo].[GetExchangeAccountsPaged] +( + @ActorID int, + @ItemID int, + @AccountTypes nvarchar(30), + @FilterColumn nvarchar(50) = '', + @FilterValue nvarchar(50) = '', + @SortColumn nvarchar(50), + @StartRow int, + @MaximumRows int +) +AS + +DECLARE @PackageID int +SELECT @PackageID = PackageID FROM ServiceItems +WHERE ItemID = @ItemID + +-- check rights +IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0 +RAISERROR('You are not allowed to access this package', 16, 1) + +-- start +DECLARE @condition nvarchar(700) +SET @condition = ' +EA.AccountType IN (' + @AccountTypes + ') +AND EA.ItemID = @ItemID +' + +IF @FilterColumn <> '' AND @FilterColumn IS NOT NULL +AND @FilterValue <> '' AND @FilterValue IS NOT NULL +BEGIN + IF @FilterColumn = 'PrimaryEmailAddress' AND @AccountTypes <> '2' + BEGIN + SET @condition = @condition + ' AND EA.AccountID IN (SELECT EAEA.AccountID FROM ExchangeAccountEmailAddresses EAEA WHERE EAEA.EmailAddress LIKE ''' + @FilterValue + ''')' + END + ELSE + BEGIN + SET @condition = @condition + ' AND ' + @FilterColumn + ' LIKE ''' + @FilterValue + '''' + END +END + +IF @SortColumn IS NULL OR @SortColumn = '' +SET @SortColumn = 'EA.DisplayName ASC' + +DECLARE @joincondition nvarchar(700) + SET @joincondition = ',P.MailboxPlan FROM ExchangeAccounts AS EA + LEFT OUTER JOIN ExchangeMailboxPlans AS P ON EA.MailboxPlanId = P.MailboxPlanId' + +DECLARE @sql nvarchar(3500) + +set @sql = ' +SELECT COUNT(EA.AccountID) FROM ExchangeAccounts AS EA +WHERE ' + @condition + '; + +WITH Accounts AS ( + SELECT ROW_NUMBER() OVER (ORDER BY ' + @SortColumn + ') as Row, + EA.AccountID, + EA.ItemID, + EA.AccountType, + EA.AccountName, + EA.DisplayName, + EA.PrimaryEmailAddress, + EA.MailEnabledPublicFolder, + EA.MailboxPlanId, + EA.SubscriberNumber ' + @joincondition + + ' WHERE ' + @condition + ' +) + +SELECT * FROM Accounts +WHERE Row BETWEEN @StartRow + 1 and @StartRow + @MaximumRows +' + +print @sql + +exec sp_executesql @sql, N'@ItemID int, @StartRow int, @MaximumRows int', +@ItemID, @StartRow, @MaximumRows + +RETURN + + + + +GO + + + + + + + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'GetExchangeAccountByAccountName') +BEGIN +EXEC sp_executesql N'CREATE PROCEDURE [dbo].[GetExchangeAccountByAccountName] +( + @ItemID int, + @AccountName nvarchar(300) +) +AS +SELECT + E.AccountID, + E.ItemID, + E.AccountType, + E.AccountName, + E.DisplayName, + E.PrimaryEmailAddress, + E.MailEnabledPublicFolder, + E.MailboxManagerActions, + E.SamAccountName, + E.AccountPassword, + E.MailboxPlanId, + P.MailboxPlan, + E.SubscriberNumber +FROM + ExchangeAccounts AS E +LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId +WHERE + E.ItemID = @ItemID AND + E.AccountName = @AccountName +RETURN' +END +GO + + + + + + + + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'GetExchangeMailboxPlan') +BEGIN +EXEC sp_executesql N' CREATE PROCEDURE [dbo].[GetExchangeMailboxPlan] +( + @MailboxPlanId int +) +AS +SELECT + MailboxPlanId, + ItemID, + MailboxPlan, + EnableActiveSync, + EnableIMAP, + EnableMAPI, + EnableOWA, + EnablePOP, + IsDefault, + IssueWarningPct, + KeepDeletedItemsDays, + MailboxSizeMB, + MaxReceiveMessageSizeKB, + MaxRecipients, + MaxSendMessageSizeKB, + ProhibitSendPct, + ProhibitSendReceivePct, + HideFromAddressBook +FROM + ExchangeMailboxPlans +WHERE + MailboxPlanId = @MailboxPlanId +RETURN' +END +GO + + + + + + + + + + + + + + + + + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'GetExchangeMailboxPlans') +BEGIN +EXEC sp_executesql N'CREATE PROCEDURE [dbo].[GetExchangeMailboxPlans] +( + @ItemID int +) +AS +SELECT + MailboxPlanId, + ItemID, + MailboxPlan, + EnableActiveSync, + EnableIMAP, + EnableMAPI, + EnableOWA, + EnablePOP, + IsDefault, + IssueWarningPct, + KeepDeletedItemsDays, + MailboxSizeMB, + MaxReceiveMessageSizeKB, + MaxRecipients, + MaxSendMessageSizeKB, + ProhibitSendPct, + ProhibitSendReceivePct, + HideFromAddressBook +FROM + ExchangeMailboxPlans +WHERE + ItemID = @ItemID +ORDER BY MailboxPlan +RETURN' +END +GO + + + + + + + + + + + + + + + + + + + +ALTER PROCEDURE [dbo].[GetExchangeOrganizationStatistics] +( + @ItemID int +) +AS +SELECT + (SELECT COUNT(*) FROM ExchangeAccounts WHERE (AccountType = 1 OR AccountType = 5 OR AccountType = 6) AND ItemID = @ItemID) AS CreatedMailboxes, + (SELECT COUNT(*) FROM ExchangeAccounts WHERE AccountType = 2 AND ItemID = @ItemID) AS CreatedContacts, + (SELECT COUNT(*) FROM ExchangeAccounts WHERE AccountType = 3 AND ItemID = @ItemID) AS CreatedDistributionLists, + (SELECT COUNT(*) FROM ExchangeAccounts WHERE AccountType = 4 AND ItemID = @ItemID) AS CreatedPublicFolders, + (SELECT COUNT(*) FROM ExchangeOrganizationDomains WHERE ItemID = @ItemID) AS CreatedDomains, + (SELECT SUM(B.MailboxSizeMB) FROM ExchangeAccounts AS A INNER JOIN ExchangeMailboxPlans AS B ON A.MailboxPlanId = B.MailboxPlanId WHERE A.ItemID=@ItemID) AS UsedDiskSpace + +RETURN +GO + + + + + + + + + + + + + + + + + + + + +ALTER PROCEDURE [dbo].[GetPackages] +( + @ActorID int, + @UserID int +) +AS + +IF dbo.CheckActorUserRights(@ActorID, @UserID) = 0 +RAISERROR('You are not allowed to access this account', 16, 1) + +SELECT + P.PackageID, + P.ParentPackageID, + P.PackageName, + P.StatusID, + P.PurchaseDate, + + -- server + ISNULL(P.ServerID, 0) AS ServerID, + ISNULL(S.ServerName, 'None') AS ServerName, + ISNULL(S.Comments, '') AS ServerComments, + ISNULL(S.VirtualServer, 1) AS VirtualServer, + + -- hosting plan + P.PlanID, + HP.PlanName, + + -- user + P.UserID, + U.Username, + U.FirstName, + U.LastName, + U.RoleID, + U.Email +FROM Packages AS P +INNER JOIN Users AS U ON P.UserID = U.UserID +INNER JOIN Servers AS S ON P.ServerID = S.ServerID +INNER JOIN HostingPlans AS HP ON P.PlanID = HP.PlanID +WHERE + P.UserID = @UserID +RETURN + +GO + + + + + + + + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'SetExchangeAccountMailboxplan') +BEGIN +EXEC sp_executesql N'CREATE PROCEDURE [dbo].[SetExchangeAccountMailboxplan] +( + @AccountID int, + @MailboxPlanId int +) +AS + +UPDATE ExchangeAccounts SET + MailboxPlanId = @MailboxPlanId +WHERE + AccountID = @AccountID + +RETURN' +END +GO + + + + + + + + + + + + + +IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'SetOrganizationDefaultExchangeMailboxPlan') +BEGIN +EXEC sp_executesql N'CREATE PROCEDURE [dbo].[SetOrganizationDefaultExchangeMailboxPlan] +( + @ItemId int, + @MailboxPlanId int +) +AS + +UPDATE ExchangeMailboxPlans SET IsDefault=0 WHERE ItemId=@ItemId +UPDATE ExchangeMailboxPlans SET IsDefault=1 WHERE MailboxPlanId=@MailboxPlanId + +RETURN' +END +GO + + + + + + + + + + + + + + + + + + +ALTER PROCEDURE [dbo].[UpdateExchangeAccount] +( + @AccountID int, + @AccountName nvarchar(300), + @DisplayName nvarchar(300), + @PrimaryEmailAddress nvarchar(300), + @AccountType int, + @SamAccountName nvarchar(100), + @MailEnabledPublicFolder bit, + @MailboxManagerActions varchar(200), + @Password varchar(200), + @MailboxPlanId int, + @SubscriberNumber varchar(32) +) +AS + +BEGIN TRAN + +IF (@MailboxPlanId = -1) +BEGIN + SET @MailboxPlanId = NULL +END + +UPDATE ExchangeAccounts SET + AccountName = @AccountName, + DisplayName = @DisplayName, + PrimaryEmailAddress = @PrimaryEmailAddress, + MailEnabledPublicFolder = @MailEnabledPublicFolder, + MailboxManagerActions = @MailboxManagerActions, + AccountType =@AccountType, + SamAccountName = @SamAccountName, + MailboxPlanId = @MailboxPlanId, + SubscriberNumber = @SubscriberNumber + +WHERE + AccountID = @AccountID + +IF (@@ERROR <> 0 ) + BEGIN + ROLLBACK TRANSACTION + RETURN -1 + END + +UPDATE ExchangeAccounts SET + AccountPassword = @Password WHERE AccountID = @AccountID AND @Password IS NOT NULL + +IF (@@ERROR <> 0 ) + BEGIN + ROLLBACK TRANSACTION + RETURN -1 + END +COMMIT TRAN +RETURN +GO + + + + + + + + + + +ALTER PROCEDURE [dbo].[GetExchangeAccount] +( + @ItemID int, + @AccountID int +) +AS +SELECT + E.AccountID, + E.ItemID, + E.AccountType, + E.AccountName, + E.DisplayName, + E.PrimaryEmailAddress, + E.MailEnabledPublicFolder, + E.MailboxManagerActions, + E.SamAccountName, + E.AccountPassword, + E.MailboxPlanId, + P.MailboxPlan, + E.SubscriberNumber +FROM + ExchangeAccounts AS E +LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId +WHERE + E.ItemID = @ItemID AND + E.AccountID = @AccountID +RETURN +GO + + + + + + + + + +ALTER PROCEDURE [dbo].[GetExchangeMailboxes] + @ItemID int +AS +BEGIN +SELECT + AccountID, + ItemID, + AccountType, + AccountName, + DisplayName, + PrimaryEmailAddress, + MailEnabledPublicFolder, + SubscriberNumber +FROM + ExchangeAccounts +WHERE + ItemID = @ItemID AND + (AccountType =1 OR AccountType=5 OR AccountType=6) +ORDER BY 1 + +END + +GO + + + + + + + + + + + + +ALTER PROCEDURE [dbo].[SearchExchangeAccount] +( + @ActorID int, + @AccountType int, + @PrimaryEmailAddress nvarchar(300) +) +AS + +DECLARE @PackageID int +DECLARE @ItemID int +DECLARE @AccountID int + +SELECT + @AccountID = AccountID, + @ItemID = ItemID +FROM ExchangeAccounts +WHERE PrimaryEmailAddress = @PrimaryEmailAddress +AND AccountType = @AccountType + + +-- check space rights +SELECT @PackageID = PackageID FROM ServiceItems +WHERE ItemID = @ItemID + +IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0 +RAISERROR('You are not allowed to access this package', 16, 1) + +SELECT + AccountID, + ItemID, + @PackageID AS PackageID, + AccountType, + AccountName, + DisplayName, + PrimaryEmailAddress, + MailEnabledPublicFolder, + MailboxManagerActions, + SamAccountName, + AccountPassword, + SubscriberNumber +FROM ExchangeAccounts +WHERE AccountID = @AccountID + +RETURN + +GO + + + + + + + + + + + +ALTER PROCEDURE [dbo].[SearchExchangeAccounts] +( + @ActorID int, + @ItemID int, + @IncludeMailboxes bit, + @IncludeContacts bit, + @IncludeDistributionLists bit, + @IncludeRooms bit, + @IncludeEquipment bit, + @FilterColumn nvarchar(50) = '', + @FilterValue nvarchar(50) = '', + @SortColumn nvarchar(50) +) +AS +DECLARE @PackageID int +SELECT @PackageID = PackageID FROM ServiceItems +WHERE ItemID = @ItemID + +-- check rights +IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0 +RAISERROR('You are not allowed to access this package', 16, 1) + +-- start +DECLARE @condition nvarchar(700) +SET @condition = ' +((@IncludeMailboxes = 1 AND EA.AccountType = 1) +OR (@IncludeContacts = 1 AND EA.AccountType = 2) +OR (@IncludeDistributionLists = 1 AND EA.AccountType = 3) +OR (@IncludeRooms = 1 AND EA.AccountType = 5) +OR (@IncludeEquipment = 1 AND EA.AccountType = 6)) +AND EA.ItemID = @ItemID +' + +IF @FilterColumn <> '' AND @FilterColumn IS NOT NULL +AND @FilterValue <> '' AND @FilterValue IS NOT NULL +SET @condition = @condition + ' AND ' + @FilterColumn + ' LIKE ''' + @FilterValue + '''' + +IF @SortColumn IS NULL OR @SortColumn = '' +SET @SortColumn = 'EA.DisplayName ASC' + +DECLARE @sql nvarchar(3500) + +set @sql = ' +SELECT + EA.AccountID, + EA.ItemID, + EA.AccountType, + EA.AccountName, + EA.DisplayName, + EA.PrimaryEmailAddress, + EA.MailEnabledPublicFolder, + EA.SubscriberNumber +FROM ExchangeAccounts AS EA +WHERE ' + @condition + +print @sql + +exec sp_executesql @sql, N'@ItemID int, @IncludeMailboxes int, @IncludeContacts int, + @IncludeDistributionLists int, @IncludeRooms bit, @IncludeEquipment bit', +@ItemID, @IncludeMailboxes, @IncludeContacts, @IncludeDistributionLists, @IncludeRooms, @IncludeEquipment + +RETURN + +GO + + + + + + + + + + + + + + + + + + +ALTER PROCEDURE [dbo].[SearchOrganizationAccounts] +( + @ActorID int, + @ItemID int, + @FilterColumn nvarchar(50) = '', + @FilterValue nvarchar(50) = '', + @SortColumn nvarchar(50), + @IncludeMailboxes bit +) +AS +DECLARE @PackageID int +SELECT @PackageID = PackageID FROM ServiceItems +WHERE ItemID = @ItemID + +-- check rights +IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0 +RAISERROR('You are not allowed to access this package', 16, 1) + +-- start +DECLARE @condition nvarchar(700) +SET @condition = ' +(EA.AccountType = 7 OR (EA.AccountType = 1 AND @IncludeMailboxes = 1) ) +AND EA.ItemID = @ItemID +' + +IF @FilterColumn <> '' AND @FilterColumn IS NOT NULL +AND @FilterValue <> '' AND @FilterValue IS NOT NULL +SET @condition = @condition + ' AND ' + @FilterColumn + ' LIKE ''' + @FilterValue + '''' + +IF @SortColumn IS NULL OR @SortColumn = '' +SET @SortColumn = 'EA.DisplayName ASC' + +DECLARE @sql nvarchar(3500) + +set @sql = ' +SELECT + EA.AccountID, + EA.ItemID, + EA.AccountType, + EA.AccountName, + EA.DisplayName, + EA.PrimaryEmailAddress, + EA.SubscriberNumber +FROM ExchangeAccounts AS EA +WHERE ' + @condition + +print @sql + +exec sp_executesql @sql, N'@ItemID int, @IncludeMailboxes bit', +@ItemID, @IncludeMailboxes + +RETURN + + + diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs index 98a45a86..8a242db2 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs @@ -105,6 +105,11 @@ order by rg.groupOrder public const string EXCHANGE2007_OWAENABLED = "Exchange2007.OWAEnabled"; // OWA Enabled by default public const string EXCHANGE2007_MAPIENABLED = "Exchange2007.MAPIEnabled"; // MAPI Enabled by default public const string EXCHANGE2007_ACTIVESYNCENABLED = "Exchange2007.ActiveSyncEnabled"; // ActiveSync Enabled by default + public const string EXCHANGE2007_KEEPDELETEDITEMSDAYS = "Exchange2007.KeepDeletedItemsDays"; // Keep deleted items + public const string EXCHANGE2007_MAXRECIPIENTS = "Exchange2007.MaxRecipients"; // Max Recipients + public const string EXCHANGE2007_MAXSENDMESSAGESIZEKB = "Exchange2007.MaxSendMessageSizeKB"; // Max Send Message Size + public const string EXCHANGE2007_MAXRECEIVEMESSAGESIZEKB = "Exchange2007.MaxReceiveMessageSizeKB"; // Max Receive Message Size + public const string EXCHANGE2007_ISCONSUMER = "Exchange2007.IsConsumer"; // Is Consumer Organization public const string MSSQL2000_DATABASES = "MsSQL2000.Databases"; // Databases public const string MSSQL2000_USERS = "MsSQL2000.Users"; // Users public const string MSSQL2000_MAXDATABASESIZE = "MsSQL2000.MaxDatabaseSize"; // Max Database Size diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/ExchangeServerProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/ExchangeServerProxy.cs index 05e81557..99410a39 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/ExchangeServerProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/ExchangeServerProxy.cs @@ -1,31 +1,3 @@ -// Copyright (c) 2012, Outercurve Foundation. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// - Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// - Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// - Neither the name of the Outercurve Foundation nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - //------------------------------------------------------------------------------ // // This code was generated by a tool. @@ -39,8 +11,7 @@ // // This source code was auto-generated by wsdl, Version=2.0.50727.42. // -namespace WebsitePanel.EnterpriseServer -{ +namespace WebsitePanel.EnterpriseServer { using System.Xml.Serialization; using System.Web.Services; using System.ComponentModel; @@ -49,10 +20,12 @@ namespace WebsitePanel.EnterpriseServer using System.Diagnostics; using System.Data; + using WebsitePanel.Providers; using WebsitePanel.Providers.Common; using WebsitePanel.Providers.HostedSolution; using WebsitePanel.Providers.ResultObjects; + /// @@ -60,31 +33,10 @@ namespace WebsitePanel.EnterpriseServer [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Web.Services.WebServiceBindingAttribute(Name="esExchangeServerSoap", Namespace="http://smbsaas/websitepanel/enterpriseserver")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(BaseStatistics))] [System.Xml.Serialization.XmlIncludeAttribute(typeof(ServiceProviderItem))] public partial class esExchangeServer : Microsoft.Web.Services3.WebServicesClientProtocol { - private System.Threading.SendOrPostCallback GetPublicFolderMailFlowSettingsOperationCompleted; - - private System.Threading.SendOrPostCallback SetPublicFolderMailFlowSettingsOperationCompleted; - - private System.Threading.SendOrPostCallback GetPublicFolderEmailAddressesOperationCompleted; - - private System.Threading.SendOrPostCallback AddPublicFolderEmailAddressOperationCompleted; - - private System.Threading.SendOrPostCallback SetPublicFolderPrimaryEmailAddressOperationCompleted; - - private System.Threading.SendOrPostCallback DeletePublicFolderEmailAddressesOperationCompleted; - - private System.Threading.SendOrPostCallback GetMobileDevicesOperationCompleted; - - private System.Threading.SendOrPostCallback GetMobileDeviceOperationCompleted; - - private System.Threading.SendOrPostCallback WipeDataFromDeviceOperationCompleted; - - private System.Threading.SendOrPostCallback CancelRemoteWipeRequestOperationCompleted; - - private System.Threading.SendOrPostCallback RemoveDeviceOperationCompleted; - private System.Threading.SendOrPostCallback GetRawExchangeOrganizationsPagedOperationCompleted; private System.Threading.SendOrPostCallback GetExchangeOrganizationsPagedOperationCompleted; @@ -103,7 +55,7 @@ namespace WebsitePanel.EnterpriseServer private System.Threading.SendOrPostCallback GetMailboxesStatisticsOperationCompleted; - private System.Threading.SendOrPostCallback GetPublicFoldersStatisticsOperationCompleted; + private System.Threading.SendOrPostCallback GetMailboxStatisticsOperationCompleted; private System.Threading.SendOrPostCallback CalculateOrganizationDiskspaceOperationCompleted; @@ -149,9 +101,7 @@ namespace WebsitePanel.EnterpriseServer private System.Threading.SendOrPostCallback SetMailboxMailFlowSettingsOperationCompleted; - private System.Threading.SendOrPostCallback GetMailboxAdvancedSettingsOperationCompleted; - - private System.Threading.SendOrPostCallback SetMailboxAdvancedSettingsOperationCompleted; + private System.Threading.SendOrPostCallback SetExchangeMailboxPlanOperationCompleted; private System.Threading.SendOrPostCallback GetMailboxSetupInstructionsOperationCompleted; @@ -199,6 +149,26 @@ namespace WebsitePanel.EnterpriseServer private System.Threading.SendOrPostCallback GetDistributionListPermissionsOperationCompleted; + private System.Threading.SendOrPostCallback GetMobileDevicesOperationCompleted; + + private System.Threading.SendOrPostCallback GetMobileDeviceOperationCompleted; + + private System.Threading.SendOrPostCallback WipeDataFromDeviceOperationCompleted; + + private System.Threading.SendOrPostCallback CancelRemoteWipeRequestOperationCompleted; + + private System.Threading.SendOrPostCallback RemoveDeviceOperationCompleted; + + private System.Threading.SendOrPostCallback GetExchangeMailboxPlansOperationCompleted; + + private System.Threading.SendOrPostCallback GetExchangeMailboxPlanOperationCompleted; + + private System.Threading.SendOrPostCallback AddExchangeMailboxPlanOperationCompleted; + + private System.Threading.SendOrPostCallback DeleteExchangeMailboxPlanOperationCompleted; + + private System.Threading.SendOrPostCallback SetOrganizationDefaultExchangeMailboxPlanOperationCompleted; + private System.Threading.SendOrPostCallback CreatePublicFolderOperationCompleted; private System.Threading.SendOrPostCallback DeletePublicFoldersOperationCompleted; @@ -213,44 +183,23 @@ namespace WebsitePanel.EnterpriseServer private System.Threading.SendOrPostCallback SetPublicFolderGeneralSettingsOperationCompleted; + private System.Threading.SendOrPostCallback GetPublicFolderMailFlowSettingsOperationCompleted; + + private System.Threading.SendOrPostCallback SetPublicFolderMailFlowSettingsOperationCompleted; + + private System.Threading.SendOrPostCallback GetPublicFolderEmailAddressesOperationCompleted; + + private System.Threading.SendOrPostCallback AddPublicFolderEmailAddressOperationCompleted; + + private System.Threading.SendOrPostCallback SetPublicFolderPrimaryEmailAddressOperationCompleted; + + private System.Threading.SendOrPostCallback DeletePublicFolderEmailAddressesOperationCompleted; + /// public esExchangeServer() { this.Url = "http://localhost:9005/esExchangeServer.asmx"; } - /// - public event GetPublicFolderMailFlowSettingsCompletedEventHandler GetPublicFolderMailFlowSettingsCompleted; - - /// - public event SetPublicFolderMailFlowSettingsCompletedEventHandler SetPublicFolderMailFlowSettingsCompleted; - - /// - public event GetPublicFolderEmailAddressesCompletedEventHandler GetPublicFolderEmailAddressesCompleted; - - /// - public event AddPublicFolderEmailAddressCompletedEventHandler AddPublicFolderEmailAddressCompleted; - - /// - public event SetPublicFolderPrimaryEmailAddressCompletedEventHandler SetPublicFolderPrimaryEmailAddressCompleted; - - /// - public event DeletePublicFolderEmailAddressesCompletedEventHandler DeletePublicFolderEmailAddressesCompleted; - - /// - public event GetMobileDevicesCompletedEventHandler GetMobileDevicesCompleted; - - /// - public event GetMobileDeviceCompletedEventHandler GetMobileDeviceCompleted; - - /// - public event WipeDataFromDeviceCompletedEventHandler WipeDataFromDeviceCompleted; - - /// - public event CancelRemoteWipeRequestCompletedEventHandler CancelRemoteWipeRequestCompleted; - - /// - public event RemoveDeviceCompletedEventHandler RemoveDeviceCompleted; - /// public event GetRawExchangeOrganizationsPagedCompletedEventHandler GetRawExchangeOrganizationsPagedCompleted; @@ -279,7 +228,7 @@ namespace WebsitePanel.EnterpriseServer public event GetMailboxesStatisticsCompletedEventHandler GetMailboxesStatisticsCompleted; /// - public event GetPublicFoldersStatisticsCompletedEventHandler GetPublicFoldersStatisticsCompleted; + public event GetMailboxStatisticsCompletedEventHandler GetMailboxStatisticsCompleted; /// public event CalculateOrganizationDiskspaceCompletedEventHandler CalculateOrganizationDiskspaceCompleted; @@ -348,10 +297,7 @@ namespace WebsitePanel.EnterpriseServer public event SetMailboxMailFlowSettingsCompletedEventHandler SetMailboxMailFlowSettingsCompleted; /// - public event GetMailboxAdvancedSettingsCompletedEventHandler GetMailboxAdvancedSettingsCompleted; - - /// - public event SetMailboxAdvancedSettingsCompletedEventHandler SetMailboxAdvancedSettingsCompleted; + public event SetExchangeMailboxPlanCompletedEventHandler SetExchangeMailboxPlanCompleted; /// public event GetMailboxSetupInstructionsCompletedEventHandler GetMailboxSetupInstructionsCompleted; @@ -422,6 +368,36 @@ namespace WebsitePanel.EnterpriseServer /// public event GetDistributionListPermissionsCompletedEventHandler GetDistributionListPermissionsCompleted; + /// + public event GetMobileDevicesCompletedEventHandler GetMobileDevicesCompleted; + + /// + public event GetMobileDeviceCompletedEventHandler GetMobileDeviceCompleted; + + /// + public event WipeDataFromDeviceCompletedEventHandler WipeDataFromDeviceCompleted; + + /// + public event CancelRemoteWipeRequestCompletedEventHandler CancelRemoteWipeRequestCompleted; + + /// + public event RemoveDeviceCompletedEventHandler RemoveDeviceCompleted; + + /// + public event GetExchangeMailboxPlansCompletedEventHandler GetExchangeMailboxPlansCompleted; + + /// + public event GetExchangeMailboxPlanCompletedEventHandler GetExchangeMailboxPlanCompleted; + + /// + public event AddExchangeMailboxPlanCompletedEventHandler AddExchangeMailboxPlanCompleted; + + /// + public event DeleteExchangeMailboxPlanCompletedEventHandler DeleteExchangeMailboxPlanCompleted; + + /// + public event SetOrganizationDefaultExchangeMailboxPlanCompletedEventHandler SetOrganizationDefaultExchangeMailboxPlanCompleted; + /// public event CreatePublicFolderCompletedEventHandler CreatePublicFolderCompleted; @@ -444,500 +420,22 @@ namespace WebsitePanel.EnterpriseServer public event SetPublicFolderGeneralSettingsCompletedEventHandler SetPublicFolderGeneralSettingsCompleted; /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetPublicFolderMailFlowSettings", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public ExchangePublicFolder GetPublicFolderMailFlowSettings(int itemId, int accountId) { - object[] results = this.Invoke("GetPublicFolderMailFlowSettings", new object[] { - itemId, - accountId}); - return ((ExchangePublicFolder)(results[0])); - } + public event GetPublicFolderMailFlowSettingsCompletedEventHandler GetPublicFolderMailFlowSettingsCompleted; /// - public System.IAsyncResult BeginGetPublicFolderMailFlowSettings(int itemId, int accountId, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("GetPublicFolderMailFlowSettings", new object[] { - itemId, - accountId}, callback, asyncState); - } + public event SetPublicFolderMailFlowSettingsCompletedEventHandler SetPublicFolderMailFlowSettingsCompleted; /// - public ExchangePublicFolder EndGetPublicFolderMailFlowSettings(System.IAsyncResult asyncResult) { - object[] results = this.EndInvoke(asyncResult); - return ((ExchangePublicFolder)(results[0])); - } + public event GetPublicFolderEmailAddressesCompletedEventHandler GetPublicFolderEmailAddressesCompleted; /// - public void GetPublicFolderMailFlowSettingsAsync(int itemId, int accountId) { - this.GetPublicFolderMailFlowSettingsAsync(itemId, accountId, null); - } + public event AddPublicFolderEmailAddressCompletedEventHandler AddPublicFolderEmailAddressCompleted; /// - public void GetPublicFolderMailFlowSettingsAsync(int itemId, int accountId, object userState) { - if ((this.GetPublicFolderMailFlowSettingsOperationCompleted == null)) { - this.GetPublicFolderMailFlowSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetPublicFolderMailFlowSettingsOperationCompleted); - } - this.InvokeAsync("GetPublicFolderMailFlowSettings", new object[] { - itemId, - accountId}, this.GetPublicFolderMailFlowSettingsOperationCompleted, userState); - } - - private void OnGetPublicFolderMailFlowSettingsOperationCompleted(object arg) { - if ((this.GetPublicFolderMailFlowSettingsCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.GetPublicFolderMailFlowSettingsCompleted(this, new GetPublicFolderMailFlowSettingsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } + public event SetPublicFolderPrimaryEmailAddressCompletedEventHandler SetPublicFolderPrimaryEmailAddressCompleted; /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SetPublicFolderMailFlowSettings", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public int SetPublicFolderMailFlowSettings(int itemId, int accountId, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) { - object[] results = this.Invoke("SetPublicFolderMailFlowSettings", new object[] { - itemId, - accountId, - acceptAccounts, - rejectAccounts, - requireSenderAuthentication}); - return ((int)(results[0])); - } - - /// - public System.IAsyncResult BeginSetPublicFolderMailFlowSettings(int itemId, int accountId, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("SetPublicFolderMailFlowSettings", new object[] { - itemId, - accountId, - acceptAccounts, - rejectAccounts, - requireSenderAuthentication}, callback, asyncState); - } - - /// - public int EndSetPublicFolderMailFlowSettings(System.IAsyncResult asyncResult) { - object[] results = this.EndInvoke(asyncResult); - return ((int)(results[0])); - } - - /// - public void SetPublicFolderMailFlowSettingsAsync(int itemId, int accountId, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) { - this.SetPublicFolderMailFlowSettingsAsync(itemId, accountId, acceptAccounts, rejectAccounts, requireSenderAuthentication, null); - } - - /// - public void SetPublicFolderMailFlowSettingsAsync(int itemId, int accountId, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication, object userState) { - if ((this.SetPublicFolderMailFlowSettingsOperationCompleted == null)) { - this.SetPublicFolderMailFlowSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetPublicFolderMailFlowSettingsOperationCompleted); - } - this.InvokeAsync("SetPublicFolderMailFlowSettings", new object[] { - itemId, - accountId, - acceptAccounts, - rejectAccounts, - requireSenderAuthentication}, this.SetPublicFolderMailFlowSettingsOperationCompleted, userState); - } - - private void OnSetPublicFolderMailFlowSettingsOperationCompleted(object arg) { - if ((this.SetPublicFolderMailFlowSettingsCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.SetPublicFolderMailFlowSettingsCompleted(this, new SetPublicFolderMailFlowSettingsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetPublicFolderEmailAddresses", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public ExchangeEmailAddress[] GetPublicFolderEmailAddresses(int itemId, int accountId) { - object[] results = this.Invoke("GetPublicFolderEmailAddresses", new object[] { - itemId, - accountId}); - return ((ExchangeEmailAddress[])(results[0])); - } - - /// - public System.IAsyncResult BeginGetPublicFolderEmailAddresses(int itemId, int accountId, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("GetPublicFolderEmailAddresses", new object[] { - itemId, - accountId}, callback, asyncState); - } - - /// - public ExchangeEmailAddress[] EndGetPublicFolderEmailAddresses(System.IAsyncResult asyncResult) { - object[] results = this.EndInvoke(asyncResult); - return ((ExchangeEmailAddress[])(results[0])); - } - - /// - public void GetPublicFolderEmailAddressesAsync(int itemId, int accountId) { - this.GetPublicFolderEmailAddressesAsync(itemId, accountId, null); - } - - /// - public void GetPublicFolderEmailAddressesAsync(int itemId, int accountId, object userState) { - if ((this.GetPublicFolderEmailAddressesOperationCompleted == null)) { - this.GetPublicFolderEmailAddressesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetPublicFolderEmailAddressesOperationCompleted); - } - this.InvokeAsync("GetPublicFolderEmailAddresses", new object[] { - itemId, - accountId}, this.GetPublicFolderEmailAddressesOperationCompleted, userState); - } - - private void OnGetPublicFolderEmailAddressesOperationCompleted(object arg) { - if ((this.GetPublicFolderEmailAddressesCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.GetPublicFolderEmailAddressesCompleted(this, new GetPublicFolderEmailAddressesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/AddPublicFolderEmailAddress", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public int AddPublicFolderEmailAddress(int itemId, int accountId, string emailAddress) { - object[] results = this.Invoke("AddPublicFolderEmailAddress", new object[] { - itemId, - accountId, - emailAddress}); - return ((int)(results[0])); - } - - /// - public System.IAsyncResult BeginAddPublicFolderEmailAddress(int itemId, int accountId, string emailAddress, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("AddPublicFolderEmailAddress", new object[] { - itemId, - accountId, - emailAddress}, callback, asyncState); - } - - /// - public int EndAddPublicFolderEmailAddress(System.IAsyncResult asyncResult) { - object[] results = this.EndInvoke(asyncResult); - return ((int)(results[0])); - } - - /// - public void AddPublicFolderEmailAddressAsync(int itemId, int accountId, string emailAddress) { - this.AddPublicFolderEmailAddressAsync(itemId, accountId, emailAddress, null); - } - - /// - public void AddPublicFolderEmailAddressAsync(int itemId, int accountId, string emailAddress, object userState) { - if ((this.AddPublicFolderEmailAddressOperationCompleted == null)) { - this.AddPublicFolderEmailAddressOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddPublicFolderEmailAddressOperationCompleted); - } - this.InvokeAsync("AddPublicFolderEmailAddress", new object[] { - itemId, - accountId, - emailAddress}, this.AddPublicFolderEmailAddressOperationCompleted, userState); - } - - private void OnAddPublicFolderEmailAddressOperationCompleted(object arg) { - if ((this.AddPublicFolderEmailAddressCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.AddPublicFolderEmailAddressCompleted(this, new AddPublicFolderEmailAddressCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SetPublicFolderPrimaryEmailAddress", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public int SetPublicFolderPrimaryEmailAddress(int itemId, int accountId, string emailAddress) { - object[] results = this.Invoke("SetPublicFolderPrimaryEmailAddress", new object[] { - itemId, - accountId, - emailAddress}); - return ((int)(results[0])); - } - - /// - public System.IAsyncResult BeginSetPublicFolderPrimaryEmailAddress(int itemId, int accountId, string emailAddress, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("SetPublicFolderPrimaryEmailAddress", new object[] { - itemId, - accountId, - emailAddress}, callback, asyncState); - } - - /// - public int EndSetPublicFolderPrimaryEmailAddress(System.IAsyncResult asyncResult) { - object[] results = this.EndInvoke(asyncResult); - return ((int)(results[0])); - } - - /// - public void SetPublicFolderPrimaryEmailAddressAsync(int itemId, int accountId, string emailAddress) { - this.SetPublicFolderPrimaryEmailAddressAsync(itemId, accountId, emailAddress, null); - } - - /// - public void SetPublicFolderPrimaryEmailAddressAsync(int itemId, int accountId, string emailAddress, object userState) { - if ((this.SetPublicFolderPrimaryEmailAddressOperationCompleted == null)) { - this.SetPublicFolderPrimaryEmailAddressOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetPublicFolderPrimaryEmailAddressOperationCompleted); - } - this.InvokeAsync("SetPublicFolderPrimaryEmailAddress", new object[] { - itemId, - accountId, - emailAddress}, this.SetPublicFolderPrimaryEmailAddressOperationCompleted, userState); - } - - private void OnSetPublicFolderPrimaryEmailAddressOperationCompleted(object arg) { - if ((this.SetPublicFolderPrimaryEmailAddressCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.SetPublicFolderPrimaryEmailAddressCompleted(this, new SetPublicFolderPrimaryEmailAddressCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/DeletePublicFolderEmailAddresses", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public int DeletePublicFolderEmailAddresses(int itemId, int accountId, string[] emailAddresses) { - object[] results = this.Invoke("DeletePublicFolderEmailAddresses", new object[] { - itemId, - accountId, - emailAddresses}); - return ((int)(results[0])); - } - - /// - public System.IAsyncResult BeginDeletePublicFolderEmailAddresses(int itemId, int accountId, string[] emailAddresses, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("DeletePublicFolderEmailAddresses", new object[] { - itemId, - accountId, - emailAddresses}, callback, asyncState); - } - - /// - public int EndDeletePublicFolderEmailAddresses(System.IAsyncResult asyncResult) { - object[] results = this.EndInvoke(asyncResult); - return ((int)(results[0])); - } - - /// - public void DeletePublicFolderEmailAddressesAsync(int itemId, int accountId, string[] emailAddresses) { - this.DeletePublicFolderEmailAddressesAsync(itemId, accountId, emailAddresses, null); - } - - /// - public void DeletePublicFolderEmailAddressesAsync(int itemId, int accountId, string[] emailAddresses, object userState) { - if ((this.DeletePublicFolderEmailAddressesOperationCompleted == null)) { - this.DeletePublicFolderEmailAddressesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeletePublicFolderEmailAddressesOperationCompleted); - } - this.InvokeAsync("DeletePublicFolderEmailAddresses", new object[] { - itemId, - accountId, - emailAddresses}, this.DeletePublicFolderEmailAddressesOperationCompleted, userState); - } - - private void OnDeletePublicFolderEmailAddressesOperationCompleted(object arg) { - if ((this.DeletePublicFolderEmailAddressesCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.DeletePublicFolderEmailAddressesCompleted(this, new DeletePublicFolderEmailAddressesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetMobileDevices", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public ExchangeMobileDevice[] GetMobileDevices(int itemId, int accountId) { - object[] results = this.Invoke("GetMobileDevices", new object[] { - itemId, - accountId}); - return ((ExchangeMobileDevice[])(results[0])); - } - - /// - public System.IAsyncResult BeginGetMobileDevices(int itemId, int accountId, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("GetMobileDevices", new object[] { - itemId, - accountId}, callback, asyncState); - } - - /// - public ExchangeMobileDevice[] EndGetMobileDevices(System.IAsyncResult asyncResult) { - object[] results = this.EndInvoke(asyncResult); - return ((ExchangeMobileDevice[])(results[0])); - } - - /// - public void GetMobileDevicesAsync(int itemId, int accountId) { - this.GetMobileDevicesAsync(itemId, accountId, null); - } - - /// - public void GetMobileDevicesAsync(int itemId, int accountId, object userState) { - if ((this.GetMobileDevicesOperationCompleted == null)) { - this.GetMobileDevicesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetMobileDevicesOperationCompleted); - } - this.InvokeAsync("GetMobileDevices", new object[] { - itemId, - accountId}, this.GetMobileDevicesOperationCompleted, userState); - } - - private void OnGetMobileDevicesOperationCompleted(object arg) { - if ((this.GetMobileDevicesCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.GetMobileDevicesCompleted(this, new GetMobileDevicesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetMobileDevice", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public ExchangeMobileDevice GetMobileDevice(int itemId, string deviceId) { - object[] results = this.Invoke("GetMobileDevice", new object[] { - itemId, - deviceId}); - return ((ExchangeMobileDevice)(results[0])); - } - - /// - public System.IAsyncResult BeginGetMobileDevice(int itemId, string deviceId, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("GetMobileDevice", new object[] { - itemId, - deviceId}, callback, asyncState); - } - - /// - public ExchangeMobileDevice EndGetMobileDevice(System.IAsyncResult asyncResult) { - object[] results = this.EndInvoke(asyncResult); - return ((ExchangeMobileDevice)(results[0])); - } - - /// - public void GetMobileDeviceAsync(int itemId, string deviceId) { - this.GetMobileDeviceAsync(itemId, deviceId, null); - } - - /// - public void GetMobileDeviceAsync(int itemId, string deviceId, object userState) { - if ((this.GetMobileDeviceOperationCompleted == null)) { - this.GetMobileDeviceOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetMobileDeviceOperationCompleted); - } - this.InvokeAsync("GetMobileDevice", new object[] { - itemId, - deviceId}, this.GetMobileDeviceOperationCompleted, userState); - } - - private void OnGetMobileDeviceOperationCompleted(object arg) { - if ((this.GetMobileDeviceCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.GetMobileDeviceCompleted(this, new GetMobileDeviceCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/WipeDataFromDevice", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void WipeDataFromDevice(int itemId, string deviceId) { - this.Invoke("WipeDataFromDevice", new object[] { - itemId, - deviceId}); - } - - /// - public System.IAsyncResult BeginWipeDataFromDevice(int itemId, string deviceId, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("WipeDataFromDevice", new object[] { - itemId, - deviceId}, callback, asyncState); - } - - /// - public void EndWipeDataFromDevice(System.IAsyncResult asyncResult) { - this.EndInvoke(asyncResult); - } - - /// - public void WipeDataFromDeviceAsync(int itemId, string deviceId) { - this.WipeDataFromDeviceAsync(itemId, deviceId, null); - } - - /// - public void WipeDataFromDeviceAsync(int itemId, string deviceId, object userState) { - if ((this.WipeDataFromDeviceOperationCompleted == null)) { - this.WipeDataFromDeviceOperationCompleted = new System.Threading.SendOrPostCallback(this.OnWipeDataFromDeviceOperationCompleted); - } - this.InvokeAsync("WipeDataFromDevice", new object[] { - itemId, - deviceId}, this.WipeDataFromDeviceOperationCompleted, userState); - } - - private void OnWipeDataFromDeviceOperationCompleted(object arg) { - if ((this.WipeDataFromDeviceCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.WipeDataFromDeviceCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/CancelRemoteWipeRequest", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void CancelRemoteWipeRequest(int itemId, string deviceId) { - this.Invoke("CancelRemoteWipeRequest", new object[] { - itemId, - deviceId}); - } - - /// - public System.IAsyncResult BeginCancelRemoteWipeRequest(int itemId, string deviceId, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("CancelRemoteWipeRequest", new object[] { - itemId, - deviceId}, callback, asyncState); - } - - /// - public void EndCancelRemoteWipeRequest(System.IAsyncResult asyncResult) { - this.EndInvoke(asyncResult); - } - - /// - public void CancelRemoteWipeRequestAsync(int itemId, string deviceId) { - this.CancelRemoteWipeRequestAsync(itemId, deviceId, null); - } - - /// - public void CancelRemoteWipeRequestAsync(int itemId, string deviceId, object userState) { - if ((this.CancelRemoteWipeRequestOperationCompleted == null)) { - this.CancelRemoteWipeRequestOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCancelRemoteWipeRequestOperationCompleted); - } - this.InvokeAsync("CancelRemoteWipeRequest", new object[] { - itemId, - deviceId}, this.CancelRemoteWipeRequestOperationCompleted, userState); - } - - private void OnCancelRemoteWipeRequestOperationCompleted(object arg) { - if ((this.CancelRemoteWipeRequestCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.CancelRemoteWipeRequestCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/RemoveDevice", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void RemoveDevice(int itemId, string deviceId) { - this.Invoke("RemoveDevice", new object[] { - itemId, - deviceId}); - } - - /// - public System.IAsyncResult BeginRemoveDevice(int itemId, string deviceId, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("RemoveDevice", new object[] { - itemId, - deviceId}, callback, asyncState); - } - - /// - public void EndRemoveDevice(System.IAsyncResult asyncResult) { - this.EndInvoke(asyncResult); - } - - /// - public void RemoveDeviceAsync(int itemId, string deviceId) { - this.RemoveDeviceAsync(itemId, deviceId, null); - } - - /// - public void RemoveDeviceAsync(int itemId, string deviceId, object userState) { - if ((this.RemoveDeviceOperationCompleted == null)) { - this.RemoveDeviceOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRemoveDeviceOperationCompleted); - } - this.InvokeAsync("RemoveDevice", new object[] { - itemId, - deviceId}, this.RemoveDeviceOperationCompleted, userState); - } - - private void OnRemoveDeviceOperationCompleted(object arg) { - if ((this.RemoveDeviceCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.RemoveDeviceCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } + public event DeletePublicFolderEmailAddressesCompletedEventHandler DeletePublicFolderEmailAddressesCompleted; /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetRawExchangeOrganizationsPaged", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] @@ -1363,43 +861,46 @@ namespace WebsitePanel.EnterpriseServer } /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetPublicFoldersStatistics", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public ExchangeItemStatistics[] GetPublicFoldersStatistics(int itemId) { - object[] results = this.Invoke("GetPublicFoldersStatistics", new object[] { - itemId}); - return ((ExchangeItemStatistics[])(results[0])); + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetMailboxStatistics", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ExchangeMailboxStatistics GetMailboxStatistics(int itemId, int accountId) { + object[] results = this.Invoke("GetMailboxStatistics", new object[] { + itemId, + accountId}); + return ((ExchangeMailboxStatistics)(results[0])); } /// - public System.IAsyncResult BeginGetPublicFoldersStatistics(int itemId, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("GetPublicFoldersStatistics", new object[] { - itemId}, callback, asyncState); + public System.IAsyncResult BeginGetMailboxStatistics(int itemId, int accountId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetMailboxStatistics", new object[] { + itemId, + accountId}, callback, asyncState); } /// - public ExchangeItemStatistics[] EndGetPublicFoldersStatistics(System.IAsyncResult asyncResult) { + public ExchangeMailboxStatistics EndGetMailboxStatistics(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); - return ((ExchangeItemStatistics[])(results[0])); + return ((ExchangeMailboxStatistics)(results[0])); } /// - public void GetPublicFoldersStatisticsAsync(int itemId) { - this.GetPublicFoldersStatisticsAsync(itemId, null); + public void GetMailboxStatisticsAsync(int itemId, int accountId) { + this.GetMailboxStatisticsAsync(itemId, accountId, null); } /// - public void GetPublicFoldersStatisticsAsync(int itemId, object userState) { - if ((this.GetPublicFoldersStatisticsOperationCompleted == null)) { - this.GetPublicFoldersStatisticsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetPublicFoldersStatisticsOperationCompleted); + public void GetMailboxStatisticsAsync(int itemId, int accountId, object userState) { + if ((this.GetMailboxStatisticsOperationCompleted == null)) { + this.GetMailboxStatisticsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetMailboxStatisticsOperationCompleted); } - this.InvokeAsync("GetPublicFoldersStatistics", new object[] { - itemId}, this.GetPublicFoldersStatisticsOperationCompleted, userState); + this.InvokeAsync("GetMailboxStatistics", new object[] { + itemId, + accountId}, this.GetMailboxStatisticsOperationCompleted, userState); } - private void OnGetPublicFoldersStatisticsOperationCompleted(object arg) { - if ((this.GetPublicFoldersStatisticsCompleted != null)) { + private void OnGetMailboxStatisticsOperationCompleted(object arg) { + if ((this.GetMailboxStatisticsCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.GetPublicFoldersStatisticsCompleted(this, new GetPublicFoldersStatisticsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + this.GetMailboxStatisticsCompleted(this, new GetMailboxStatisticsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } @@ -2038,7 +1539,7 @@ namespace WebsitePanel.EnterpriseServer /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/CreateMailbox", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public int CreateMailbox(int itemId, int accountId, ExchangeAccountType accountType, string accountName, string displayName, string name, string domain, string password, bool sendSetupInstructions, string setupInstructionMailAddress) { + public int CreateMailbox(int itemId, int accountId, ExchangeAccountType accountType, string accountName, string displayName, string name, string domain, string password, bool sendSetupInstructions, string setupInstructionMailAddress, int mailboxPlanId, string subscriberNumber) { object[] results = this.Invoke("CreateMailbox", new object[] { itemId, accountId, @@ -2049,12 +1550,14 @@ namespace WebsitePanel.EnterpriseServer domain, password, sendSetupInstructions, - setupInstructionMailAddress}); + setupInstructionMailAddress, + mailboxPlanId, + subscriberNumber}); return ((int)(results[0])); } /// - public System.IAsyncResult BeginCreateMailbox(int itemId, int accountId, ExchangeAccountType accountType, string accountName, string displayName, string name, string domain, string password, bool sendSetupInstructions, string setupInstructionMailAddress, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginCreateMailbox(int itemId, int accountId, ExchangeAccountType accountType, string accountName, string displayName, string name, string domain, string password, bool sendSetupInstructions, string setupInstructionMailAddress, int mailboxPlanId, string subscriberNumber, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("CreateMailbox", new object[] { itemId, accountId, @@ -2065,7 +1568,9 @@ namespace WebsitePanel.EnterpriseServer domain, password, sendSetupInstructions, - setupInstructionMailAddress}, callback, asyncState); + setupInstructionMailAddress, + mailboxPlanId, + subscriberNumber}, callback, asyncState); } /// @@ -2075,12 +1580,12 @@ namespace WebsitePanel.EnterpriseServer } /// - public void CreateMailboxAsync(int itemId, int accountId, ExchangeAccountType accountType, string accountName, string displayName, string name, string domain, string password, bool sendSetupInstructions, string setupInstructionMailAddress) { - this.CreateMailboxAsync(itemId, accountId, accountType, accountName, displayName, name, domain, password, sendSetupInstructions, setupInstructionMailAddress, null); + public void CreateMailboxAsync(int itemId, int accountId, ExchangeAccountType accountType, string accountName, string displayName, string name, string domain, string password, bool sendSetupInstructions, string setupInstructionMailAddress, int mailboxPlanId, string subscriberNumber) { + this.CreateMailboxAsync(itemId, accountId, accountType, accountName, displayName, name, domain, password, sendSetupInstructions, setupInstructionMailAddress, mailboxPlanId, subscriberNumber, null); } /// - public void CreateMailboxAsync(int itemId, int accountId, ExchangeAccountType accountType, string accountName, string displayName, string name, string domain, string password, bool sendSetupInstructions, string setupInstructionMailAddress, object userState) { + public void CreateMailboxAsync(int itemId, int accountId, ExchangeAccountType accountType, string accountName, string displayName, string name, string domain, string password, bool sendSetupInstructions, string setupInstructionMailAddress, int mailboxPlanId, string subscriberNumber, object userState) { if ((this.CreateMailboxOperationCompleted == null)) { this.CreateMailboxOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateMailboxOperationCompleted); } @@ -2094,7 +1599,9 @@ namespace WebsitePanel.EnterpriseServer domain, password, sendSetupInstructions, - setupInstructionMailAddress}, this.CreateMailboxOperationCompleted, userState); + setupInstructionMailAddress, + mailboxPlanId, + subscriberNumber}, this.CreateMailboxOperationCompleted, userState); } private void OnCreateMailboxOperationCompleted(object arg) { @@ -2238,120 +1745,22 @@ namespace WebsitePanel.EnterpriseServer /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SetMailboxGeneralSettings", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public int SetMailboxGeneralSettings( - int itemId, - int accountId, - string displayName, - string password, - bool hideAddressBook, - bool disabled, - string firstName, - string initials, - string lastName, - string address, - string city, - string state, - string zip, - string country, - string jobTitle, - string company, - string department, - string office, - string managerAccountName, - string businessPhone, - string fax, - string homePhone, - string mobilePhone, - string pager, - string webPage, - string notes) { + public int SetMailboxGeneralSettings(int itemId, int accountId, bool hideAddressBook, bool disabled) { object[] results = this.Invoke("SetMailboxGeneralSettings", new object[] { itemId, accountId, - displayName, - password, hideAddressBook, - disabled, - firstName, - initials, - lastName, - address, - city, - state, - zip, - country, - jobTitle, - company, - department, - office, - managerAccountName, - businessPhone, - fax, - homePhone, - mobilePhone, - pager, - webPage, - notes}); + disabled}); return ((int)(results[0])); } /// - public System.IAsyncResult BeginSetMailboxGeneralSettings( - int itemId, - int accountId, - string displayName, - string password, - bool hideAddressBook, - bool disabled, - string firstName, - string initials, - string lastName, - string address, - string city, - string state, - string zip, - string country, - string jobTitle, - string company, - string department, - string office, - string managerAccountName, - string businessPhone, - string fax, - string homePhone, - string mobilePhone, - string pager, - string webPage, - string notes, - System.AsyncCallback callback, - object asyncState) { + public System.IAsyncResult BeginSetMailboxGeneralSettings(int itemId, int accountId, bool hideAddressBook, bool disabled, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("SetMailboxGeneralSettings", new object[] { itemId, accountId, - displayName, - password, hideAddressBook, - disabled, - firstName, - initials, - lastName, - address, - city, - state, - zip, - country, - jobTitle, - company, - department, - office, - managerAccountName, - businessPhone, - fax, - homePhone, - mobilePhone, - pager, - webPage, - notes}, callback, asyncState); + disabled}, callback, asyncState); } /// @@ -2361,95 +1770,20 @@ namespace WebsitePanel.EnterpriseServer } /// - public void SetMailboxGeneralSettingsAsync( - int itemId, - int accountId, - string displayName, - string password, - bool hideAddressBook, - bool disabled, - string firstName, - string initials, - string lastName, - string address, - string city, - string state, - string zip, - string country, - string jobTitle, - string company, - string department, - string office, - string managerAccountName, - string businessPhone, - string fax, - string homePhone, - string mobilePhone, - string pager, - string webPage, - string notes) { - this.SetMailboxGeneralSettingsAsync(itemId, accountId, displayName, password, hideAddressBook, disabled, firstName, initials, lastName, address, city, state, zip, country, jobTitle, company, department, office, managerAccountName, businessPhone, fax, homePhone, mobilePhone, pager, webPage, notes, null); + public void SetMailboxGeneralSettingsAsync(int itemId, int accountId, bool hideAddressBook, bool disabled) { + this.SetMailboxGeneralSettingsAsync(itemId, accountId, hideAddressBook, disabled, null); } /// - public void SetMailboxGeneralSettingsAsync( - int itemId, - int accountId, - string displayName, - string password, - bool hideAddressBook, - bool disabled, - string firstName, - string initials, - string lastName, - string address, - string city, - string state, - string zip, - string country, - string jobTitle, - string company, - string department, - string office, - string managerAccountName, - string businessPhone, - string fax, - string homePhone, - string mobilePhone, - string pager, - string webPage, - string notes, - object userState) { + public void SetMailboxGeneralSettingsAsync(int itemId, int accountId, bool hideAddressBook, bool disabled, object userState) { if ((this.SetMailboxGeneralSettingsOperationCompleted == null)) { this.SetMailboxGeneralSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetMailboxGeneralSettingsOperationCompleted); } this.InvokeAsync("SetMailboxGeneralSettings", new object[] { itemId, accountId, - displayName, - password, hideAddressBook, - disabled, - firstName, - initials, - lastName, - address, - city, - state, - zip, - country, - jobTitle, - company, - department, - office, - managerAccountName, - businessPhone, - fax, - homePhone, - mobilePhone, - pager, - webPage, - notes}, this.SetMailboxGeneralSettingsOperationCompleted, userState); + disabled}, this.SetMailboxGeneralSettingsOperationCompleted, userState); } private void OnSetMailboxGeneralSettingsOperationCompleted(object arg) { @@ -2690,7 +2024,7 @@ namespace WebsitePanel.EnterpriseServer /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SetMailboxMailFlowSettings", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public int SetMailboxMailFlowSettings(int itemId, int accountId, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB, bool requireSenderAuthentication) { + public int SetMailboxMailFlowSettings(int itemId, int accountId, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) { object[] results = this.Invoke("SetMailboxMailFlowSettings", new object[] { itemId, accountId, @@ -2700,15 +2034,12 @@ namespace WebsitePanel.EnterpriseServer sendOnBehalfAccounts, acceptAccounts, rejectAccounts, - maxRecipients, - maxSendMessageSizeKB, - maxReceiveMessageSizeKB, requireSenderAuthentication}); return ((int)(results[0])); } /// - public System.IAsyncResult BeginSetMailboxMailFlowSettings(int itemId, int accountId, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB, bool requireSenderAuthentication, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginSetMailboxMailFlowSettings(int itemId, int accountId, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("SetMailboxMailFlowSettings", new object[] { itemId, accountId, @@ -2718,9 +2049,6 @@ namespace WebsitePanel.EnterpriseServer sendOnBehalfAccounts, acceptAccounts, rejectAccounts, - maxRecipients, - maxSendMessageSizeKB, - maxReceiveMessageSizeKB, requireSenderAuthentication}, callback, asyncState); } @@ -2731,12 +2059,12 @@ namespace WebsitePanel.EnterpriseServer } /// - public void SetMailboxMailFlowSettingsAsync(int itemId, int accountId, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB, bool requireSenderAuthentication) { - this.SetMailboxMailFlowSettingsAsync(itemId, accountId, enableForwarding, forwardingAccountName, forwardToBoth, sendOnBehalfAccounts, acceptAccounts, rejectAccounts, maxRecipients, maxSendMessageSizeKB, maxReceiveMessageSizeKB, requireSenderAuthentication, null); + public void SetMailboxMailFlowSettingsAsync(int itemId, int accountId, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) { + this.SetMailboxMailFlowSettingsAsync(itemId, accountId, enableForwarding, forwardingAccountName, forwardToBoth, sendOnBehalfAccounts, acceptAccounts, rejectAccounts, requireSenderAuthentication, null); } /// - public void SetMailboxMailFlowSettingsAsync(int itemId, int accountId, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB, bool requireSenderAuthentication, object userState) { + public void SetMailboxMailFlowSettingsAsync(int itemId, int accountId, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication, object userState) { if ((this.SetMailboxMailFlowSettingsOperationCompleted == null)) { this.SetMailboxMailFlowSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetMailboxMailFlowSettingsOperationCompleted); } @@ -2749,9 +2077,6 @@ namespace WebsitePanel.EnterpriseServer sendOnBehalfAccounts, acceptAccounts, rejectAccounts, - maxRecipients, - maxSendMessageSizeKB, - maxReceiveMessageSizeKB, requireSenderAuthentication}, this.SetMailboxMailFlowSettingsOperationCompleted, userState); } @@ -2763,117 +2088,49 @@ namespace WebsitePanel.EnterpriseServer } /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetMailboxAdvancedSettings", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public ExchangeMailbox GetMailboxAdvancedSettings(int itemId, int accountId) { - object[] results = this.Invoke("GetMailboxAdvancedSettings", new object[] { - itemId, - accountId}); - return ((ExchangeMailbox)(results[0])); - } - - /// - public System.IAsyncResult BeginGetMailboxAdvancedSettings(int itemId, int accountId, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("GetMailboxAdvancedSettings", new object[] { - itemId, - accountId}, callback, asyncState); - } - - /// - public ExchangeMailbox EndGetMailboxAdvancedSettings(System.IAsyncResult asyncResult) { - object[] results = this.EndInvoke(asyncResult); - return ((ExchangeMailbox)(results[0])); - } - - /// - public void GetMailboxAdvancedSettingsAsync(int itemId, int accountId) { - this.GetMailboxAdvancedSettingsAsync(itemId, accountId, null); - } - - /// - public void GetMailboxAdvancedSettingsAsync(int itemId, int accountId, object userState) { - if ((this.GetMailboxAdvancedSettingsOperationCompleted == null)) { - this.GetMailboxAdvancedSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetMailboxAdvancedSettingsOperationCompleted); - } - this.InvokeAsync("GetMailboxAdvancedSettings", new object[] { - itemId, - accountId}, this.GetMailboxAdvancedSettingsOperationCompleted, userState); - } - - private void OnGetMailboxAdvancedSettingsOperationCompleted(object arg) { - if ((this.GetMailboxAdvancedSettingsCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.GetMailboxAdvancedSettingsCompleted(this, new GetMailboxAdvancedSettingsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SetMailboxAdvancedSettings", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public int SetMailboxAdvancedSettings(int itemId, int accountId, bool enablePOP, bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays) { - object[] results = this.Invoke("SetMailboxAdvancedSettings", new object[] { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SetExchangeMailboxPlan", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int SetExchangeMailboxPlan(int itemId, int accountId, int mailboxPlanId) { + object[] results = this.Invoke("SetExchangeMailboxPlan", new object[] { itemId, accountId, - enablePOP, - enableIMAP, - enableOWA, - enableMAPI, - enableActiveSync, - issueWarningKB, - prohibitSendKB, - prohibitSendReceiveKB, - keepDeletedItemsDays}); + mailboxPlanId}); return ((int)(results[0])); } /// - public System.IAsyncResult BeginSetMailboxAdvancedSettings(int itemId, int accountId, bool enablePOP, bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("SetMailboxAdvancedSettings", new object[] { + public System.IAsyncResult BeginSetExchangeMailboxPlan(int itemId, int accountId, int mailboxPlanId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("SetExchangeMailboxPlan", new object[] { itemId, accountId, - enablePOP, - enableIMAP, - enableOWA, - enableMAPI, - enableActiveSync, - issueWarningKB, - prohibitSendKB, - prohibitSendReceiveKB, - keepDeletedItemsDays}, callback, asyncState); + mailboxPlanId}, callback, asyncState); } /// - public int EndSetMailboxAdvancedSettings(System.IAsyncResult asyncResult) { + public int EndSetExchangeMailboxPlan(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((int)(results[0])); } /// - public void SetMailboxAdvancedSettingsAsync(int itemId, int accountId, bool enablePOP, bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays) { - this.SetMailboxAdvancedSettingsAsync(itemId, accountId, enablePOP, enableIMAP, enableOWA, enableMAPI, enableActiveSync, issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, keepDeletedItemsDays, null); + public void SetExchangeMailboxPlanAsync(int itemId, int accountId, int mailboxPlanId) { + this.SetExchangeMailboxPlanAsync(itemId, accountId, mailboxPlanId, null); } /// - public void SetMailboxAdvancedSettingsAsync(int itemId, int accountId, bool enablePOP, bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays, object userState) { - if ((this.SetMailboxAdvancedSettingsOperationCompleted == null)) { - this.SetMailboxAdvancedSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetMailboxAdvancedSettingsOperationCompleted); + public void SetExchangeMailboxPlanAsync(int itemId, int accountId, int mailboxPlanId, object userState) { + if ((this.SetExchangeMailboxPlanOperationCompleted == null)) { + this.SetExchangeMailboxPlanOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetExchangeMailboxPlanOperationCompleted); } - this.InvokeAsync("SetMailboxAdvancedSettings", new object[] { + this.InvokeAsync("SetExchangeMailboxPlan", new object[] { itemId, accountId, - enablePOP, - enableIMAP, - enableOWA, - enableMAPI, - enableActiveSync, - issueWarningKB, - prohibitSendKB, - prohibitSendReceiveKB, - keepDeletedItemsDays}, this.SetMailboxAdvancedSettingsOperationCompleted, userState); + mailboxPlanId}, this.SetExchangeMailboxPlanOperationCompleted, userState); } - private void OnSetMailboxAdvancedSettingsOperationCompleted(object arg) { - if ((this.SetMailboxAdvancedSettingsCompleted != null)) { + private void OnSetExchangeMailboxPlanOperationCompleted(object arg) { + if ((this.SetExchangeMailboxPlanCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.SetMailboxAdvancedSettingsCompleted(this, new SetMailboxAdvancedSettingsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + this.SetExchangeMailboxPlanCompleted(this, new SetExchangeMailboxPlanCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } @@ -4160,6 +3417,436 @@ namespace WebsitePanel.EnterpriseServer } } + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetMobileDevices", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ExchangeMobileDevice[] GetMobileDevices(int itemId, int accountId) { + object[] results = this.Invoke("GetMobileDevices", new object[] { + itemId, + accountId}); + return ((ExchangeMobileDevice[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetMobileDevices(int itemId, int accountId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetMobileDevices", new object[] { + itemId, + accountId}, callback, asyncState); + } + + /// + public ExchangeMobileDevice[] EndGetMobileDevices(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ExchangeMobileDevice[])(results[0])); + } + + /// + public void GetMobileDevicesAsync(int itemId, int accountId) { + this.GetMobileDevicesAsync(itemId, accountId, null); + } + + /// + public void GetMobileDevicesAsync(int itemId, int accountId, object userState) { + if ((this.GetMobileDevicesOperationCompleted == null)) { + this.GetMobileDevicesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetMobileDevicesOperationCompleted); + } + this.InvokeAsync("GetMobileDevices", new object[] { + itemId, + accountId}, this.GetMobileDevicesOperationCompleted, userState); + } + + private void OnGetMobileDevicesOperationCompleted(object arg) { + if ((this.GetMobileDevicesCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetMobileDevicesCompleted(this, new GetMobileDevicesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetMobileDevice", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ExchangeMobileDevice GetMobileDevice(int itemId, string deviceId) { + object[] results = this.Invoke("GetMobileDevice", new object[] { + itemId, + deviceId}); + return ((ExchangeMobileDevice)(results[0])); + } + + /// + public System.IAsyncResult BeginGetMobileDevice(int itemId, string deviceId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetMobileDevice", new object[] { + itemId, + deviceId}, callback, asyncState); + } + + /// + public ExchangeMobileDevice EndGetMobileDevice(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ExchangeMobileDevice)(results[0])); + } + + /// + public void GetMobileDeviceAsync(int itemId, string deviceId) { + this.GetMobileDeviceAsync(itemId, deviceId, null); + } + + /// + public void GetMobileDeviceAsync(int itemId, string deviceId, object userState) { + if ((this.GetMobileDeviceOperationCompleted == null)) { + this.GetMobileDeviceOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetMobileDeviceOperationCompleted); + } + this.InvokeAsync("GetMobileDevice", new object[] { + itemId, + deviceId}, this.GetMobileDeviceOperationCompleted, userState); + } + + private void OnGetMobileDeviceOperationCompleted(object arg) { + if ((this.GetMobileDeviceCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetMobileDeviceCompleted(this, new GetMobileDeviceCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/WipeDataFromDevice", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void WipeDataFromDevice(int itemId, string deviceId) { + this.Invoke("WipeDataFromDevice", new object[] { + itemId, + deviceId}); + } + + /// + public System.IAsyncResult BeginWipeDataFromDevice(int itemId, string deviceId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("WipeDataFromDevice", new object[] { + itemId, + deviceId}, callback, asyncState); + } + + /// + public void EndWipeDataFromDevice(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void WipeDataFromDeviceAsync(int itemId, string deviceId) { + this.WipeDataFromDeviceAsync(itemId, deviceId, null); + } + + /// + public void WipeDataFromDeviceAsync(int itemId, string deviceId, object userState) { + if ((this.WipeDataFromDeviceOperationCompleted == null)) { + this.WipeDataFromDeviceOperationCompleted = new System.Threading.SendOrPostCallback(this.OnWipeDataFromDeviceOperationCompleted); + } + this.InvokeAsync("WipeDataFromDevice", new object[] { + itemId, + deviceId}, this.WipeDataFromDeviceOperationCompleted, userState); + } + + private void OnWipeDataFromDeviceOperationCompleted(object arg) { + if ((this.WipeDataFromDeviceCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.WipeDataFromDeviceCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/CancelRemoteWipeRequest", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void CancelRemoteWipeRequest(int itemId, string deviceId) { + this.Invoke("CancelRemoteWipeRequest", new object[] { + itemId, + deviceId}); + } + + /// + public System.IAsyncResult BeginCancelRemoteWipeRequest(int itemId, string deviceId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("CancelRemoteWipeRequest", new object[] { + itemId, + deviceId}, callback, asyncState); + } + + /// + public void EndCancelRemoteWipeRequest(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void CancelRemoteWipeRequestAsync(int itemId, string deviceId) { + this.CancelRemoteWipeRequestAsync(itemId, deviceId, null); + } + + /// + public void CancelRemoteWipeRequestAsync(int itemId, string deviceId, object userState) { + if ((this.CancelRemoteWipeRequestOperationCompleted == null)) { + this.CancelRemoteWipeRequestOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCancelRemoteWipeRequestOperationCompleted); + } + this.InvokeAsync("CancelRemoteWipeRequest", new object[] { + itemId, + deviceId}, this.CancelRemoteWipeRequestOperationCompleted, userState); + } + + private void OnCancelRemoteWipeRequestOperationCompleted(object arg) { + if ((this.CancelRemoteWipeRequestCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.CancelRemoteWipeRequestCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/RemoveDevice", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void RemoveDevice(int itemId, string deviceId) { + this.Invoke("RemoveDevice", new object[] { + itemId, + deviceId}); + } + + /// + public System.IAsyncResult BeginRemoveDevice(int itemId, string deviceId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("RemoveDevice", new object[] { + itemId, + deviceId}, callback, asyncState); + } + + /// + public void EndRemoveDevice(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void RemoveDeviceAsync(int itemId, string deviceId) { + this.RemoveDeviceAsync(itemId, deviceId, null); + } + + /// + public void RemoveDeviceAsync(int itemId, string deviceId, object userState) { + if ((this.RemoveDeviceOperationCompleted == null)) { + this.RemoveDeviceOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRemoveDeviceOperationCompleted); + } + this.InvokeAsync("RemoveDevice", new object[] { + itemId, + deviceId}, this.RemoveDeviceOperationCompleted, userState); + } + + private void OnRemoveDeviceOperationCompleted(object arg) { + if ((this.RemoveDeviceCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.RemoveDeviceCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetExchangeMailboxPlans", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ExchangeMailboxPlan[] GetExchangeMailboxPlans(int itemId) { + object[] results = this.Invoke("GetExchangeMailboxPlans", new object[] { + itemId}); + return ((ExchangeMailboxPlan[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetExchangeMailboxPlans(int itemId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetExchangeMailboxPlans", new object[] { + itemId}, callback, asyncState); + } + + /// + public ExchangeMailboxPlan[] EndGetExchangeMailboxPlans(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ExchangeMailboxPlan[])(results[0])); + } + + /// + public void GetExchangeMailboxPlansAsync(int itemId) { + this.GetExchangeMailboxPlansAsync(itemId, null); + } + + /// + public void GetExchangeMailboxPlansAsync(int itemId, object userState) { + if ((this.GetExchangeMailboxPlansOperationCompleted == null)) { + this.GetExchangeMailboxPlansOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetExchangeMailboxPlansOperationCompleted); + } + this.InvokeAsync("GetExchangeMailboxPlans", new object[] { + itemId}, this.GetExchangeMailboxPlansOperationCompleted, userState); + } + + private void OnGetExchangeMailboxPlansOperationCompleted(object arg) { + if ((this.GetExchangeMailboxPlansCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetExchangeMailboxPlansCompleted(this, new GetExchangeMailboxPlansCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetExchangeMailboxPlan", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ExchangeMailboxPlan GetExchangeMailboxPlan(int itemId, int mailboxPlanId) { + object[] results = this.Invoke("GetExchangeMailboxPlan", new object[] { + itemId, + mailboxPlanId}); + return ((ExchangeMailboxPlan)(results[0])); + } + + /// + public System.IAsyncResult BeginGetExchangeMailboxPlan(int itemId, int mailboxPlanId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetExchangeMailboxPlan", new object[] { + itemId, + mailboxPlanId}, callback, asyncState); + } + + /// + public ExchangeMailboxPlan EndGetExchangeMailboxPlan(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ExchangeMailboxPlan)(results[0])); + } + + /// + public void GetExchangeMailboxPlanAsync(int itemId, int mailboxPlanId) { + this.GetExchangeMailboxPlanAsync(itemId, mailboxPlanId, null); + } + + /// + public void GetExchangeMailboxPlanAsync(int itemId, int mailboxPlanId, object userState) { + if ((this.GetExchangeMailboxPlanOperationCompleted == null)) { + this.GetExchangeMailboxPlanOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetExchangeMailboxPlanOperationCompleted); + } + this.InvokeAsync("GetExchangeMailboxPlan", new object[] { + itemId, + mailboxPlanId}, this.GetExchangeMailboxPlanOperationCompleted, userState); + } + + private void OnGetExchangeMailboxPlanOperationCompleted(object arg) { + if ((this.GetExchangeMailboxPlanCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetExchangeMailboxPlanCompleted(this, new GetExchangeMailboxPlanCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/AddExchangeMailboxPlan", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int AddExchangeMailboxPlan(int itemId, ExchangeMailboxPlan mailboxPlan) { + object[] results = this.Invoke("AddExchangeMailboxPlan", new object[] { + itemId, + mailboxPlan}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginAddExchangeMailboxPlan(int itemId, ExchangeMailboxPlan mailboxPlan, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("AddExchangeMailboxPlan", new object[] { + itemId, + mailboxPlan}, callback, asyncState); + } + + /// + public int EndAddExchangeMailboxPlan(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void AddExchangeMailboxPlanAsync(int itemId, ExchangeMailboxPlan mailboxPlan) { + this.AddExchangeMailboxPlanAsync(itemId, mailboxPlan, null); + } + + /// + public void AddExchangeMailboxPlanAsync(int itemId, ExchangeMailboxPlan mailboxPlan, object userState) { + if ((this.AddExchangeMailboxPlanOperationCompleted == null)) { + this.AddExchangeMailboxPlanOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddExchangeMailboxPlanOperationCompleted); + } + this.InvokeAsync("AddExchangeMailboxPlan", new object[] { + itemId, + mailboxPlan}, this.AddExchangeMailboxPlanOperationCompleted, userState); + } + + private void OnAddExchangeMailboxPlanOperationCompleted(object arg) { + if ((this.AddExchangeMailboxPlanCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.AddExchangeMailboxPlanCompleted(this, new AddExchangeMailboxPlanCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/DeleteExchangeMailboxPlan", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int DeleteExchangeMailboxPlan(int itemId, int mailboxPlanId) { + object[] results = this.Invoke("DeleteExchangeMailboxPlan", new object[] { + itemId, + mailboxPlanId}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginDeleteExchangeMailboxPlan(int itemId, int mailboxPlanId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("DeleteExchangeMailboxPlan", new object[] { + itemId, + mailboxPlanId}, callback, asyncState); + } + + /// + public int EndDeleteExchangeMailboxPlan(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void DeleteExchangeMailboxPlanAsync(int itemId, int mailboxPlanId) { + this.DeleteExchangeMailboxPlanAsync(itemId, mailboxPlanId, null); + } + + /// + public void DeleteExchangeMailboxPlanAsync(int itemId, int mailboxPlanId, object userState) { + if ((this.DeleteExchangeMailboxPlanOperationCompleted == null)) { + this.DeleteExchangeMailboxPlanOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteExchangeMailboxPlanOperationCompleted); + } + this.InvokeAsync("DeleteExchangeMailboxPlan", new object[] { + itemId, + mailboxPlanId}, this.DeleteExchangeMailboxPlanOperationCompleted, userState); + } + + private void OnDeleteExchangeMailboxPlanOperationCompleted(object arg) { + if ((this.DeleteExchangeMailboxPlanCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.DeleteExchangeMailboxPlanCompleted(this, new DeleteExchangeMailboxPlanCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SetOrganizationDefaultExchangeMailbo" + + "xPlan", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public void SetOrganizationDefaultExchangeMailboxPlan(int itemId, int mailboxPlanId) { + this.Invoke("SetOrganizationDefaultExchangeMailboxPlan", new object[] { + itemId, + mailboxPlanId}); + } + + /// + public System.IAsyncResult BeginSetOrganizationDefaultExchangeMailboxPlan(int itemId, int mailboxPlanId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("SetOrganizationDefaultExchangeMailboxPlan", new object[] { + itemId, + mailboxPlanId}, callback, asyncState); + } + + /// + public void EndSetOrganizationDefaultExchangeMailboxPlan(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void SetOrganizationDefaultExchangeMailboxPlanAsync(int itemId, int mailboxPlanId) { + this.SetOrganizationDefaultExchangeMailboxPlanAsync(itemId, mailboxPlanId, null); + } + + /// + public void SetOrganizationDefaultExchangeMailboxPlanAsync(int itemId, int mailboxPlanId, object userState) { + if ((this.SetOrganizationDefaultExchangeMailboxPlanOperationCompleted == null)) { + this.SetOrganizationDefaultExchangeMailboxPlanOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetOrganizationDefaultExchangeMailboxPlanOperationCompleted); + } + this.InvokeAsync("SetOrganizationDefaultExchangeMailboxPlan", new object[] { + itemId, + mailboxPlanId}, this.SetOrganizationDefaultExchangeMailboxPlanOperationCompleted, userState); + } + + private void OnSetOrganizationDefaultExchangeMailboxPlanOperationCompleted(object arg) { + if ((this.SetOrganizationDefaultExchangeMailboxPlanCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.SetOrganizationDefaultExchangeMailboxPlanCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/CreatePublicFolder", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] public int CreatePublicFolder(int itemId, string parentFolder, string folderName, bool mailEnabled, string accountName, string domain) { @@ -4495,232 +4182,294 @@ namespace WebsitePanel.EnterpriseServer } } + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetPublicFolderMailFlowSettings", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ExchangePublicFolder GetPublicFolderMailFlowSettings(int itemId, int accountId) { + object[] results = this.Invoke("GetPublicFolderMailFlowSettings", new object[] { + itemId, + accountId}); + return ((ExchangePublicFolder)(results[0])); + } + + /// + public System.IAsyncResult BeginGetPublicFolderMailFlowSettings(int itemId, int accountId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetPublicFolderMailFlowSettings", new object[] { + itemId, + accountId}, callback, asyncState); + } + + /// + public ExchangePublicFolder EndGetPublicFolderMailFlowSettings(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ExchangePublicFolder)(results[0])); + } + + /// + public void GetPublicFolderMailFlowSettingsAsync(int itemId, int accountId) { + this.GetPublicFolderMailFlowSettingsAsync(itemId, accountId, null); + } + + /// + public void GetPublicFolderMailFlowSettingsAsync(int itemId, int accountId, object userState) { + if ((this.GetPublicFolderMailFlowSettingsOperationCompleted == null)) { + this.GetPublicFolderMailFlowSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetPublicFolderMailFlowSettingsOperationCompleted); + } + this.InvokeAsync("GetPublicFolderMailFlowSettings", new object[] { + itemId, + accountId}, this.GetPublicFolderMailFlowSettingsOperationCompleted, userState); + } + + private void OnGetPublicFolderMailFlowSettingsOperationCompleted(object arg) { + if ((this.GetPublicFolderMailFlowSettingsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetPublicFolderMailFlowSettingsCompleted(this, new GetPublicFolderMailFlowSettingsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SetPublicFolderMailFlowSettings", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int SetPublicFolderMailFlowSettings(int itemId, int accountId, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) { + object[] results = this.Invoke("SetPublicFolderMailFlowSettings", new object[] { + itemId, + accountId, + acceptAccounts, + rejectAccounts, + requireSenderAuthentication}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginSetPublicFolderMailFlowSettings(int itemId, int accountId, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("SetPublicFolderMailFlowSettings", new object[] { + itemId, + accountId, + acceptAccounts, + rejectAccounts, + requireSenderAuthentication}, callback, asyncState); + } + + /// + public int EndSetPublicFolderMailFlowSettings(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void SetPublicFolderMailFlowSettingsAsync(int itemId, int accountId, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) { + this.SetPublicFolderMailFlowSettingsAsync(itemId, accountId, acceptAccounts, rejectAccounts, requireSenderAuthentication, null); + } + + /// + public void SetPublicFolderMailFlowSettingsAsync(int itemId, int accountId, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication, object userState) { + if ((this.SetPublicFolderMailFlowSettingsOperationCompleted == null)) { + this.SetPublicFolderMailFlowSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetPublicFolderMailFlowSettingsOperationCompleted); + } + this.InvokeAsync("SetPublicFolderMailFlowSettings", new object[] { + itemId, + accountId, + acceptAccounts, + rejectAccounts, + requireSenderAuthentication}, this.SetPublicFolderMailFlowSettingsOperationCompleted, userState); + } + + private void OnSetPublicFolderMailFlowSettingsOperationCompleted(object arg) { + if ((this.SetPublicFolderMailFlowSettingsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.SetPublicFolderMailFlowSettingsCompleted(this, new SetPublicFolderMailFlowSettingsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetPublicFolderEmailAddresses", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public ExchangeEmailAddress[] GetPublicFolderEmailAddresses(int itemId, int accountId) { + object[] results = this.Invoke("GetPublicFolderEmailAddresses", new object[] { + itemId, + accountId}); + return ((ExchangeEmailAddress[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetPublicFolderEmailAddresses(int itemId, int accountId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetPublicFolderEmailAddresses", new object[] { + itemId, + accountId}, callback, asyncState); + } + + /// + public ExchangeEmailAddress[] EndGetPublicFolderEmailAddresses(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ExchangeEmailAddress[])(results[0])); + } + + /// + public void GetPublicFolderEmailAddressesAsync(int itemId, int accountId) { + this.GetPublicFolderEmailAddressesAsync(itemId, accountId, null); + } + + /// + public void GetPublicFolderEmailAddressesAsync(int itemId, int accountId, object userState) { + if ((this.GetPublicFolderEmailAddressesOperationCompleted == null)) { + this.GetPublicFolderEmailAddressesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetPublicFolderEmailAddressesOperationCompleted); + } + this.InvokeAsync("GetPublicFolderEmailAddresses", new object[] { + itemId, + accountId}, this.GetPublicFolderEmailAddressesOperationCompleted, userState); + } + + private void OnGetPublicFolderEmailAddressesOperationCompleted(object arg) { + if ((this.GetPublicFolderEmailAddressesCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetPublicFolderEmailAddressesCompleted(this, new GetPublicFolderEmailAddressesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/AddPublicFolderEmailAddress", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int AddPublicFolderEmailAddress(int itemId, int accountId, string emailAddress) { + object[] results = this.Invoke("AddPublicFolderEmailAddress", new object[] { + itemId, + accountId, + emailAddress}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginAddPublicFolderEmailAddress(int itemId, int accountId, string emailAddress, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("AddPublicFolderEmailAddress", new object[] { + itemId, + accountId, + emailAddress}, callback, asyncState); + } + + /// + public int EndAddPublicFolderEmailAddress(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void AddPublicFolderEmailAddressAsync(int itemId, int accountId, string emailAddress) { + this.AddPublicFolderEmailAddressAsync(itemId, accountId, emailAddress, null); + } + + /// + public void AddPublicFolderEmailAddressAsync(int itemId, int accountId, string emailAddress, object userState) { + if ((this.AddPublicFolderEmailAddressOperationCompleted == null)) { + this.AddPublicFolderEmailAddressOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddPublicFolderEmailAddressOperationCompleted); + } + this.InvokeAsync("AddPublicFolderEmailAddress", new object[] { + itemId, + accountId, + emailAddress}, this.AddPublicFolderEmailAddressOperationCompleted, userState); + } + + private void OnAddPublicFolderEmailAddressOperationCompleted(object arg) { + if ((this.AddPublicFolderEmailAddressCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.AddPublicFolderEmailAddressCompleted(this, new AddPublicFolderEmailAddressCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SetPublicFolderPrimaryEmailAddress", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int SetPublicFolderPrimaryEmailAddress(int itemId, int accountId, string emailAddress) { + object[] results = this.Invoke("SetPublicFolderPrimaryEmailAddress", new object[] { + itemId, + accountId, + emailAddress}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginSetPublicFolderPrimaryEmailAddress(int itemId, int accountId, string emailAddress, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("SetPublicFolderPrimaryEmailAddress", new object[] { + itemId, + accountId, + emailAddress}, callback, asyncState); + } + + /// + public int EndSetPublicFolderPrimaryEmailAddress(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void SetPublicFolderPrimaryEmailAddressAsync(int itemId, int accountId, string emailAddress) { + this.SetPublicFolderPrimaryEmailAddressAsync(itemId, accountId, emailAddress, null); + } + + /// + public void SetPublicFolderPrimaryEmailAddressAsync(int itemId, int accountId, string emailAddress, object userState) { + if ((this.SetPublicFolderPrimaryEmailAddressOperationCompleted == null)) { + this.SetPublicFolderPrimaryEmailAddressOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetPublicFolderPrimaryEmailAddressOperationCompleted); + } + this.InvokeAsync("SetPublicFolderPrimaryEmailAddress", new object[] { + itemId, + accountId, + emailAddress}, this.SetPublicFolderPrimaryEmailAddressOperationCompleted, userState); + } + + private void OnSetPublicFolderPrimaryEmailAddressOperationCompleted(object arg) { + if ((this.SetPublicFolderPrimaryEmailAddressCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.SetPublicFolderPrimaryEmailAddressCompleted(this, new SetPublicFolderPrimaryEmailAddressCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/DeletePublicFolderEmailAddresses", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int DeletePublicFolderEmailAddresses(int itemId, int accountId, string[] emailAddresses) { + object[] results = this.Invoke("DeletePublicFolderEmailAddresses", new object[] { + itemId, + accountId, + emailAddresses}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginDeletePublicFolderEmailAddresses(int itemId, int accountId, string[] emailAddresses, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("DeletePublicFolderEmailAddresses", new object[] { + itemId, + accountId, + emailAddresses}, callback, asyncState); + } + + /// + public int EndDeletePublicFolderEmailAddresses(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void DeletePublicFolderEmailAddressesAsync(int itemId, int accountId, string[] emailAddresses) { + this.DeletePublicFolderEmailAddressesAsync(itemId, accountId, emailAddresses, null); + } + + /// + public void DeletePublicFolderEmailAddressesAsync(int itemId, int accountId, string[] emailAddresses, object userState) { + if ((this.DeletePublicFolderEmailAddressesOperationCompleted == null)) { + this.DeletePublicFolderEmailAddressesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeletePublicFolderEmailAddressesOperationCompleted); + } + this.InvokeAsync("DeletePublicFolderEmailAddresses", new object[] { + itemId, + accountId, + emailAddresses}, this.DeletePublicFolderEmailAddressesOperationCompleted, userState); + } + + private void OnDeletePublicFolderEmailAddressesOperationCompleted(object arg) { + if ((this.DeletePublicFolderEmailAddressesCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.DeletePublicFolderEmailAddressesCompleted(this, new DeletePublicFolderEmailAddressesCompletedEventArgs(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 GetPublicFolderMailFlowSettingsCompletedEventHandler(object sender, GetPublicFolderMailFlowSettingsCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetPublicFolderMailFlowSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal GetPublicFolderMailFlowSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public ExchangePublicFolder Result { - get { - this.RaiseExceptionIfNecessary(); - return ((ExchangePublicFolder)(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void SetPublicFolderMailFlowSettingsCompletedEventHandler(object sender, SetPublicFolderMailFlowSettingsCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class SetPublicFolderMailFlowSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal SetPublicFolderMailFlowSettingsCompletedEventArgs(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 GetPublicFolderEmailAddressesCompletedEventHandler(object sender, GetPublicFolderEmailAddressesCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetPublicFolderEmailAddressesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal GetPublicFolderEmailAddressesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public ExchangeEmailAddress[] Result { - get { - this.RaiseExceptionIfNecessary(); - return ((ExchangeEmailAddress[])(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void AddPublicFolderEmailAddressCompletedEventHandler(object sender, AddPublicFolderEmailAddressCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class AddPublicFolderEmailAddressCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal AddPublicFolderEmailAddressCompletedEventArgs(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 SetPublicFolderPrimaryEmailAddressCompletedEventHandler(object sender, SetPublicFolderPrimaryEmailAddressCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class SetPublicFolderPrimaryEmailAddressCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal SetPublicFolderPrimaryEmailAddressCompletedEventArgs(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 DeletePublicFolderEmailAddressesCompletedEventHandler(object sender, DeletePublicFolderEmailAddressesCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class DeletePublicFolderEmailAddressesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal DeletePublicFolderEmailAddressesCompletedEventArgs(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 GetMobileDevicesCompletedEventHandler(object sender, GetMobileDevicesCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetMobileDevicesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal GetMobileDevicesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public ExchangeMobileDevice[] Result { - get { - this.RaiseExceptionIfNecessary(); - return ((ExchangeMobileDevice[])(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void GetMobileDeviceCompletedEventHandler(object sender, GetMobileDeviceCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetMobileDeviceCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal GetMobileDeviceCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public ExchangeMobileDevice Result { - get { - this.RaiseExceptionIfNecessary(); - return ((ExchangeMobileDevice)(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void WipeDataFromDeviceCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void CancelRemoteWipeRequestCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void RemoveDeviceCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void GetRawExchangeOrganizationsPagedCompletedEventHandler(object sender, GetRawExchangeOrganizationsPagedCompletedEventArgs e); @@ -4957,26 +4706,26 @@ namespace WebsitePanel.EnterpriseServer /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void GetPublicFoldersStatisticsCompletedEventHandler(object sender, GetPublicFoldersStatisticsCompletedEventArgs e); + public delegate void GetMailboxStatisticsCompletedEventHandler(object sender, GetMailboxStatisticsCompletedEventArgs e); /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetPublicFoldersStatisticsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class GetMailboxStatisticsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - internal GetPublicFoldersStatisticsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + internal GetMailboxStatisticsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } /// - public ExchangeItemStatistics[] Result { + public ExchangeMailboxStatistics Result { get { this.RaiseExceptionIfNecessary(); - return ((ExchangeItemStatistics[])(this.results[0])); + return ((ExchangeMailboxStatistics)(this.results[0])); } } } @@ -5555,43 +5304,17 @@ namespace WebsitePanel.EnterpriseServer /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void GetMailboxAdvancedSettingsCompletedEventHandler(object sender, GetMailboxAdvancedSettingsCompletedEventArgs e); + public delegate void SetExchangeMailboxPlanCompletedEventHandler(object sender, SetExchangeMailboxPlanCompletedEventArgs e); /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetMailboxAdvancedSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class SetExchangeMailboxPlanCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - internal GetMailboxAdvancedSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { - this.results = results; - } - - /// - public ExchangeMailbox Result { - get { - this.RaiseExceptionIfNecessary(); - return ((ExchangeMailbox)(this.results[0])); - } - } - } - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void SetMailboxAdvancedSettingsCompletedEventHandler(object sender, SetMailboxAdvancedSettingsCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class SetMailboxAdvancedSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal SetMailboxAdvancedSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + internal SetExchangeMailboxPlanCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } @@ -6203,6 +5926,178 @@ namespace WebsitePanel.EnterpriseServer } } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetMobileDevicesCompletedEventHandler(object sender, GetMobileDevicesCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetMobileDevicesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetMobileDevicesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ExchangeMobileDevice[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ExchangeMobileDevice[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetMobileDeviceCompletedEventHandler(object sender, GetMobileDeviceCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetMobileDeviceCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetMobileDeviceCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ExchangeMobileDevice Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ExchangeMobileDevice)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void WipeDataFromDeviceCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void CancelRemoteWipeRequestCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void RemoveDeviceCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetExchangeMailboxPlansCompletedEventHandler(object sender, GetExchangeMailboxPlansCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetExchangeMailboxPlansCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetExchangeMailboxPlansCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ExchangeMailboxPlan[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ExchangeMailboxPlan[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetExchangeMailboxPlanCompletedEventHandler(object sender, GetExchangeMailboxPlanCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetExchangeMailboxPlanCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetExchangeMailboxPlanCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ExchangeMailboxPlan Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ExchangeMailboxPlan)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void AddExchangeMailboxPlanCompletedEventHandler(object sender, AddExchangeMailboxPlanCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class AddExchangeMailboxPlanCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal AddExchangeMailboxPlanCompletedEventArgs(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 DeleteExchangeMailboxPlanCompletedEventHandler(object sender, DeleteExchangeMailboxPlanCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class DeleteExchangeMailboxPlanCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal DeleteExchangeMailboxPlanCompletedEventArgs(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 SetOrganizationDefaultExchangeMailboxPlanCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void CreatePublicFolderCompletedEventHandler(object sender, CreatePublicFolderCompletedEventArgs e); @@ -6384,4 +6279,160 @@ namespace WebsitePanel.EnterpriseServer } } } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetPublicFolderMailFlowSettingsCompletedEventHandler(object sender, GetPublicFolderMailFlowSettingsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetPublicFolderMailFlowSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetPublicFolderMailFlowSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ExchangePublicFolder Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ExchangePublicFolder)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void SetPublicFolderMailFlowSettingsCompletedEventHandler(object sender, SetPublicFolderMailFlowSettingsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class SetPublicFolderMailFlowSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal SetPublicFolderMailFlowSettingsCompletedEventArgs(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 GetPublicFolderEmailAddressesCompletedEventHandler(object sender, GetPublicFolderEmailAddressesCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetPublicFolderEmailAddressesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetPublicFolderEmailAddressesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public ExchangeEmailAddress[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ExchangeEmailAddress[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void AddPublicFolderEmailAddressCompletedEventHandler(object sender, AddPublicFolderEmailAddressCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class AddPublicFolderEmailAddressCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal AddPublicFolderEmailAddressCompletedEventArgs(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 SetPublicFolderPrimaryEmailAddressCompletedEventHandler(object sender, SetPublicFolderPrimaryEmailAddressCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class SetPublicFolderPrimaryEmailAddressCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal SetPublicFolderPrimaryEmailAddressCompletedEventArgs(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 DeletePublicFolderEmailAddressesCompletedEventHandler(object sender, DeletePublicFolderEmailAddressesCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class DeletePublicFolderEmailAddressesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal DeletePublicFolderEmailAddressesCompletedEventArgs(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])); + } + } + } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs index a178d57c..f7164f03 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/OrganizationProxy.cs @@ -1,35 +1,7 @@ -// Copyright (c) 2012, Outercurve Foundation. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// - Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// - Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// - Neither the name of the Outercurve Foundation nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.3053 +// Runtime Version:2.0.50727.5456 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -39,162 +11,180 @@ // // This source code was auto-generated by wsdl, Version=2.0.50727.42. // -using WebsitePanel.Providers; -using WebsitePanel.Providers.Common; -using WebsitePanel.Providers.HostedSolution; -using WebsitePanel.Providers.ResultObjects; - -namespace WebsitePanel.EnterpriseServer.HostedSolution { - using System.Diagnostics; +namespace WebsitePanel.EnterpriseServer.HostedSolution +{ + using System.Xml.Serialization; using System.Web.Services; using System.ComponentModel; using System.Web.Services.Protocols; using System; - using System.Xml.Serialization; + using System.Diagnostics; using System.Data; - - + + using WebsitePanel.Providers; + 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="esOrganizationsSoap", Namespace="http://tempuri.org/")] + [System.Web.Services.WebServiceBindingAttribute(Name = "esOrganizationsSoap", Namespace = "http://tempuri.org/")] [System.Xml.Serialization.XmlIncludeAttribute(typeof(ResultObject))] [System.Xml.Serialization.XmlIncludeAttribute(typeof(ServiceProviderItem))] - public partial class esOrganizations : Microsoft.Web.Services3.WebServicesClientProtocol { - + public partial class esOrganizations : Microsoft.Web.Services3.WebServicesClientProtocol + { + private System.Threading.SendOrPostCallback CreateOrganizationOperationCompleted; - + private System.Threading.SendOrPostCallback GetRawOrganizationsPagedOperationCompleted; - + private System.Threading.SendOrPostCallback GetOrganizationsOperationCompleted; - + private System.Threading.SendOrPostCallback GetOrganizationUserSummuryLetterOperationCompleted; - + private System.Threading.SendOrPostCallback SendOrganizationUserSummuryLetterOperationCompleted; - + private System.Threading.SendOrPostCallback DeleteOrganizationOperationCompleted; - + private System.Threading.SendOrPostCallback GetOrganizationStatisticsOperationCompleted; - + private System.Threading.SendOrPostCallback GetOrganizationOperationCompleted; - + + private System.Threading.SendOrPostCallback GetAccountIdByUserPrincipalNameOperationCompleted; + private System.Threading.SendOrPostCallback AddOrganizationDomainOperationCompleted; - + private System.Threading.SendOrPostCallback GetOrganizationDomainsOperationCompleted; - + private System.Threading.SendOrPostCallback DeleteOrganizationDomainOperationCompleted; - + private System.Threading.SendOrPostCallback SetOrganizationDefaultDomainOperationCompleted; - + private System.Threading.SendOrPostCallback CreateUserOperationCompleted; - + + private System.Threading.SendOrPostCallback ImportUserOperationCompleted; + private System.Threading.SendOrPostCallback GetOrganizationUsersPagedOperationCompleted; - + private System.Threading.SendOrPostCallback GetUserGeneralSettingsOperationCompleted; - + private System.Threading.SendOrPostCallback SetUserGeneralSettingsOperationCompleted; - + private System.Threading.SendOrPostCallback SearchAccountsOperationCompleted; - + private System.Threading.SendOrPostCallback DeleteUserOperationCompleted; - + private System.Threading.SendOrPostCallback GetPasswordPolicyOperationCompleted; - + /// - public esOrganizations() { - this.Url = "http://localhost/WebsitePanelEnterpriseServer/esOrganizations.asmx"; + public esOrganizations() + { + this.Url = "http://localhost:9002/esOrganizations.asmx"; } - + /// public event CreateOrganizationCompletedEventHandler CreateOrganizationCompleted; - + /// public event GetRawOrganizationsPagedCompletedEventHandler GetRawOrganizationsPagedCompleted; - + /// public event GetOrganizationsCompletedEventHandler GetOrganizationsCompleted; - + /// public event GetOrganizationUserSummuryLetterCompletedEventHandler GetOrganizationUserSummuryLetterCompleted; - + /// public event SendOrganizationUserSummuryLetterCompletedEventHandler SendOrganizationUserSummuryLetterCompleted; - + /// public event DeleteOrganizationCompletedEventHandler DeleteOrganizationCompleted; - + /// public event GetOrganizationStatisticsCompletedEventHandler GetOrganizationStatisticsCompleted; - + /// public event GetOrganizationCompletedEventHandler GetOrganizationCompleted; - + + /// + public event GetAccountIdByUserPrincipalNameCompletedEventHandler GetAccountIdByUserPrincipalNameCompleted; + /// public event AddOrganizationDomainCompletedEventHandler AddOrganizationDomainCompleted; - + /// public event GetOrganizationDomainsCompletedEventHandler GetOrganizationDomainsCompleted; - + /// public event DeleteOrganizationDomainCompletedEventHandler DeleteOrganizationDomainCompleted; - + /// public event SetOrganizationDefaultDomainCompletedEventHandler SetOrganizationDefaultDomainCompleted; - + /// public event CreateUserCompletedEventHandler CreateUserCompleted; - + + /// + public event ImportUserCompletedEventHandler ImportUserCompleted; + /// public event GetOrganizationUsersPagedCompletedEventHandler GetOrganizationUsersPagedCompleted; - + /// public event GetUserGeneralSettingsCompletedEventHandler GetUserGeneralSettingsCompleted; - + /// public event SetUserGeneralSettingsCompletedEventHandler SetUserGeneralSettingsCompleted; - + /// public event SearchAccountsCompletedEventHandler SearchAccountsCompleted; - + /// public event DeleteUserCompletedEventHandler DeleteUserCompleted; - + /// public event GetPasswordPolicyCompletedEventHandler GetPasswordPolicyCompleted; - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CreateOrganization", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public int CreateOrganization(int packageId, string organizationID, string organizationName) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CreateOrganization", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int CreateOrganization(int packageId, string organizationID, string organizationName) + { object[] results = this.Invoke("CreateOrganization", new object[] { packageId, organizationID, organizationName}); return ((int)(results[0])); } - + /// - public System.IAsyncResult BeginCreateOrganization(int packageId, string organizationID, string organizationName, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginCreateOrganization(int packageId, string organizationID, string organizationName, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("CreateOrganization", new object[] { packageId, organizationID, organizationName}, callback, asyncState); } - + /// - public int EndCreateOrganization(System.IAsyncResult asyncResult) { + public int EndCreateOrganization(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((int)(results[0])); } - + /// - public void CreateOrganizationAsync(int packageId, string organizationID, string organizationName) { + public void CreateOrganizationAsync(int packageId, string organizationID, string organizationName) + { this.CreateOrganizationAsync(packageId, organizationID, organizationName, null); } - + /// - public void CreateOrganizationAsync(int packageId, string organizationID, string organizationName, object userState) { - if ((this.CreateOrganizationOperationCompleted == null)) { + public void CreateOrganizationAsync(int packageId, string organizationID, string organizationName, object userState) + { + if ((this.CreateOrganizationOperationCompleted == null)) + { this.CreateOrganizationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateOrganizationOperationCompleted); } this.InvokeAsync("CreateOrganization", new object[] { @@ -202,17 +192,20 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { organizationID, organizationName}, this.CreateOrganizationOperationCompleted, userState); } - - private void OnCreateOrganizationOperationCompleted(object arg) { - if ((this.CreateOrganizationCompleted != null)) { + + private void OnCreateOrganizationOperationCompleted(object arg) + { + if ((this.CreateOrganizationCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.CreateOrganizationCompleted(this, new CreateOrganizationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetRawOrganizationsPaged", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public System.Data.DataSet GetRawOrganizationsPaged(int packageId, bool recursive, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetRawOrganizationsPaged", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public System.Data.DataSet GetRawOrganizationsPaged(int packageId, bool recursive, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { object[] results = this.Invoke("GetRawOrganizationsPaged", new object[] { packageId, recursive, @@ -223,9 +216,10 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { maximumRows}); return ((System.Data.DataSet)(results[0])); } - + /// - public System.IAsyncResult BeginGetRawOrganizationsPaged(int packageId, bool recursive, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginGetRawOrganizationsPaged(int packageId, bool recursive, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("GetRawOrganizationsPaged", new object[] { packageId, recursive, @@ -235,21 +229,25 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { startRow, maximumRows}, callback, asyncState); } - + /// - public System.Data.DataSet EndGetRawOrganizationsPaged(System.IAsyncResult asyncResult) { + public System.Data.DataSet EndGetRawOrganizationsPaged(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((System.Data.DataSet)(results[0])); } - + /// - public void GetRawOrganizationsPagedAsync(int packageId, bool recursive, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) { + public void GetRawOrganizationsPagedAsync(int packageId, bool recursive, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { this.GetRawOrganizationsPagedAsync(packageId, recursive, filterColumn, filterValue, sortColumn, startRow, maximumRows, null); } - + /// - public void GetRawOrganizationsPagedAsync(int packageId, bool recursive, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, object userState) { - if ((this.GetRawOrganizationsPagedOperationCompleted == null)) { + public void GetRawOrganizationsPagedAsync(int packageId, bool recursive, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, object userState) + { + if ((this.GetRawOrganizationsPagedOperationCompleted == null)) + { this.GetRawOrganizationsPagedOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRawOrganizationsPagedOperationCompleted); } this.InvokeAsync("GetRawOrganizationsPaged", new object[] { @@ -261,61 +259,72 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { startRow, maximumRows}, this.GetRawOrganizationsPagedOperationCompleted, userState); } - - private void OnGetRawOrganizationsPagedOperationCompleted(object arg) { - if ((this.GetRawOrganizationsPagedCompleted != null)) { + + private void OnGetRawOrganizationsPagedOperationCompleted(object arg) + { + if ((this.GetRawOrganizationsPagedCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetRawOrganizationsPagedCompleted(this, new GetRawOrganizationsPagedCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganizations", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public Organization[] GetOrganizations(int packageId, bool recursive) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganizations", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public Organization[] GetOrganizations(int packageId, bool recursive) + { object[] results = this.Invoke("GetOrganizations", new object[] { packageId, recursive}); return ((Organization[])(results[0])); } - + /// - public System.IAsyncResult BeginGetOrganizations(int packageId, bool recursive, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginGetOrganizations(int packageId, bool recursive, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("GetOrganizations", new object[] { packageId, recursive}, callback, asyncState); } - + /// - public Organization[] EndGetOrganizations(System.IAsyncResult asyncResult) { + public Organization[] EndGetOrganizations(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((Organization[])(results[0])); } - + /// - public void GetOrganizationsAsync(int packageId, bool recursive) { + public void GetOrganizationsAsync(int packageId, bool recursive) + { this.GetOrganizationsAsync(packageId, recursive, null); } - + /// - public void GetOrganizationsAsync(int packageId, bool recursive, object userState) { - if ((this.GetOrganizationsOperationCompleted == null)) { + public void GetOrganizationsAsync(int packageId, bool recursive, object userState) + { + if ((this.GetOrganizationsOperationCompleted == null)) + { this.GetOrganizationsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetOrganizationsOperationCompleted); } this.InvokeAsync("GetOrganizations", new object[] { packageId, recursive}, this.GetOrganizationsOperationCompleted, userState); } - - private void OnGetOrganizationsOperationCompleted(object arg) { - if ((this.GetOrganizationsCompleted != null)) { + + private void OnGetOrganizationsOperationCompleted(object arg) + { + if ((this.GetOrganizationsCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetOrganizationsCompleted(this, new GetOrganizationsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganizationUserSummuryLetter", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public string GetOrganizationUserSummuryLetter(int itemId, int accountId, bool pmm, bool emailMode, bool signup) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganizationUserSummuryLetter", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string GetOrganizationUserSummuryLetter(int itemId, int accountId, bool pmm, bool emailMode, bool signup) + { object[] results = this.Invoke("GetOrganizationUserSummuryLetter", new object[] { itemId, accountId, @@ -324,9 +333,10 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { signup}); return ((string)(results[0])); } - + /// - public System.IAsyncResult BeginGetOrganizationUserSummuryLetter(int itemId, int accountId, bool pmm, bool emailMode, bool signup, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginGetOrganizationUserSummuryLetter(int itemId, int accountId, bool pmm, bool emailMode, bool signup, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("GetOrganizationUserSummuryLetter", new object[] { itemId, accountId, @@ -334,21 +344,25 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { emailMode, signup}, callback, asyncState); } - + /// - public string EndGetOrganizationUserSummuryLetter(System.IAsyncResult asyncResult) { + public string EndGetOrganizationUserSummuryLetter(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((string)(results[0])); } - + /// - public void GetOrganizationUserSummuryLetterAsync(int itemId, int accountId, bool pmm, bool emailMode, bool signup) { + public void GetOrganizationUserSummuryLetterAsync(int itemId, int accountId, bool pmm, bool emailMode, bool signup) + { this.GetOrganizationUserSummuryLetterAsync(itemId, accountId, pmm, emailMode, signup, null); } - + /// - public void GetOrganizationUserSummuryLetterAsync(int itemId, int accountId, bool pmm, bool emailMode, bool signup, object userState) { - if ((this.GetOrganizationUserSummuryLetterOperationCompleted == null)) { + public void GetOrganizationUserSummuryLetterAsync(int itemId, int accountId, bool pmm, bool emailMode, bool signup, object userState) + { + if ((this.GetOrganizationUserSummuryLetterOperationCompleted == null)) + { this.GetOrganizationUserSummuryLetterOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetOrganizationUserSummuryLetterOperationCompleted); } this.InvokeAsync("GetOrganizationUserSummuryLetter", new object[] { @@ -358,17 +372,20 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { emailMode, signup}, this.GetOrganizationUserSummuryLetterOperationCompleted, userState); } - - private void OnGetOrganizationUserSummuryLetterOperationCompleted(object arg) { - if ((this.GetOrganizationUserSummuryLetterCompleted != null)) { + + private void OnGetOrganizationUserSummuryLetterOperationCompleted(object arg) + { + if ((this.GetOrganizationUserSummuryLetterCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetOrganizationUserSummuryLetterCompleted(this, new GetOrganizationUserSummuryLetterCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SendOrganizationUserSummuryLetter", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public int SendOrganizationUserSummuryLetter(int itemId, int accountId, bool signup, string to, string cc) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SendOrganizationUserSummuryLetter", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int SendOrganizationUserSummuryLetter(int itemId, int accountId, bool signup, string to, string cc) + { object[] results = this.Invoke("SendOrganizationUserSummuryLetter", new object[] { itemId, accountId, @@ -377,9 +394,10 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { cc}); return ((int)(results[0])); } - + /// - public System.IAsyncResult BeginSendOrganizationUserSummuryLetter(int itemId, int accountId, bool signup, string to, string cc, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginSendOrganizationUserSummuryLetter(int itemId, int accountId, bool signup, string to, string cc, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("SendOrganizationUserSummuryLetter", new object[] { itemId, accountId, @@ -387,21 +405,25 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { to, cc}, callback, asyncState); } - + /// - public int EndSendOrganizationUserSummuryLetter(System.IAsyncResult asyncResult) { + public int EndSendOrganizationUserSummuryLetter(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((int)(results[0])); } - + /// - public void SendOrganizationUserSummuryLetterAsync(int itemId, int accountId, bool signup, string to, string cc) { + public void SendOrganizationUserSummuryLetterAsync(int itemId, int accountId, bool signup, string to, string cc) + { this.SendOrganizationUserSummuryLetterAsync(itemId, accountId, signup, to, cc, null); } - + /// - public void SendOrganizationUserSummuryLetterAsync(int itemId, int accountId, bool signup, string to, string cc, object userState) { - if ((this.SendOrganizationUserSummuryLetterOperationCompleted == null)) { + public void SendOrganizationUserSummuryLetterAsync(int itemId, int accountId, bool signup, string to, string cc, object userState) + { + if ((this.SendOrganizationUserSummuryLetterOperationCompleted == null)) + { this.SendOrganizationUserSummuryLetterOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSendOrganizationUserSummuryLetterOperationCompleted); } this.InvokeAsync("SendOrganizationUserSummuryLetter", new object[] { @@ -411,350 +433,468 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { to, cc}, this.SendOrganizationUserSummuryLetterOperationCompleted, userState); } - - private void OnSendOrganizationUserSummuryLetterOperationCompleted(object arg) { - if ((this.SendOrganizationUserSummuryLetterCompleted != null)) { + + private void OnSendOrganizationUserSummuryLetterOperationCompleted(object arg) + { + if ((this.SendOrganizationUserSummuryLetterCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.SendOrganizationUserSummuryLetterCompleted(this, new SendOrganizationUserSummuryLetterCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteOrganization", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public int DeleteOrganization(int itemId) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteOrganization", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int DeleteOrganization(int itemId) + { object[] results = this.Invoke("DeleteOrganization", new object[] { itemId}); return ((int)(results[0])); } - + /// - public System.IAsyncResult BeginDeleteOrganization(int itemId, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginDeleteOrganization(int itemId, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("DeleteOrganization", new object[] { itemId}, callback, asyncState); } - + /// - public int EndDeleteOrganization(System.IAsyncResult asyncResult) { + public int EndDeleteOrganization(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((int)(results[0])); } - + /// - public void DeleteOrganizationAsync(int itemId) { + public void DeleteOrganizationAsync(int itemId) + { this.DeleteOrganizationAsync(itemId, null); } - + /// - public void DeleteOrganizationAsync(int itemId, object userState) { - if ((this.DeleteOrganizationOperationCompleted == null)) { + public void DeleteOrganizationAsync(int itemId, object userState) + { + if ((this.DeleteOrganizationOperationCompleted == null)) + { this.DeleteOrganizationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteOrganizationOperationCompleted); } this.InvokeAsync("DeleteOrganization", new object[] { itemId}, this.DeleteOrganizationOperationCompleted, userState); } - - private void OnDeleteOrganizationOperationCompleted(object arg) { - if ((this.DeleteOrganizationCompleted != null)) { + + private void OnDeleteOrganizationOperationCompleted(object arg) + { + if ((this.DeleteOrganizationCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.DeleteOrganizationCompleted(this, new DeleteOrganizationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganizationStatistics", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public OrganizationStatistics GetOrganizationStatistics(int itemId) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganizationStatistics", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public OrganizationStatistics GetOrganizationStatistics(int itemId) + { object[] results = this.Invoke("GetOrganizationStatistics", new object[] { itemId}); return ((OrganizationStatistics)(results[0])); } - + /// - public System.IAsyncResult BeginGetOrganizationStatistics(int itemId, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginGetOrganizationStatistics(int itemId, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("GetOrganizationStatistics", new object[] { itemId}, callback, asyncState); } - + /// - public OrganizationStatistics EndGetOrganizationStatistics(System.IAsyncResult asyncResult) { + public OrganizationStatistics EndGetOrganizationStatistics(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((OrganizationStatistics)(results[0])); } - + /// - public void GetOrganizationStatisticsAsync(int itemId) { + public void GetOrganizationStatisticsAsync(int itemId) + { this.GetOrganizationStatisticsAsync(itemId, null); } - + /// - public void GetOrganizationStatisticsAsync(int itemId, object userState) { - if ((this.GetOrganizationStatisticsOperationCompleted == null)) { + public void GetOrganizationStatisticsAsync(int itemId, object userState) + { + if ((this.GetOrganizationStatisticsOperationCompleted == null)) + { this.GetOrganizationStatisticsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetOrganizationStatisticsOperationCompleted); } this.InvokeAsync("GetOrganizationStatistics", new object[] { itemId}, this.GetOrganizationStatisticsOperationCompleted, userState); } - - private void OnGetOrganizationStatisticsOperationCompleted(object arg) { - if ((this.GetOrganizationStatisticsCompleted != null)) { + + private void OnGetOrganizationStatisticsOperationCompleted(object arg) + { + if ((this.GetOrganizationStatisticsCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetOrganizationStatisticsCompleted(this, new GetOrganizationStatisticsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganization", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public Organization GetOrganization(int itemId) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganization", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public Organization GetOrganization(int itemId) + { object[] results = this.Invoke("GetOrganization", new object[] { itemId}); return ((Organization)(results[0])); } - + /// - public System.IAsyncResult BeginGetOrganization(int itemId, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginGetOrganization(int itemId, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("GetOrganization", new object[] { itemId}, callback, asyncState); } - + /// - public Organization EndGetOrganization(System.IAsyncResult asyncResult) { + public Organization EndGetOrganization(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((Organization)(results[0])); } - + /// - public void GetOrganizationAsync(int itemId) { + public void GetOrganizationAsync(int itemId) + { this.GetOrganizationAsync(itemId, null); } - + /// - public void GetOrganizationAsync(int itemId, object userState) { - if ((this.GetOrganizationOperationCompleted == null)) { + public void GetOrganizationAsync(int itemId, object userState) + { + if ((this.GetOrganizationOperationCompleted == null)) + { this.GetOrganizationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetOrganizationOperationCompleted); } this.InvokeAsync("GetOrganization", new object[] { itemId}, this.GetOrganizationOperationCompleted, userState); } - - private void OnGetOrganizationOperationCompleted(object arg) { - if ((this.GetOrganizationCompleted != null)) { + + private void OnGetOrganizationOperationCompleted(object arg) + { + if ((this.GetOrganizationCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetOrganizationCompleted(this, new GetOrganizationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/AddOrganizationDomain", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public int AddOrganizationDomain(int itemId, string domainName) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetAccountIdByUserPrincipalName", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int GetAccountIdByUserPrincipalName(int itemId, string userPrincipalName) + { + object[] results = this.Invoke("GetAccountIdByUserPrincipalName", new object[] { + itemId, + userPrincipalName}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginGetAccountIdByUserPrincipalName(int itemId, string userPrincipalName, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("GetAccountIdByUserPrincipalName", new object[] { + itemId, + userPrincipalName}, callback, asyncState); + } + + /// + public int EndGetAccountIdByUserPrincipalName(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void GetAccountIdByUserPrincipalNameAsync(int itemId, string userPrincipalName) + { + this.GetAccountIdByUserPrincipalNameAsync(itemId, userPrincipalName, null); + } + + /// + public void GetAccountIdByUserPrincipalNameAsync(int itemId, string userPrincipalName, object userState) + { + if ((this.GetAccountIdByUserPrincipalNameOperationCompleted == null)) + { + this.GetAccountIdByUserPrincipalNameOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetAccountIdByUserPrincipalNameOperationCompleted); + } + this.InvokeAsync("GetAccountIdByUserPrincipalName", new object[] { + itemId, + userPrincipalName}, this.GetAccountIdByUserPrincipalNameOperationCompleted, userState); + } + + private void OnGetAccountIdByUserPrincipalNameOperationCompleted(object arg) + { + if ((this.GetAccountIdByUserPrincipalNameCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetAccountIdByUserPrincipalNameCompleted(this, new GetAccountIdByUserPrincipalNameCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/AddOrganizationDomain", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int AddOrganizationDomain(int itemId, string domainName) + { object[] results = this.Invoke("AddOrganizationDomain", new object[] { itemId, domainName}); return ((int)(results[0])); } - + /// - public System.IAsyncResult BeginAddOrganizationDomain(int itemId, string domainName, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginAddOrganizationDomain(int itemId, string domainName, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("AddOrganizationDomain", new object[] { itemId, domainName}, callback, asyncState); } - + /// - public int EndAddOrganizationDomain(System.IAsyncResult asyncResult) { + public int EndAddOrganizationDomain(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((int)(results[0])); } - + /// - public void AddOrganizationDomainAsync(int itemId, string domainName) { + public void AddOrganizationDomainAsync(int itemId, string domainName) + { this.AddOrganizationDomainAsync(itemId, domainName, null); } - + /// - public void AddOrganizationDomainAsync(int itemId, string domainName, object userState) { - if ((this.AddOrganizationDomainOperationCompleted == null)) { + public void AddOrganizationDomainAsync(int itemId, string domainName, object userState) + { + if ((this.AddOrganizationDomainOperationCompleted == null)) + { this.AddOrganizationDomainOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddOrganizationDomainOperationCompleted); } this.InvokeAsync("AddOrganizationDomain", new object[] { itemId, domainName}, this.AddOrganizationDomainOperationCompleted, userState); } - - private void OnAddOrganizationDomainOperationCompleted(object arg) { - if ((this.AddOrganizationDomainCompleted != null)) { + + private void OnAddOrganizationDomainOperationCompleted(object arg) + { + if ((this.AddOrganizationDomainCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.AddOrganizationDomainCompleted(this, new AddOrganizationDomainCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganizationDomains", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public OrganizationDomainName[] GetOrganizationDomains(int itemId) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganizationDomains", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public OrganizationDomainName[] GetOrganizationDomains(int itemId) + { object[] results = this.Invoke("GetOrganizationDomains", new object[] { itemId}); return ((OrganizationDomainName[])(results[0])); } - + /// - public System.IAsyncResult BeginGetOrganizationDomains(int itemId, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginGetOrganizationDomains(int itemId, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("GetOrganizationDomains", new object[] { itemId}, callback, asyncState); } - + /// - public OrganizationDomainName[] EndGetOrganizationDomains(System.IAsyncResult asyncResult) { + public OrganizationDomainName[] EndGetOrganizationDomains(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((OrganizationDomainName[])(results[0])); } - + /// - public void GetOrganizationDomainsAsync(int itemId) { + public void GetOrganizationDomainsAsync(int itemId) + { this.GetOrganizationDomainsAsync(itemId, null); } - + /// - public void GetOrganizationDomainsAsync(int itemId, object userState) { - if ((this.GetOrganizationDomainsOperationCompleted == null)) { + public void GetOrganizationDomainsAsync(int itemId, object userState) + { + if ((this.GetOrganizationDomainsOperationCompleted == null)) + { this.GetOrganizationDomainsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetOrganizationDomainsOperationCompleted); } this.InvokeAsync("GetOrganizationDomains", new object[] { itemId}, this.GetOrganizationDomainsOperationCompleted, userState); } - - private void OnGetOrganizationDomainsOperationCompleted(object arg) { - if ((this.GetOrganizationDomainsCompleted != null)) { + + private void OnGetOrganizationDomainsOperationCompleted(object arg) + { + if ((this.GetOrganizationDomainsCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetOrganizationDomainsCompleted(this, new GetOrganizationDomainsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteOrganizationDomain", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public int DeleteOrganizationDomain(int itemId, int domainId) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteOrganizationDomain", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int DeleteOrganizationDomain(int itemId, int domainId) + { object[] results = this.Invoke("DeleteOrganizationDomain", new object[] { itemId, domainId}); return ((int)(results[0])); } - + /// - public System.IAsyncResult BeginDeleteOrganizationDomain(int itemId, int domainId, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginDeleteOrganizationDomain(int itemId, int domainId, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("DeleteOrganizationDomain", new object[] { itemId, domainId}, callback, asyncState); } - + /// - public int EndDeleteOrganizationDomain(System.IAsyncResult asyncResult) { + public int EndDeleteOrganizationDomain(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((int)(results[0])); } - + /// - public void DeleteOrganizationDomainAsync(int itemId, int domainId) { + public void DeleteOrganizationDomainAsync(int itemId, int domainId) + { this.DeleteOrganizationDomainAsync(itemId, domainId, null); } - + /// - public void DeleteOrganizationDomainAsync(int itemId, int domainId, object userState) { - if ((this.DeleteOrganizationDomainOperationCompleted == null)) { + public void DeleteOrganizationDomainAsync(int itemId, int domainId, object userState) + { + if ((this.DeleteOrganizationDomainOperationCompleted == null)) + { this.DeleteOrganizationDomainOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteOrganizationDomainOperationCompleted); } this.InvokeAsync("DeleteOrganizationDomain", new object[] { itemId, domainId}, this.DeleteOrganizationDomainOperationCompleted, userState); } - - private void OnDeleteOrganizationDomainOperationCompleted(object arg) { - if ((this.DeleteOrganizationDomainCompleted != null)) { + + private void OnDeleteOrganizationDomainOperationCompleted(object arg) + { + if ((this.DeleteOrganizationDomainCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.DeleteOrganizationDomainCompleted(this, new DeleteOrganizationDomainCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SetOrganizationDefaultDomain", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public int SetOrganizationDefaultDomain(int itemId, int domainId) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SetOrganizationDefaultDomain", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int SetOrganizationDefaultDomain(int itemId, int domainId) + { object[] results = this.Invoke("SetOrganizationDefaultDomain", new object[] { itemId, domainId}); return ((int)(results[0])); } - + /// - public System.IAsyncResult BeginSetOrganizationDefaultDomain(int itemId, int domainId, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginSetOrganizationDefaultDomain(int itemId, int domainId, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("SetOrganizationDefaultDomain", new object[] { itemId, domainId}, callback, asyncState); } - + /// - public int EndSetOrganizationDefaultDomain(System.IAsyncResult asyncResult) { + public int EndSetOrganizationDefaultDomain(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((int)(results[0])); } - + /// - public void SetOrganizationDefaultDomainAsync(int itemId, int domainId) { + public void SetOrganizationDefaultDomainAsync(int itemId, int domainId) + { this.SetOrganizationDefaultDomainAsync(itemId, domainId, null); } - + /// - public void SetOrganizationDefaultDomainAsync(int itemId, int domainId, object userState) { - if ((this.SetOrganizationDefaultDomainOperationCompleted == null)) { + public void SetOrganizationDefaultDomainAsync(int itemId, int domainId, object userState) + { + if ((this.SetOrganizationDefaultDomainOperationCompleted == null)) + { this.SetOrganizationDefaultDomainOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetOrganizationDefaultDomainOperationCompleted); } this.InvokeAsync("SetOrganizationDefaultDomain", new object[] { itemId, domainId}, this.SetOrganizationDefaultDomainOperationCompleted, userState); } - - private void OnSetOrganizationDefaultDomainOperationCompleted(object arg) { - if ((this.SetOrganizationDefaultDomainCompleted != null)) { + + private void OnSetOrganizationDefaultDomainOperationCompleted(object arg) + { + if ((this.SetOrganizationDefaultDomainCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.SetOrganizationDefaultDomainCompleted(this, new SetOrganizationDefaultDomainCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CreateUser", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public int CreateUser(int itemId, string displayName, string name, string domain, string password, bool sendNotification, string to) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CreateUser", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int CreateUser(int itemId, string displayName, string name, string domain, string password, string subscriberNumber, bool sendNotification, string to) + { object[] results = this.Invoke("CreateUser", new object[] { itemId, displayName, name, domain, password, + subscriberNumber, sendNotification, to}); return ((int)(results[0])); } - + /// - public System.IAsyncResult BeginCreateUser(int itemId, string displayName, string name, string domain, string password, bool sendNotification, string to, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginCreateUser(int itemId, string displayName, string name, string domain, string password, string subscriberNumber, bool sendNotification, string to, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("CreateUser", new object[] { itemId, displayName, name, domain, password, + subscriberNumber, sendNotification, to}, callback, asyncState); } - + /// - public int EndCreateUser(System.IAsyncResult asyncResult) { + public int EndCreateUser(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((int)(results[0])); } - + /// - public void CreateUserAsync(int itemId, string displayName, string name, string domain, string password, bool sendNotification, string to) { - this.CreateUserAsync(itemId, displayName, name, domain, password, sendNotification, to, null); + public void CreateUserAsync(int itemId, string displayName, string name, string domain, string password, string subscriberNumber, bool sendNotification, string to) + { + this.CreateUserAsync(itemId, displayName, name, domain, password, subscriberNumber, sendNotification, to, null); } - + /// - public void CreateUserAsync(int itemId, string displayName, string name, string domain, string password, bool sendNotification, string to, object userState) { - if ((this.CreateUserOperationCompleted == null)) { + public void CreateUserAsync(int itemId, string displayName, string name, string domain, string password, string subscriberNumber, bool sendNotification, string to, object userState) + { + if ((this.CreateUserOperationCompleted == null)) + { this.CreateUserOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateUserOperationCompleted); } this.InvokeAsync("CreateUser", new object[] { @@ -763,20 +903,88 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { name, domain, password, + subscriberNumber, sendNotification, to}, this.CreateUserOperationCompleted, userState); } - - private void OnCreateUserOperationCompleted(object arg) { - if ((this.CreateUserCompleted != null)) { + + private void OnCreateUserOperationCompleted(object arg) + { + if ((this.CreateUserCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.CreateUserCompleted(this, new CreateUserCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganizationUsersPaged", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public OrganizationUsersPaged GetOrganizationUsersPaged(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/ImportUser", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int ImportUser(int itemId, string accountName, string displayName, string name, string domain, string password) + { + object[] results = this.Invoke("ImportUser", new object[] { + itemId, + accountName, + displayName, + name, + domain, + password}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginImportUser(int itemId, string accountName, string displayName, string name, string domain, string password, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("ImportUser", new object[] { + itemId, + accountName, + displayName, + name, + domain, + password}, callback, asyncState); + } + + /// + public int EndImportUser(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void ImportUserAsync(int itemId, string accountName, string displayName, string name, string domain, string password) + { + this.ImportUserAsync(itemId, accountName, displayName, name, domain, password, null); + } + + /// + public void ImportUserAsync(int itemId, string accountName, string displayName, string name, string domain, string password, object userState) + { + if ((this.ImportUserOperationCompleted == null)) + { + this.ImportUserOperationCompleted = new System.Threading.SendOrPostCallback(this.OnImportUserOperationCompleted); + } + this.InvokeAsync("ImportUser", new object[] { + itemId, + accountName, + displayName, + name, + domain, + password}, this.ImportUserOperationCompleted, userState); + } + + private void OnImportUserOperationCompleted(object arg) + { + if ((this.ImportUserCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.ImportUserCompleted(this, new ImportUserCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetOrganizationUsersPaged", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public OrganizationUsersPaged GetOrganizationUsersPaged(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { object[] results = this.Invoke("GetOrganizationUsersPaged", new object[] { itemId, filterColumn, @@ -786,9 +994,10 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { maximumRows}); return ((OrganizationUsersPaged)(results[0])); } - + /// - public System.IAsyncResult BeginGetOrganizationUsersPaged(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginGetOrganizationUsersPaged(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("GetOrganizationUsersPaged", new object[] { itemId, filterColumn, @@ -797,21 +1006,25 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { startRow, maximumRows}, callback, asyncState); } - + /// - public OrganizationUsersPaged EndGetOrganizationUsersPaged(System.IAsyncResult asyncResult) { + public OrganizationUsersPaged EndGetOrganizationUsersPaged(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((OrganizationUsersPaged)(results[0])); } - + /// - public void GetOrganizationUsersPagedAsync(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) { + public void GetOrganizationUsersPagedAsync(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { this.GetOrganizationUsersPagedAsync(itemId, filterColumn, filterValue, sortColumn, startRow, maximumRows, null); } - + /// - public void GetOrganizationUsersPagedAsync(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, object userState) { - if ((this.GetOrganizationUsersPagedOperationCompleted == null)) { + public void GetOrganizationUsersPagedAsync(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, object userState) + { + if ((this.GetOrganizationUsersPagedOperationCompleted == null)) + { this.GetOrganizationUsersPagedOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetOrganizationUsersPagedOperationCompleted); } this.InvokeAsync("GetOrganizationUsersPaged", new object[] { @@ -822,89 +1035,101 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { startRow, maximumRows}, this.GetOrganizationUsersPagedOperationCompleted, userState); } - - private void OnGetOrganizationUsersPagedOperationCompleted(object arg) { - if ((this.GetOrganizationUsersPagedCompleted != null)) { + + private void OnGetOrganizationUsersPagedOperationCompleted(object arg) + { + if ((this.GetOrganizationUsersPagedCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetOrganizationUsersPagedCompleted(this, new GetOrganizationUsersPagedCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetUserGeneralSettings", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public OrganizationUser GetUserGeneralSettings(int itemId, int accountId) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetUserGeneralSettings", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public OrganizationUser GetUserGeneralSettings(int itemId, int accountId) + { object[] results = this.Invoke("GetUserGeneralSettings", new object[] { itemId, accountId}); return ((OrganizationUser)(results[0])); } - + /// - public System.IAsyncResult BeginGetUserGeneralSettings(int itemId, int accountId, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginGetUserGeneralSettings(int itemId, int accountId, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("GetUserGeneralSettings", new object[] { itemId, accountId}, callback, asyncState); } - + /// - public OrganizationUser EndGetUserGeneralSettings(System.IAsyncResult asyncResult) { + public OrganizationUser EndGetUserGeneralSettings(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((OrganizationUser)(results[0])); } - + /// - public void GetUserGeneralSettingsAsync(int itemId, int accountId) { + public void GetUserGeneralSettingsAsync(int itemId, int accountId) + { this.GetUserGeneralSettingsAsync(itemId, accountId, null); } - + /// - public void GetUserGeneralSettingsAsync(int itemId, int accountId, object userState) { - if ((this.GetUserGeneralSettingsOperationCompleted == null)) { + public void GetUserGeneralSettingsAsync(int itemId, int accountId, object userState) + { + if ((this.GetUserGeneralSettingsOperationCompleted == null)) + { this.GetUserGeneralSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetUserGeneralSettingsOperationCompleted); } this.InvokeAsync("GetUserGeneralSettings", new object[] { itemId, accountId}, this.GetUserGeneralSettingsOperationCompleted, userState); } - - private void OnGetUserGeneralSettingsOperationCompleted(object arg) { - if ((this.GetUserGeneralSettingsCompleted != null)) { + + private void OnGetUserGeneralSettingsOperationCompleted(object arg) + { + if ((this.GetUserGeneralSettingsCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetUserGeneralSettingsCompleted(this, new GetUserGeneralSettingsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SetUserGeneralSettings", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SetUserGeneralSettings", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] public int SetUserGeneralSettings( - int itemId, - int accountId, - string displayName, - string password, - bool hideAddressBook, - bool disabled, - bool locked, - string firstName, - string initials, - string lastName, - string address, - string city, - string state, - string zip, - string country, - string jobTitle, - string company, - string department, - string office, - string managerAccountName, - string businessPhone, - string fax, - string homePhone, - string mobilePhone, - string pager, - string webPage, - string notes, - string externalEmail) { + int itemId, + int accountId, + string displayName, + string password, + bool hideAddressBook, + bool disabled, + bool locked, + string firstName, + string initials, + string lastName, + string address, + string city, + string state, + string zip, + string country, + string jobTitle, + string company, + string department, + string office, + string managerAccountName, + string businessPhone, + string fax, + string homePhone, + string mobilePhone, + string pager, + string webPage, + string notes, + string externalEmail, + string subscriberNumber) + { object[] results = this.Invoke("SetUserGeneralSettings", new object[] { itemId, accountId, @@ -933,42 +1158,45 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { pager, webPage, notes, - externalEmail}); + externalEmail, + subscriberNumber}); return ((int)(results[0])); } - + /// public System.IAsyncResult BeginSetUserGeneralSettings( - int itemId, - int accountId, - string displayName, - string password, - bool hideAddressBook, - bool disabled, - bool locked, - string firstName, - string initials, - string lastName, - string address, - string city, - string state, - string zip, - string country, - string jobTitle, - string company, - string department, - string office, - string managerAccountName, - string businessPhone, - string fax, - string homePhone, - string mobilePhone, - string pager, - string webPage, - string notes, - string externalEmail, - System.AsyncCallback callback, - object asyncState) { + int itemId, + int accountId, + string displayName, + string password, + bool hideAddressBook, + bool disabled, + bool locked, + string firstName, + string initials, + string lastName, + string address, + string city, + string state, + string zip, + string country, + string jobTitle, + string company, + string department, + string office, + string managerAccountName, + string businessPhone, + string fax, + string homePhone, + string mobilePhone, + string pager, + string webPage, + string notes, + string externalEmail, + string subscriberNumber, + System.AsyncCallback callback, + object asyncState) + { return this.BeginInvoke("SetUserGeneralSettings", new object[] { itemId, accountId, @@ -997,80 +1225,87 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { pager, webPage, notes, - externalEmail}, callback, asyncState); + externalEmail, + subscriberNumber}, callback, asyncState); } - + /// - public int EndSetUserGeneralSettings(System.IAsyncResult asyncResult) { + public int EndSetUserGeneralSettings(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((int)(results[0])); } - + /// public void SetUserGeneralSettingsAsync( - int itemId, - int accountId, - string displayName, - string password, - bool hideAddressBook, - bool disabled, - bool locked, - string firstName, - string initials, - string lastName, - string address, - string city, - string state, - string zip, - string country, - string jobTitle, - string company, - string department, - string office, - string managerAccountName, - string businessPhone, - string fax, - string homePhone, - string mobilePhone, - string pager, - string webPage, - string notes, - string externalEmail) { - this.SetUserGeneralSettingsAsync(itemId, accountId, displayName, password, hideAddressBook, disabled, locked, firstName, initials, lastName, address, city, state, zip, country, jobTitle, company, department, office, managerAccountName, businessPhone, fax, homePhone, mobilePhone, pager, webPage, notes, externalEmail, null); + int itemId, + int accountId, + string displayName, + string password, + bool hideAddressBook, + bool disabled, + bool locked, + string firstName, + string initials, + string lastName, + string address, + string city, + string state, + string zip, + string country, + string jobTitle, + string company, + string department, + string office, + string managerAccountName, + string businessPhone, + string fax, + string homePhone, + string mobilePhone, + string pager, + string webPage, + string notes, + string externalEmail, + string subscriberNumber) + { + this.SetUserGeneralSettingsAsync(itemId, accountId, displayName, password, hideAddressBook, disabled, locked, firstName, initials, lastName, address, city, state, zip, country, jobTitle, company, department, office, managerAccountName, businessPhone, fax, homePhone, mobilePhone, pager, webPage, notes, externalEmail, subscriberNumber, null); } - + /// public void SetUserGeneralSettingsAsync( - int itemId, - int accountId, - string displayName, - string password, - bool hideAddressBook, - bool disabled, - bool locked, - string firstName, - string initials, - string lastName, - string address, - string city, - string state, - string zip, - string country, - string jobTitle, - string company, - string department, - string office, - string managerAccountName, - string businessPhone, - string fax, - string homePhone, - string mobilePhone, - string pager, - string webPage, - string notes, - string externalEmail, - object userState) { - if ((this.SetUserGeneralSettingsOperationCompleted == null)) { + int itemId, + int accountId, + string displayName, + string password, + bool hideAddressBook, + bool disabled, + bool locked, + string firstName, + string initials, + string lastName, + string address, + string city, + string state, + string zip, + string country, + string jobTitle, + string company, + string department, + string office, + string managerAccountName, + string businessPhone, + string fax, + string homePhone, + string mobilePhone, + string pager, + string webPage, + string notes, + string externalEmail, + string subscriberNumber, + object userState) + { + if ((this.SetUserGeneralSettingsOperationCompleted == null)) + { this.SetUserGeneralSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetUserGeneralSettingsOperationCompleted); } this.InvokeAsync("SetUserGeneralSettings", new object[] { @@ -1101,19 +1336,23 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { pager, webPage, notes, - externalEmail}, this.SetUserGeneralSettingsOperationCompleted, userState); + externalEmail, + subscriberNumber}, this.SetUserGeneralSettingsOperationCompleted, userState); } - - private void OnSetUserGeneralSettingsOperationCompleted(object arg) { - if ((this.SetUserGeneralSettingsCompleted != null)) { + + private void OnSetUserGeneralSettingsOperationCompleted(object arg) + { + if ((this.SetUserGeneralSettingsCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.SetUserGeneralSettingsCompleted(this, new SetUserGeneralSettingsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SearchAccounts", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public OrganizationUser[] SearchAccounts(int itemId, string filterColumn, string filterValue, string sortColumn, bool includeMailboxes) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/SearchAccounts", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public OrganizationUser[] SearchAccounts(int itemId, string filterColumn, string filterValue, string sortColumn, bool includeMailboxes) + { object[] results = this.Invoke("SearchAccounts", new object[] { itemId, filterColumn, @@ -1122,9 +1361,10 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { includeMailboxes}); return ((OrganizationUser[])(results[0])); } - + /// - public System.IAsyncResult BeginSearchAccounts(int itemId, string filterColumn, string filterValue, string sortColumn, bool includeMailboxes, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginSearchAccounts(int itemId, string filterColumn, string filterValue, string sortColumn, bool includeMailboxes, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("SearchAccounts", new object[] { itemId, filterColumn, @@ -1132,21 +1372,25 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { sortColumn, includeMailboxes}, callback, asyncState); } - + /// - public OrganizationUser[] EndSearchAccounts(System.IAsyncResult asyncResult) { + public OrganizationUser[] EndSearchAccounts(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((OrganizationUser[])(results[0])); } - + /// - public void SearchAccountsAsync(int itemId, string filterColumn, string filterValue, string sortColumn, bool includeMailboxes) { + public void SearchAccountsAsync(int itemId, string filterColumn, string filterValue, string sortColumn, bool includeMailboxes) + { this.SearchAccountsAsync(itemId, filterColumn, filterValue, sortColumn, includeMailboxes, null); } - + /// - public void SearchAccountsAsync(int itemId, string filterColumn, string filterValue, string sortColumn, bool includeMailboxes, object userState) { - if ((this.SearchAccountsOperationCompleted == null)) { + public void SearchAccountsAsync(int itemId, string filterColumn, string filterValue, string sortColumn, bool includeMailboxes, object userState) + { + if ((this.SearchAccountsOperationCompleted == null)) + { this.SearchAccountsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSearchAccountsOperationCompleted); } this.InvokeAsync("SearchAccounts", new object[] { @@ -1156,604 +1400,748 @@ namespace WebsitePanel.EnterpriseServer.HostedSolution { sortColumn, includeMailboxes}, this.SearchAccountsOperationCompleted, userState); } - - private void OnSearchAccountsOperationCompleted(object arg) { - if ((this.SearchAccountsCompleted != null)) { + + private void OnSearchAccountsOperationCompleted(object arg) + { + if ((this.SearchAccountsCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.SearchAccountsCompleted(this, new SearchAccountsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteUser", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public int DeleteUser(int itemId, int accountId) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/DeleteUser", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public int DeleteUser(int itemId, int accountId) + { object[] results = this.Invoke("DeleteUser", new object[] { itemId, accountId}); return ((int)(results[0])); } - + /// - public System.IAsyncResult BeginDeleteUser(int itemId, int accountId, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginDeleteUser(int itemId, int accountId, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("DeleteUser", new object[] { itemId, accountId}, callback, asyncState); } - + /// - public int EndDeleteUser(System.IAsyncResult asyncResult) { + public int EndDeleteUser(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((int)(results[0])); } - + /// - public void DeleteUserAsync(int itemId, int accountId) { + public void DeleteUserAsync(int itemId, int accountId) + { this.DeleteUserAsync(itemId, accountId, null); } - + /// - public void DeleteUserAsync(int itemId, int accountId, object userState) { - if ((this.DeleteUserOperationCompleted == null)) { + public void DeleteUserAsync(int itemId, int accountId, object userState) + { + if ((this.DeleteUserOperationCompleted == null)) + { this.DeleteUserOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteUserOperationCompleted); } this.InvokeAsync("DeleteUser", new object[] { itemId, accountId}, this.DeleteUserOperationCompleted, userState); } - - private void OnDeleteUserOperationCompleted(object arg) { - if ((this.DeleteUserCompleted != null)) { + + private void OnDeleteUserOperationCompleted(object arg) + { + if ((this.DeleteUserCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.DeleteUserCompleted(this, new DeleteUserCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetPasswordPolicy", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public PasswordPolicyResult GetPasswordPolicy(int itemId) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetPasswordPolicy", RequestNamespace = "http://tempuri.org/", ResponseNamespace = "http://tempuri.org/", Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public PasswordPolicyResult GetPasswordPolicy(int itemId) + { object[] results = this.Invoke("GetPasswordPolicy", new object[] { itemId}); return ((PasswordPolicyResult)(results[0])); } - + /// - public System.IAsyncResult BeginGetPasswordPolicy(int itemId, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginGetPasswordPolicy(int itemId, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("GetPasswordPolicy", new object[] { itemId}, callback, asyncState); } - + /// - public PasswordPolicyResult EndGetPasswordPolicy(System.IAsyncResult asyncResult) { + public PasswordPolicyResult EndGetPasswordPolicy(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((PasswordPolicyResult)(results[0])); } - + /// - public void GetPasswordPolicyAsync(int itemId) { + public void GetPasswordPolicyAsync(int itemId) + { this.GetPasswordPolicyAsync(itemId, null); } - + /// - public void GetPasswordPolicyAsync(int itemId, object userState) { - if ((this.GetPasswordPolicyOperationCompleted == null)) { + public void GetPasswordPolicyAsync(int itemId, object userState) + { + if ((this.GetPasswordPolicyOperationCompleted == null)) + { this.GetPasswordPolicyOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetPasswordPolicyOperationCompleted); } this.InvokeAsync("GetPasswordPolicy", new object[] { itemId}, this.GetPasswordPolicyOperationCompleted, userState); } - - private void OnGetPasswordPolicyOperationCompleted(object arg) { - if ((this.GetPasswordPolicyCompleted != null)) { + + private void OnGetPasswordPolicyOperationCompleted(object arg) + { + if ((this.GetPasswordPolicyCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetPasswordPolicyCompleted(this, new GetPasswordPolicyCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - public new void CancelAsync(object userState) { + 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 { - + public partial class CreateOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal CreateOrganizationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal CreateOrganizationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public int Result { - get { + public int Result + { + get + { this.RaiseExceptionIfNecessary(); return ((int)(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void GetRawOrganizationsPagedCompletedEventHandler(object sender, GetRawOrganizationsPagedCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetRawOrganizationsPagedCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class GetRawOrganizationsPagedCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal GetRawOrganizationsPagedCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal GetRawOrganizationsPagedCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public System.Data.DataSet Result { - get { + public System.Data.DataSet Result + { + get + { this.RaiseExceptionIfNecessary(); return ((System.Data.DataSet)(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void GetOrganizationsCompletedEventHandler(object sender, GetOrganizationsCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetOrganizationsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class GetOrganizationsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal GetOrganizationsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal GetOrganizationsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public Organization[] Result { - get { + public Organization[] Result + { + get + { this.RaiseExceptionIfNecessary(); return ((Organization[])(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void GetOrganizationUserSummuryLetterCompletedEventHandler(object sender, GetOrganizationUserSummuryLetterCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetOrganizationUserSummuryLetterCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class GetOrganizationUserSummuryLetterCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal GetOrganizationUserSummuryLetterCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal GetOrganizationUserSummuryLetterCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public string Result { - get { + public string Result + { + get + { this.RaiseExceptionIfNecessary(); return ((string)(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void SendOrganizationUserSummuryLetterCompletedEventHandler(object sender, SendOrganizationUserSummuryLetterCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class SendOrganizationUserSummuryLetterCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class SendOrganizationUserSummuryLetterCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal SendOrganizationUserSummuryLetterCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal SendOrganizationUserSummuryLetterCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public int Result { - get { + public int Result + { + get + { this.RaiseExceptionIfNecessary(); return ((int)(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.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 { - + public partial class DeleteOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal DeleteOrganizationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal DeleteOrganizationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public int Result { - get { + public int Result + { + get + { this.RaiseExceptionIfNecessary(); return ((int)(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void GetOrganizationStatisticsCompletedEventHandler(object sender, GetOrganizationStatisticsCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetOrganizationStatisticsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class GetOrganizationStatisticsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal GetOrganizationStatisticsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal GetOrganizationStatisticsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public OrganizationStatistics Result { - get { + public OrganizationStatistics Result + { + get + { this.RaiseExceptionIfNecessary(); return ((OrganizationStatistics)(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void GetOrganizationCompletedEventHandler(object sender, GetOrganizationCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class GetOrganizationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal GetOrganizationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal GetOrganizationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public Organization Result { - get { + public Organization Result + { + get + { this.RaiseExceptionIfNecessary(); return ((Organization)(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void AddOrganizationDomainCompletedEventHandler(object sender, AddOrganizationDomainCompletedEventArgs e); - + public delegate void GetAccountIdByUserPrincipalNameCompletedEventHandler(object sender, GetAccountIdByUserPrincipalNameCompletedEventArgs e); + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class AddOrganizationDomainCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class GetAccountIdByUserPrincipalNameCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal AddOrganizationDomainCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal GetAccountIdByUserPrincipalNameCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public int Result { - get { + public int Result + { + get + { this.RaiseExceptionIfNecessary(); return ((int)(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void GetOrganizationDomainsCompletedEventHandler(object sender, GetOrganizationDomainsCompletedEventArgs e); - + public delegate void AddOrganizationDomainCompletedEventHandler(object sender, AddOrganizationDomainCompletedEventArgs e); + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetOrganizationDomainsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class AddOrganizationDomainCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal GetOrganizationDomainsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal AddOrganizationDomainCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public OrganizationDomainName[] Result { - get { + public int Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((int)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetOrganizationDomainsCompletedEventHandler(object sender, GetOrganizationDomainsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetOrganizationDomainsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal GetOrganizationDomainsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public OrganizationDomainName[] Result + { + get + { this.RaiseExceptionIfNecessary(); return ((OrganizationDomainName[])(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void DeleteOrganizationDomainCompletedEventHandler(object sender, DeleteOrganizationDomainCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class DeleteOrganizationDomainCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class DeleteOrganizationDomainCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal DeleteOrganizationDomainCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal DeleteOrganizationDomainCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public int Result { - get { + public int Result + { + get + { this.RaiseExceptionIfNecessary(); return ((int)(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void SetOrganizationDefaultDomainCompletedEventHandler(object sender, SetOrganizationDefaultDomainCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class SetOrganizationDefaultDomainCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class SetOrganizationDefaultDomainCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal SetOrganizationDefaultDomainCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal SetOrganizationDefaultDomainCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public int Result { - get { + public int Result + { + get + { this.RaiseExceptionIfNecessary(); return ((int)(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.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 { - + public partial class CreateUserCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal CreateUserCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal CreateUserCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public int Result { - get { + public int Result + { + get + { this.RaiseExceptionIfNecessary(); return ((int)(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void GetOrganizationUsersPagedCompletedEventHandler(object sender, GetOrganizationUsersPagedCompletedEventArgs e); - + public delegate void ImportUserCompletedEventHandler(object sender, ImportUserCompletedEventArgs e); + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetOrganizationUsersPagedCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class ImportUserCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal GetOrganizationUsersPagedCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal ImportUserCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public OrganizationUsersPaged Result { - get { + public int Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((int)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetOrganizationUsersPagedCompletedEventHandler(object sender, GetOrganizationUsersPagedCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetOrganizationUsersPagedCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal GetOrganizationUsersPagedCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public OrganizationUsersPaged Result + { + get + { this.RaiseExceptionIfNecessary(); return ((OrganizationUsersPaged)(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void GetUserGeneralSettingsCompletedEventHandler(object sender, GetUserGeneralSettingsCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetUserGeneralSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class GetUserGeneralSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal GetUserGeneralSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal GetUserGeneralSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public OrganizationUser Result { - get { + public OrganizationUser Result + { + get + { this.RaiseExceptionIfNecessary(); return ((OrganizationUser)(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void SetUserGeneralSettingsCompletedEventHandler(object sender, SetUserGeneralSettingsCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class SetUserGeneralSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class SetUserGeneralSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal SetUserGeneralSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal SetUserGeneralSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public int Result { - get { + public int Result + { + get + { this.RaiseExceptionIfNecessary(); return ((int)(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void SearchAccountsCompletedEventHandler(object sender, SearchAccountsCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class SearchAccountsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class SearchAccountsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal SearchAccountsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal SearchAccountsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public OrganizationUser[] Result { - get { + public OrganizationUser[] Result + { + get + { this.RaiseExceptionIfNecessary(); return ((OrganizationUser[])(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.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 { - + public partial class DeleteUserCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal DeleteUserCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal DeleteUserCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public int Result { - get { + public int Result + { + get + { this.RaiseExceptionIfNecessary(); return ((int)(this.results[0])); } } } - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void GetPasswordPolicyCompletedEventHandler(object sender, GetPasswordPolicyCompletedEventArgs e); - + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetPasswordPolicyCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class GetPasswordPolicyCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal GetPasswordPolicyCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal GetPasswordPolicyCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public PasswordPolicyResult Result { - get { + public PasswordPolicyResult Result + { + get + { this.RaiseExceptionIfNecessary(); return ((PasswordPolicyResult)(this.results[0])); } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Data/DataProvider.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Data/DataProvider.cs index 1d4f770d..714b0165 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Data/DataProvider.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Data/DataProvider.cs @@ -2065,33 +2065,36 @@ namespace WebsitePanel.EnterpriseServer #endregion #region Exchange Server - - public static int AddExchangeAccount(int itemId, int accountType, string accountName, + + public static int AddExchangeAccount(int itemId, int accountType, string accountName, string displayName, string primaryEmailAddress, bool mailEnabledPublicFolder, - string mailboxManagerActions, string samAccountName, string accountPassword) - { - SqlParameter outParam = new SqlParameter("@AccountID", SqlDbType.Int); - outParam.Direction = ParameterDirection.Output; + string mailboxManagerActions, string samAccountName, string accountPassword, int mailboxPlanId, string subscriberNumber) + { + SqlParameter outParam = new SqlParameter("@AccountID", SqlDbType.Int); + outParam.Direction = ParameterDirection.Output; - SqlHelper.ExecuteNonQuery( - ConnectionString, - CommandType.StoredProcedure, - "AddExchangeAccount", - outParam, - new SqlParameter("@ItemID", itemId), - new SqlParameter("@AccountType", accountType), - new SqlParameter("@AccountName", accountName), - new SqlParameter("@DisplayName", displayName), - new SqlParameter("@PrimaryEmailAddress", primaryEmailAddress), - new SqlParameter("@MailEnabledPublicFolder", mailEnabledPublicFolder), + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "AddExchangeAccount", + outParam, + new SqlParameter("@ItemID", itemId), + new SqlParameter("@AccountType", accountType), + new SqlParameter("@AccountName", accountName), + new SqlParameter("@DisplayName", displayName), + new SqlParameter("@PrimaryEmailAddress", primaryEmailAddress), + new SqlParameter("@MailEnabledPublicFolder", mailEnabledPublicFolder), new SqlParameter("@MailboxManagerActions", mailboxManagerActions), new SqlParameter("@SamAccountName", samAccountName), - new SqlParameter("@AccountPassword", accountPassword) - ); + new SqlParameter("@AccountPassword", accountPassword), + new SqlParameter("@MailboxPlanId", (mailboxPlanId == 0) ? (object)DBNull.Value : (object)mailboxPlanId), + new SqlParameter("@SubscriberNumber", (string.IsNullOrEmpty(subscriberNumber) ? (object)DBNull.Value : (object)subscriberNumber)) + ); + + return Convert.ToInt32(outParam.Value); + } - return Convert.ToInt32(outParam.Value); - } public static void AddExchangeAccountEmailAddress(int accountId, string emailAddress) { @@ -2159,6 +2162,7 @@ namespace WebsitePanel.EnterpriseServer ); } + public static void DeleteExchangeAccountEmailAddress(int accountId, string emailAddress) { SqlHelper.ExecuteNonQuery( @@ -2255,26 +2259,27 @@ namespace WebsitePanel.EnterpriseServer return Convert.ToBoolean(outParam.Value); } - public static void UpdateExchangeAccount(int accountId, string accountName, ExchangeAccountType accountType, + public static void UpdateExchangeAccount(int accountId, string accountName, ExchangeAccountType accountType, string displayName, string primaryEmailAddress, bool mailEnabledPublicFolder, - string mailboxManagerActions, string samAccountName, string accountPassword) - { - SqlHelper.ExecuteNonQuery( - ConnectionString, - CommandType.StoredProcedure, - "UpdateExchangeAccount", - new SqlParameter("@AccountID", accountId), - new SqlParameter("@AccountName", accountName), - new SqlParameter("@DisplayName", displayName), + string mailboxManagerActions, string samAccountName, string accountPassword, int mailboxPlanId, string subscriberNumber) + { + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "UpdateExchangeAccount", + new SqlParameter("@AccountID", accountId), + new SqlParameter("@AccountName", accountName), + new SqlParameter("@DisplayName", displayName), new SqlParameter("@AccountType", (int)accountType), - new SqlParameter("@PrimaryEmailAddress", primaryEmailAddress), - new SqlParameter("@MailEnabledPublicFolder", mailEnabledPublicFolder), + new SqlParameter("@PrimaryEmailAddress", primaryEmailAddress), + new SqlParameter("@MailEnabledPublicFolder", mailEnabledPublicFolder), new SqlParameter("@MailboxManagerActions", mailboxManagerActions), new SqlParameter("@Password", string.IsNullOrEmpty(accountPassword) ? (object)DBNull.Value : (object)accountPassword), - new SqlParameter("@SamAccountName", samAccountName) - - ); - } + new SqlParameter("@SamAccountName", samAccountName), + new SqlParameter("@MailboxPlanId", (mailboxPlanId == 0) ? (object)DBNull.Value : (object)mailboxPlanId), + new SqlParameter("@SubscriberNumber", (string.IsNullOrEmpty(subscriberNumber) ? (object)DBNull.Value : (object)subscriberNumber)) + ); + } public static IDataReader GetExchangeAccount(int itemId, int accountId) { @@ -2287,6 +2292,17 @@ namespace WebsitePanel.EnterpriseServer ); } + public static IDataReader GetExchangeAccountByAccountName(int itemId, string accountName) + { + return SqlHelper.ExecuteReader( + ConnectionString, + CommandType.StoredProcedure, + "GetExchangeAccountByAccountName", + new SqlParameter("@ItemID", itemId), + new SqlParameter("@AccountName", accountName) + ); + } + public static IDataReader GetExchangeAccountEmailAddresses(int accountId) { return SqlHelper.ExecuteReader( @@ -2398,6 +2414,97 @@ namespace WebsitePanel.EnterpriseServer #endregion + #region Exchange Mailbox Plans + public static int AddExchangeMailboxPlan(int itemID, string mailboxPlan, bool enableActiveSync, bool enableIMAP, bool enableMAPI, bool enableOWA, bool enablePOP, + bool isDefault, int issueWarningPct, int keepDeletedItemsDays, int mailboxSizeMB, int maxReceiveMessageSizeKB, int maxRecipients, + int maxSendMessageSizeKB, int prohibitSendPct, int prohibitSendReceivePct, bool hideFromAddressBook) + { + SqlParameter outParam = new SqlParameter("@MailboxPlanId", SqlDbType.Int); + outParam.Direction = ParameterDirection.Output; + + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "AddExchangeMailboxPlan", + outParam, + new SqlParameter("@ItemID", itemID), + new SqlParameter("@MailboxPlan", mailboxPlan), + new SqlParameter("@EnableActiveSync", enableActiveSync), + new SqlParameter("@EnableIMAP", enableIMAP), + new SqlParameter("@EnableMAPI", enableMAPI), + new SqlParameter("@EnableOWA", enableOWA), + new SqlParameter("@EnablePOP", enablePOP), + new SqlParameter("@IsDefault", isDefault), + new SqlParameter("@IssueWarningPct", issueWarningPct), + new SqlParameter("@KeepDeletedItemsDays", keepDeletedItemsDays), + new SqlParameter("@MailboxSizeMB", mailboxSizeMB), + new SqlParameter("@MaxReceiveMessageSizeKB", maxReceiveMessageSizeKB), + new SqlParameter("@MaxRecipients", maxRecipients), + new SqlParameter("@MaxSendMessageSizeKB", maxSendMessageSizeKB), + new SqlParameter("@ProhibitSendPct", prohibitSendPct), + new SqlParameter("@ProhibitSendReceivePct", prohibitSendReceivePct), + new SqlParameter("@HideFromAddressBook", hideFromAddressBook) + ); + + return Convert.ToInt32(outParam.Value); + } + + + public static void DeleteExchangeMailboxPlan(int mailboxPlanId) + { + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "DeleteExchangeMailboxPlan", + new SqlParameter("@MailboxPlanId", mailboxPlanId) + ); + } + + + public static IDataReader GetExchangeMailboxPlan(int mailboxPlanId) + { + return SqlHelper.ExecuteReader( + ConnectionString, + CommandType.StoredProcedure, + "GetExchangeMailboxPlan", + new SqlParameter("@MailboxPlanId", mailboxPlanId) + ); + } + + public static IDataReader GetExchangeMailboxPlans(int itemId) + { + return SqlHelper.ExecuteReader( + ConnectionString, + CommandType.StoredProcedure, + "GetExchangeMailboxPlans", + new SqlParameter("@ItemID", itemId) + ); + } + + public static void SetOrganizationDefaultExchangeMailboxPlan(int itemId, int mailboxPlanId) + { + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "SetOrganizationDefaultExchangeMailboxPlan", + new SqlParameter("@ItemID", itemId), + new SqlParameter("@MailboxPlanId", mailboxPlanId) + ); + } + + public static void SetExchangeAccountMailboxPlan(int accountId, int mailboxPlanId) + { + SqlHelper.ExecuteNonQuery( + ConnectionString, + CommandType.StoredProcedure, + "SetExchangeAccountMailboxplan", + new SqlParameter("@AccountID", accountId), + new SqlParameter("@MailboxPlanId", (mailboxPlanId == 0) ? (object)DBNull.Value : (object)mailboxPlanId) + ); + } + + #endregion + #region Organizations public static void DeleteOrganizationUser(int itemId) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/ExchangeServer/ExchangeServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/ExchangeServer/ExchangeServerController.cs index 77eb5848..42a4e2bd 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/ExchangeServer/ExchangeServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/ExchangeServer/ExchangeServerController.cs @@ -120,9 +120,6 @@ namespace WebsitePanel.EnterpriseServer org.Id = 1; org.OrganizationId = "fabrikam"; org.Name = "Fabrikam Inc"; - org.IssueWarningKB = 150000; - org.ProhibitSendKB = 170000; - org.ProhibitSendReceiveKB = 190000; org.KeepDeletedItemsDays = 14; return org; } @@ -167,7 +164,7 @@ namespace WebsitePanel.EnterpriseServer DataProvider.GetExchangeOrganizationStatistics(itemId)); // disk space - stats.UsedDiskSpace = org.DiskSpace; + //stats.UsedDiskSpace = org.DiskSpace; // allocated quotas PackageContext cntx = PackageController.GetPackageContext(org.PackageId); @@ -295,10 +292,6 @@ namespace WebsitePanel.EnterpriseServer ExchangeServer mailboxRole = GetExchangeServer(serviceId, org.ServiceId); - - - - bool authDomainCreated = false; @@ -307,10 +300,15 @@ namespace WebsitePanel.EnterpriseServer List domains = null; try - { + { + PackageContext cntx = PackageController.GetPackageContext(org.PackageId); + // 1) Create Organization (Mailbox) // ================================ - Organization exchangeOrganization = mailboxRole.ExtendToExchangeOrganization(org.OrganizationId, org.SecurityGroup); + Organization exchangeOrganization = mailboxRole.ExtendToExchangeOrganization(org.OrganizationId, + org.SecurityGroup, + Convert.ToBoolean(cntx.Quotas[Quotas.EXCHANGE2007_ISCONSUMER].QuotaAllocatedValue)); + organizationExtended = true; exchangeOrganization.OrganizationId = org.OrganizationId; @@ -386,17 +384,17 @@ namespace WebsitePanel.EnterpriseServer break; } - PackageContext cntx = PackageController.GetPackageContext(org.PackageId); - // organization limits - org.IssueWarningKB = cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue; - if (org.IssueWarningKB > 0) - org.IssueWarningKB *= Convert.ToInt32(1024*0.9); //90% - org.ProhibitSendKB = cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue; - if (org.ProhibitSendKB > 0) - org.ProhibitSendKB *= 1024; //100% - org.ProhibitSendReceiveKB = cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue; - if (org.ProhibitSendReceiveKB > 0) - org.ProhibitSendReceiveKB *= 1024; //100% + + // 4) Add the address book policy (Exchange 2010 SP2 + // + // ========================================== + Organization OrgTmp = mailboxRole.CreateOrganizationAddressBookPolicy(org.OrganizationId, + org.GlobalAddressList, + org.AddressList, + org.RoomsAddressList, + org.OfflineAddressBook); + + org.AddressBookPolicy = OrgTmp.AddressBookPolicy; StringDictionary settings = ServerController.GetServiceSettings(serviceId); org.KeepDeletedItemsDays = Utils.ParseInt(settings["KeepDeletedItemsDays"], 14); @@ -406,9 +404,9 @@ namespace WebsitePanel.EnterpriseServer { // rollback organization creation - if (organizationExtended) + if (organizationExtended) mailboxRole.DeleteOrganization(org.OrganizationId, org.DistinguishedName, - org.GlobalAddressList, org.AddressList, org.RoomsAddressList, org.OfflineAddressBook, org.SecurityGroup); + org.GlobalAddressList, org.AddressList, org.RoomsAddressList, org.OfflineAddressBook, org.SecurityGroup, org.AddressBookPolicy); // rollback domain if (authDomainCreated) @@ -498,16 +496,16 @@ namespace WebsitePanel.EnterpriseServer int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - - bool successful = exchange.DeleteOrganization( - org.OrganizationId, - org.DistinguishedName, - org.GlobalAddressList, - org.AddressList, - org.RoomsAddressList, - org.OfflineAddressBook, - org.SecurityGroup); + bool successful = exchange.DeleteOrganization( + org.OrganizationId, + org.DistinguishedName, + org.GlobalAddressList, + org.AddressList, + org.RoomsAddressList, + org.OfflineAddressBook, + org.SecurityGroup, + org.AddressBookPolicy); return successful ? 0 : BusinessErrorCodes.ERROR_EXCHANGE_DELETE_SOME_PROBLEMS; @@ -571,9 +569,6 @@ namespace WebsitePanel.EnterpriseServer return BusinessErrorCodes.ERROR_EXCHANGE_STORAGE_QUOTAS_EXCEED_HOST_VALUES; // set limits - org.IssueWarningKB = issueWarningKB; - org.ProhibitSendKB = prohibitSendKB; - org.ProhibitSendReceiveKB = prohibitSendReceiveKB; org.KeepDeletedItemsDays = keepDeletedItemsDays; // save organization @@ -665,6 +660,39 @@ namespace WebsitePanel.EnterpriseServer } } + public static ExchangeMailboxStatistics GetMailboxStatistics(int itemId, int accountId) + { + // place log record + TaskManager.StartTask("EXCHANGE", "GET_MAILBOX_STATS"); + TaskManager.ItemId = itemId; + + try + { + Organization org = (Organization)PackageController.GetPackageItem(itemId); + if (org == null) + return null; + + + // get stats + int exchangeServiceId = GetExchangeServiceID(org.PackageId); + ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); + + // load account + ExchangeAccount account = GetAccount(itemId, accountId); + + return exchange.GetMailboxStatistics(account.AccountName); + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + public static ExchangeItemStatistics[] GetPublicFoldersStatistics(int itemId) { #region Demo Mode @@ -1087,21 +1115,22 @@ namespace WebsitePanel.EnterpriseServer return account; } - private static int AddAccount(int itemId, ExchangeAccountType accountType, - string accountName, string displayName, string primaryEmailAddress, bool mailEnabledPublicFolder, - MailboxManagerActions mailboxManagerActions, string samAccountName, string accountPassword) - { - return DataProvider.AddExchangeAccount(itemId, (int)accountType, - accountName, displayName, primaryEmailAddress, mailEnabledPublicFolder, - mailboxManagerActions.ToString(), samAccountName, CryptoUtils.Encrypt(accountPassword)); - } + private static int AddAccount(int itemId, ExchangeAccountType accountType, + string accountName, string displayName, string primaryEmailAddress, bool mailEnabledPublicFolder, + MailboxManagerActions mailboxManagerActions, string samAccountName, string accountPassword, int mailboxPlanId, string subscriberNumber) + { + return DataProvider.AddExchangeAccount(itemId, (int)accountType, + accountName, displayName, primaryEmailAddress, mailEnabledPublicFolder, + mailboxManagerActions.ToString(), samAccountName, CryptoUtils.Encrypt(accountPassword), mailboxPlanId, subscriberNumber.Trim()); + } - private static void UpdateAccount(ExchangeAccount account) - { - DataProvider.UpdateExchangeAccount(account.AccountId, account.AccountName, account.AccountType, account.DisplayName, - account.PrimaryEmailAddress,account.MailEnabledPublicFolder, - account.MailboxManagerActions.ToString(), account.SamAccountName, account.AccountPassword); - } + private static void UpdateAccount(ExchangeAccount account) + { + DataProvider.UpdateExchangeAccount(account.AccountId, account.AccountName, account.AccountType, account.DisplayName, + account.PrimaryEmailAddress, account.MailEnabledPublicFolder, + account.MailboxManagerActions.ToString(), account.SamAccountName, account.AccountPassword, account.MailboxPlanId, + (string.IsNullOrEmpty(account.SubscriberNumber) ? null : account.SubscriberNumber.Trim())); + } private static void DeleteAccount(int itemId, int accountId) { @@ -1112,29 +1141,41 @@ namespace WebsitePanel.EnterpriseServer DataProvider.DeleteExchangeAccount(itemId, accountId); } - private static string BuildAccountName(string orgId, string name) - { - int maxLen = 19 - orgId.Length; + private static string BuildAccountName(string orgId, string name) + { + string accountName = name = name.Replace(" ", ""); + string CounterStr = "00000"; + int counter = 0; + bool bFound = false; + do + { + accountName = genSamLogin(name, CounterStr); - // try to choose name - int i = 0; - while (true) - { - string num = i > 0 ? i.ToString() : ""; - int len = maxLen - num.Length; + if (!AccountExists(accountName)) bFound = true; - if (name.Length > len) - name = name.Substring(0, len); + CounterStr = counter.ToString("d5"); + counter++; + } + while (!bFound); - string accountName = name + num + "_" + orgId; + return accountName; + } - // check if already exists - if (!AccountExists(accountName)) - return accountName; + private static string genSamLogin(string login, string strCounter) + { + int maxLogin = 20; + int fullLen = login.Length + strCounter.Length; + if (fullLen <= maxLogin) + return login + strCounter; + else + { + if (login.Length - (fullLen - maxLogin) > 0) + return login.Substring(0, login.Length - (fullLen - maxLogin)) + strCounter; + else return strCounter; // ???? + } + + } - i++; - } - } #endregion @@ -1375,160 +1416,198 @@ namespace WebsitePanel.EnterpriseServer #endregion #region Mailboxes - - private static void UpdateExchangeAccount(int accountId, string accountName, ExchangeAccountType accountType, + + private static void UpdateExchangeAccount(int accountId, string accountName, ExchangeAccountType accountType, string displayName, string primaryEmailAddress, bool mailEnabledPublicFolder, - string mailboxManagerActions, string samAccountName, string accountPassword) - { - DataProvider.UpdateExchangeAccount(accountId, - accountName, - accountType, - displayName, - primaryEmailAddress, - mailEnabledPublicFolder, + string mailboxManagerActions, string samAccountName, string accountPassword, int mailboxPlanId, string subscriberNumber) + { + DataProvider.UpdateExchangeAccount(accountId, + accountName, + accountType, + displayName, + primaryEmailAddress, + mailEnabledPublicFolder, mailboxManagerActions, samAccountName, - CryptoUtils.Encrypt(accountPassword)); + CryptoUtils.Encrypt(accountPassword), + mailboxPlanId, + (string.IsNullOrEmpty(subscriberNumber) ? null : subscriberNumber.Trim())); } - public static int CreateMailbox(int itemId, int accountId, ExchangeAccountType accountType, string accountName, - string displayName, string name, string domain, string password, bool sendSetupInstructions, string setupInstructionMailAddress) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; + public static int CreateMailbox(int itemId, int accountId, ExchangeAccountType accountType, string accountName, + string displayName, string name, string domain, string password, bool sendSetupInstructions, string setupInstructionMailAddress, int mailboxPlanId, string subscriberNumber) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; - // check mailbox quota - OrganizationStatistics orgStats = GetOrganizationStatistics(itemId); - if ((orgStats.AllocatedMailboxes > -1 ) && ( orgStats.CreatedMailboxes >= orgStats.AllocatedMailboxes)) - return BusinessErrorCodes.ERROR_EXCHANGE_MAILBOXES_QUOTA_LIMIT; - - // place log record - TaskManager.StartTask("EXCHANGE", "CREATE_MAILBOX"); - TaskManager.ItemId = itemId; - bool userCreated = false; - Organization org = null; - try - { - // load organization - org = GetOrganization(itemId); - if (org == null) - return -1; - - // e-mail - string email = name + "@" + domain; - bool enabled = (accountType == ExchangeAccountType.Mailbox); - - - // string accountName = string.Empty; - //Create AD user if needed - if (accountId == 0) - { - accountId = OrganizationController.CreateUser(org.Id, displayName, name, domain, password, enabled, false, string.Empty, out accountName); - if (accountId > 0) - userCreated = true; - } - if (accountId < 0) - return accountId; - - int exchangeServiceId = PackageController.GetPackageServiceId(org.PackageId, ResourceGroups.Exchange); - - ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); + // check mailbox quota + OrganizationStatistics orgStats = GetOrganizationStatistics(itemId); + if ((orgStats.AllocatedMailboxes > -1) && (orgStats.CreatedMailboxes >= orgStats.AllocatedMailboxes)) + return BusinessErrorCodes.ERROR_EXCHANGE_MAILBOXES_QUOTA_LIMIT; - //Create Exchange Organization - if (string.IsNullOrEmpty(org.GlobalAddressList)) - { - ExtendToExchangeOrganization(ref org); - - PackageController.UpdatePackageItem(org); - } - - // check package - int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) return packageCheck; + // place log record + TaskManager.StartTask("EXCHANGE", "CREATE_MAILBOX"); + TaskManager.ItemId = itemId; + bool userCreated = false; + Organization org = null; + try + { + accountName = accountName.Trim(); + displayName = displayName.Trim(); + name = name.Trim(); + domain = domain.Trim(); - // load package context - PackageContext cntx = PackageController.GetPackageContext(org.PackageId); + // load organization + org = GetOrganization(itemId); + if (org == null) + return -1; + + // e-mail + string email = name + "@" + domain; + bool enabled = (accountType == ExchangeAccountType.Mailbox); - string samAccount = exchange.CreateMailEnableUser(email, org.OrganizationId, org.DistinguishedName, accountType, org.Database, - org.OfflineAddressBook, - accountName, - QuotaEnabled(cntx, Quotas.EXCHANGE2007_POP3ENABLED), - QuotaEnabled(cntx, Quotas.EXCHANGE2007_IMAPENABLED), - QuotaEnabled(cntx, Quotas.EXCHANGE2007_OWAENABLED), - QuotaEnabled(cntx, Quotas.EXCHANGE2007_MAPIENABLED), - QuotaEnabled(cntx, Quotas.EXCHANGE2007_ACTIVESYNCENABLED), - org.IssueWarningKB, - org.ProhibitSendKB, - org.ProhibitSendReceiveKB, - org.KeepDeletedItemsDays); + // string accountName = string.Empty; + //Create AD user if needed + if (accountId == 0) + { + accountId = OrganizationController.CreateUser(org.Id, displayName, name, domain, password, subscriberNumber, enabled, false, string.Empty, out accountName); + if (accountId > 0) + userCreated = true; + } + if (accountId < 0) + return accountId; - MailboxManagerActions pmmActions = MailboxManagerActions.GeneralSettings - | MailboxManagerActions.MailFlowSettings - | MailboxManagerActions.AdvancedSettings - | MailboxManagerActions.EmailAddresses; + // get mailbox settings + Organizations orgProxy = OrganizationController.GetOrganizationProxy(org.ServiceId); + OrganizationUser retUser = orgProxy.GetUserGeneralSettings(accountName, org.OrganizationId); - UpdateExchangeAccount(accountId, accountName, accountType, displayName, email, false, pmmActions.ToString(), samAccount, password); + int exchangeServiceId = PackageController.GetPackageServiceId(org.PackageId, ResourceGroups.Exchange); + + ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); + + + //Create Exchange Organization + if (string.IsNullOrEmpty(org.GlobalAddressList)) + { + ExtendToExchangeOrganization(ref org); + + PackageController.UpdatePackageItem(org); + } + + // check package + int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; + + //verify if the mailbox fits in the storage quota + // load package context + PackageContext cntx = PackageController.GetPackageContext(org.PackageId); + + int maxDiskSpace = -1; + int quotaUsed = 0; + if (cntx.Quotas.ContainsKey(Quotas.EXCHANGE2007_DISKSPACE) + && cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue > 0) + { + maxDiskSpace = cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue; + quotaUsed = cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaUsedValue; + } + + ExchangeMailboxPlan plan = GetExchangeMailboxPlan(itemId, mailboxPlanId); + if (maxDiskSpace != -1) + { + if ((quotaUsed + plan.MailboxSizeMB) > (maxDiskSpace)) + return BusinessErrorCodes.ERROR_EXCHANGE_STORAGE_QUOTAS_EXCEED_HOST_VALUES; + } + + //GetServiceSettings + StringDictionary primSettings = ServerController.GetServiceSettings(exchangeServiceId); + + string samAccount = exchange.CreateMailEnableUser(email, org.OrganizationId, org.DistinguishedName, accountType, primSettings["mailboxdatabase"], + org.OfflineAddressBook, + org.AddressBookPolicy, + retUser.SamAccountName, + plan.EnablePOP, + plan.EnableIMAP, + plan.EnableOWA, + plan.EnableMAPI, + plan.EnableActiveSync, + (int)Math.Round((double)((plan.IssueWarningPct * plan.MailboxSizeMB * 1024) / 100)), + (int)Math.Round((double)((plan.ProhibitSendPct * plan.MailboxSizeMB * 1024) / 100)), + (int)Math.Round((double)((plan.ProhibitSendReceivePct * plan.MailboxSizeMB * 1024) / 100)), + plan.KeepDeletedItemsDays, + plan.MaxRecipients, + plan.MaxSendMessageSizeKB, + plan.MaxReceiveMessageSizeKB, + plan.HideFromAddressBook, + Convert.ToBoolean(cntx.Quotas[Quotas.EXCHANGE2007_ISCONSUMER].QuotaAllocatedValue)); + + MailboxManagerActions pmmActions = MailboxManagerActions.GeneralSettings + | MailboxManagerActions.MailFlowSettings + | MailboxManagerActions.AdvancedSettings + | MailboxManagerActions.EmailAddresses; + + + UpdateExchangeAccount(accountId, accountName, accountType, displayName, email, false, pmmActions.ToString(), samAccount, password, mailboxPlanId, subscriberNumber); - // send setup instructions - if (sendSetupInstructions) - { - try - { - // send setup instructions - int sendResult = SendMailboxSetupInstructions(itemId, accountId, true, setupInstructionMailAddress, null); - if (sendResult < 0) - TaskManager.WriteWarning("Setup instructions were not sent. Error code: " + sendResult); - } - catch (Exception ex) - { - TaskManager.WriteError(ex); - } - } + // send setup instructions + if (sendSetupInstructions) + { + try + { + // send setup instructions + int sendResult = SendMailboxSetupInstructions(itemId, accountId, true, setupInstructionMailAddress, null); + if (sendResult < 0) + TaskManager.WriteWarning("Setup instructions were not sent. Error code: " + sendResult); + } + catch (Exception ex) + { + TaskManager.WriteError(ex); + } + } - try - { - // update OAB - // check if this is the first mailbox within the organization - if (GetAccounts(itemId, ExchangeAccountType.Mailbox).Count == 1) - exchange.UpdateOrganizationOfflineAddressBook(org.OfflineAddressBook); - } - catch (Exception ex) - { - TaskManager.WriteError(ex); - } + try + { + // update OAB + // check if this is the first mailbox within the organization + if (GetAccounts(itemId, ExchangeAccountType.Mailbox).Count == 1) + exchange.UpdateOrganizationOfflineAddressBook(org.OfflineAddressBook); + } + catch (Exception ex) + { + TaskManager.WriteError(ex); + } - return accountId; - } - catch (Exception ex) - { - //rollback AD user - if (userCreated) - { - try - { - OrganizationController.DeleteUser(org.Id, accountId); - } - catch (Exception rollbackException) - { - TaskManager.WriteError(rollbackException); - } - } - throw TaskManager.WriteError(ex); + return accountId; + } + catch (Exception ex) + { + //rollback AD user + if (userCreated) + { + try + { + OrganizationController.DeleteUser(org.Id, accountId); + } + catch (Exception rollbackException) + { + TaskManager.WriteError(rollbackException); + } + } + throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + } + finally + { + TaskManager.CompleteTask(); + } + } public static int DisableMailbox(int itemId, int accountId) { @@ -1694,85 +1773,56 @@ namespace WebsitePanel.EnterpriseServer } } - public static int SetMailboxGeneralSettings(int itemId, int accountId, string displayName, - string password, bool hideAddressBook, bool disabled, string firstName, string initials, - string lastName, string address, string city, string state, string zip, string country, - string jobTitle, string company, string department, string office, string managerAccountName, - string businessPhone, string fax, string homePhone, string mobilePhone, string pager, - string webPage, string notes) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; + public static int SetMailboxGeneralSettings(int itemId, int accountId, bool hideAddressBook, bool disabled) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; - // place log record - TaskManager.StartTask("EXCHANGE", "UPDATE_MAILBOX_GENERAL"); - TaskManager.ItemId = itemId; + // place log record + TaskManager.StartTask("EXCHANGE", "UPDATE_MAILBOX_GENERAL"); + TaskManager.ItemId = itemId; - try - { - // load organization - Organization org = GetOrganization(itemId); - if (org == null) - return -1; + try + { + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return -1; - // check package - int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) return packageCheck; + // check package + int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; - // load account - ExchangeAccount account = GetAccount(itemId, accountId); + // load account + ExchangeAccount account = GetAccount(itemId, accountId); - // get mailbox settings + // get mailbox settings int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - - exchange.SetMailboxGeneralSettings( - account.AccountName, - displayName, - password, - hideAddressBook, - disabled, - firstName, - initials, - lastName, - address, - city, - state, - zip, - country, - jobTitle, - company, - department, - office, - managerAccountName, - businessPhone, - fax, - homePhone, - mobilePhone, - pager, - webPage, - notes); - // update account - account.DisplayName = displayName; - if (!String.IsNullOrEmpty(password)) - account.AccountPassword = CryptoUtils.Encrypt(password); + PackageContext cntx = PackageController.GetPackageContext(org.PackageId); - UpdateAccount(account); + if (Convert.ToBoolean(cntx.Quotas[Quotas.EXCHANGE2007_ISCONSUMER].QuotaAllocatedValue)) + hideAddressBook = true; - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + exchange.SetMailboxGeneralSettings( + account.AccountName, + hideAddressBook, + disabled); + + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } public static ExchangeEmailAddress[] GetMailboxEmailAddresses(int itemId, int accountId) { @@ -2002,61 +2052,58 @@ namespace WebsitePanel.EnterpriseServer } } - public static int SetMailboxMailFlowSettings(int itemId, int accountId, - bool enableForwarding, string forwardingAccountName, bool forwardToBoth, - string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, - int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB, + public static int SetMailboxMailFlowSettings(int itemId, int accountId, + bool enableForwarding, string forwardingAccountName, bool forwardToBoth, + string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; - // place log record - TaskManager.StartTask("EXCHANGE", "UPDATE_MAILBOX_MAILFLOW"); - TaskManager.ItemId = itemId; + // place log record + TaskManager.StartTask("EXCHANGE", "UPDATE_MAILBOX_MAILFLOW"); + TaskManager.ItemId = itemId; - try - { - // load organization - Organization org = GetOrganization(itemId); - if (org == null) - return -1; + try + { + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return -1; - // check package - int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) return packageCheck; + // check package + int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; - // load account - ExchangeAccount account = GetAccount(itemId, accountId); + // load account + ExchangeAccount account = GetAccount(itemId, accountId); - // get mailbox settings + // get mailbox settings int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - - exchange.SetMailboxMailFlowSettings(account.AccountName, - enableForwarding, - forwardingAccountName, - forwardToBoth, - sendOnBehalfAccounts, - acceptAccounts, - rejectAccounts, - maxRecipients, - maxSendMessageSizeKB, - maxReceiveMessageSizeKB, - requireSenderAuthentication); - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + exchange.SetMailboxMailFlowSettings(account.AccountName, + enableForwarding, + forwardingAccountName, + forwardToBoth, + sendOnBehalfAccounts, + acceptAccounts, + rejectAccounts, + requireSenderAuthentication); + + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + public static ExchangeMailbox GetMailboxAdvancedSettings(int itemId, int accountId) { @@ -2098,75 +2145,6 @@ namespace WebsitePanel.EnterpriseServer } } - public static int SetMailboxAdvancedSettings(int itemId, int accountId, bool enablePOP, - bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, - int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays) - { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; - - // place log record - TaskManager.StartTask("EXCHANGE", "UPDATE_MAILBOX_ADVANCED"); - TaskManager.ItemId = itemId; - - try - { - // load organization - Organization org = GetOrganization(itemId); - if (org == null) - return -1; - - // check package - int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) return packageCheck; - - // load account - ExchangeAccount account = GetAccount(itemId, accountId); - - // load package context - PackageContext cntx = PackageController.GetPackageContext(org.PackageId); - - int maxDiskSpace = 0; - if (cntx.Quotas.ContainsKey(Quotas.EXCHANGE2007_DISKSPACE) - && cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue > 0) - maxDiskSpace = cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue * 1024; - - if ((maxDiskSpace > 0 && - (issueWarningKB > maxDiskSpace - || prohibitSendKB > maxDiskSpace - || prohibitSendReceiveKB > maxDiskSpace || issueWarningKB == -1 || prohibitSendKB == -1 || prohibitSendReceiveKB == -1))) - return BusinessErrorCodes.ERROR_EXCHANGE_STORAGE_QUOTAS_EXCEED_HOST_VALUES; - - // get mailbox settings - int exchangeServiceId = GetExchangeServiceID(org.PackageId); - ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - - exchange.SetMailboxAdvancedSettings( - org.OrganizationId, - account.AccountName, - QuotaEnabled(cntx, Quotas.EXCHANGE2007_POP3ALLOWED) && enablePOP, - QuotaEnabled(cntx, Quotas.EXCHANGE2007_IMAPALLOWED) && enableIMAP, - QuotaEnabled(cntx, Quotas.EXCHANGE2007_OWAALLOWED) && enableOWA, - QuotaEnabled(cntx, Quotas.EXCHANGE2007_MAPIALLOWED) && enableMAPI, - QuotaEnabled(cntx, Quotas.EXCHANGE2007_ACTIVESYNCALLOWED) && enableActiveSync, - issueWarningKB, - prohibitSendKB, - prohibitSendReceiveKB, - keepDeletedItemsDays); - - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } - public static int SetMailboxManagerSettings(int itemId, int accountId, bool pmmAllowed, MailboxManagerActions action) { // check account @@ -2421,44 +2399,266 @@ namespace WebsitePanel.EnterpriseServer #endregion - #region Contacts - public static int CreateContact(int itemId, string displayName, string email) + + #region Mailbox plan + public static int SetExchangeMailboxPlan(int itemId, int accountId, int mailboxPlanId) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; + + // place log record + TaskManager.StartTask("EXCHANGE", "SET_MAILBOXPLAN"); + TaskManager.ItemId = itemId; + + try + { + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return -1; + + // check package + int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; + + // load account + ExchangeAccount account = GetAccount(itemId, accountId); + + // load package context + PackageContext cntx = PackageController.GetPackageContext(org.PackageId); + + int maxDiskSpace = -1; + int quotaUsed = 0; + if (cntx.Quotas.ContainsKey(Quotas.EXCHANGE2007_DISKSPACE) + && cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue > 0) + { + maxDiskSpace = cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue; + quotaUsed = cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaUsedValue; + } + + ExchangeMailboxPlan plan = GetExchangeMailboxPlan(itemId, mailboxPlanId); + if (maxDiskSpace != -1) + { + if ((quotaUsed + plan.MailboxSizeMB) > (maxDiskSpace)) + return BusinessErrorCodes.ERROR_EXCHANGE_STORAGE_QUOTAS_EXCEED_HOST_VALUES; + } + + // get mailbox settings + int exchangeServiceId = GetExchangeServiceID(org.PackageId); + ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); + + exchange.SetMailboxAdvancedSettings( + org.OrganizationId, + account.AccountName, + plan.EnablePOP, + plan.EnableIMAP, + plan.EnableOWA, + plan.EnableMAPI, + plan.EnableActiveSync, + (int)Math.Round((double)((plan.IssueWarningPct * plan.MailboxSizeMB * 1024) / 100)), + (int)Math.Round((double)((plan.ProhibitSendPct * plan.MailboxSizeMB * 1024) / 100)), + (int)Math.Round((double)((plan.ProhibitSendReceivePct * plan.MailboxSizeMB * 1024) / 100)), + plan.KeepDeletedItemsDays, + plan.MaxRecipients, + plan.MaxSendMessageSizeKB, + plan.MaxReceiveMessageSizeKB); + + DataProvider.SetExchangeAccountMailboxPlan(accountId, mailboxPlanId); + + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + public static List GetExchangeMailboxPlans(int itemId) + { + // place log record + TaskManager.StartTask("EXCHANGE", "GET_EXCHANGE_MAILBOXPLANS"); + TaskManager.ItemId = itemId; + + try + { + return ObjectUtils.CreateListFromDataReader( + DataProvider.GetExchangeMailboxPlans(itemId)); + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + public static ExchangeMailboxPlan GetExchangeMailboxPlan(int itemID, int mailboxPlanId) + { + + // place log record + TaskManager.StartTask("EXCHANGE", "GET_EXCHANGE_MAILBOXPLAN"); + TaskManager.ItemId = mailboxPlanId; + + try + { + return ObjectUtils.FillObjectFromDataReader( + DataProvider.GetExchangeMailboxPlan(mailboxPlanId)); + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + public static int AddExchangeMailboxPlan(int itemID, ExchangeMailboxPlan mailboxPlan) + { + // place log record + TaskManager.StartTask("EXCHANGE", "ADD_EXCHANGE_MAILBOXPLAN"); + TaskManager.ItemId = itemID; + + try + { + Organization org = GetOrganization(itemID); + if (org == null) + return -1; + + // load package context + PackageContext cntx = PackageController.GetPackageContext(org.PackageId); + + mailboxPlan.EnableActiveSync = mailboxPlan.EnableActiveSync & Convert.ToBoolean(cntx.Quotas[Quotas.EXCHANGE2007_ACTIVESYNCALLOWED].QuotaAllocatedValue); + mailboxPlan.EnableIMAP = mailboxPlan.EnableIMAP & Convert.ToBoolean(cntx.Quotas[Quotas.EXCHANGE2007_IMAPALLOWED].QuotaAllocatedValue); + mailboxPlan.EnableMAPI = mailboxPlan.EnableMAPI & Convert.ToBoolean(cntx.Quotas[Quotas.EXCHANGE2007_MAPIALLOWED].QuotaAllocatedValue); + mailboxPlan.EnableOWA = mailboxPlan.EnableOWA & Convert.ToBoolean(cntx.Quotas[Quotas.EXCHANGE2007_OWAALLOWED].QuotaAllocatedValue); + mailboxPlan.EnablePOP = mailboxPlan.EnablePOP & Convert.ToBoolean(cntx.Quotas[Quotas.EXCHANGE2007_POP3ALLOWED].QuotaAllocatedValue); + if (mailboxPlan.KeepDeletedItemsDays > cntx.Quotas[Quotas.EXCHANGE2007_KEEPDELETEDITEMSDAYS].QuotaAllocatedValue) + mailboxPlan.KeepDeletedItemsDays = cntx.Quotas[Quotas.EXCHANGE2007_KEEPDELETEDITEMSDAYS].QuotaAllocatedValue; + if (cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue != -1) + if (mailboxPlan.MailboxSizeMB > cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue) + mailboxPlan.MailboxSizeMB = cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue; + if (mailboxPlan.MaxReceiveMessageSizeKB > cntx.Quotas[Quotas.EXCHANGE2007_MAXRECEIVEMESSAGESIZEKB].QuotaAllocatedValue) + mailboxPlan.MaxReceiveMessageSizeKB = cntx.Quotas[Quotas.EXCHANGE2007_MAXRECEIVEMESSAGESIZEKB].QuotaAllocatedValue; + if (mailboxPlan.MaxSendMessageSizeKB > cntx.Quotas[Quotas.EXCHANGE2007_MAXSENDMESSAGESIZEKB].QuotaAllocatedValue) + mailboxPlan.MaxSendMessageSizeKB = cntx.Quotas[Quotas.EXCHANGE2007_MAXSENDMESSAGESIZEKB].QuotaAllocatedValue; + if (cntx.Quotas[Quotas.EXCHANGE2007_MAXRECIPIENTS].QuotaAllocatedValue != -1) + if (mailboxPlan.MaxRecipients > cntx.Quotas[Quotas.EXCHANGE2007_MAXRECIPIENTS].QuotaAllocatedValue) + mailboxPlan.MaxRecipients = cntx.Quotas[Quotas.EXCHANGE2007_MAXRECIPIENTS].QuotaAllocatedValue; + if (Convert.ToBoolean(cntx.Quotas[Quotas.EXCHANGE2007_ISCONSUMER].QuotaAllocatedValue)) mailboxPlan.HideFromAddressBook = true; + + return DataProvider.AddExchangeMailboxPlan(itemID, mailboxPlan.MailboxPlan, mailboxPlan.EnableActiveSync, mailboxPlan.EnableIMAP, mailboxPlan.EnableMAPI, mailboxPlan.EnableOWA, mailboxPlan.EnablePOP, + mailboxPlan.IsDefault, mailboxPlan.IssueWarningPct, mailboxPlan.KeepDeletedItemsDays, mailboxPlan.MailboxSizeMB, mailboxPlan.MaxReceiveMessageSizeKB, mailboxPlan.MaxRecipients, + mailboxPlan.MaxSendMessageSizeKB, mailboxPlan.ProhibitSendPct, mailboxPlan.ProhibitSendReceivePct, mailboxPlan.HideFromAddressBook); + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + + } + + public static int DeleteExchangeMailboxPlan(int itemID, int mailboxPlanId) + { + TaskManager.StartTask("EXCHANGE", "DELETE_EXCHANGE_MAILBOXPLAN"); + TaskManager.ItemId = itemID; + + try + { + DataProvider.DeleteExchangeMailboxPlan(mailboxPlanId); + + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + + } + + public static void SetOrganizationDefaultExchangeMailboxPlan(int itemId, int mailboxPlanId) + { + TaskManager.StartTask("EXCHANGE", "SET_EXCHANGE_MAILBOXPLAN"); + TaskManager.ItemId = itemId; + + try + { + DataProvider.SetOrganizationDefaultExchangeMailboxPlan(itemId, mailboxPlanId); + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + + } + + + + #endregion + + + #region Contacts + public static int CreateContact(int itemId, string displayName, string email) { //if (EmailAddressExists(email)) - // return BusinessErrorCodes.ERROR_EXCHANGE_EMAIL_EXISTS; - + // return BusinessErrorCodes.ERROR_EXCHANGE_EMAIL_EXISTS; + // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; // check mailbox quota - OrganizationStatistics orgStats = GetOrganizationStatistics(itemId); - if (orgStats.AllocatedContacts > -1 - && orgStats.CreatedContacts >= orgStats.AllocatedContacts) - return BusinessErrorCodes.ERROR_EXCHANGE_CONTACTS_QUOTA_LIMIT; + OrganizationStatistics orgStats = GetOrganizationStatistics(itemId); + if (orgStats.AllocatedContacts > -1 + && orgStats.CreatedContacts >= orgStats.AllocatedContacts) + return BusinessErrorCodes.ERROR_EXCHANGE_CONTACTS_QUOTA_LIMIT; - // place log record - TaskManager.StartTask("EXCHANGE", "CREATE_CONTACT"); - TaskManager.ItemId = itemId; + // place log record + TaskManager.StartTask("EXCHANGE", "CREATE_CONTACT"); + TaskManager.ItemId = itemId; - try - { - // load organization - Organization org = GetOrganization(itemId); + try + { - // check package - int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) return packageCheck; + displayName = displayName.Trim(); + email = email.Trim(); - string name = email; - int idx = email.IndexOf("@"); - if (idx > -1) - name = email.Substring(0, idx); + // load organization + Organization org = GetOrganization(itemId); - string accountName = BuildAccountName(org.OrganizationId, name); + // check package + int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; - // add contact + string name = email; + int idx = email.IndexOf("@"); + if (idx > -1) + name = email.Substring(0, idx); + + string accountName = BuildAccountName(org.OrganizationId, name); + + // add contact int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); @@ -2469,30 +2669,32 @@ namespace WebsitePanel.EnterpriseServer PackageController.UpdatePackageItem(org); } - + exchange.CreateContact( - org.OrganizationId, - org.DistinguishedName, - displayName, - accountName, + org.OrganizationId, + org.DistinguishedName, + displayName, + accountName, email, org.DefaultDomain); - // add meta-item - int accountId = AddAccount(itemId, ExchangeAccountType.Contact, accountName, - displayName, email, false, - 0, "", null); + ExchangeContact contact = exchange.GetContactGeneralSettings(accountName); - return accountId; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + // add meta-item + int accountId = AddAccount(itemId, ExchangeAccountType.Contact, accountName, + displayName, email, false, + 0, contact.SAMAccountName, null, 0, null); + + return accountId; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } public static int DeleteContact(int itemId, int accountId) { @@ -2593,75 +2795,80 @@ namespace WebsitePanel.EnterpriseServer string businessPhone, string fax, string homePhone, string mobilePhone, string pager, string webPage, string notes, int useMapiRichTextFormat) { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; - // place log record - TaskManager.StartTask("EXCHANGE", "UPDATE_CONTACT_GENERAL"); - TaskManager.ItemId = itemId; + // place log record + TaskManager.StartTask("EXCHANGE", "UPDATE_CONTACT_GENERAL"); + TaskManager.ItemId = itemId; - try - { - // load organization - Organization org = GetOrganization(itemId); - if (org == null) - return -1; + try + { + displayName = displayName.Trim(); + emailAddress = emailAddress.Trim(); + firstName = firstName.Trim(); + lastName = lastName.Trim(); - // check package - int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) return packageCheck; + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return -1; - // load account - ExchangeAccount account = GetAccount(itemId, accountId); + // check package + int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; - // get mailbox settings + // load account + ExchangeAccount account = GetAccount(itemId, accountId); + + // get mailbox settings int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - - exchange.SetContactGeneralSettings( - account.AccountName, - displayName, - emailAddress, - hideAddressBook, - firstName, - initials, - lastName, - address, - city, - state, - zip, - country, - jobTitle, - company, - department, - office, - managerAccountName, - businessPhone, - fax, - homePhone, - mobilePhone, - pager, - webPage, - notes, + + exchange.SetContactGeneralSettings( + account.AccountName, + displayName, + emailAddress, + hideAddressBook, + firstName, + initials, + lastName, + address, + city, + state, + zip, + country, + jobTitle, + company, + department, + office, + managerAccountName, + businessPhone, + fax, + homePhone, + mobilePhone, + pager, + webPage, + notes, useMapiRichTextFormat, org.DefaultDomain); - // update account - account.DisplayName = displayName; - account.PrimaryEmailAddress = emailAddress; - UpdateAccount(account); + // update account + account.DisplayName = displayName; + account.PrimaryEmailAddress = emailAddress; + UpdateAccount(account); - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } public static ExchangeContact GetContactMailFlowSettings(int itemId, int accountId) { @@ -2754,40 +2961,44 @@ namespace WebsitePanel.EnterpriseServer #region Distribution Lists public static int CreateDistributionList(int itemId, string displayName, string name, string domain, int managerId) { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; - // check mailbox quota - OrganizationStatistics orgStats = GetOrganizationStatistics(itemId); - if (orgStats.AllocatedDistributionLists > -1 - && orgStats.CreatedDistributionLists >= orgStats.AllocatedDistributionLists) - return BusinessErrorCodes.ERROR_EXCHANGE_DLISTS_QUOTA_LIMIT; + // check mailbox quota + OrganizationStatistics orgStats = GetOrganizationStatistics(itemId); + if (orgStats.AllocatedDistributionLists > -1 + && orgStats.CreatedDistributionLists >= orgStats.AllocatedDistributionLists) + return BusinessErrorCodes.ERROR_EXCHANGE_DLISTS_QUOTA_LIMIT; - // place log record - TaskManager.StartTask("EXCHANGE", "CREATE_DISTR_LIST"); - TaskManager.ItemId = itemId; + // place log record + TaskManager.StartTask("EXCHANGE", "CREATE_DISTR_LIST"); + TaskManager.ItemId = itemId; - try - { - // e-mail - string email = name + "@" + domain; + try + { + displayName = displayName.Trim(); + name = name.Trim(); + domain = domain.Trim(); - // check e-mail - if (EmailAddressExists(email)) - return BusinessErrorCodes.ERROR_EXCHANGE_EMAIL_EXISTS; + // e-mail + string email = name + "@" + domain; - // load organization - Organization org = GetOrganization(itemId); + // check e-mail + if (EmailAddressExists(email)) + return BusinessErrorCodes.ERROR_EXCHANGE_EMAIL_EXISTS; - // check package - int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) return packageCheck; + // load organization + Organization org = GetOrganization(itemId); - string accountName = BuildAccountName(org.OrganizationId, name); + // check package + int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; - // add account - // add contact + string accountName = BuildAccountName(org.OrganizationId, name); + + // add account + // add contact int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); @@ -2799,34 +3010,41 @@ namespace WebsitePanel.EnterpriseServer PackageController.UpdatePackageItem(org); } - OrganizationUser manager = OrganizationController.GetAccount(itemId, managerId); - exchange.CreateDistributionList( - org.OrganizationId, - org.DistinguishedName, - displayName, - accountName, - name, - domain, manager.AccountName); + OrganizationUser manager = OrganizationController.GetAccount(itemId, managerId); - // add meta-item - int accountId = AddAccount(itemId, ExchangeAccountType.DistributionList, accountName, - displayName, email, false, - 0, "", null); + List addressLists = new List(); + addressLists.Add(org.GlobalAddressList); + addressLists.Add(org.AddressList); - // register email address - AddAccountEmailAddress(accountId, email); + exchange.CreateDistributionList( + org.OrganizationId, + org.DistinguishedName, + displayName, + accountName, + name, + domain, manager.AccountName, addressLists.ToArray()); - return accountId; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + ExchangeDistributionList dl = exchange.GetDistributionListGeneralSettings(accountName); + + // add meta-item + int accountId = AddAccount(itemId, ExchangeAccountType.DistributionList, email, + displayName, email, false, + 0, dl.SAMAccountName, null, 0, null); + + // register email address + AddAccountEmailAddress(accountId, email); + + return accountId; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } public static int DeleteDistributionList(int itemId, int accountId) { @@ -2923,55 +3141,62 @@ namespace WebsitePanel.EnterpriseServer bool hideAddressBook, string managerAccount, string[] memberAccounts, string notes) { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; - // place log record - TaskManager.StartTask("EXCHANGE", "UPDATE_DISTR_LIST_GENERAL"); - TaskManager.ItemId = itemId; + // place log record + TaskManager.StartTask("EXCHANGE", "UPDATE_DISTR_LIST_GENERAL"); + TaskManager.ItemId = itemId; - try - { - // load organization - Organization org = GetOrganization(itemId); - if (org == null) - return -1; + try + { + displayName = displayName.Trim(); - // check package - int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) return packageCheck; + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return -1; - // load account - ExchangeAccount account = GetAccount(itemId, accountId); + // check package + int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; - // get mailbox settings + // load account + ExchangeAccount account = GetAccount(itemId, accountId); + + // get mailbox settings int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - - exchange.SetDistributionListGeneralSettings( - account.AccountName, - displayName, - hideAddressBook, - managerAccount, - memberAccounts, - notes); - // update account - account.DisplayName = displayName; - UpdateAccount(account); + List addressLists = new List(); + addressLists.Add(org.GlobalAddressList); + addressLists.Add(org.AddressList); - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + exchange.SetDistributionListGeneralSettings( + account.AccountName, + displayName, + hideAddressBook, + managerAccount, + memberAccounts, + notes, + addressLists.ToArray()); + + // update account + account.DisplayName = displayName; + UpdateAccount(account); + + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } public static ExchangeDistributionList GetDistributionListMailFlowSettings(int itemId, int accountId) { @@ -3017,48 +3242,54 @@ namespace WebsitePanel.EnterpriseServer public static int SetDistributionListMailFlowSettings(int itemId, int accountId, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; - // place log record - TaskManager.StartTask("EXCHANGE", "UPDATE_DISTR_LIST_MAILFLOW"); - TaskManager.ItemId = itemId; + // place log record + TaskManager.StartTask("EXCHANGE", "UPDATE_DISTR_LIST_MAILFLOW"); + TaskManager.ItemId = itemId; - try - { - // load organization - Organization org = GetOrganization(itemId); - if (org == null) - return -1; + try + { + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return -1; - // check package - int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) return packageCheck; + // check package + int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; - // load account - ExchangeAccount account = GetAccount(itemId, accountId); + // load account + ExchangeAccount account = GetAccount(itemId, accountId); - // get mailbox settings + // get mailbox settings int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - - exchange.SetDistributionListMailFlowSettings(account.AccountName, - acceptAccounts, - rejectAccounts, - requireSenderAuthentication); - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + List addressLists = new List(); + addressLists.Add(org.GlobalAddressList); + addressLists.Add(org.AddressList); + + + exchange.SetDistributionListMailFlowSettings(account.AccountName, + acceptAccounts, + rejectAccounts, + requireSenderAuthentication, + addressLists.ToArray()); + + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } public static ExchangeEmailAddress[] GetDistributionListEmailAddresses(int itemId, int accountId) { @@ -3082,152 +3313,165 @@ namespace WebsitePanel.EnterpriseServer public static int AddDistributionListEmailAddress(int itemId, int accountId, string emailAddress) { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; - // place log record - TaskManager.StartTask("EXCHANGE", "ADD_DISTR_LIST_ADDRESS"); - TaskManager.ItemId = itemId; + // place log record + TaskManager.StartTask("EXCHANGE", "ADD_DISTR_LIST_ADDRESS"); + TaskManager.ItemId = itemId; - try - { - // check - if (EmailAddressExists(emailAddress)) - return BusinessErrorCodes.ERROR_EXCHANGE_EMAIL_EXISTS; + try + { + // check + if (EmailAddressExists(emailAddress)) + return BusinessErrorCodes.ERROR_EXCHANGE_EMAIL_EXISTS; - // load organization - Organization org = GetOrganization(itemId); - if (org == null) - return -1; + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return -1; - // check package - int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) return packageCheck; + // check package + int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; - // load account - ExchangeAccount account = GetAccount(itemId, accountId); + // load account + ExchangeAccount account = GetAccount(itemId, accountId); - // add e-mail - AddAccountEmailAddress(accountId, emailAddress); + // add e-mail + AddAccountEmailAddress(accountId, emailAddress); - // update e-mail addresses + // update e-mail addresses int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - - exchange.SetDistributionListEmailAddresses( - account.AccountName, - GetAccountSimpleEmailAddresses(itemId, accountId)); - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + List addressLists = new List(); + addressLists.Add(org.GlobalAddressList); + addressLists.Add(org.AddressList); + + exchange.SetDistributionListEmailAddresses( + account.AccountName, + GetAccountSimpleEmailAddresses(itemId, accountId), addressLists.ToArray()); + + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } public static int SetDistributionListPrimaryEmailAddress(int itemId, int accountId, string emailAddress) { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; - // place log record - TaskManager.StartTask("EXCHANGE", "SET_PRIMARY_DISTR_LIST_ADDRESS"); - TaskManager.ItemId = itemId; + // place log record + TaskManager.StartTask("EXCHANGE", "SET_PRIMARY_DISTR_LIST_ADDRESS"); + TaskManager.ItemId = itemId; - try - { - // get account - ExchangeAccount account = GetAccount(itemId, accountId); - account.PrimaryEmailAddress = emailAddress; + try + { + // get account + ExchangeAccount account = GetAccount(itemId, accountId); + account.PrimaryEmailAddress = emailAddress; - // update exchange - Organization org = GetOrganization(itemId); - if (org == null) - return -1; + // update exchange + Organization org = GetOrganization(itemId); + if (org == null) + return -1; - // check package - int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) return packageCheck; + // check package + int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - - exchange.SetDistributionListPrimaryEmailAddress( - account.AccountName, - emailAddress); - // save account - UpdateAccount(account); + List addressLists = new List(); + addressLists.Add(org.GlobalAddressList); + addressLists.Add(org.AddressList); - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + exchange.SetDistributionListPrimaryEmailAddress( + account.AccountName, + emailAddress, + addressLists.ToArray()); + + // save account + UpdateAccount(account); + + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } public static int DeleteDistributionListEmailAddresses(int itemId, int accountId, string[] emailAddresses) { - // check account - int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); - if (accountCheck < 0) return accountCheck; + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; - // place log record - TaskManager.StartTask("EXCHANGE", "DELETE_DISTR_LIST_ADDRESSES"); - TaskManager.ItemId = itemId; + // place log record + TaskManager.StartTask("EXCHANGE", "DELETE_DISTR_LIST_ADDRESSES"); + TaskManager.ItemId = itemId; - try - { - // get account - ExchangeAccount account = GetAccount(itemId, accountId); + try + { + // get account + ExchangeAccount account = GetAccount(itemId, accountId); - // delete e-mail addresses - List toDelete = new List(); - foreach (string emailAddress in emailAddresses) - { - if (String.Compare(account.PrimaryEmailAddress, emailAddress, true) != 0) - toDelete.Add(emailAddress); - } + // delete e-mail addresses + List toDelete = new List(); + foreach (string emailAddress in emailAddresses) + { + if (String.Compare(account.PrimaryEmailAddress, emailAddress, true) != 0) + toDelete.Add(emailAddress); + } - // delete from meta-base - DeleteAccountEmailAddresses(accountId, toDelete.ToArray()); + // delete from meta-base + DeleteAccountEmailAddresses(accountId, toDelete.ToArray()); - // delete from Exchange - Organization org = GetOrganization(itemId); - if (org == null) - return -1; + // delete from Exchange + Organization org = GetOrganization(itemId); + if (org == null) + return -1; - // update e-mail addresses + // update e-mail addresses int exchangeServiceId = GetExchangeServiceID(org.PackageId); ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId); - - exchange.SetDistributionListEmailAddresses( - account.AccountName, - GetAccountSimpleEmailAddresses(itemId, accountId)); - return 0; - } - catch (Exception ex) - { - throw TaskManager.WriteError(ex); - } - finally - { - TaskManager.CompleteTask(); - } - } + List addressLists = new List(); + addressLists.Add(org.GlobalAddressList); + addressLists.Add(org.AddressList); + + exchange.SetDistributionListEmailAddresses( + account.AccountName, + GetAccountSimpleEmailAddresses(itemId, accountId), addressLists.ToArray()); + + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } public static ResultObject SetDistributionListPermissions(int itemId, int accountId, string[] sendAsAccounts, string[] sendOnBehalfAccounts) @@ -3273,8 +3517,12 @@ namespace WebsitePanel.EnterpriseServer try { + List addressLists = new List(); + addressLists.Add(org.GlobalAddressList); + addressLists.Add(org.AddressList); + exchange.SetDistributionListPermissions(org.OrganizationId, account.AccountName, sendAsAccounts, - sendOnBehalfAccounts); + sendOnBehalfAccounts, addressLists.ToArray()); } catch(Exception ex) { @@ -3422,7 +3670,7 @@ namespace WebsitePanel.EnterpriseServer // add meta-item int accountId = AddAccount(itemId, ExchangeAccountType.PublicFolder, accountName, folderPath, email, mailEnabled, - 0, "", null); + 0, "", null, 0 , null); // register email address if(mailEnabled) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs index d081ec48..07672218 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HostedSolution/OrganizationController.cs @@ -633,7 +633,7 @@ namespace WebsitePanel.EnterpriseServer } - private static Organizations GetOrganizationProxy(int serviceId) + public static Organizations GetOrganizationProxy(int serviceId) { Organizations ws = new Organizations(); ServiceProviderProxy.Init(ws, serviceId); @@ -710,9 +710,6 @@ namespace WebsitePanel.EnterpriseServer org.Id = 1; org.OrganizationId = "fabrikam"; org.Name = "Fabrikam Inc"; - org.IssueWarningKB = 150000; - org.ProhibitSendKB = 170000; - org.ProhibitSendReceiveKB = 190000; org.KeepDeletedItemsDays = 14; org.GlobalAddressList = "FabrikamGAL"; return org; @@ -980,8 +977,17 @@ namespace WebsitePanel.EnterpriseServer OrganizationUsersPaged result = new OrganizationUsersPaged(); result.RecordsCount = (int)ds.Tables[0].Rows[0][0]; + List Tmpaccounts = new List(); + ObjectUtils.FillCollectionFromDataView(Tmpaccounts, ds.Tables[1].DefaultView); + result.PageUsers = Tmpaccounts.ToArray(); + List accounts = new List(); - ObjectUtils.FillCollectionFromDataView(accounts, ds.Tables[1].DefaultView); + + foreach (OrganizationUser user in Tmpaccounts.ToArray()) + { + accounts.Add(GetUserGeneralSettings(itemId, user.AccountId)); + } + result.PageUsers = accounts.ToArray(); return result; } @@ -993,22 +999,23 @@ namespace WebsitePanel.EnterpriseServer return DataProvider.ExchangeAccountEmailAddressExists(emailAddress); } - - private static int AddOrganizationUser(int itemId, string accountName, string displayName, string email, string accountPassword) - { + + private static int AddOrganizationUser(int itemId, string accountName, string displayName, string email, string sAMAccountName, string accountPassword, string subscriberNumber) + { return DataProvider.AddExchangeAccount(itemId, (int)ExchangeAccountType.User, accountName, displayName, email, false, string.Empty, - string.Empty, CryptoUtils.Encrypt(accountPassword)); - - } + sAMAccountName, CryptoUtils.Encrypt(accountPassword), 0, subscriberNumber.Trim()); + + } public static string GetAccountName(string loginName) { - string []parts = loginName.Split('@'); - return parts != null && parts.Length > 1 ? parts[0] : loginName; + //string []parts = loginName.Split('@'); + //return parts != null && parts.Length > 1 ? parts[0] : loginName; + return loginName; } - public static int CreateUser(int itemId, string displayName, string name, string domain, string password, bool enabled, bool sendNotification, string to, out string accountName) + public static int CreateUser(int itemId, string displayName, string name, string domain, string password, string subscriberNumber, bool enabled, bool sendNotification, string to, out string accountName) { if (string.IsNullOrEmpty(displayName)) throw new ArgumentNullException("displayName"); @@ -1023,55 +1030,171 @@ namespace WebsitePanel.EnterpriseServer throw new ArgumentNullException("password"); accountName = string.Empty; - + // check account int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); if (accountCheck < 0) return accountCheck; - + // place log record TaskManager.StartTask("ORGANIZATION", "CREATE_USER"); TaskManager.ItemId = itemId; + TaskManager.Write("Organization ID :" + itemId); + TaskManager.Write("name :" + name); + TaskManager.Write("domain :" + domain); + TaskManager.Write("subscriberNumber :" + subscriberNumber); - // e-mail - string email = name + "@" + domain; + int userId = -1; - if (EmailAddressExists(email)) - return BusinessErrorCodes.ERROR_EXCHANGE_EMAIL_EXISTS; - - // load organization - Organization org = GetOrganization(itemId); - if (org == null) - return -1; - - // check package - int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); - if (packageCheck < 0) return packageCheck; - - int errorCode; - if (!CheckUserQuota(org.Id, out errorCode)) - return errorCode; - - - Organizations orgProxy = GetOrganizationProxy(org.ServiceId); - - string upn = string.Format("{0}@{1}", name, domain); - accountName = BuildAccountName(org.OrganizationId, name); - orgProxy.CreateUser(org.OrganizationId, accountName, displayName, upn, password, enabled); - - int userId = AddOrganizationUser(itemId, accountName, displayName, email, password); - - // register email address - AddAccountEmailAddress(userId, email); - - if (sendNotification) + try { - SendSummaryLetter(org.Id, userId, true, to, ""); + displayName = displayName.Trim(); + name = name.Trim(); + domain = domain.Trim(); + + // e-mail + string email = name + "@" + domain; + + if (EmailAddressExists(email)) + return BusinessErrorCodes.ERROR_EXCHANGE_EMAIL_EXISTS; + + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return -1; + + // check package + int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; + + int errorCode; + if (!CheckUserQuota(org.Id, out errorCode)) + return errorCode; + + + Organizations orgProxy = GetOrganizationProxy(org.ServiceId); + + string upn = string.Format("{0}@{1}", name, domain); + string sAMAccountName = BuildAccountName(org.OrganizationId, name); + + TaskManager.Write("accountName :" + sAMAccountName); + TaskManager.Write("upn :" + upn); + + if (orgProxy.CreateUser(org.OrganizationId, sAMAccountName, displayName, upn, password, enabled) == 0) + { + OrganizationUser retUser = orgProxy.GetUserGeneralSettings(upn, org.OrganizationId); + TaskManager.Write("sAMAccountName :" + retUser.DomainUserName); + + userId = AddOrganizationUser(itemId, upn, displayName, email, retUser.DomainUserName, password, subscriberNumber); + accountName = upn; + + // register email address + AddAccountEmailAddress(userId, email); + + if (sendNotification) + { + SendSummaryLetter(org.Id, userId, true, to, ""); + } + } + else + { + TaskManager.WriteError("Failed to create user"); + } } + catch (Exception ex) + { + TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + + return userId; + } + + + + public static int ImportUser(int itemId, string accountName, string displayName, string name, string domain, string password, string subscriberNumber) + { + if (string.IsNullOrEmpty(accountName)) + throw new ArgumentNullException("accountName"); + + if (string.IsNullOrEmpty(displayName)) + throw new ArgumentNullException("displayName"); + + if (string.IsNullOrEmpty(name)) + throw new ArgumentNullException("name"); + + if (string.IsNullOrEmpty(domain)) + throw new ArgumentNullException("domain"); + + if (string.IsNullOrEmpty(password)) + throw new ArgumentNullException("password"); + + + // place log record + TaskManager.StartTask("ORGANIZATION", "IMPORT_USER"); + TaskManager.ItemId = itemId; + TaskManager.Write("Organization ID :" + itemId); + TaskManager.Write("account :" + accountName); + TaskManager.Write("name :" + name); + TaskManager.Write("domain :" + domain); + + int userId = -1; + + try + { + accountName = accountName.Trim(); + displayName = displayName.Trim(); + name = name.Trim(); + domain = domain.Trim(); + + // e-mail + string email = name + "@" + domain; + + if (EmailAddressExists(email)) + return BusinessErrorCodes.ERROR_EXCHANGE_EMAIL_EXISTS; + + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return -1; + + // check package + int packageCheck = SecurityContext.CheckPackage(org.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) return packageCheck; + + int errorCode; + if (!CheckUserQuota(org.Id, out errorCode)) + return errorCode; + + Organizations orgProxy = GetOrganizationProxy(org.ServiceId); + + string upn = string.Format("{0}@{1}", name, domain); + TaskManager.Write("upn :" + upn); + + OrganizationUser retUser = orgProxy.GetUserGeneralSettings(accountName, org.OrganizationId); + + TaskManager.Write("sAMAccountName :" + retUser.DomainUserName); + + userId = AddOrganizationUser(itemId, accountName, displayName, email, retUser.DomainUserName, password, subscriberNumber); + + AddAccountEmailAddress(userId, email); + + } + catch (Exception ex) + { + TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + return userId; } - private static void AddAccountEmailAddress(int accountId, string emailAddress) { @@ -1080,28 +1203,40 @@ namespace WebsitePanel.EnterpriseServer private static string BuildAccountName(string orgId, string name) { - int maxLen = 19 - orgId.Length; - - // try to choose name - int i = 0; - while (true) + string accountName = name = name.Replace(" ", ""); + string CounterStr = "00000"; + int counter = 0; + bool bFound = false; + do { - string num = i > 0 ? i.ToString() : ""; - int len = maxLen - num.Length; + accountName = genSamLogin(name, CounterStr); - if (name.Length > len) - name = name.Substring(0, len); + if (!AccountExists(accountName)) bFound = true; - string accountName = name + num + "_" + orgId; - - // check if already exists - if (!AccountExists(accountName)) - return accountName; - - i++; + CounterStr = counter.ToString("d5"); + counter++; } + while (!bFound); + + return accountName; } + private static string genSamLogin(string login, string strCounter) + { + int maxLogin = 20; + int fullLen = login.Length + strCounter.Length; + if (fullLen <= maxLogin) + return login + strCounter; + else + { + if (login.Length - (fullLen - maxLogin) > 0) + return login.Substring(0, login.Length - (fullLen - maxLogin)) + strCounter; + else return strCounter; // ???? + } + + } + + private static bool AccountExists(string accountName) { return DataProvider.ExchangeAccountExists(accountName); @@ -1180,6 +1315,18 @@ namespace WebsitePanel.EnterpriseServer return account; } + public static OrganizationUser GetAccountByAccountName(int itemId, string AccountName) + { + OrganizationUser account = ObjectUtils.FillObjectFromDataReader( + DataProvider.GetExchangeAccountByAccountName(itemId, AccountName)); + + if (account == null) + return null; + + return account; + } + + private static void DeleteUserFromMetabase(int itemId, int accountId) { // try to get organization @@ -1217,11 +1364,16 @@ namespace WebsitePanel.EnterpriseServer string accountName = GetAccountName(account.AccountName); - OrganizationUser retUser = orgProxy.GeUserGeneralSettings(accountName, org.OrganizationId); + OrganizationUser retUser = orgProxy.GetUserGeneralSettings(accountName, org.OrganizationId); retUser.AccountId = accountId; retUser.AccountName = account.AccountName; retUser.PrimaryEmailAddress = account.PrimaryEmailAddress; retUser.AccountType = account.AccountType; + retUser.CrmUserId = CRMController.GetCrmUserId(accountId); + retUser.IsOCSUser = DataProvider.CheckOCSUserExists(accountId); + //retUser.IsLyncUser = DataProvider.CheckLyncUserExists(accountId); + retUser.IsBlackBerryUser = BlackBerryController.CheckBlackBerryUserExists(accountId); + retUser.SubscriberNumber = account.SubscriberNumber; return retUser; } @@ -1240,7 +1392,7 @@ namespace WebsitePanel.EnterpriseServer string lastName, string address, string city, string state, string zip, string country, string jobTitle, string company, string department, string office, string managerAccountName, string businessPhone, string fax, string homePhone, string mobilePhone, string pager, - string webPage, string notes, string externalEmail) + string webPage, string notes, string externalEmail, string subscriberNumber) { // check account @@ -1253,6 +1405,10 @@ namespace WebsitePanel.EnterpriseServer try { + displayName = displayName.Trim(); + firstName = firstName.Trim(); + lastName = lastName.Trim(); + // load organization Organization org = GetOrganization(itemId); if (org == null) @@ -1303,6 +1459,7 @@ namespace WebsitePanel.EnterpriseServer // update account account.DisplayName = displayName; + account.SubscriberNumber = subscriberNumber; //account. if (!String.IsNullOrEmpty(password)) @@ -1329,7 +1486,8 @@ namespace WebsitePanel.EnterpriseServer { DataProvider.UpdateExchangeAccount(account.AccountId, account.AccountName, account.AccountType, account.DisplayName, account.PrimaryEmailAddress, account.MailEnabledPublicFolder, - account.MailboxManagerActions.ToString(), account.SamAccountName, account.AccountPassword); + account.MailboxManagerActions.ToString(), account.SamAccountName, account.AccountPassword, account.MailboxPlanId, + (string.IsNullOrEmpty(account.SubscriberNumber) ? null : account.SubscriberNumber.Trim())); } @@ -1377,11 +1535,58 @@ namespace WebsitePanel.EnterpriseServer } #endregion - return ObjectUtils.CreateListFromDataReader( - DataProvider.SearchOrganizationAccounts(SecurityContext.User.UserId, itemId, - filterColumn, filterValue, sortColumn, includeMailboxes)); + List Tmpaccounts = ObjectUtils.CreateListFromDataReader( + DataProvider.SearchOrganizationAccounts(SecurityContext.User.UserId, itemId, + filterColumn, filterValue, sortColumn, includeMailboxes)); + + List Accounts = new List(); + + foreach (OrganizationUser user in Tmpaccounts.ToArray()) + { + Accounts.Add(GetUserGeneralSettings(itemId, user.AccountId)); + } + + return Accounts; } + public static int GetAccountIdByUserPrincipalName(int itemId, string userPrincipalName) + { + // place log record + TaskManager.StartTask("ORGANIZATION", "GET_ACCOUNT_BYUPN"); + TaskManager.ItemId = itemId; + + int accounId = -1; + + try + { + // load organization + Organization org = GetOrganization(itemId); + if (org == null) + return 0; + + // get samaccountName + //Organizations orgProxy = GetOrganizationProxy(org.ServiceId); + //string accountName = orgProxy.GetSamAccountNameByUserPrincipalName(org.OrganizationId, userPrincipalName); + + // load account + OrganizationUser account = GetAccountByAccountName(itemId, userPrincipalName); + + if (account != null) + accounId = account.AccountId; + + return accounId; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + #endregion public static List GetOrganizationDomains(int itemId) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esExchangeServer.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esExchangeServer.asmx.cs index 984bbd28..41fbd9d8 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esExchangeServer.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esExchangeServer.asmx.cs @@ -46,80 +46,81 @@ namespace WebsitePanel.EnterpriseServer [ToolboxItem(false)] public class esExchangeServer : WebService { - #region Organizations - [WebMethod] - public DataSet GetRawExchangeOrganizationsPaged(int packageId, bool recursive, - string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) - { - return ExchangeServerController.GetRawExchangeOrganizationsPaged(packageId, recursive, - filterColumn, filterValue, sortColumn, startRow, maximumRows); - } + #region Organizations + [WebMethod] + public DataSet GetRawExchangeOrganizationsPaged(int packageId, bool recursive, + string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { + return ExchangeServerController.GetRawExchangeOrganizationsPaged(packageId, recursive, + filterColumn, filterValue, sortColumn, startRow, maximumRows); + } - [WebMethod] - public OrganizationsPaged GetExchangeOrganizationsPaged(int packageId, bool recursive, - string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) - { - return ExchangeServerController.GetExchangeOrganizationsPaged(packageId, recursive, - filterColumn, filterValue, sortColumn, startRow, maximumRows); - } + [WebMethod] + public OrganizationsPaged GetExchangeOrganizationsPaged(int packageId, bool recursive, + string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { + return ExchangeServerController.GetExchangeOrganizationsPaged(packageId, recursive, + filterColumn, filterValue, sortColumn, startRow, maximumRows); + } - [WebMethod] - public List GetExchangeOrganizations(int packageId, bool recursive) - { - return ExchangeServerController.GetExchangeOrganizations(packageId, recursive); - } + [WebMethod] + public List GetExchangeOrganizations(int packageId, bool recursive) + { + return ExchangeServerController.GetExchangeOrganizations(packageId, recursive); + } - [WebMethod] - public Organization GetOrganization(int itemId) - { - return ExchangeServerController.GetOrganization(itemId); - } + [WebMethod] + public Organization GetOrganization(int itemId) + { + return ExchangeServerController.GetOrganization(itemId); + } - [WebMethod] - public OrganizationStatistics GetOrganizationStatistics(int itemId) - { - return ExchangeServerController.GetOrganizationStatistics(itemId); - } + [WebMethod] + public OrganizationStatistics GetOrganizationStatistics(int itemId) + { + return ExchangeServerController.GetOrganizationStatistics(itemId); + } - - [WebMethod] - public int DeleteOrganization(int itemId) - { - return ExchangeServerController.DeleteOrganization(itemId); - } - [WebMethod] - public Organization GetOrganizationStorageLimits(int itemId) - { - return ExchangeServerController.GetOrganizationStorageLimits(itemId); - } + [WebMethod] + public int DeleteOrganization(int itemId) + { + return ExchangeServerController.DeleteOrganization(itemId); + } - [WebMethod] - public int SetOrganizationStorageLimits(int itemId, int issueWarningKB, int prohibitSendKB, - int prohibitSendReceiveKB, int keepDeletedItemsDays, bool applyToMailboxes) - { - return ExchangeServerController.SetOrganizationStorageLimits(itemId, issueWarningKB, prohibitSendKB, - prohibitSendReceiveKB, keepDeletedItemsDays, applyToMailboxes); - } + [WebMethod] + public Organization GetOrganizationStorageLimits(int itemId) + { + return ExchangeServerController.GetOrganizationStorageLimits(itemId); + } - [WebMethod] - public ExchangeItemStatistics[] GetMailboxesStatistics(int itemId) - { - return ExchangeServerController.GetMailboxesStatistics(itemId); - } + [WebMethod] + public int SetOrganizationStorageLimits(int itemId, int issueWarningKB, int prohibitSendKB, + int prohibitSendReceiveKB, int keepDeletedItemsDays, bool applyToMailboxes) + { + return ExchangeServerController.SetOrganizationStorageLimits(itemId, issueWarningKB, prohibitSendKB, + prohibitSendReceiveKB, keepDeletedItemsDays, applyToMailboxes); + } - [WebMethod] - public ExchangeItemStatistics[] GetPublicFoldersStatistics(int itemId) - { - return ExchangeServerController.GetPublicFoldersStatistics(itemId); - } + [WebMethod] + public ExchangeItemStatistics[] GetMailboxesStatistics(int itemId) + { + return ExchangeServerController.GetMailboxesStatistics(itemId); + } - [WebMethod] - public int CalculateOrganizationDiskspace(int itemId) - { - return ExchangeServerController.CalculateOrganizationDiskspace(itemId); - } + [WebMethod] + public ExchangeMailboxStatistics GetMailboxStatistics(int itemId, int accountId) + { + return ExchangeServerController.GetMailboxStatistics(itemId, accountId); + } + + + [WebMethod] + public int CalculateOrganizationDiskspace(int itemId) + { + return ExchangeServerController.CalculateOrganizationDiskspace(itemId); + } [WebMethod] public ExchangeActiveSyncPolicy GetActiveSyncPolicy(int itemId) @@ -139,14 +140,14 @@ namespace WebsitePanel.EnterpriseServer passwordRecoveryEnabled, deviceEncryptionEnabled, allowSimplePassword, maxPasswordFailedAttempts, minPasswordLength, inactivityLockMin, passwordExpirationDays, passwordHistory, refreshInteval); } - #endregion + #endregion - #region Domains - [WebMethod] + #region Domains + [WebMethod] public int AddAuthoritativeDomain(int itemId, int domainId) - { + { return ExchangeServerController.AddAuthoritativeDomain(itemId, domainId); - } + } [WebMethod] public int DeleteAuthoritativeDomain(int itemId, int domainId) @@ -155,42 +156,42 @@ namespace WebsitePanel.EnterpriseServer } - #endregion + #endregion - #region Accounts - [WebMethod] - public ExchangeAccountsPaged GetAccountsPaged(int itemId, string accountTypes, - string filterColumn, string filterValue, string sortColumn, - int startRow, int maximumRows) - { + #region Accounts + [WebMethod] + public ExchangeAccountsPaged GetAccountsPaged(int itemId, string accountTypes, + string filterColumn, string filterValue, string sortColumn, + int startRow, int maximumRows) + { return ExchangeServerController.GetAccountsPaged(itemId, accountTypes, - filterColumn, filterValue, sortColumn, - startRow, maximumRows); - } + filterColumn, filterValue, sortColumn, + startRow, maximumRows); + } - [WebMethod] - public List GetAccounts(int itemId, ExchangeAccountType accountType) - { - return ExchangeServerController.GetAccounts(itemId, accountType); - } + [WebMethod] + public List GetAccounts(int itemId, ExchangeAccountType accountType) + { + return ExchangeServerController.GetAccounts(itemId, accountType); + } - [WebMethod] - public List SearchAccounts(int itemId, - bool includeMailboxes, bool includeContacts, bool includeDistributionLists, + [WebMethod] + public List SearchAccounts(int itemId, + bool includeMailboxes, bool includeContacts, bool includeDistributionLists, bool includeRooms, bool includeEquipment, - string filterColumn, string filterValue, string sortColumn) - { - return ExchangeServerController.SearchAccounts(itemId, - includeMailboxes, includeContacts, includeDistributionLists, + string filterColumn, string filterValue, string sortColumn) + { + return ExchangeServerController.SearchAccounts(itemId, + includeMailboxes, includeContacts, includeDistributionLists, includeRooms, includeEquipment, - filterColumn, filterValue, sortColumn); - } + filterColumn, filterValue, sortColumn); + } - [WebMethod] - public ExchangeAccount GetAccount(int itemId, int accountId) - { - return ExchangeServerController.GetAccount(itemId, accountId); - } + [WebMethod] + public ExchangeAccount GetAccount(int itemId, int accountId) + { + return ExchangeServerController.GetAccount(itemId, accountId); + } [WebMethod] public ExchangeAccount SearchAccount(ExchangeAccountType accountType, string primaryEmailAddress) @@ -204,21 +205,21 @@ namespace WebsitePanel.EnterpriseServer return ExchangeServerController.CheckAccountCredentials(itemId, email, password); } - #endregion + #endregion - #region Mailboxes - [WebMethod] - public int CreateMailbox(int itemId, int accountId, ExchangeAccountType accountType, string accountName, string displayName, - string name, string domain, string password, bool sendSetupInstructions, string setupInstructionMailAddress) - { - return ExchangeServerController.CreateMailbox(itemId, accountId, accountType, accountName, displayName, name, domain, password, sendSetupInstructions, setupInstructionMailAddress); - } + #region Mailboxes + [WebMethod] + public int CreateMailbox(int itemId, int accountId, ExchangeAccountType accountType, string accountName, string displayName, + string name, string domain, string password, bool sendSetupInstructions, string setupInstructionMailAddress, int mailboxPlanId, string subscriberNumber) + { + return ExchangeServerController.CreateMailbox(itemId, accountId, accountType, accountName, displayName, name, domain, password, sendSetupInstructions, setupInstructionMailAddress, mailboxPlanId, subscriberNumber); + } - [WebMethod] - public int DeleteMailbox(int itemId, int accountId) - { - return ExchangeServerController.DeleteMailbox(itemId, accountId); - } + [WebMethod] + public int DeleteMailbox(int itemId, int accountId) + { + return ExchangeServerController.DeleteMailbox(itemId, accountId); + } [WebMethod] public int DisableMailbox(int itemId, int accountId) @@ -227,87 +228,66 @@ namespace WebsitePanel.EnterpriseServer } - [WebMethod] - public ExchangeMailbox GetMailboxGeneralSettings(int itemId, int accountId) - { - return ExchangeServerController.GetMailboxGeneralSettings(itemId, accountId); - } + [WebMethod] + public ExchangeMailbox GetMailboxGeneralSettings(int itemId, int accountId) + { + return ExchangeServerController.GetMailboxGeneralSettings(itemId, accountId); + } - [WebMethod] - public int SetMailboxGeneralSettings(int itemId, int accountId, string displayName, - string password, bool hideAddressBook, bool disabled, string firstName, string initials, - string lastName, string address, string city, string state, string zip, string country, - string jobTitle, string company, string department, string office, string managerAccountName, - string businessPhone, string fax, string homePhone, string mobilePhone, string pager, - string webPage, string notes) - { - return ExchangeServerController.SetMailboxGeneralSettings(itemId, accountId, displayName, - password, hideAddressBook, disabled, firstName, initials, - lastName, address, city, state, zip, country, - jobTitle, company, department, office, managerAccountName, - businessPhone, fax, homePhone, mobilePhone, pager, - webPage, notes); - } + [WebMethod] + public int SetMailboxGeneralSettings(int itemId, int accountId, bool hideAddressBook, bool disabled) + { + return ExchangeServerController.SetMailboxGeneralSettings(itemId, accountId, hideAddressBook, disabled); + } - [WebMethod] - public ExchangeEmailAddress[] GetMailboxEmailAddresses(int itemId, int accountId) - { - return ExchangeServerController.GetMailboxEmailAddresses(itemId, accountId); - } + [WebMethod] + public ExchangeEmailAddress[] GetMailboxEmailAddresses(int itemId, int accountId) + { + return ExchangeServerController.GetMailboxEmailAddresses(itemId, accountId); + } - [WebMethod] - public int AddMailboxEmailAddress(int itemId, int accountId, string emailAddress) - { - return ExchangeServerController.AddMailboxEmailAddress(itemId, accountId, emailAddress); - } + [WebMethod] + public int AddMailboxEmailAddress(int itemId, int accountId, string emailAddress) + { + return ExchangeServerController.AddMailboxEmailAddress(itemId, accountId, emailAddress); + } - [WebMethod] - public int SetMailboxPrimaryEmailAddress(int itemId, int accountId, string emailAddress) - { - return ExchangeServerController.SetMailboxPrimaryEmailAddress(itemId, accountId, emailAddress); - } + [WebMethod] + public int SetMailboxPrimaryEmailAddress(int itemId, int accountId, string emailAddress) + { + return ExchangeServerController.SetMailboxPrimaryEmailAddress(itemId, accountId, emailAddress); + } - [WebMethod] - public int DeleteMailboxEmailAddresses(int itemId, int accountId, string[] emailAddresses) - { - return ExchangeServerController.DeleteMailboxEmailAddresses(itemId, accountId, emailAddresses); - } + [WebMethod] + public int DeleteMailboxEmailAddresses(int itemId, int accountId, string[] emailAddresses) + { + return ExchangeServerController.DeleteMailboxEmailAddresses(itemId, accountId, emailAddresses); + } - [WebMethod] - public ExchangeMailbox GetMailboxMailFlowSettings(int itemId, int accountId) - { - return ExchangeServerController.GetMailboxMailFlowSettings(itemId, accountId); - } + [WebMethod] + public ExchangeMailbox GetMailboxMailFlowSettings(int itemId, int accountId) + { + return ExchangeServerController.GetMailboxMailFlowSettings(itemId, accountId); + } - [WebMethod] - public int SetMailboxMailFlowSettings(int itemId, int accountId, - bool enableForwarding, string forwardingAccountName, bool forwardToBoth, - string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, - int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB, + [WebMethod] + public int SetMailboxMailFlowSettings(int itemId, int accountId, + bool enableForwarding, string forwardingAccountName, bool forwardToBoth, + string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) - { - return ExchangeServerController.SetMailboxMailFlowSettings(itemId, accountId, - enableForwarding, forwardingAccountName, forwardToBoth, - sendOnBehalfAccounts, acceptAccounts, rejectAccounts, - maxRecipients, maxSendMessageSizeKB, maxReceiveMessageSizeKB, - requireSenderAuthentication); - } + { + return ExchangeServerController.SetMailboxMailFlowSettings(itemId, accountId, + enableForwarding, forwardingAccountName, forwardToBoth, + sendOnBehalfAccounts, acceptAccounts, rejectAccounts, + requireSenderAuthentication); + } - [WebMethod] - public ExchangeMailbox GetMailboxAdvancedSettings(int itemId, int accountId) - { - return ExchangeServerController.GetMailboxAdvancedSettings(itemId, accountId); - } - [WebMethod] - public int SetMailboxAdvancedSettings(int itemId, int accountId, bool enablePOP, - bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, - int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays) - { - return ExchangeServerController.SetMailboxAdvancedSettings(itemId, accountId, enablePOP, - enableIMAP, enableOWA, enableMAPI, enableActiveSync, - issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, keepDeletedItemsDays); - } + [WebMethod] + public int SetExchangeMailboxPlan(int itemId, int accountId, int mailboxPlanId) + { + return ExchangeServerController.SetExchangeMailboxPlan(itemId, accountId, mailboxPlanId); + } [WebMethod] public string GetMailboxSetupInstructions(int itemId, int accountId, bool pmm, bool emailMode, bool signup) @@ -327,137 +307,137 @@ namespace WebsitePanel.EnterpriseServer return ExchangeServerController.SetMailboxManagerSettings(itemId, accountId, pmmAllowed, action); } - [WebMethod] + [WebMethod] public ExchangeMailbox GetMailboxPermissions(int itemId, int accountId) { - return ExchangeServerController.GetMailboxPermissions(itemId, accountId); + return ExchangeServerController.GetMailboxPermissions(itemId, accountId); } [WebMethod] public int SetMailboxPermissions(int itemId, int accountId, string[] sendAsaccounts, string[] fullAccessAcounts) { - return ExchangeServerController.SetMailboxPermissions(itemId, accountId, sendAsaccounts, fullAccessAcounts); + return ExchangeServerController.SetMailboxPermissions(itemId, accountId, sendAsaccounts, fullAccessAcounts); } - - - #endregion - #region Contacts - [WebMethod] - public int CreateContact(int itemId, string displayName, string email) - { - return ExchangeServerController.CreateContact(itemId, displayName, email); - } - [WebMethod] - public int DeleteContact(int itemId, int accountId) - { - return ExchangeServerController.DeleteContact(itemId, accountId); - } + #endregion - [WebMethod] - public ExchangeContact GetContactGeneralSettings(int itemId, int accountId) - { - return ExchangeServerController.GetContactGeneralSettings(itemId, accountId); - } + #region Contacts + [WebMethod] + public int CreateContact(int itemId, string displayName, string email) + { + return ExchangeServerController.CreateContact(itemId, displayName, email); + } - [WebMethod] - public int SetContactGeneralSettings(int itemId, int accountId, string displayName, string emailAddress, - bool hideAddressBook, string firstName, string initials, - string lastName, string address, string city, string state, string zip, string country, - string jobTitle, string company, string department, string office, string managerAccountName, - string businessPhone, string fax, string homePhone, string mobilePhone, string pager, + [WebMethod] + public int DeleteContact(int itemId, int accountId) + { + return ExchangeServerController.DeleteContact(itemId, accountId); + } + + [WebMethod] + public ExchangeContact GetContactGeneralSettings(int itemId, int accountId) + { + return ExchangeServerController.GetContactGeneralSettings(itemId, accountId); + } + + [WebMethod] + public int SetContactGeneralSettings(int itemId, int accountId, string displayName, string emailAddress, + bool hideAddressBook, string firstName, string initials, + string lastName, string address, string city, string state, string zip, string country, + string jobTitle, string company, string department, string office, string managerAccountName, + string businessPhone, string fax, string homePhone, string mobilePhone, string pager, string webPage, string notes, int useMapiRichTextFormat) - { - return ExchangeServerController.SetContactGeneralSettings(itemId, accountId, displayName, emailAddress, - hideAddressBook, firstName, initials, - lastName, address, city, state, zip, country, - jobTitle, company, department, office, managerAccountName, - businessPhone, fax, homePhone, mobilePhone, pager, - webPage, notes, useMapiRichTextFormat); - } + { + return ExchangeServerController.SetContactGeneralSettings(itemId, accountId, displayName, emailAddress, + hideAddressBook, firstName, initials, + lastName, address, city, state, zip, country, + jobTitle, company, department, office, managerAccountName, + businessPhone, fax, homePhone, mobilePhone, pager, + webPage, notes, useMapiRichTextFormat); + } - [WebMethod] - public ExchangeContact GetContactMailFlowSettings(int itemId, int accountId) - { - return ExchangeServerController.GetContactMailFlowSettings(itemId, accountId); - } + [WebMethod] + public ExchangeContact GetContactMailFlowSettings(int itemId, int accountId) + { + return ExchangeServerController.GetContactMailFlowSettings(itemId, accountId); + } - [WebMethod] - public int SetContactMailFlowSettings(int itemId, int accountId, - string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) - { - return ExchangeServerController.SetContactMailFlowSettings(itemId, accountId, - acceptAccounts, rejectAccounts, requireSenderAuthentication); - } - #endregion + [WebMethod] + public int SetContactMailFlowSettings(int itemId, int accountId, + string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) + { + return ExchangeServerController.SetContactMailFlowSettings(itemId, accountId, + acceptAccounts, rejectAccounts, requireSenderAuthentication); + } + #endregion - #region Distribution Lists - [WebMethod] - public int CreateDistributionList(int itemId, string displayName, string name, string domain, int managerId) - { - return ExchangeServerController.CreateDistributionList(itemId, displayName, name, domain, managerId); - } + #region Distribution Lists + [WebMethod] + public int CreateDistributionList(int itemId, string displayName, string name, string domain, int managerId) + { + return ExchangeServerController.CreateDistributionList(itemId, displayName, name, domain, managerId); + } - [WebMethod] - public int DeleteDistributionList(int itemId, int accountId) - { - return ExchangeServerController.DeleteDistributionList(itemId, accountId); - } + [WebMethod] + public int DeleteDistributionList(int itemId, int accountId) + { + return ExchangeServerController.DeleteDistributionList(itemId, accountId); + } - [WebMethod] - public ExchangeDistributionList GetDistributionListGeneralSettings(int itemId, int accountId) - { - return ExchangeServerController.GetDistributionListGeneralSettings(itemId, accountId); - } + [WebMethod] + public ExchangeDistributionList GetDistributionListGeneralSettings(int itemId, int accountId) + { + return ExchangeServerController.GetDistributionListGeneralSettings(itemId, accountId); + } - [WebMethod] - public int SetDistributionListGeneralSettings(int itemId, int accountId, string displayName, - bool hideAddressBook, string managerAccount, string[] memberAccounts, - string notes) - { - return ExchangeServerController.SetDistributionListGeneralSettings(itemId, accountId, displayName, - hideAddressBook, managerAccount, memberAccounts, - notes); - } + [WebMethod] + public int SetDistributionListGeneralSettings(int itemId, int accountId, string displayName, + bool hideAddressBook, string managerAccount, string[] memberAccounts, + string notes) + { + return ExchangeServerController.SetDistributionListGeneralSettings(itemId, accountId, displayName, + hideAddressBook, managerAccount, memberAccounts, + notes); + } - [WebMethod] - public ExchangeDistributionList GetDistributionListMailFlowSettings(int itemId, int accountId) - { - return ExchangeServerController.GetDistributionListMailFlowSettings(itemId, accountId); - } + [WebMethod] + public ExchangeDistributionList GetDistributionListMailFlowSettings(int itemId, int accountId) + { + return ExchangeServerController.GetDistributionListMailFlowSettings(itemId, accountId); + } - [WebMethod] - public int SetDistributionListMailFlowSettings(int itemId, int accountId, - string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) - { - return ExchangeServerController.SetDistributionListMailFlowSettings(itemId, accountId, - acceptAccounts, rejectAccounts, requireSenderAuthentication); - } + [WebMethod] + public int SetDistributionListMailFlowSettings(int itemId, int accountId, + string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) + { + return ExchangeServerController.SetDistributionListMailFlowSettings(itemId, accountId, + acceptAccounts, rejectAccounts, requireSenderAuthentication); + } - [WebMethod] - public ExchangeEmailAddress[] GetDistributionListEmailAddresses(int itemId, int accountId) - { - return ExchangeServerController.GetDistributionListEmailAddresses(itemId, accountId); - } + [WebMethod] + public ExchangeEmailAddress[] GetDistributionListEmailAddresses(int itemId, int accountId) + { + return ExchangeServerController.GetDistributionListEmailAddresses(itemId, accountId); + } - [WebMethod] - public int AddDistributionListEmailAddress(int itemId, int accountId, string emailAddress) - { - return ExchangeServerController.AddDistributionListEmailAddress(itemId, accountId, emailAddress); - } + [WebMethod] + public int AddDistributionListEmailAddress(int itemId, int accountId, string emailAddress) + { + return ExchangeServerController.AddDistributionListEmailAddress(itemId, accountId, emailAddress); + } - [WebMethod] - public int SetDistributionListPrimaryEmailAddress(int itemId, int accountId, string emailAddress) - { - return ExchangeServerController.SetDistributionListPrimaryEmailAddress(itemId, accountId, emailAddress); - } + [WebMethod] + public int SetDistributionListPrimaryEmailAddress(int itemId, int accountId, string emailAddress) + { + return ExchangeServerController.SetDistributionListPrimaryEmailAddress(itemId, accountId, emailAddress); + } - [WebMethod] - public int DeleteDistributionListEmailAddresses(int itemId, int accountId, string[] emailAddresses) - { - return ExchangeServerController.DeleteDistributionListEmailAddresses(itemId, accountId, emailAddresses); - } + [WebMethod] + public int DeleteDistributionListEmailAddresses(int itemId, int accountId, string[] emailAddresses) + { + return ExchangeServerController.DeleteDistributionListEmailAddresses(itemId, accountId, emailAddresses); + } [WebMethod] public ResultObject SetDistributionListPermissions(int itemId, int accountId, string[] sendAsAccounts, string[] sendOnBehalfAccounts) @@ -470,9 +450,77 @@ namespace WebsitePanel.EnterpriseServer { return ExchangeServerController.GetDistributionListPermissions(itemId, accountId); } - + #endregion + #region MobileDevice + + [WebMethod] + public ExchangeMobileDevice[] GetMobileDevices(int itemId, int accountId) + { + return ExchangeServerController.GetMobileDevices(itemId, accountId); + } + + [WebMethod] + public ExchangeMobileDevice GetMobileDevice(int itemId, string deviceId) + { + return ExchangeServerController.GetMobileDevice(itemId, deviceId); + } + + [WebMethod] + public void WipeDataFromDevice(int itemId, string deviceId) + { + ExchangeServerController.WipeDataFromDevice(itemId, deviceId); + } + + [WebMethod] + public void CancelRemoteWipeRequest(int itemId, string deviceId) + { + ExchangeServerController.CancelRemoteWipeRequest(itemId, deviceId); + } + + [WebMethod] + public void RemoveDevice(int itemId, string deviceId) + { + ExchangeServerController.RemoveDevice(itemId, deviceId); + } + + #endregion + + #region MailboxPlans + [WebMethod] + public List GetExchangeMailboxPlans(int itemId) + { + return ExchangeServerController.GetExchangeMailboxPlans(itemId); + } + + [WebMethod] + public ExchangeMailboxPlan GetExchangeMailboxPlan(int itemId, int mailboxPlanId) + { + return ExchangeServerController.GetExchangeMailboxPlan(itemId, mailboxPlanId); + } + + [WebMethod] + public int AddExchangeMailboxPlan(int itemId, ExchangeMailboxPlan mailboxPlan) + { + return ExchangeServerController.AddExchangeMailboxPlan(itemId, mailboxPlan); + } + + [WebMethod] + public int DeleteExchangeMailboxPlan(int itemId, int mailboxPlanId) + { + return ExchangeServerController.DeleteExchangeMailboxPlan(itemId, mailboxPlanId); + } + + [WebMethod] + public void SetOrganizationDefaultExchangeMailboxPlan(int itemId, int mailboxPlanId) + { + ExchangeServerController.SetOrganizationDefaultExchangeMailboxPlan(itemId, mailboxPlanId); + } + + #endregion + + #region Public Folders [WebMethod] public int CreatePublicFolder(int itemId, string parentFolder, string folderName, @@ -560,39 +608,7 @@ namespace WebsitePanel.EnterpriseServer } #endregion - #region MobileDevice - [WebMethod] - public ExchangeMobileDevice[] GetMobileDevices(int itemId, int accountId) - { - return ExchangeServerController.GetMobileDevices(itemId, accountId); - } - - [WebMethod] - public ExchangeMobileDevice GetMobileDevice(int itemId, string deviceId) - { - return ExchangeServerController.GetMobileDevice(itemId, deviceId); - } - - [WebMethod] - public void WipeDataFromDevice(int itemId, string deviceId) - { - ExchangeServerController.WipeDataFromDevice(itemId, deviceId); - } - - [WebMethod] - public void CancelRemoteWipeRequest(int itemId, string deviceId) - { - ExchangeServerController.CancelRemoteWipeRequest(itemId, deviceId); - } - - [WebMethod] - public void RemoveDevice(int itemId, string deviceId) - { - ExchangeServerController.RemoveDevice(itemId, deviceId); - } - - #endregion } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs index 3f9dccbd..9bccc46a 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOrganizations.asmx.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2012, Outercurve Foundation. +// Copyright (c) 2011, Outercurve Foundation. // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, @@ -46,10 +46,10 @@ namespace WebsitePanel.EnterpriseServer #region Organizations [WebMethod] - public int CreateOrganization(int packageId, string organizationID, string organizationName) + public int CreateOrganization(int packageId, string organizationID, string organizationName) { return OrganizationController.CreateOrganization(packageId, organizationID, organizationName); - + } [WebMethod] @@ -60,7 +60,7 @@ namespace WebsitePanel.EnterpriseServer filterColumn, filterValue, sortColumn, startRow, maximumRows); } - + [WebMethod] public List GetOrganizations(int packageId, bool recursive) { @@ -72,13 +72,13 @@ namespace WebsitePanel.EnterpriseServer { return OrganizationController.GetOrganizationUserSummuryLetter(itemId, accountId, pmm, emailMode, signup); } - + [WebMethod] public int SendOrganizationUserSummuryLetter(int itemId, int accountId, bool signup, string to, string cc) { return OrganizationController.SendSummaryLetter(itemId, accountId, signup, to, cc); } - + [WebMethod] public int DeleteOrganization(int itemId) { @@ -97,6 +97,13 @@ namespace WebsitePanel.EnterpriseServer return OrganizationController.GetOrganization(itemId); } + [WebMethod] + public int GetAccountIdByUserPrincipalName(int itemId, string userPrincipalName) + { + return OrganizationController.GetAccountIdByUserPrincipalName(itemId, userPrincipalName); + } + + #endregion @@ -107,13 +114,13 @@ namespace WebsitePanel.EnterpriseServer { return OrganizationController.AddOrganizationDomain(itemId, domainName); } - + [WebMethod] public List GetOrganizationDomains(int itemId) { return OrganizationController.GetOrganizationDomains(itemId); } - + [WebMethod] public int DeleteOrganizationDomain(int itemId, int domainId) { @@ -132,15 +139,22 @@ namespace WebsitePanel.EnterpriseServer #region Users [WebMethod] - public int CreateUser(int itemId, string displayName, string name, string domain, string password, bool sendNotification, string to) + public int CreateUser(int itemId, string displayName, string name, string domain, string password, string subscriberNumber, bool sendNotification, string to) { string accountName; - return OrganizationController.CreateUser(itemId, displayName, name, domain, password, true, sendNotification, to, out accountName); + return OrganizationController.CreateUser(itemId, displayName, name, domain, password, subscriberNumber, true, sendNotification, to, out accountName); } + [WebMethod] + public int ImportUser(int itemId, string accountName, string displayName, string name, string domain, string password, string subscriberNumber) + { + return OrganizationController.ImportUser(itemId, accountName, displayName, name, domain, password, subscriberNumber); + } + + [WebMethod] public OrganizationUsersPaged GetOrganizationUsersPaged(int itemId, string filterColumn, string filterValue, string sortColumn, - int startRow, int maximumRows) + int startRow, int maximumRows) { return OrganizationController.GetOrganizationUsersPaged(itemId, filterColumn, filterValue, sortColumn, startRow, maximumRows); } @@ -157,30 +171,30 @@ namespace WebsitePanel.EnterpriseServer string lastName, string address, string city, string state, string zip, string country, string jobTitle, string company, string department, string office, string managerAccountName, string businessPhone, string fax, string homePhone, string mobilePhone, string pager, - string webPage, string notes, string externalEmail) + string webPage, string notes, string externalEmail, string subscriberNumber) { return OrganizationController.SetUserGeneralSettings(itemId, accountId, displayName, password, hideAddressBook, disabled, locked, firstName, initials, lastName, address, city, state, zip, country, jobTitle, company, department, office, managerAccountName, businessPhone, fax, homePhone, mobilePhone, pager, - webPage, notes, externalEmail); + webPage, notes, externalEmail, subscriberNumber); } [WebMethod] - public List SearchAccounts(int itemId, + public List SearchAccounts(int itemId, string filterColumn, string filterValue, string sortColumn, bool includeMailboxes) { return OrganizationController.SearchAccounts(itemId, filterColumn, filterValue, sortColumn, includeMailboxes); } - + [WebMethod] public int DeleteUser(int itemId, int accountId) { - return OrganizationController.DeleteUser(itemId, accountId); + return OrganizationController.DeleteUser(itemId, accountId); } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ActiveDirectoryUtils.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ActiveDirectoryUtils.cs index fb1092c6..cb38f66d 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ActiveDirectoryUtils.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ActiveDirectoryUtils.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2012, Outercurve Foundation. +// Copyright (c) 2011, Outercurve Foundation. // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, @@ -39,7 +39,7 @@ namespace WebsitePanel.Providers.HostedSolution { public static DirectoryEntry GetADObject(string path) { - DirectoryEntry de = new DirectoryEntry(path); + DirectoryEntry de = new DirectoryEntry(path); de.RefreshCache(); return de; } @@ -48,16 +48,16 @@ namespace WebsitePanel.Providers.HostedSolution { bool res = false; DirectorySearcher deSearch = new DirectorySearcher - { - Filter = - ("(&(objectClass=user)(samaccountname=" + samAccountName + "))") - }; + { + Filter = + ("(&(objectClass=user)(samaccountname=" + samAccountName + "))") + }; //get the group result SearchResult results = deSearch.FindOne(); DirectoryEntry de = results.GetDirectoryEntry(); PropertyValueCollection props = de.Properties["memberOf"]; - + foreach (string str in props) { if (str.IndexOf(group) != -1) @@ -81,8 +81,8 @@ namespace WebsitePanel.Providers.HostedSolution ou = parent.Children.Add( string.Format("OU={0}", name), - parent.SchemaClassName); - + parent.SchemaClassName); + ret = ou.Path; ou.CommitChanges(); } @@ -100,13 +100,13 @@ namespace WebsitePanel.Providers.HostedSolution public static void DeleteADObject(string path, bool removeChild) { DirectoryEntry entry = GetADObject(path); - + if (removeChild && entry.Children != null) foreach (DirectoryEntry child in entry.Children) { entry.Children.Remove(child); } - + DirectoryEntry parent = entry.Parent; if (parent != null) { @@ -115,7 +115,7 @@ namespace WebsitePanel.Providers.HostedSolution } } - + public static void DeleteADObject(string path) { DirectoryEntry entry = GetADObject(path); @@ -141,21 +141,34 @@ namespace WebsitePanel.Providers.HostedSolution } } else - { + { if (oDE.Properties.Contains(name)) { oDE.Properties[name].Remove(oDE.Properties[name][0]); } - + } } - public static void SetADObjectPropertyValue(DirectoryEntry oDE, string name, object value) + public static void SetADObjectPropertyValue(DirectoryEntry oDE, string name, string value) { PropertyValueCollection collection = oDE.Properties[name]; collection.Value = value; } - + + public static void SetADObjectPropertyValue(DirectoryEntry oDE, string name, Guid value) + { + PropertyValueCollection collection = oDE.Properties[name]; + collection.Value = value.ToByteArray(); + } + + public static void ClearADObjectPropertyValue(DirectoryEntry oDE, string name) + { + PropertyValueCollection collection = oDE.Properties[name]; + collection.Clear(); + } + + public static object GetADObjectProperty(DirectoryEntry entry, string name) { return entry.Properties.Contains(name) ? entry.Properties[name][0] : null; @@ -164,7 +177,7 @@ namespace WebsitePanel.Providers.HostedSolution public static string GetADObjectStringProperty(DirectoryEntry entry, string name) { object ret = GetADObjectProperty(entry, name); - return ret != null ? ret.ToString() : string.Empty; + return ret != null ? ret.ToString() : string.Empty; } public static string ConvertADPathToCanonicalName(string name) @@ -254,29 +267,38 @@ namespace WebsitePanel.Providers.HostedSolution return ret; } + public static string CreateUser(string path, string user, string displayName, string password, bool enabled) { - DirectoryEntry currentADObject = new DirectoryEntry(path); + return CreateUser(path, "", user, displayName, password, enabled); + } - DirectoryEntry newUserObject = currentADObject.Children.Add("CN=" + user, "User"); - - newUserObject.Properties[ADAttributes.SAMAccountName].Add(user); + public static string CreateUser(string path, string upn, string user, string displayName, string password, bool enabled) + { + DirectoryEntry currentADObject = new DirectoryEntry(path); + + string cn = string.Empty; + if (string.IsNullOrEmpty(upn)) cn = user; else cn = upn; + + DirectoryEntry newUserObject = currentADObject.Children.Add("CN=" + cn, "User"); + + newUserObject.Properties[ADAttributes.SAMAccountName].Add(user); SetADObjectProperty(newUserObject, ADAttributes.DisplayName, displayName); newUserObject.CommitChanges(); newUserObject.Invoke(ADAttributes.SetPassword, password); newUserObject.InvokeSet(ADAttributes.AccountDisabled, !enabled); newUserObject.CommitChanges(); - + return newUserObject.Path; } public static void CreateGroup(string path, string group) { - DirectoryEntry currentADObject = new DirectoryEntry(path); + DirectoryEntry currentADObject = new DirectoryEntry(path); DirectoryEntry newGroupObject = currentADObject.Children.Add("CN=" + group, "Group"); - + newGroupObject.Properties[ADAttributes.SAMAccountName].Add(group); newGroupObject.Properties[ADAttributes.GroupType].Add(-2147483640); @@ -320,7 +342,7 @@ namespace WebsitePanel.Providers.HostedSolution if (string.IsNullOrEmpty(primaryDomainController)) { dn = string.Format("LDAP://{0}", dn); - + } else dn = string.Format("LDAP://{0}/{1}", primaryDomainController, dn); @@ -358,7 +380,7 @@ namespace WebsitePanel.Providers.HostedSolution DirectoryEntry ou = GetADObject(ouPath); PropertyValueCollection prop = null; - prop = ou.Properties["uPNSuffixes"]; + prop = ou.Properties["uPNSuffixes"]; if (prop != null) { diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeAccount.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeAccount.cs index 53110402..36fbfdde 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeAccount.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeAccount.cs @@ -32,32 +32,35 @@ using System.Text; namespace WebsitePanel.Providers.HostedSolution { - public class ExchangeAccount - { - int accountId; - int itemId; + public class ExchangeAccount + { + int accountId; + int itemId; int packageId; - ExchangeAccountType accountType; - string accountName; - string displayName; - string primaryEmailAddress; - bool mailEnabledPublicFolder; + string subscriberNumber; + ExchangeAccountType accountType; + string accountName; + string displayName; + string primaryEmailAddress; + bool mailEnabledPublicFolder; MailboxManagerActions mailboxManagerActions; string accountPassword; string samAccountName; + int mailboxPlanId; + string mailboxPlan; string publicFolderPermission; - public int AccountId - { - get { return this.accountId; } - set { this.accountId = value; } - } + public int AccountId + { + get { return this.accountId; } + set { this.accountId = value; } + } - public int ItemId - { + public int ItemId + { get { return this.itemId; } set { this.itemId = value; } - } + } public int PackageId { @@ -65,17 +68,17 @@ namespace WebsitePanel.Providers.HostedSolution set { this.packageId = value; } } - public ExchangeAccountType AccountType - { - get { return this.accountType; } - set { this.accountType = value; } - } + public ExchangeAccountType AccountType + { + get { return this.accountType; } + set { this.accountType = value; } + } - public string AccountName - { - get { return this.accountName; } - set { this.accountName = value; } - } + public string AccountName + { + get { return this.accountName; } + set { this.accountName = value; } + } public string SamAccountName { @@ -83,23 +86,23 @@ namespace WebsitePanel.Providers.HostedSolution set { this.samAccountName = value; } } - public string DisplayName - { - get { return this.displayName; } - set { this.displayName = value; } - } + public string DisplayName + { + get { return this.displayName; } + set { this.displayName = value; } + } - public string PrimaryEmailAddress - { - get { return this.primaryEmailAddress; } - set { this.primaryEmailAddress = value; } - } + public string PrimaryEmailAddress + { + get { return this.primaryEmailAddress; } + set { this.primaryEmailAddress = value; } + } - public bool MailEnabledPublicFolder - { - get { return this.mailEnabledPublicFolder; } - set { this.mailEnabledPublicFolder = value; } - } + public bool MailEnabledPublicFolder + { + get { return this.mailEnabledPublicFolder; } + set { this.mailEnabledPublicFolder = value; } + } public string AccountPassword { @@ -113,10 +116,31 @@ namespace WebsitePanel.Providers.HostedSolution set { this.mailboxManagerActions = value; } } + public int MailboxPlanId + { + get { return this.mailboxPlanId; } + set { this.mailboxPlanId = value; } + } + + public string MailboxPlan + { + get { return this.mailboxPlan; } + set { this.mailboxPlan = value; } + } + + + public string SubscriberNumber + { + get { return this.subscriberNumber; } + set { this.subscriberNumber = value; } + } + public string PublicFolderPermission { get { return this.publicFolderPermission; } set { this.publicFolderPermission = value; } } - } + + + } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeContact.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeContact.cs index fe8984cc..689d1558 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeContact.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeContact.cs @@ -32,209 +32,219 @@ using System.Text; namespace WebsitePanel.Providers.HostedSolution { - public class ExchangeContact - { - string displayName; - string accountName; - string emailAddress; - bool hideFromAddressBook; + public class ExchangeContact + { + string displayName; + string accountName; + string emailAddress; + bool hideFromAddressBook; - string firstName; - string initials; - string lastName; + string firstName; + string initials; + string lastName; - string jobTitle; - string company; - string department; - string office; - ExchangeAccount managerAccount; + string jobTitle; + string company; + string department; + string office; + ExchangeAccount managerAccount; - string businessPhone; - string fax; - string homePhone; - string mobilePhone; - string pager; - string webPage; + string businessPhone; + string fax; + string homePhone; + string mobilePhone; + string pager; + string webPage; - string address; - string city; - string state; - string zip; - string country; + string address; + string city; + string state; + string zip; + string country; - string notes; - private int useMapiRichTextFormat; - - ExchangeAccount[] acceptAccounts; - ExchangeAccount[] rejectAccounts; - bool requireSenderAuthentication; + string notes; + string sAMAccountName; + private int useMapiRichTextFormat; - public string DisplayName - { - get { return this.displayName; } - set { this.displayName = value; } - } + ExchangeAccount[] acceptAccounts; + ExchangeAccount[] rejectAccounts; + bool requireSenderAuthentication; - public string AccountName - { - get { return this.accountName; } - set { this.accountName = value; } - } + public string DisplayName + { + get { return this.displayName; } + set { this.displayName = value; } + } - public string EmailAddress - { - get { return this.emailAddress; } - set { this.emailAddress = value; } - } + public string AccountName + { + get { return this.accountName; } + set { this.accountName = value; } + } - public bool HideFromAddressBook - { - get { return this.hideFromAddressBook; } - set { this.hideFromAddressBook = value; } - } + public string EmailAddress + { + get { return this.emailAddress; } + set { this.emailAddress = value; } + } - public string FirstName - { - get { return this.firstName; } - set { this.firstName = value; } - } + public bool HideFromAddressBook + { + get { return this.hideFromAddressBook; } + set { this.hideFromAddressBook = value; } + } - public string Initials - { - get { return this.initials; } - set { this.initials = value; } - } + public string FirstName + { + get { return this.firstName; } + set { this.firstName = value; } + } - public string LastName - { - get { return this.lastName; } - set { this.lastName = value; } - } + public string Initials + { + get { return this.initials; } + set { this.initials = value; } + } - public string JobTitle - { - get { return this.jobTitle; } - set { this.jobTitle = value; } - } + public string LastName + { + get { return this.lastName; } + set { this.lastName = value; } + } - public string Company - { - get { return this.company; } - set { this.company = value; } - } + public string JobTitle + { + get { return this.jobTitle; } + set { this.jobTitle = value; } + } - public string Department - { - get { return this.department; } - set { this.department = value; } - } + public string Company + { + get { return this.company; } + set { this.company = value; } + } - public string Office - { - get { return this.office; } - set { this.office = value; } - } + public string Department + { + get { return this.department; } + set { this.department = value; } + } - public ExchangeAccount ManagerAccount - { - get { return this.managerAccount; } - set { this.managerAccount = value; } - } + public string Office + { + get { return this.office; } + set { this.office = value; } + } - public string BusinessPhone - { - get { return this.businessPhone; } - set { this.businessPhone = value; } - } + public ExchangeAccount ManagerAccount + { + get { return this.managerAccount; } + set { this.managerAccount = value; } + } - public string Fax - { - get { return this.fax; } - set { this.fax = value; } - } + public string BusinessPhone + { + get { return this.businessPhone; } + set { this.businessPhone = value; } + } - public string HomePhone - { - get { return this.homePhone; } - set { this.homePhone = value; } - } + public string Fax + { + get { return this.fax; } + set { this.fax = value; } + } - public string MobilePhone - { - get { return this.mobilePhone; } - set { this.mobilePhone = value; } - } + public string HomePhone + { + get { return this.homePhone; } + set { this.homePhone = value; } + } - public string Pager - { - get { return this.pager; } - set { this.pager = value; } - } + public string MobilePhone + { + get { return this.mobilePhone; } + set { this.mobilePhone = value; } + } - public string WebPage - { - get { return this.webPage; } - set { this.webPage = value; } - } + public string Pager + { + get { return this.pager; } + set { this.pager = value; } + } - public string Address - { - get { return this.address; } - set { this.address = value; } - } + public string WebPage + { + get { return this.webPage; } + set { this.webPage = value; } + } - public string City - { - get { return this.city; } - set { this.city = value; } - } + public string Address + { + get { return this.address; } + set { this.address = value; } + } - public string State - { - get { return this.state; } - set { this.state = value; } - } + public string City + { + get { return this.city; } + set { this.city = value; } + } - public string Zip - { - get { return this.zip; } - set { this.zip = value; } - } + public string State + { + get { return this.state; } + set { this.state = value; } + } - public string Country - { - get { return this.country; } - set { this.country = value; } - } + public string Zip + { + get { return this.zip; } + set { this.zip = value; } + } - public string Notes - { - get { return this.notes; } - set { this.notes = value; } - } + public string Country + { + get { return this.country; } + set { this.country = value; } + } - public ExchangeAccount[] AcceptAccounts - { - get { return this.acceptAccounts; } - set { this.acceptAccounts = value; } - } + public string Notes + { + get { return this.notes; } + set { this.notes = value; } + } - public ExchangeAccount[] RejectAccounts - { - get { return this.rejectAccounts; } - set { this.rejectAccounts = value; } - } + public ExchangeAccount[] AcceptAccounts + { + get { return this.acceptAccounts; } + set { this.acceptAccounts = value; } + } - public bool RequireSenderAuthentication - { - get { return requireSenderAuthentication; } - set { requireSenderAuthentication = value; } - } + public ExchangeAccount[] RejectAccounts + { + get { return this.rejectAccounts; } + set { this.rejectAccounts = value; } + } - public int UseMapiRichTextFormat - { + public bool RequireSenderAuthentication + { + get { return requireSenderAuthentication; } + set { requireSenderAuthentication = value; } + } + + public int UseMapiRichTextFormat + { get { return useMapiRichTextFormat; } set { useMapiRichTextFormat = value; } - } - } + } + + public string SAMAccountName + { + get { return sAMAccountName; } + set { sAMAccountName = value; } + } + + + + } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeDistributionList.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeDistributionList.cs index 17840d1f..6d3c5322 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeDistributionList.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeDistributionList.cs @@ -32,72 +32,79 @@ using System.Text; namespace WebsitePanel.Providers.HostedSolution { - public class ExchangeDistributionList - { - public string DisplayName - { - get; - set; - } + public class ExchangeDistributionList + { + public string DisplayName + { + get; + set; + } - public string AccountName - { - get; - set; - } + public string AccountName + { + get; + set; + } - public bool HideFromAddressBook - { - get; - set; - } + public bool HideFromAddressBook + { + get; + set; + } - public ExchangeAccount[] MembersAccounts - { - get; - set; - } + public ExchangeAccount[] MembersAccounts + { + get; + set; + } - public ExchangeAccount ManagerAccount - { - get; - set; - } + public ExchangeAccount ManagerAccount + { + get; + set; + } - public string Notes - { - get; - set; - } + public string Notes + { + get; + set; + } - public ExchangeAccount[] AcceptAccounts - { - get; - set; - } + public ExchangeAccount[] AcceptAccounts + { + get; + set; + } - public ExchangeAccount[] RejectAccounts - { - get; - set; - } + public ExchangeAccount[] RejectAccounts + { + get; + set; + } - public bool RequireSenderAuthentication - { - get; - set; - } - - public ExchangeAccount[] SendAsAccounts - { - get; - set; - } + public bool RequireSenderAuthentication + { + get; + set; + } - public ExchangeAccount[] SendOnBehalfAccounts - { - get; - set; - } - } + public ExchangeAccount[] SendAsAccounts + { + get; + set; + } + + public ExchangeAccount[] SendOnBehalfAccounts + { + get; + set; + } + + public string SAMAccountName + { + get; + set; + } + + } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeMailboxPlan.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeMailboxPlan.cs new file mode 100644 index 00000000..167c5f04 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeMailboxPlan.cs @@ -0,0 +1,160 @@ +// 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 ExchangeMailboxPlan + { + int mailboxPlanId; + string mailboxPlan; + int mailboxSizeMB; + int maxRecipients; + int maxSendMessageSizeKB; + int maxReceiveMessageSizeKB; + + bool enablePOP; + bool enableIMAP; + bool enableOWA; + bool enableMAPI; + bool enableActiveSync; + + int issueWarningPct; + int prohibitSendPct; + int prohibitSendReceivePct; + int keepDeletedItemsDays; + bool isDefault; + bool hideFromAddressBook; + + public int MailboxPlanId + { + get { return this.mailboxPlanId; } + set { this.mailboxPlanId = value; } + } + + public string MailboxPlan + { + get { return this.mailboxPlan; } + set { this.mailboxPlan = value; } + } + + public int MailboxSizeMB + { + get { return this.mailboxSizeMB; } + set { this.mailboxSizeMB = value; } + } + + public bool IsDefault + { + get { return this.isDefault; } + set { this.isDefault = value; } + } + + public int MaxRecipients + { + get { return this.maxRecipients; } + set { this.maxRecipients = value; } + } + + public int MaxSendMessageSizeKB + { + get { return this.maxSendMessageSizeKB; } + set { this.maxSendMessageSizeKB = value; } + } + + public int MaxReceiveMessageSizeKB + { + get { return this.maxReceiveMessageSizeKB; } + set { this.maxReceiveMessageSizeKB = value; } + } + + public bool EnablePOP + { + get { return this.enablePOP; } + set { this.enablePOP = value; } + } + + public bool EnableIMAP + { + get { return this.enableIMAP; } + set { this.enableIMAP = value; } + } + + public bool EnableOWA + { + get { return this.enableOWA; } + set { this.enableOWA = value; } + } + + public bool EnableMAPI + { + get { return this.enableMAPI; } + set { this.enableMAPI = value; } + } + + public bool EnableActiveSync + { + get { return this.enableActiveSync; } + set { this.enableActiveSync = value; } + } + + public int IssueWarningPct + { + get { return this.issueWarningPct; } + set { this.issueWarningPct = value; } + } + + public int ProhibitSendPct + { + get { return this.prohibitSendPct; } + set { this.prohibitSendPct = value; } + } + + public int ProhibitSendReceivePct + { + get { return this.prohibitSendReceivePct; } + set { this.prohibitSendReceivePct = value; } + } + + public int KeepDeletedItemsDays + { + get { return this.keepDeletedItemsDays; } + set { this.keepDeletedItemsDays = value; } + } + + public bool HideFromAddressBook + { + get { return this.hideFromAddressBook; } + set { this.hideFromAddressBook = value; } + } + + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/IExchangeServer.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/IExchangeServer.cs index 34651e08..559b9385 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/IExchangeServer.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/IExchangeServer.cs @@ -30,70 +30,71 @@ namespace WebsitePanel.Providers.HostedSolution { public interface IExchangeServer { - + bool CheckAccountCredentials(string username, string password); - // Organizations + // Organizations - string CreateMailEnableUser(string upn, string organizationId, string organizationDistinguishedName, ExchangeAccountType accountType, - string mailboxDatabase, string offlineAddressBook, - string accountName, bool enablePOP, bool enableIMAP, - bool enableOWA, bool enableMAPI, bool enableActiveSync, - int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, - int keepDeletedItemsDays); - - Organization ExtendToExchangeOrganization(string organizationId, string securityGroup); - string GetOABVirtualDirectory(); - Organization CreateOrganizationOfflineAddressBook(string organizationId, string securityGroup, string oabVirtualDir); - void UpdateOrganizationOfflineAddressBook(string id); - bool DeleteOrganization(string organizationId, string distinguishedName, string globalAddressList, string addressList, string roomsAddressList, string offlineAddressBook, string securityGroup); - void SetOrganizationStorageLimits(string organizationDistinguishedName, int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays); - ExchangeItemStatistics[] GetMailboxesStatistics(string organizationDistinguishedName); + string CreateMailEnableUser(string upn, string organizationId, string organizationDistinguishedName, ExchangeAccountType accountType, + string mailboxDatabase, string offlineAddressBook, string addressBookPolicy, + string accountName, bool enablePOP, bool enableIMAP, + bool enableOWA, bool enableMAPI, bool enableActiveSync, + int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, + int keepDeletedItemsDays, int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB, bool hideFromAddressBook, bool isConsumer); - // Domains + Organization ExtendToExchangeOrganization(string organizationId, string securityGroup, bool IsConsumer); + string GetOABVirtualDirectory(); + Organization CreateOrganizationOfflineAddressBook(string organizationId, string securityGroup, string oabVirtualDir); + Organization CreateOrganizationAddressBookPolicy(string organizationId, string gal, string addressBook, string roomList, string oab); + void UpdateOrganizationOfflineAddressBook(string id); + bool DeleteOrganization(string organizationId, string distinguishedName, string globalAddressList, string addressList, string roomList, string offlineAddressBook, string securityGroup, string addressBookPolicy); + void SetOrganizationStorageLimits(string organizationDistinguishedName, int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays); + ExchangeItemStatistics[] GetMailboxesStatistics(string organizationDistinguishedName); + + // Domains void AddAuthoritativeDomain(string domain); void DeleteAuthoritativeDomain(string domain); - string[] GetAuthoritativeDomains(); + string[] GetAuthoritativeDomains(); - // Mailboxes - string CreateMailbox(string organizationId, string organizationDistinguishedName, string mailboxDatabase, string securityGroup, string offlineAddressBook, ExchangeAccountType accountType, string displayName, string accountName, string name, string domain, string password, bool enablePOP, bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, - int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays); - void DeleteMailbox(string accountName); + // Mailboxes + //string CreateMailbox(string organizationId, string organizationDistinguishedName, string mailboxDatabase, string securityGroup, string offlineAddressBook, string addressBookPolicy, ExchangeAccountType accountType, string displayName, string accountName, string name, string domain, string password, bool enablePOP, bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, + // int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays, int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB,bool hideFromAddressBook); + void DeleteMailbox(string accountName); void DisableMailbox(string id); - ExchangeMailbox GetMailboxGeneralSettings(string accountName); - void SetMailboxGeneralSettings(string accountName, string displayName, string password, bool hideFromAddressBook, bool disabled, string firstName, string initials, string lastName, string address, string city, string state, string zip, string country, string jobTitle, string company, string department, string office, string managerAccountName, string businessPhone, string fax, string homePhone, string mobilePhone, string pager, string webPage, string notes); - ExchangeMailbox GetMailboxMailFlowSettings(string accountName); - void SetMailboxMailFlowSettings(string accountName, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB, bool requireSenderAuthentication); - ExchangeMailbox GetMailboxAdvancedSettings(string accountName); - void SetMailboxAdvancedSettings(string organizationId, string accountName, bool enablePOP, bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays); - ExchangeEmailAddress[] GetMailboxEmailAddresses(string accountName); - void SetMailboxEmailAddresses(string accountName, string[] emailAddresses); - void SetMailboxPrimaryEmailAddress(string accountName, string emailAddress); - void SetMailboxPermissions(string organizationId, string accountName, string[] sendAsAccounts, string[] fullAccessAccounts); - ExchangeMailbox GetMailboxPermissions(string organizationId, string accountName); - ExchangeMailboxStatistics GetMailboxStatistics(string accountName); + ExchangeMailbox GetMailboxGeneralSettings(string accountName); + void SetMailboxGeneralSettings(string accountName, bool hideFromAddressBook, bool disabled); + ExchangeMailbox GetMailboxMailFlowSettings(string accountName); + void SetMailboxMailFlowSettings(string accountName, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication); + ExchangeMailbox GetMailboxAdvancedSettings(string accountName); + void SetMailboxAdvancedSettings(string organizationId, string accountName, bool enablePOP, bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays, int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB); + ExchangeEmailAddress[] GetMailboxEmailAddresses(string accountName); + void SetMailboxEmailAddresses(string accountName, string[] emailAddresses); + void SetMailboxPrimaryEmailAddress(string accountName, string emailAddress); + void SetMailboxPermissions(string organizationId, string accountName, string[] sendAsAccounts, string[] fullAccessAccounts); + ExchangeMailbox GetMailboxPermissions(string organizationId, string accountName); + ExchangeMailboxStatistics GetMailboxStatistics(string accountName); - // Contacts - void CreateContact(string organizationId, string organizationDistinguishedName, string contactDisplayName, string contactAccountName, string contactEmail, string defaultOrganizationDomain); - void DeleteContact(string accountName); - ExchangeContact GetContactGeneralSettings(string accountName); + // Contacts + void CreateContact(string organizationId, string organizationDistinguishedName, string contactDisplayName, string contactAccountName, string contactEmail, string defaultOrganizationDomain); + void DeleteContact(string accountName); + ExchangeContact GetContactGeneralSettings(string accountName); void SetContactGeneralSettings(string accountName, string displayName, string email, bool hideFromAddressBook, string firstName, string initials, string lastName, string address, string city, string state, string zip, string country, string jobTitle, string company, string department, string office, string managerAccountName, string businessPhone, string fax, string homePhone, string mobilePhone, string pager, string webPage, string notes, int useMapiRichTextFormat, string defaultDomain); - ExchangeContact GetContactMailFlowSettings(string accountName); - void SetContactMailFlowSettings(string accountName, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication); + ExchangeContact GetContactMailFlowSettings(string accountName); + void SetContactMailFlowSettings(string accountName, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication); - // Distribution Lists - void CreateDistributionList(string organizationId, string organizationDistinguishedName, string displayName, string accountName, string name, string domain, string managedBy); - void DeleteDistributionList(string accountName); - ExchangeDistributionList GetDistributionListGeneralSettings(string accountName); - void SetDistributionListGeneralSettings(string accountName, string displayName, bool hideFromAddressBook, string managedBy, string[] memebers, string notes); - void AddDistributionListMembers(string accountName, string[] memberAccounts); - void RemoveDistributionListMembers(string accountName, string[] memberAccounts); - ExchangeDistributionList GetDistributionListMailFlowSettings(string accountName); - void SetDistributionListMailFlowSettings(string accountName, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication); - ExchangeEmailAddress[] GetDistributionListEmailAddresses(string accountName); - void SetDistributionListEmailAddresses(string accountName, string[] emailAddresses); - void SetDistributionListPrimaryEmailAddress(string accountName, string emailAddress); - ExchangeDistributionList GetDistributionListPermissions(string organizationId, string accountName); - void SetDistributionListPermissions(string organizationId, string accountName, string[] sendAsAccounts, string[] sendOnBehalfAccounts); + // Distribution Lists + void CreateDistributionList(string organizationId, string organizationDistinguishedName, string displayName, string accountName, string name, string domain, string managedBy, string[] addressLists); + void DeleteDistributionList(string accountName); + ExchangeDistributionList GetDistributionListGeneralSettings(string accountName); + void SetDistributionListGeneralSettings(string accountName, string displayName, bool hideFromAddressBook, string managedBy, string[] memebers, string notes, string[] addressLists); + void AddDistributionListMembers(string accountName, string[] memberAccounts, string[] addressLists); + void RemoveDistributionListMembers(string accountName, string[] memberAccounts, string[] addressLists); + ExchangeDistributionList GetDistributionListMailFlowSettings(string accountName); + void SetDistributionListMailFlowSettings(string accountName, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication, string[] addressLists); + ExchangeEmailAddress[] GetDistributionListEmailAddresses(string accountName); + void SetDistributionListEmailAddresses(string accountName, string[] emailAddresses, string[] addressLists); + void SetDistributionListPrimaryEmailAddress(string accountName, string emailAddress, string[] addressLists); + ExchangeDistributionList GetDistributionListPermissions(string organizationId, string accountName); + void SetDistributionListPermissions(string organizationId, string accountName, string[] sendAsAccounts, string[] sendOnBehalfAccounts, string[] addressLists); // Public Folders void CreatePublicFolder(string organizationId, string securityGroup, string parentFolder, string folderName, bool mailEnabled, string accountName, string name, string domain); @@ -111,20 +112,20 @@ namespace WebsitePanel.Providers.HostedSolution string[] GetPublicFoldersRecursive(string parent); long GetPublicFolderSize(string folder); - //ActiveSync - void CreateOrganizationActiveSyncPolicy(string organizationId); - ExchangeActiveSyncPolicy GetActiveSyncPolicy(string organizationId); - void SetActiveSyncPolicy(string organizationId, bool allowNonProvisionableDevices, bool attachmentsEnabled, - int maxAttachmentSizeKB, bool uncAccessEnabled, bool wssAccessEnabled, bool devicePasswordEnabled, - bool alphanumericPasswordRequired, bool passwordRecoveryEnabled, bool deviceEncryptionEnabled, - bool allowSimplePassword, int maxPasswordFailedAttempts, int minPasswordLength, int inactivityLockMin, - int passwordExpirationDays, int passwordHistory, int refreshInterval); + //ActiveSync + void CreateOrganizationActiveSyncPolicy(string organizationId); + ExchangeActiveSyncPolicy GetActiveSyncPolicy(string organizationId); + void SetActiveSyncPolicy(string organizationId, bool allowNonProvisionableDevices, bool attachmentsEnabled, + int maxAttachmentSizeKB, bool uncAccessEnabled, bool wssAccessEnabled, bool devicePasswordEnabled, + bool alphanumericPasswordRequired, bool passwordRecoveryEnabled, bool deviceEncryptionEnabled, + bool allowSimplePassword, int maxPasswordFailedAttempts, int minPasswordLength, int inactivityLockMin, + int passwordExpirationDays, int passwordHistory, int refreshInterval); - //Mobile Devices - ExchangeMobileDevice[] GetMobileDevices(string accountName); - ExchangeMobileDevice GetMobileDevice(string id); - void WipeDataFromDevice(string id); - void CancelRemoteWipeRequest(string id); - void RemoveDevice(string id); - } + //Mobile Devices + ExchangeMobileDevice[] GetMobileDevices(string accountName); + ExchangeMobileDevice GetMobileDevice(string id); + void WipeDataFromDevice(string id); + void CancelRemoteWipeRequest(string id); + void RemoveDevice(string id); + } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/IOrganization.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/IOrganization.cs index 11cef205..15846f9c 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/IOrganization.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/IOrganization.cs @@ -33,10 +33,10 @@ namespace WebsitePanel.Providers.HostedSolution public interface IOrganization { Organization CreateOrganization(string organizationId); - + void DeleteOrganization(string organizationId); - void CreateUser(string organizationId, string loginName, string displayName, string upn, string password, bool enabled); + int CreateUser(string organizationId, string loginName, string displayName, string upn, string password, bool enabled); void DeleteUser(string loginName, string organizationId); @@ -49,7 +49,7 @@ namespace WebsitePanel.Providers.HostedSolution string jobTitle, string company, string department, string office, string managerAccountName, string businessPhone, string fax, string homePhone, string mobilePhone, string pager, - string webPage, string notes, string externalEmail); + string webPage, string notes, string externalEmail); bool OrganizationExists(string organizationId); @@ -58,5 +58,7 @@ namespace WebsitePanel.Providers.HostedSolution void CreateOrganizationDomain(string organizationDistinguishedName, string domain); PasswordPolicyResult GetPasswordPolicy(); + + string GetSamAccountNameByUserPrincipalName(string organizationId, string userPrincipalName); } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/Organization.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/Organization.cs index 677a52a7..3abfbd7f 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/Organization.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/Organization.cs @@ -41,12 +41,12 @@ namespace WebsitePanel.Providers.HostedSolution private string addressList; private string roomsAddressList; private string globalAddressList; + private string addressBookPolicy; + private string database; private string securityGroup; + private string lyncTenantId; private int diskSpace; - private int issueWarningKB; - private int prohibitSendKB; - private int prohibitSendReceiveKB; private int keepDeletedItemsDays; @@ -125,7 +125,7 @@ namespace WebsitePanel.Providers.HostedSolution get { return crmCurrency; } set { crmCurrency = value; } } - + [Persistent] public string DistinguishedName { @@ -151,7 +151,7 @@ namespace WebsitePanel.Providers.HostedSolution { return defaultDomain; } - } + } [Persistent] @@ -182,6 +182,13 @@ namespace WebsitePanel.Providers.HostedSolution set { globalAddressList = value; } } + [Persistent] + public string AddressBookPolicy + { + get { return addressBookPolicy; } + set { addressBookPolicy = value; } + } + [Persistent] public string Database { @@ -203,27 +210,6 @@ namespace WebsitePanel.Providers.HostedSolution set { diskSpace = value; } } - [Persistent] - public int IssueWarningKB - { - get { return issueWarningKB; } - set { issueWarningKB = value; } - } - - [Persistent] - public int ProhibitSendKB - { - get { return prohibitSendKB; } - set { prohibitSendKB = value; } - } - - [Persistent] - public int ProhibitSendReceiveKB - { - get { return prohibitSendReceiveKB; } - set { prohibitSendReceiveKB = value; } - } - [Persistent] public int KeepDeletedItemsDays { @@ -233,5 +219,15 @@ namespace WebsitePanel.Providers.HostedSolution [Persistent] public bool IsOCSOrganization { get; set; } + + + [Persistent] + public string LyncTenantId + { + get { return lyncTenantId; } + set { lyncTenantId = value; } + } + + } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationUser.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationUser.cs index 53d73e5f..d3e2b62c 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationUser.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationUser.cs @@ -37,6 +37,7 @@ namespace WebsitePanel.Providers.HostedSolution private int accountId; private int itemId; private int packageId; + private string subscriberNumber; private string primaryEmailAddress; private string accountPassword; @@ -298,5 +299,13 @@ namespace WebsitePanel.Providers.HostedSolution set { isBlackBerryUser = value; } } + public string SubscriberNumber + { + get { return subscriberNumber; } + set { subscriberNumber = value; } + } + + + } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/TransactionAction.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/TransactionAction.cs new file mode 100644 index 00000000..9b16e530 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/TransactionAction.cs @@ -0,0 +1,71 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace WebsitePanel.Providers.HostedSolution +{ + public class TransactionAction + { + private TransactionActionTypes actionType; + + public TransactionActionTypes ActionType + { + get { return actionType; } + set { actionType = value; } + } + + private string id; + + public string Id + { + get { return id; } + set { id = value; } + } + + private string suffix; + + public string Suffix + { + get { return suffix; } + set { suffix = value; } + } + + private string account; + + public string Account + { + get { return account; } + set { account = value; } + + } + + public enum TransactionActionTypes + { + CreateOrganizationUnit, + CreateGlobalAddressList, + CreateAddressList, + CreateAddressBookPolicy, + CreateOfflineAddressBook, + CreateDistributionGroup, + EnableDistributionGroup, + CreateAcceptedDomain, + AddUPNSuffix, + CreateMailbox, + CreateContact, + CreatePublicFolder, + CreateActiveSyncPolicy, + AddMailboxFullAccessPermission, + AddSendAsPermission, + RemoveMailboxFullAccessPermission, + RemoveSendAsPermission, + EnableMailbox, + LyncNewSipDomain, + LyncNewSimpleUrl, + LyncNewUser, + LyncNewConferencingPolicy, + LyncNewExternalAccessPolicy, + LyncNewMobilityPolicy + }; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj index 1d281456..a74bff15 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj @@ -79,6 +79,8 @@ + + diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs index 793ee9d6..d8f22589 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2007.cs @@ -28,6 +28,7 @@ using System; using System.IO; +using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Text; @@ -67,7 +68,6 @@ namespace WebsitePanel.Providers.HostedSolution #region Constants private const string CONFIG_CLEAR_QUERYBASEDN = "WebsitePanel.Exchange.ClearQueryBaseDN"; - private const string CONFIG_ENABLESP2ABP = "WebsitePanel.Exchange.enableSP2abp"; #endregion #region Properties @@ -87,7 +87,12 @@ namespace WebsitePanel.Providers.HostedSolution get { return ProviderSettings["MailboxDatabase"]; } } - internal int KeepDeletedItemsDays + internal bool PublicFolderDistributionEnabled + { + get { return ProviderSettings.GetBool("PublicFolderDistributionEnabled"); } + } + + internal int KeepDeletedItemsDays { get { return Int32.Parse(ProviderSettings["KeepDeletedItemsDays"]); } } @@ -152,10 +157,10 @@ namespace WebsitePanel.Providers.HostedSolution /// /// /// - public Organization ExtendToExchangeOrganization(string organizationId, string securityGroup) - { - return ExtendToExchangeOrganizationInternal(organizationId, securityGroup); - } + public Organization ExtendToExchangeOrganization(string organizationId, string securityGroup, bool IsConsumer) + { + return ExtendToExchangeOrganizationInternal(organizationId, securityGroup, IsConsumer); + } /// /// Creates organization OAB on the Client Access Server @@ -183,13 +188,18 @@ namespace WebsitePanel.Providers.HostedSolution return GetOABVirtualDirectoryInternal(); } - public bool DeleteOrganization(string organizationId, string distinguishedName, - string globalAddressList, string addressList, string roomsAddressList, string offlineAddressBook, - string securityGroup) - { - return DeleteOrganizationInternal(organizationId, distinguishedName, globalAddressList, - addressList, roomsAddressList, offlineAddressBook, securityGroup); - } + public Organization CreateOrganizationAddressBookPolicy(string organizationId, string gal, string addressBook, string roomList, string oab) + { + return CreateOrganizationAddressBookPolicyInternal(organizationId, gal, addressBook, roomList, oab); + } + + public bool DeleteOrganization(string organizationId, string distinguishedName, + string globalAddressList, string addressList, string roomList, string offlineAddressBook, + string securityGroup, string addressBookPolicy) + { + return DeleteOrganizationInternal(organizationId, distinguishedName, globalAddressList, + addressList, roomList, offlineAddressBook, securityGroup, addressBookPolicy); + } public void SetOrganizationStorageLimits(string organizationDistinguishedName, int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays) @@ -234,7 +244,7 @@ namespace WebsitePanel.Providers.HostedSolution SetMailboxPermissionsInternal(organizationId, accountName, sendAsAccounts, fullAccessAccounts); } - +/* public string CreateMailbox(string organizationId, string organizationDistinguishedName, string mailboxDatabase, string securityGroup, string offlineAddressBook, ExchangeAccountType accountType, string displayName, @@ -247,7 +257,7 @@ namespace WebsitePanel.Providers.HostedSolution enableOWA, enableMAPI, enableActiveSync, issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, keepDeletedItemsDays); } - +*/ public void DeleteMailbox(string accountName) { DeleteMailboxInternal(accountName); @@ -258,17 +268,9 @@ namespace WebsitePanel.Providers.HostedSolution return GetMailboxGeneralSettingsInternal(accountName); } - public void SetMailboxGeneralSettings(string accountName, string displayName, string password, - bool hideFromAddressBook, bool disabled, string firstName, string initials, string lastName, - string address, string city, string state, string zip, string country, string jobTitle, - string company, string department, string office, string managerAccountName, - string businessPhone, string fax, string homePhone, string mobilePhone, string pager, - string webPage, string notes) + public void SetMailboxGeneralSettings(string accountName, bool hideFromAddressBook, bool disabled) { - SetMailboxGeneralSettingsInternal(accountName, displayName, password, hideFromAddressBook, - disabled, firstName, initials, lastName, address, city, state, zip, country, jobTitle, - company, department, office, managerAccountName, businessPhone, fax, homePhone, - mobilePhone, pager, webPage, notes); + SetMailboxGeneralSettingsInternal(accountName, hideFromAddressBook, disabled); } public ExchangeMailbox GetMailboxMailFlowSettings(string accountName) @@ -276,29 +278,28 @@ namespace WebsitePanel.Providers.HostedSolution return GetMailboxMailFlowSettingsInternal(accountName); } - public void SetMailboxMailFlowSettings(string accountName, bool enableForwarding, - string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, - string[] acceptAccounts, string[] rejectAccounts, int maxRecipients, int maxSendMessageSizeKB, - int maxReceiveMessageSizeKB, bool requireSenderAuthentication) - { - SetMailboxMailFlowSettingsInternal(accountName, enableForwarding, forwardingAccountName, - forwardToBoth, sendOnBehalfAccounts, acceptAccounts, rejectAccounts, maxRecipients, - maxSendMessageSizeKB, maxReceiveMessageSizeKB, requireSenderAuthentication); - } + public void SetMailboxMailFlowSettings(string accountName, bool enableForwarding, + string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, + string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) + { + SetMailboxMailFlowSettingsInternal(accountName, enableForwarding, forwardingAccountName, + forwardToBoth, sendOnBehalfAccounts, acceptAccounts, rejectAccounts, requireSenderAuthentication); + } public ExchangeMailbox GetMailboxAdvancedSettings(string accountName) { return GetMailboxAdvancedSettingsInternal(accountName); } - public void SetMailboxAdvancedSettings(string organizationId, string accountName, bool enablePOP, - bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, - int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays) - { - SetMailboxAdvancedSettingsInternal(organizationId, accountName, enablePOP, enableIMAP, enableOWA, - enableMAPI, enableActiveSync, issueWarningKB, - prohibitSendKB, prohibitSendReceiveKB, keepDeletedItemsDays); - } + public void SetMailboxAdvancedSettings(string organizationId, string accountName, bool enablePOP, + bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, + int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays, int maxRecipients, int maxSendMessageSizeKB, + int maxReceiveMessageSizeKB) + { + SetMailboxAdvancedSettingsInternal(organizationId, accountName, enablePOP, enableIMAP, enableOWA, + enableMAPI, enableActiveSync, issueWarningKB, + prohibitSendKB, prohibitSendReceiveKB, keepDeletedItemsDays, maxRecipients, maxSendMessageSizeKB, maxReceiveMessageSizeKB); + } public ExchangeEmailAddress[] GetMailboxEmailAddresses(string accountName) { @@ -363,12 +364,12 @@ namespace WebsitePanel.Providers.HostedSolution #endregion #region Distribution lists - public void CreateDistributionList(string organizationId, string organizationDistinguishedName, - string displayName, string accountName, string name, string domain, string managedBy) - { - CreateDistributionListInternal(organizationId, organizationDistinguishedName, displayName, - accountName, name, domain, managedBy); - } + public void CreateDistributionList(string organizationId, string organizationDistinguishedName, + string displayName, string accountName, string name, string domain, string managedBy, string[] addressLists) + { + CreateDistributionListInternal(organizationId, organizationDistinguishedName, displayName, + accountName, name, domain, managedBy, addressLists); + } public void DeleteDistributionList(string accountName) { @@ -380,58 +381,59 @@ namespace WebsitePanel.Providers.HostedSolution return GetDistributionListGeneralSettingsInternal(accountName); } - public void SetDistributionListGeneralSettings(string accountName, string displayName, - bool hideFromAddressBook, string managedBy, string[] members, string notes) - { - SetDistributionListGeneralSettingsInternal(accountName, displayName, hideFromAddressBook, - managedBy, members, notes); - } + public void SetDistributionListGeneralSettings(string accountName, string displayName, + bool hideFromAddressBook, string managedBy, string[] members, string notes, string[] addressLists) + { + SetDistributionListGeneralSettingsInternal(accountName, displayName, hideFromAddressBook, + managedBy, members, notes, addressLists); + } - public void AddDistributionListMembers(string accountName, string[] memberAccounts) - { - AddDistributionListMembersInternal(accountName, memberAccounts); - } + public void AddDistributionListMembers(string accountName, string[] memberAccounts, string[] addressLists) + { + AddDistributionListMembersInternal(accountName, memberAccounts, addressLists); + } - public void RemoveDistributionListMembers(string accountName, string[] memberAccounts) - { - RemoveDistributionListMembersInternal(accountName, memberAccounts); - } + + public void RemoveDistributionListMembers(string accountName, string[] memberAccounts, string[] addressLists) + { + RemoveDistributionListMembersInternal(accountName, memberAccounts, addressLists); + } public ExchangeDistributionList GetDistributionListMailFlowSettings(string accountName) { return GetDistributionListMailFlowSettingsInternal(accountName); } - public void SetDistributionListMailFlowSettings(string accountName, string[] acceptAccounts, - string[] rejectAccounts, bool requireSenderAuthentication) - { - SetDistributionListMailFlowSettingsInternal(accountName, acceptAccounts, rejectAccounts, requireSenderAuthentication); - } + public void SetDistributionListMailFlowSettings(string accountName, string[] acceptAccounts, + string[] rejectAccounts, bool requireSenderAuthentication, string[] addressLists) + { + SetDistributionListMailFlowSettingsInternal(accountName, acceptAccounts, rejectAccounts, requireSenderAuthentication, addressLists); + } public ExchangeEmailAddress[] GetDistributionListEmailAddresses(string accountName) { return GetDistributionListEmailAddressesInternal(accountName); } - public void SetDistributionListEmailAddresses(string accountName, string[] emailAddresses) - { - SetDistributionListEmailAddressesInternal(accountName, emailAddresses); - } + public void SetDistributionListEmailAddresses(string accountName, string[] emailAddresses, string[] addressLists) + { + SetDistributionListEmailAddressesInternal(accountName, emailAddresses, addressLists); + } - public void SetDistributionListPrimaryEmailAddress(string accountName, string emailAddress) - { - SetDistributionListPrimaryEmailAddressInternal(accountName, emailAddress); - } + public void SetDistributionListPrimaryEmailAddress(string accountName, string emailAddress, string[] addressLists) + { + SetDistributionListPrimaryEmailAddressInternal(accountName, emailAddress, addressLists); + } public ExchangeDistributionList GetDistributionListPermissions(string organizationId, string accountName) { return GetDistributionListPermissionsInternal(organizationId, accountName, null); } - public void SetDistributionListPermissions(string organizationId, string accountName, string[] sendAsAccounts, string[] sendOnBehalfAccounts) - { - SetDistributionListPermissionsInternal(organizationId, accountName, sendAsAccounts, sendOnBehalfAccounts); - } + public void SetDistributionListPermissions(string organizationId, string accountName, string[] sendAsAccounts, string[] sendOnBehalfAccounts, string[] addressLists) + { + SetDistributionListPermissionsInternal(organizationId, accountName, sendAsAccounts, sendOnBehalfAccounts, addressLists); + } #endregion #region Public folders @@ -455,10 +457,10 @@ namespace WebsitePanel.Providers.HostedSolution public void DisableMailbox(string id) { - DisableMailboxIntenal(id); + DisableMailboxInternal(id); } - private void DisableMailboxIntenal(string id) + internal virtual void DisableMailboxInternal(string id) { ExchangeLog.LogStart("DisableMailboxIntenal"); Runspace runSpace = null; @@ -617,9 +619,9 @@ namespace WebsitePanel.Providers.HostedSolution if (item is Organization) { Organization org = item as Organization; - DeleteOrganization(org.OrganizationId, org.DistinguishedName, org.GlobalAddressList, - org.AddressList, org.RoomsAddressList, org.OfflineAddressBook, org.SecurityGroup); - } + DeleteOrganization(org.OrganizationId, org.DistinguishedName, org.GlobalAddressList, + org.AddressList, org.RoomsAddressList, org.OfflineAddressBook, org.SecurityGroup, org.AddressBookPolicy); + } else if (item is ExchangeDomain) { DeleteAcceptedDomain(item.Name); @@ -706,9 +708,9 @@ namespace WebsitePanel.Providers.HostedSolution /// /// /// - private Organization ExtendToExchangeOrganizationInternal(string organizationId, string securityGroup) - { - ExchangeLog.LogStart("CreateOrganizationInternal"); + internal virtual Organization ExtendToExchangeOrganizationInternal(string organizationId, string securityGroup, bool IsConsumer) + { + ExchangeLog.LogStart("CreateOrganizationInternal"); ExchangeLog.DebugInfo(" Organization Id: {0}", organizationId); ExchangeTransaction transaction = StartTransaction(); @@ -724,7 +726,7 @@ namespace WebsitePanel.Providers.HostedSolution //Create mail enabled organization security group EnableMailSecurityDistributionGroup(runSpace, securityGroup, organizationId); transaction.RegisterMailEnabledDistributionGroup(securityGroup); - UpdateSecurityDistributionGroup(runSpace, securityGroup, organizationId); + UpdateSecurityDistributionGroup(runSpace, securityGroup, organizationId, IsConsumer); //create GAL string galId = CreateGlobalAddressList(runSpace, organizationId); @@ -742,7 +744,7 @@ namespace WebsitePanel.Providers.HostedSolution string ralId = CreateRoomsAddressList(runSpace, organizationId); transaction.RegisterNewRoomsAddressList(ralId); ExchangeLog.LogInfo(" Rooms Address List: {0}", ralId); - UpdateRoomsAddressList(runSpace, ralId, securityGroupPath); + UpdateAddressList(runSpace, ralId, securityGroupPath); //create ActiveSync policy string asId = CreateActiveSyncPolicy(runSpace, organizationId); @@ -847,20 +849,6 @@ namespace WebsitePanel.Providers.HostedSolution transaction.RegisterNewOfflineAddressBook(oabId); UpdateOfflineAddressBook(runSpace, oabId, securityGroupId); info.OfflineAddressBook = oabId; - - //create ABP - - bool enableSP2abp = false; - if (ConfigurationManager.AppSettings[CONFIG_ENABLESP2ABP] != null) - enableSP2abp = Boolean.Parse(ConfigurationManager.AppSettings[CONFIG_ENABLESP2ABP]); - Version exchangeVersion = GetExchangeVersion(); - - if (enableSP2abp && (exchangeVersion >= new Version(14, 2))) - { - string abpId = CreateAddressPolicy(runSpace, organizationId); - transaction.RegisterNewAddressPolicy(abpId); - ExchangeLog.LogInfo(" Address Policy: {0}", abpId); - } } catch (Exception ex) { @@ -908,11 +896,17 @@ namespace WebsitePanel.Providers.HostedSolution } ExchangeLog.LogEnd("UpdateOrganizationOfflineAddressBookInternal"); } + + internal virtual Organization CreateOrganizationAddressBookPolicyInternal(string organizationId, string gal, string addressBook, string roomList, string oab) + { + Organization info = new Organization(); + return info; + } - private bool DeleteOrganizationInternal(string organizationId, string distinguishedName, - string globalAddressList, string addressList, string roomsAddressList, string offlineAddressBook, string securityGroup) - { + internal virtual bool DeleteOrganizationInternal(string organizationId, string distinguishedName, + string globalAddressList, string addressList, string roomsAddressList, string offlineAddressBook, string securityGroup, string addressBookPolicy) + { ExchangeLog.LogStart("DeleteOrganizationInternal"); bool ret = true; @@ -944,30 +938,6 @@ namespace WebsitePanel.Providers.HostedSolution if (!DeleteOrganizationPublicFolders(runSpace, organizationId)) ret = false; - //delete ABP - - bool enableSP2abp = false; - if (ConfigurationManager.AppSettings[CONFIG_ENABLESP2ABP] != null) - enableSP2abp = Boolean.Parse(ConfigurationManager.AppSettings[CONFIG_ENABLESP2ABP]); - Version exchangeVersion = GetExchangeVersion(); - - if (enableSP2abp && (exchangeVersion >= new Version(14, 2))) - { - - - string adpstring = GetAddressPolicyName(organizationId); - - try - { - if (!string.IsNullOrEmpty(adpstring)) - DeleteAddressPolicy(runSpace, adpstring); - } - catch (Exception ex) - { - ret = false; - ExchangeLog.LogError("Could not delete Address Policy " + globalAddressList, ex); - } - } //delete OAB try @@ -997,7 +967,7 @@ namespace WebsitePanel.Providers.HostedSolution try { if (!string.IsNullOrEmpty(roomsAddressList)) - DeleteRoomsAddressList(runSpace, roomsAddressList); + DeleteAddressList(runSpace, roomsAddressList); } catch (Exception ex) { @@ -1101,7 +1071,7 @@ namespace WebsitePanel.Providers.HostedSolution return ret; } - private bool DeleteOrganizationMailboxes(Runspace runSpace, string ou) + internal bool DeleteOrganizationMailboxes(Runspace runSpace, string ou) { ExchangeLog.LogStart("DeleteOrganizationMailboxes"); bool ret = true; @@ -1131,7 +1101,7 @@ namespace WebsitePanel.Providers.HostedSolution return ret; } - private bool DeleteOrganizationContacts(Runspace runSpace, string ou) + internal bool DeleteOrganizationContacts(Runspace runSpace, string ou) { ExchangeLog.LogStart("DeleteOrganizationContacts"); bool ret = true; @@ -1161,7 +1131,7 @@ namespace WebsitePanel.Providers.HostedSolution return ret; } - private bool DeleteOrganizationDistributionLists(Runspace runSpace, string ou) + internal bool DeleteOrganizationDistributionLists(Runspace runSpace, string ou) { ExchangeLog.LogStart("DeleteOrganizationDistributionLists"); bool ret = true; @@ -1392,7 +1362,7 @@ namespace WebsitePanel.Providers.HostedSolution return size; } - private long CalculatePublicFolderDiskSpace(Runspace runSpace, string folder) + internal virtual long CalculatePublicFolderDiskSpace(Runspace runSpace, string folder) { ExchangeLog.LogStart("CalculatePublicFolderDiskSpace"); ExchangeLog.DebugInfo("Folder: {0}", folder); @@ -1649,7 +1619,7 @@ namespace WebsitePanel.Providers.HostedSolution } - private void RemoveMailboxAccessPermission(Runspace runSpace, string accountName, string account, string accessRights) + internal void RemoveMailboxAccessPermission(Runspace runSpace, string accountName, string account, string accessRights) { ExchangeLog.LogStart("RemoveMailboxFullAccessPermission"); @@ -1779,167 +1749,165 @@ namespace WebsitePanel.Providers.HostedSolution public string CreateMailEnableUser(string upn, string organizationId, string organizationDistinguishedName, ExchangeAccountType accountType, - string mailboxDatabase, string offlineAddressBook, + string mailboxDatabase, string offlineAddressBook,string addressBookPolicy, string accountName, bool enablePOP, bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, - int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays) + int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays, + int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB, bool hideFromAddressBook, bool IsConsumer) { return CreateMailEnableUserInternal(upn, organizationId, organizationDistinguishedName, accountType, - mailboxDatabase, offlineAddressBook, + mailboxDatabase, offlineAddressBook,addressBookPolicy, accountName, enablePOP, enableIMAP, enableOWA, enableMAPI, enableActiveSync, issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, - keepDeletedItemsDays); + keepDeletedItemsDays, maxRecipients, maxSendMessageSizeKB, maxReceiveMessageSizeKB, hideFromAddressBook, IsConsumer); } - private string CreateMailEnableUserInternal(string upn, string organizationId, string organizationDistinguishedName, ExchangeAccountType accountType, - string mailboxDatabase, string offlineAddressBook, - string accountName, bool enablePOP, bool enableIMAP, - bool enableOWA, bool enableMAPI, bool enableActiveSync, - int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays) - { + internal virtual string CreateMailEnableUserInternal(string upn, string organizationId, string organizationDistinguishedName, ExchangeAccountType accountType, + string mailboxDatabase, string offlineAddressBook, string addressBookPolicy, + string accountName, bool enablePOP, bool enableIMAP, + bool enableOWA, bool enableMAPI, bool enableActiveSync, + int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays, + int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB, bool hideFromAddressBook, bool IsConsumer) + { - ExchangeLog.LogStart("CreateMailEnableUserInternal"); - ExchangeLog.DebugInfo("Organization Id: {0}", organizationId); + ExchangeLog.LogStart("CreateMailEnableUserInternal"); + ExchangeLog.DebugInfo("Organization Id: {0}", organizationId); - string ret = null; - ExchangeTransaction transaction = StartTransaction(); - Runspace runSpace = null; + string ret = null; + ExchangeTransaction transaction = StartTransaction(); + Runspace runSpace = null; - int attempts = 0; - string id = null; + int attempts = 0; + string id = null; Version exchangeVersion = GetExchangeVersion(); + + try + { + runSpace = OpenRunspace(); + Command cmd = null; + Collection result = null; + //try to enable mail user for 10 times + while (true) + { + try + { - try - { - runSpace = OpenRunspace(); - Command cmd = null; - Collection result = null; - - //try to enable mail user for 10 times - while (true) - { - try - { - //create mailbox - cmd = new Command("Enable-Mailbox"); - cmd.Parameters.Add("Identity", upn); - cmd.Parameters.Add("Alias", accountName); + //create mailbox + cmd = new Command("Enable-Mailbox"); + cmd.Parameters.Add("Identity", upn); + cmd.Parameters.Add("Alias", accountName); if (!(mailboxDatabase == "*" && exchangeVersion >= new Version(14, 0))) cmd.Parameters.Add("Database", mailboxDatabase); - if (accountType == ExchangeAccountType.Equipment) - cmd.Parameters.Add("Equipment"); - else if (accountType == ExchangeAccountType.Room) - cmd.Parameters.Add("Room"); + if (accountType == ExchangeAccountType.Equipment) + cmd.Parameters.Add("Equipment"); + else if (accountType == ExchangeAccountType.Room) + cmd.Parameters.Add("Room"); - result = ExecuteShellCommand(runSpace, cmd); + result = ExecuteShellCommand(runSpace, cmd); - id = CheckResultObjectDN(result); - } - catch (Exception ex) - { - ExchangeLog.LogError(ex); - } - if (id != null) - break; + id = CheckResultObjectDN(result); + } + catch (Exception ex) + { + ExchangeLog.LogError(ex); + } + if (id != null) + break; - if (attempts > 9) - throw new Exception( - string.Format("Could not enable mail user '{0}' ", accountName)); + if (attempts > 9) + throw new Exception( + string.Format("Could not enable mail user '{0}' ", accountName)); - attempts++; - ExchangeLog.LogWarning("Attempt #{0} to enable mail user failed!", attempts); - // wait 5 sec - System.Threading.Thread.Sleep(5000); - } + attempts++; + ExchangeLog.LogWarning("Attempt #{0} to enable mail user failed!", attempts); + // wait 5 sec + System.Threading.Thread.Sleep(5000); + } - //transaction.RegisterNewMailbox(id); + //transaction.RegisterNewMailbox(id); - string windowsEmailAddress = ObjToString(GetPSObjectProperty(result[0], "WindowsEmailAddress")); - string adpstring = GetAddressPolicyName(organizationId); + string windowsEmailAddress = ObjToString(GetPSObjectProperty(result[0], "WindowsEmailAddress")); - //update mailbox - cmd = new Command("Set-Mailbox"); - cmd.Parameters.Add("Identity", id); - cmd.Parameters.Add("OfflineAddressBook", offlineAddressBook); - cmd.Parameters.Add("EmailAddressPolicyEnabled", false); - cmd.Parameters.Add("CustomAttribute1", organizationId); - cmd.Parameters.Add("CustomAttribute3", windowsEmailAddress); - cmd.Parameters.Add("PrimarySmtpAddress", upn); - cmd.Parameters.Add("WindowsEmailAddress", upn); - - bool enableSP2abp = false; - if (ConfigurationManager.AppSettings[CONFIG_ENABLESP2ABP] != null) - enableSP2abp = Boolean.Parse(ConfigurationManager.AppSettings[CONFIG_ENABLESP2ABP]); - if (enableSP2abp && (exchangeVersion >= new Version(14, 2))) - cmd.Parameters.Add("AddressBookPolicy", adpstring); + //update mailbox + cmd = new Command("Set-Mailbox"); + cmd.Parameters.Add("Identity", id); + cmd.Parameters.Add("OfflineAddressBook", offlineAddressBook); + cmd.Parameters.Add("EmailAddressPolicyEnabled", false); + cmd.Parameters.Add("CustomAttribute1", organizationId); + cmd.Parameters.Add("CustomAttribute3", windowsEmailAddress); + cmd.Parameters.Add("PrimarySmtpAddress", upn); + cmd.Parameters.Add("WindowsEmailAddress", upn); - cmd.Parameters.Add("UseDatabaseQuotaDefaults", new bool?(false)); - cmd.Parameters.Add("UseDatabaseRetentionDefaults", false); - cmd.Parameters.Add("IssueWarningQuota", ConvertKBToUnlimited(issueWarningKB)); - cmd.Parameters.Add("ProhibitSendQuota", ConvertKBToUnlimited(prohibitSendKB)); - cmd.Parameters.Add("ProhibitSendReceiveQuota", ConvertKBToUnlimited(prohibitSendReceiveKB)); - cmd.Parameters.Add("RetainDeletedItemsFor", ConvertDaysToEnhancedTimeSpan(keepDeletedItemsDays)); - ExecuteShellCommand(runSpace, cmd); + cmd.Parameters.Add("UseDatabaseQuotaDefaults", new bool?(false)); + cmd.Parameters.Add("UseDatabaseRetentionDefaults", false); + cmd.Parameters.Add("IssueWarningQuota", ConvertKBToUnlimited(issueWarningKB)); + cmd.Parameters.Add("ProhibitSendQuota", ConvertKBToUnlimited(prohibitSendKB)); + cmd.Parameters.Add("ProhibitSendReceiveQuota", ConvertKBToUnlimited(prohibitSendReceiveKB)); + cmd.Parameters.Add("RetainDeletedItemsFor", ConvertDaysToEnhancedTimeSpan(keepDeletedItemsDays)); + cmd.Parameters.Add("RecipientLimits", ConvertInt32ToUnlimited(maxRecipients)); + cmd.Parameters.Add("MaxSendSize", ConvertKBToUnlimited(maxSendMessageSizeKB)); + cmd.Parameters.Add("MaxReceiveSize", ConvertKBToUnlimited(maxReceiveMessageSizeKB)); + cmd.Parameters.Add("HiddenFromAddressListsEnabled", hideFromAddressBook); + ExecuteShellCommand(runSpace, cmd); + //update AD object + string globalAddressListName = this.GetGlobalAddressListName(organizationId); + string globalAddressListDN = this.GetGlobalAddressListDN(runSpace, globalAddressListName); + string path = AddADPrefix(id); + DirectoryEntry mailbox = GetADObject(path); + // check if msExchQueryBaseDN must be cleared for Exchange 2010 SP1 + bool clearQueryBaseDN = false; + if (ConfigurationManager.AppSettings[CONFIG_CLEAR_QUERYBASEDN] != null) + clearQueryBaseDN = Boolean.Parse(ConfigurationManager.AppSettings[CONFIG_CLEAR_QUERYBASEDN]); - //update AD object - string globalAddressListName = this.GetGlobalAddressListName(organizationId); - string globalAddressListDN = this.GetGlobalAddressListDN(runSpace, globalAddressListName); - string path = AddADPrefix(id); - DirectoryEntry mailbox = GetADObject(path); + if (!(clearQueryBaseDN && (exchangeVersion >= new Version(14, 1)))) + SetADObjectPropertyValue(mailbox, "msExchQueryBaseDN", globalAddressListDN); - // check if msExchQueryBaseDN must be cleared for Exchange 2010 SP1 - bool clearQueryBaseDN = false; - if (ConfigurationManager.AppSettings[CONFIG_CLEAR_QUERYBASEDN] != null) - clearQueryBaseDN = Boolean.Parse(ConfigurationManager.AppSettings[CONFIG_CLEAR_QUERYBASEDN]); + //SetADObjectPropertyValue(mailbox, "msExchUseOAB", offlineAddressBook); + mailbox.CommitChanges(); + mailbox.Close(); - if (!(clearQueryBaseDN && (exchangeVersion >= new Version(14, 1)))) - SetADObjectPropertyValue(mailbox, "msExchQueryBaseDN", globalAddressListDN); + //Client Access + cmd = new Command("Set-CASMailbox"); + cmd.Parameters.Add("Identity", id); + cmd.Parameters.Add("ActiveSyncEnabled", enableActiveSync); + if (enableActiveSync) + { + cmd.Parameters.Add("ActiveSyncMailboxPolicy", organizationId); + } + cmd.Parameters.Add("OWAEnabled", enableOWA); + cmd.Parameters.Add("MAPIEnabled", enableMAPI); + cmd.Parameters.Add("PopEnabled", enablePOP); + cmd.Parameters.Add("ImapEnabled", enableIMAP); + ExecuteShellCommand(runSpace, cmd); - //SetADObjectPropertyValue(mailbox, "msExchUseOAB", offlineAddressBook); - mailbox.CommitChanges(); - mailbox.Close(); + //calendar settings + if (accountType == ExchangeAccountType.Equipment || accountType == ExchangeAccountType.Room) + { + //SetCalendarSettings(runSpace, id); + } - //Client Access - cmd = new Command("Set-CASMailbox"); - cmd.Parameters.Add("Identity", id); - cmd.Parameters.Add("ActiveSyncEnabled", enableActiveSync); - if (enableActiveSync) - { - cmd.Parameters.Add("ActiveSyncMailboxPolicy", organizationId); - } - cmd.Parameters.Add("OWAEnabled", enableOWA); - cmd.Parameters.Add("MAPIEnabled", enableMAPI); - cmd.Parameters.Add("PopEnabled", enablePOP); - cmd.Parameters.Add("ImapEnabled", enableIMAP); - ExecuteShellCommand(runSpace, cmd); - - //calendar settings - if (accountType == ExchangeAccountType.Equipment || accountType == ExchangeAccountType.Room) - { - SetCalendarSettings(runSpace, id); - } - - ret = string.Format("{0}\\{1}", GetNETBIOSDomainName(), accountName); - ExchangeLog.LogEnd("CreateMailEnableUserInternal"); - return ret; - } - catch (Exception ex) - { - ExchangeLog.LogError("CreateMailEnableUserInternal", ex); - RollbackTransaction(transaction); - throw; - } - finally - { - CloseRunspace(runSpace); - } - } + ret = string.Format("{0}\\{1}", GetNETBIOSDomainName(), accountName); + ExchangeLog.LogEnd("CreateMailEnableUserInternal"); + return ret; + } + catch (Exception ex) + { + ExchangeLog.LogError("CreateMailEnableUserInternal", ex); + RollbackTransaction(transaction); + throw; + } + finally + { + CloseRunspace(runSpace); + } + } + /* private string CreateMailboxInternal(string organizationId, string organizationDistinguishedName, string mailboxDatabase, string securityGroup, string offlineAddressBook, ExchangeAccountType accountType, string displayName, @@ -2074,7 +2042,7 @@ namespace WebsitePanel.Providers.HostedSolution CloseRunspace(runSpace); } } - +*/ internal virtual void SetCalendarSettings(Runspace runspace, string id) { ExchangeLog.LogStart("SetCalendarSettings"); @@ -2085,7 +2053,7 @@ namespace WebsitePanel.Providers.HostedSolution ExchangeLog.LogEnd("SetCalendarSettings"); } - private void DeleteMailboxInternal(string accountName) + internal virtual void DeleteMailboxInternal(string accountName) { ExchangeLog.LogStart("DeleteMailboxInternal"); ExchangeLog.DebugInfo("Account Name: {0}", accountName); @@ -2105,7 +2073,7 @@ namespace WebsitePanel.Providers.HostedSolution ExchangeLog.LogEnd("DeleteMailboxInternal"); } - private void RemoveMailbox(Runspace runSpace, string id) + internal void RemoveMailbox(Runspace runSpace, string id) { ExchangeLog.LogStart("RemoveMailbox"); Command cmd = new Command("Remove-Mailbox"); @@ -2116,6 +2084,16 @@ namespace WebsitePanel.Providers.HostedSolution ExchangeLog.LogEnd("RemoveMailbox"); } + private void DisableMailbox(Runspace runSpace, string id) + { + ExchangeLog.LogStart("DisableMailbox"); + Command cmd = new Command("Disable-Mailbox"); + cmd.Parameters.Add("Identity", id); + cmd.Parameters.Add("Confirm", false); + ExecuteShellCommand(runSpace, cmd); + ExchangeLog.LogEnd("DisableMailbox"); + } + private string GetMailboxCommonName(Runspace runSpace, string accountName) { ExchangeLog.LogStart("GetMailboxCommonName"); @@ -2212,71 +2190,39 @@ namespace WebsitePanel.Providers.HostedSolution } - private void SetMailboxGeneralSettingsInternal(string accountName, string displayName, string password, - bool hideFromAddressBook, bool disabled, string firstName, string initials, string lastName, - string address, string city, string state, string zip, string country, string jobTitle, - string company, string department, string office, string managerAccountName, string businessPhone, - string fax, string homePhone, string mobilePhone, string pager, string webPage, string notes) - { - ExchangeLog.LogStart("SetMailboxGeneralSettingsInternal"); - ExchangeLog.DebugInfo("Account: {0}", accountName); + private void SetMailboxGeneralSettingsInternal(string accountName, bool hideFromAddressBook, bool disabled) + { + ExchangeLog.LogStart("SetMailboxGeneralSettingsInternal"); + ExchangeLog.DebugInfo("Account: {0}", accountName); - Runspace runSpace = null; - try - { - runSpace = OpenRunspace(); + Runspace runSpace = null; + try + { + runSpace = OpenRunspace(); - Collection result = GetMailboxObject(runSpace, accountName); - PSObject mailbox = result[0]; + Collection result = GetMailboxObject(runSpace, accountName); + PSObject mailbox = result[0]; - string id = GetResultObjectDN(result); - string path = AddADPrefix(id); - DirectoryEntry entry = GetADObject(path); - entry.InvokeSet("AccountDisabled", disabled); - if (!string.IsNullOrEmpty(password)) - entry.Invoke("SetPassword", password); - entry.CommitChanges(); + string id = GetResultObjectDN(result); + string path = AddADPrefix(id); + DirectoryEntry entry = GetADObject(path); + entry.InvokeSet("AccountDisabled", disabled); + entry.CommitChanges(); - Command cmd = new Command("Set-Mailbox"); - cmd.Parameters.Add("Identity", accountName); - cmd.Parameters.Add("DisplayName", displayName); - cmd.Parameters.Add("HiddenFromAddressListsEnabled", hideFromAddressBook); - cmd.Parameters.Add("CustomAttribute2", (disabled ? "disabled" : null)); - ExecuteShellCommand(runSpace, cmd); + Command cmd = new Command("Set-Mailbox"); + cmd.Parameters.Add("Identity", accountName); + cmd.Parameters.Add("HiddenFromAddressListsEnabled", hideFromAddressBook); + cmd.Parameters.Add("CustomAttribute2", (disabled ? "disabled" : null)); + ExecuteShellCommand(runSpace, cmd); - cmd = new Command("Set-User"); - cmd.Parameters.Add("Identity", accountName); - cmd.Parameters.Add("FirstName", firstName); - cmd.Parameters.Add("Initials", initials); - cmd.Parameters.Add("LastName", lastName); - cmd.Parameters.Add("StreetAddress", address); - cmd.Parameters.Add("City", city); - cmd.Parameters.Add("StateOrProvince", state); - cmd.Parameters.Add("PostalCode", zip); - cmd.Parameters.Add("CountryOrRegion", ParseCountryInfo(country)); - cmd.Parameters.Add("Title", jobTitle); - cmd.Parameters.Add("Company", company); - cmd.Parameters.Add("Department", department); - cmd.Parameters.Add("Office", office); - cmd.Parameters.Add("Manager", managerAccountName); - cmd.Parameters.Add("Phone", businessPhone); - cmd.Parameters.Add("Fax", fax); - cmd.Parameters.Add("HomePhone", homePhone); - cmd.Parameters.Add("MobilePhone", mobilePhone); - cmd.Parameters.Add("Pager", pager); - cmd.Parameters.Add("WebPage", webPage); - cmd.Parameters.Add("Notes", notes); + } + finally + { - ExecuteShellCommand(runSpace, cmd); - - } - finally - { - - CloseRunspace(runSpace); - } - ExchangeLog.LogEnd("SetMailboxGeneralSettingsInternal"); - } + CloseRunspace(runSpace); + } + ExchangeLog.LogEnd("SetMailboxGeneralSettingsInternal"); + } private void ChangeMailboxState(string id, bool enabled) { @@ -2334,62 +2280,58 @@ namespace WebsitePanel.Providers.HostedSolution return info; } - private void SetMailboxMailFlowSettingsInternal(string accountName, bool enableForwarding, - string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, - string[] acceptAccounts, string[] rejectAccounts, int maxRecipients, int maxSendMessageSizeKB, - int maxReceiveMessageSizeKB, bool requireSenderAuthentication) - { - ExchangeLog.LogStart("SetMailboxMailFlowSettingsInternal"); - ExchangeLog.DebugInfo("Account: {0}", accountName); + private void SetMailboxMailFlowSettingsInternal(string accountName, bool enableForwarding, + string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, + string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) + { + ExchangeLog.LogStart("SetMailboxMailFlowSettingsInternal"); + ExchangeLog.DebugInfo("Account: {0}", accountName); - Runspace runSpace = null; - try - { - runSpace = OpenRunspace(); + Runspace runSpace = null; + try + { + runSpace = OpenRunspace(); - Command cmd = new Command("Set-Mailbox"); - cmd.Parameters.Add("Identity", accountName); + Command cmd = new Command("Set-Mailbox"); + cmd.Parameters.Add("Identity", accountName); - if (enableForwarding) - { - cmd.Parameters.Add("ForwardingAddress", forwardingAccountName); - cmd.Parameters.Add("DeliverToMailboxAndForward", forwardToBoth); - } - else - { - cmd.Parameters.Add("ForwardingAddress", null); - cmd.Parameters.Add("DeliverToMailboxAndForward", false); - } + if (enableForwarding) + { + cmd.Parameters.Add("ForwardingAddress", forwardingAccountName); + cmd.Parameters.Add("DeliverToMailboxAndForward", forwardToBoth); + } + else + { + cmd.Parameters.Add("ForwardingAddress", null); + cmd.Parameters.Add("DeliverToMailboxAndForward", false); + } - cmd.Parameters.Add("GrantSendOnBehalfTo", SetSendOnBehalfAccounts(runSpace, sendOnBehalfAccounts)); + cmd.Parameters.Add("GrantSendOnBehalfTo", SetSendOnBehalfAccounts(runSpace, sendOnBehalfAccounts)); - MultiValuedProperty ids = null; - MultiValuedProperty dlIds = null; + MultiValuedProperty ids = null; + MultiValuedProperty dlIds = null; - SetAccountIds(runSpace, acceptAccounts, out ids, out dlIds); - cmd.Parameters.Add("AcceptMessagesOnlyFrom", ids); - cmd.Parameters.Add("AcceptMessagesOnlyFromDLMembers", dlIds); + SetAccountIds(runSpace, acceptAccounts, out ids, out dlIds); + cmd.Parameters.Add("AcceptMessagesOnlyFrom", ids); + cmd.Parameters.Add("AcceptMessagesOnlyFromDLMembers", dlIds); - SetAccountIds(runSpace, rejectAccounts, out ids, out dlIds); - cmd.Parameters.Add("RejectMessagesFrom", ids); - cmd.Parameters.Add("RejectMessagesFromDLMembers", dlIds); + SetAccountIds(runSpace, rejectAccounts, out ids, out dlIds); + cmd.Parameters.Add("RejectMessagesFrom", ids); + cmd.Parameters.Add("RejectMessagesFromDLMembers", dlIds); - cmd.Parameters.Add("RecipientLimits", ConvertInt32ToUnlimited(maxRecipients)); - cmd.Parameters.Add("MaxSendSize", ConvertKBToUnlimited(maxSendMessageSizeKB)); - cmd.Parameters.Add("MaxReceiveSize", ConvertKBToUnlimited(maxReceiveMessageSizeKB)); - cmd.Parameters.Add("RequireSenderAuthenticationEnabled", requireSenderAuthentication); + cmd.Parameters.Add("RequireSenderAuthenticationEnabled", requireSenderAuthentication); - ExecuteShellCommand(runSpace, cmd); + ExecuteShellCommand(runSpace, cmd); - } - finally - { + } + finally + { - CloseRunspace(runSpace); - } - ExchangeLog.LogEnd("SetMailboxMailFlowSettingsInternal"); - } + CloseRunspace(runSpace); + } + ExchangeLog.LogEnd("SetMailboxMailFlowSettingsInternal"); + } private ExchangeMailbox GetMailboxAdvancedSettingsInternal(string accountName) { @@ -2464,48 +2406,52 @@ namespace WebsitePanel.Providers.HostedSolution return info; } - private void SetMailboxAdvancedSettingsInternal(string organizationId, string accountName, bool enablePOP, bool enableIMAP, - bool enableOWA, bool enableMAPI, bool enableActiveSync, int issueWarningKB, int prohibitSendKB, - int prohibitSendReceiveKB, int keepDeletedItemsDays) - { - ExchangeLog.LogStart("SetMailboxAdvancedSettingsInternal"); - ExchangeLog.DebugInfo("Account: {0}", accountName); + private void SetMailboxAdvancedSettingsInternal(string organizationId, string accountName, bool enablePOP, bool enableIMAP, + bool enableOWA, bool enableMAPI, bool enableActiveSync, int issueWarningKB, int prohibitSendKB, + int prohibitSendReceiveKB, int keepDeletedItemsDays, int maxRecipients, int maxSendMessageSizeKB, + int maxReceiveMessageSizeKB) + { + ExchangeLog.LogStart("SetMailboxAdvancedSettingsInternal"); + ExchangeLog.DebugInfo("Account: {0}", accountName); - Runspace runSpace = null; - try - { - runSpace = OpenRunspace(); + Runspace runSpace = null; + try + { + runSpace = OpenRunspace(); - Command cmd = new Command("Set-Mailbox"); - cmd.Parameters.Add("Identity", accountName); - cmd.Parameters.Add("IssueWarningQuota", ConvertKBToUnlimited(issueWarningKB)); - cmd.Parameters.Add("ProhibitSendQuota", ConvertKBToUnlimited(prohibitSendKB)); - cmd.Parameters.Add("ProhibitSendReceiveQuota", ConvertKBToUnlimited(prohibitSendReceiveKB)); - cmd.Parameters.Add("RetainDeletedItemsFor", ConvertDaysToEnhancedTimeSpan(keepDeletedItemsDays)); - ExecuteShellCommand(runSpace, cmd); + Command cmd = new Command("Set-Mailbox"); + cmd.Parameters.Add("Identity", accountName); + cmd.Parameters.Add("IssueWarningQuota", ConvertKBToUnlimited(issueWarningKB)); + cmd.Parameters.Add("ProhibitSendQuota", ConvertKBToUnlimited(prohibitSendKB)); + cmd.Parameters.Add("ProhibitSendReceiveQuota", ConvertKBToUnlimited(prohibitSendReceiveKB)); + cmd.Parameters.Add("RetainDeletedItemsFor", ConvertDaysToEnhancedTimeSpan(keepDeletedItemsDays)); + cmd.Parameters.Add("RecipientLimits", ConvertInt32ToUnlimited(maxRecipients)); + cmd.Parameters.Add("MaxSendSize", ConvertKBToUnlimited(maxSendMessageSizeKB)); + cmd.Parameters.Add("MaxReceiveSize", ConvertKBToUnlimited(maxReceiveMessageSizeKB)); + ExecuteShellCommand(runSpace, cmd); - //Client Access - cmd = new Command("Set-CASMailbox"); - cmd.Parameters.Add("Identity", accountName); - cmd.Parameters.Add("ActiveSyncEnabled", enableActiveSync); - if (enableActiveSync) - { - cmd.Parameters.Add("ActiveSyncMailboxPolicy", organizationId); - } - cmd.Parameters.Add("OWAEnabled", enableOWA); - cmd.Parameters.Add("MAPIEnabled", enableMAPI); - cmd.Parameters.Add("PopEnabled", enablePOP); - cmd.Parameters.Add("ImapEnabled", enableIMAP); - ExecuteShellCommand(runSpace, cmd); - } - finally - { + //Client Access + cmd = new Command("Set-CASMailbox"); + cmd.Parameters.Add("Identity", accountName); + cmd.Parameters.Add("ActiveSyncEnabled", enableActiveSync); + if (enableActiveSync) + { + cmd.Parameters.Add("ActiveSyncMailboxPolicy", organizationId); + } + cmd.Parameters.Add("OWAEnabled", enableOWA); + cmd.Parameters.Add("MAPIEnabled", enableMAPI); + cmd.Parameters.Add("PopEnabled", enablePOP); + cmd.Parameters.Add("ImapEnabled", enableIMAP); + ExecuteShellCommand(runSpace, cmd); + } + finally + { - CloseRunspace(runSpace); - } - ExchangeLog.LogEnd("SetMailboxAdvancedSettingsInternal"); - } + CloseRunspace(runSpace); + } + ExchangeLog.LogEnd("SetMailboxAdvancedSettingsInternal"); + } private ExchangeEmailAddress[] GetMailboxEmailAddressesInternal(string accountName) { @@ -3267,7 +3213,7 @@ namespace WebsitePanel.Providers.HostedSolution return id; } - private string EnableMailSecurityDistributionGroup(Runspace runSpace, string distName, string groupName) + internal string EnableMailSecurityDistributionGroup(Runspace runSpace, string distName, string groupName) { ExchangeLog.LogStart("EnableMailSecurityDistributionGroup"); ExchangeLog.DebugInfo("Group Distinguished Name: {0}", distName); @@ -3312,7 +3258,7 @@ namespace WebsitePanel.Providers.HostedSolution return securityGroupId; } - private void DisableMailSecurityDistributionGroup(Runspace runSpace, string id) + internal void DisableMailSecurityDistributionGroup(Runspace runSpace, string id) { ExchangeLog.LogStart("DisableMailSecurityDistributionGroup"); ExchangeLog.DebugInfo("Group Id: {0}", id); @@ -3324,7 +3270,7 @@ namespace WebsitePanel.Providers.HostedSolution } - private void UpdateSecurityDistributionGroup(Runspace runSpace, string id, string groupName) + internal void UpdateSecurityDistributionGroup(Runspace runSpace, string id, string groupName, bool isConsumer) { ExchangeLog.LogStart("UpdateSecurityDistributionGroup"); @@ -3332,21 +3278,22 @@ namespace WebsitePanel.Providers.HostedSolution cmd.Parameters.Add("Identity", id); cmd.Parameters.Add("EmailAddressPolicyEnabled", false); cmd.Parameters.Add("CustomAttribute1", groupName); - cmd.Parameters.Add("HiddenFromAddressListsEnabled", true); + cmd.Parameters.Add("HiddenFromAddressListsEnabled", !isConsumer); ExecuteShellCommand(runSpace, cmd); ExchangeLog.LogEnd("UpdateSecurityDistributionGroup"); } - private void CreateDistributionListInternal( - string organizationId, - string organizationDistinguishedName, - string displayName, - string accountName, - string name, - string domain, - string managedBy) - { + private void CreateDistributionListInternal( + string organizationId, + string organizationDistinguishedName, + string displayName, + string accountName, + string name, + string domain, + string managedBy, + string[] addressLists) + { ExchangeLog.LogStart("CreateDistributionListInternal"); ExchangeLog.DebugInfo("Organization Id: {0}", organizationId); ExchangeLog.DebugInfo("Name: {0}", name); @@ -3395,6 +3342,11 @@ namespace WebsitePanel.Providers.HostedSolution cmd.Parameters.Add("WindowsEmailAddress", email); cmd.Parameters.Add("RequireSenderAuthenticationEnabled", false); ExecuteShellCommand(runSpace, cmd); + + //fix showInAddressBook Attribute + if (addressLists.Length > 0) + FixShowInAddressBook(runSpace, email, addressLists); + } catch (Exception ex) { @@ -3410,6 +3362,23 @@ namespace WebsitePanel.Providers.HostedSolution ExchangeLog.LogEnd("CreateDistributionListInternal"); } + private void FixShowInAddressBook(Runspace runSpace, string accountName, string[] addressLists) + { + Command cmd = new Command("Get-DistributionGroup"); + cmd.Parameters.Add("Identity", accountName); + + Collection result = ExecuteShellCommand(runSpace, cmd); + string id = GetResultObjectDN(result); + + DirectoryEntry dlDEEntry = GetADObject(AddADPrefix(id)); + dlDEEntry.Properties["showInAddressBook"].Clear(); + foreach (string addressList in addressLists) + { + dlDEEntry.Properties["showInAddressBook"].Add(addressList); + } + dlDEEntry.CommitChanges(); + } + private void DeleteDistributionListInternal(string accountName) { ExchangeLog.LogStart("DeleteDistributionListInternal"); @@ -3490,9 +3459,9 @@ namespace WebsitePanel.Providers.HostedSolution return ObjToString(GetPSObjectProperty(group, "ManagedBy")); } - private void SetDistributionListGeneralSettingsInternal(string accountName, string displayName, - bool hideFromAddressBook, string managedBy, string[] memberAccounts, string notes) - { + private void SetDistributionListGeneralSettingsInternal(string accountName, string displayName, + bool hideFromAddressBook, string managedBy, string[] memberAccounts, string notes, string[] addressLists) + { ExchangeLog.LogStart("SetDistributionListGeneralSettingsInternal"); ExchangeLog.DebugInfo("Account: {0}", accountName); @@ -3561,6 +3530,10 @@ namespace WebsitePanel.Providers.HostedSolution { AddADPermission(runSpace, accountName, managedBy, "WriteProperty", null, "Member"); } + + if (addressLists.Length > 0) + FixShowInAddressBook(runSpace, accountName, addressLists); + } finally { @@ -3605,7 +3578,7 @@ namespace WebsitePanel.Providers.HostedSolution } - private void AddDistributionListMembersInternal(string accountName, string[] memberAccounts) + private void AddDistributionListMembersInternal(string accountName, string[] memberAccounts, string[] addressLists) { ExchangeLog.LogStart("AddDistributionListMembersInternal"); ExchangeLog.DebugInfo("Account: {0}", accountName); @@ -3624,8 +3597,13 @@ namespace WebsitePanel.Providers.HostedSolution cmd = new Command("Add-DistributionGroupMember"); cmd.Parameters.Add("Identity", accountName); cmd.Parameters.Add("Member", member); + cmd.Parameters.Add("BypassSecurityGroupManagerCheck", true); ExecuteShellCommand(runSpace, cmd); } + + if (addressLists.Length > 0) + FixShowInAddressBook(runSpace, accountName, addressLists); + } finally { @@ -3636,7 +3614,7 @@ namespace WebsitePanel.Providers.HostedSolution ExchangeLog.LogEnd("AddDistributionListMembersInternal"); } - private void RemoveDistributionListMembersInternal(string accountName, string[] memberAccounts) + private void RemoveDistributionListMembersInternal(string accountName, string[] memberAccounts, string[] addressLists) { ExchangeLog.LogStart("RemoveDistributionListMembersInternal"); ExchangeLog.DebugInfo("Account: {0}", accountName); @@ -3658,6 +3636,10 @@ namespace WebsitePanel.Providers.HostedSolution cmd.Parameters.Add("Confirm", false); ExecuteShellCommand(runSpace, cmd); } + + if (addressLists.Length > 0) + FixShowInAddressBook(runSpace, accountName, addressLists); + } finally { @@ -3698,9 +3680,9 @@ namespace WebsitePanel.Providers.HostedSolution return info; } - private void SetDistributionListMailFlowSettingsInternal(string accountName, - string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) - { + private void SetDistributionListMailFlowSettingsInternal(string accountName, + string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication, string[] addressLists) + { ExchangeLog.LogStart("SetDistributionListMailFlowSettingsInternal"); ExchangeLog.DebugInfo("Account: {0}", accountName); @@ -3727,6 +3709,9 @@ namespace WebsitePanel.Providers.HostedSolution ExecuteShellCommand(runSpace, cmd); + if (addressLists.Length > 0) + FixShowInAddressBook(runSpace, accountName, addressLists); + } finally { @@ -3809,7 +3794,7 @@ namespace WebsitePanel.Providers.HostedSolution return list.ToArray(); } - private void SetDistributionListEmailAddressesInternal(string accountName, string[] emailAddresses) + private void SetDistributionListEmailAddressesInternal(string accountName, string[] emailAddresses, string[] addressLists) { ExchangeLog.LogStart("SetDistributionListEmailAddressesInternal"); ExchangeLog.DebugInfo("Account: {0}", accountName); @@ -3859,6 +3844,9 @@ namespace WebsitePanel.Providers.HostedSolution cmd.Parameters.Add("WindowsEmailAddress", primaryEmail); } ExecuteShellCommand(runSpace, cmd); + + if (addressLists.Length > 0) + FixShowInAddressBook(runSpace, accountName, addressLists); } finally { @@ -3868,7 +3856,7 @@ namespace WebsitePanel.Providers.HostedSolution ExchangeLog.LogEnd("SetDistributionListEmailAddressesInternal"); } - private void SetDistributionListPrimaryEmailAddressInternal(string accountName, string emailAddress) + private void SetDistributionListPrimaryEmailAddressInternal(string accountName, string emailAddress, string[] addressLists) { ExchangeLog.LogStart("SetDistributionListPrimaryEmailAddressInternal"); ExchangeLog.DebugInfo("Account: {0}", accountName); @@ -3886,6 +3874,8 @@ namespace WebsitePanel.Providers.HostedSolution cmd.Parameters.Add("WindowsEmailAddress", primaryEmail); ExecuteShellCommand(runSpace, cmd); + + } finally { @@ -3941,7 +3931,7 @@ namespace WebsitePanel.Providers.HostedSolution return exchangeDistributionList; } - private void SetDistributionListPermissionsInternal(string organizationId, string accountName, string[] sendAsAccounts, string[] sendOnBehalfAccounts) + private void SetDistributionListPermissionsInternal(string organizationId, string accountName, string[] sendAsAccounts, string[] sendOnBehalfAccounts, string[] addressLists) { ExchangeLog.LogStart("SetDistributionListPermissionsInternal"); @@ -3964,6 +3954,9 @@ namespace WebsitePanel.Providers.HostedSolution SetSendAsPermissions(runspace, distributionList.SendAsAccounts, cn, sendAsAccounts); SetDistributionListSendOnBehalfAccounts(runspace, accountName, sendOnBehalfAccounts); + if (addressLists.Length > 0) + FixShowInAddressBook(runspace, accountName, addressLists); + } catch (Exception ex) { @@ -4760,7 +4753,7 @@ namespace WebsitePanel.Providers.HostedSolution return resultObjectDN; } - private string CreateAddressList(Runspace runSpace, string organizationId) + internal string CreateAddressList(Runspace runSpace, string organizationId) { ExchangeLog.LogStart("CreateAddressList"); string addressListName = this.GetAddressListName(organizationId); @@ -4812,7 +4805,60 @@ namespace WebsitePanel.Providers.HostedSolution return addressListDN; } - private void UpdateAddressList(Runspace runSpace, string id, string securityGroup) + internal string CreateRoomsAddressList(Runspace runSpace, string organizationId) + { + ExchangeLog.LogStart("CreateRoomList"); + string addressListName = this.GetRoomsAddressListName(organizationId); + string addressListDN = this.GetAddressListDN(runSpace, addressListName); + if (!string.IsNullOrEmpty(addressListDN)) + { + //address list already exists - we will use it + ExchangeLog.LogWarning("Room List '{0}' already exists", new object[] { addressListName }); + } + else + { + //try to create a new address list (10 attempts) + int attempts = 0; + Command cmd = null; + Collection result = null; + + while (true) + { + try + { + //try to create address list + cmd = new Command("New-AddressList"); + cmd.Parameters.Add("Name", addressListName); + cmd.Parameters.Add("IncludedRecipients", "Resources"); + cmd.Parameters.Add("ConditionalCustomAttribute1", organizationId); + + result = ExecuteShellCommand(runSpace, cmd); + addressListDN = CheckResultObjectDN(result); + } + catch (Exception ex) + { + ExchangeLog.LogError(ex); + } + if (addressListDN != null) + break; + + if (attempts > 9) + throw new Exception( + string.Format("Could not create Room List '{0}' ", addressListName)); + + attempts++; + ExchangeLog.LogWarning("Attempt #{0} to create room list failed!", attempts); + // wait 1 sec + System.Threading.Thread.Sleep(1000); + } + } + + ExchangeLog.LogEnd("CreateRoomList"); + return addressListDN; + } + + + internal void UpdateAddressList(Runspace runSpace, string id, string securityGroup) { ExchangeLog.LogStart("UpdateAddressList"); @@ -4826,7 +4872,7 @@ namespace WebsitePanel.Providers.HostedSolution ExchangeLog.LogEnd("UpdateAddressList"); } - private void DeleteAddressList(Runspace runSpace, string id) + internal void DeleteAddressList(Runspace runSpace, string id) { ExchangeLog.LogStart("DeleteAddressList"); Command cmd = new Command("Remove-AddressList"); @@ -4836,116 +4882,33 @@ namespace WebsitePanel.Providers.HostedSolution ExchangeLog.LogEnd("DeleteAddressList"); } - private string GetRoomsAddressListDN(Runspace runSpace, string id) + + internal virtual void DeleteAddressBookPolicy(Runspace runSpace, string id) { - ExchangeLog.LogStart("GetRoomsAddressListDN"); + ExchangeLog.LogStart("DeleteAddressBookPolicy"); + ExchangeLog.LogEnd("DeleteAddressBookPolicy"); + } + + + + internal string GetGlobalAddressListDN(Runspace runSpace, string id) + { + ExchangeLog.LogStart("GetGlobalAddressListDN"); string resultObjectDN = null; - Command cmd = new Command("Get-AddressList"); + Command cmd = new Command("Get-GlobalAddressList"); cmd.Parameters.Add("Identity", id); Collection result = this.ExecuteShellCommand(runSpace, cmd); if ((result != null) && (result.Count > 0)) { resultObjectDN = this.GetResultObjectDN(result); - ExchangeLog.DebugInfo("RAL DN: {0}", new object[] { resultObjectDN }); + ExchangeLog.DebugInfo("GAL DN: {0}", new object[] { resultObjectDN }); } - ExchangeLog.DebugInfo("GetRommsAddressListDN, cmd = {0}", cmd.CommandText); - ExchangeLog.LogEnd("GetRoomsAddressListDN"); + ExchangeLog.LogEnd("GetGlobalAddressListDN"); return resultObjectDN; } - private string CreateRoomsAddressList(Runspace runSpace, string organizationId) - { - ExchangeLog.LogStart("CreateRoomsAddressList"); - string roomsAddressListName = this.GetRoomsAddressListName(organizationId); - string roomsAddressListDN = this.GetRoomsAddressListDN(runSpace, roomsAddressListName); - if (!string.IsNullOrEmpty(roomsAddressListDN)) - { - //rooms address list already exists - we will use it - ExchangeLog.LogWarning("Rooms Address List '{0}' already exists", new object[] { roomsAddressListName }); - } - else - { - //try to create a new rooms address list (10 attempts) - int attempts = 0; - Command cmd = null; - Collection result = null; - while (true) - { - try - { - //try to create address list - cmd = new Command("New-AddressList"); - cmd.Parameters.Add("Name", roomsAddressListName); - cmd.Parameters.Add("IncludedRecipients", "Resources"); - cmd.Parameters.Add("ConditionalCustomAttribute1", organizationId); - - result = ExecuteShellCommand(runSpace, cmd); - roomsAddressListDN = CheckResultObjectDN(result); - } - catch (Exception ex) - { - ExchangeLog.LogError(ex); - } - if (roomsAddressListDN != null) - break; - - if (attempts > 9) - throw new Exception( - string.Format("Could not create Rooms Address List '{0}' cmd = '{1}'", roomsAddressListName, cmd)); - - attempts++; - ExchangeLog.LogWarning("Attempt #{0} to create rooms address list failed!", attempts); - // wait 1 sec - System.Threading.Thread.Sleep(1000); - } - } - - ExchangeLog.LogEnd("CreateRoomsAddressList"); - return roomsAddressListDN; - } - - private void UpdateRoomsAddressList(Runspace runSpace, string id, string securityGroup) - { - ExchangeLog.LogStart("UpdateRoomsAddressList"); - - string path = AddADPrefix(id); - Command cmd = new Command("Update-AddressList"); - cmd.Parameters.Add("Identity", id); - ExecuteShellCommand(runSpace, cmd); - - AdjustADSecurity(path, securityGroup, false); - - ExchangeLog.LogEnd("UpdateRoomsAddressList"); - } - - private void DeleteRoomsAddressList(Runspace runSpace, string id) - { - ExchangeLog.LogStart("DeleteRoomsAddressList"); - Command cmd = new Command("Remove-AddressList"); - cmd.Parameters.Add("Identity", id); - cmd.Parameters.Add("Confirm", false); - ExecuteShellCommand(runSpace, cmd); - ExchangeLog.LogEnd("DeleteRoomsAddressList"); - } - - private string GetGlobalAddressListDN(Runspace runSpace, string id) - { - ExchangeLog.LogStart("GetGlobalAddressListDN"); - string resultObjectDN = null; - Command cmd = new Command("Get-GlobalAddressList"); - cmd.Parameters.Add("Identity", id); - Collection result = this.ExecuteShellCommand(runSpace, cmd); - if ((result != null) && (result.Count > 0)) - { - resultObjectDN = this.GetResultObjectDN(result); - ExchangeLog.DebugInfo("GAL DN: {0}", new object[] { resultObjectDN }); - } - ExchangeLog.LogEnd("GetGlobalAddressListDN"); - return resultObjectDN; - } - - private string CreateGlobalAddressList(Runspace runSpace, string organizationId) + internal string CreateGlobalAddressList(Runspace runSpace, string organizationId) { ExchangeLog.LogStart("CreateGlobalAddressList"); @@ -4962,7 +4925,7 @@ namespace WebsitePanel.Providers.HostedSolution return id; } - private void UpdateGlobalAddressList(Runspace runSpace, string id, string securityGroup) + internal void UpdateGlobalAddressList(Runspace runSpace, string id, string securityGroup) { ExchangeLog.LogStart("UpdateGlobalAddressList"); @@ -4977,7 +4940,7 @@ namespace WebsitePanel.Providers.HostedSolution ExchangeLog.LogEnd("UpdateGlobalAddressList"); } - private void DeleteGlobalAddressList(Runspace runSpace, string id) + internal void DeleteGlobalAddressList(Runspace runSpace, string id) { ExchangeLog.LogStart("DeleteGlobalAddressList"); Command cmd = new Command("Remove-GlobalAddressList"); @@ -4989,44 +4952,39 @@ namespace WebsitePanel.Providers.HostedSolution private string CreateOfflineAddressBook(Runspace runSpace, string organizationId, string server, string oabVirtualDirs) { - ExchangeLog.LogStart("CreateOfflineAddressBook"); + ExchangeLog.LogStart("CreateOfflineAddressBook"); - string oabName = GetOfflineAddressBookName(organizationId); + string oabName = GetOfflineAddressBookName(organizationId); + string addressListName = GetAddressListName(organizationId); - bool enableSP2abp = false; - if (ConfigurationManager.AppSettings[CONFIG_ENABLESP2ABP] != null) - enableSP2abp = Boolean.Parse(ConfigurationManager.AppSettings[CONFIG_ENABLESP2ABP]); - Version exchangeVersion = GetExchangeVersion(); - string addressListName; - if (enableSP2abp && (exchangeVersion >= new Version(14, 2))) - { - // Ex2010SP2 with ABP support, want to use GAL for OAB - addressListName = GetGlobalAddressListName(organizationId); - } - else - { - // Ex2007 or Ex2010 without ABP support, have to use AL for OAB - addressListName = GetAddressListName(organizationId); - } + Command cmd = new Command("New-OfflineAddressBook"); + cmd.Parameters.Add("Name", oabName); + cmd.Parameters.Add("Server", server); + cmd.Parameters.Add("AddressLists", addressListName); + cmd.Parameters.Add("PublicFolderDistributionEnabled", PublicFolderDistributionEnabled); + cmd.Parameters.Add("IsDefault", false); - Command cmd = new Command("New-OfflineAddressBook"); - cmd.Parameters.Add("Name", oabName); - cmd.Parameters.Add("Server", server); - cmd.Parameters.Add("AddressLists", addressListName); - cmd.Parameters.Add("PublicFolderDistributionEnabled", true); - cmd.Parameters.Add("IsDefault", false); - if (!string.IsNullOrEmpty(oabVirtualDirs)) - { - cmd.Parameters.Add("VirtualDirectories", oabVirtualDirs); - } - Collection result = ExecuteShellCommand(runSpace, cmd); - string id = GetResultObjectDN(result); + //TODO: fix web distribution + if (!string.IsNullOrEmpty(oabVirtualDirs)) + { + ArrayList virtualDirs = new ArrayList(); + string[] strTmp = oabVirtualDirs.Split(','); + foreach (string s in strTmp) + { + virtualDirs.Add(s); + } - ExchangeLog.LogEnd("CreateOfflineAddressBook"); + cmd.Parameters.Add("VirtualDirectories", (String[])virtualDirs.ToArray(typeof(string))); + } - return id; - } + Collection result = ExecuteShellCommand(runSpace, cmd); + string id = GetResultObjectDN(result); + + ExchangeLog.LogEnd("CreateOfflineAddressBook"); + + return id; + } private void UpdateOfflineAddressBook(Runspace runSpace, string id, string securityGroup) { @@ -5044,7 +5002,7 @@ namespace WebsitePanel.Providers.HostedSolution } - private void DeleteOfflineAddressBook(Runspace runSpace, string id) + internal void DeleteOfflineAddressBook(Runspace runSpace, string id) { ExchangeLog.LogStart("DeleteOfflineAddressBook"); Command cmd = new Command("Remove-OfflineAddressBook"); @@ -5054,31 +5012,6 @@ namespace WebsitePanel.Providers.HostedSolution ExchangeLog.LogEnd("DeleteOfflineAddressBook"); } - private string CreateAddressPolicy(Runspace runSpace, string organizationId) - { - ExchangeLog.LogStart("CreateAddressPolicy"); - - string ABP = GetAddressPolicyName(organizationId); - string AL = GetAddressListName(organizationId); - string GAL = GetGlobalAddressListName(organizationId); - string OAB = GetOfflineAddressBookName(organizationId); - string RL = GetRoomsAddressListName(organizationId); - - Command cmd = new Command("New-AddressBookPolicy"); - cmd.Parameters.Add("Name", ABP); - cmd.Parameters.Add("GlobalAddressList", GAL); - cmd.Parameters.Add("OfflineAddressBook", OAB); - cmd.Parameters.Add("AddressLists", AL); - cmd.Parameters.Add("RoomList", RL); - - - Collection result = ExecuteShellCommand(runSpace, cmd); - string id = GetResultObjectDN(result); - - ExchangeLog.LogEnd("CreateAddressPolicy"); - return id; - } - private void DeleteAddressPolicy(Runspace runSpace, string id) { ExchangeLog.LogStart("DeleteAddressPolicy"); @@ -5094,7 +5027,7 @@ namespace WebsitePanel.Providers.HostedSolution return orgName + " Address List"; } - private string GetGlobalAddressListName(string orgName) + internal string GetGlobalAddressListName(string orgName) { return orgName + " Global Address List"; } @@ -5103,7 +5036,8 @@ namespace WebsitePanel.Providers.HostedSolution { return orgName + " Offline Address Book"; } - private string GetAddressPolicyName(string orgName) + + internal string GetAddressBookPolicyName(string orgName) { return orgName + " Address Policy"; } @@ -5162,7 +5096,7 @@ namespace WebsitePanel.Providers.HostedSolution ExchangeLog.LogEnd("DeleteADObject"); } - private DirectoryEntry GetRootOU() + private DirectoryEntry GetRootOU() { ExchangeLog.LogStart("GetRootOU"); StringBuilder sb = new StringBuilder(); @@ -5177,7 +5111,7 @@ namespace WebsitePanel.Providers.HostedSolution return de; } - private void SetADObjectProperty(DirectoryEntry oDE, string name, string value) + private void SetADObjectProperty(DirectoryEntry oDE, string name, string value) { if (!string.IsNullOrEmpty(value)) { @@ -5192,14 +5126,14 @@ namespace WebsitePanel.Providers.HostedSolution } } - private void SetADObjectPropertyValue(DirectoryEntry oDE, string name, string value) + internal void SetADObjectPropertyValue(DirectoryEntry oDE, string name, string value) { PropertyValueCollection collection = oDE.Properties[name]; collection.Value = value; } - private void AddADObjectProperty(DirectoryEntry oDE, string name, string value) + internal void AddADObjectProperty(DirectoryEntry oDE, string name, string value) { if (!string.IsNullOrEmpty(value)) { @@ -5208,7 +5142,7 @@ namespace WebsitePanel.Providers.HostedSolution } } - private DirectoryEntry GetADObject(string path) + internal DirectoryEntry GetADObject(string path) { DirectoryEntry de = null; if (path.StartsWith("LDAP://" + PrimaryDomainController + "/", true, CultureInfo.InvariantCulture)) @@ -5226,7 +5160,7 @@ namespace WebsitePanel.Providers.HostedSolution return de; } - private object GetADObjectProperty(DirectoryEntry entry, string name) + internal object GetADObjectProperty(DirectoryEntry entry, string name) { if (entry.Properties.Contains(name)) return entry.Properties[name][0]; @@ -5234,6 +5168,18 @@ namespace WebsitePanel.Providers.HostedSolution return String.Empty; } + + private string GetOrganizationPath(string organizationId) + { + StringBuilder sb = new StringBuilder(); + // append provider + AppendOUPath(sb, organizationId); + AppendOUPath(sb, RootOU); + AppendDomainPath(sb, RootDomain); + + return sb.ToString(); + } + private void AppendProtocol(StringBuilder sb) { sb.Append("LDAP://"); @@ -5270,7 +5216,7 @@ namespace WebsitePanel.Providers.HostedSolution } } - private string AddADPrefix(string path) + internal string AddADPrefix(string path) { string dn = path; if (!dn.ToUpper().StartsWith("LDAP://")) @@ -5296,7 +5242,7 @@ namespace WebsitePanel.Providers.HostedSolution return dn; } - private string ConvertADPathToCanonicalName(string name) + internal string ConvertADPathToCanonicalName(string name) { if (string.IsNullOrEmpty(name)) @@ -5355,7 +5301,7 @@ namespace WebsitePanel.Providers.HostedSolution } - private void AdjustADSecurity(string objPath, string securityGroupPath, bool isAddressBook) + internal virtual void AdjustADSecurity(string objPath, string securityGroupPath, bool isAddressBook) { ExchangeLog.LogStart("AdjustADSecurity"); ExchangeLog.DebugInfo(" Active Direcory object: {0}", objPath); @@ -5487,7 +5433,7 @@ namespace WebsitePanel.Providers.HostedSolution ExchangeLog.LogEnd("AddGlobalUPNSuffix"); }*/ - private string GetNETBIOSDomainName() + internal string GetNETBIOSDomainName() { ExchangeLog.LogStart("GetNETBIOSDomainName"); string ret = string.Empty; @@ -6026,7 +5972,7 @@ namespace WebsitePanel.Providers.HostedSolution ExchangeLog.LogEnd("CreateOrganizationActiveSyncPolicyInternal"); } - private string CreateActiveSyncPolicy(Runspace runSpace, string organizationId) + internal string CreateActiveSyncPolicy(Runspace runSpace, string organizationId) { ExchangeLog.LogStart("CreateActiveSyncPolicy"); Command cmd = new Command("New-ActiveSyncMailboxPolicy"); @@ -6039,7 +5985,7 @@ namespace WebsitePanel.Providers.HostedSolution return id; } - private void DeleteActiveSyncPolicy(Runspace runSpace, string id) + internal void DeleteActiveSyncPolicy(Runspace runSpace, string id) { ExchangeLog.LogStart("DeleteActiveSyncPolicy"); Command cmd = new Command("Remove-ActiveSyncMailboxPolicy"); @@ -6175,35 +6121,43 @@ namespace WebsitePanel.Providers.HostedSolution private ExchangeMobileDevice[] GetMobileDevicesInternal(string accountName) { - ExchangeLog.LogStart("GetMobileDevicesInternal"); - ExchangeLog.DebugInfo("Account name: {0}", accountName); + ExchangeLog.LogStart("GetMobileDevicesInternal"); + ExchangeLog.DebugInfo("Account name: {0}", accountName); - List devices = new List(); - ExchangeMobileDevice device = null; + List devices = new List(); + ExchangeMobileDevice device = null; - Runspace runSpace = null; - try - { - runSpace = OpenRunspace(); - Command cmd = new Command("Get-ActiveSyncDeviceStatistics"); - cmd.Parameters.Add("Mailbox", accountName); - Collection result = ExecuteShellCommand(runSpace, cmd); + Runspace runSpace = null; + try + { + runSpace = OpenRunspace(); + Command cmd = new Command("Get-ActiveSyncDeviceStatistics"); + cmd.Parameters.Add("Mailbox", accountName); - if (result != null) - { - foreach (PSObject obj in result) - { - device = GetMobileDeviceObject(obj); - devices.Add(device); - } - } - } - finally - { - CloseRunspace(runSpace); - } - ExchangeLog.LogEnd("GetMobileDevicesInternal"); - return devices.ToArray(); + Collection result = null; + try + { + result = ExecuteShellCommand(runSpace, cmd); + } + catch (Exception) + { + } + + if (result != null) + { + foreach (PSObject obj in result) + { + device = GetMobileDeviceObject(obj); + devices.Add(device); + } + } + } + finally + { + CloseRunspace(runSpace); + } + ExchangeLog.LogEnd("GetMobileDevicesInternal"); + return devices.ToArray(); } private ExchangeMobileDevice GetMobileDeviceObject(PSObject obj) @@ -6616,7 +6570,7 @@ namespace WebsitePanel.Providers.HostedSolution return ret; } - private string GetServerName() + internal string GetServerName() { string ret = null; if (!string.IsNullOrEmpty(MailboxCluster)) @@ -6659,12 +6613,12 @@ namespace WebsitePanel.Providers.HostedSolution #region Transactions - private ExchangeTransaction StartTransaction() + internal ExchangeTransaction StartTransaction() { return new ExchangeTransaction(); } - private void RollbackTransaction(ExchangeTransaction transaction) + internal void RollbackTransaction(ExchangeTransaction transaction) { ExchangeLog.LogStart("RollbackTransaction"); Runspace runSpace = null; @@ -6703,58 +6657,61 @@ namespace WebsitePanel.Providers.HostedSolution ExchangeLog.LogInfo("Rollback action: {0}", action.ActionType); switch (action.ActionType) { - case TransactionAction.TransactionActionTypes.CreateOrganizationUnit: - DeleteADObject(action.Id); - break; - case TransactionAction.TransactionActionTypes.CreateDistributionGroup: - RemoveDistributionGroup(runspace, action.Id); - break; - case TransactionAction.TransactionActionTypes.EnableDistributionGroup: - DisableMailSecurityDistributionGroup(runspace, action.Id); - break; - case TransactionAction.TransactionActionTypes.CreateGlobalAddressList: - DeleteGlobalAddressList(runspace, action.Id); - break; - case TransactionAction.TransactionActionTypes.CreateAddressList: - DeleteAddressList(runspace, action.Id); - break; - case TransactionAction.TransactionActionTypes.CreateRoomsAddressList: - DeleteRoomsAddressList(runspace, action.Id); + case TransactionAction.TransactionActionTypes.CreateOrganizationUnit: + DeleteADObject(action.Id); break; - case TransactionAction.TransactionActionTypes.CreateOfflineAddressBook: - DeleteOfflineAddressBook(runspace, action.Id); - break; - case TransactionAction.TransactionActionTypes.CreateActiveSyncPolicy: - DeleteActiveSyncPolicy(runspace, action.Id); - break; - case TransactionAction.TransactionActionTypes.CreateAcceptedDomain: - RemoveAcceptedDomain(runspace, action.Id); - break; - case TransactionAction.TransactionActionTypes.AddUPNSuffix: - RemoveUPNSuffix(action.Id, action.Suffix); - break; - case TransactionAction.TransactionActionTypes.CreateMailbox: - RemoveMailbox(runspace, action.Id); - break; - case TransactionAction.TransactionActionTypes.CreateContact: - RemoveContact(runspace, action.Id); - break; - case TransactionAction.TransactionActionTypes.CreatePublicFolder: - RemovePublicFolder(runspace, action.Id); - break; - case TransactionAction.TransactionActionTypes.AddMailboxFullAccessPermission: - RemoveMailboxAccessPermission(runspace, action.Account, action.Id, "FullAccess"); - break; - case TransactionAction.TransactionActionTypes.AddSendAsPermission: - RemoveADPermission(runspace, action.Account, action.Id, null, "Send-as", null); - break; - case TransactionAction.TransactionActionTypes.RemoveMailboxFullAccessPermission: - SetMailboxPermission(runspace, action.Account, action.Id, "FullAccess"); - break; - case TransactionAction.TransactionActionTypes.RemoveSendAsPermission: - SetExtendedRights(runspace, action.Account, action.Id, "Send-as"); - break; - } + case TransactionAction.TransactionActionTypes.CreateDistributionGroup: + RemoveDistributionGroup(runspace, action.Id); + break; + case TransactionAction.TransactionActionTypes.EnableDistributionGroup: + DisableMailSecurityDistributionGroup(runspace, action.Id); + break; + case TransactionAction.TransactionActionTypes.CreateGlobalAddressList: + DeleteGlobalAddressList(runspace, action.Id); + break; + case TransactionAction.TransactionActionTypes.CreateAddressList: + DeleteAddressList(runspace, action.Id); + break; + case TransactionAction.TransactionActionTypes.CreateAddressBookPolicy: + DeleteAddressBookPolicy(runspace, action.Id); + break; + case TransactionAction.TransactionActionTypes.CreateOfflineAddressBook: + DeleteOfflineAddressBook(runspace, action.Id); + break; + case TransactionAction.TransactionActionTypes.CreateActiveSyncPolicy: + DeleteActiveSyncPolicy(runspace, action.Id); + break; + case TransactionAction.TransactionActionTypes.CreateAcceptedDomain: + RemoveAcceptedDomain(runspace, action.Id); + break; + case TransactionAction.TransactionActionTypes.AddUPNSuffix: + RemoveUPNSuffix(action.Id, action.Suffix); + break; + case TransactionAction.TransactionActionTypes.CreateMailbox: + RemoveMailbox(runspace, action.Id); + break; + case TransactionAction.TransactionActionTypes.EnableMailbox: + DisableMailbox(runspace, action.Id); + break; + case TransactionAction.TransactionActionTypes.CreateContact: + RemoveContact(runspace, action.Id); + break; + case TransactionAction.TransactionActionTypes.CreatePublicFolder: + RemovePublicFolder(runspace, action.Id); + break; + case TransactionAction.TransactionActionTypes.AddMailboxFullAccessPermission: + RemoveMailboxAccessPermission(runspace, action.Account, action.Id, "FullAccess"); + break; + case TransactionAction.TransactionActionTypes.AddSendAsPermission: + RemoveADPermission(runspace, action.Account, action.Id, null, "Send-as", null); + break; + case TransactionAction.TransactionActionTypes.RemoveMailboxFullAccessPermission: + SetMailboxPermission(runspace, action.Account, action.Id, "FullAccess"); + break; + case TransactionAction.TransactionActionTypes.RemoveSendAsPermission: + SetExtendedRights(runspace, action.Account, action.Id, "Send-as"); + break; + } } #endregion } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2010.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2010.cs index 63c46ed2..fdb674cf 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2010.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2010.cs @@ -167,7 +167,7 @@ namespace WebsitePanel.Providers.HostedSolution return runspace; } - private static Assembly ResolveExchangeAssembly(object p, ResolveEventArgs args) + internal static Assembly ResolveExchangeAssembly(object p, ResolveEventArgs args) { //Add path for the Exchange 2007 DLLs if (args.Name.Contains("Microsoft.Exchange")) diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2010SP2.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2010SP2.cs new file mode 100644 index 00000000..e2b16d4f --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/Exchange2010SP2.cs @@ -0,0 +1,753 @@ +// 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.Configuration; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Text; +using System.Reflection; +using System.Globalization; +using System.Collections; + +using System.DirectoryServices; +using System.Security; +using System.Security.Principal; +using System.Security.AccessControl; + +using System.Management.Automation; +using System.Management.Automation.Runspaces; + +using WebsitePanel.Providers; +using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.Providers.Utils; +using WebsitePanel.Server.Utils; +using Microsoft.Exchange.Data.Directory.Recipient; +using Microsoft.Win32; + +using Microsoft.Exchange.Data; +using Microsoft.Exchange.Data.Directory; +using Microsoft.Exchange.Data.Storage; + +namespace WebsitePanel.Providers.HostedSolution +{ + public class Exchange2010SP2 : Exchange2010 + { + #region Static constructor + + static private Hashtable htBbalancer = new Hashtable(); + + static Exchange2010SP2() + { + AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(ResolveExchangeAssembly); + ExchangeRegistryPath = "SOFTWARE\\Microsoft\\ExchangeServer\\v14\\Setup"; + } + #endregion + + + #region Organization + /// + /// Creates organization on Mail Server + /// + /// + /// + internal override Organization ExtendToExchangeOrganizationInternal(string organizationId, string securityGroup, bool IsConsumer) + { + ExchangeLog.LogStart("CreateOrganizationInternal"); + ExchangeLog.DebugInfo(" Organization Id: {0}", organizationId); + + ExchangeTransaction transaction = StartTransaction(); + Organization info = new Organization(); + Runspace runSpace = null; + try + { + runSpace = OpenRunspace(); + + string server = GetServerName(); + string securityGroupPath = AddADPrefix(securityGroup); + + //Create mail enabled organization security group + EnableMailSecurityDistributionGroup(runSpace, securityGroup, organizationId); + transaction.RegisterMailEnabledDistributionGroup(securityGroup); + UpdateSecurityDistributionGroup(runSpace, securityGroup, organizationId, IsConsumer); + + //create GAL + string galId = CreateGlobalAddressList(runSpace, organizationId); + transaction.RegisterNewGlobalAddressList(galId); + ExchangeLog.LogInfo(" Global Address List: {0}", galId); + UpdateGlobalAddressList(runSpace, galId, securityGroupPath); + + //create AL + string alId = CreateAddressList(runSpace, organizationId); + transaction.RegisterNewAddressList(alId); + ExchangeLog.LogInfo(" Address List: {0}", alId); + UpdateAddressList(runSpace, alId, securityGroupPath); + + //create RAL + string ralId = CreateRoomsAddressList(runSpace, organizationId); + transaction.RegisterNewRoomsAddressList(ralId); + ExchangeLog.LogInfo(" Rooms Address List: {0}", ralId); + UpdateAddressList(runSpace, ralId, securityGroupPath); + + //create ActiveSync policy + string asId = CreateActiveSyncPolicy(runSpace, organizationId); + transaction.RegisterNewActiveSyncPolicy(asId); + ExchangeLog.LogInfo(" ActiveSync Policy: {0}", asId); + + info.AddressList = alId; + info.GlobalAddressList = galId; + info.RoomsAddressList = ralId; + info.OrganizationId = organizationId; + } + catch (Exception ex) + { + ExchangeLog.LogError("CreateOrganizationInternal", ex); + RollbackTransaction(transaction); + throw; + } + finally + { + + CloseRunspace(runSpace); + } + ExchangeLog.LogEnd("CreateOrganizationInternal"); + return info; + } + + + internal override Organization CreateOrganizationAddressBookPolicyInternal(string organizationId, string gal, string addressBook, string roomList, string oab) + { + ExchangeLog.LogStart("CreateOrganizationAddressBookPolicyInternal"); + ExchangeLog.LogInfo(" Organization Id: {0}", organizationId); + ExchangeLog.LogInfo(" GAL: {0}", gal); + ExchangeLog.LogInfo(" AddressBook: {0}", addressBook); + ExchangeLog.LogInfo(" RoomList: {0}", roomList); + ExchangeLog.LogInfo(" OAB: {0}", oab); + + ExchangeTransaction transaction = StartTransaction(); + + Organization info = new Organization(); + string policyName = GetAddressBookPolicyName(organizationId); + + Runspace runSpace = null; + try + { + runSpace = OpenRunspace(); + Command cmd = new Command("New-AddressBookPolicy"); + cmd.Parameters.Add("Name", policyName); + cmd.Parameters.Add("AddressLists", addressBook); + cmd.Parameters.Add("RoomList", roomList); + cmd.Parameters.Add("GlobalAddressList", gal); + cmd.Parameters.Add("OfflineAddressBook", oab); + + Collection result = ExecuteShellCommand(runSpace, cmd); + info.AddressBookPolicy = GetResultObjectDN(result); + + } + catch (Exception ex) + { + ExchangeLog.LogError("CreateOrganizationAddressBookPolicyInternal", ex); + RollbackTransaction(transaction); + throw; + } + finally + { + + CloseRunspace(runSpace); + } + ExchangeLog.LogEnd("CreateOrganizationAddressBookPolicyInternal"); + return info; + } + + internal override bool DeleteOrganizationInternal(string organizationId, string distinguishedName, + string globalAddressList, string addressList, string roomList, string offlineAddressBook, string securityGroup, string addressBookPolicy) + { + ExchangeLog.LogStart("DeleteOrganizationInternal"); + bool ret = true; + + Runspace runSpace = null; + try + { + runSpace = OpenRunspace(); + + + string ou = ConvertADPathToCanonicalName(distinguishedName); + + if (!DeleteOrganizationMailboxes(runSpace, ou)) + ret = false; + + if (!DeleteOrganizationContacts(runSpace, ou)) + ret = false; + + if (!DeleteOrganizationDistributionLists(runSpace, ou)) + ret = false; + + //delete AddressBookPolicy + try + { + if (!string.IsNullOrEmpty(addressBookPolicy)) + DeleteAddressBookPolicy(runSpace, addressBookPolicy); + } + catch (Exception ex) + { + ret = false; + ExchangeLog.LogError("Could not delete AddressBook Policy " + addressBookPolicy, ex); + } + + //delete OAB + try + { + if (!string.IsNullOrEmpty(offlineAddressBook)) + DeleteOfflineAddressBook(runSpace, offlineAddressBook); + } + catch (Exception ex) + { + ret = false; + ExchangeLog.LogError("Could not delete Offline Address Book " + offlineAddressBook, ex); + } + + //delete AL + try + { + if (!string.IsNullOrEmpty(addressList)) + DeleteAddressList(runSpace, addressList); + } + catch (Exception ex) + { + ret = false; + ExchangeLog.LogError("Could not delete Address List " + addressList, ex); + } + + //delete RL + try + { + if (!string.IsNullOrEmpty(roomList)) + DeleteAddressList(runSpace, roomList); + } + catch (Exception ex) + { + ret = false; + ExchangeLog.LogError("Could not delete Address List " + roomList, ex); + } + + + //delete GAL + try + { + if (!string.IsNullOrEmpty(globalAddressList)) + DeleteGlobalAddressList(runSpace, globalAddressList); + } + catch (Exception ex) + { + ret = false; + ExchangeLog.LogError("Could not delete Global Address List " + globalAddressList, ex); + } + + //delete ActiveSync policy + try + { + DeleteActiveSyncPolicy(runSpace, organizationId); + } + catch (Exception ex) + { + ret = false; + ExchangeLog.LogError("Could not delete ActiveSyncPolicy " + organizationId, ex); + } + + //disable mail security distribution group + try + { + DisableMailSecurityDistributionGroup(runSpace, securityGroup); + } + catch (Exception ex) + { + ret = false; + ExchangeLog.LogError("Could not disable mail security distribution group " + securityGroup, ex); + } + } + catch (Exception ex) + { + ret = false; + ExchangeLog.LogError("DeleteOrganizationInternal", ex); + throw; + } + finally + { + + CloseRunspace(runSpace); + } + ExchangeLog.LogEnd("DeleteOrganizationInternal"); + return ret; + } + + internal override void DeleteAddressBookPolicy(Runspace runSpace, string id) + { + ExchangeLog.LogStart("DeleteAddressBookPolicy"); + //if (id != "IsConsumer") + //{ + Command cmd = new Command("Remove-AddressBookPolicy"); + cmd.Parameters.Add("Identity", id); + cmd.Parameters.Add("Confirm", false); + ExecuteShellCommand(runSpace, cmd); + //} + ExchangeLog.LogEnd("DeleteAddressBookPolicy"); + } + + #endregion + + #region Mailbox + internal override string CreateMailEnableUserInternal(string upn, string organizationId, string organizationDistinguishedName, ExchangeAccountType accountType, + string mailboxDatabase, string offlineAddressBook, string addressBookPolicy, + string accountName, bool enablePOP, bool enableIMAP, + bool enableOWA, bool enableMAPI, bool enableActiveSync, + int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays, + int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB, bool hideFromAddressBook, bool IsConsumer) + { + + ExchangeLog.LogStart("CreateMailEnableUserInternal"); + ExchangeLog.DebugInfo("Organization Id: {0}", organizationId); + + string ret = null; + ExchangeTransaction transaction = StartTransaction(); + Runspace runSpace = null; + + int attempts = 0; + string id = null; + + try + { + runSpace = OpenRunspace(); + Command cmd = null; + Collection result = null; + + //try to enable mail user for 10 times + while (true) + { + try + { + //create mailbox + cmd = new Command("Enable-Mailbox"); + cmd.Parameters.Add("Identity", upn); + cmd.Parameters.Add("Alias", accountName); + string database = GetDatabase(runSpace, PrimaryDomainController, mailboxDatabase); + ExchangeLog.DebugInfo("database: " + database); + if (database != string.Empty) + { + cmd.Parameters.Add("Database", database); + } + if (accountType == ExchangeAccountType.Equipment) + cmd.Parameters.Add("Equipment"); + else if (accountType == ExchangeAccountType.Room) + cmd.Parameters.Add("Room"); + + result = ExecuteShellCommand(runSpace, cmd); + + id = CheckResultObjectDN(result); + } + catch (Exception ex) + { + ExchangeLog.LogError(ex); + } + if (id != null) + break; + + if (attempts > 9) + throw new Exception( + string.Format("Could not enable mail user '{0}' ", upn)); + + attempts++; + ExchangeLog.LogWarning("Attempt #{0} to enable mail user failed!", attempts); + // wait 5 sec + System.Threading.Thread.Sleep(1000); + } + + transaction.RegisterEnableMailbox(id); + + string windowsEmailAddress = ObjToString(GetPSObjectProperty(result[0], "WindowsEmailAddress")); + + //update mailbox + cmd = new Command("Set-Mailbox"); + cmd.Parameters.Add("Identity", id); + cmd.Parameters.Add("OfflineAddressBook", offlineAddressBook); + cmd.Parameters.Add("EmailAddressPolicyEnabled", false); + cmd.Parameters.Add("CustomAttribute1", organizationId); + cmd.Parameters.Add("CustomAttribute3", windowsEmailAddress); + cmd.Parameters.Add("PrimarySmtpAddress", upn); + cmd.Parameters.Add("WindowsEmailAddress", upn); + + cmd.Parameters.Add("UseDatabaseQuotaDefaults", new bool?(false)); + cmd.Parameters.Add("UseDatabaseRetentionDefaults", false); + cmd.Parameters.Add("IssueWarningQuota", ConvertKBToUnlimited(issueWarningKB)); + cmd.Parameters.Add("ProhibitSendQuota", ConvertKBToUnlimited(prohibitSendKB)); + cmd.Parameters.Add("ProhibitSendReceiveQuota", ConvertKBToUnlimited(prohibitSendReceiveKB)); + cmd.Parameters.Add("RetainDeletedItemsFor", ConvertDaysToEnhancedTimeSpan(keepDeletedItemsDays)); + cmd.Parameters.Add("RecipientLimits", ConvertInt32ToUnlimited(maxRecipients)); + cmd.Parameters.Add("MaxSendSize", ConvertKBToUnlimited(maxSendMessageSizeKB)); + cmd.Parameters.Add("MaxReceiveSize", ConvertKBToUnlimited(maxReceiveMessageSizeKB)); + if (IsConsumer) cmd.Parameters.Add("HiddenFromAddressListsEnabled", true); + else + cmd.Parameters.Add("HiddenFromAddressListsEnabled", hideFromAddressBook); + cmd.Parameters.Add("AddressBookPolicy", addressBookPolicy); + ExecuteShellCommand(runSpace, cmd); + + //Client Access + cmd = new Command("Set-CASMailbox"); + cmd.Parameters.Add("Identity", id); + cmd.Parameters.Add("ActiveSyncEnabled", enableActiveSync); + if (enableActiveSync) + { + cmd.Parameters.Add("ActiveSyncMailboxPolicy", organizationId); + } + cmd.Parameters.Add("OWAEnabled", enableOWA); + cmd.Parameters.Add("MAPIEnabled", enableMAPI); + cmd.Parameters.Add("PopEnabled", enablePOP); + cmd.Parameters.Add("ImapEnabled", enableIMAP); + ExecuteShellCommand(runSpace, cmd); + + //add to the security group + cmd = new Command("Add-DistributionGroupMember"); + cmd.Parameters.Add("Identity", organizationId); + cmd.Parameters.Add("Member", id); + cmd.Parameters.Add("BypassSecurityGroupManagerCheck", true); + ExecuteShellCommand(runSpace, cmd); + + if (!IsConsumer) + { + //Set-MailboxFolderPermission for calendar + cmd = new Command("Add-MailboxFolderPermission"); + cmd.Parameters.Add("Identity", id + ":\\calendar"); + cmd.Parameters.Add("AccessRights", "Reviewer"); + cmd.Parameters.Add("User", organizationId); + ExecuteShellCommand(runSpace, cmd); + } + cmd = new Command("Set-MailboxFolderPermission"); + cmd.Parameters.Add("Identity", id + ":\\calendar"); + cmd.Parameters.Add("AccessRights", "None"); + cmd.Parameters.Add("User", "Default"); + ExecuteShellCommand(runSpace, cmd); + + ret = string.Format("{0}\\{1}", GetNETBIOSDomainName(), accountName); + ExchangeLog.LogEnd("CreateMailEnableUserInternal"); + return ret; + } + catch (Exception ex) + { + ExchangeLog.LogError("CreateMailEnableUserInternal", ex); + RollbackTransaction(transaction); + throw; + } + finally + { + CloseRunspace(runSpace); + } + } + + + internal override void DisableMailboxInternal(string id) + { + ExchangeLog.LogStart("DisableMailboxInternal"); + Runspace runSpace = null; + try + { + runSpace = OpenRunspace(); + + Command cmd = new Command("Get-Mailbox"); + cmd.Parameters.Add("Identity", id); + Collection result = ExecuteShellCommand(runSpace, cmd); + + if (result != null && result.Count > 0) + { + string upn = ObjToString(GetPSObjectProperty(result[0], "UserPrincipalName")); + + string addressbookPolicy = ObjToString(GetPSObjectProperty(result[0], "AddressBookPolicy")); + + cmd = new Command("Disable-Mailbox"); + cmd.Parameters.Add("Identity", id); + cmd.Parameters.Add("Confirm", false); + ExecuteShellCommand(runSpace, cmd); + + if (addressbookPolicy == (upn + " AP")) + { + try + { + DeleteAddressBookPolicy(runSpace, upn + " AP"); + } + catch (Exception) + { + } + + try + { + DeleteGlobalAddressList(runSpace, upn + " GAL"); + } + catch (Exception) + { + } + + try + { + DeleteAddressList(runSpace, upn + " AL"); + } + catch (Exception) + { + } + } + + + } + + } + + finally + { + + CloseRunspace(runSpace); + } + ExchangeLog.LogEnd("DisableMailboxInternal"); + } + + + internal override void DeleteMailboxInternal(string accountName) + { + ExchangeLog.LogStart("DeleteMailboxInternal"); + ExchangeLog.DebugInfo("Account Name: {0}", accountName); + + Runspace runSpace = null; + try + { + runSpace = OpenRunspace(); + + Command cmd = new Command("Get-Mailbox"); + cmd.Parameters.Add("Identity", accountName); + Collection result = ExecuteShellCommand(runSpace, cmd); + + if (result != null && result.Count > 0) + { + string upn = ObjToString(GetPSObjectProperty(result[0], "UserPrincipalName")); + string addressbookPolicy = ObjToString(GetPSObjectProperty(result[0], "AddressBookPolicy")); + + RemoveMailbox(runSpace, accountName); + + if (addressbookPolicy == (upn + " AP")) + { + try + { + DeleteAddressBookPolicy(runSpace, upn + " AP"); + } + catch (Exception) + { + } + + try + { + DeleteGlobalAddressList(runSpace, upn + " GAL"); + } + catch (Exception) + { + } + + try + { + DeleteAddressList(runSpace, upn + " AL"); + } + catch (Exception) + { + } + } + } + + + } + finally + { + + CloseRunspace(runSpace); + } + ExchangeLog.LogEnd("DeleteMailboxInternal"); + } + + + internal string GetDatabase(Runspace runSpace, string primaryDomainController, string dagName) + { + string database = string.Empty; + + if (string.IsNullOrEmpty(dagName)) return string.Empty; + + ExchangeLog.LogStart("GetDatabase"); + ExchangeLog.LogInfo("DAG: " + dagName); + + //Get Dag Servers + Collection dags = null; + Command cmd = new Command("Get-DatabaseAvailabilityGroup"); + cmd.Parameters.Add("Identity", dagName); + dags = ExecuteShellCommand(runSpace, cmd); + + if (htBbalancer == null) + htBbalancer = new Hashtable(); + + if (htBbalancer[dagName] == null) + htBbalancer.Add(dagName, 0); + + if (dags != null && dags.Count > 0) + { + + ADMultiValuedProperty servers = (ADMultiValuedProperty)GetPSObjectProperty(dags[0], "Servers"); + + if (servers != null) + { + System.Collections.Generic.List lstDatabase = new System.Collections.Generic.List(); + + foreach (object objServer in servers) + { + Collection databases = null; + cmd = new Command("Get-MailboxDatabase"); + cmd.Parameters.Add("Server", ObjToString(objServer)); + databases = ExecuteShellCommand(runSpace, cmd); + + foreach (PSObject objDatabase in databases) + { + if (((bool)GetPSObjectProperty(objDatabase, "IsExcludedFromProvisioning") == false) && + ((bool)GetPSObjectProperty(objDatabase, "IsSuspendedFromProvisioning") == false)) + { + string db = ObjToString(GetPSObjectProperty(objDatabase, "Identity")); + + bool bAdd = true; + foreach (string s in lstDatabase) + { + if (s.ToLower() == db.ToLower()) + { + bAdd = false; + break; + } + } + + if (bAdd) + { + lstDatabase.Add(db); + ExchangeLog.LogInfo("AddDatabase: " + db); + } + } + } + } + + int balancer = (int)htBbalancer[dagName]; + balancer++; + if (balancer >= lstDatabase.Count) balancer = 0; + htBbalancer[dagName] = balancer; + if (lstDatabase.Count != 0) database = lstDatabase[balancer]; + + } + } + + ExchangeLog.LogEnd("GetDatabase"); + return database; + } + + + #endregion + + #region AddressBook + internal override void AdjustADSecurity(string objPath, string securityGroupPath, bool isAddressBook) + { + ExchangeLog.LogStart("AdjustADSecurity"); + ExchangeLog.DebugInfo(" Active Direcory object: {0}", objPath); + ExchangeLog.DebugInfo(" Security Group: {0}", securityGroupPath); + + if (isAddressBook) + { + ExchangeLog.DebugInfo(" Updating Security"); + //"Download Address Book" security permission for offline address book + Guid openAddressBookGuid = new Guid("{bd919c7c-2d79-4950-bc9c-e16fd99285e8}"); + + DirectoryEntry groupEntry = GetADObject(securityGroupPath); + byte[] byteSid = (byte[])GetADObjectProperty(groupEntry, "objectSid"); + + DirectoryEntry objEntry = GetADObject(objPath); + ActiveDirectorySecurity security = objEntry.ObjectSecurity; + + // Create a SecurityIdentifier object for security group. + SecurityIdentifier groupSid = new SecurityIdentifier(byteSid, 0); + + // Create an access rule to allow users in Security Group to open address book. + ActiveDirectoryAccessRule allowOpenAddressBook = + new ActiveDirectoryAccessRule( + groupSid, + ActiveDirectoryRights.ExtendedRight, + AccessControlType.Allow, + openAddressBookGuid); + + // Create an access rule to allow users in Security Group to read object. + ActiveDirectoryAccessRule allowRead = + new ActiveDirectoryAccessRule( + groupSid, + ActiveDirectoryRights.GenericRead, + AccessControlType.Allow); + + // Remove existing rules if exist + security.RemoveAccessRuleSpecific(allowOpenAddressBook); + security.RemoveAccessRuleSpecific(allowRead); + + // Add a new access rule to allow users in Security Group to open address book. + security.AddAccessRule(allowOpenAddressBook); + // Add a new access rule to allow users in Security Group to read object. + security.AddAccessRule(allowRead); + + // Commit the changes. + objEntry.CommitChanges(); + } + + ExchangeLog.LogEnd("AdjustADSecurity"); + } + + + #endregion + + + + public override bool IsInstalled() + { + int value = 0; + bool bResult = false; + RegistryKey root = Registry.LocalMachine; + RegistryKey rk = root.OpenSubKey(ExchangeRegistryPath); + if (rk != null) + { + value = (int)rk.GetValue("MsiProductMajor", null); + if (value == 14) + { + value = (int)rk.GetValue("MsiProductMinor", null); + if (value == 2) bResult = true; + } + rk.Close(); + } + return bResult; + } + } +} + diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/ExchangeLog.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/ExchangeLog.cs index 5472863c..aa965e8f 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/ExchangeLog.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/ExchangeLog.cs @@ -33,71 +33,67 @@ using WebsitePanel.Server.Utils; namespace WebsitePanel.Providers.HostedSolution { - /// - /// Exchange Log Helper Methods - /// - internal class ExchangeLog - { - internal static string LogPrefix = "Exchange"; + /// + /// Exchange Log Helper Methods + /// + internal class ExchangeLog + { + internal static string LogPrefix = "Exchange"; - internal static void LogStart(string message, params object[] args) - { - string text = String.Format(message, args); - Log.WriteStart("{0} {1}", LogPrefix, text); - } + internal static void LogStart(string message, params object[] args) + { + string text = String.Format(message, args); + Log.WriteStart("{0} {1}", LogPrefix, text); + } - internal static void LogEnd(string message, params object[] args) - { - string text = String.Format(message, args); - Log.WriteEnd("{0} {1}", LogPrefix, text); - } + internal static void LogEnd(string message, params object[] args) + { + string text = String.Format(message, args); + Log.WriteEnd("{0} {1}", LogPrefix, text); + } - internal static void LogInfo(string message, params object[] args) - { - string text = String.Format(message, args); - Log.WriteInfo("{0} {1}", LogPrefix, text); - } + internal static void LogInfo(string message, params object[] args) + { + string text = String.Format(message, args); + Log.WriteInfo("{0} {1}", LogPrefix, text); + } - internal static void LogWarning(string message, params object[] args) - { - string text = String.Format(message, args); - Log.WriteWarning("{0} {1}", LogPrefix, text); - } + internal static void LogWarning(string message, params object[] args) + { + string text = String.Format(message, args); + Log.WriteWarning("{0} {1}", LogPrefix, text); + } - internal static void LogError(Exception ex) - { - Log.WriteError(LogPrefix, ex); - } + internal static void LogError(Exception ex) + { + Log.WriteError(LogPrefix, ex); + } - internal static void LogError(string message, Exception ex) - { - string text = String.Format("{0} {1}", LogPrefix, message); - Log.WriteError(text, ex); - } + internal static void LogError(string message, Exception ex) + { + string text = String.Format("{0} {1}", LogPrefix, message); + Log.WriteError(text, ex); + } - internal static void DebugInfo(string message, params object[] args) - { -#if DEBUG - string text = String.Format(message, args); - Log.WriteInfo("{0} {1}", LogPrefix, text); -#endif - } + internal static void DebugInfo(string message, params object[] args) + { + string text = String.Format(message, args); + Log.WriteInfo("{0} {1}", LogPrefix, text); + } - internal static void DebugCommand(Command cmd) - { -#if DEBUG - StringBuilder sb = new StringBuilder(cmd.CommandText); - foreach (CommandParameter parameter in cmd.Parameters) - { - string formatString = " -{0} {1}"; - if (parameter.Value is string) - formatString = " -{0} '{1}'"; - else if (parameter.Value is bool) - formatString = " -{0} ${1}"; - sb.AppendFormat(formatString, parameter.Name, parameter.Value); - } - Log.WriteInfo("{0} {1}", LogPrefix, sb.ToString()); -#endif - } - } + internal static void DebugCommand(Command cmd) + { + StringBuilder sb = new StringBuilder(cmd.CommandText); + foreach (CommandParameter parameter in cmd.Parameters) + { + string formatString = " -{0} {1}"; + if (parameter.Value is string) + formatString = " -{0} '{1}'"; + else if (parameter.Value is bool) + formatString = " -{0} ${1}"; + sb.AppendFormat(formatString, parameter.Name, parameter.Value); + } + Log.WriteInfo("{0} {1}", LogPrefix, sb.ToString()); + } + } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/ExchangeTransaction.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/ExchangeTransaction.cs index 0af4bb65..1d6e0eba 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/ExchangeTransaction.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/ExchangeTransaction.cs @@ -30,228 +30,180 @@ using System.Collections.Generic; namespace WebsitePanel.Providers.HostedSolution { - internal class ExchangeTransaction - { - List actions = null; + internal class ExchangeTransaction + { + List actions = null; - public ExchangeTransaction() - { - actions = new List(); - } + public ExchangeTransaction() + { + actions = new List(); + } - internal List Actions - { - get { return actions; } - } + internal List Actions + { + get { return actions; } + } - internal void RegisterNewOrganizationUnit(string id) - { - TransactionAction action = new TransactionAction(); - action.ActionType = TransactionAction.TransactionActionTypes.CreateOrganizationUnit; - action.Id = id; - Actions.Add(action); - } + internal void RegisterNewOrganizationUnit(string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.CreateOrganizationUnit; + action.Id = id; + Actions.Add(action); + } - public void RegisterNewDistributionGroup(string id) - { - TransactionAction action = new TransactionAction(); - action.ActionType = TransactionAction.TransactionActionTypes.CreateDistributionGroup; - action.Id = id; - Actions.Add(action); - } + public void RegisterNewDistributionGroup(string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.CreateDistributionGroup; + action.Id = id; + Actions.Add(action); + } - public void RegisterMailEnabledDistributionGroup(string id) - { - TransactionAction action = new TransactionAction(); - action.ActionType = TransactionAction.TransactionActionTypes.EnableDistributionGroup; - action.Id = id; - Actions.Add(action); - } + public void RegisterMailEnabledDistributionGroup(string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.EnableDistributionGroup; + action.Id = id; + Actions.Add(action); + } + + internal void RegisterNewGlobalAddressList(string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.CreateGlobalAddressList; + action.Id = id; + Actions.Add(action); + } + + internal void RegisterNewAddressList(string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.CreateAddressList; + action.Id = id; + Actions.Add(action); + } + + internal void RegisterNewAddressBookPolicy(string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.CreateAddressBookPolicy; + action.Id = id; + Actions.Add(action); + } - internal void RegisterNewGlobalAddressList(string id) - { - TransactionAction action = new TransactionAction(); - action.ActionType = TransactionAction.TransactionActionTypes.CreateGlobalAddressList; - action.Id = id; - Actions.Add(action); - } - internal void RegisterNewAddressList(string id) - { - TransactionAction action = new TransactionAction(); - action.ActionType = TransactionAction.TransactionActionTypes.CreateAddressList; - action.Id = id; - Actions.Add(action); - } internal void RegisterNewRoomsAddressList(string id) { TransactionAction action = new TransactionAction(); - action.ActionType = TransactionAction.TransactionActionTypes.CreateRoomsAddressList; + action.ActionType = TransactionAction.TransactionActionTypes.CreateAddressList; action.Id = id; Actions.Add(action); } - internal void RegisterNewAddressPolicy(string id) + + + internal void RegisterNewOfflineAddressBook(string id) { TransactionAction action = new TransactionAction(); - action.ActionType = TransactionAction.TransactionActionTypes.CreateAddressPolicy; + action.ActionType = TransactionAction.TransactionActionTypes.CreateOfflineAddressBook; + action.Id = id; + Actions.Add(action); + } + + internal void RegisterNewActiveSyncPolicy(string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.CreateActiveSyncPolicy; action.Id = id; Actions.Add(action); } - internal void RegisterNewOfflineAddressBook(string id) - { - TransactionAction action = new TransactionAction(); - action.ActionType = TransactionAction.TransactionActionTypes.CreateOfflineAddressBook; - action.Id = id; - Actions.Add(action); - } + internal void RegisterNewAcceptedDomain(string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.CreateAcceptedDomain; + action.Id = id; + Actions.Add(action); + } - internal void RegisterNewActiveSyncPolicy(string id) - { - TransactionAction action = new TransactionAction(); - action.ActionType = TransactionAction.TransactionActionTypes.CreateActiveSyncPolicy; - action.Id = id; - Actions.Add(action); - } + internal void RegisterNewUPNSuffix(string id, string suffix) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.AddUPNSuffix; + action.Id = id; + action.Suffix = suffix; + Actions.Add(action); + } + + internal void RegisterNewMailbox(string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.CreateMailbox; + action.Id = id; + Actions.Add(action); + } + + internal void RegisterEnableMailbox(string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.EnableMailbox; + action.Id = id; + Actions.Add(action); + } - internal void RegisterNewAcceptedDomain(string id) - { - TransactionAction action = new TransactionAction(); - action.ActionType = TransactionAction.TransactionActionTypes.CreateAcceptedDomain; - action.Id = id; - Actions.Add(action); - } + internal void RegisterNewContact(string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.CreateContact; + action.Id = id; + Actions.Add(action); + } - internal void RegisterNewUPNSuffix(string id, string suffix) - { - TransactionAction action = new TransactionAction(); - action.ActionType = TransactionAction.TransactionActionTypes.AddUPNSuffix; - action.Id = id; - action.Suffix = suffix; - Actions.Add(action); - } + internal void RegisterNewPublicFolder(string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.CreatePublicFolder; + action.Id = id; + Actions.Add(action); + } - internal void RegisterNewMailbox(string id) - { - TransactionAction action = new TransactionAction(); - action.ActionType = TransactionAction.TransactionActionTypes.CreateMailbox; - action.Id = id; - Actions.Add(action); - } + internal void AddMailBoxFullAccessPermission(string accountName, string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.AddMailboxFullAccessPermission; + action.Id = id; + action.Account = accountName; + Actions.Add(action); + } - internal void RegisterNewContact(string id) - { - TransactionAction action = new TransactionAction(); - action.ActionType = TransactionAction.TransactionActionTypes.CreateContact; - action.Id = id; - Actions.Add(action); - } - - internal void RegisterNewPublicFolder(string id) - { - TransactionAction action = new TransactionAction(); - action.ActionType = TransactionAction.TransactionActionTypes.CreatePublicFolder; - action.Id = id; - Actions.Add(action); - } - - internal void AddMailBoxFullAccessPermission(string accountName, string id) - { - TransactionAction action = new TransactionAction(); - action.ActionType = TransactionAction.TransactionActionTypes.AddMailboxFullAccessPermission; - action.Id = id; - action.Account = accountName; - Actions.Add(action); - } - - internal void AddSendAsPermission(string accountName, string id) - { - TransactionAction action = new TransactionAction(); - action.ActionType = TransactionAction.TransactionActionTypes.AddSendAsPermission; - action.Id = id; - action.Account = accountName; - Actions.Add(action); - } - - internal void RemoveMailboxFullAccessPermission(string accountName, string id) - { - TransactionAction action = new TransactionAction(); - action.ActionType = TransactionAction.TransactionActionTypes.RemoveMailboxFullAccessPermission; - action.Id = id; - action.Account = accountName; - Actions.Add(action); - } - - internal void RemoveSendAsPermission(string accountName, string id) - { - TransactionAction action = new TransactionAction(); - action.ActionType = TransactionAction.TransactionActionTypes.RemoveSendAsPermission; - action.Id = id; - action.Account = accountName; - Actions.Add(action); - } - } - - internal class TransactionAction - { - private TransactionActionTypes actionType; - - public TransactionActionTypes ActionType - { - get { return actionType; } - set { actionType = value; } - } - - private string id; - - public string Id - { - get { return id; } - set { id = value; } - } - - private string suffix; - - public string Suffix - { - get { return suffix; } - set { suffix = value; } - } - - private string account; - - public string Account - { - get { return account; } - set { account = value; } - - } - - internal enum TransactionActionTypes - { - CreateOrganizationUnit, - CreateGlobalAddressList, - CreateAddressList, - CreateAddressPolicy, - CreateOfflineAddressBook, - CreateDistributionGroup, - EnableDistributionGroup, - CreateAcceptedDomain, - AddUPNSuffix, - CreateMailbox, - CreateContact, - CreatePublicFolder, - CreateActiveSyncPolicy, - AddMailboxFullAccessPermission, - AddSendAsPermission, - RemoveMailboxFullAccessPermission, - RemoveSendAsPermission, - CreateRoomsAddressList - }; - } + internal void AddSendAsPermission(string accountName, string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.AddSendAsPermission; + action.Id = id; + action.Account = accountName; + Actions.Add(action); + } + internal void RemoveMailboxFullAccessPermission(string accountName, string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.RemoveMailboxFullAccessPermission; + action.Id = id; + action.Account = accountName; + Actions.Add(action); + } + internal void RemoveSendAsPermission(string accountName, string id) + { + TransactionAction action = new TransactionAction(); + action.ActionType = TransactionAction.TransactionActionTypes.RemoveSendAsPermission; + action.Id = id; + action.Account = accountName; + Actions.Add(action); + } + } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs index 6e3a9e9c..9b78cd77 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/OrganizationProvider.cs @@ -342,9 +342,9 @@ namespace WebsitePanel.Providers.HostedSolution #region Users - public void CreateUser(string organizationId, string loginName, string displayName, string upn, string password, bool enabled) + public int CreateUser(string organizationId, string loginName, string displayName, string upn, string password, bool enabled) { - CreateUserInternal(organizationId, loginName, displayName, upn, password, enabled); + return CreateUserInternal(organizationId, loginName, displayName, upn, password, enabled); } internal int CreateUserInternal(string organizationId, string loginName, string displayName, string upn, string password, bool enabled) @@ -356,36 +356,43 @@ namespace WebsitePanel.Providers.HostedSolution if (string.IsNullOrEmpty(organizationId)) throw new ArgumentNullException("organizationId"); - + if (string.IsNullOrEmpty(loginName)) throw new ArgumentNullException("loginName"); if (string.IsNullOrEmpty(password)) throw new ArgumentNullException("password"); - bool userCreated = false; + bool userCreated = false; string userPath = null; try { string path = GetOrganizationPath(organizationId); - userPath= GetUserPath(organizationId, loginName); + userPath = GetUserPath(organizationId, loginName); if (!ActiveDirectoryUtils.AdObjectExists(userPath)) { - userPath = ActiveDirectoryUtils.CreateUser(path, loginName, displayName, password, enabled); + userPath = ActiveDirectoryUtils.CreateUser(path, upn, loginName, displayName, password, enabled); DirectoryEntry entry = new DirectoryEntry(userPath); ActiveDirectoryUtils.SetADObjectProperty(entry, ADAttributes.UserPrincipalName, upn); entry.CommitChanges(); userCreated = true; + HostedSolutionLog.DebugInfo("User created: {0}", displayName); } else + { + HostedSolutionLog.DebugInfo("AD_OBJECT_ALREADY_EXISTS: {0}", userPath); + HostedSolutionLog.LogEnd("CreateUserInternal"); return Errors.AD_OBJECT_ALREADY_EXISTS; - - string groupPath = GetGroupPath(organizationId); + } + + string groupPath = GetGroupPath(organizationId); + HostedSolutionLog.DebugInfo("Group retrieved: {0}", groupPath); + - ActiveDirectoryUtils.AddUserToGroup(userPath, groupPath); + HostedSolutionLog.DebugInfo("Added to group: {0}", groupPath); } - catch(Exception e) + catch (Exception e) { HostedSolutionLog.LogError(e); try @@ -393,10 +400,12 @@ namespace WebsitePanel.Providers.HostedSolution if (userCreated) ActiveDirectoryUtils.DeleteADObject(userPath); } - catch(Exception ex) + catch (Exception ex) { HostedSolutionLog.LogError(ex); - } + } + + return Errors.AD_OBJECT_ALREADY_EXISTS; } HostedSolutionLog.LogEnd("CreateUserInternal"); @@ -492,10 +501,10 @@ namespace WebsitePanel.Providers.HostedSolution DirectoryEntry entry = ActiveDirectoryUtils.GetADObject(path); OrganizationUser retUser = new OrganizationUser(); - + retUser.FirstName = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.FirstName); retUser.LastName = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.LastName); - retUser.DisplayName = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.DisplayName); + retUser.DisplayName = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.DisplayName); retUser.Initials = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.Initials); retUser.JobTitle = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.JobTitle); retUser.Company = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.Company); @@ -513,10 +522,11 @@ namespace WebsitePanel.Providers.HostedSolution retUser.Zip = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.Zip); retUser.Country = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.Country); retUser.Notes = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.Notes); - retUser.ExternalEmail = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.ExternalEmail); - retUser.Disabled = (bool)entry.InvokeGet(ADAttributes.AccountDisabled); + retUser.ExternalEmail = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.ExternalEmail); + retUser.Disabled = (bool)entry.InvokeGet(ADAttributes.AccountDisabled); retUser.Manager = GetManager(entry); - retUser.DomainUserName = GetDomainName(loginName); + retUser.SamAccountName = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.SAMAccountName); + retUser.DomainUserName = GetDomainName(ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.SAMAccountName)); retUser.DistinguishedName = ActiveDirectoryUtils.GetADObjectStringProperty(entry, ADAttributes.DistinguishedName); retUser.Locked = (bool)entry.InvokeGet(ADAttributes.AccountLocked); @@ -578,7 +588,7 @@ namespace WebsitePanel.Providers.HostedSolution ActiveDirectoryUtils.SetADObjectProperty(entry, ADAttributes.FirstName, firstName); ActiveDirectoryUtils.SetADObjectProperty(entry, ADAttributes.LastName, lastName); ActiveDirectoryUtils.SetADObjectProperty(entry, ADAttributes.DisplayName, displayName); - + ActiveDirectoryUtils.SetADObjectProperty(entry, ADAttributes.Initials, initials); ActiveDirectoryUtils.SetADObjectProperty(entry, ADAttributes.JobTitle, jobTitle); ActiveDirectoryUtils.SetADObjectProperty(entry, ADAttributes.Company, company); @@ -596,7 +606,7 @@ namespace WebsitePanel.Providers.HostedSolution ActiveDirectoryUtils.SetADObjectProperty(entry, ADAttributes.Zip, zip); ActiveDirectoryUtils.SetADObjectProperty(entry, ADAttributes.Country, country); ActiveDirectoryUtils.SetADObjectProperty(entry, ADAttributes.Notes, notes); - ActiveDirectoryUtils.SetADObjectProperty(entry, ADAttributes.ExternalEmail, externalEmail); + ActiveDirectoryUtils.SetADObjectProperty(entry, ADAttributes.ExternalEmail, externalEmail); ActiveDirectoryUtils.SetADObjectProperty(entry, ADAttributes.CustomAttribute2, (disabled ? "disabled" : null)); @@ -626,6 +636,48 @@ namespace WebsitePanel.Providers.HostedSolution } + public string GetSamAccountNameByUserPrincipalName(string organizationId, string userPrincipalName) + { + return GetSamAccountNameByUserPrincipalNameInternal(organizationId, userPrincipalName); + } + + private string GetSamAccountNameByUserPrincipalNameInternal(string organizationId, string userPrincipalName) + { + HostedSolutionLog.LogStart("GetSamAccountNameByUserPrincipalNameInternal"); + HostedSolutionLog.DebugInfo("userPrincipalName : {0}", userPrincipalName); + HostedSolutionLog.DebugInfo("organizationId : {0}", organizationId); + + string accountName = string.Empty; + + try + { + + string path = GetOrganizationPath(organizationId); + DirectoryEntry entry = ActiveDirectoryUtils.GetADObject(path); + + DirectorySearcher searcher = new DirectorySearcher(entry); + searcher.PropertiesToLoad.Add("userPrincipalName"); + searcher.PropertiesToLoad.Add("sAMAccountName"); + searcher.Filter = "(userPrincipalName=" + userPrincipalName + ")"; + searcher.SearchScope = SearchScope.Subtree; + + SearchResult resCollection = searcher.FindOne(); + if (resCollection != null) + { + accountName = resCollection.Properties["samaccountname"][0].ToString(); + } + + HostedSolutionLog.LogEnd("GetSamAccountNameByUserPrincipalNameInternal"); + } + catch (Exception e) + { + HostedSolutionLog.DebugInfo("Failed : {0}", e.Message); + } + + return accountName; + } + + #endregion #region Domains diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/WebsitePanel.Providers.HostedSolution.csproj b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/WebsitePanel.Providers.HostedSolution.csproj index 7d5b2014..a1441425 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/WebsitePanel.Providers.HostedSolution.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution/WebsitePanel.Providers.HostedSolution.csproj @@ -131,6 +131,7 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/ExchangeServerProxy.cs b/WebsitePanel/Sources/WebsitePanel.Server.Client/ExchangeServerProxy.cs index 7514cfdf..e9fa92c9 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.Client/ExchangeServerProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/ExchangeServerProxy.cs @@ -1,31 +1,3 @@ -// Copyright (c) 2012, Outercurve Foundation. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// - Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// - Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// - Neither the name of the Outercurve Foundation nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - //------------------------------------------------------------------------------ // // This code was generated by a tool. @@ -39,9 +11,10 @@ // // This source code was auto-generated by wsdl, Version=2.0.50727.42. // + using WebsitePanel.Providers.HostedSolution; -namespace WebsitePanel.Providers.Exchange -{ + +namespace WebsitePanel.Providers.Exchange { using System.Xml.Serialization; using System.Web.Services; using System.ComponentModel; @@ -61,12 +34,6 @@ namespace WebsitePanel.Providers.Exchange public ServiceProviderSettingsSoapHeader ServiceProviderSettingsSoapHeaderValue; - private System.Threading.SendOrPostCallback WipeDataFromDeviceOperationCompleted; - - private System.Threading.SendOrPostCallback CancelRemoteWipeRequestOperationCompleted; - - private System.Threading.SendOrPostCallback RemoveDeviceOperationCompleted; - private System.Threading.SendOrPostCallback CheckAccountCredentialsOperationCompleted; private System.Threading.SendOrPostCallback ExtendToExchangeOrganizationOperationCompleted; @@ -79,6 +46,8 @@ namespace WebsitePanel.Providers.Exchange private System.Threading.SendOrPostCallback GetOABVirtualDirectoryOperationCompleted; + private System.Threading.SendOrPostCallback CreateOrganizationAddressBookPolicyOperationCompleted; + private System.Threading.SendOrPostCallback DeleteOrganizationOperationCompleted; private System.Threading.SendOrPostCallback SetOrganizationStorageLimitsOperationCompleted; @@ -91,8 +60,6 @@ namespace WebsitePanel.Providers.Exchange private System.Threading.SendOrPostCallback DeleteAuthoritativeDomainOperationCompleted; - private System.Threading.SendOrPostCallback CreateMailboxOperationCompleted; - private System.Threading.SendOrPostCallback DeleteMailboxOperationCompleted; private System.Threading.SendOrPostCallback DisableMailboxOperationCompleted; @@ -193,20 +160,17 @@ namespace WebsitePanel.Providers.Exchange private System.Threading.SendOrPostCallback GetMobileDeviceOperationCompleted; + private System.Threading.SendOrPostCallback WipeDataFromDeviceOperationCompleted; + + private System.Threading.SendOrPostCallback CancelRemoteWipeRequestOperationCompleted; + + private System.Threading.SendOrPostCallback RemoveDeviceOperationCompleted; + /// public ExchangeServer() { - this.Url = "http://localhost:9004/ExchangeServer.asmx"; + this.Url = "http://localhost:9006/ExchangeServer.asmx"; } - /// - public event WipeDataFromDeviceCompletedEventHandler WipeDataFromDeviceCompleted; - - /// - public event CancelRemoteWipeRequestCompletedEventHandler CancelRemoteWipeRequestCompleted; - - /// - public event RemoveDeviceCompletedEventHandler RemoveDeviceCompleted; - /// public event CheckAccountCredentialsCompletedEventHandler CheckAccountCredentialsCompleted; @@ -225,6 +189,9 @@ namespace WebsitePanel.Providers.Exchange /// public event GetOABVirtualDirectoryCompletedEventHandler GetOABVirtualDirectoryCompleted; + /// + public event CreateOrganizationAddressBookPolicyCompletedEventHandler CreateOrganizationAddressBookPolicyCompleted; + /// public event DeleteOrganizationCompletedEventHandler DeleteOrganizationCompleted; @@ -243,9 +210,6 @@ namespace WebsitePanel.Providers.Exchange /// public event DeleteAuthoritativeDomainCompletedEventHandler DeleteAuthoritativeDomainCompleted; - /// - public event CreateMailboxCompletedEventHandler CreateMailboxCompleted; - /// public event DeleteMailboxCompletedEventHandler DeleteMailboxCompleted; @@ -397,124 +361,13 @@ namespace WebsitePanel.Providers.Exchange public event GetMobileDeviceCompletedEventHandler GetMobileDeviceCompleted; /// - [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/WipeDataFromDevice", 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 WipeDataFromDevice(string id) { - this.Invoke("WipeDataFromDevice", new object[] { - id}); - } + public event WipeDataFromDeviceCompletedEventHandler WipeDataFromDeviceCompleted; /// - public System.IAsyncResult BeginWipeDataFromDevice(string id, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("WipeDataFromDevice", new object[] { - id}, callback, asyncState); - } + public event CancelRemoteWipeRequestCompletedEventHandler CancelRemoteWipeRequestCompleted; /// - public void EndWipeDataFromDevice(System.IAsyncResult asyncResult) { - this.EndInvoke(asyncResult); - } - - /// - public void WipeDataFromDeviceAsync(string id) { - this.WipeDataFromDeviceAsync(id, null); - } - - /// - public void WipeDataFromDeviceAsync(string id, object userState) { - if ((this.WipeDataFromDeviceOperationCompleted == null)) { - this.WipeDataFromDeviceOperationCompleted = new System.Threading.SendOrPostCallback(this.OnWipeDataFromDeviceOperationCompleted); - } - this.InvokeAsync("WipeDataFromDevice", new object[] { - id}, this.WipeDataFromDeviceOperationCompleted, userState); - } - - private void OnWipeDataFromDeviceOperationCompleted(object arg) { - if ((this.WipeDataFromDeviceCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.WipeDataFromDeviceCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CancelRemoteWipeRequest", 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 CancelRemoteWipeRequest(string id) { - this.Invoke("CancelRemoteWipeRequest", new object[] { - id}); - } - - /// - public System.IAsyncResult BeginCancelRemoteWipeRequest(string id, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("CancelRemoteWipeRequest", new object[] { - id}, callback, asyncState); - } - - /// - public void EndCancelRemoteWipeRequest(System.IAsyncResult asyncResult) { - this.EndInvoke(asyncResult); - } - - /// - public void CancelRemoteWipeRequestAsync(string id) { - this.CancelRemoteWipeRequestAsync(id, null); - } - - /// - public void CancelRemoteWipeRequestAsync(string id, object userState) { - if ((this.CancelRemoteWipeRequestOperationCompleted == null)) { - this.CancelRemoteWipeRequestOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCancelRemoteWipeRequestOperationCompleted); - } - this.InvokeAsync("CancelRemoteWipeRequest", new object[] { - id}, this.CancelRemoteWipeRequestOperationCompleted, userState); - } - - private void OnCancelRemoteWipeRequestOperationCompleted(object arg) { - if ((this.CancelRemoteWipeRequestCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.CancelRemoteWipeRequestCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/RemoveDevice", 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 RemoveDevice(string id) { - this.Invoke("RemoveDevice", new object[] { - id}); - } - - /// - public System.IAsyncResult BeginRemoveDevice(string id, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("RemoveDevice", new object[] { - id}, callback, asyncState); - } - - /// - public void EndRemoveDevice(System.IAsyncResult asyncResult) { - this.EndInvoke(asyncResult); - } - - /// - public void RemoveDeviceAsync(string id) { - this.RemoveDeviceAsync(id, null); - } - - /// - public void RemoveDeviceAsync(string id, object userState) { - if ((this.RemoveDeviceOperationCompleted == null)) { - this.RemoveDeviceOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRemoveDeviceOperationCompleted); - } - this.InvokeAsync("RemoveDevice", new object[] { - id}, this.RemoveDeviceOperationCompleted, userState); - } - - private void OnRemoveDeviceOperationCompleted(object arg) { - if ((this.RemoveDeviceCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.RemoveDeviceCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } + public event RemoveDeviceCompletedEventHandler RemoveDeviceCompleted; /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] @@ -564,18 +417,20 @@ namespace WebsitePanel.Providers.Exchange /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/ExtendToExchangeOrganization", 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 Organization ExtendToExchangeOrganization(string organizationId, string securityGroup) { + public Organization ExtendToExchangeOrganization(string organizationId, string securityGroup, bool IsConsumer) { object[] results = this.Invoke("ExtendToExchangeOrganization", new object[] { organizationId, - securityGroup}); + securityGroup, + IsConsumer}); return ((Organization)(results[0])); } /// - public System.IAsyncResult BeginExtendToExchangeOrganization(string organizationId, string securityGroup, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginExtendToExchangeOrganization(string organizationId, string securityGroup, bool IsConsumer, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("ExtendToExchangeOrganization", new object[] { organizationId, - securityGroup}, callback, asyncState); + securityGroup, + IsConsumer}, callback, asyncState); } /// @@ -585,18 +440,19 @@ namespace WebsitePanel.Providers.Exchange } /// - public void ExtendToExchangeOrganizationAsync(string organizationId, string securityGroup) { - this.ExtendToExchangeOrganizationAsync(organizationId, securityGroup, null); + public void ExtendToExchangeOrganizationAsync(string organizationId, string securityGroup, bool IsConsumer) { + this.ExtendToExchangeOrganizationAsync(organizationId, securityGroup, IsConsumer, null); } /// - public void ExtendToExchangeOrganizationAsync(string organizationId, string securityGroup, object userState) { + public void ExtendToExchangeOrganizationAsync(string organizationId, string securityGroup, bool IsConsumer, object userState) { if ((this.ExtendToExchangeOrganizationOperationCompleted == null)) { this.ExtendToExchangeOrganizationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnExtendToExchangeOrganizationOperationCompleted); } this.InvokeAsync("ExtendToExchangeOrganization", new object[] { organizationId, - securityGroup}, this.ExtendToExchangeOrganizationOperationCompleted, userState); + securityGroup, + IsConsumer}, this.ExtendToExchangeOrganizationOperationCompleted, userState); } private void OnExtendToExchangeOrganizationOperationCompleted(object arg) { @@ -616,6 +472,7 @@ namespace WebsitePanel.Providers.Exchange ExchangeAccountType accountType, string mailboxDatabase, string offlineAddressBook, + string addressBookPolicy, string accountName, bool enablePOP, bool enableIMAP, @@ -625,7 +482,12 @@ namespace WebsitePanel.Providers.Exchange int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, - int keepDeletedItemsDays) { + int keepDeletedItemsDays, + int maxRecipients, + int maxSendMessageSizeKB, + int maxReceiveMessageSizeKB, + bool hideFromAddressBook, + bool isConsumer) { object[] results = this.Invoke("CreateMailEnableUser", new object[] { upn, organizationId, @@ -633,6 +495,7 @@ namespace WebsitePanel.Providers.Exchange accountType, mailboxDatabase, offlineAddressBook, + addressBookPolicy, accountName, enablePOP, enableIMAP, @@ -642,7 +505,12 @@ namespace WebsitePanel.Providers.Exchange issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, - keepDeletedItemsDays}); + keepDeletedItemsDays, + maxRecipients, + maxSendMessageSizeKB, + maxReceiveMessageSizeKB, + hideFromAddressBook, + isConsumer}); return ((string)(results[0])); } @@ -654,6 +522,7 @@ namespace WebsitePanel.Providers.Exchange ExchangeAccountType accountType, string mailboxDatabase, string offlineAddressBook, + string addressBookPolicy, string accountName, bool enablePOP, bool enableIMAP, @@ -664,6 +533,11 @@ namespace WebsitePanel.Providers.Exchange int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays, + int maxRecipients, + int maxSendMessageSizeKB, + int maxReceiveMessageSizeKB, + bool hideFromAddressBook, + bool isConsumer, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("CreateMailEnableUser", new object[] { @@ -673,6 +547,7 @@ namespace WebsitePanel.Providers.Exchange accountType, mailboxDatabase, offlineAddressBook, + addressBookPolicy, accountName, enablePOP, enableIMAP, @@ -682,7 +557,12 @@ namespace WebsitePanel.Providers.Exchange issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, - keepDeletedItemsDays}, callback, asyncState); + keepDeletedItemsDays, + maxRecipients, + maxSendMessageSizeKB, + maxReceiveMessageSizeKB, + hideFromAddressBook, + isConsumer}, callback, asyncState); } /// @@ -699,27 +579,7 @@ namespace WebsitePanel.Providers.Exchange ExchangeAccountType accountType, string mailboxDatabase, string offlineAddressBook, - string accountName, - bool enablePOP, - bool enableIMAP, - bool enableOWA, - bool enableMAPI, - bool enableActiveSync, - int issueWarningKB, - int prohibitSendKB, - int prohibitSendReceiveKB, - int keepDeletedItemsDays) { - this.CreateMailEnableUserAsync(upn, organizationId, organizationDistinguishedName, accountType, mailboxDatabase, offlineAddressBook, accountName, enablePOP, enableIMAP, enableOWA, enableMAPI, enableActiveSync, issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, keepDeletedItemsDays, null); - } - - /// - public void CreateMailEnableUserAsync( - string upn, - string organizationId, - string organizationDistinguishedName, - ExchangeAccountType accountType, - string mailboxDatabase, - string offlineAddressBook, + string addressBookPolicy, string accountName, bool enablePOP, bool enableIMAP, @@ -730,6 +590,38 @@ namespace WebsitePanel.Providers.Exchange int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays, + int maxRecipients, + int maxSendMessageSizeKB, + int maxReceiveMessageSizeKB, + bool hideFromAddressBook, + bool isConsumer) { + this.CreateMailEnableUserAsync(upn, organizationId, organizationDistinguishedName, accountType, mailboxDatabase, offlineAddressBook, addressBookPolicy, accountName, enablePOP, enableIMAP, enableOWA, enableMAPI, enableActiveSync, issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, keepDeletedItemsDays, maxRecipients, maxSendMessageSizeKB, maxReceiveMessageSizeKB, hideFromAddressBook, isConsumer, null); + } + + /// + public void CreateMailEnableUserAsync( + string upn, + string organizationId, + string organizationDistinguishedName, + ExchangeAccountType accountType, + string mailboxDatabase, + string offlineAddressBook, + string addressBookPolicy, + string accountName, + bool enablePOP, + bool enableIMAP, + bool enableOWA, + bool enableMAPI, + bool enableActiveSync, + int issueWarningKB, + int prohibitSendKB, + int prohibitSendReceiveKB, + int keepDeletedItemsDays, + int maxRecipients, + int maxSendMessageSizeKB, + int maxReceiveMessageSizeKB, + bool hideFromAddressBook, + bool isConsumer, object userState) { if ((this.CreateMailEnableUserOperationCompleted == null)) { this.CreateMailEnableUserOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateMailEnableUserOperationCompleted); @@ -741,6 +633,7 @@ namespace WebsitePanel.Providers.Exchange accountType, mailboxDatabase, offlineAddressBook, + addressBookPolicy, accountName, enablePOP, enableIMAP, @@ -750,7 +643,12 @@ namespace WebsitePanel.Providers.Exchange issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, - keepDeletedItemsDays}, this.CreateMailEnableUserOperationCompleted, userState); + keepDeletedItemsDays, + maxRecipients, + maxSendMessageSizeKB, + maxReceiveMessageSizeKB, + hideFromAddressBook, + isConsumer}, this.CreateMailEnableUserOperationCompleted, userState); } private void OnCreateMailEnableUserOperationCompleted(object arg) { @@ -887,31 +785,87 @@ namespace WebsitePanel.Providers.Exchange } } + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateOrganizationAddressBookPolicy", 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 Organization CreateOrganizationAddressBookPolicy(string organizationId, string gal, string addressBook, string roomList, string oab) { + object[] results = this.Invoke("CreateOrganizationAddressBookPolicy", new object[] { + organizationId, + gal, + addressBook, + roomList, + oab}); + return ((Organization)(results[0])); + } + + /// + public System.IAsyncResult BeginCreateOrganizationAddressBookPolicy(string organizationId, string gal, string addressBook, string roomList, string oab, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("CreateOrganizationAddressBookPolicy", new object[] { + organizationId, + gal, + addressBook, + roomList, + oab}, callback, asyncState); + } + + /// + public Organization EndCreateOrganizationAddressBookPolicy(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((Organization)(results[0])); + } + + /// + public void CreateOrganizationAddressBookPolicyAsync(string organizationId, string gal, string addressBook, string roomList, string oab) { + this.CreateOrganizationAddressBookPolicyAsync(organizationId, gal, addressBook, roomList, oab, null); + } + + /// + public void CreateOrganizationAddressBookPolicyAsync(string organizationId, string gal, string addressBook, string roomList, string oab, object userState) { + if ((this.CreateOrganizationAddressBookPolicyOperationCompleted == null)) { + this.CreateOrganizationAddressBookPolicyOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateOrganizationAddressBookPolicyOperationCompleted); + } + this.InvokeAsync("CreateOrganizationAddressBookPolicy", new object[] { + organizationId, + gal, + addressBook, + roomList, + oab}, this.CreateOrganizationAddressBookPolicyOperationCompleted, userState); + } + + private void OnCreateOrganizationAddressBookPolicyOperationCompleted(object arg) { + if ((this.CreateOrganizationAddressBookPolicyCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.CreateOrganizationAddressBookPolicyCompleted(this, new CreateOrganizationAddressBookPolicyCompletedEventArgs(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 distinguishedName, string globalAddressList, string addressList, string roomsAddressList, string offlineAddressBook, string securityGroup) { + public bool DeleteOrganization(string organizationId, string distinguishedName, string globalAddressList, string addressList, string roomList, string offlineAddressBook, string securityGroup, string addressBookPolicy) { object[] results = this.Invoke("DeleteOrganization", new object[] { organizationId, distinguishedName, globalAddressList, addressList, - roomsAddressList, + roomList, offlineAddressBook, - securityGroup}); + securityGroup, + addressBookPolicy}); return ((bool)(results[0])); } /// - public System.IAsyncResult BeginDeleteOrganization(string organizationId, string distinguishedName, string globalAddressList, string addressList, string roomsAddressList, string offlineAddressBook, string securityGroup, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginDeleteOrganization(string organizationId, string distinguishedName, string globalAddressList, string addressList, string roomList, string offlineAddressBook, string securityGroup, string addressBookPolicy, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("DeleteOrganization", new object[] { organizationId, distinguishedName, globalAddressList, addressList, - roomsAddressList, + roomList, offlineAddressBook, - securityGroup}, callback, asyncState); + securityGroup, + addressBookPolicy}, callback, asyncState); } /// @@ -921,12 +875,12 @@ namespace WebsitePanel.Providers.Exchange } /// - public void DeleteOrganizationAsync(string organizationId, string distinguishedName, string globalAddressList, string addressList, string roomsAddressList, string offlineAddressBook, string securityGroup) { - this.DeleteOrganizationAsync(organizationId, distinguishedName, globalAddressList, addressList, roomsAddressList, offlineAddressBook, securityGroup, null); + public void DeleteOrganizationAsync(string organizationId, string distinguishedName, string globalAddressList, string addressList, string roomList, string offlineAddressBook, string securityGroup, string addressBookPolicy) { + this.DeleteOrganizationAsync(organizationId, distinguishedName, globalAddressList, addressList, roomList, offlineAddressBook, securityGroup, addressBookPolicy, null); } /// - public void DeleteOrganizationAsync(string organizationId, string distinguishedName, string globalAddressList, string addressList, string roomsAddressList, string offlineAddressBook, string securityGroup, object userState) { + public void DeleteOrganizationAsync(string organizationId, string distinguishedName, string globalAddressList, string addressList, string roomList, string offlineAddressBook, string securityGroup, string addressBookPolicy, object userState) { if ((this.DeleteOrganizationOperationCompleted == null)) { this.DeleteOrganizationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteOrganizationOperationCompleted); } @@ -935,9 +889,10 @@ namespace WebsitePanel.Providers.Exchange distinguishedName, globalAddressList, addressList, - roomsAddressList, + roomList, offlineAddressBook, - securityGroup}, this.DeleteOrganizationOperationCompleted, userState); + securityGroup, + addressBookPolicy}, this.DeleteOrganizationOperationCompleted, userState); } private void OnDeleteOrganizationOperationCompleted(object arg) { @@ -1160,188 +1115,6 @@ namespace WebsitePanel.Providers.Exchange } } - /// - [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateMailbox", 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 CreateMailbox( - string organizationId, - string organizationDistinguishedName, - string mailboxDatabase, - string securityGroup, - string offlineAddressBook, - ExchangeAccountType accountType, - string displayName, - string accountName, - string name, - string domain, - string password, - bool enablePOP, - bool enableIMAP, - bool enableOWA, - bool enableMAPI, - bool enableActiveSync, - int issueWarningKB, - int prohibitSendKB, - int prohibitSendReceiveKB, - int keepDeletedItemsDays) { - object[] results = this.Invoke("CreateMailbox", new object[] { - organizationId, - organizationDistinguishedName, - mailboxDatabase, - securityGroup, - offlineAddressBook, - accountType, - displayName, - accountName, - name, - domain, - password, - enablePOP, - enableIMAP, - enableOWA, - enableMAPI, - enableActiveSync, - issueWarningKB, - prohibitSendKB, - prohibitSendReceiveKB, - keepDeletedItemsDays}); - return ((string)(results[0])); - } - - /// - public System.IAsyncResult BeginCreateMailbox( - string organizationId, - string organizationDistinguishedName, - string mailboxDatabase, - string securityGroup, - string offlineAddressBook, - ExchangeAccountType accountType, - string displayName, - string accountName, - string name, - string domain, - string password, - bool enablePOP, - bool enableIMAP, - bool enableOWA, - bool enableMAPI, - bool enableActiveSync, - int issueWarningKB, - int prohibitSendKB, - int prohibitSendReceiveKB, - int keepDeletedItemsDays, - System.AsyncCallback callback, - object asyncState) { - return this.BeginInvoke("CreateMailbox", new object[] { - organizationId, - organizationDistinguishedName, - mailboxDatabase, - securityGroup, - offlineAddressBook, - accountType, - displayName, - accountName, - name, - domain, - password, - enablePOP, - enableIMAP, - enableOWA, - enableMAPI, - enableActiveSync, - issueWarningKB, - prohibitSendKB, - prohibitSendReceiveKB, - keepDeletedItemsDays}, callback, asyncState); - } - - /// - public string EndCreateMailbox(System.IAsyncResult asyncResult) { - object[] results = this.EndInvoke(asyncResult); - return ((string)(results[0])); - } - - /// - public void CreateMailboxAsync( - string organizationId, - string organizationDistinguishedName, - string mailboxDatabase, - string securityGroup, - string offlineAddressBook, - ExchangeAccountType accountType, - string displayName, - string accountName, - string name, - string domain, - string password, - bool enablePOP, - bool enableIMAP, - bool enableOWA, - bool enableMAPI, - bool enableActiveSync, - int issueWarningKB, - int prohibitSendKB, - int prohibitSendReceiveKB, - int keepDeletedItemsDays) { - this.CreateMailboxAsync(organizationId, organizationDistinguishedName, mailboxDatabase, securityGroup, offlineAddressBook, accountType, displayName, accountName, name, domain, password, enablePOP, enableIMAP, enableOWA, enableMAPI, enableActiveSync, issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, keepDeletedItemsDays, null); - } - - /// - public void CreateMailboxAsync( - string organizationId, - string organizationDistinguishedName, - string mailboxDatabase, - string securityGroup, - string offlineAddressBook, - ExchangeAccountType accountType, - string displayName, - string accountName, - string name, - string domain, - string password, - bool enablePOP, - bool enableIMAP, - bool enableOWA, - bool enableMAPI, - bool enableActiveSync, - int issueWarningKB, - int prohibitSendKB, - int prohibitSendReceiveKB, - int keepDeletedItemsDays, - object userState) { - if ((this.CreateMailboxOperationCompleted == null)) { - this.CreateMailboxOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateMailboxOperationCompleted); - } - this.InvokeAsync("CreateMailbox", new object[] { - organizationId, - organizationDistinguishedName, - mailboxDatabase, - securityGroup, - offlineAddressBook, - accountType, - displayName, - accountName, - name, - domain, - password, - enablePOP, - enableIMAP, - enableOWA, - enableMAPI, - enableActiveSync, - issueWarningKB, - prohibitSendKB, - prohibitSendReceiveKB, - keepDeletedItemsDays}, this.CreateMailboxOperationCompleted, userState); - } - - private void OnCreateMailboxOperationCompleted(object arg) { - if ((this.CreateMailboxCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.CreateMailboxCompleted(this, new CreateMailboxCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/DeleteMailbox", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] @@ -1467,115 +1240,19 @@ namespace WebsitePanel.Providers.Exchange /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SetMailboxGeneralSettings", 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 SetMailboxGeneralSettings( - string accountName, - string displayName, - string password, - bool hideFromAddressBook, - bool disabled, - string firstName, - string initials, - string lastName, - string address, - string city, - string state, - string zip, - string country, - string jobTitle, - string company, - string department, - string office, - string managerAccountName, - string businessPhone, - string fax, - string homePhone, - string mobilePhone, - string pager, - string webPage, - string notes) { + public void SetMailboxGeneralSettings(string accountName, bool hideFromAddressBook, bool disabled) { this.Invoke("SetMailboxGeneralSettings", new object[] { accountName, - displayName, - password, hideFromAddressBook, - disabled, - firstName, - initials, - lastName, - address, - city, - state, - zip, - country, - jobTitle, - company, - department, - office, - managerAccountName, - businessPhone, - fax, - homePhone, - mobilePhone, - pager, - webPage, - notes}); + disabled}); } /// - public System.IAsyncResult BeginSetMailboxGeneralSettings( - string accountName, - string displayName, - string password, - bool hideFromAddressBook, - bool disabled, - string firstName, - string initials, - string lastName, - string address, - string city, - string state, - string zip, - string country, - string jobTitle, - string company, - string department, - string office, - string managerAccountName, - string businessPhone, - string fax, - string homePhone, - string mobilePhone, - string pager, - string webPage, - string notes, - System.AsyncCallback callback, - object asyncState) { + public System.IAsyncResult BeginSetMailboxGeneralSettings(string accountName, bool hideFromAddressBook, bool disabled, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("SetMailboxGeneralSettings", new object[] { accountName, - displayName, - password, hideFromAddressBook, - disabled, - firstName, - initials, - lastName, - address, - city, - state, - zip, - country, - jobTitle, - company, - department, - office, - managerAccountName, - businessPhone, - fax, - homePhone, - mobilePhone, - pager, - webPage, - notes}, callback, asyncState); + disabled}, callback, asyncState); } /// @@ -1584,92 +1261,19 @@ namespace WebsitePanel.Providers.Exchange } /// - public void SetMailboxGeneralSettingsAsync( - string accountName, - string displayName, - string password, - bool hideFromAddressBook, - bool disabled, - string firstName, - string initials, - string lastName, - string address, - string city, - string state, - string zip, - string country, - string jobTitle, - string company, - string department, - string office, - string managerAccountName, - string businessPhone, - string fax, - string homePhone, - string mobilePhone, - string pager, - string webPage, - string notes) { - this.SetMailboxGeneralSettingsAsync(accountName, displayName, password, hideFromAddressBook, disabled, firstName, initials, lastName, address, city, state, zip, country, jobTitle, company, department, office, managerAccountName, businessPhone, fax, homePhone, mobilePhone, pager, webPage, notes, null); + public void SetMailboxGeneralSettingsAsync(string accountName, bool hideFromAddressBook, bool disabled) { + this.SetMailboxGeneralSettingsAsync(accountName, hideFromAddressBook, disabled, null); } /// - public void SetMailboxGeneralSettingsAsync( - string accountName, - string displayName, - string password, - bool hideFromAddressBook, - bool disabled, - string firstName, - string initials, - string lastName, - string address, - string city, - string state, - string zip, - string country, - string jobTitle, - string company, - string department, - string office, - string managerAccountName, - string businessPhone, - string fax, - string homePhone, - string mobilePhone, - string pager, - string webPage, - string notes, - object userState) { + public void SetMailboxGeneralSettingsAsync(string accountName, bool hideFromAddressBook, bool disabled, object userState) { if ((this.SetMailboxGeneralSettingsOperationCompleted == null)) { this.SetMailboxGeneralSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetMailboxGeneralSettingsOperationCompleted); } this.InvokeAsync("SetMailboxGeneralSettings", new object[] { accountName, - displayName, - password, hideFromAddressBook, - disabled, - firstName, - initials, - lastName, - address, - city, - state, - zip, - country, - jobTitle, - company, - department, - office, - managerAccountName, - businessPhone, - fax, - homePhone, - mobilePhone, - pager, - webPage, - notes}, this.SetMailboxGeneralSettingsOperationCompleted, userState); + disabled}, this.SetMailboxGeneralSettingsOperationCompleted, userState); } private void OnSetMailboxGeneralSettingsOperationCompleted(object arg) { @@ -1724,7 +1328,7 @@ namespace WebsitePanel.Providers.Exchange /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SetMailboxMailFlowSettings", 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 SetMailboxMailFlowSettings(string accountName, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB, bool requireSenderAuthentication) { + public void SetMailboxMailFlowSettings(string accountName, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) { this.Invoke("SetMailboxMailFlowSettings", new object[] { accountName, enableForwarding, @@ -1733,14 +1337,11 @@ namespace WebsitePanel.Providers.Exchange sendOnBehalfAccounts, acceptAccounts, rejectAccounts, - maxRecipients, - maxSendMessageSizeKB, - maxReceiveMessageSizeKB, requireSenderAuthentication}); } /// - public System.IAsyncResult BeginSetMailboxMailFlowSettings(string accountName, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB, bool requireSenderAuthentication, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginSetMailboxMailFlowSettings(string accountName, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("SetMailboxMailFlowSettings", new object[] { accountName, enableForwarding, @@ -1749,9 +1350,6 @@ namespace WebsitePanel.Providers.Exchange sendOnBehalfAccounts, acceptAccounts, rejectAccounts, - maxRecipients, - maxSendMessageSizeKB, - maxReceiveMessageSizeKB, requireSenderAuthentication}, callback, asyncState); } @@ -1761,12 +1359,12 @@ namespace WebsitePanel.Providers.Exchange } /// - public void SetMailboxMailFlowSettingsAsync(string accountName, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB, bool requireSenderAuthentication) { - this.SetMailboxMailFlowSettingsAsync(accountName, enableForwarding, forwardingAccountName, forwardToBoth, sendOnBehalfAccounts, acceptAccounts, rejectAccounts, maxRecipients, maxSendMessageSizeKB, maxReceiveMessageSizeKB, requireSenderAuthentication, null); + public void SetMailboxMailFlowSettingsAsync(string accountName, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) { + this.SetMailboxMailFlowSettingsAsync(accountName, enableForwarding, forwardingAccountName, forwardToBoth, sendOnBehalfAccounts, acceptAccounts, rejectAccounts, requireSenderAuthentication, null); } /// - public void SetMailboxMailFlowSettingsAsync(string accountName, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB, bool requireSenderAuthentication, object userState) { + public void SetMailboxMailFlowSettingsAsync(string accountName, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication, object userState) { if ((this.SetMailboxMailFlowSettingsOperationCompleted == null)) { this.SetMailboxMailFlowSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetMailboxMailFlowSettingsOperationCompleted); } @@ -1778,9 +1376,6 @@ namespace WebsitePanel.Providers.Exchange sendOnBehalfAccounts, acceptAccounts, rejectAccounts, - maxRecipients, - maxSendMessageSizeKB, - maxReceiveMessageSizeKB, requireSenderAuthentication}, this.SetMailboxMailFlowSettingsOperationCompleted, userState); } @@ -1836,7 +1431,7 @@ namespace WebsitePanel.Providers.Exchange /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SetMailboxAdvancedSettings", 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 SetMailboxAdvancedSettings(string organizationId, string accountName, bool enablePOP, bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays) { + public void SetMailboxAdvancedSettings(string organizationId, string accountName, bool enablePOP, bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays, int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB) { this.Invoke("SetMailboxAdvancedSettings", new object[] { organizationId, accountName, @@ -1848,11 +1443,30 @@ namespace WebsitePanel.Providers.Exchange issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, - keepDeletedItemsDays}); + keepDeletedItemsDays, + maxRecipients, + maxSendMessageSizeKB, + maxReceiveMessageSizeKB}); } /// - public System.IAsyncResult BeginSetMailboxAdvancedSettings(string organizationId, string accountName, bool enablePOP, bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginSetMailboxAdvancedSettings( + string organizationId, + string accountName, + bool enablePOP, + bool enableIMAP, + bool enableOWA, + bool enableMAPI, + bool enableActiveSync, + int issueWarningKB, + int prohibitSendKB, + int prohibitSendReceiveKB, + int keepDeletedItemsDays, + int maxRecipients, + int maxSendMessageSizeKB, + int maxReceiveMessageSizeKB, + System.AsyncCallback callback, + object asyncState) { return this.BeginInvoke("SetMailboxAdvancedSettings", new object[] { organizationId, accountName, @@ -1864,7 +1478,10 @@ namespace WebsitePanel.Providers.Exchange issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, - keepDeletedItemsDays}, callback, asyncState); + keepDeletedItemsDays, + maxRecipients, + maxSendMessageSizeKB, + maxReceiveMessageSizeKB}, callback, asyncState); } /// @@ -1873,12 +1490,12 @@ namespace WebsitePanel.Providers.Exchange } /// - public void SetMailboxAdvancedSettingsAsync(string organizationId, string accountName, bool enablePOP, bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays) { - this.SetMailboxAdvancedSettingsAsync(organizationId, accountName, enablePOP, enableIMAP, enableOWA, enableMAPI, enableActiveSync, issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, keepDeletedItemsDays, null); + public void SetMailboxAdvancedSettingsAsync(string organizationId, string accountName, bool enablePOP, bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays, int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB) { + this.SetMailboxAdvancedSettingsAsync(organizationId, accountName, enablePOP, enableIMAP, enableOWA, enableMAPI, enableActiveSync, issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, keepDeletedItemsDays, maxRecipients, maxSendMessageSizeKB, maxReceiveMessageSizeKB, null); } /// - public void SetMailboxAdvancedSettingsAsync(string organizationId, string accountName, bool enablePOP, bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays, object userState) { + public void SetMailboxAdvancedSettingsAsync(string organizationId, string accountName, bool enablePOP, bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays, int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB, object userState) { if ((this.SetMailboxAdvancedSettingsOperationCompleted == null)) { this.SetMailboxAdvancedSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetMailboxAdvancedSettingsOperationCompleted); } @@ -1893,7 +1510,10 @@ namespace WebsitePanel.Providers.Exchange issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, - keepDeletedItemsDays}, this.SetMailboxAdvancedSettingsOperationCompleted, userState); + keepDeletedItemsDays, + maxRecipients, + maxSendMessageSizeKB, + maxReceiveMessageSizeKB}, this.SetMailboxAdvancedSettingsOperationCompleted, userState); } private void OnSetMailboxAdvancedSettingsOperationCompleted(object arg) { @@ -2620,7 +2240,7 @@ namespace WebsitePanel.Providers.Exchange /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateDistributionList", 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 CreateDistributionList(string organizationId, string organizationDistinguishedName, string displayName, string accountName, string name, string domain, string managedBy) { + public void CreateDistributionList(string organizationId, string organizationDistinguishedName, string displayName, string accountName, string name, string domain, string managedBy, string[] addressLists) { this.Invoke("CreateDistributionList", new object[] { organizationId, organizationDistinguishedName, @@ -2628,11 +2248,12 @@ namespace WebsitePanel.Providers.Exchange accountName, name, domain, - managedBy}); + managedBy, + addressLists}); } /// - public System.IAsyncResult BeginCreateDistributionList(string organizationId, string organizationDistinguishedName, string displayName, string accountName, string name, string domain, string managedBy, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginCreateDistributionList(string organizationId, string organizationDistinguishedName, string displayName, string accountName, string name, string domain, string managedBy, string[] addressLists, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("CreateDistributionList", new object[] { organizationId, organizationDistinguishedName, @@ -2640,7 +2261,8 @@ namespace WebsitePanel.Providers.Exchange accountName, name, domain, - managedBy}, callback, asyncState); + managedBy, + addressLists}, callback, asyncState); } /// @@ -2649,12 +2271,12 @@ namespace WebsitePanel.Providers.Exchange } /// - public void CreateDistributionListAsync(string organizationId, string organizationDistinguishedName, string displayName, string accountName, string name, string domain, string managedBy) { - this.CreateDistributionListAsync(organizationId, organizationDistinguishedName, displayName, accountName, name, domain, managedBy, null); + public void CreateDistributionListAsync(string organizationId, string organizationDistinguishedName, string displayName, string accountName, string name, string domain, string managedBy, string[] addressLists) { + this.CreateDistributionListAsync(organizationId, organizationDistinguishedName, displayName, accountName, name, domain, managedBy, addressLists, null); } /// - public void CreateDistributionListAsync(string organizationId, string organizationDistinguishedName, string displayName, string accountName, string name, string domain, string managedBy, object userState) { + public void CreateDistributionListAsync(string organizationId, string organizationDistinguishedName, string displayName, string accountName, string name, string domain, string managedBy, string[] addressLists, object userState) { if ((this.CreateDistributionListOperationCompleted == null)) { this.CreateDistributionListOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateDistributionListOperationCompleted); } @@ -2665,7 +2287,8 @@ namespace WebsitePanel.Providers.Exchange accountName, name, domain, - managedBy}, this.CreateDistributionListOperationCompleted, userState); + managedBy, + addressLists}, this.CreateDistributionListOperationCompleted, userState); } private void OnCreateDistributionListOperationCompleted(object arg) { @@ -2760,25 +2383,27 @@ namespace WebsitePanel.Providers.Exchange /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SetDistributionListGeneralSettings", 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 SetDistributionListGeneralSettings(string accountName, string displayName, bool hideFromAddressBook, string managedBy, string[] members, string notes) { + public void SetDistributionListGeneralSettings(string accountName, string displayName, bool hideFromAddressBook, string managedBy, string[] members, string notes, string[] addressLists) { this.Invoke("SetDistributionListGeneralSettings", new object[] { accountName, displayName, hideFromAddressBook, managedBy, members, - notes}); + notes, + addressLists}); } /// - public System.IAsyncResult BeginSetDistributionListGeneralSettings(string accountName, string displayName, bool hideFromAddressBook, string managedBy, string[] members, string notes, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginSetDistributionListGeneralSettings(string accountName, string displayName, bool hideFromAddressBook, string managedBy, string[] members, string notes, string[] addressLists, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("SetDistributionListGeneralSettings", new object[] { accountName, displayName, hideFromAddressBook, managedBy, members, - notes}, callback, asyncState); + notes, + addressLists}, callback, asyncState); } /// @@ -2787,12 +2412,12 @@ namespace WebsitePanel.Providers.Exchange } /// - public void SetDistributionListGeneralSettingsAsync(string accountName, string displayName, bool hideFromAddressBook, string managedBy, string[] members, string notes) { - this.SetDistributionListGeneralSettingsAsync(accountName, displayName, hideFromAddressBook, managedBy, members, notes, null); + public void SetDistributionListGeneralSettingsAsync(string accountName, string displayName, bool hideFromAddressBook, string managedBy, string[] members, string notes, string[] addressLists) { + this.SetDistributionListGeneralSettingsAsync(accountName, displayName, hideFromAddressBook, managedBy, members, notes, addressLists, null); } /// - public void SetDistributionListGeneralSettingsAsync(string accountName, string displayName, bool hideFromAddressBook, string managedBy, string[] members, string notes, object userState) { + public void SetDistributionListGeneralSettingsAsync(string accountName, string displayName, bool hideFromAddressBook, string managedBy, string[] members, string notes, string[] addressLists, object userState) { if ((this.SetDistributionListGeneralSettingsOperationCompleted == null)) { this.SetDistributionListGeneralSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetDistributionListGeneralSettingsOperationCompleted); } @@ -2802,7 +2427,8 @@ namespace WebsitePanel.Providers.Exchange hideFromAddressBook, managedBy, members, - notes}, this.SetDistributionListGeneralSettingsOperationCompleted, userState); + notes, + addressLists}, this.SetDistributionListGeneralSettingsOperationCompleted, userState); } private void OnSetDistributionListGeneralSettingsOperationCompleted(object arg) { @@ -2857,21 +2483,23 @@ namespace WebsitePanel.Providers.Exchange /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SetDistributionListMailFlowSettings", 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 SetDistributionListMailFlowSettings(string accountName, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) { + public void SetDistributionListMailFlowSettings(string accountName, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication, string[] addressLists) { this.Invoke("SetDistributionListMailFlowSettings", new object[] { accountName, acceptAccounts, rejectAccounts, - requireSenderAuthentication}); + requireSenderAuthentication, + addressLists}); } /// - public System.IAsyncResult BeginSetDistributionListMailFlowSettings(string accountName, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginSetDistributionListMailFlowSettings(string accountName, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication, string[] addressLists, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("SetDistributionListMailFlowSettings", new object[] { accountName, acceptAccounts, rejectAccounts, - requireSenderAuthentication}, callback, asyncState); + requireSenderAuthentication, + addressLists}, callback, asyncState); } /// @@ -2880,12 +2508,12 @@ namespace WebsitePanel.Providers.Exchange } /// - public void SetDistributionListMailFlowSettingsAsync(string accountName, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) { - this.SetDistributionListMailFlowSettingsAsync(accountName, acceptAccounts, rejectAccounts, requireSenderAuthentication, null); + public void SetDistributionListMailFlowSettingsAsync(string accountName, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication, string[] addressLists) { + this.SetDistributionListMailFlowSettingsAsync(accountName, acceptAccounts, rejectAccounts, requireSenderAuthentication, addressLists, null); } /// - public void SetDistributionListMailFlowSettingsAsync(string accountName, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication, object userState) { + public void SetDistributionListMailFlowSettingsAsync(string accountName, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication, string[] addressLists, object userState) { if ((this.SetDistributionListMailFlowSettingsOperationCompleted == null)) { this.SetDistributionListMailFlowSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetDistributionListMailFlowSettingsOperationCompleted); } @@ -2893,7 +2521,8 @@ namespace WebsitePanel.Providers.Exchange accountName, acceptAccounts, rejectAccounts, - requireSenderAuthentication}, this.SetDistributionListMailFlowSettingsOperationCompleted, userState); + requireSenderAuthentication, + addressLists}, this.SetDistributionListMailFlowSettingsOperationCompleted, userState); } private void OnSetDistributionListMailFlowSettingsOperationCompleted(object arg) { @@ -2948,17 +2577,19 @@ namespace WebsitePanel.Providers.Exchange /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SetDistributionListEmailAddresses", 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 SetDistributionListEmailAddresses(string accountName, string[] emailAddresses) { + public void SetDistributionListEmailAddresses(string accountName, string[] emailAddresses, string[] addressLists) { this.Invoke("SetDistributionListEmailAddresses", new object[] { accountName, - emailAddresses}); + emailAddresses, + addressLists}); } /// - public System.IAsyncResult BeginSetDistributionListEmailAddresses(string accountName, string[] emailAddresses, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginSetDistributionListEmailAddresses(string accountName, string[] emailAddresses, string[] addressLists, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("SetDistributionListEmailAddresses", new object[] { accountName, - emailAddresses}, callback, asyncState); + emailAddresses, + addressLists}, callback, asyncState); } /// @@ -2967,18 +2598,19 @@ namespace WebsitePanel.Providers.Exchange } /// - public void SetDistributionListEmailAddressesAsync(string accountName, string[] emailAddresses) { - this.SetDistributionListEmailAddressesAsync(accountName, emailAddresses, null); + public void SetDistributionListEmailAddressesAsync(string accountName, string[] emailAddresses, string[] addressLists) { + this.SetDistributionListEmailAddressesAsync(accountName, emailAddresses, addressLists, null); } /// - public void SetDistributionListEmailAddressesAsync(string accountName, string[] emailAddresses, object userState) { + public void SetDistributionListEmailAddressesAsync(string accountName, string[] emailAddresses, string[] addressLists, object userState) { if ((this.SetDistributionListEmailAddressesOperationCompleted == null)) { this.SetDistributionListEmailAddressesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetDistributionListEmailAddressesOperationCompleted); } this.InvokeAsync("SetDistributionListEmailAddresses", new object[] { accountName, - emailAddresses}, this.SetDistributionListEmailAddressesOperationCompleted, userState); + emailAddresses, + addressLists}, this.SetDistributionListEmailAddressesOperationCompleted, userState); } private void OnSetDistributionListEmailAddressesOperationCompleted(object arg) { @@ -2991,17 +2623,19 @@ namespace WebsitePanel.Providers.Exchange /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SetDistributionListPrimaryEmailAddress", 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 SetDistributionListPrimaryEmailAddress(string accountName, string emailAddress) { + public void SetDistributionListPrimaryEmailAddress(string accountName, string emailAddress, string[] addressLists) { this.Invoke("SetDistributionListPrimaryEmailAddress", new object[] { accountName, - emailAddress}); + emailAddress, + addressLists}); } /// - public System.IAsyncResult BeginSetDistributionListPrimaryEmailAddress(string accountName, string emailAddress, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginSetDistributionListPrimaryEmailAddress(string accountName, string emailAddress, string[] addressLists, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("SetDistributionListPrimaryEmailAddress", new object[] { accountName, - emailAddress}, callback, asyncState); + emailAddress, + addressLists}, callback, asyncState); } /// @@ -3010,18 +2644,19 @@ namespace WebsitePanel.Providers.Exchange } /// - public void SetDistributionListPrimaryEmailAddressAsync(string accountName, string emailAddress) { - this.SetDistributionListPrimaryEmailAddressAsync(accountName, emailAddress, null); + public void SetDistributionListPrimaryEmailAddressAsync(string accountName, string emailAddress, string[] addressLists) { + this.SetDistributionListPrimaryEmailAddressAsync(accountName, emailAddress, addressLists, null); } /// - public void SetDistributionListPrimaryEmailAddressAsync(string accountName, string emailAddress, object userState) { + public void SetDistributionListPrimaryEmailAddressAsync(string accountName, string emailAddress, string[] addressLists, object userState) { if ((this.SetDistributionListPrimaryEmailAddressOperationCompleted == null)) { this.SetDistributionListPrimaryEmailAddressOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetDistributionListPrimaryEmailAddressOperationCompleted); } this.InvokeAsync("SetDistributionListPrimaryEmailAddress", new object[] { accountName, - emailAddress}, this.SetDistributionListPrimaryEmailAddressOperationCompleted, userState); + emailAddress, + addressLists}, this.SetDistributionListPrimaryEmailAddressOperationCompleted, userState); } private void OnSetDistributionListPrimaryEmailAddressOperationCompleted(object arg) { @@ -3034,21 +2669,23 @@ namespace WebsitePanel.Providers.Exchange /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SetDistributionListPermissions", 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 SetDistributionListPermissions(string organizationId, string accountName, string[] sendAsAccounts, string[] sendOnBehalfAccounts) { + public void SetDistributionListPermissions(string organizationId, string accountName, string[] sendAsAccounts, string[] sendOnBehalfAccounts, string[] addressLists) { this.Invoke("SetDistributionListPermissions", new object[] { organizationId, accountName, sendAsAccounts, - sendOnBehalfAccounts}); + sendOnBehalfAccounts, + addressLists}); } /// - public System.IAsyncResult BeginSetDistributionListPermissions(string organizationId, string accountName, string[] sendAsAccounts, string[] sendOnBehalfAccounts, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginSetDistributionListPermissions(string organizationId, string accountName, string[] sendAsAccounts, string[] sendOnBehalfAccounts, string[] addressLists, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("SetDistributionListPermissions", new object[] { organizationId, accountName, sendAsAccounts, - sendOnBehalfAccounts}, callback, asyncState); + sendOnBehalfAccounts, + addressLists}, callback, asyncState); } /// @@ -3057,12 +2694,12 @@ namespace WebsitePanel.Providers.Exchange } /// - public void SetDistributionListPermissionsAsync(string organizationId, string accountName, string[] sendAsAccounts, string[] sendOnBehalfAccounts) { - this.SetDistributionListPermissionsAsync(organizationId, accountName, sendAsAccounts, sendOnBehalfAccounts, null); + public void SetDistributionListPermissionsAsync(string organizationId, string accountName, string[] sendAsAccounts, string[] sendOnBehalfAccounts, string[] addressLists) { + this.SetDistributionListPermissionsAsync(organizationId, accountName, sendAsAccounts, sendOnBehalfAccounts, addressLists, null); } /// - public void SetDistributionListPermissionsAsync(string organizationId, string accountName, string[] sendAsAccounts, string[] sendOnBehalfAccounts, object userState) { + public void SetDistributionListPermissionsAsync(string organizationId, string accountName, string[] sendAsAccounts, string[] sendOnBehalfAccounts, string[] addressLists, object userState) { if ((this.SetDistributionListPermissionsOperationCompleted == null)) { this.SetDistributionListPermissionsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetDistributionListPermissionsOperationCompleted); } @@ -3070,7 +2707,8 @@ namespace WebsitePanel.Providers.Exchange organizationId, accountName, sendAsAccounts, - sendOnBehalfAccounts}, this.SetDistributionListPermissionsOperationCompleted, userState); + sendOnBehalfAccounts, + addressLists}, this.SetDistributionListPermissionsOperationCompleted, userState); } private void OnSetDistributionListPermissionsOperationCompleted(object arg) { @@ -4079,24 +3717,132 @@ namespace WebsitePanel.Providers.Exchange } } + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/WipeDataFromDevice", 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 WipeDataFromDevice(string id) { + this.Invoke("WipeDataFromDevice", new object[] { + id}); + } + + /// + public System.IAsyncResult BeginWipeDataFromDevice(string id, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("WipeDataFromDevice", new object[] { + id}, callback, asyncState); + } + + /// + public void EndWipeDataFromDevice(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void WipeDataFromDeviceAsync(string id) { + this.WipeDataFromDeviceAsync(id, null); + } + + /// + public void WipeDataFromDeviceAsync(string id, object userState) { + if ((this.WipeDataFromDeviceOperationCompleted == null)) { + this.WipeDataFromDeviceOperationCompleted = new System.Threading.SendOrPostCallback(this.OnWipeDataFromDeviceOperationCompleted); + } + this.InvokeAsync("WipeDataFromDevice", new object[] { + id}, this.WipeDataFromDeviceOperationCompleted, userState); + } + + private void OnWipeDataFromDeviceOperationCompleted(object arg) { + if ((this.WipeDataFromDeviceCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.WipeDataFromDeviceCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CancelRemoteWipeRequest", 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 CancelRemoteWipeRequest(string id) { + this.Invoke("CancelRemoteWipeRequest", new object[] { + id}); + } + + /// + public System.IAsyncResult BeginCancelRemoteWipeRequest(string id, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("CancelRemoteWipeRequest", new object[] { + id}, callback, asyncState); + } + + /// + public void EndCancelRemoteWipeRequest(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void CancelRemoteWipeRequestAsync(string id) { + this.CancelRemoteWipeRequestAsync(id, null); + } + + /// + public void CancelRemoteWipeRequestAsync(string id, object userState) { + if ((this.CancelRemoteWipeRequestOperationCompleted == null)) { + this.CancelRemoteWipeRequestOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCancelRemoteWipeRequestOperationCompleted); + } + this.InvokeAsync("CancelRemoteWipeRequest", new object[] { + id}, this.CancelRemoteWipeRequestOperationCompleted, userState); + } + + private void OnCancelRemoteWipeRequestOperationCompleted(object arg) { + if ((this.CancelRemoteWipeRequestCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.CancelRemoteWipeRequestCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/RemoveDevice", 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 RemoveDevice(string id) { + this.Invoke("RemoveDevice", new object[] { + id}); + } + + /// + public System.IAsyncResult BeginRemoveDevice(string id, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("RemoveDevice", new object[] { + id}, callback, asyncState); + } + + /// + public void EndRemoveDevice(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void RemoveDeviceAsync(string id) { + this.RemoveDeviceAsync(id, null); + } + + /// + public void RemoveDeviceAsync(string id, object userState) { + if ((this.RemoveDeviceOperationCompleted == null)) { + this.RemoveDeviceOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRemoveDeviceOperationCompleted); + } + this.InvokeAsync("RemoveDevice", new object[] { + id}, this.RemoveDeviceOperationCompleted, userState); + } + + private void OnRemoveDeviceOperationCompleted(object arg) { + if ((this.RemoveDeviceCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.RemoveDeviceCompleted(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 WipeDataFromDeviceCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void CancelRemoteWipeRequestCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void RemoveDeviceCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void CheckAccountCredentialsCompletedEventHandler(object sender, CheckAccountCredentialsCompletedEventArgs e); @@ -4231,6 +3977,32 @@ namespace WebsitePanel.Providers.Exchange } } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void CreateOrganizationAddressBookPolicyCompletedEventHandler(object sender, CreateOrganizationAddressBookPolicyCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class CreateOrganizationAddressBookPolicyCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal CreateOrganizationAddressBookPolicyCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public Organization Result { + get { + this.RaiseExceptionIfNecessary(); + return ((Organization)(this.results[0])); + } + } + } + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void DeleteOrganizationCompletedEventHandler(object sender, DeleteOrganizationCompletedEventArgs e); @@ -4321,32 +4093,6 @@ namespace WebsitePanel.Providers.Exchange [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void DeleteAuthoritativeDomainCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void CreateMailboxCompletedEventHandler(object sender, CreateMailboxCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - [System.Diagnostics.DebuggerStepThroughAttribute()] - [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class CreateMailboxCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - - private object[] results; - - internal CreateMailboxCompletedEventArgs(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 DeleteMailboxCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); @@ -5008,4 +4754,16 @@ namespace WebsitePanel.Providers.Exchange } } } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void WipeDataFromDeviceCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void CancelRemoteWipeRequestCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void RemoveDeviceCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); } diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/OrganizationProxy.cs b/WebsitePanel/Sources/WebsitePanel.Server.Client/OrganizationProxy.cs index ed96ad4f..8121e66d 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.Client/OrganizationProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/OrganizationProxy.cs @@ -1,35 +1,7 @@ -// Copyright (c) 2012, Outercurve Foundation. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// - Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// - Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// - Neither the name of the Outercurve Foundation nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.3053 +// Runtime Version:2.0.50727.5456 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -39,17 +11,17 @@ // // This source code was auto-generated by wsdl, Version=2.0.50727.42. // -using WebsitePanel.Providers.Common; -using WebsitePanel.Providers.ResultObjects; - namespace WebsitePanel.Providers.HostedSolution { - using System.Diagnostics; + using System.Xml.Serialization; using System.Web.Services; using System.ComponentModel; using System.Web.Services.Protocols; using System; - using System.Xml.Serialization; - + using System.Diagnostics; + + using WebsitePanel.Providers.Common; + using WebsitePanel.Providers.ResultObjects; + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] @@ -72,7 +44,7 @@ namespace WebsitePanel.Providers.HostedSolution { private System.Threading.SendOrPostCallback DeleteUserOperationCompleted; - private System.Threading.SendOrPostCallback GeUserGeneralSettingsOperationCompleted; + private System.Threading.SendOrPostCallback GetUserGeneralSettingsOperationCompleted; private System.Threading.SendOrPostCallback SetUserGeneralSettingsOperationCompleted; @@ -82,9 +54,11 @@ namespace WebsitePanel.Providers.HostedSolution { private System.Threading.SendOrPostCallback GetPasswordPolicyOperationCompleted; + private System.Threading.SendOrPostCallback GetSamAccountNameByUserPrincipalNameOperationCompleted; + /// public Organizations() { - this.Url = "http://exchange-dev:9003/Organizations.asmx"; + this.Url = "http://localhost:9006/Organizations.asmx"; } /// @@ -103,7 +77,7 @@ namespace WebsitePanel.Providers.HostedSolution { public event DeleteUserCompletedEventHandler DeleteUserCompleted; /// - public event GeUserGeneralSettingsCompletedEventHandler GeUserGeneralSettingsCompleted; + public event GetUserGeneralSettingsCompletedEventHandler GetUserGeneralSettingsCompleted; /// public event SetUserGeneralSettingsCompletedEventHandler SetUserGeneralSettingsCompleted; @@ -117,6 +91,9 @@ namespace WebsitePanel.Providers.HostedSolution { /// public event GetPasswordPolicyCompletedEventHandler GetPasswordPolicyCompleted; + /// + public event GetSamAccountNameByUserPrincipalNameCompletedEventHandler GetSamAccountNameByUserPrincipalNameCompleted; + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/OrganizationExists", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] @@ -244,14 +221,15 @@ namespace WebsitePanel.Providers.HostedSolution { /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/CreateUser", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public void CreateUser(string organizationId, string loginName, string displayName, string upn, string password, bool enabled) { - this.Invoke("CreateUser", new object[] { + public int CreateUser(string organizationId, string loginName, string displayName, string upn, string password, bool enabled) { + object[] results = this.Invoke("CreateUser", new object[] { organizationId, loginName, displayName, upn, password, enabled}); + return ((int)(results[0])); } /// @@ -266,8 +244,9 @@ namespace WebsitePanel.Providers.HostedSolution { } /// - public void EndCreateUser(System.IAsyncResult asyncResult) { - this.EndInvoke(asyncResult); + public int EndCreateUser(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); } /// @@ -292,7 +271,7 @@ namespace WebsitePanel.Providers.HostedSolution { 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 System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + this.CreateUserCompleted(this, new CreateUserCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } @@ -341,46 +320,46 @@ namespace WebsitePanel.Providers.HostedSolution { /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GeUserGeneralSettings", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] - public OrganizationUser GeUserGeneralSettings(string loginName, string organizationId) { - object[] results = this.Invoke("GeUserGeneralSettings", new object[] { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetUserGeneralSettings", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public OrganizationUser GetUserGeneralSettings(string loginName, string organizationId) { + object[] results = this.Invoke("GetUserGeneralSettings", new object[] { loginName, organizationId}); return ((OrganizationUser)(results[0])); } /// - public System.IAsyncResult BeginGeUserGeneralSettings(string loginName, string organizationId, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("GeUserGeneralSettings", new object[] { + public System.IAsyncResult BeginGetUserGeneralSettings(string loginName, string organizationId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetUserGeneralSettings", new object[] { loginName, organizationId}, callback, asyncState); } /// - public OrganizationUser EndGeUserGeneralSettings(System.IAsyncResult asyncResult) { + public OrganizationUser EndGetUserGeneralSettings(System.IAsyncResult asyncResult) { object[] results = this.EndInvoke(asyncResult); return ((OrganizationUser)(results[0])); } /// - public void GeUserGeneralSettingsAsync(string loginName, string organizationId) { - this.GeUserGeneralSettingsAsync(loginName, organizationId, null); + public void GetUserGeneralSettingsAsync(string loginName, string organizationId) { + this.GetUserGeneralSettingsAsync(loginName, organizationId, null); } /// - public void GeUserGeneralSettingsAsync(string loginName, string organizationId, object userState) { - if ((this.GeUserGeneralSettingsOperationCompleted == null)) { - this.GeUserGeneralSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGeUserGeneralSettingsOperationCompleted); + public void GetUserGeneralSettingsAsync(string loginName, string organizationId, object userState) { + if ((this.GetUserGeneralSettingsOperationCompleted == null)) { + this.GetUserGeneralSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetUserGeneralSettingsOperationCompleted); } - this.InvokeAsync("GeUserGeneralSettings", new object[] { + this.InvokeAsync("GetUserGeneralSettings", new object[] { loginName, - organizationId}, this.GeUserGeneralSettingsOperationCompleted, userState); + organizationId}, this.GetUserGeneralSettingsOperationCompleted, userState); } - private void OnGeUserGeneralSettingsOperationCompleted(object arg) { - if ((this.GeUserGeneralSettingsCompleted != null)) { + private void OnGetUserGeneralSettingsOperationCompleted(object arg) { + if ((this.GetUserGeneralSettingsCompleted != null)) { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.GeUserGeneralSettingsCompleted(this, new GeUserGeneralSettingsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + this.GetUserGeneralSettingsCompleted(this, new GetUserGeneralSettingsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } @@ -745,21 +724,57 @@ namespace WebsitePanel.Providers.HostedSolution { } } + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetSamAccountNameByUserPrincipalName", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + public string GetSamAccountNameByUserPrincipalName(string organizationId, string userPrincipalName) { + object[] results = this.Invoke("GetSamAccountNameByUserPrincipalName", new object[] { + organizationId, + userPrincipalName}); + return ((string)(results[0])); + } + + /// + public System.IAsyncResult BeginGetSamAccountNameByUserPrincipalName(string organizationId, string userPrincipalName, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetSamAccountNameByUserPrincipalName", new object[] { + organizationId, + userPrincipalName}, callback, asyncState); + } + + /// + public string EndGetSamAccountNameByUserPrincipalName(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((string)(results[0])); + } + + /// + public void GetSamAccountNameByUserPrincipalNameAsync(string organizationId, string userPrincipalName) { + this.GetSamAccountNameByUserPrincipalNameAsync(organizationId, userPrincipalName, null); + } + + /// + public void GetSamAccountNameByUserPrincipalNameAsync(string organizationId, string userPrincipalName, object userState) { + if ((this.GetSamAccountNameByUserPrincipalNameOperationCompleted == null)) { + this.GetSamAccountNameByUserPrincipalNameOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetSamAccountNameByUserPrincipalNameOperationCompleted); + } + this.InvokeAsync("GetSamAccountNameByUserPrincipalName", new object[] { + organizationId, + userPrincipalName}, this.GetSamAccountNameByUserPrincipalNameOperationCompleted, userState); + } + + private void OnGetSamAccountNameByUserPrincipalNameOperationCompleted(object arg) { + if ((this.GetSamAccountNameByUserPrincipalNameCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetSamAccountNameByUserPrincipalNameCompleted(this, new GetSamAccountNameByUserPrincipalNameCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + /// public new void CancelAsync(object userState) { base.CancelAsync(userState); } } - - - - - - - - - /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void OrganizationExistsCompletedEventHandler(object sender, OrganizationExistsCompletedEventArgs e); @@ -818,7 +833,29 @@ namespace WebsitePanel.Providers.HostedSolution { /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void CreateUserCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + 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 int Result { + get { + this.RaiseExceptionIfNecessary(); + return ((int)(this.results[0])); + } + } + } /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] @@ -826,17 +863,17 @@ namespace WebsitePanel.Providers.HostedSolution { /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] - public delegate void GeUserGeneralSettingsCompletedEventHandler(object sender, GeUserGeneralSettingsCompletedEventArgs e); + public delegate void GetUserGeneralSettingsCompletedEventHandler(object sender, GetUserGeneralSettingsCompletedEventArgs e); /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GeUserGeneralSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + public partial class GetUserGeneralSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { private object[] results; - internal GeUserGeneralSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + internal GetUserGeneralSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : base(exception, cancelled, userState) { this.results = results; } @@ -887,4 +924,30 @@ namespace WebsitePanel.Providers.HostedSolution { } } } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetSamAccountNameByUserPrincipalNameCompletedEventHandler(object sender, GetSamAccountNameByUserPrincipalNameCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetSamAccountNameByUserPrincipalNameCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal GetSamAccountNameByUserPrincipalNameCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public string Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string)(this.results[0])); + } + } + } } diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Utils/Log.cs b/WebsitePanel/Sources/WebsitePanel.Server.Utils/Log.cs index be3ea63f..e645d9f5 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.Utils/Log.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server.Utils/Log.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2012, Outercurve Foundation. +// Copyright (c) 2011, Outercurve Foundation. // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, @@ -31,125 +31,125 @@ using System.Diagnostics; namespace WebsitePanel.Server.Utils { - /// - /// Application log. - /// - public sealed class Log - { + /// + /// Application log. + /// + public sealed class Log + { private static TraceSwitch logSeverity = new TraceSwitch("Log", "General trace switch"); - - private Log() - { - } - /// - /// Write error to the log. - /// - /// Error message. - /// Exception. - public static void WriteError(string message, Exception ex) - { - try - { - if (logSeverity.TraceError) - { - string line = string.Format("[{0:G}] ERROR: {1}\n{2}\n", DateTime.Now, message, ex); - Trace.TraceError(line); - } - } - catch { } - } + private Log() + { + } - /// - /// Write error to the log. - /// - /// Exception. - public static void WriteError(Exception ex) - { + /// + /// Write error to the log. + /// + /// Error message. + /// Exception. + public static void WriteError(string message, Exception ex) + { + try + { + if (logSeverity.TraceError) + { + string line = string.Format("[{0:G}] ERROR: {1}\n{2}\n", DateTime.Now, message, ex); + Trace.TraceError(line); + } + } + catch { } + } - try - { - if (ex != null) - { - WriteError(ex.Message, ex); - } - } - catch { } - } + /// + /// Write error to the log. + /// + /// Exception. + public static void WriteError(Exception ex) + { - /// - /// Write info message to log - /// - /// - public static void WriteInfo(string message, params object[] args) - { - try - { - if (logSeverity.TraceInfo) - { - Trace.TraceInformation(FormatIncomingMessage(message, args)); - } - } - catch { } - } + try + { + if (ex != null) + { + WriteError(ex.Message, ex); + } + } + catch { } + } - /// - /// Write info message to log - /// - /// - public static void WriteWarning(string message, params object[] args) - { - try - { - if (logSeverity.TraceWarning) - { - Trace.TraceWarning(FormatIncomingMessage(message, args)); - } - } - catch { } - } + /// + /// Write info message to log + /// + /// + public static void WriteInfo(string message, params object[] args) + { + try + { + if (logSeverity.TraceInfo) + { + Trace.TraceInformation(FormatIncomingMessage(message, "INFO", args)); + } + } + catch { } + } - /// - /// Write start message to log - /// - /// + /// + /// Write info message to log + /// + /// + public static void WriteWarning(string message, params object[] args) + { + try + { + if (logSeverity.TraceWarning) + { + Trace.TraceWarning(FormatIncomingMessage(message, "WARNING", args)); + } + } + catch { } + } + + /// + /// Write start message to log + /// + /// public static void WriteStart(string message, params object[] args) - { - try - { - if (logSeverity.TraceInfo) - { - Trace.TraceInformation(FormatIncomingMessage(message, args)); - } - } - catch { } - } - - /// - /// Write end message to log - /// - /// - public static void WriteEnd(string message, params object[] args) - { - try - { - if (logSeverity.TraceInfo) - { - Trace.TraceInformation(FormatIncomingMessage(message, args)); - } - } - catch { } - } + { + try + { + if (logSeverity.TraceInfo) + { + Trace.TraceInformation(FormatIncomingMessage(message, "START", args)); + } + } + catch { } + } - private static string FormatIncomingMessage(string message, params object[] args) - { - // - if (args.Length > 0) - { - message = String.Format(message, args); - } - // - return String.Concat(String.Format("[{0:G}] END: ", DateTime.Now), message); - } - } + /// + /// Write end message to log + /// + /// + public static void WriteEnd(string message, params object[] args) + { + try + { + if (logSeverity.TraceInfo) + { + Trace.TraceInformation(FormatIncomingMessage(message, "END", args)); + } + } + catch { } + } + + private static string FormatIncomingMessage(string message, string tag, params object[] args) + { + // + if (args.Length > 0) + { + message = String.Format(message, args); + } + // + return String.Concat(String.Format("[{0:G}] {1}: ", DateTime.Now, tag), message); + } + } } diff --git a/WebsitePanel/Sources/WebsitePanel.Server/ExchangeServer.asmx.cs b/WebsitePanel/Sources/WebsitePanel.Server/ExchangeServer.asmx.cs index 04617336..c7f05931 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/ExchangeServer.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server/ExchangeServer.asmx.cs @@ -68,41 +68,43 @@ namespace WebsitePanel.Server } } - #region Organizations - - [WebMethod, SoapHeader("settings")] - public Organization ExtendToExchangeOrganization(string organizationId, string securityGroup) - { - try - { - LogStart("ExtendToExchangeOrganization"); - Organization ret = ES.ExtendToExchangeOrganization(organizationId, securityGroup); - LogEnd("ExtendToExchangeOrganization"); - return ret; - } - catch (Exception ex) - { - LogError("ExtendToExchangeOrganization", ex); - throw; - } - } + #region Organizations [WebMethod, SoapHeader("settings")] - public string CreateMailEnableUser(string upn, string organizationId, string organizationDistinguishedName, ExchangeAccountType accountType, - string mailboxDatabase, string offlineAddressBook, + public Organization ExtendToExchangeOrganization(string organizationId, string securityGroup, bool IsConsumer) + { + try + { + LogStart("ExtendToExchangeOrganization"); + Organization ret = ES.ExtendToExchangeOrganization(organizationId, securityGroup, IsConsumer); + LogEnd("ExtendToExchangeOrganization"); + return ret; + } + catch (Exception ex) + { + LogError("ExtendToExchangeOrganization", ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public string CreateMailEnableUser(string upn, string organizationId, string organizationDistinguishedName, ExchangeAccountType accountType, + string mailboxDatabase, string offlineAddressBook, string addressBookPolicy, string accountName, bool enablePOP, bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, - int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays) + int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays, + int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB, bool hideFromAddressBook, bool isConsumer) { try { LogStart("CreateMailEnableUser"); - string ret = ES.CreateMailEnableUser(upn, organizationId, organizationDistinguishedName,accountType, - mailboxDatabase, offlineAddressBook, + string ret = ES.CreateMailEnableUser(upn, organizationId, organizationDistinguishedName, accountType, + mailboxDatabase, offlineAddressBook, addressBookPolicy, accountName, enablePOP, enableIMAP, enableOWA, enableMAPI, enableActiveSync, issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, - keepDeletedItemsDays); + keepDeletedItemsDays, + maxRecipients, maxSendMessageSizeKB, maxReceiveMessageSizeKB, hideFromAddressBook, isConsumer); LogEnd("CreateMailEnableUser"); return ret; } @@ -113,137 +115,155 @@ namespace WebsitePanel.Server } } - /// - /// Creates organization OAB - /// - /// - /// - /// - /// - [WebMethod, SoapHeader("settings")] - public Organization CreateOrganizationOfflineAddressBook(string organizationId, string securityGroup, string oabVirtualDir) - { - try - { - LogStart("CreateOrganizationOfflineAddressBook"); - Organization ret = ES.CreateOrganizationOfflineAddressBook(organizationId, securityGroup, oabVirtualDir); - LogEnd("CreateOrganizationOfflineAddressBook"); - return ret; - } - catch (Exception ex) - { - LogError("CreateOrganizationOfflineAddressBook", ex); - throw; - } - } + /// + /// Creates organization OAB + /// + /// + /// + /// + /// + [WebMethod, SoapHeader("settings")] + public Organization CreateOrganizationOfflineAddressBook(string organizationId, string securityGroup, string oabVirtualDir) + { + try + { + LogStart("CreateOrganizationOfflineAddressBook"); + Organization ret = ES.CreateOrganizationOfflineAddressBook(organizationId, securityGroup, oabVirtualDir); + LogEnd("CreateOrganizationOfflineAddressBook"); + return ret; + } + catch (Exception ex) + { + LogError("CreateOrganizationOfflineAddressBook", ex); + throw; + } + } - /// - /// Updates organization OAB - /// - /// - [WebMethod, SoapHeader("settings")] - public void UpdateOrganizationOfflineAddressBook(string id) - { - try - { - LogStart("UpdateOrganizationOfflineAddressBook"); - ES.UpdateOrganizationOfflineAddressBook(id); - LogEnd("UpdateOrganizationOfflineAddressBook"); - } - catch (Exception ex) - { - LogError("UpdateOrganizationOfflineAddressBook", ex); - throw; - } - } + /// + /// Updates organization OAB + /// + /// + [WebMethod, SoapHeader("settings")] + public void UpdateOrganizationOfflineAddressBook(string id) + { + try + { + LogStart("UpdateOrganizationOfflineAddressBook"); + ES.UpdateOrganizationOfflineAddressBook(id); + LogEnd("UpdateOrganizationOfflineAddressBook"); + } + catch (Exception ex) + { + LogError("UpdateOrganizationOfflineAddressBook", ex); + throw; + } + } - [WebMethod, SoapHeader("settings")] - public string GetOABVirtualDirectory() - { - try - { - LogStart("GetOABVirtualDirectory"); - string ret = ES.GetOABVirtualDirectory(); - LogEnd("GetOABVirtualDirectory"); - return ret; - } - catch (Exception ex) - { - LogError("GetOABVirtualDirectory", ex); - throw; - } - } + [WebMethod, SoapHeader("settings")] + public string GetOABVirtualDirectory() + { + try + { + LogStart("GetOABVirtualDirectory"); + string ret = ES.GetOABVirtualDirectory(); + LogEnd("GetOABVirtualDirectory"); + return ret; + } + catch (Exception ex) + { + LogError("GetOABVirtualDirectory", ex); + throw; + } + } - [WebMethod, SoapHeader("settings")] - public bool DeleteOrganization(string organizationId, string distinguishedName, string globalAddressList, string addressList, string roomsAddressList, string offlineAddressBook, string securityGroup) - { - try - { - LogStart("DeleteOrganization"); - bool ret = ES.DeleteOrganization(organizationId, distinguishedName, globalAddressList, addressList, roomsAddressList, offlineAddressBook, securityGroup); - LogEnd("DeleteOrganization"); - return ret; - } - catch (Exception ex) - { - LogError("DeleteOrganization", ex); - throw; - } - } + [WebMethod, SoapHeader("settings")] + public Organization CreateOrganizationAddressBookPolicy(string organizationId, string gal, string addressBook, string roomList, string oab) + { + try + { + LogStart("CCreateOrganizationAddressBookPolicy"); + Organization ret = ES.CreateOrganizationAddressBookPolicy(organizationId, gal, addressBook, roomList, oab); + LogEnd("CreateOrganizationAddressBookPolicy"); + return ret; + } + catch (Exception ex) + { + LogError("CreateOrganizationAddressBookPolicy", ex); + throw; + } + } + + + [WebMethod, SoapHeader("settings")] + public bool DeleteOrganization(string organizationId, string distinguishedName, string globalAddressList, string addressList, string roomList, string offlineAddressBook, string securityGroup, string addressBookPolicy) + { + try + { + LogStart("DeleteOrganization"); + bool ret = ES.DeleteOrganization(organizationId, distinguishedName, globalAddressList, addressList, roomList, offlineAddressBook, securityGroup, addressBookPolicy); + LogEnd("DeleteOrganization"); + return ret; + } + catch (Exception ex) + { + LogError("DeleteOrganization", ex); + throw; + } + } - [WebMethod, SoapHeader("settings")] - public void SetOrganizationStorageLimits(string organizationDistinguishedName, int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays) - { - try - { - LogStart("SetOrganizationStorageLimits"); - ES.SetOrganizationStorageLimits(organizationDistinguishedName, issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, keepDeletedItemsDays); - LogEnd("SetOrganizationStorageLimits"); - } - catch (Exception ex) - { - LogError("SetOrganizationStorageLimits", ex); - throw; - } - } + [WebMethod, SoapHeader("settings")] + public void SetOrganizationStorageLimits(string organizationDistinguishedName, int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays) + { + try + { + LogStart("SetOrganizationStorageLimits"); + ES.SetOrganizationStorageLimits(organizationDistinguishedName, issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, keepDeletedItemsDays); + LogEnd("SetOrganizationStorageLimits"); + } + catch (Exception ex) + { + LogError("SetOrganizationStorageLimits", ex); + throw; + } + } - [WebMethod, SoapHeader("settings")] - public ExchangeItemStatistics[] GetMailboxesStatistics(string organizationDistinguishedName) - { - try - { - LogStart("GetMailboxesStatistics"); - ExchangeItemStatistics[] ret = ES.GetMailboxesStatistics(organizationDistinguishedName); - LogEnd("GetMailboxesStatistics"); - return ret; - } - catch (Exception ex) - { - LogError("GetMailboxesStatistics", ex); - throw; - } - } - #endregion + [WebMethod, SoapHeader("settings")] + public ExchangeItemStatistics[] GetMailboxesStatistics(string organizationDistinguishedName) + { + try + { + LogStart("GetMailboxesStatistics"); + ExchangeItemStatistics[] ret = ES.GetMailboxesStatistics(organizationDistinguishedName); + LogEnd("GetMailboxesStatistics"); + return ret; + } + catch (Exception ex) + { + LogError("GetMailboxesStatistics", ex); + throw; + } + } + #endregion - #region Domains - [WebMethod, SoapHeader("settings")] + #region Domains + [WebMethod, SoapHeader("settings")] public void AddAuthoritativeDomain(string domain) - { - try - { + { + try + { LogStart("AddAuthoritativeDomain"); ES.AddAuthoritativeDomain(domain); LogEnd("AddAuthoritativeDomain"); - } - catch (Exception ex) - { + } + catch (Exception ex) + { LogError("AddAuthoritativeDomain", ex); - throw; - } - } + throw; + } + } [WebMethod, SoapHeader("settings")] @@ -252,7 +272,7 @@ namespace WebsitePanel.Server try { LogStart("GetAuthoritativeDomains"); - string []ret = ES.GetAuthoritativeDomains(); + string[] ret = ES.GetAuthoritativeDomains(); LogEnd("GetAuthoritativeDomains"); return ret; } @@ -263,39 +283,41 @@ namespace WebsitePanel.Server } } - [WebMethod, SoapHeader("settings")] + [WebMethod, SoapHeader("settings")] public void DeleteAuthoritativeDomain(string domain) - { - try - { + { + try + { LogStart("DeleteAuthoritativeDomain"); ES.DeleteAuthoritativeDomain(domain); LogEnd("DeleteAuthoritativeDomain"); - } - catch (Exception ex) - { + } + catch (Exception ex) + { LogError("DeleteAuthoritativeDomain", ex); - throw; - } - } - #endregion + throw; + } + } + #endregion - #region Mailboxes + #region Mailboxes + /* [WebMethod, SoapHeader("settings")] public string CreateMailbox(string organizationId, string organizationDistinguishedName, string mailboxDatabase, - string securityGroup, string offlineAddressBook, ExchangeAccountType accountType, + string securityGroup, string offlineAddressBook, string addressBookPolicy, ExchangeAccountType accountType, string displayName, string accountName, string name, string domain, string password, bool enablePOP, bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, - int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays) + int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays, int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB, bool hideFromAddressBook) { try { LogStart("CreateMailbox"); string ret = ES.CreateMailbox(organizationId, organizationDistinguishedName, mailboxDatabase, securityGroup, - offlineAddressBook, accountType, + offlineAddressBook, addressBookPolicy, accountType, displayName, accountName, name, domain, password, enablePOP, enableIMAP, enableOWA, enableMAPI, enableActiveSync, - issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, keepDeletedItemsDays); + issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, keepDeletedItemsDays, + maxRecipients, maxSendMessageSizeKB, maxReceiveMessageSizeKB, hideFromAddressBook); LogEnd("CreateMailbox"); return ret; } @@ -305,22 +327,22 @@ namespace WebsitePanel.Server throw; } } - - [WebMethod, SoapHeader("settings")] - public void DeleteMailbox(string accountName) - { - try - { - LogStart("DeleteMailbox"); - ES.DeleteMailbox(accountName); - LogEnd("DeleteMailbox"); - } - catch (Exception ex) - { - LogError("DeleteMailbox", ex); - throw; - } - } +*/ + [WebMethod, SoapHeader("settings")] + public void DeleteMailbox(string accountName) + { + try + { + LogStart("DeleteMailbox"); + ES.DeleteMailbox(accountName); + LogEnd("DeleteMailbox"); + } + catch (Exception ex) + { + LogError("DeleteMailbox", ex); + throw; + } + } [WebMethod, SoapHeader("settings")] @@ -339,164 +361,164 @@ namespace WebsitePanel.Server } } - [WebMethod, SoapHeader("settings")] - public ExchangeMailbox GetMailboxGeneralSettings(string accountName) - { - try - { - LogStart("GetMailboxGeneralSettings"); - ExchangeMailbox ret = ES.GetMailboxGeneralSettings(accountName); - LogEnd("GetMailboxGeneralSettings"); - return ret; - } - catch (Exception ex) - { - LogError("GetMailboxGeneralSettings", ex); - throw; - } - } + [WebMethod, SoapHeader("settings")] + public ExchangeMailbox GetMailboxGeneralSettings(string accountName) + { + try + { + LogStart("GetMailboxGeneralSettings"); + ExchangeMailbox ret = ES.GetMailboxGeneralSettings(accountName); + LogEnd("GetMailboxGeneralSettings"); + return ret; + } + catch (Exception ex) + { + LogError("GetMailboxGeneralSettings", ex); + throw; + } + } - [WebMethod, SoapHeader("settings")] - public void SetMailboxGeneralSettings(string accountName, string displayName, string password, bool hideFromAddressBook, bool disabled, string firstName, string initials, string lastName, string address, string city, string state, string zip, string country, string jobTitle, string company, string department, string office, string managerAccountName, string businessPhone, string fax, string homePhone, string mobilePhone, string pager, string webPage, string notes) - { - try - { - LogStart("SetMailboxGeneralSettings"); - ES.SetMailboxGeneralSettings(accountName, displayName, password, hideFromAddressBook, disabled, firstName, initials, lastName, address, city, state, zip, country, jobTitle, company, department, office, managerAccountName, businessPhone, fax, homePhone, mobilePhone, pager, webPage, notes); - LogEnd("SetMailboxGeneralSettings"); - } - catch (Exception ex) - { - LogError("SetMailboxGeneralSettings", ex); - throw; - } - } + [WebMethod, SoapHeader("settings")] + public void SetMailboxGeneralSettings(string accountName, bool hideFromAddressBook, bool disabled) + { + try + { + LogStart("SetMailboxGeneralSettings"); + ES.SetMailboxGeneralSettings(accountName, hideFromAddressBook, disabled); + LogEnd("SetMailboxGeneralSettings"); + } + catch (Exception ex) + { + LogError("SetMailboxGeneralSettings", ex); + throw; + } + } - [WebMethod, SoapHeader("settings")] - public ExchangeMailbox GetMailboxMailFlowSettings(string accountName) - { - try - { - LogStart("GetMailboxMailFlowSettings"); - ExchangeMailbox ret = ES.GetMailboxMailFlowSettings(accountName); - LogEnd("GetMailboxMailFlowSettings"); - return ret; - } - catch (Exception ex) - { - LogError("GetMailboxMailFlowSettings", ex); - throw; - } - } + [WebMethod, SoapHeader("settings")] + public ExchangeMailbox GetMailboxMailFlowSettings(string accountName) + { + try + { + LogStart("GetMailboxMailFlowSettings"); + ExchangeMailbox ret = ES.GetMailboxMailFlowSettings(accountName); + LogEnd("GetMailboxMailFlowSettings"); + return ret; + } + catch (Exception ex) + { + LogError("GetMailboxMailFlowSettings", ex); + throw; + } + } - [WebMethod, SoapHeader("settings")] - public void SetMailboxMailFlowSettings(string accountName, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB, bool requireSenderAuthentication) - { - try - { - LogStart("SetMailboxMailFlowSettings"); - ES.SetMailboxMailFlowSettings(accountName, enableForwarding, forwardingAccountName, forwardToBoth, sendOnBehalfAccounts, acceptAccounts, rejectAccounts, maxRecipients, maxSendMessageSizeKB, maxReceiveMessageSizeKB, requireSenderAuthentication); - LogEnd("SetMailboxMailFlowSettings"); - } - catch (Exception ex) - { - LogError("SetMailboxMailFlowSettings", ex); - throw; - } - } + [WebMethod, SoapHeader("settings")] + public void SetMailboxMailFlowSettings(string accountName, bool enableForwarding, string forwardingAccountName, bool forwardToBoth, string[] sendOnBehalfAccounts, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) + { + try + { + LogStart("SetMailboxMailFlowSettings"); + ES.SetMailboxMailFlowSettings(accountName, enableForwarding, forwardingAccountName, forwardToBoth, sendOnBehalfAccounts, acceptAccounts, rejectAccounts, requireSenderAuthentication); + LogEnd("SetMailboxMailFlowSettings"); + } + catch (Exception ex) + { + LogError("SetMailboxMailFlowSettings", ex); + throw; + } + } - [WebMethod, SoapHeader("settings")] - public ExchangeMailbox GetMailboxAdvancedSettings(string accountName) - { - try - { - LogStart("GetMailboxAdvancedSettings"); - ExchangeMailbox ret = ES.GetMailboxAdvancedSettings(accountName); - LogEnd("GetMailboxAdvancedSettings"); - return ret; - } - catch (Exception ex) - { - LogError("GetMailboxAdvancedSettings", ex); - throw; - } - } + [WebMethod, SoapHeader("settings")] + public ExchangeMailbox GetMailboxAdvancedSettings(string accountName) + { + try + { + LogStart("GetMailboxAdvancedSettings"); + ExchangeMailbox ret = ES.GetMailboxAdvancedSettings(accountName); + LogEnd("GetMailboxAdvancedSettings"); + return ret; + } + catch (Exception ex) + { + LogError("GetMailboxAdvancedSettings", ex); + throw; + } + } - [WebMethod, SoapHeader("settings")] - public void SetMailboxAdvancedSettings(string organizationId, string accountName, bool enablePOP, bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, - int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays) - { - try - { - LogStart("SetMailboxAdvancedSettings"); - ES.SetMailboxAdvancedSettings(organizationId, accountName, enablePOP, enableIMAP, enableOWA, enableMAPI, enableActiveSync, - issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, keepDeletedItemsDays); - LogEnd("SetMailboxAdvancedSettings"); - } - catch (Exception ex) - { - LogError("SetMailboxAdvancedSettings", ex); - throw; - } - } + [WebMethod, SoapHeader("settings")] + public void SetMailboxAdvancedSettings(string organizationId, string accountName, bool enablePOP, bool enableIMAP, bool enableOWA, bool enableMAPI, bool enableActiveSync, + int issueWarningKB, int prohibitSendKB, int prohibitSendReceiveKB, int keepDeletedItemsDays, int maxRecipients, int maxSendMessageSizeKB, int maxReceiveMessageSizeKB) + { + try + { + LogStart("SetMailboxAdvancedSettings"); + ES.SetMailboxAdvancedSettings(organizationId, accountName, enablePOP, enableIMAP, enableOWA, enableMAPI, enableActiveSync, + issueWarningKB, prohibitSendKB, prohibitSendReceiveKB, keepDeletedItemsDays, maxRecipients, maxSendMessageSizeKB, maxReceiveMessageSizeKB); + LogEnd("SetMailboxAdvancedSettings"); + } + catch (Exception ex) + { + LogError("SetMailboxAdvancedSettings", ex); + throw; + } + } - [WebMethod, SoapHeader("settings")] - public ExchangeEmailAddress[] GetMailboxEmailAddresses(string accountName) - { - try - { - LogStart("GetMailboxEmailAddresses"); - ExchangeEmailAddress[] ret = ES.GetMailboxEmailAddresses(accountName); - LogEnd("GetMailboxEmailAddresses"); - return ret; - } - catch (Exception ex) - { - LogError("GetMailboxEmailAddresses", ex); - throw; - } - } + [WebMethod, SoapHeader("settings")] + public ExchangeEmailAddress[] GetMailboxEmailAddresses(string accountName) + { + try + { + LogStart("GetMailboxEmailAddresses"); + ExchangeEmailAddress[] ret = ES.GetMailboxEmailAddresses(accountName); + LogEnd("GetMailboxEmailAddresses"); + return ret; + } + catch (Exception ex) + { + LogError("GetMailboxEmailAddresses", ex); + throw; + } + } - [WebMethod, SoapHeader("settings")] - public void SetMailboxEmailAddresses(string accountName, string[] emailAddresses) - { - try - { - LogStart("SetMailboxEmailAddresses"); - ES.SetMailboxEmailAddresses(accountName, emailAddresses); - LogEnd("SetMailboxEmailAddresses"); - } - catch (Exception ex) - { - LogError("SetMailboxEmailAddresses", ex); - throw; - } - } + [WebMethod, SoapHeader("settings")] + public void SetMailboxEmailAddresses(string accountName, string[] emailAddresses) + { + try + { + LogStart("SetMailboxEmailAddresses"); + ES.SetMailboxEmailAddresses(accountName, emailAddresses); + LogEnd("SetMailboxEmailAddresses"); + } + catch (Exception ex) + { + LogError("SetMailboxEmailAddresses", ex); + throw; + } + } - [WebMethod, SoapHeader("settings")] - public void SetMailboxPrimaryEmailAddress(string accountName, string emailAddress) - { - try - { - LogStart("SetMailboxPrimaryEmailAddress"); - ES.SetMailboxPrimaryEmailAddress(accountName, emailAddress); - LogEnd("SetMailboxPrimaryEmailAddress"); - } - catch (Exception ex) - { - LogError("SetMailboxPrimaryEmailAddress", ex); - throw; - } - } + [WebMethod, SoapHeader("settings")] + public void SetMailboxPrimaryEmailAddress(string accountName, string emailAddress) + { + try + { + LogStart("SetMailboxPrimaryEmailAddress"); + ES.SetMailboxPrimaryEmailAddress(accountName, emailAddress); + LogEnd("SetMailboxPrimaryEmailAddress"); + } + catch (Exception ex) + { + LogError("SetMailboxPrimaryEmailAddress", ex); + throw; + } + } [WebMethod, SoapHeader("settings")] - public void SetMailboxPermissions(string organizationId, string accountName, string[] sendAsAccounts, string[] fullAccessAccounts) + public void SetMailboxPermissions(string organizationId, string accountName, string[] sendAsAccounts, string[] fullAccessAccounts) { try { LogStart("SetMailboxPermissions"); - ES.SetMailboxPermissions(organizationId, accountName, sendAsAccounts, fullAccessAccounts); + ES.SetMailboxPermissions(organizationId, accountName, sendAsAccounts, fullAccessAccounts); LogEnd("SetMailboxPermissions"); } catch (Exception ex) @@ -505,16 +527,16 @@ namespace WebsitePanel.Server throw; } } - - + + [WebMethod, SoapHeader("settings")] - public ExchangeMailbox GetMailboxPermissions(string organizationId, string accountName) + public ExchangeMailbox GetMailboxPermissions(string organizationId, string accountName) { try { LogStart("GetMailboxPermissions"); - ExchangeMailbox ret = ES.GetMailboxPermissions(organizationId, accountName); + ExchangeMailbox ret = ES.GetMailboxPermissions(organizationId, accountName); LogEnd("GetMailboxPermissions"); return ret; } @@ -525,285 +547,285 @@ namespace WebsitePanel.Server } } - [WebMethod, SoapHeader("settings")] - public ExchangeMailboxStatistics GetMailboxStatistics(string accountName) - { - try - { - LogStart("GetMailboxStatistics"); - ExchangeMailboxStatistics ret = ES.GetMailboxStatistics(accountName); - LogEnd("GetMailboxStatistics"); - return ret; - } - catch (Exception ex) - { - Log.WriteError("GetMailboxStatistics", ex); - throw; - } - } + [WebMethod, SoapHeader("settings")] + public ExchangeMailboxStatistics GetMailboxStatistics(string accountName) + { + try + { + LogStart("GetMailboxStatistics"); + ExchangeMailboxStatistics ret = ES.GetMailboxStatistics(accountName); + LogEnd("GetMailboxStatistics"); + return ret; + } + catch (Exception ex) + { + Log.WriteError("GetMailboxStatistics", ex); + throw; + } + } #endregion - #region Contacts - [WebMethod, SoapHeader("settings")] + #region Contacts + [WebMethod, SoapHeader("settings")] public void CreateContact(string organizationId, string organizationDistinguishedName, string contactDisplayName, string contactAccountName, string contactEmail, string defaultOrganizationDomain) - { - try - { - LogStart("CreateContact"); + { + try + { + LogStart("CreateContact"); ES.CreateContact(organizationId, organizationDistinguishedName, contactDisplayName, contactAccountName, contactEmail, defaultOrganizationDomain); - LogEnd("CreateContact"); - } - catch (Exception ex) - { - LogError("CreateContact", ex); - throw; - } - } - - [WebMethod, SoapHeader("settings")] - public void DeleteContact(string accountName) - { - try - { - LogStart("DeleteContact"); - ES.DeleteContact(accountName); - LogEnd("DeleteContact"); - } - catch (Exception ex) - { - LogError("DeleteContact", ex); - throw; - } - } - - [WebMethod, SoapHeader("settings")] - public ExchangeContact GetContactGeneralSettings(string accountName) - { - try - { - LogStart("GetContactGeneralSettings"); - ExchangeContact ret = ES.GetContactGeneralSettings(accountName); - LogEnd("GetContactGeneralSettings"); - return ret; - } - catch (Exception ex) - { - LogError("GetContactGeneralSettings", ex); - throw; - } - } - - [WebMethod, SoapHeader("settings")] - public void SetContactGeneralSettings(string accountName, string displayName, string email, bool hideFromAddressBook, string firstName, string initials, string lastName, string address, string city, string state, string zip, string country, string jobTitle, string company, string department, string office, string managerAccountName, string businessPhone, string fax, string homePhone, string mobilePhone, string pager, string webPage, string notes, int useMapiRichTextFormat, string defaultDomain) - { - try - { - LogStart("SetContactGeneralSettings"); - ES.SetContactGeneralSettings(accountName, displayName, email, hideFromAddressBook, firstName, initials, lastName, address, city, state, zip, country, jobTitle, company, department, office, managerAccountName, businessPhone, fax, homePhone, mobilePhone, pager, webPage, notes, useMapiRichTextFormat, defaultDomain); - LogEnd("SetContactGeneralSettings"); - } - catch (Exception ex) - { - LogError("SetContactGeneralSettings", ex); - throw; - } - } - - [WebMethod, SoapHeader("settings")] - public ExchangeContact GetContactMailFlowSettings(string accountName) - { - try - { - LogStart("GetContactMailFlowSettings"); - ExchangeContact ret = ES.GetContactMailFlowSettings(accountName); - LogEnd("GetContactMailFlowSettings"); - return ret; - } - catch (Exception ex) - { - LogError("GetContactMailFlowSettings", ex); - throw; - } - } - - [WebMethod, SoapHeader("settings")] - public void SetContactMailFlowSettings(string accountName, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) - { - try - { - LogStart("SetContactMailFlowSettings"); - ES.SetContactMailFlowSettings(accountName, acceptAccounts, rejectAccounts, requireSenderAuthentication); - LogEnd("SetContactMailFlowSettings"); - } - catch (Exception ex) - { - LogError("SetContactMailFlowSettings", ex); - throw; - } - } - #endregion - - #region Distribution Lists - [WebMethod, SoapHeader("settings")] - public void CreateDistributionList(string organizationId, string organizationDistinguishedName, string displayName, string accountName, string name, string domain, string managedBy) - { - try - { - LogStart("CreateDistributionList"); - ES.CreateDistributionList(organizationId, organizationDistinguishedName, displayName, accountName, name, domain, managedBy); - LogEnd("CreateDistributionList"); - } - catch (Exception ex) - { - LogError("CreateDistributionList", ex); - throw; - } - } - - [WebMethod, SoapHeader("settings")] - public void DeleteDistributionList(string accountName) - { - try - { - LogStart("DeleteDistributionList"); - ES.DeleteDistributionList(accountName); - LogEnd("DeleteDistributionList"); - } - catch (Exception ex) - { - LogError("DeleteDistributionList", ex); - throw; - } - } - - [WebMethod, SoapHeader("settings")] - public ExchangeDistributionList GetDistributionListGeneralSettings(string accountName) - { - try - { - LogStart("GetDistributionListGeneralSettings"); - ExchangeDistributionList ret = ES.GetDistributionListGeneralSettings(accountName); - LogEnd("GetDistributionListGeneralSettings"); - return ret; - } - catch (Exception ex) - { - LogError("GetDistributionListGeneralSettings", ex); - throw; - } - } - - [WebMethod, SoapHeader("settings")] - public void SetDistributionListGeneralSettings(string accountName, string displayName, bool hideFromAddressBook, string managedBy, string[] members, string notes) - { - try - { - LogStart("SetDistributionListGeneralSettings"); - ES.SetDistributionListGeneralSettings(accountName, displayName, hideFromAddressBook, managedBy, members, notes); - LogEnd("SetDistributionListGeneralSettings"); - } - catch (Exception ex) - { - LogError("SetDistributionListGeneralSettings", ex); - throw; - } - } - - [WebMethod, SoapHeader("settings")] - public ExchangeDistributionList GetDistributionListMailFlowSettings(string accountName) - { - try - { - LogStart("GetDistributionListMailFlowSettings"); - ExchangeDistributionList ret = ES.GetDistributionListMailFlowSettings(accountName); - LogEnd("GetDistributionListMailFlowSettings"); - return ret; - } - catch (Exception ex) - { - LogError("GetDistributionListMailFlowSettings", ex); - throw; - } - } - - [WebMethod, SoapHeader("settings")] - public void SetDistributionListMailFlowSettings(string accountName, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) - { - try - { - LogStart("SetDistributionListMailFlowSettings"); - ES.SetDistributionListMailFlowSettings(accountName, acceptAccounts, rejectAccounts, requireSenderAuthentication); - LogEnd("SetDistributionListMailFlowSettings"); - } - catch (Exception ex) - { - LogError("SetDistributionListMailFlowSettings", ex); - throw; - } - } - - [WebMethod, SoapHeader("settings")] - public ExchangeEmailAddress[] GetDistributionListEmailAddresses(string accountName) - { - try - { - LogStart("GetDistributionListEmailAddresses"); - ExchangeEmailAddress[] ret = ES.GetDistributionListEmailAddresses(accountName); - LogEnd("GetDistributionListEmailAddresses"); - return ret; - } - catch (Exception ex) - { - LogError("GetDistributionListEmailAddresses", ex); - throw; - } - } - - [WebMethod, SoapHeader("settings")] - public void SetDistributionListEmailAddresses(string accountName, string[] emailAddresses) - { - try - { - LogStart("SetDistributionListEmailAddresses"); - ES.SetDistributionListEmailAddresses(accountName, emailAddresses); - LogEnd("SetDistributionListEmailAddresses"); - } - catch (Exception ex) - { - LogError("SetDistributionListEmailAddresses", ex); - throw; - } - } - - [WebMethod, SoapHeader("settings")] - public void SetDistributionListPrimaryEmailAddress(string accountName, string emailAddress) - { - try - { - LogStart("SetDistributionListPrimaryEmailAddress"); - ES.SetDistributionListPrimaryEmailAddress(accountName, emailAddress); - LogEnd("SetDistributionListPrimaryEmailAddress"); - } - catch (Exception ex) - { - LogError("SetDistributionListPrimaryEmailAddress", ex); - throw; - } - } + LogEnd("CreateContact"); + } + catch (Exception ex) + { + LogError("CreateContact", ex); + throw; + } + } [WebMethod, SoapHeader("settings")] - public void SetDistributionListPermissions(string organizationId, string accountName, string[] sendAsAccounts, string[] sendOnBehalfAccounts) + public void DeleteContact(string accountName) { - ES.SetDistributionListPermissions(organizationId, accountName, sendAsAccounts, sendOnBehalfAccounts); + try + { + LogStart("DeleteContact"); + ES.DeleteContact(accountName); + LogEnd("DeleteContact"); + } + catch (Exception ex) + { + LogError("DeleteContact", ex); + throw; + } } - + + [WebMethod, SoapHeader("settings")] + public ExchangeContact GetContactGeneralSettings(string accountName) + { + try + { + LogStart("GetContactGeneralSettings"); + ExchangeContact ret = ES.GetContactGeneralSettings(accountName); + LogEnd("GetContactGeneralSettings"); + return ret; + } + catch (Exception ex) + { + LogError("GetContactGeneralSettings", ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public void SetContactGeneralSettings(string accountName, string displayName, string email, bool hideFromAddressBook, string firstName, string initials, string lastName, string address, string city, string state, string zip, string country, string jobTitle, string company, string department, string office, string managerAccountName, string businessPhone, string fax, string homePhone, string mobilePhone, string pager, string webPage, string notes, int useMapiRichTextFormat, string defaultDomain) + { + try + { + LogStart("SetContactGeneralSettings"); + ES.SetContactGeneralSettings(accountName, displayName, email, hideFromAddressBook, firstName, initials, lastName, address, city, state, zip, country, jobTitle, company, department, office, managerAccountName, businessPhone, fax, homePhone, mobilePhone, pager, webPage, notes, useMapiRichTextFormat, defaultDomain); + LogEnd("SetContactGeneralSettings"); + } + catch (Exception ex) + { + LogError("SetContactGeneralSettings", ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public ExchangeContact GetContactMailFlowSettings(string accountName) + { + try + { + LogStart("GetContactMailFlowSettings"); + ExchangeContact ret = ES.GetContactMailFlowSettings(accountName); + LogEnd("GetContactMailFlowSettings"); + return ret; + } + catch (Exception ex) + { + LogError("GetContactMailFlowSettings", ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public void SetContactMailFlowSettings(string accountName, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication) + { + try + { + LogStart("SetContactMailFlowSettings"); + ES.SetContactMailFlowSettings(accountName, acceptAccounts, rejectAccounts, requireSenderAuthentication); + LogEnd("SetContactMailFlowSettings"); + } + catch (Exception ex) + { + LogError("SetContactMailFlowSettings", ex); + throw; + } + } + #endregion + + #region Distribution Lists + [WebMethod, SoapHeader("settings")] + public void CreateDistributionList(string organizationId, string organizationDistinguishedName, string displayName, string accountName, string name, string domain, string managedBy, string[] addressLists) + { + try + { + LogStart("CreateDistributionList"); + ES.CreateDistributionList(organizationId, organizationDistinguishedName, displayName, accountName, name, domain, managedBy, addressLists); + LogEnd("CreateDistributionList"); + } + catch (Exception ex) + { + LogError("CreateDistributionList", ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public void DeleteDistributionList(string accountName) + { + try + { + LogStart("DeleteDistributionList"); + ES.DeleteDistributionList(accountName); + LogEnd("DeleteDistributionList"); + } + catch (Exception ex) + { + LogError("DeleteDistributionList", ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public ExchangeDistributionList GetDistributionListGeneralSettings(string accountName) + { + try + { + LogStart("GetDistributionListGeneralSettings"); + ExchangeDistributionList ret = ES.GetDistributionListGeneralSettings(accountName); + LogEnd("GetDistributionListGeneralSettings"); + return ret; + } + catch (Exception ex) + { + LogError("GetDistributionListGeneralSettings", ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public void SetDistributionListGeneralSettings(string accountName, string displayName, bool hideFromAddressBook, string managedBy, string[] members, string notes, string[] addressLists) + { + try + { + LogStart("SetDistributionListGeneralSettings"); + ES.SetDistributionListGeneralSettings(accountName, displayName, hideFromAddressBook, managedBy, members, notes, addressLists); + LogEnd("SetDistributionListGeneralSettings"); + } + catch (Exception ex) + { + LogError("SetDistributionListGeneralSettings", ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public ExchangeDistributionList GetDistributionListMailFlowSettings(string accountName) + { + try + { + LogStart("GetDistributionListMailFlowSettings"); + ExchangeDistributionList ret = ES.GetDistributionListMailFlowSettings(accountName); + LogEnd("GetDistributionListMailFlowSettings"); + return ret; + } + catch (Exception ex) + { + LogError("GetDistributionListMailFlowSettings", ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public void SetDistributionListMailFlowSettings(string accountName, string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication, string[] addressLists) + { + try + { + LogStart("SetDistributionListMailFlowSettings"); + ES.SetDistributionListMailFlowSettings(accountName, acceptAccounts, rejectAccounts, requireSenderAuthentication, addressLists); + LogEnd("SetDistributionListMailFlowSettings"); + } + catch (Exception ex) + { + LogError("SetDistributionListMailFlowSettings", ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public ExchangeEmailAddress[] GetDistributionListEmailAddresses(string accountName) + { + try + { + LogStart("GetDistributionListEmailAddresses"); + ExchangeEmailAddress[] ret = ES.GetDistributionListEmailAddresses(accountName); + LogEnd("GetDistributionListEmailAddresses"); + return ret; + } + catch (Exception ex) + { + LogError("GetDistributionListEmailAddresses", ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public void SetDistributionListEmailAddresses(string accountName, string[] emailAddresses, string[] addressLists) + { + try + { + LogStart("SetDistributionListEmailAddresses"); + ES.SetDistributionListEmailAddresses(accountName, emailAddresses, addressLists); + LogEnd("SetDistributionListEmailAddresses"); + } + catch (Exception ex) + { + LogError("SetDistributionListEmailAddresses", ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public void SetDistributionListPrimaryEmailAddress(string accountName, string emailAddress, string[] addressLists) + { + try + { + LogStart("SetDistributionListPrimaryEmailAddress"); + ES.SetDistributionListPrimaryEmailAddress(accountName, emailAddress, addressLists); + LogEnd("SetDistributionListPrimaryEmailAddress"); + } + catch (Exception ex) + { + LogError("SetDistributionListPrimaryEmailAddress", ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public void SetDistributionListPermissions(string organizationId, string accountName, string[] sendAsAccounts, string[] sendOnBehalfAccounts, string[] addressLists) + { + ES.SetDistributionListPermissions(organizationId, accountName, sendAsAccounts, sendOnBehalfAccounts, addressLists); + } + [WebMethod, SoapHeader("settings")] public ExchangeDistributionList GetDistributionListPermissions(string organizationId, string accountName) { return ES.GetDistributionListPermissions(organizationId, accountName); } - + #endregion @@ -1048,148 +1070,148 @@ namespace WebsitePanel.Server #endregion - #region ActiveSync - [WebMethod, SoapHeader("settings")] - public void CreateOrganizationActiveSyncPolicy(string organizationId) - { - try - { - LogStart("CreateOrganizationActiveSyncPolicy"); - ES.CreateOrganizationActiveSyncPolicy(organizationId); - LogEnd("CreateOrganizationActiveSyncPolicy"); - } - catch (Exception ex) - { - LogError("CreateOrganizationActiveSyncPolicy", ex); - throw; - } - } + #region ActiveSync + [WebMethod, SoapHeader("settings")] + public void CreateOrganizationActiveSyncPolicy(string organizationId) + { + try + { + LogStart("CreateOrganizationActiveSyncPolicy"); + ES.CreateOrganizationActiveSyncPolicy(organizationId); + LogEnd("CreateOrganizationActiveSyncPolicy"); + } + catch (Exception ex) + { + LogError("CreateOrganizationActiveSyncPolicy", ex); + throw; + } + } - [WebMethod, SoapHeader("settings")] - public ExchangeActiveSyncPolicy GetActiveSyncPolicy(string organizationId) - { - try - { - LogStart("GetActiveSyncPolicy"); - ExchangeActiveSyncPolicy ret = ES.GetActiveSyncPolicy(organizationId); - LogEnd("GetActiveSyncPolicy"); - return ret; - } - catch (Exception ex) - { - LogError("GetActiveSyncPolicy", ex); - throw; - } - } + [WebMethod, SoapHeader("settings")] + public ExchangeActiveSyncPolicy GetActiveSyncPolicy(string organizationId) + { + try + { + LogStart("GetActiveSyncPolicy"); + ExchangeActiveSyncPolicy ret = ES.GetActiveSyncPolicy(organizationId); + LogEnd("GetActiveSyncPolicy"); + return ret; + } + catch (Exception ex) + { + LogError("GetActiveSyncPolicy", ex); + throw; + } + } - [WebMethod, SoapHeader("settings")] - public void SetActiveSyncPolicy(string id, bool allowNonProvisionableDevices, bool attachmentsEnabled, - int maxAttachmentSizeKB, bool uncAccessEnabled, bool wssAccessEnabled, bool devicePasswordEnabled, - bool alphanumericPasswordRequired, bool passwordRecoveryEnabled, bool deviceEncryptionEnabled, - bool allowSimplePassword, int maxPasswordFailedAttempts, int minPasswordLength, int inactivityLockMin, - int passwordExpirationDays, int passwordHistory, int refreshInterval) - { - try - { - LogStart("SetActiveSyncPolicy"); - ES.SetActiveSyncPolicy(id, allowNonProvisionableDevices, attachmentsEnabled, - maxAttachmentSizeKB, uncAccessEnabled, wssAccessEnabled, devicePasswordEnabled, alphanumericPasswordRequired, passwordRecoveryEnabled, - deviceEncryptionEnabled, allowSimplePassword, maxPasswordFailedAttempts, - minPasswordLength, inactivityLockMin, passwordExpirationDays, passwordHistory, refreshInterval); - LogEnd("SetActiveSyncPolicy"); - } - catch (Exception ex) - { - LogError("SetActiveSyncPolicy", ex); - throw; - } - } - #endregion + [WebMethod, SoapHeader("settings")] + public void SetActiveSyncPolicy(string id, bool allowNonProvisionableDevices, bool attachmentsEnabled, + int maxAttachmentSizeKB, bool uncAccessEnabled, bool wssAccessEnabled, bool devicePasswordEnabled, + bool alphanumericPasswordRequired, bool passwordRecoveryEnabled, bool deviceEncryptionEnabled, + bool allowSimplePassword, int maxPasswordFailedAttempts, int minPasswordLength, int inactivityLockMin, + int passwordExpirationDays, int passwordHistory, int refreshInterval) + { + try + { + LogStart("SetActiveSyncPolicy"); + ES.SetActiveSyncPolicy(id, allowNonProvisionableDevices, attachmentsEnabled, + maxAttachmentSizeKB, uncAccessEnabled, wssAccessEnabled, devicePasswordEnabled, alphanumericPasswordRequired, passwordRecoveryEnabled, + deviceEncryptionEnabled, allowSimplePassword, maxPasswordFailedAttempts, + minPasswordLength, inactivityLockMin, passwordExpirationDays, passwordHistory, refreshInterval); + LogEnd("SetActiveSyncPolicy"); + } + catch (Exception ex) + { + LogError("SetActiveSyncPolicy", ex); + throw; + } + } + #endregion - #region Mobile devices - [WebMethod, SoapHeader("settings")] - public ExchangeMobileDevice[] GetMobileDevices(string accountName) - { - try - { - LogStart("GetMobileDevices"); - ExchangeMobileDevice[] ret = ES.GetMobileDevices(accountName); - LogEnd("GetMobileDevices"); - return ret; - } - catch (Exception ex) - { - LogError("GetMobileDevices", ex); - throw; - } - } + #region Mobile devices + [WebMethod, SoapHeader("settings")] + public ExchangeMobileDevice[] GetMobileDevices(string accountName) + { + try + { + LogStart("GetMobileDevices"); + ExchangeMobileDevice[] ret = ES.GetMobileDevices(accountName); + LogEnd("GetMobileDevices"); + return ret; + } + catch (Exception ex) + { + LogError("GetMobileDevices", ex); + throw; + } + } - [WebMethod, SoapHeader("settings")] - public ExchangeMobileDevice GetMobileDevice(string id) - { - try - { - LogStart("GetMobileDevice"); - ExchangeMobileDevice ret = ES.GetMobileDevice(id); - LogEnd("GetMobileDevice"); - return ret; - } - catch (Exception ex) - { - LogError("GetMobileDevice", ex); - throw; - } - } - - [WebMethod, SoapHeader("settings")] - public void WipeDataFromDevice(string id) - { - try - { - LogStart("WipeDataFromDevice"); - ES.WipeDataFromDevice(id); - LogEnd("WipeDataFromDevice"); - } - catch (Exception ex) - { - LogError("WipeDataFromDevice", ex); - throw; - } - } + [WebMethod, SoapHeader("settings")] + public ExchangeMobileDevice GetMobileDevice(string id) + { + try + { + LogStart("GetMobileDevice"); + ExchangeMobileDevice ret = ES.GetMobileDevice(id); + LogEnd("GetMobileDevice"); + return ret; + } + catch (Exception ex) + { + LogError("GetMobileDevice", ex); + throw; + } + } - [WebMethod, SoapHeader("settings")] - public void CancelRemoteWipeRequest(string id) - { - try - { - LogStart("CancelRemoteWipeRequest"); - ES.CancelRemoteWipeRequest(id); - LogEnd("CancelRemoteWipeRequest"); - } - catch (Exception ex) - { - LogError("CancelRemoteWipeRequest", ex); - throw; - } - } + [WebMethod, SoapHeader("settings")] + public void WipeDataFromDevice(string id) + { + try + { + LogStart("WipeDataFromDevice"); + ES.WipeDataFromDevice(id); + LogEnd("WipeDataFromDevice"); + } + catch (Exception ex) + { + LogError("WipeDataFromDevice", ex); + throw; + } + } + + [WebMethod, SoapHeader("settings")] + public void CancelRemoteWipeRequest(string id) + { + try + { + LogStart("CancelRemoteWipeRequest"); + ES.CancelRemoteWipeRequest(id); + LogEnd("CancelRemoteWipeRequest"); + } + catch (Exception ex) + { + LogError("CancelRemoteWipeRequest", ex); + throw; + } + } - [WebMethod, SoapHeader("settings")] - public void RemoveDevice(string id) - { - try - { - LogStart("RemoveDevice"); - ES.RemoveDevice(id); - LogEnd("RemoveDevice"); - } - catch (Exception ex) - { - LogError("RemoveDevice", ex); - throw; - } - } - #endregion + [WebMethod, SoapHeader("settings")] + public void RemoveDevice(string id) + { + try + { + LogStart("RemoveDevice"); + ES.RemoveDevice(id); + LogEnd("RemoveDevice"); + } + catch (Exception ex) + { + LogError("RemoveDevice", ex); + throw; + } + } + #endregion protected void LogStart(string func) { diff --git a/WebsitePanel/Sources/WebsitePanel.Server/Organizations.asmx.cs b/WebsitePanel/Sources/WebsitePanel.Server/Organizations.asmx.cs index f057ec76..775058d8 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/Organizations.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server/Organizations.asmx.cs @@ -67,14 +67,14 @@ namespace WebsitePanel.Server throw; } } - - + + [WebMethod, SoapHeader("settings")] public Organization CreateOrganization(string organizationId) { try { - Log.WriteStart("'{0}' CreateOrganization", ProviderSettings.ProviderName); + Log.WriteStart("'{0}' CreateOrganization", ProviderSettings.ProviderName); Organization ret = Organization.CreateOrganization(organizationId); Log.WriteEnd("'{0}' CreateOrganization", ProviderSettings.ProviderName); return ret; @@ -85,21 +85,17 @@ namespace WebsitePanel.Server throw; } } - + [WebMethod, SoapHeader("settings")] public void DeleteOrganization(string organizationId) { - Organization.DeleteOrganization(organizationId); + Organization.DeleteOrganization(organizationId); } [WebMethod, SoapHeader("settings")] - public void CreateUser(string organizationId, string loginName, string displayName, string upn, string password, bool enabled) + public int CreateUser(string organizationId, string loginName, string displayName, string upn, string password, bool enabled) { - Log.WriteStart("'{0} CreateUser", ProviderSettings.ProviderName); - - Organization.CreateUser(organizationId, loginName, displayName, upn, password, enabled); - - Log.WriteEnd("'{0}' CreateUser", ProviderSettings.ProviderName); + return Organization.CreateUser(organizationId, loginName, displayName, upn, password, enabled); } [WebMethod, SoapHeader("settings")] @@ -109,7 +105,7 @@ namespace WebsitePanel.Server } [WebMethod, SoapHeader("settings")] - public OrganizationUser GeUserGeneralSettings(string loginName, string organizationId) + public OrganizationUser GetUserGeneralSettings(string loginName, string organizationId) { return Organization.GetUserGeneralSettings(loginName, organizationId); } @@ -132,9 +128,9 @@ namespace WebsitePanel.Server [WebMethod, SoapHeader("settings")] public void DeleteOrganizationDomain(string organizationDistinguishedName, string domain) { - Organization.DeleteOrganizationDomain(organizationDistinguishedName, domain); + Organization.DeleteOrganizationDomain(organizationDistinguishedName, domain); } - + [WebMethod, SoapHeader("settings")] public void CreateOrganizationDomain(string organizationDistinguishedName, string domain) { @@ -147,5 +143,10 @@ namespace WebsitePanel.Server return Organization.GetPasswordPolicy(); } + [WebMethod, SoapHeader("settings")] + public string GetSamAccountNameByUserPrincipalName(string organizationId, string userPrincipalName) + { + return Organization.GetSamAccountNameByUserPrincipalName(organizationId, userPrincipalName); + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/SiteSettings.config b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/SiteSettings.config index 0a99be01..e40147a6 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/SiteSettings.config +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/SiteSettings.config @@ -3,7 +3,7 @@ WebsitePanel - http://localhost:9002 + http://localhost:9005 UserCulture UserTheme diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config index c979a2a4..76798152 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config @@ -486,7 +486,10 @@ - + + + + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx index 2bf42484..c04ed97a 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx @@ -2806,7 +2806,7 @@ Contacts per Organization - Max mailbox size, MB + Mailbox storage, MB Distribution Lists per Organization @@ -2850,6 +2850,18 @@ Public Folders per Organization + + Keep Deleted Items (Days) + + + Maximum Recipients + + + Maximum Send Message Size (Kb) + + + Maximum Receive Message Size (Kb) + Hosted Exchange @@ -4990,4 +5002,7 @@ Use shared SSL Root + + Consumer Organization Support + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/Exchange/blank16.gif b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/Exchange/blank16.gif new file mode 100644 index 00000000..ca92d53f Binary files /dev/null and b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/Exchange/blank16.gif differ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/Exchange/disabled.png b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/Exchange/disabled.png new file mode 100644 index 00000000..2fa793d1 Binary files /dev/null and b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/Exchange/disabled.png differ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/Exchange/enabled.png b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/Exchange/enabled.png new file mode 100644 index 00000000..6cb2c138 Binary files /dev/null and b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Themes/Default/Images/Exchange/enabled.png differ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/UserCreateSpace.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/UserCreateSpace.ascx.resx index 5f25f68b..f89f6cc5 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/UserCreateSpace.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/UserCreateSpace.ascx.resx @@ -112,10 +112,10 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Cancel @@ -219,4 +219,7 @@ Please select hosting plan + + Automated Hosted Organization Provisioning + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeActiveSyncSettings.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeActiveSyncSettings.ascx.resx index 28496e91..7a93b328 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeActiveSyncSettings.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeActiveSyncSettings.ascx.resx @@ -112,10 +112,10 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ShowProgressDialog('Updating ActiveSync settings...'); @@ -151,7 +151,7 @@ Windows SharePoint Services - <p>Exchange Server 2007 enables users who have mobile devices to synchronize mailbox data by using Exchange ActiveSync. Users can synchronize e-mail, contacts, calendars, and task folders. </p><p> + <p>Exchange Server enables users who have mobile devices to synchronize mailbox data by using Exchange ActiveSync. Users can synchronize e-mail, contacts, calendars, and task folders. </p><p> ActiveSync mailbox policy allows you to apply a common set of security settings to all users in organization. </p> diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeAddDomainName.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeAddDomainName.ascx.resx index fcbdac5d..1b687b23 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeAddDomainName.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeAddDomainName.ascx.resx @@ -112,13 +112,16 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Cancel + - Enter domain name, e.g. "mydomain.com" or "sub.mydomain.com" + Select a domain name, e.g. "mydomain.com" or "sub.mydomain.com" Add Domain Name diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxAdvancedSettings.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeAddMailboxPlan.ascx.resx similarity index 78% rename from WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxAdvancedSettings.ascx.resx rename to WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeAddMailboxPlan.ascx.resx index ebca9e9b..4549ab13 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxAdvancedSettings.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeAddMailboxPlan.ascx.resx @@ -112,20 +112,17 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - ShowProgressDialog('Updating mailbox settings...'); - - - Save Changes - ActiveSync + + Hide from Addressbook + IMAP @@ -135,20 +132,11 @@ OWA/HTTP - - Allow these settings to be managed from <b>Personal Mailbox Manager</b> - POP3 - - Use organization defaults - - - Use organization defaults - - <p>In "Mailbox Features" section you may enable/disable specific access protocols for the mailbox.</p><p>You may override mailbox quotas and retention period defined on the organization level. Please note, that you cannot specify storage settings higher than defined in the space hosting plan.</p><p><b>Domain User Name</b> is used when setting up mailbox in Outlook 2003/2007.</p> + <p> A Mailbox plan is a template that defines the characteristics of a mailbox </p> <p>The mailbox plan name needs to be unique. A mailbox plan cannot be modified. In case a mailbox needs a mailbox plan with another characteristics, a new mailbox plan needs to be created and assigned to the mailbox. A mailbox plan can only be deleted when the plan is not assigned to any mailboxes. </p> days @@ -162,11 +150,17 @@ Keep deleted items for: - - Last Logoff: + + Mailbox size: - - Last Logon: + + Maximum Receive Message Size: + + + Maximum Recipients: + + + Maximum Send Message Size: Prohibit send at: @@ -175,13 +169,7 @@ Prohibit send and receive at: - Edit Mailbox - - - Total Items: - - - Total Size (MB): + Add Mailbox plan When the mailbox size exceeds the indicated amount: @@ -189,19 +177,25 @@ Delete Item Retention - - Domain User Name - Mailbox Features - - Mailbox Statistics + + General + + + Mailbox plan - Mailbox Quotas + Quotas - Mailboxes + Mailbox plan + + + Please enter correct mailboxplan + + + * \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeContactGeneralSettings.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeContactGeneralSettings.ascx.resx index a775ec0b..68b60ab8 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeContactGeneralSettings.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeContactGeneralSettings.ascx.resx @@ -112,10 +112,10 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ShowProgressDialog('Updating contact settings...'); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeContactMailFlowSettings.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeContactMailFlowSettings.ascx.resx index 8bd04c62..9ea225b7 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeContactMailFlowSettings.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeContactMailFlowSettings.ascx.resx @@ -112,10 +112,10 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ShowProgressDialog('Updating contact settings...'); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeContacts.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeContacts.ascx.resx index 2b5d6c02..20eeb913 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeContacts.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeContacts.ascx.resx @@ -112,10 +112,10 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Create New Contact diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeCreateContact.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeCreateContact.ascx.resx index 51270a74..2048b51e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeCreateContact.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeCreateContact.ascx.resx @@ -112,10 +112,10 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ShowProgressDialog('Creating contact...'); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeCreateDistributionList.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeCreateDistributionList.ascx.resx index e1165b0f..c089926b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeCreateDistributionList.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeCreateDistributionList.ascx.resx @@ -112,10 +112,10 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ShowProgressDialog('Creating distribution list...'); @@ -124,7 +124,7 @@ Create Distribution List - <p><b>Display Name</b> will be shown in the GAL in Outlook and OWA.</p><p>You can add new Domain Names on "Domain Names" page. We always provide you with a free domain that would allow your organization migrating to Exchange as soon as possible.</p><p><b>Primary E-Mail Address</b> is shown in the GAL and in "From" field of all messages sent from this DL.</p> + <p><b>Display Name</b> will be shown in the GAL in Outlook and OWA.</p><p>You can add new Domain Names on "Domain Names" page. </p><p><b>Primary E-Mail Address</b> is shown in the GAL and in "From" field of all messages sent from this DL.</p> E-mail Address: * @@ -132,22 +132,22 @@ Display Name: * + + Managed by: * + Create New Distribution List Distribution Lists + + Please specify a manager + Enter Display Name * - - Managed by: * - - - Please specify a manager - \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeCreateMailbox.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeCreateMailbox.ascx.resx index f921332b..edd62354 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeCreateMailbox.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeCreateMailbox.ascx.resx @@ -112,10 +112,10 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ShowProgressDialog('Creating mailbox...'); @@ -134,7 +134,7 @@ <p><b>E-Mail Address</b> is a User Principal Name (UPN). It is used as a logon name in Outlook, Outlook Web Access (OWA) or SharePoint.</p> -<p>New organization domains can be added on "Domain Names" page. Temporary domain name is provided by default to allow creating new accounts as soon as possible.</p> +<p>New organization domains can be added on "Domain Names" page.</p> <p>Make sure your password is strong enough, i.e. contains lower and capital letters, numbers and symbols. @@ -156,6 +156,9 @@ Password: * + + Subscriber Number: * + Create New Mailbox @@ -183,4 +186,10 @@ * + + Enter Subscriber Number + + + * + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeDistributionListEmailAddresses.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeDistributionListEmailAddresses.ascx.resx index f01bbe92..56dab2cf 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeDistributionListEmailAddresses.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeDistributionListEmailAddresses.ascx.resx @@ -112,10 +112,10 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Add E-mail Address @@ -127,7 +127,7 @@ Set As Primary - <b>Primary E-Mail Address</b> is a User Principal Name (UPN). It will be used as a login in Outlook 2003/2007 and Outlook Web Access (OWA). Also, Primary E-Mail Address will be shown in "From" field of messages sent from this mailbox.</p><p>You can add new Domain Names on "Domain Names" page. We always provide you with a free domain that would allow your organization migrating to Exchange as soon as possible.</p><p>E-mail addresses of all Exchange accounts should be unique across the organization. You cannot add the same e-mail address to several accounts.</p> + <b>Primary E-Mail Address</b> is a User Principal Name (UPN). It will be used as a login in Outlook and Outlook Web Access (OWA). Also, Primary E-Mail Address will be shown in "From" field of messages sent from this mailbox.</p><p>You can add new Domain Names on "Domain Names" page.</p><p>E-mail addresses of all Exchange accounts should be unique across the organization. You cannot add the same e-mail address to several accounts.</p> E-mail Address diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeDistributionListGeneralSettings.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeDistributionListGeneralSettings.ascx.resx index b8b475b0..56de9930 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeDistributionListGeneralSettings.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeDistributionListGeneralSettings.ascx.resx @@ -112,10 +112,10 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ShowProgressDialog('Updating distribution list settings...'); @@ -144,13 +144,13 @@ Distribution Lists + + Please specify a manager + Enter Display Name * - - Please specify a manager - \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeDistributionListMailFlowSettings.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeDistributionListMailFlowSettings.ascx.resx index c2911ebf..3df43c86 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeDistributionListMailFlowSettings.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeDistributionListMailFlowSettings.ascx.resx @@ -112,10 +112,10 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ShowProgressDialog('Updating distribution list settings...'); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeDistributionLists.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeDistributionLists.ascx.resx index 85d2a8eb..b5f5a8ad 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeDistributionLists.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeDistributionLists.ascx.resx @@ -112,10 +112,10 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Create New Distribution List diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeDomainNames.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeDomainNames.ascx.resx index a8fea59b..d8f453a2 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeDomainNames.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeDomainNames.ascx.resx @@ -112,10 +112,10 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Add New Domain @@ -142,11 +142,9 @@ Domain Name - <p>Each organization can have several domain names. These domain names are used as part of the primary e-mail address (UPN) of the new accounts. Exchange-enabled organizations use domain name when creating e-mail addresses for mailboxes, distribution lists and mail-enabled public folders. Domain name is also used when creating new site collection in SharePoint.</p> - + <p>Each organization can have several domain names. These domain names are used as part of the primary e-mail address (UPN) of the new accounts. Exchange-enabled organizations use domain name when creating e-mail addresses for mailboxes, and distribution lists. Domain name is also used when creating new site collection in SharePoint.</p> <p>Default domain name is selected by default when creating a new e-mail address. You can always change default domain name and it will not affect existing accounts.</p> - -<p>For each domain name WebsitePanel creates a corresponding DNS Zone. You can edit DNS zone records by clicking domain name link. If you are unsure about the structure of DNS zone, please do not modify zone records.</p> +<p>For each domain name a corresponding DNS Zone is created. You can edit DNS zone records by clicking domain name link. If you are unsure about the structure of DNS zone, please do not modify zone records.</p> Total Domain Names Used: diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeDomainRecords.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeDomainRecords.ascx.resx index 556b31c4..3096f457 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeDomainRecords.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeDomainRecords.ascx.resx @@ -112,10 +112,10 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Add record @@ -130,7 +130,7 @@ Save - <p>For each domain name WebsitePanel creates a corresponding DNS Zone. If you are unsure about the structure of DNS zone, please do not modify zone records.</p> + <p>For each domain name a corresponding DNS Zone is created. If you are unsure about the structure of DNS zone, please do not modify zone records.</p> No DNS records defined. diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxEmailAddresses.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxEmailAddresses.ascx.resx index 137621eb..31627731 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxEmailAddresses.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxEmailAddresses.ascx.resx @@ -112,10 +112,10 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Add E-mail Address @@ -130,7 +130,7 @@ Allow these settings to be managed from <b>Personal Mailbox Manager</b> - <b>Primary E-Mail Address</b> is a User Principal Name (UPN). It will be used as a login in Outlook 2003/2007 and Outlook Web Access (OWA). Also, Primary E-Mail Address will be shown in "From" field of messages sent from this mailbox.</p><p>You can add new Domain Names on "Domain Names" page. We always provide you with a free domain that would allow your organization migrating to Exchange as soon as possible.</p><p>E-mail addresses of all Exchange accounts should be unique across the organization. You cannot add the same e-mail address to several accounts.</p> + <b>Primary E-Mail Address</b> is a User Principal Name (UPN). It will be used as a login in Outlook and Outlook Web Access (OWA). Also, Primary E-Mail Address will be shown in "From" field of messages sent from this mailbox.</p><p>You can add new Domain Names on "Domain Names" page. </p><p>E-mail addresses of all Exchange accounts should be unique across the organization. You cannot add the same e-mail address to several accounts.</p> E-mail Address diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxGeneralSettings.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxGeneralSettings.ascx.resx index 93dbf852..952e1037 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxGeneralSettings.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxGeneralSettings.ascx.resx @@ -112,10 +112,10 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ShowProgressDialog('Updating mailbox settings...'); @@ -133,85 +133,22 @@ Allow these settings to be managed from <b>Personal Mailbox Manager</b> - <p>The General tab displays general information about the mailbox user. Use this tab to view or modify the display name, password, company information, contact information and address. You can also specify whether to disable the mailbox user or hide the mailbox user from Exchange address lists.</p> + <p>The General tab displays general information about the mailbox Use this tab to view or modify the mailbox characteristics such as size and show in your address book in the Exchange address lists. You can also specify whether to disable the mailbox user.</p> - - Address: + + Mailbox plan: - - Business Phone: - - - City: - - - Company: - - - Country/Region: - - - Department: - - - Display Name: * - - - Fax: - - - First Name: - - - Home Phone: - - - Initials: - - - Job Title: - - - Last Name: - - - Manager: - - - Mobile Phone: - - - Notes: - - - Office: - - - Pager: - - - Password: - - - State/Province: + + Mailbox size: Edit Mailbox - - Web Page: + + Calendar Settings - - Zip/Postal Code: - - - Address - - - Company Information - - - Contact Information + + General Mailboxes diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxMailFlowSettings.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxMailFlowSettings.ascx.resx index 962a69de..3dfe91c1 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxMailFlowSettings.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxMailFlowSettings.ascx.resx @@ -112,10 +112,10 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ShowProgressDialog('Updating mailbox settings...'); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxMobile.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxMobile.ascx.resx index 31f224e8..7b809afa 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxMobile.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxMobile.ascx.resx @@ -112,13 +112,13 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - User Agent + + return confirm('Are you sure you want to remove the device partnership?'); Status @@ -126,34 +126,34 @@ Type + + User Agent + There are no mobile devices. + + <p>Manage mobile devices here.</p><p>To add a new device, begin a partnership with Microsoft Exchange from the device and it will appear in the device list.</p><p>You can remove devices that you are no longer using. If you forget your device password, you can access it here. If you lose your phone or mobile device, you can initiate a remote device wipe to protect your information.</p> + Last Sync Time + + Edit Mailbox + OK Pending Wipe + + Edit Mailbox + Unknown Wipe Successful - - return confirm('Are you sure you want to remove the device partnership?'); - - - Edit Mailbox - - - Edit Mailbox - - - <p>Manage mobile devices here.</p><p>To add a new device, begin a partnership with Microsoft Exchange from the device and it will appear in the device list.</p><p>You can remove devices that you are no longer using. If you forget your device password, you can access it here. If you lose your phone or mobile device, you can initiate a remote device wipe to protect your information.</p> - \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxMobileDetails.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxMobileDetails.ascx.resx index d2aa6bc9..56efeeba 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxMobileDetails.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxMobileDetails.ascx.resx @@ -112,11 +112,26 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + Back + + + Cancel Pending Wipe Request + + + return confirm('Are you sure you want to wipe all data from your device?'); + + + Wipe All Data from Device + + + <p>Manage the mobile device here.</p><p>If you forget your device password, you can access it here. If you lose your phone or mobile device, you can initiate a remote device wipe to protect your information . You can also cancel a wipe request if it was initiated by accident or the device was found subsequently.</p> + Device wipe acnowledge time: @@ -165,37 +180,22 @@ Status: + + Edit Mailbox + OK Pending wipe + + Edit Mailbox + Unknown Wipe successful - - Back - - - Cancel Pending Wipe Request - - - Wipe All Data from Device - - - Edit Mailbox - - - Edit Mailbox - - - <p>Manage the mobile device here.</p><p>If you forget your device password, you can access it here. If you lose your phone or mobile device, you can initiate a remote device wipe to protect your information . You can also cancel a wipe request if it was initiated by accident or the device was found subsequently.</p> - - - return confirm('Are you sure you want to wipe all data from your device?'); - \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxPermissions.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxPermissions.ascx.resx index ea2b0e5d..5e891cc2 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxPermissions.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxPermissions.ascx.resx @@ -112,17 +112,23 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ShowProgressDialog('Updating mailbox permissions...'); + + Save Changes + <p>When you grant <b>Full Access</b> permission to a user, that user can open this mailbox and access all of its content.</p> <br><p>When you grant <b>Send As</b> permission to a user, that user can send messages as this mailbox. </p> <br><p>We do not recommend to use this setting together “Send on behalf” (“Send as”) – it may work unpredictable</p> + + Grant this permission to: + Full Access @@ -132,10 +138,4 @@ Permissions - - Grant this permission to: - - - Save Changes - \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/App_LocalResources/Exchange2010SP1_Settings.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxPlans.ascx.resx similarity index 74% rename from WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/App_LocalResources/Exchange2010SP1_Settings.ascx.resx rename to WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxPlans.ascx.resx index 1dadcd94..68c5b189 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/App_LocalResources/Exchange2010SP1_Settings.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxPlans.ascx.resx @@ -112,36 +112,42 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Domain Templates + + Add New Mailbox plan - - Exchange Control Panel URL: + + Set Default Mailbox plan - - You can use [DOMAIN_NAME] variable for organization default domain. + + if(!confirm('Are you sure you want to delete selected mailbox plan?')) return false; else ShowProgressDialog('Deleting Mailbox plan...'); - - Offer ID: + + Delete - - Organization Template + + Delete Mailbox plan - - Program ID: + + Mailbox plan - - Temporary domain: + + Default Mailbox plan - - * + + No mailbox plans have been added yet. To add a new mailbox plan click "Add New Mailbox plan" button. - - * + + <p> A Mailbox plan is a template that defines the characteristics of a mailbox </p> <p>The mailbox plan name needs to be unique. A mailbox plan cannot be modified. In case a mailbox needs a mailbox plan with another characteristics, a new mailbox plan needs to be created and assigned to the mailbox. A mailbox plan can only be deleted when the plan is not assigned to any mailboxes. </p> + + + Mailbox plans + + + Mailbox plans \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxSetupInstructions.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxSetupInstructions.ascx.resx index ea0b1623..de0dd29b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxSetupInstructions.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxSetupInstructions.ascx.resx @@ -112,10 +112,10 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Send diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxes.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxes.ascx.resx index 9bcdbf5d..1aaeac3a 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxes.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxes.ascx.resx @@ -112,10 +112,10 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Create New Mailbox @@ -132,6 +132,9 @@ Search + + Domain Account + Display Name @@ -147,6 +150,12 @@ Primary E-mail Address + + Mailbox plan + + + Subscriber + <p><b>Mailboxes</b> are used to receive and send electronic messages. Each mailbox is a separate Exchange account which may be a person, room or inventory unit.</p> @@ -165,7 +174,4 @@ Mailboxes - - Domain Account - \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeStorageLimits.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeStorageLimits.ascx.resx deleted file mode 100644 index e127ca84..00000000 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeStorageLimits.ascx.resx +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - ShowProgressDialog('Updating storage settings...'); - - - Save Changes - - - if(!confirm('Please be aware that applying new storage settings to all mailboxes can take significant time to complete. Do you want to proceed?')) return false; else ShowProgressDialog('Applying storage settings to mailboxes...'); - - - Save and Apply to All Mailboxes - - - <p>You can change storage limits and deleted items retention policy.</p><p>The settings will be applied for for new mailboxes only. By clicking "Save and Apply to All Mailboxes" button you can override these settings for all existing mailboxes.</p><p>Please note, that you cannot specify storage settings higher than defined in the space hosting plan.</p> - - - Issue warning at: - - - Keep deleted items for: - - - Prohibit send at: - - - Prohibit send and receive at: - - - Storage Settings - - - When the mailbox size exceeds the indicated amount: - - - Deletion Settings - - - Storage Settings - - - Storage Settings - - \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeStorageUsage.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeStorageUsage.ascx.resx index a5ce0185..4046f8fd 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeStorageUsage.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeStorageUsage.ascx.resx @@ -112,10 +112,10 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 return confirm('Recalculating organization disk space may require certain time to complete and this task will be performed asynchronously. New disk space value will be available in a few minutes. Proceed with disk space calculation?'); @@ -123,8 +123,11 @@ Recalculate Disk Space + + ShowProgressDialog('Please wait...'); + - <p>Organization disk space usage is calculated on timely basis (usually once a day). You can recalculate it right now by clicking "Recalculate Disk Space" button.</p><p>Click on the link with used disk space to see usage breakdown by all organization mailboxes and public folders.</p> + <p>Organization disk space actual usage is calculated on timely basis (usually once a day). You can recalculate it right now by clicking "Recalculate Disk Space" button.</p><p>Click on the link with used disk space to see actual usage breakdown by all organization mailboxes.</p> Allocated Disk Space (MB): @@ -136,7 +139,7 @@ Storage Usage - Used Disk Space (MB): + Allocated Disk Space (MB): Storage Usage @@ -144,7 +147,4 @@ Unlimited - - ShowProgressDialog('Please wait...'); - \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeStorageUsageBreakdown.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeStorageUsageBreakdown.ascx.resx index bf09c997..4a2785d0 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeStorageUsageBreakdown.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeStorageUsageBreakdown.ascx.resx @@ -112,10 +112,10 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 OK diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationCreateOrganization.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationCreateOrganization.ascx.resx index 1357e558..4b45044c 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationCreateOrganization.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationCreateOrganization.ascx.resx @@ -112,10 +112,10 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ShowProgressDialog('Creating Organization...'); @@ -124,7 +124,7 @@ Create Organization - <p><b>Organization name</b> is used just as display name for references purposes. It will not be used somewhere on Exchange Server.</p> <p><b>Organization ID</b> is an unique organization identifier. It can contain only numbers and letters and cannot be longer than 9 symbols. Organization ID will be used as GAL name and as a root public folder.</p> + <p><b>Organization name</b> is used just as display name for references purposes. It will not be used somewhere on Exchange Server.</p> <p><b>Organization ID</b> is an unique organization identifier. Organization ID will be used as GAL name.</p> Organization ID: * diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationCreateUser.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationCreateUser.ascx.resx index 71721667..0d09f564 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationCreateUser.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationCreateUser.ascx.resx @@ -112,10 +112,10 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ShowProgressDialog('Creating user...'); @@ -131,7 +131,7 @@ <p><b>E-Mail Address</b> is a User Principal Name (UPN). It is used as a logon name in Outlook, Outlook Web Access (OWA) or SharePoint.</p> -<p>New organization domains can be added on "Domain Names" page. Temporary domain name is provided by default to allow creating new users as soon as possible.</p> +<p>New organization domains can be added on "Domain Names" page.</p> <p>Make sure your password is strong enough, i.e. contains lower and capital letters, numbers and symbols.</p> @@ -144,6 +144,9 @@ Password: * + + Subscriber Number: * + Create New User @@ -156,4 +159,10 @@ * + + Enter Subscriber Number + + + * + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationHome.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationHome.ascx.resx index 23cd8d32..9c8ad7bf 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationHome.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationHome.ascx.resx @@ -112,57 +112,16 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 <p>Welcome to the organization home page!</p> - <p>Using the left menu you can manage organization domain names and users.</p> - <p>Organization statistics displays current status of the organization.</p> - - Allocated Diskspace (MB) - - - Contacts: - - - Domain Names: - - - Public Folders: - - - Distribution Lists: - - - Mailboxes: - - - Site Collections: - - - Used Diskspace (MB) - - - Users: - - - Organization Statistics - - - Home - - - Home - - - Unlimited - Created: @@ -172,22 +131,82 @@ Organization Name: - - CRM Users: - Total Used Disk Space, MB: Used Disk Space, MB: + + Allocated Diskspace (MB) + + + BlackBerry Users: + + + Contacts: + + + CRM Users: + + + Domain Names: + + + Storage (Mb): + + + Public Folders: + + + Distribution Lists: + + + Users: + + + Mailboxes: + + + OCS Users: + + + Site Collections: + + + Used Diskspace (MB) + + + Users: + + + BlackBerry + CRM Exchange + + Organization + + + Lync + + + OCS + SharePoint + + Home + + + Home + + + Unlimited + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUserGeneralSettings.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUserGeneralSettings.ascx.resx index 9f22134d..a1a54a1d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUserGeneralSettings.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUserGeneralSettings.ascx.resx @@ -112,10 +112,10 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ShowProgressDialog('Updating user settings...'); @@ -126,11 +126,15 @@ Disable User + + Account is locked out + + + Set Password + <p><b>Display Name</b> is a “friendly” name used by other programs, such as Microsoft Exchange or SharePoint.</p> - <p>Make sure your password is strong enough, i.e. contains lower and capital letters, numbers and symbols.</p> - <p>You can specify manager account to build organizational structure of your company.</p> @@ -154,6 +158,9 @@ Display Name: * + + External e-mail: + Fax: @@ -193,6 +200,9 @@ State/Province: + + Subscriber Number: + Edit User @@ -226,10 +236,4 @@ * - - External e-mail: - - - Account is locked out - \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUserSetupInstructions.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUserSetupInstructions.ascx.resx index 720d3d30..d59541dc 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUserSetupInstructions.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUserSetupInstructions.ascx.resx @@ -112,10 +112,10 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Send diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUsers.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUsers.ascx.resx index 9a097cd4..65ed352a 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUsers.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationUsers.ascx.resx @@ -112,10 +112,10 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Create New User @@ -132,12 +132,21 @@ Search + + Domain Account + Display Name E-mail Address + + Subscriber Number + + + Subscriber + No users have been created. To create a new user click "Create New Users" button. @@ -149,14 +158,11 @@ <p>Active Directory user accounts are used to:</p> - <p>• Authenticate the identity of a user.<br> • Authorize or deny access to domain resources.<br> • Administer other security principals.<br> • Audit actions performed using the user account.</p> - <p>Primary E-Mail Address is a User Principal Name (UPN). It is used as a logon name in Outlook, Outlook Web Access (OWA) or SharePoint.</p> - <p>User account can also represent Exchange mailbox, which may be a person, room or inventory unit.</p> @@ -168,7 +174,4 @@ Users - - Domain Account - \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/Organizations.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/Organizations.ascx.resx index db039cae..f87c9b7d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/Organizations.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/Organizations.ascx.resx @@ -112,10 +112,10 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Create New Organization @@ -158,10 +158,8 @@ <p><b>Organization</b> is a group of Active Directory users, contacts and groups.<br><br> - All accounts within one organization are located in the same Organizational Unit and are not visible to members of other organizations.<br><br> - -Exchange-enabled organization has its own Global Address List (GAL) and Offline Address Book (OAB). Mailboxes, contacts, distribution lists and public folders of Exchange-enabled organization share the same GAL and OAB</p> +Exchange-enabled organization has its own Global Address List (GAL) and Offline Address Book (OAB). Mailboxes, contacts, and distribution lists of Exchange-enabled organization share the same GAL and OAB</p> Total Organizations Created: diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeActiveSyncSettings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeActiveSyncSettings.ascx index b8146635..2a208153 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeActiveSyncSettings.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeActiveSyncSettings.ascx @@ -59,7 +59,7 @@ - + @@ -137,7 +137,7 @@ - + @@ -146,7 +146,7 @@ meta:resourcekey="locMinimumPasswordLength" Text="Minimum password length:"> + DisplayUnits="false" EmptyValue="0" DisplayUnitsKB="false" DisplayUnitsMB="false" DisplayUnitsPct="false"/> @@ -154,7 +154,7 @@ - + @@ -164,7 +164,7 @@ - + @@ -174,7 +174,7 @@ - + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeActiveSyncSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeActiveSyncSettings.ascx.cs index cd2eb6c5..97c58b86 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeActiveSyncSettings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeActiveSyncSettings.ascx.cs @@ -28,6 +28,7 @@ using System; using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.EnterpriseServer; namespace WebsitePanel.Portal.ExchangeServer { @@ -39,6 +40,9 @@ namespace WebsitePanel.Portal.ExchangeServer { BindPolicy(); } + + + } protected void btnSave_Click(object sender, EventArgs e) @@ -55,7 +59,7 @@ namespace WebsitePanel.Portal.ExchangeServer // bind data chkAllowNonProvisionable.Checked = policy.AllowNonProvisionableDevices; - + chkAllowAttachments.Checked = policy.AttachmentsEnabled; sizeMaxAttachmentSize.ValueKB = policy.MaxAttachmentSizeKB; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeActiveSyncSettings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeActiveSyncSettings.ascx.designer.cs index 6e6cf679..3f3f65cd 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeActiveSyncSettings.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeActiveSyncSettings.ascx.designer.cs @@ -1,22 +1,15 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.832 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace WebsitePanel.Portal.ExchangeServer { - /// - /// ExchangeActiveSyncSettings class. - /// - /// - /// Auto-generated class. - /// public partial class ExchangeActiveSyncSettings { /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddDomainName.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddDomainName.ascx index 364ba693..39484d06 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddDomainName.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddDomainName.ascx @@ -26,12 +26,7 @@ - - - * + @@ -39,6 +34,7 @@
+
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddDomainName.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddDomainName.ascx.cs index 29c5a9a5..a6d9c55c 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddDomainName.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddDomainName.ascx.cs @@ -27,21 +27,55 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using System; +using WebsitePanel.EnterpriseServer; +using WebsitePanel.Providers.HostedSolution; namespace WebsitePanel.Portal.ExchangeServer { - public partial class ExchangeAddDomainName : WebsitePanelModuleBase - { - protected void Page_Load(object sender, EventArgs e) - { + public partial class ExchangeAddDomainName : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + DomainInfo[] domains = ES.Services.Servers.GetMyDomains(PanelSecurity.PackageId); - } + OrganizationDomainName[] list = ES.Services.Organizations.GetOrganizationDomains(PanelRequest.ItemID); + + foreach (DomainInfo d in domains) + { + if (!d.IsDomainPointer & !d.IsInstantAlias) + { + bool bAdd = true; + foreach (OrganizationDomainName acceptedDomain in list) + { + if (d.DomainName.ToLower() == acceptedDomain.DomainName.ToLower()) + { + bAdd = false; + break; + } + + } + if (bAdd) ddlDomains.Items.Add(d.DomainName.ToLower()); + } + } + + if (ddlDomains.Items.Count == 0) btnAdd.Enabled = false; + + + + } protected void btnAdd_Click(object sender, EventArgs e) { AddDomain(); } + protected void btnCancel_Click(object sender, EventArgs e) + { + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "domains", "SpaceID=" + PanelSecurity.PackageId)); + + } + + private void AddDomain() { if (!Page.IsValid) @@ -51,7 +85,7 @@ namespace WebsitePanel.Portal.ExchangeServer { int result = ES.Services.Organizations.AddOrganizationDomain(PanelRequest.ItemID, - txtDomainName.Text.Trim()); + ddlDomains.SelectedValue.Trim()); if (result < 0) { @@ -67,5 +101,5 @@ namespace WebsitePanel.Portal.ExchangeServer messageBox.ShowErrorMessage("EXCHANGE_ADD_DOMAIN", ex); } } - } + } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddDomainName.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddDomainName.ascx.designer.cs index b0444dc0..911a13b7 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddDomainName.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddDomainName.ascx.designer.cs @@ -76,31 +76,13 @@ namespace WebsitePanel.Portal.ExchangeServer { protected global::System.Web.UI.WebControls.Localize locDomainName; /// - /// txtDomainName control. + /// ddlDomains control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.TextBox txtDomainName; - - /// - /// valRequireDomainName control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireDomainName; - - /// - /// valRequireCorrectDomain control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.RegularExpressionValidator valRequireCorrectDomain; + protected global::System.Web.UI.WebControls.DropDownList ddlDomains; /// /// btnAdd control. @@ -120,6 +102,15 @@ namespace WebsitePanel.Portal.ExchangeServer { /// protected global::System.Web.UI.WebControls.ValidationSummary ValidationSummary1; + /// + /// btnCancel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCancel; + /// /// FormComments control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxAdvancedSettings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddMailboxPlan.ascx similarity index 54% rename from WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxAdvancedSettings.ascx rename to WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddMailboxPlan.ascx index a2fb4232..7ca424b7 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxAdvancedSettings.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddMailboxPlan.ascx @@ -1,11 +1,10 @@ -<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ExchangeMailboxAdvancedSettings.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.ExchangeMailboxAdvancedSettings" %> +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ExchangeAddMailboxPlan.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.ExchangeAddMailboxPlan" %> <%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> -<%@ Register Src="UserControls/MailboxTabs.ascx" TagName="MailboxTabs" TagPrefix="wsp" %> <%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> <%@ Register Src="UserControls/SizeBox.ascx" TagName="SizeBox" TagPrefix="wsp" %> <%@ Register Src="UserControls/DaysBox.ascx" TagName="DaysBox" TagPrefix="wsp" %> -<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> -<%@ Register TagPrefix="wsp" TagName="CollapsiblePanel" Src="../UserControls/CollapsiblePanel.ascx" %> +<%@ Register Src="../UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" TagPrefix="wsp" %> <%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> @@ -16,19 +15,35 @@
- +
- - - - - -
+ + +
- - + + + + + + + + + + +
+ + + + +
+
+
@@ -63,66 +78,70 @@
- - - + + - - - - + +
+ - - - - - - - - - - - - - +
- 177 +
- 16 -
- -
- -

- - + + + + + + + + + + + + + + + + + +
+ +
+ +
+ +
+ +
- +
- +
- +
@@ -138,44 +157,17 @@ - +
- - - - - - - - - - -
- - - -
-
-
- - - - - -
- -
- + +
- - + +
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddMailboxPlan.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddMailboxPlan.ascx.cs new file mode 100644 index 00000000..2237914d --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddMailboxPlan.ascx.cs @@ -0,0 +1,192 @@ +// 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.ExchangeServer +{ + public partial class ExchangeAddMailboxPlan : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + + if (!IsPostBack) + { + if (PanelRequest.GetInt("MailboxPlanId") != 0) + { + Providers.HostedSolution.ExchangeMailboxPlan plan = ES.Services.ExchangeServer.GetExchangeMailboxPlan(PanelRequest.ItemID, PanelRequest.GetInt("MailboxPlanId")); + txtMailboxPlan.Text = plan.MailboxPlan; + mailboxSize.ValueKB = plan.MailboxSizeMB; + maxRecipients.ValueKB = plan.MaxRecipients; + maxSendMessageSizeKB.ValueKB = plan.MaxSendMessageSizeKB; + maxReceiveMessageSizeKB.ValueKB = plan.MaxReceiveMessageSizeKB; + chkPOP3.Checked = plan.EnablePOP; + chkIMAP.Checked = plan.EnableIMAP; + chkOWA.Checked = plan.EnableOWA; + chkMAPI.Checked = plan.EnableMAPI; + chkActiveSync.Checked = plan.EnableActiveSync; + sizeIssueWarning.ValueKB = plan.IssueWarningPct; + sizeProhibitSend.ValueKB = plan.ProhibitSendPct; + sizeProhibitSendReceive.ValueKB = plan.ProhibitSendReceivePct; + daysKeepDeletedItems.ValueDays = plan.KeepDeletedItemsDays; + chkHideFromAddressBook.Checked = plan.HideFromAddressBook; + + /* + txtMailboxPlan.Enabled = false; + mailboxSize.Enabled = false; + maxRecipients.Enabled = false; + maxSendMessageSizeKB.Enabled = false; + maxReceiveMessageSizeKB.Enabled = false; + chkPOP3.Enabled = false; + chkIMAP.Enabled = false; + chkOWA.Enabled = false; + chkMAPI.Enabled = false; + chkActiveSync.Enabled = false; + sizeIssueWarning.Enabled = false; + sizeProhibitSend.Enabled = false; + sizeProhibitSendReceive.Enabled = false; + daysKeepDeletedItems.Enabled = false; + chkHideFromAddressBook.Enabled = false; + + btnAdd.Enabled = false; + */ + + locTitle.Text = plan.MailboxPlan; + this.DisableControls = true; + + } + else + { + PackageContext cntx = ES.Services.Packages.GetPackageContext(PanelSecurity.PackageId); + if (cntx != null) + { + foreach (QuotaValueInfo quota in cntx.QuotasArray) + { + switch (quota.QuotaId) + { + case 365: + maxRecipients.ValueKB = quota.QuotaAllocatedValue; + break; + case 366: + maxSendMessageSizeKB.ValueKB = quota.QuotaAllocatedValue; + break; + case 367: + maxReceiveMessageSizeKB.ValueKB = quota.QuotaAllocatedValue; + break; + case 83: + chkPOP3.Checked = Convert.ToBoolean(quota.QuotaAllocatedValue); + chkPOP3.Enabled = Convert.ToBoolean(quota.QuotaAllocatedValue); + break; + case 84: + chkIMAP.Checked = Convert.ToBoolean(quota.QuotaAllocatedValue); + chkIMAP.Enabled = Convert.ToBoolean(quota.QuotaAllocatedValue); + break; + case 85: + chkOWA.Checked = Convert.ToBoolean(quota.QuotaAllocatedValue); + chkOWA.Enabled = Convert.ToBoolean(quota.QuotaAllocatedValue); + break; + case 86: + chkMAPI.Checked = Convert.ToBoolean(quota.QuotaAllocatedValue); + chkMAPI.Enabled = Convert.ToBoolean(quota.QuotaAllocatedValue); + break; + case 87: + chkActiveSync.Checked = Convert.ToBoolean(quota.QuotaAllocatedValue); + chkActiveSync.Enabled = Convert.ToBoolean(quota.QuotaAllocatedValue); + break; + case 364: + daysKeepDeletedItems.ValueDays = quota.QuotaAllocatedValue; + break; + } + + sizeIssueWarning.ValueKB = 100; + sizeProhibitSend.ValueKB = 100; + sizeProhibitSendReceive.ValueKB = 100; + } + } + else + this.DisableControls = true; + } + } + + } + + protected void btnAdd_Click(object sender, EventArgs e) + { + AddMailboxPlan(); + } + + private void AddMailboxPlan() + { + try + { + Providers.HostedSolution.ExchangeMailboxPlan plan = new Providers.HostedSolution.ExchangeMailboxPlan(); + plan.MailboxPlan = txtMailboxPlan.Text; + plan.MailboxSizeMB = mailboxSize.ValueKB; + if ((plan.MailboxSizeMB == 0)) plan.MailboxSizeMB = 1; + + plan.IsDefault = false; + plan.MaxRecipients = maxRecipients.ValueKB; + plan.MaxSendMessageSizeKB = maxSendMessageSizeKB.ValueKB; + plan.MaxReceiveMessageSizeKB = maxReceiveMessageSizeKB.ValueKB; + plan.EnablePOP = chkPOP3.Checked; + plan.EnableIMAP = chkIMAP.Checked; + plan.EnableOWA = chkOWA.Checked; + plan.EnableMAPI = chkMAPI.Checked; + plan.EnableActiveSync = chkActiveSync.Checked; + plan.IssueWarningPct = sizeIssueWarning.ValueKB; + if ((plan.IssueWarningPct == 0)) plan.IssueWarningPct = 100; + plan.ProhibitSendPct = sizeProhibitSend.ValueKB; + if ((plan.ProhibitSendPct == 0)) plan.ProhibitSendPct = 100; + plan.ProhibitSendReceivePct = sizeProhibitSendReceive.ValueKB; + if ((plan.ProhibitSendReceivePct == 0)) plan.ProhibitSendReceivePct = 100; + plan.KeepDeletedItemsDays = daysKeepDeletedItems.ValueDays; + plan.HideFromAddressBook = chkHideFromAddressBook.Checked; + + int result = ES.Services.ExchangeServer.AddExchangeMailboxPlan(PanelRequest.ItemID, + plan); + + + if (result < 0) + { + messageBox.ShowResultMessage(result); + return; + } + + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "mailboxplans", + "SpaceID=" + PanelSecurity.PackageId)); + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("EXCHANGE_ADD_MAILBOXPLAN", ex); + } + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxAdvancedSettings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddMailboxPlan.ascx.designer.cs similarity index 86% rename from WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxAdvancedSettings.ascx.designer.cs rename to WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddMailboxPlan.ascx.designer.cs index aad359ab..7a1b7b1d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxAdvancedSettings.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddMailboxPlan.ascx.designer.cs @@ -1,17 +1,16 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.1433 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace WebsitePanel.Portal.ExchangeServer { - public partial class ExchangeMailboxAdvancedSettings { + public partial class ExchangeAddMailboxPlan { /// /// asyncTasks control. @@ -58,24 +57,6 @@ namespace WebsitePanel.Portal.ExchangeServer { /// protected global::System.Web.UI.WebControls.Localize locTitle; - /// - /// litDisplayName control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Literal litDisplayName; - - /// - /// tabs control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::WebsitePanel.Portal.ExchangeServer.UserControls.MailboxTabs tabs; - /// /// messageBox control. /// @@ -85,6 +66,42 @@ namespace WebsitePanel.Portal.ExchangeServer { /// protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + /// + /// secMailboxPlan control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secMailboxPlan; + + /// + /// MailboxPlan control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel MailboxPlan; + + /// + /// txtMailboxPlan control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtMailboxPlan; + + /// + /// valRequireMailboxPlan control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireMailboxPlan; + /// /// secMailboxFeatures control. /// @@ -149,94 +166,31 @@ namespace WebsitePanel.Portal.ExchangeServer { protected global::System.Web.UI.WebControls.CheckBox chkActiveSync; /// - /// secStatistics control. + /// secMailboxGeneral control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::WebsitePanel.Portal.CollapsiblePanel secStatistics; + protected global::WebsitePanel.Portal.CollapsiblePanel secMailboxGeneral; /// - /// Statistics control. + /// MailboxGeneral control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.Panel Statistics; + protected global::System.Web.UI.WebControls.Panel MailboxGeneral; /// - /// locTotalItems control. + /// chkHideFromAddressBook control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.Localize locTotalItems; - - /// - /// lblTotalItems control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Label lblTotalItems; - - /// - /// locTotalSize control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize locTotalSize; - - /// - /// lblTotalSize control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Label lblTotalSize; - - /// - /// locLastLogon control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize locLastLogon; - - /// - /// lblLastLogon control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Label lblLastLogon; - - /// - /// locLastLogoff control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize locLastLogoff; - - /// - /// lblLastLogoff control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Label lblLastLogoff; + protected global::System.Web.UI.WebControls.CheckBox chkHideFromAddressBook; /// /// secStorageQuotas control. @@ -256,6 +210,78 @@ namespace WebsitePanel.Portal.ExchangeServer { /// protected global::System.Web.UI.WebControls.Panel StorageQuotas; + /// + /// locMailboxSize control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locMailboxSize; + + /// + /// mailboxSize control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.SizeBox mailboxSize; + + /// + /// locMaxRecipients control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locMaxRecipients; + + /// + /// maxRecipients control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.SizeBox maxRecipients; + + /// + /// locMaxSendMessageSizeKB control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locMaxSendMessageSizeKB; + + /// + /// maxSendMessageSizeKB control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.SizeBox maxSendMessageSizeKB; + + /// + /// locMaxReceiveMessageSizeKB control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locMaxReceiveMessageSizeKB; + + /// + /// maxReceiveMessageSizeKB control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.SizeBox maxReceiveMessageSizeKB; + /// /// locWhenSizeExceeds control. /// @@ -356,49 +382,13 @@ namespace WebsitePanel.Portal.ExchangeServer { protected global::WebsitePanel.Portal.ExchangeServer.UserControls.DaysBox daysKeepDeletedItems; /// - /// secDomainUser control. + /// btnAdd control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::WebsitePanel.Portal.CollapsiblePanel secDomainUser; - - /// - /// DomainUser control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Panel DomainUser; - - /// - /// txtAccountName control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox txtAccountName; - - /// - /// chkPmmAllowed control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.CheckBox chkPmmAllowed; - - /// - /// 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; + protected global::System.Web.UI.WebControls.Button btnAdd; /// /// ValidationSummary1 control. diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeContactGeneralSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeContactGeneralSettings.ascx.cs index f0b2c7ba..3237f9b2 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeContactGeneralSettings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeContactGeneralSettings.ascx.cs @@ -30,19 +30,22 @@ using System; using System.Web.UI.WebControls; using WebsitePanel.Providers.HostedSolution; using Microsoft.Security.Application; +using WebsitePanel.EnterpriseServer; namespace WebsitePanel.Portal.ExchangeServer { - public partial class ExchangeContactGeneralSettings : WebsitePanelModuleBase - { - protected void Page_Load(object sender, EventArgs e) - { + public partial class ExchangeContactGeneralSettings : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { if (!IsPostBack) { BindMapiRichTextFormat(); BindSettings(); } - } + + + } private void BindMapiRichTextFormat() { @@ -60,8 +63,8 @@ namespace WebsitePanel.Portal.ExchangeServer // get settings ExchangeContact contact = ES.Services.ExchangeServer.GetContactGeneralSettings(PanelRequest.ItemID, PanelRequest.AccountID); - - litDisplayName.Text = AntiXss.HtmlEncode(contact.DisplayName); + + litDisplayName.Text = AntiXss.HtmlEncode(contact.DisplayName); // bind form txtDisplayName.Text = contact.DisplayName; @@ -95,7 +98,7 @@ namespace WebsitePanel.Portal.ExchangeServer } catch (Exception ex) { - messageBox.ShowErrorMessage("EXCHANGE_GET_CONTACT_SETTINGS", ex); + messageBox.ShowErrorMessage("EXCHANGE_GET_CONTACT_SETTINGS", ex); } } @@ -143,13 +146,13 @@ namespace WebsitePanel.Portal.ExchangeServer return; } - litDisplayName.Text = AntiXss.HtmlEncode(txtDisplayName.Text); + litDisplayName.Text = AntiXss.HtmlEncode(txtDisplayName.Text); - messageBox.ShowSuccessMessage("EXCHANGE_UPDATE_CONTACT_SETTINGS"); + messageBox.ShowSuccessMessage("EXCHANGE_UPDATE_CONTACT_SETTINGS"); } catch (Exception ex) { - messageBox.ShowErrorMessage("EXCHANGE_UPDATE_CONTACT_SETTINGS", ex); + messageBox.ShowErrorMessage("EXCHANGE_UPDATE_CONTACT_SETTINGS", ex); } } @@ -157,5 +160,5 @@ namespace WebsitePanel.Portal.ExchangeServer { SaveSettings(); } - } + } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeContactGeneralSettings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeContactGeneralSettings.ascx.designer.cs index d7b1be03..6186bb22 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeContactGeneralSettings.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeContactGeneralSettings.ascx.designer.cs @@ -1,22 +1,15 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.1433 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace WebsitePanel.Portal.ExchangeServer { - /// - /// ExchangeContactGeneralSettings class. - /// - /// - /// Auto-generated class. - /// public partial class ExchangeContactGeneralSettings { /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeContactMailFlowSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeContactMailFlowSettings.ascx.cs index 03e37b08..ae256765 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeContactMailFlowSettings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeContactMailFlowSettings.ascx.cs @@ -38,17 +38,20 @@ using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.EnterpriseServer; namespace WebsitePanel.Portal.ExchangeServer { - public partial class ExchangeContactMailFlowSettings : WebsitePanelModuleBase - { + public partial class ExchangeContactMailFlowSettings : WebsitePanelModuleBase + { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BindSettings(); } + + } private void BindSettings() @@ -59,12 +62,12 @@ namespace WebsitePanel.Portal.ExchangeServer ExchangeContact contact = ES.Services.ExchangeServer.GetContactMailFlowSettings( PanelRequest.ItemID, PanelRequest.AccountID); - litDisplayName.Text = contact.DisplayName; + litDisplayName.Text = contact.DisplayName; // bind form acceptAccounts.SetAccounts(contact.AcceptAccounts); chkSendersAuthenticated.Checked = contact.RequireSenderAuthentication; - rejectAccounts.SetAccounts(contact.RejectAccounts); + rejectAccounts.SetAccounts(contact.RejectAccounts); } catch (Exception ex) { @@ -92,11 +95,11 @@ namespace WebsitePanel.Portal.ExchangeServer return; } - messageBox.ShowSuccessMessage("EXCHANGE_UPDATE_CONTACT_MAILFLOW"); + messageBox.ShowSuccessMessage("EXCHANGE_UPDATE_CONTACT_MAILFLOW"); } catch (Exception ex) { - messageBox.ShowErrorMessage("EXCHANGE_UPDATE_CONTACT_MAILFLOW", ex); + messageBox.ShowErrorMessage("EXCHANGE_UPDATE_CONTACT_MAILFLOW", ex); } } @@ -104,5 +107,5 @@ namespace WebsitePanel.Portal.ExchangeServer { SaveSettings(); } - } + } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeContactMailFlowSettings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeContactMailFlowSettings.ascx.designer.cs index ae203ff7..51e80b4a 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeContactMailFlowSettings.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeContactMailFlowSettings.ascx.designer.cs @@ -1,22 +1,15 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.312 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace WebsitePanel.Portal.ExchangeServer { - /// - /// ExchangeContactMailFlowSettings class. - /// - /// - /// Auto-generated class. - /// public partial class ExchangeContactMailFlowSettings { /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeContacts.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeContacts.ascx index 85248ff5..edd7473c 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeContacts.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeContacts.ascx @@ -32,13 +32,6 @@
- - 10 - 20 - 50 - 100 - DisplayName Email @@ -51,7 +44,7 @@ + DataSourceID="odsAccountsPaged"> diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeContacts.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeContacts.ascx.cs index f50647e5..9937409f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeContacts.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeContacts.ascx.cs @@ -38,49 +38,52 @@ using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.EnterpriseServer; namespace WebsitePanel.Portal.ExchangeServer { - public partial class ExchangeContacts : WebsitePanelModuleBase - { - protected void Page_Load(object sender, EventArgs e) - { - if (!IsPostBack) - { - BindStats(); - } - } + public partial class ExchangeContacts : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + BindStats(); + } - private void BindStats() - { - // quota values - OrganizationStatistics stats = - ES.Services.ExchangeServer.GetOrganizationStatistics(PanelRequest.ItemID); - contactsQuota.QuotaUsedValue = stats.CreatedContacts; - contactsQuota.QuotaValue = stats.AllocatedContacts; - } + + } - protected void btnCreateContact_Click(object sender, EventArgs e) - { - Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "create_contact", - "SpaceID=" + PanelSecurity.PackageId.ToString())); - } + private void BindStats() + { + // quota values + OrganizationStatistics stats = + ES.Services.ExchangeServer.GetOrganizationStatistics(PanelRequest.ItemID); + contactsQuota.QuotaUsedValue = stats.CreatedContacts; + contactsQuota.QuotaValue = stats.AllocatedContacts; + } - public string GetContactEditUrl(string accountId) - { - return EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "contact_settings", - "AccountID=" + accountId, - "ItemID=" + PanelRequest.ItemID.ToString()); - } + protected void btnCreateContact_Click(object sender, EventArgs e) + { + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "create_contact", + "SpaceID=" + PanelSecurity.PackageId.ToString())); + } - protected void odsAccountsPaged_Selected(object sender, ObjectDataSourceStatusEventArgs e) - { - if (e.Exception != null) - { - messageBox.ShowErrorMessage("EXCHANGE_GET_CONTACTS", e.Exception); - e.ExceptionHandled = true; - } - } + public string GetContactEditUrl(string accountId) + { + return EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "contact_settings", + "AccountID=" + accountId, + "ItemID=" + PanelRequest.ItemID.ToString()); + } + + protected void odsAccountsPaged_Selected(object sender, ObjectDataSourceStatusEventArgs e) + { + if (e.Exception != null) + { + messageBox.ShowErrorMessage("EXCHANGE_GET_CONTACTS", e.Exception); + e.ExceptionHandled = true; + } + } protected void gvContacts_RowCommand(object sender, GridViewCommandEventArgs e) { @@ -101,25 +104,13 @@ namespace WebsitePanel.Portal.ExchangeServer // rebind grid gvContacts.DataBind(); - BindStats(); + BindStats(); } catch (Exception ex) { - messageBox.ShowErrorMessage("EXCHANGE_DELETE_CONTACT", ex); + messageBox.ShowErrorMessage("EXCHANGE_DELETE_CONTACT", ex); } } } - - protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) - { - gvContacts.PageSize = Convert.ToInt16(ddlPageSize.SelectedValue); - - // rebind grid - gvContacts.DataBind(); - - // bind stats - BindStats(); - - } - } + } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeContacts.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeContacts.ascx.designer.cs index 8a00f9e7..70d6ca5f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeContacts.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeContacts.ascx.designer.cs @@ -93,15 +93,6 @@ namespace WebsitePanel.Portal.ExchangeServer { /// protected global::System.Web.UI.WebControls.Localize locSearch; - /// - /// ddlPageSize control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.DropDownList ddlPageSize; - /// /// ddlSearchColumn control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateContact.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateContact.ascx.cs index f09dd359..6bdc0eaf 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateContact.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateContact.ascx.cs @@ -40,12 +40,12 @@ using WebsitePanel.EnterpriseServer; namespace WebsitePanel.Portal.ExchangeServer { - public partial class ExchangeCreateContact : WebsitePanelModuleBase - { - protected void Page_Load(object sender, EventArgs e) - { - - } + public partial class ExchangeCreateContact : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + + } protected void btnCreate_Click(object sender, EventArgs e) { @@ -68,7 +68,7 @@ namespace WebsitePanel.Portal.ExchangeServer { messageBox.ShowResultMessage(BusinessErrorCodes.ERROR_EXCHANGE_EMAIL_EXISTS); return; - + } if (accountId < 0) @@ -86,5 +86,5 @@ namespace WebsitePanel.Portal.ExchangeServer messageBox.ShowErrorMessage("EXCHANGE_CREATE_CONTACT", ex); } } - } + } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateContact.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateContact.ascx.designer.cs index 58a987b9..3f35f26b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateContact.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateContact.ascx.designer.cs @@ -1,31 +1,159 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.42 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace WebsitePanel.Portal.ExchangeServer { + public partial class ExchangeCreateContact { - protected WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; - protected WebsitePanel.Portal.ExchangeServer.UserControls.Breadcrumb breadcrumb; - protected WebsitePanel.Portal.ExchangeServer.UserControls.Menu menu; - protected System.Web.UI.WebControls.Image Image1; - protected System.Web.UI.WebControls.Localize locTitle; - protected WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; - protected System.Web.UI.WebControls.Localize locDisplayName; - protected System.Web.UI.WebControls.TextBox txtDisplayName; - protected System.Web.UI.WebControls.RequiredFieldValidator valRequireDisplayName; - protected System.Web.UI.WebControls.Localize locEmail; - protected System.Web.UI.WebControls.TextBox txtEmail; - protected System.Web.UI.WebControls.RequiredFieldValidator valRequireAccount; - protected System.Web.UI.WebControls.RegularExpressionValidator valCorrectEmail; - protected System.Web.UI.WebControls.Button btnCreate; - protected System.Web.UI.WebControls.ValidationSummary ValidationSummary1; - protected System.Web.UI.WebControls.Localize FormComments; + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Menu menu; + + /// + /// Image1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image Image1; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// locDisplayName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locDisplayName; + + /// + /// txtDisplayName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtDisplayName; + + /// + /// valRequireDisplayName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireDisplayName; + + /// + /// locEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locEmail; + + /// + /// txtEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtEmail; + + /// + /// valRequireAccount control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireAccount; + + /// + /// valCorrectEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RegularExpressionValidator valCorrectEmail; + + /// + /// btnCreate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCreate; + + /// + /// ValidationSummary1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ValidationSummary ValidationSummary1; + + /// + /// FormComments control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize FormComments; } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateDistributionList.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateDistributionList.ascx.cs index 2de35495..99b92082 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateDistributionList.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateDistributionList.ascx.cs @@ -36,15 +36,16 @@ using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; +using WebsitePanel.EnterpriseServer; namespace WebsitePanel.Portal.ExchangeServer { - public partial class ExchangeCreateDistributionList : WebsitePanelModuleBase - { - protected void Page_Load(object sender, EventArgs e) - { - - } + public partial class ExchangeCreateDistributionList : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + + } protected void btnCreate_Click(object sender, EventArgs e) { @@ -56,7 +57,7 @@ namespace WebsitePanel.Portal.ExchangeServer if (!Page.IsValid) return; - + try { @@ -66,7 +67,7 @@ namespace WebsitePanel.Portal.ExchangeServer email.AccountName, email.DomainName, manager.GetAccountId()); - + if (accountId < 0) { @@ -90,6 +91,6 @@ namespace WebsitePanel.Portal.ExchangeServer } - - } + + } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateDistributionList.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateDistributionList.ascx.designer.cs index 40d5eec3..6c1ccf4e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateDistributionList.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateDistributionList.ascx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.1873 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx index b6a1e5f6..5cae78f8 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx @@ -7,6 +7,7 @@ <%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> <%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> <%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> +<%@ Register Src="UserControls/MailboxPlanSelector.ascx" TagName="MailboxPlanSelector" TagPrefix="wsp" %> @@ -50,7 +51,7 @@ - + @@ -61,6 +62,14 @@ ErrorMessage="Enter Display Name" ValidationGroup="CreateMailbox" Display="Dynamic" Text="*" SetFocusOnError="True"> + + + + +
+ + +
@@ -91,21 +100,23 @@
- - - - - + + + +
- -
+ + + +
- +
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx.cs index ab4da28a..359c7fe8 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx.cs @@ -33,18 +33,18 @@ using WebsitePanel.Providers.ResultObjects; namespace WebsitePanel.Portal.ExchangeServer { - public partial class ExchangeCreateMailbox : WebsitePanelModuleBase - { - private bool IsNewUser - { - get - { - return NewUserTable.Visible; - } - } - + public partial class ExchangeCreateMailbox : WebsitePanelModuleBase + { + private bool IsNewUser + { + get + { + return NewUserTable.Visible; + } + } + protected void Page_Load(object sender, EventArgs e) - { + { if (!IsPostBack) { password.SetPackagePolicy(PanelSecurity.PackageId, UserSettings.EXCHANGE_POLICY, "MailboxPasswordPolicy"); @@ -64,16 +64,32 @@ namespace WebsitePanel.Portal.ExchangeServer messageBox.ShowMessage(passwordPolicy, "EXCHANGE_CREATE_MAILBOX", "HostedOrganization"); return; } - + PackageInfo package = ES.Services.Packages.GetPackage(PanelSecurity.PackageId); if (package != null) { - UserInfo user = ES.Services.Users.GetUserById(package.UserId); - if (user != null) - sendInstructionEmail.Text = user.Email; + //UserInfo user = ES.Services.Users.GetUserById(package.UserId); + //if (user != null) + //sendInstructionEmail.Text = user.Email; } - } - } + + WebsitePanel.Providers.HostedSolution.ExchangeMailboxPlan[] plans = ES.Services.ExchangeServer.GetExchangeMailboxPlans(PanelRequest.ItemID); + + if (plans.Length == 0) + btnCreate.Enabled = false; + } + + + PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); + if (cntx.Quotas.ContainsKey(Quotas.EXCHANGE2007_ISCONSUMER)) + { + if (cntx.Quotas[Quotas.EXCHANGE2007_ISCONSUMER].QuotaAllocatedValue != 1) + { + locSubscriberNumber.Visible = txtSubscriberNumber.Visible = valRequireSubscriberNumber.Enabled = false; + } + } + + } protected void btnCreate_Click(object sender, EventArgs e) { @@ -92,23 +108,27 @@ namespace WebsitePanel.Portal.ExchangeServer string accountName = IsNewUser ? string.Empty : userSelector.GetAccount(); ExchangeAccountType type = IsNewUser - ? (ExchangeAccountType) Utils.ParseInt(rbMailboxType.SelectedValue, 1) + ? (ExchangeAccountType)Utils.ParseInt(rbMailboxType.SelectedValue, 1) : ExchangeAccountType.Mailbox; - + string domain = IsNewUser ? email.DomainName : userSelector.GetPrimaryEmailAddress().Split('@')[1]; int accountId = IsNewUser ? 0 : userSelector.GetAccountId(); + string subscriberNumber = IsNewUser ? txtSubscriberNumber.Text.Trim() : userSelector.GetSubscriberNumber(); + accountId = ES.Services.ExchangeServer.CreateMailbox(PanelRequest.ItemID, accountId, type, accountName, displayName, name, domain, password.Password, - chkSendInstructions.Checked, - sendInstructionEmail.Text); - - + false, + "", + Convert.ToInt32(mailboxPlanSelector.MailboxPlanId), + subscriberNumber); + + if (accountId < 0) { messageBox.ShowResultMessage(accountId); @@ -125,7 +145,7 @@ namespace WebsitePanel.Portal.ExchangeServer } } - + protected void rbtnUserExistingUser_CheckedChanged(object sender, EventArgs e) { @@ -138,7 +158,7 @@ namespace WebsitePanel.Portal.ExchangeServer NewUserTable.Visible = true; ExistingUserTable.Visible = false; - } - - } + } + + } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx.designer.cs index 7380d76e..2c5c9255 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx.designer.cs @@ -1,22 +1,15 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.1378 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace WebsitePanel.Portal.ExchangeServer { - /// - /// ExchangeCreateMailbox class. - /// - /// - /// Auto-generated class. - /// public partial class ExchangeCreateMailbox { /// @@ -145,6 +138,33 @@ namespace WebsitePanel.Portal.ExchangeServer { /// protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireDisplayName; + /// + /// locSubscriberNumber control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locSubscriberNumber; + + /// + /// txtSubscriberNumber control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtSubscriberNumber; + + /// + /// valRequireSubscriberNumber control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireSubscriberNumber; + /// /// locAccount control. /// @@ -227,22 +247,22 @@ namespace WebsitePanel.Portal.ExchangeServer { protected global::WebsitePanel.Portal.ExchangeServer.UserControls.UserSelector userSelector; /// - /// chkSendInstructions control. + /// locMailboxplanName control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.CheckBox chkSendInstructions; + protected global::System.Web.UI.WebControls.Localize locMailboxplanName; /// - /// sendInstructionEmail control. + /// mailboxPlanSelector control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::WebsitePanel.Portal.UserControls.EmailControl sendInstructionEmail; + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.MailboxPlanSelector mailboxPlanSelector; /// /// btnCreate control. diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListEmailAddresses.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListEmailAddresses.ascx index 2c0d04a2..879fbec5 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListEmailAddresses.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListEmailAddresses.ascx @@ -7,13 +7,12 @@ <%@ Register TagPrefix="wsp" TagName="CollapsiblePanel" Src="../UserControls/CollapsiblePanel.ascx" %> diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListEmailAddresses.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListEmailAddresses.ascx.cs index 06f4b5ff..0f986fc9 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListEmailAddresses.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListEmailAddresses.ascx.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2012, Outercurve Foundation. +// Copyright (c) 2011, Outercurve Foundation. // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, @@ -42,16 +42,17 @@ using WebsitePanel.EnterpriseServer; namespace WebsitePanel.Portal.ExchangeServer { - public partial class ExchangeDistributionListEmailAddresses : WebsitePanelModuleBase - { - protected void Page_Load(object sender, EventArgs e) - { + public partial class ExchangeDistributionListEmailAddresses : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { if (!IsPostBack) { BindEmails(); } + - } + } private void BindEmails() { @@ -79,11 +80,11 @@ namespace WebsitePanel.Portal.ExchangeServer { if (!Page.IsValid) return; - - btnDeleteAddresses.Enabled = true; - btnSetAsPrimary.Enabled = true; - try + btnDeleteAddresses.Enabled = true; + btnSetAsPrimary.Enabled = true; + + try { int result = ES.Services.ExchangeServer.AddDistributionListEmailAddress( PanelRequest.ItemID, PanelRequest.AccountID, email.Email); @@ -94,17 +95,17 @@ namespace WebsitePanel.Portal.ExchangeServer return; } - // rebind - BindEmails(); + // rebind + BindEmails(); } catch (Exception ex) { - messageBox.ShowErrorMessage("EXCHANGE_DLIST_ADD_EMAIL", ex); + messageBox.ShowErrorMessage("EXCHANGE_DLIST_ADD_EMAIL", ex); } - // clear field - email.AccountName = ""; + // clear field + email.AccountName = ""; } protected void btnSetAsPrimary_Click(object sender, EventArgs e) @@ -113,10 +114,10 @@ namespace WebsitePanel.Portal.ExchangeServer { string email = null; bool Checked = false; - + for (int i = 0; i < gvEmails.Rows.Count; i++) { - + GridViewRow row = gvEmails.Rows[i]; CheckBox chkSelect = (CheckBox)row.FindControl("chkSelect"); if (chkSelect.Checked) @@ -145,14 +146,14 @@ namespace WebsitePanel.Portal.ExchangeServer return; } - // rebind - BindEmails(); + // rebind + BindEmails(); messageBox.ShowSuccessMessage("EXCHANGE_MAILBOX_SET_DEFAULT_EMAIL"); } catch (Exception ex) { - messageBox.ShowErrorMessage("EXCHANGE_DLIST_SET_DEFAULT_EMAIL", ex); + messageBox.ShowErrorMessage("EXCHANGE_DLIST_SET_DEFAULT_EMAIL", ex); } } @@ -187,13 +188,13 @@ namespace WebsitePanel.Portal.ExchangeServer return; } - // rebind - BindEmails(); + // rebind + BindEmails(); } catch (Exception ex) { - messageBox.ShowErrorMessage("EXCHANGE_DLIST_DELETE_EMAILS", ex); + messageBox.ShowErrorMessage("EXCHANGE_DLIST_DELETE_EMAILS", ex); } } - } + } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListEmailAddresses.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListEmailAddresses.ascx.designer.cs index a961bc7a..7ccebf49 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListEmailAddresses.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListEmailAddresses.ascx.designer.cs @@ -1,34 +1,186 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.42 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace WebsitePanel.Portal.ExchangeServer { + public partial class ExchangeDistributionListEmailAddresses { - protected WebsitePanel.Portal.ExchangeServer.UserControls.Breadcrumb breadcrumb; - protected WebsitePanel.Portal.ExchangeServer.UserControls.Menu menu; - protected System.Web.UI.WebControls.Image Image1; - protected System.Web.UI.WebControls.Localize locTitle; - protected System.Web.UI.WebControls.Literal litDisplayName; - protected WebsitePanel.Portal.ExchangeServer.UserControls.DistributionListTabs tabs; - protected WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; - protected System.Web.UI.WebControls.Label lblAddEmail; - protected System.Web.UI.WebControls.Localize locAccount; - protected WebsitePanel.Portal.ExchangeServer.UserControls.EmailAddress email; - protected System.Web.UI.WebControls.Button btnAddEmail; - protected WebsitePanel.Portal.CollapsiblePanel secExistingAddresses; - protected System.Web.UI.WebControls.Panel ExistingAddresses; - protected System.Web.UI.WebControls.GridView gvEmails; - protected System.Web.UI.WebControls.Localize locTotal; - protected System.Web.UI.WebControls.Label lblTotal; - protected System.Web.UI.WebControls.Button btnSetAsPrimary; - protected System.Web.UI.WebControls.Button btnDeleteAddresses; - protected System.Web.UI.WebControls.Localize FormComments; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Menu menu; + + /// + /// Image1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image Image1; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// litDisplayName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litDisplayName; + + /// + /// tabs control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.DistributionListTabs tabs; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// lblAddEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblAddEmail; + + /// + /// locAccount control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locAccount; + + /// + /// email control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.EmailAddress email; + + /// + /// btnAddEmail control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnAddEmail; + + /// + /// secExistingAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secExistingAddresses; + + /// + /// ExistingAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel ExistingAddresses; + + /// + /// gvEmails control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvEmails; + + /// + /// locTotal control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTotal; + + /// + /// lblTotal control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblTotal; + + /// + /// btnSetAsPrimary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnSetAsPrimary; + + /// + /// btnDeleteAddresses control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnDeleteAddresses; + + /// + /// FormComments control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize FormComments; } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListGeneralSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListGeneralSettings.ascx.cs index 072a415c..4382712e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListGeneralSettings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListGeneralSettings.ascx.cs @@ -39,18 +39,21 @@ using System.Web.UI.HtmlControls; using WebsitePanel.Providers.HostedSolution; using Microsoft.Security.Application; +using WebsitePanel.EnterpriseServer; namespace WebsitePanel.Portal.ExchangeServer { - public partial class ExchangeDistributionListGeneralSettings : WebsitePanelModuleBase - { - protected void Page_Load(object sender, EventArgs e) - { + public partial class ExchangeDistributionListGeneralSettings : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { if (!IsPostBack) { BindSettings(); } - } + + + } private void BindSettings() { @@ -60,7 +63,7 @@ namespace WebsitePanel.Portal.ExchangeServer ExchangeDistributionList dlist = ES.Services.ExchangeServer.GetDistributionListGeneralSettings( PanelRequest.ItemID, PanelRequest.AccountID); - litDisplayName.Text = dlist.DisplayName; + litDisplayName.Text = dlist.DisplayName; // bind form txtDisplayName.Text = dlist.DisplayName; @@ -74,7 +77,7 @@ namespace WebsitePanel.Portal.ExchangeServer } catch (Exception ex) { - messageBox.ShowErrorMessage("EXCHANGE_GET_DLIST_SETTINGS", ex); + messageBox.ShowErrorMessage("EXCHANGE_GET_DLIST_SETTINGS", ex); } } @@ -102,13 +105,13 @@ namespace WebsitePanel.Portal.ExchangeServer return; } - litDisplayName.Text = AntiXss.HtmlEncode(txtDisplayName.Text); + litDisplayName.Text = AntiXss.HtmlEncode(txtDisplayName.Text); - messageBox.ShowSuccessMessage("EXCHANGE_UPDATE_DLIST_SETTINGS"); + messageBox.ShowSuccessMessage("EXCHANGE_UPDATE_DLIST_SETTINGS"); } catch (Exception ex) { - messageBox.ShowErrorMessage("EXCHANGE_UPDATE_DLIST_SETTINGS", ex); + messageBox.ShowErrorMessage("EXCHANGE_UPDATE_DLIST_SETTINGS", ex); } } @@ -122,5 +125,5 @@ namespace WebsitePanel.Portal.ExchangeServer args.IsValid = manager.GetAccount() != null; } - } + } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListGeneralSettings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListGeneralSettings.ascx.designer.cs index d47594e0..4c435967 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListGeneralSettings.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListGeneralSettings.ascx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.3053 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListMailFlowSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListMailFlowSettings.ascx.cs index b857eb64..a8101656 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListMailFlowSettings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListMailFlowSettings.ascx.cs @@ -38,17 +38,20 @@ using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.EnterpriseServer; namespace WebsitePanel.Portal.ExchangeServer { - public partial class ExchangeDistributionListMailFlowSettings : WebsitePanelModuleBase - { + public partial class ExchangeDistributionListMailFlowSettings : WebsitePanelModuleBase + { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BindSettings(); } + + } private void BindSettings() @@ -59,7 +62,7 @@ namespace WebsitePanel.Portal.ExchangeServer ExchangeDistributionList dlist = ES.Services.ExchangeServer.GetDistributionListMailFlowSettings( PanelRequest.ItemID, PanelRequest.AccountID); - litDisplayName.Text = dlist.DisplayName; + litDisplayName.Text = dlist.DisplayName; // bind form acceptAccounts.SetAccounts(dlist.AcceptAccounts); @@ -68,7 +71,7 @@ namespace WebsitePanel.Portal.ExchangeServer } catch (Exception ex) { - messageBox.ShowErrorMessage("EXCHANGE_GET_DLIST_MAILFLOW", ex); + messageBox.ShowErrorMessage("EXCHANGE_GET_DLIST_MAILFLOW", ex); } } @@ -92,11 +95,11 @@ namespace WebsitePanel.Portal.ExchangeServer return; } - messageBox.ShowSuccessMessage("EXCHANGE_UPDATE_DLIST_MAILFLOW"); + messageBox.ShowSuccessMessage("EXCHANGE_UPDATE_DLIST_MAILFLOW"); } catch (Exception ex) { - messageBox.ShowErrorMessage("EXCHANGE_UPDATE_DLIST_MAILFLOW", ex); + messageBox.ShowErrorMessage("EXCHANGE_UPDATE_DLIST_MAILFLOW", ex); } } @@ -104,5 +107,5 @@ namespace WebsitePanel.Portal.ExchangeServer { SaveSettings(); } - } + } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListMailFlowSettings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListMailFlowSettings.ascx.designer.cs index 8acd9d04..6323eb4a 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListMailFlowSettings.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListMailFlowSettings.ascx.designer.cs @@ -1,22 +1,15 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.312 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace WebsitePanel.Portal.ExchangeServer { - /// - /// ExchangeDistributionListMailFlowSettings class. - /// - /// - /// Auto-generated class. - /// public partial class ExchangeDistributionListMailFlowSettings { /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListPermissions.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListPermissions.ascx.cs index 391caa18..e6ff43a8 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListPermissions.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListPermissions.ascx.cs @@ -29,6 +29,7 @@ using System; using WebsitePanel.Providers.Common; using WebsitePanel.Providers.ResultObjects; +using WebsitePanel.EnterpriseServer; namespace WebsitePanel.Portal.ExchangeServer { @@ -43,24 +44,26 @@ namespace WebsitePanel.Portal.ExchangeServer { litDisplayName.Text = res.Value.DisplayName; sendBehalfList.SetAccounts(res.Value.SendOnBehalfAccounts); - sendAsList.SetAccounts(res.Value.SendAsAccounts); + sendAsList.SetAccounts(res.Value.SendAsAccounts); } else { messageBox.ShowMessage(res, "SET_DISTRIBUTION_LIST_PERMISSIONS", "HostedOrganization"); } - - + + } + + } protected void btnSave_Click(object sender, EventArgs e) { - string []sendBehalfAccouts = sendBehalfList.GetAccounts(); - string []sendAsAccounts = sendAsList.GetAccounts(); + string[] sendBehalfAccouts = sendBehalfList.GetAccounts(); + string[] sendAsAccounts = sendAsList.GetAccounts(); - ResultObject res = ES.Services.ExchangeServer.SetDistributionListPermissions(PanelRequest.ItemID, PanelRequest.AccountID, sendAsAccounts, sendBehalfAccouts); + ResultObject res = ES.Services.ExchangeServer.SetDistributionListPermissions(PanelRequest.ItemID, PanelRequest.AccountID, sendAsAccounts, sendBehalfAccouts); messageBox.ShowMessage(res, "SET_DISTRIBUTION_LIST_PERMISSIONS", ""); } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListPermissions.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListPermissions.ascx.designer.cs index c524bab3..cd5f70ec 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListPermissions.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionListPermissions.ascx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.1873 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionLists.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionLists.ascx index 57504228..f3f006d6 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionLists.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionLists.ascx @@ -32,13 +32,6 @@
- - 10 - 20 - 50 - 100 - DisplayName Email @@ -51,7 +44,7 @@ + DataSourceID="odsAccountsPaged"> diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionLists.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionLists.ascx.cs index 31a95d2e..4c44664a 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionLists.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionLists.ascx.cs @@ -38,27 +38,30 @@ using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.EnterpriseServer; namespace WebsitePanel.Portal.ExchangeServer { - public partial class ExchangeDistributionLists : WebsitePanelModuleBase - { - protected void Page_Load(object sender, EventArgs e) - { + public partial class ExchangeDistributionLists : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { if (!IsPostBack) { - BindStats(); + BindStats(); } - } - private void BindStats() - { - // quota values - OrganizationStatistics stats = - ES.Services.ExchangeServer.GetOrganizationStatistics(PanelRequest.ItemID); - listsQuota.QuotaUsedValue = stats.CreatedDistributionLists; - listsQuota.QuotaValue = stats.AllocatedDistributionLists; - } + + } + + private void BindStats() + { + // quota values + OrganizationStatistics stats = + ES.Services.ExchangeServer.GetOrganizationStatistics(PanelRequest.ItemID); + listsQuota.QuotaUsedValue = stats.CreatedDistributionLists; + listsQuota.QuotaValue = stats.AllocatedDistributionLists; + } protected void btnCreateList_Click(object sender, EventArgs e) { @@ -66,21 +69,21 @@ namespace WebsitePanel.Portal.ExchangeServer "SpaceID=" + PanelSecurity.PackageId.ToString())); } - public string GetListEditUrl(string accountId) - { - return EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "dlist_settings", - "AccountID=" + accountId, - "ItemID=" + PanelRequest.ItemID.ToString()); - } + public string GetListEditUrl(string accountId) + { + return EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "dlist_settings", + "AccountID=" + accountId, + "ItemID=" + PanelRequest.ItemID.ToString()); + } - protected void odsAccountsPaged_Selected(object sender, ObjectDataSourceStatusEventArgs e) - { - if (e.Exception != null) - { - messageBox.ShowErrorMessage("EXCHANGE_GET_LISTS", e.Exception); - e.ExceptionHandled = true; - } - } + protected void odsAccountsPaged_Selected(object sender, ObjectDataSourceStatusEventArgs e) + { + if (e.Exception != null) + { + messageBox.ShowErrorMessage("EXCHANGE_GET_LISTS", e.Exception); + e.ExceptionHandled = true; + } + } protected void gvLists_RowCommand(object sender, GridViewCommandEventArgs e) { @@ -101,25 +104,13 @@ namespace WebsitePanel.Portal.ExchangeServer // rebind grid gvLists.DataBind(); - BindStats(); + BindStats(); } catch (Exception ex) { - messageBox.ShowErrorMessage("EXCHANGE_DELETE_DISTRIBUTION_LIST", ex); + messageBox.ShowErrorMessage("EXCHANGE_DELETE_DISTRIBUTION_LIST", ex); } } } - - protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) - { - gvLists.PageSize = Convert.ToInt16(ddlPageSize.SelectedValue); - - // rebind grid - gvLists.DataBind(); - - // bind stats - BindStats(); - - } - } + } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionLists.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionLists.ascx.designer.cs index b2601fcd..a6826723 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionLists.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDistributionLists.ascx.designer.cs @@ -93,15 +93,6 @@ namespace WebsitePanel.Portal.ExchangeServer { /// protected global::System.Web.UI.WebControls.Localize locSearch; - /// - /// ddlPageSize control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.DropDownList ddlPageSize; - /// /// ddlSearchColumn control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDomainNames.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDomainNames.ascx.cs index fa2ca3c5..6a2caaed 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDomainNames.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDomainNames.ascx.cs @@ -33,34 +33,36 @@ using WebsitePanel.Providers.HostedSolution; namespace WebsitePanel.Portal.ExchangeServer { - public partial class ExchangeDomainNames : WebsitePanelModuleBase - { - protected void Page_Load(object sender, EventArgs e) - { - if (!IsPostBack) - { - BindStats(); + public partial class ExchangeDomainNames : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + BindStats(); // bind domain names BindDomainNames(); - } - } + } + + + } private void BindStats() - { + { // set quotas - OrganizationStatistics stats = - ES.Services.Organizations.GetOrganizationStatistics(PanelRequest.ItemID); - domainsQuota.QuotaUsedValue = stats.CreatedDomains; - domainsQuota.QuotaValue = stats.AllocatedDomains; - } + OrganizationStatistics stats = + ES.Services.Organizations.GetOrganizationStatistics(PanelRequest.ItemID); + domainsQuota.QuotaUsedValue = stats.CreatedDomains; + domainsQuota.QuotaValue = stats.AllocatedDomains; + } - public string GetDomainRecordsEditUrl(string domainId) - { - return EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "domain_records", - "DomainID=" + domainId, - "ItemID=" + PanelRequest.ItemID); - } + public string GetDomainRecordsEditUrl(string domainId) + { + return EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "domain_records", + "DomainID=" + domainId, + "ItemID=" + PanelRequest.ItemID); + } private void BindDomainNames() { @@ -107,7 +109,7 @@ namespace WebsitePanel.Portal.ExchangeServer // rebind domains BindDomainNames(); - BindStats(); + BindStats(); } catch (Exception ex) { @@ -140,5 +142,5 @@ namespace WebsitePanel.Portal.ExchangeServer ShowErrorMessage("EXCHANGE_SET_DEFAULT_DOMAIN", ex); } } - } + } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDomainNames.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDomainNames.ascx.designer.cs index 56eedb42..13135b73 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDomainNames.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDomainNames.ascx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.1433 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDomainRecords.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDomainRecords.ascx.cs index 81796d94..61ac3ba0 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDomainRecords.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDomainRecords.ascx.cs @@ -42,25 +42,38 @@ using WebsitePanel.EnterpriseServer; namespace WebsitePanel.Portal.ExchangeServer { - public partial class ExchangeDomainRecords : WebsitePanelModuleBase - { - protected void Page_Load(object sender, EventArgs e) - { - if (!IsPostBack) - { - // save return URL - ViewState["ReturnUrl"] = Request.UrlReferrer.ToString(); + public partial class ExchangeDomainRecords : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + // save return URL + ViewState["ReturnUrl"] = Request.UrlReferrer.ToString(); - ToggleRecordControls(); + ToggleRecordControls(); - // domain name - DomainInfo domain = ES.Services.Servers.GetDomain(PanelRequest.DomainID); - litDomainName.Text = domain.DomainName; - } - } + // domain name + DomainInfo domain = ES.Services.Servers.GetDomain(PanelRequest.DomainID); + litDomainName.Text = domain.DomainName; + } + + + if (PanelSecurity.LoggedUser.Role == UserRole.User) + { + if (!PackagesHelper.CheckGroupQuotaEnabled(PanelSecurity.PackageId, ResourceGroups.Dns, Quotas.DNS_EDITOR)) + { + this.ExcludeDisableControls.Add(btnBack); + this.DisableControls = true; + } + } + + + + } public string GetRecordFullData(string recordType, string recordData, int mxPriority, int port) - { + { switch (recordType) { case "MX": @@ -72,8 +85,8 @@ namespace WebsitePanel.Portal.ExchangeServer } } - private void GetRecordsDetails(int recordIndex) - { + private void GetRecordsDetails(int recordIndex) + { GridViewRow row = gvRecords.Rows[recordIndex]; ViewState["SrvPort"] = ((Literal)row.Cells[0].FindControl("litSrvPort")).Text; ViewState["SrvWeight"] = ((Literal)row.Cells[0].FindControl("litSrvWeight")).Text; @@ -84,8 +97,8 @@ namespace WebsitePanel.Portal.ExchangeServer ViewState["RecordData"] = ((Literal)row.Cells[0].FindControl("litRecordData")).Text; } - private void BindDnsRecord(int recordIndex) - { + private void BindDnsRecord(int recordIndex) + { try { ViewState["NewRecord"] = false; @@ -107,13 +120,13 @@ namespace WebsitePanel.Portal.ExchangeServer } } - protected void ddlRecordType_SelectedIndexChanged(object sender, EventArgs e) - { - ToggleRecordControls(); - } + protected void ddlRecordType_SelectedIndexChanged(object sender, EventArgs e) + { + ToggleRecordControls(); + } - private void ToggleRecordControls() - { + private void ToggleRecordControls() + { rowMXPriority.Visible = false; rowSRVPriority.Visible = false; rowSRVWeight.Visible = false; @@ -141,18 +154,18 @@ namespace WebsitePanel.Portal.ExchangeServer } } - private void SaveRecord() - { - if (!Page.IsValid) - return; + private void SaveRecord() + { + if (!Page.IsValid) + return; - bool existingRecord = ViewState["ExistingRecord"] != null; + bool existingRecord = ViewState["ExistingRecord"] != null; - if (!existingRecord) - { - // add record - try - { + if (!existingRecord) + { + // add record + try + { int result = ES.Services.Servers.AddDnsZoneRecord(PanelRequest.DomainID, txtRecordName.Text.Trim(), (DnsRecordType) @@ -164,23 +177,23 @@ namespace WebsitePanel.Portal.ExchangeServer Int32.Parse(txtSRVWeight.Text.Trim()), Int32.Parse(txtSRVPort.Text.Trim())); - if (result < 0) - { - messageBox.ShowResultMessage(result); - return; - } - } - catch (Exception ex) - { - messageBox.ShowErrorMessage("GDNS_ADD_RECORD", ex); - return; - } - } - else - { - // update record - try - { + if (result < 0) + { + messageBox.ShowResultMessage(result); + return; + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("GDNS_ADD_RECORD", ex); + return; + } + } + else + { + // update record + try + { int result = ES.Services.Servers.UpdateDnsZoneRecord(PanelRequest.DomainID, ViewState["RecordName"].ToString(), ViewState["RecordData"].ToString(), @@ -192,64 +205,64 @@ namespace WebsitePanel.Portal.ExchangeServer Int32.Parse(txtSRVWeight.Text.Trim()), Int32.Parse(txtSRVPort.Text.Trim())); - if (result < 0) - { - messageBox.ShowResultMessage(result); - return; - } - } - catch (Exception ex) - { - messageBox.ShowErrorMessage("GDNS_UPDATE_RECORD", ex); - return; - } - } + if (result < 0) + { + messageBox.ShowResultMessage(result); + return; + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("GDNS_UPDATE_RECORD", ex); + return; + } + } - ResetPopup(); + ResetPopup(); - // rebind and switch - gvRecords.DataBind(); - } + // rebind and switch + gvRecords.DataBind(); + } - private void DeleteRecord(int recordIndex) - { - try - { - GetRecordsDetails(recordIndex); + private void DeleteRecord(int recordIndex) + { + try + { + GetRecordsDetails(recordIndex); - int result = ES.Services.Servers.DeleteDnsZoneRecord(PanelRequest.DomainID, - ViewState["RecordName"].ToString(), - (DnsRecordType)ViewState["RecordType"], - ViewState["RecordData"].ToString()); + int result = ES.Services.Servers.DeleteDnsZoneRecord(PanelRequest.DomainID, + ViewState["RecordName"].ToString(), + (DnsRecordType)ViewState["RecordType"], + ViewState["RecordData"].ToString()); - if (result < 0) - { - messageBox.ShowResultMessage(result); - return; - } - } - catch (Exception ex) - { - messageBox.ShowErrorMessage("GDNS_DELETE_RECORD", ex); - return; - } + if (result < 0) + { + messageBox.ShowResultMessage(result); + return; + } + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("GDNS_DELETE_RECORD", ex); + return; + } - // rebind grid - gvRecords.DataBind(); - } + // rebind grid + gvRecords.DataBind(); + } - protected void btnSave_Click(object sender, EventArgs e) - { - SaveRecord(); - } + protected void btnSave_Click(object sender, EventArgs e) + { + SaveRecord(); + } - protected void btnCancel_Click(object sender, EventArgs e) - { - ResetPopup(); - } + protected void btnCancel_Click(object sender, EventArgs e) + { + ResetPopup(); + } - private void ResetPopup() - { + private void ResetPopup() + { EditRecordModal.Hide(); ViewState["ExistingRecord"] = null; @@ -266,36 +279,36 @@ namespace WebsitePanel.Portal.ExchangeServer ToggleRecordControls(); } - protected void gvRecords_RowEditing(object sender, GridViewEditEventArgs e) - { - ViewState["ExistingRecord"] = true; - BindDnsRecord(e.NewEditIndex); - EditRecordModal.Show(); - e.Cancel = true; - } + protected void gvRecords_RowEditing(object sender, GridViewEditEventArgs e) + { + ViewState["ExistingRecord"] = true; + BindDnsRecord(e.NewEditIndex); + EditRecordModal.Show(); + e.Cancel = true; + } - protected void gvRecords_RowDeleting(object sender, GridViewDeleteEventArgs e) - { - DeleteRecord(e.RowIndex); - e.Cancel = true; - } + protected void gvRecords_RowDeleting(object sender, GridViewDeleteEventArgs e) + { + DeleteRecord(e.RowIndex); + e.Cancel = true; + } - protected void odsDnsRecords_Selected(object sender, ObjectDataSourceStatusEventArgs e) - { - if (e.Exception != null) - { - messageBox.ShowErrorMessage("GDNS_GET_RECORD", e.Exception); - //this.DisableControls = true; - e.ExceptionHandled = true; - } - } + protected void odsDnsRecords_Selected(object sender, ObjectDataSourceStatusEventArgs e) + { + if (e.Exception != null) + { + messageBox.ShowErrorMessage("GDNS_GET_RECORD", e.Exception); + //this.DisableControls = true; + e.ExceptionHandled = true; + } + } - protected void btnBack_Click(object sender, EventArgs e) - { - if (ViewState["ReturnUrl"] != null) - Response.Redirect(ViewState["ReturnUrl"].ToString()); - else - RedirectToBrowsePage(); - } - } + protected void btnBack_Click(object sender, EventArgs e) + { + if (ViewState["ReturnUrl"] != null) + Response.Redirect(ViewState["ReturnUrl"].ToString()); + else + RedirectToBrowsePage(); + } + } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDomainRecords.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDomainRecords.ascx.designer.cs index f7333780..fe5fa391 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDomainRecords.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeDomainRecords.ascx.designer.cs @@ -1,31 +1,3 @@ -// Copyright (c) 2012, Outercurve Foundation. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// - Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// - Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// - Neither the name of the Outercurve Foundation nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - //------------------------------------------------------------------------------ // // This code was generated by a tool. diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxAdvancedSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxAdvancedSettings.ascx.cs deleted file mode 100644 index cd1eeace..00000000 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxAdvancedSettings.ascx.cs +++ /dev/null @@ -1,164 +0,0 @@ -// 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.EnterpriseServer; - -namespace WebsitePanel.Portal.ExchangeServer -{ - public partial class ExchangeMailboxAdvancedSettings : WebsitePanelModuleBase - { - protected void Page_Load(object sender, EventArgs e) - { - if (!IsPostBack) - { - BindSettings(); - } - } - - private void BindSettings() - { - try - { - // get settings - ExchangeMailbox mailbox = ES.Services.ExchangeServer.GetMailboxAdvancedSettings( - PanelRequest.ItemID, PanelRequest.AccountID); - - // title - litDisplayName.Text = mailbox.DisplayName; - - // load space context - PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); - - chkPOP3.Visible = cntx.Quotas.ContainsKey(Quotas.EXCHANGE2007_POP3ALLOWED) && !cntx.Quotas[Quotas.EXCHANGE2007_POP3ALLOWED].QuotaExhausted; - chkIMAP.Visible = cntx.Quotas.ContainsKey(Quotas.EXCHANGE2007_IMAPALLOWED) && !cntx.Quotas[Quotas.EXCHANGE2007_IMAPALLOWED].QuotaExhausted; - chkOWA.Visible = cntx.Quotas.ContainsKey(Quotas.EXCHANGE2007_OWAALLOWED) && !cntx.Quotas[Quotas.EXCHANGE2007_OWAALLOWED].QuotaExhausted; - chkMAPI.Visible = cntx.Quotas.ContainsKey(Quotas.EXCHANGE2007_MAPIALLOWED) && !cntx.Quotas[Quotas.EXCHANGE2007_MAPIALLOWED].QuotaExhausted; - chkActiveSync.Visible = cntx.Quotas.ContainsKey(Quotas.EXCHANGE2007_ACTIVESYNCALLOWED) && !cntx.Quotas[Quotas.EXCHANGE2007_ACTIVESYNCALLOWED].QuotaExhausted; - - // bind form - chkPOP3.Checked = mailbox.EnablePOP; - chkIMAP.Checked = mailbox.EnableIMAP; - chkOWA.Checked = mailbox.EnableOWA; - chkMAPI.Checked = mailbox.EnableMAPI; - chkActiveSync.Checked = mailbox.EnableActiveSync; - - lblTotalItems.Text = mailbox.TotalItems.ToString(); - lblTotalSize.Text = mailbox.TotalSizeMB.ToString(); - lblLastLogon.Text = Utils.FormatDateTime(mailbox.LastLogon); - lblLastLogoff.Text = Utils.FormatDateTime(mailbox.LastLogoff); - - sizeIssueWarning.ValueKB = mailbox.IssueWarningKB; - sizeProhibitSend.ValueKB = mailbox.ProhibitSendKB; - sizeProhibitSendReceive.ValueKB = mailbox.ProhibitSendReceiveKB; - - daysKeepDeletedItems.ValueDays = mailbox.KeepDeletedItemsDays; - - txtAccountName.Text = mailbox.Domain + "\\" + mailbox.AccountName; - - // get account meta - ExchangeAccount account = ES.Services.ExchangeServer.GetAccount(PanelRequest.ItemID, PanelRequest.AccountID); - chkPmmAllowed.Checked = (account.MailboxManagerActions & MailboxManagerActions.AdvancedSettings) > 0; - } - catch (Exception ex) - { - messageBox.ShowErrorMessage("EXCHANGE_GET_MAILBOX_ADVANCED", ex); - } - } - - private void SaveSettings() - { - if (!Page.IsValid) - return; - - try - { - if (((sizeIssueWarning.ValueKB <= sizeProhibitSend.ValueKB && sizeIssueWarning.ValueKB != -1) || sizeProhibitSend.ValueKB == -1) - && ((sizeProhibitSend.ValueKB <= sizeProhibitSendReceive.ValueKB && sizeProhibitSend.ValueKB != -1) || sizeProhibitSendReceive.ValueKB == -1)) - { - int result = ES.Services.ExchangeServer.SetMailboxAdvancedSettings( - PanelRequest.ItemID, PanelRequest.AccountID, - chkPOP3.Checked, - chkIMAP.Checked, - chkOWA.Checked, - chkMAPI.Checked, - chkActiveSync.Checked, - - sizeIssueWarning.ValueKB, - sizeProhibitSend.ValueKB, - sizeProhibitSendReceive.ValueKB, - - daysKeepDeletedItems.ValueDays); - - if (result < 0) - { - messageBox.ShowResultMessage(result); - return; - } - - messageBox.ShowSuccessMessage("EXCHANGE_UPDATE_MAILBOX_ADVANCED"); - } - else - { - messageBox.ShowErrorMessage("EXCHANGE_SET_ORG_LIMITS_VALIDATION"); - } - } - catch (Exception ex) - { - messageBox.ShowErrorMessage("EXCHANGE_UPDATE_MAILBOX_ADVANCED", ex); - } - } - - protected void btnSave_Click(object sender, EventArgs e) - { - SaveSettings(); - } - - protected void chkPmmAllowed_CheckedChanged(object sender, EventArgs e) - { - try - { - int result = ES.Services.ExchangeServer.SetMailboxManagerSettings(PanelRequest.ItemID, PanelRequest.AccountID, - chkPmmAllowed.Checked, MailboxManagerActions.AdvancedSettings); - - if (result < 0) - { - messageBox.ShowResultMessage(result); - return; - } - - messageBox.ShowSuccessMessage("EXCHANGE_UPDATE_MAILMANAGER"); - } - catch (Exception ex) - { - messageBox.ShowErrorMessage("EXCHANGE_UPDATE_MAILMANAGER", ex); - } - } - } -} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxEmailAddresses.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxEmailAddresses.ascx index 44fb11c1..1e94d27f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxEmailAddresses.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxEmailAddresses.ascx @@ -7,13 +7,12 @@ <%@ Register TagPrefix="wsp" TagName="CollapsiblePanel" Src="../UserControls/CollapsiblePanel.ascx" %> @@ -88,7 +87,7 @@
  - +
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxEmailAddresses.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxEmailAddresses.ascx.cs index b0e5ca58..eb6eb688 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxEmailAddresses.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxEmailAddresses.ascx.cs @@ -40,34 +40,37 @@ using System.Web.UI.HtmlControls; using EntServer = WebsitePanel.EnterpriseServer; using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.EnterpriseServer; namespace WebsitePanel.Portal.ExchangeServer { - public partial class ExchangeMailboxEmailAddresses : WebsitePanelModuleBase - { - protected void Page_Load(object sender, EventArgs e) - { - if (!IsPostBack) - { - BindEmails(); - } - } + public partial class ExchangeMailboxEmailAddresses : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + BindEmails(); + } + + + } private void BindEmails() { EntServer.ExchangeEmailAddress[] emails = ES.Services.ExchangeServer.GetMailboxEmailAddresses( - PanelRequest.ItemID, PanelRequest.AccountID); + PanelRequest.ItemID, PanelRequest.AccountID); - gvEmails.DataSource = emails; + gvEmails.DataSource = emails; gvEmails.DataBind(); - lblTotal.Text = emails.Length.ToString(); + lblTotal.Text = emails.Length.ToString(); - // form title + // form title ExchangeAccount account = ES.Services.ExchangeServer.GetAccount(PanelRequest.ItemID, PanelRequest.AccountID); chkPmmAllowed.Checked = (account.MailboxManagerActions & MailboxManagerActions.EmailAddresses) > 0; - litDisplayName.Text = account.DisplayName; + litDisplayName.Text = account.DisplayName; //disable buttons if only one e-mail available, it is primary and cannot be deleted if (gvEmails.Rows.Count == 1) @@ -88,7 +91,7 @@ namespace WebsitePanel.Portal.ExchangeServer try { int result = ES.Services.ExchangeServer.AddMailboxEmailAddress( - PanelRequest.ItemID, PanelRequest.AccountID, email.Email); + PanelRequest.ItemID, PanelRequest.AccountID, email.Email); if (result < 0) { @@ -96,16 +99,16 @@ namespace WebsitePanel.Portal.ExchangeServer return; } - // rebind - BindEmails(); + // rebind + BindEmails(); } catch (Exception ex) { - messageBox.ShowErrorMessage("EXCHANGE_MAILBOX_ADD_EMAIL", ex); + messageBox.ShowErrorMessage("EXCHANGE_MAILBOX_ADD_EMAIL", ex); } - // clear field - email.AccountName = ""; + // clear field + email.AccountName = ""; } protected void btnSetAsPrimary_Click(object sender, EventArgs e) @@ -145,14 +148,14 @@ namespace WebsitePanel.Portal.ExchangeServer return; } - // rebind - BindEmails(); + // rebind + BindEmails(); - messageBox.ShowSuccessMessage("EXCHANGE_MAILBOX_SET_DEFAULT_EMAIL"); + messageBox.ShowSuccessMessage("EXCHANGE_MAILBOX_SET_DEFAULT_EMAIL"); } catch (Exception ex) { - messageBox.ShowErrorMessage("EXCHANGE_MAILBOX_SET_DEFAULT_EMAIL", ex); + messageBox.ShowErrorMessage("EXCHANGE_MAILBOX_SET_DEFAULT_EMAIL", ex); } } @@ -185,12 +188,12 @@ namespace WebsitePanel.Portal.ExchangeServer return; } - // rebind - BindEmails(); + // rebind + BindEmails(); } catch (Exception ex) { - messageBox.ShowErrorMessage("EXCHANGE_MAILBOX_DELETE_EMAILS", ex); + messageBox.ShowErrorMessage("EXCHANGE_MAILBOX_DELETE_EMAILS", ex); } } @@ -214,5 +217,5 @@ namespace WebsitePanel.Portal.ExchangeServer messageBox.ShowErrorMessage("EXCHANGE_UPDATE_MAILMANAGER", ex); } } - } + } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxEmailAddresses.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxEmailAddresses.ascx.designer.cs index eba6138e..4a04d015 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxEmailAddresses.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxEmailAddresses.ascx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.1433 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx index c5c4246e..4e9a8fd4 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx @@ -3,11 +3,12 @@ <%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> <%@ Register Src="UserControls/MailboxSelector.ascx" TagName="MailboxSelector" TagPrefix="wsp" %> <%@ Register Src="UserControls/MailboxTabs.ascx" TagName="MailboxTabs" TagPrefix="wsp" %> -<%@ Register Src="../UserControls/PasswordControl.ascx" TagName="PasswordControl" TagPrefix="wsp" %> <%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> <%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> <%@ Register TagPrefix="wsp" TagName="CollapsiblePanel" Src="../UserControls/CollapsiblePanel.ascx" %> <%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> +<%@ Register Src="UserControls/MailboxPlanSelector.ascx" TagName="MailboxPlanSelector" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/QuotaViewer.ascx" TagName="QuotaViewer" TagPrefix="wsp" %> @@ -31,186 +32,58 @@ - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
- - -
- -
- -
-
-
- -   - - -
- -
- - + - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
- -
- -
- -
+ + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+
+ +
+ MB +
+
+
- - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
- -
- -
- -
- -
+ + + + + +
+
+
- - - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
- -
- -
- - -
-
- - - - - - -
- -
- + - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + @@ -149,12 +162,24 @@ + + + - + + + + + 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 a880fc62..544d78cf 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.cs @@ -32,15 +32,16 @@ using WebsitePanel.Providers.HostedSolution; namespace WebsitePanel.Portal.ExchangeServer { - public partial class OrganizationHome : WebsitePanelModuleBase - { - protected void Page_Load(object sender, EventArgs e) - { - if (!IsPostBack) - { - BindOrgStats(); - } - } + public partial class OrganizationHome : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + BindOrgStats(); + } + + } private void BindExchangeStats() { @@ -54,14 +55,9 @@ namespace WebsitePanel.Portal.ExchangeServer lnkLists.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "dlists", "SpaceID=" + PanelSecurity.PackageId.ToString()); - lnkFolders.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "public_folders", + lnkExchangeStorage.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "storage_usage", "SpaceID=" + PanelSecurity.PackageId.ToString()); - - - - - mailboxesStats.QuotaUsedValue = exchangeOrgStats.CreatedMailboxes; mailboxesStats.QuotaValue = exchangeOrgStats.AllocatedMailboxes; @@ -71,79 +67,93 @@ namespace WebsitePanel.Portal.ExchangeServer listsStats.QuotaUsedValue = exchangeOrgStats.CreatedDistributionLists; listsStats.QuotaValue = exchangeOrgStats.AllocatedDistributionLists; + exchangeStorageStats.QuotaUsedValue = exchangeOrgStats.UsedDiskSpace; + exchangeStorageStats.QuotaValue = exchangeOrgStats.AllocatedDiskSpace; - foldersStats.QuotaUsedValue = exchangeOrgStats.CreatedPublicFolders; - foldersStats.QuotaValue = exchangeOrgStats.AllocatedPublicFolders; - - lnkUsedExchangeDiskSpace.Text = exchangeOrgStats.UsedDiskSpace.ToString(); - lnkUsedExchangeDiskSpace.NavigateUrl - = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "storage_usage", - "SpaceID=" + PanelSecurity.PackageId.ToString()); - - - } - + private void BindOrgStats() - { - Organization org = ES.Services.Organizations.GetOrganization(PanelRequest.ItemID); + { + Organization org = ES.Services.Organizations.GetOrganization(PanelRequest.ItemID); lblOrganizationNameValue.Text = org.Name; lblOrganizationIDValue.Text = org.OrganizationId; lblCreatedValue.Text = org.CreatedDate.Date.ToShortDateString(); - + OrganizationStatistics orgStats = ES.Services.Organizations.GetOrganizationStatistics(PanelRequest.ItemID); - if (orgStats == null) - return; - - - litTotalDiskSpaceValue.Text = orgStats.UsedDiskSpace.ToString(); + if (orgStats == null) + return; domainStats.QuotaUsedValue = orgStats.CreatedDomains; domainStats.QuotaValue = orgStats.AllocatedDomains; userStats.QuotaUsedValue = orgStats.CreatedUsers; userStats.QuotaValue = orgStats.AllocatedUsers; - - - + + + lnkDomains.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "domains", "SpaceID=" + PanelSecurity.PackageId); lnkUsers.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "users", "SpaceID=" + PanelSecurity.PackageId); - - - //If Organization is ExchangeOrganization show exchage specific statistics - if (!string.IsNullOrEmpty(org.GlobalAddressList)) + + + + PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); + if (cntx.Groups.ContainsKey(ResourceGroups.Exchange)) { exchangeStatsPanel.Visible = true; BindExchangeStats(); - } else exchangeStatsPanel.Visible = false; - - PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); + //Show SharePoint statistics if (cntx.Groups.ContainsKey(ResourceGroups.HostedSharePoint)) { sharePointStatsPanel.Visible = true; - + lnkSiteCollections.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "sharepoint_sitecollections", "SpaceID=" + PanelSecurity.PackageId); siteCollectionsStats.QuotaUsedValue = orgStats.CreatedSharePointSiteCollections; siteCollectionsStats.QuotaValue = orgStats.AllocatedSharePointSiteCollections; - + } else sharePointStatsPanel.Visible = false; + if (cntx.Groups.ContainsKey(ResourceGroups.OCS)) + { + ocsStatsPanel.Visible = true; + BindOCSStats(); + } + else + ocsStatsPanel.Visible = false; + + if (cntx.Groups.ContainsKey(ResourceGroups.BlackBerry)) + { + besStatsPanel.Visible = true; + BindBESStats(); + } + else + besStatsPanel.Visible = false; +/* + if (cntx.Groups.ContainsKey(ResourceGroups.Lync)) + { + lyncStatsPanel.Visible = true; + BindLyncStats(); + } + else + */ + lyncStatsPanel.Visible = false; + + if (org.CrmOrganizationId != Guid.Empty) { @@ -153,18 +163,51 @@ namespace WebsitePanel.Portal.ExchangeServer else crmStatsPanel.Visible = false; - - } - private void BindCRMStats(OrganizationStatistics orgStats) - { + } + + private void BindCRMStats(OrganizationStatistics orgStats) + { lnkCRMUsers.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "crmusers", "SpaceID=" + PanelSecurity.PackageId); - crmUsersStats.QuotaUsedValue = orgStats.CreatedCRMUsers; - crmUsersStats.QuotaValue = orgStats.AllocatedCRMUsers; - } - - - } + crmUsersStats.QuotaUsedValue = orgStats.CreatedCRMUsers; + crmUsersStats.QuotaValue = orgStats.AllocatedCRMUsers; + } + + private void BindOCSStats() + { + OrganizationStatistics stats = ES.Services.Organizations.GetOrganizationStatistics(PanelRequest.ItemID); + ocsUsersStats.QuotaValue = stats.AllocatedOCSUsers; + ocsUsersStats.QuotaUsedValue = stats.CreatedOCSUsers; + + lnkOCSUsers.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "ocs_users", + "SpaceID=" + PanelSecurity.PackageId.ToString()); + } + + private void BindLyncStats() + { + /* + OrganizationStatistics stats = ES.Services.Organizations.GetOrganizationStatistics(PanelRequest.ItemID); + lyncUsersStats.QuotaValue = stats.AllocatedLyncUsers; + lyncUsersStats.QuotaUsedValue = stats.CreatedLyncUsers; + + lnkLyncUsers.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "lync_users", + "SpaceID=" + PanelSecurity.PackageId.ToString()); + */ + } + + + private void BindBESStats() + { + OrganizationStatistics stats = ES.Services.Organizations.GetOrganizationStatistics(PanelRequest.ItemID); + besUsersStats.QuotaValue = stats.AllocatedBlackBerryUsers; + besUsersStats.QuotaUsedValue = stats.CreatedBlackBerryUsers; + + lnkBESUsers.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "blackberry_users", + "SpaceID=" + PanelSecurity.PackageId.ToString()); + } + + + } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.designer.cs index 1dd113c8..afd604b1 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.designer.cs @@ -147,24 +147,6 @@ namespace WebsitePanel.Portal.ExchangeServer { /// protected global::WebsitePanel.Portal.QuotaViewer userStats; - /// - /// litTotalUserDiskSpace control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Literal litTotalUserDiskSpace; - - /// - /// litTotalDiskSpaceValue control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Literal litTotalDiskSpaceValue; - /// /// exchangeStatsPanel control. /// @@ -238,40 +220,94 @@ namespace WebsitePanel.Portal.ExchangeServer { protected global::WebsitePanel.Portal.QuotaViewer listsStats; /// - /// lnkFolders control. + /// lnkExchangeStorage control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.HyperLink lnkFolders; + protected global::System.Web.UI.WebControls.HyperLink lnkExchangeStorage; /// - /// foldersStats control. + /// exchangeStorageStats control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::WebsitePanel.Portal.QuotaViewer foldersStats; + protected global::WebsitePanel.Portal.QuotaViewer exchangeStorageStats; /// - /// Literal1 control. + /// besStatsPanel control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.Literal Literal1; + protected global::System.Web.UI.WebControls.Panel besStatsPanel; /// - /// lnkUsedExchangeDiskSpace control. + /// locBESStatistics control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.HyperLink lnkUsedExchangeDiskSpace; + protected global::System.Web.UI.WebControls.Localize locBESStatistics; + + /// + /// lnkBESUsers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HyperLink lnkBESUsers; + + /// + /// besUsersStats control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.QuotaViewer besUsersStats; + + /// + /// lyncStatsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel lyncStatsPanel; + + /// + /// locLyncStatistics control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locLyncStatistics; + + /// + /// lnkLyncUsers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HyperLink lnkLyncUsers; + + /// + /// lyncUsersStats control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.QuotaViewer lyncUsersStats; /// /// sharePointStatsPanel control. @@ -309,6 +345,42 @@ namespace WebsitePanel.Portal.ExchangeServer { /// protected global::WebsitePanel.Portal.QuotaViewer siteCollectionsStats; + /// + /// ocsStatsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel ocsStatsPanel; + + /// + /// locOCSStatistics control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locOCSStatistics; + + /// + /// lnkOCSUsers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HyperLink lnkOCSUsers; + + /// + /// ocsUsersStats control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.QuotaViewer ocsUsersStats; + /// /// crmStatsPanel control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx index f3f0d5a3..710b4e40 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx @@ -62,6 +62,10 @@ + + + + @@ -205,8 +213,7 @@
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.cs index d4764986..e0130314 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.cs @@ -33,67 +33,55 @@ using Microsoft.Security.Application; namespace WebsitePanel.Portal.ExchangeServer { - public partial class ExchangeMailboxGeneralSettings : WebsitePanelModuleBase - { - protected void Page_Load(object sender, EventArgs e) - { + public partial class ExchangeMailboxGeneralSettings : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { if (!IsPostBack) { BindSettings(); } - } + + } private void BindSettings() { try { - password.SetPackagePolicy(PanelSecurity.PackageId, UserSettings.EXCHANGE_POLICY, "MailboxPasswordPolicy"); - password.EditMode = true; - // get settings ExchangeMailbox mailbox = ES.Services.ExchangeServer.GetMailboxGeneralSettings(PanelRequest.ItemID, PanelRequest.AccountID); - // title - litDisplayName.Text = mailbox.DisplayName; + //get statistics + ExchangeMailboxStatistics stats = ES.Services.ExchangeServer.GetMailboxStatistics(PanelRequest.ItemID, + PanelRequest.AccountID); + + // title + litDisplayName.Text = mailbox.DisplayName; // bind form - txtDisplayName.Text = mailbox.DisplayName; chkHideAddressBook.Checked = mailbox.HideFromAddressBook; chkDisable.Checked = mailbox.Disabled; - txtFirstName.Text = mailbox.FirstName; - txtInitials.Text = mailbox.Initials; - txtLastName.Text = mailbox.LastName; - - txtJobTitle.Text = mailbox.JobTitle; - txtCompany.Text = mailbox.Company; - txtDepartment.Text = mailbox.Department; - txtOffice.Text = mailbox.Office; - manager.SetAccount(mailbox.ManagerAccount); - - txtBusinessPhone.Text = mailbox.BusinessPhone; - txtFax.Text = mailbox.Fax; - txtHomePhone.Text = mailbox.HomePhone; - txtMobilePhone.Text = mailbox.MobilePhone; - txtPager.Text = mailbox.Pager; - txtWebPage.Text = mailbox.WebPage; - - txtAddress.Text = mailbox.Address; - txtCity.Text = mailbox.City; - txtState.Text = mailbox.State; - txtZip.Text = mailbox.Zip; - country.Country = mailbox.Country; - - txtNotes.Text = mailbox.Notes; - // get account meta ExchangeAccount account = ES.Services.ExchangeServer.GetAccount(PanelRequest.ItemID, PanelRequest.AccountID); chkPmmAllowed.Checked = (account.MailboxManagerActions & MailboxManagerActions.GeneralSettings) > 0; + + mailboxPlanSelector.MailboxPlanId = account.MailboxPlanId.ToString(); + + mailboxSize.QuotaUsedValue = Convert.ToInt32(stats.TotalSize / 1024 / 1024); + mailboxSize.QuotaValue = (int)Math.Round((double)(stats.MaxSize / 1024 / 1024)); + + if ((account.AccountType == ExchangeAccountType.Equipment) | (account.AccountType == ExchangeAccountType.Room)) + secCalendarSettings.Visible = true; + else + secCalendarSettings.Visible = false; + + } catch (Exception ex) { - messageBox.ShowErrorMessage("EXCHANGE_GET_MAILBOX_SETTINGS", ex); + messageBox.ShowErrorMessage("EXCHANGE_GET_MAILBOX_SETTINGS", ex); } } @@ -106,49 +94,29 @@ namespace WebsitePanel.Portal.ExchangeServer { int result = ES.Services.ExchangeServer.SetMailboxGeneralSettings( PanelRequest.ItemID, PanelRequest.AccountID, - txtDisplayName.Text, - password.Password, chkHideAddressBook.Checked, - chkDisable.Checked, - - txtFirstName.Text, - txtInitials.Text, - txtLastName.Text, - - txtAddress.Text, - txtCity.Text, - txtState.Text, - txtZip.Text, - country.Country, - - txtJobTitle.Text, - txtCompany.Text, - txtDepartment.Text, - txtOffice.Text, - manager.GetAccount(), - - txtBusinessPhone.Text, - txtFax.Text, - txtHomePhone.Text, - txtMobilePhone.Text, - txtPager.Text, - txtWebPage.Text, - txtNotes.Text); + chkDisable.Checked); if (result < 0) { messageBox.ShowResultMessage(result); return; } + else + { + result = ES.Services.ExchangeServer.SetExchangeMailboxPlan(PanelRequest.ItemID, PanelRequest.AccountID, Convert.ToInt32(mailboxPlanSelector.MailboxPlanId)); + if (result < 0) + { + messageBox.ShowResultMessage(result); + return; + } + } - // update title - litDisplayName.Text = AntiXss.HtmlEncode(txtDisplayName.Text); - - messageBox.ShowSuccessMessage("EXCHANGE_UPDATE_MAILBOX_SETTINGS"); + messageBox.ShowSuccessMessage("EXCHANGE_UPDATE_MAILBOX_SETTINGS"); } catch (Exception ex) { - messageBox.ShowErrorMessage("EXCHANGE_UPDATE_MAILBOX_SETTINGS", ex); + messageBox.ShowErrorMessage("EXCHANGE_UPDATE_MAILBOX_SETTINGS", ex); } } @@ -177,5 +145,33 @@ namespace WebsitePanel.Portal.ExchangeServer messageBox.ShowErrorMessage("EXCHANGE_UPDATE_MAILMANAGER", ex); } } - } + + private int ConvertMbxSizeToIntMB(string inputValue) + { + int result = 0; + + if ((inputValue == null) || (inputValue == "")) + return 0; + + if (inputValue.Contains("TB")) + { + result = Convert.ToInt32(inputValue.Replace(" TB", "")); + result = result * 1024 * 1024; + } + else + if (inputValue.Contains("GB")) + { + result = Convert.ToInt32(inputValue.Replace(" GB", "")); + result = result * 1024; + } + else + if (inputValue.Contains("MB")) + { + result = Convert.ToInt32(inputValue.Replace(" MB", "")); + } + + return result; + } + + } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.designer.cs index 0a518f20..d1dc4f60 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.1433 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ @@ -86,49 +85,31 @@ namespace WebsitePanel.Portal.ExchangeServer { protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; /// - /// locDisplayName control. + /// secGeneral control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.Localize locDisplayName; + protected global::WebsitePanel.Portal.CollapsiblePanel secGeneral; /// - /// txtDisplayName control. + /// General control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.TextBox txtDisplayName; + protected global::System.Web.UI.WebControls.Panel General; /// - /// valRequireDisplayName control. + /// GeneralUpdatePanel control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireDisplayName; - - /// - /// locPassword control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize locPassword; - - /// - /// password control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::WebsitePanel.Portal.PasswordControl password; + protected global::System.Web.UI.UpdatePanel GeneralUpdatePanel; /// /// chkHideAddressBook control. @@ -149,418 +130,67 @@ namespace WebsitePanel.Portal.ExchangeServer { protected global::System.Web.UI.WebControls.CheckBox chkDisable; /// - /// locFirstName control. + /// Localize2 control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.Localize locFirstName; + protected global::System.Web.UI.WebControls.Localize Localize2; /// - /// txtFirstName control. + /// mailboxPlanSelector control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.TextBox txtFirstName; + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.MailboxPlanSelector mailboxPlanSelector; /// - /// locInitials control. + /// locQuota control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.Localize locInitials; + protected global::System.Web.UI.WebControls.Localize locQuota; /// - /// txtInitials control. + /// mailboxSize control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.TextBox txtInitials; + protected global::WebsitePanel.Portal.QuotaViewer mailboxSize; /// - /// locLastName control. + /// secCalendarSettings control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.Localize locLastName; + protected global::WebsitePanel.Portal.CollapsiblePanel secCalendarSettings; /// - /// txtLastName control. + /// CalendarSettings control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.TextBox txtLastName; + protected global::System.Web.UI.WebControls.Panel CalendarSettings; /// - /// secCompanyInfo control. + /// UpdatePanel1 control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::WebsitePanel.Portal.CollapsiblePanel secCompanyInfo; - - /// - /// CompanyInfo control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Panel CompanyInfo; - - /// - /// locJobTitle control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize locJobTitle; - - /// - /// txtJobTitle control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox txtJobTitle; - - /// - /// locCompany control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize locCompany; - - /// - /// txtCompany control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox txtCompany; - - /// - /// locDepartment control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize locDepartment; - - /// - /// txtDepartment control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox txtDepartment; - - /// - /// locOffice control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize locOffice; - - /// - /// txtOffice control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox txtOffice; - - /// - /// locManager control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize locManager; - - /// - /// manager control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::WebsitePanel.Portal.ExchangeServer.UserControls.MailboxSelector manager; - - /// - /// secContactInfo control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::WebsitePanel.Portal.CollapsiblePanel secContactInfo; - - /// - /// ContactInfo control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Panel ContactInfo; - - /// - /// locBusinessPhone control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize locBusinessPhone; - - /// - /// txtBusinessPhone control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox txtBusinessPhone; - - /// - /// locFax control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize locFax; - - /// - /// txtFax control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox txtFax; - - /// - /// locHomePhone control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize locHomePhone; - - /// - /// txtHomePhone control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox txtHomePhone; - - /// - /// locMobilePhone control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize locMobilePhone; - - /// - /// txtMobilePhone control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox txtMobilePhone; - - /// - /// locPager control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize locPager; - - /// - /// txtPager control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox txtPager; - - /// - /// locWebPage control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize locWebPage; - - /// - /// txtWebPage control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox txtWebPage; - - /// - /// secAddressInfo control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::WebsitePanel.Portal.CollapsiblePanel secAddressInfo; - - /// - /// AddressInfo control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Panel AddressInfo; - - /// - /// locAddress control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize locAddress; - - /// - /// txtAddress control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox txtAddress; - - /// - /// locCity control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize locCity; - - /// - /// txtCity control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox txtCity; - - /// - /// locState control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize locState; - - /// - /// txtState control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox txtState; - - /// - /// locZip control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize locZip; - - /// - /// txtZip control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox txtZip; - - /// - /// locCountry control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize locCountry; - - /// - /// country control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::WebsitePanel.Portal.ExchangeServer.UserControls.CountrySelector country; - - /// - /// locNotes control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize locNotes; - - /// - /// txtNotes control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox txtNotes; + protected global::System.Web.UI.UpdatePanel UpdatePanel1; /// /// chkPmmAllowed control. diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMailFlowSettings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMailFlowSettings.ascx index f7bf243a..2a157a48 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMailFlowSettings.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMailFlowSettings.ascx @@ -106,33 +106,6 @@ - - - - - - - - - - - - - - - - - -
- -
- -
- -
-
- diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateOrganization.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateOrganization.ascx.cs index 3d738113..73fcbb7a 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateOrganization.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateOrganization.ascx.cs @@ -27,23 +27,24 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using System; +using WebsitePanel.EnterpriseServer; namespace WebsitePanel.Portal.ExchangeServer { - public partial class OrganizationCreateOrganization : WebsitePanelModuleBase - { - protected void Page_Load(object sender, EventArgs e) - { + public partial class OrganizationCreateOrganization : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + + } - } + protected void btnCreate_Click(object sender, EventArgs e) + { + CreateOrganization(); + } - protected void btnCreate_Click(object sender, EventArgs e) - { - CreateOrganization(); - } - - private void CreateOrganization() - { + private void CreateOrganization() + { if (!Page.IsValid) return; @@ -61,12 +62,12 @@ namespace WebsitePanel.Portal.ExchangeServer Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "organization_home", "ItemID=" + itemId)); - + } catch (Exception ex) { messageBox.ShowErrorMessage("ORGANIZATION_CREATE_ORG", ex); } - } - } + } + } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateOrganization.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateOrganization.ascx.designer.cs index fc70a311..45ffb4d3 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateOrganization.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateOrganization.ascx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.3053 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx index 55abf12f..5b6364e0 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateUser.ascx @@ -35,6 +35,14 @@ ErrorMessage="Enter Display Name" ValidationGroup="CreateMailbox" Display="Dynamic" Text="*" SetFocusOnError="True"> + + + +
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMailFlowSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMailFlowSettings.ascx.cs index d773c3fd..5c18d62e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMailFlowSettings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMailFlowSettings.ascx.cs @@ -38,17 +38,19 @@ using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.EnterpriseServer; namespace WebsitePanel.Portal.ExchangeServer { - public partial class ExchangeMailboxMailFlowSettings : WebsitePanelModuleBase - { + public partial class ExchangeMailboxMailFlowSettings : WebsitePanelModuleBase + { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BindSettings(); } + } private void BindSettings() @@ -59,8 +61,8 @@ namespace WebsitePanel.Portal.ExchangeServer ExchangeMailbox mailbox = ES.Services.ExchangeServer.GetMailboxMailFlowSettings( PanelRequest.ItemID, PanelRequest.AccountID); - // title - litDisplayName.Text = mailbox.DisplayName; + // title + litDisplayName.Text = mailbox.DisplayName; // bind form chkEnabledForwarding.Checked = mailbox.EnableForwarding; @@ -73,12 +75,8 @@ namespace WebsitePanel.Portal.ExchangeServer chkSendersAuthenticated.Checked = mailbox.RequireSenderAuthentication; rejectAccounts.SetAccounts(mailbox.RejectAccounts); - sizeMaxRecipients.ValueKB = mailbox.MaxRecipients; - sizeMaxSendingSize.ValueKB = mailbox.MaxSendMessageSizeKB; - sizeMaxReceivingSize.ValueKB = mailbox.MaxReceiveMessageSizeKB; - - // toggle - ToggleControls(); + // toggle + ToggleControls(); // get account meta ExchangeAccount account = ES.Services.ExchangeServer.GetAccount(PanelRequest.ItemID, PanelRequest.AccountID); @@ -87,7 +85,7 @@ namespace WebsitePanel.Portal.ExchangeServer } catch (Exception ex) { - messageBox.ShowErrorMessage("EXCHANGE_GET_MAILBOX_MAILFLOW", ex); + messageBox.ShowErrorMessage("EXCHANGE_GET_MAILBOX_MAILFLOW", ex); } } @@ -106,12 +104,8 @@ namespace WebsitePanel.Portal.ExchangeServer chkDoNotDeleteOnForward.Checked, accessAccounts.GetAccounts(), - acceptAccounts.GetAccounts(), - rejectAccounts.GetAccounts(), - - sizeMaxRecipients.ValueKB, - sizeMaxSendingSize.ValueKB, - sizeMaxReceivingSize.ValueKB, + acceptAccounts.GetAccounts(), + rejectAccounts.GetAccounts(), chkSendersAuthenticated.Checked); @@ -121,11 +115,11 @@ namespace WebsitePanel.Portal.ExchangeServer return; } - messageBox.ShowSuccessMessage("EXCHANGE_UPDATE_MAILBOX_MAILFLOW"); + messageBox.ShowSuccessMessage("EXCHANGE_UPDATE_MAILBOX_MAILFLOW"); } catch (Exception ex) { - messageBox.ShowErrorMessage("EXCHANGE_UPDATE_MAILBOX_MAILFLOW", ex); + messageBox.ShowErrorMessage("EXCHANGE_UPDATE_MAILBOX_MAILFLOW", ex); } } @@ -134,15 +128,15 @@ namespace WebsitePanel.Portal.ExchangeServer SaveSettings(); } - private void ToggleControls() - { - ForwardSettingsPanel.Visible = chkEnabledForwarding.Checked; - } + private void ToggleControls() + { + ForwardSettingsPanel.Visible = chkEnabledForwarding.Checked; + } - protected void chkEnabledForwarding_CheckedChanged(object sender, EventArgs e) - { - ToggleControls(); - } + protected void chkEnabledForwarding_CheckedChanged(object sender, EventArgs e) + { + ToggleControls(); + } protected void chkPmmAllowed_CheckedChanged(object sender, EventArgs e) { @@ -164,5 +158,5 @@ namespace WebsitePanel.Portal.ExchangeServer messageBox.ShowErrorMessage("EXCHANGE_UPDATE_MAILMANAGER", ex); } } - } + } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMailFlowSettings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMailFlowSettings.ascx.designer.cs index 9df7fac9..85e73719 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMailFlowSettings.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMailFlowSettings.ascx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.1433 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ @@ -256,78 +255,6 @@ namespace WebsitePanel.Portal.ExchangeServer { /// protected global::WebsitePanel.Portal.ExchangeServer.UserControls.RejectedSenders rejectAccounts; - /// - /// secDeliveryOptions control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::WebsitePanel.Portal.CollapsiblePanel secDeliveryOptions; - - /// - /// DeliveryOptions control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Panel DeliveryOptions; - - /// - /// locMaxRecipients control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize locMaxRecipients; - - /// - /// sizeMaxRecipients control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::WebsitePanel.Portal.ExchangeServer.UserControls.SizeBox sizeMaxRecipients; - - /// - /// locMaxSendingSize control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize locMaxSendingSize; - - /// - /// sizeMaxSendingSize control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::WebsitePanel.Portal.ExchangeServer.UserControls.SizeBox sizeMaxSendingSize; - - /// - /// locMaxReceivingSize control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize locMaxReceivingSize; - - /// - /// sizeMaxReceivingSize control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::WebsitePanel.Portal.ExchangeServer.UserControls.SizeBox sizeMaxReceivingSize; - /// /// chkPmmAllowed control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMobile.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMobile.ascx.cs index 43b26275..53685834 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMobile.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMobile.ascx.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2012, Outercurve Foundation. +// Copyright (c) 2011, Outercurve Foundation. // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, @@ -33,6 +33,7 @@ using System.Web.UI; using System.Web.UI.WebControls; using System.Drawing; using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.EnterpriseServer; namespace WebsitePanel.Portal.ExchangeServer { @@ -51,22 +52,23 @@ namespace WebsitePanel.Portal.ExchangeServer gvMobile.DataSource = devices; gvMobile.DataBind(); - // form title - ExchangeAccount account = ES.Services.ExchangeServer.GetAccount(PanelRequest.ItemID, PanelRequest.AccountID); - litDisplayName.Text = account.DisplayName; + // form title + ExchangeAccount account = ES.Services.ExchangeServer.GetAccount(PanelRequest.ItemID, PanelRequest.AccountID); + litDisplayName.Text = account.DisplayName; } - + protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { - // ExchangeMailbox mailbox = ES.Services.ExchangeServer.GetMailboxGeneralSettings(PanelRequest.ItemID, PanelRequest.AccountID); + // ExchangeMailbox mailbox = ES.Services.ExchangeServer.GetMailboxGeneralSettings(PanelRequest.ItemID, PanelRequest.AccountID); - // if (mailbox != null) - // litDisplayName.Text = mailbox.DisplayName; + // if (mailbox != null) + // litDisplayName.Text = mailbox.DisplayName; BindGrid(); } + } protected void gvMobile_RowCommand(object sender, GridViewCommandEventArgs e) @@ -103,7 +105,7 @@ namespace WebsitePanel.Portal.ExchangeServer if (lblStatus != null) { switch (current.Status) - { + { case MobileDeviceStatus.PendingWipe: lblStatus.ForeColor = Color.Red; lblStatus.Text = GetLocalizedString(PendingWipe); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMobile.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMobile.ascx.designer.cs index 8df461d6..6cc0a273 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMobile.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMobile.ascx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.4927 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMobileDetails.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMobileDetails.ascx.cs index 27a9c927..8383b5d0 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMobileDetails.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMobileDetails.ascx.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2012, Outercurve Foundation. +// Copyright (c) 2011, Outercurve Foundation. // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, @@ -33,6 +33,7 @@ using System.Web.UI; using System.Web.UI.WebControls; using WebsitePanel.Providers.HostedSolution; using System.Drawing; +using WebsitePanel.EnterpriseServer; namespace WebsitePanel.Portal.ExchangeServer { @@ -48,26 +49,26 @@ namespace WebsitePanel.Portal.ExchangeServer if (device != null) { lblStatus.Text = GetLocalizedString(device.Status.ToString()); - switch (device.Status) - { - case MobileDeviceStatus.PendingWipe: - lblStatus.ForeColor = Color.Red; - break; - case MobileDeviceStatus.WipeSuccessful: - lblStatus.ForeColor = Color.Green; - break; - default: - lblStatus.ForeColor = Color.Black; - break; - } + switch (device.Status) + { + case MobileDeviceStatus.PendingWipe: + lblStatus.ForeColor = Color.Red; + break; + case MobileDeviceStatus.WipeSuccessful: + lblStatus.ForeColor = Color.Green; + break; + default: + lblStatus.ForeColor = Color.Black; + break; + } lblDeviceModel.Text = device.DeviceModel; lblDeviceType.Text = device.DeviceType; - lblFirstSyncTime.Text = DateTimeToString(device.FirstSyncTime); - lblDeviceWipeRequestTime.Text = DateTimeToString(device.DeviceWipeRequestTime); - lblDeviceAcnowledgeTime.Text = DateTimeToString(device.DeviceWipeAckTime); - lblLastSync.Text = DateTimeToString(device.LastSyncAttemptTime); - lblLastUpdate.Text = DateTimeToString(device.LastPolicyUpdateTime); - lblLastPing.Text = device.LastPingHeartbeat == 0 ? string.Empty : device.LastPingHeartbeat.ToString(); + lblFirstSyncTime.Text = DateTimeToString(device.FirstSyncTime); + lblDeviceWipeRequestTime.Text = DateTimeToString(device.DeviceWipeRequestTime); + lblDeviceAcnowledgeTime.Text = DateTimeToString(device.DeviceWipeAckTime); + lblLastSync.Text = DateTimeToString(device.LastSyncAttemptTime); + lblLastUpdate.Text = DateTimeToString(device.LastPolicyUpdateTime); + lblLastPing.Text = device.LastPingHeartbeat == 0 ? string.Empty : device.LastPingHeartbeat.ToString(); lblDeviceFriendlyName.Text = device.DeviceFriendlyName; lblDeviceId.Text = device.DeviceID; lblDeviceUserAgent.Text = device.DeviceUserAgent; @@ -78,20 +79,22 @@ namespace WebsitePanel.Portal.ExchangeServer UpdateButtons(device.Status); - // form title - ExchangeAccount account = ES.Services.ExchangeServer.GetAccount(PanelRequest.ItemID, PanelRequest.AccountID); - litDisplayName.Text = account.DisplayName; - } + // form title + ExchangeAccount account = ES.Services.ExchangeServer.GetAccount(PanelRequest.ItemID, PanelRequest.AccountID); + litDisplayName.Text = account.DisplayName; + } + } + + private string DateTimeToString(DateTime dateTime) + { + return dateTime == DateTime.MinValue ? string.Empty : dateTime.ToString("g"); } - private string DateTimeToString(DateTime dateTime) - { - return dateTime == DateTime.MinValue ? string.Empty : dateTime.ToString("g"); - } - protected void Page_Load(object sender, EventArgs e) { BindData(); + + } private void UpdateButtons(MobileDeviceStatus status) @@ -111,12 +114,12 @@ namespace WebsitePanel.Portal.ExchangeServer { btnWipeAllData.Visible = false; btnCancel.Visible = false; - } + } } protected void btnBack_Click(object sender, EventArgs e) - { - string str = EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "mailbox_mobile", + { + string str = EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "mailbox_mobile", "ItemID=" + PanelRequest.ItemID, "AccountID=" + PanelRequest.AccountID); Response.Redirect(str); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMobileDetails.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMobileDetails.ascx.designer.cs index c0e0ced4..985bf499 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMobileDetails.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxMobileDetails.ascx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.4927 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxPermissions.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxPermissions.ascx.cs index 1c6a3211..7e03f6a8 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxPermissions.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxPermissions.ascx.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2012, Outercurve Foundation. +// Copyright (c) 2011, Outercurve Foundation. // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, @@ -28,6 +28,7 @@ using System; using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.EnterpriseServer; namespace WebsitePanel.Portal.ExchangeServer { @@ -37,8 +38,9 @@ namespace WebsitePanel.Portal.ExchangeServer { if (!IsPostBack) BindPermissions(); + } - + protected void btnSave_Click(object sender, EventArgs e) { @@ -56,15 +58,15 @@ namespace WebsitePanel.Portal.ExchangeServer sendAsPermission.SetAccounts(mailbox.SendAsAccounts); fullAccessPermission.SetAccounts(mailbox.FullAccessAccounts); } - catch(Exception ex) + catch (Exception ex) { messageBox.ShowErrorMessage("EXCHANGE_GET_MAILBOX_PERMISSIONS", ex); } } - + private void SavePermissions() - { + { try { string[] fullAccess = fullAccessPermission.GetAccounts(); @@ -72,16 +74,16 @@ namespace WebsitePanel.Portal.ExchangeServer int result = ES.Services.ExchangeServer.SetMailboxPermissions(PanelRequest.ItemID, PanelRequest.AccountID, sendAs, fullAccess); - - + + if (result < 0) { messageBox.ShowResultMessage(result); return; } - - + + messageBox.ShowSuccessMessage("EXCHANGE_UPDATE_MAILBOX_PERMISSIONS"); } catch (Exception ex) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxPermissions.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxPermissions.ascx.designer.cs index fe2d3298..4959b0c5 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxPermissions.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxPermissions.ascx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.1433 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxPlans.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxPlans.ascx new file mode 100644 index 00000000..460aa9de --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxPlans.ascx @@ -0,0 +1,73 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ExchangeMailboxPlans.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.ExchangeMailboxPlans" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/QuotaViewer.ascx" TagName="QuotaViewer" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + +
+
+
+ +
+
+ +
+
+
+
+ + +
+
+ + +
+ +
+ + + + + + + + <%# Eval("MailboxPlan")%> + + + + + +
+ /> +
+
+
+ + +   + + +
+
+
+
+ +
+ +
+
+
+ +
+
+
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxPlans.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxPlans.ascx.cs new file mode 100644 index 00000000..3cf6d8d0 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxPlans.ascx.cs @@ -0,0 +1,126 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +using System; +using System.Web.UI.WebControls; +using WebsitePanel.EnterpriseServer; +using WebsitePanel.Providers.HostedSolution; + +namespace WebsitePanel.Portal.ExchangeServer +{ + public partial class ExchangeMailboxPlans : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + // bind mailboxplans + BindMailboxPlans(); + } + + } + + public string GetMailboxPlanDisplayUrl(string MailboxPlanId) + { + return EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "add_mailboxplan", + "MailboxPlanId=" + MailboxPlanId, + "ItemID=" + PanelRequest.ItemID); + } + + + private void BindMailboxPlans() + { + ExchangeMailboxPlan[] list = ES.Services.ExchangeServer.GetExchangeMailboxPlans(PanelRequest.ItemID); + + gvMailboxPlans.DataSource = list; + gvMailboxPlans.DataBind(); + + //check if organization has only one default domain + if (gvMailboxPlans.Rows.Count == 1) + { + btnSetDefaultMailboxPlan.Enabled = false; + } + } + + public string IsChecked(bool val) + { + return val ? "checked" : ""; + } + + protected void btnAddMailboxPlan_Click(object sender, EventArgs e) + { + btnSetDefaultMailboxPlan.Enabled = true; + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "add_mailboxplan", + "SpaceID=" + PanelSecurity.PackageId)); + } + + protected void gvMailboxPlan_RowCommand(object sender, GridViewCommandEventArgs e) + { + if (e.CommandName == "DeleteItem") + { + int mailboxPlanId = Utils.ParseInt(e.CommandArgument.ToString(), 0); + + try + { + int result = ES.Services.ExchangeServer.DeleteExchangeMailboxPlan(PanelRequest.ItemID, mailboxPlanId); + + if (result < 0) + { + messageBox.ShowResultMessage(result); + return; + } + + } + catch (Exception) + { + messageBox.ShowErrorMessage("EXCHANGE_DELETE_MAILBOXPLAN"); + } + + BindMailboxPlans(); + } + } + + protected void btnSetDefaultMailboxPlan_Click(object sender, EventArgs e) + { + // get domain + int mailboxPlanId = Utils.ParseInt(Request.Form["DefaultMailboxPlan"], 0); + + try + { + ES.Services.ExchangeServer.SetOrganizationDefaultExchangeMailboxPlan(PanelRequest.ItemID, mailboxPlanId); + + // rebind domains + BindMailboxPlans(); + } + catch (Exception ex) + { + ShowErrorMessage("EXCHANGE_SET_DEFAULT_MAILBOXPLAN", ex); + } + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/Exchange2010SP1_Settings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxPlans.ascx.designer.cs similarity index 53% rename from WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/Exchange2010SP1_Settings.ascx.designer.cs rename to WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxPlans.ascx.designer.cs index 9eb2d1e9..cd76a5ae 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/Exchange2010SP1_Settings.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxPlans.ascx.designer.cs @@ -7,126 +7,99 @@ // //------------------------------------------------------------------------------ -namespace WebsitePanel.Portal.ProviderControls { +namespace WebsitePanel.Portal.ExchangeServer { - public partial class Exchange2010SP1_Settings { + public partial class ExchangeMailboxPlans { /// - /// locOrganizationTemplate control. + /// asyncTasks control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.Localize locOrganizationTemplate; + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; /// - /// locProgramID control. + /// breadcrumb control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.Localize locProgramID; + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Breadcrumb breadcrumb; /// - /// programID control. + /// menu control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.TextBox programID; + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Menu menu; /// - /// requireProgramID control. + /// Image1 control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.RequiredFieldValidator requireProgramID; + protected global::System.Web.UI.WebControls.Image Image1; /// - /// locOfferID control. + /// locTitle control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.Localize locOfferID; + protected global::System.Web.UI.WebControls.Localize locTitle; /// - /// offerID control. + /// messageBox control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.TextBox offerID; + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; /// - /// requireOfferID control. + /// btnAddMailboxPlan control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.RequiredFieldValidator requireOfferID; + protected global::System.Web.UI.WebControls.Button btnAddMailboxPlan; /// - /// locDomainTemplates control. + /// gvMailboxPlans control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.Localize locDomainTemplates; + protected global::System.Web.UI.WebControls.GridView gvMailboxPlans; /// - /// locTemporaryDomain control. + /// btnSetDefaultMailboxPlan control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.Localize locTemporaryDomain; + protected global::System.Web.UI.WebControls.Button btnSetDefaultMailboxPlan; /// - /// temporaryDomain control. + /// FormComments control. /// /// /// Auto-generated field. /// To modify move field declaration from designer file to code-behind file. /// - protected global::System.Web.UI.WebControls.TextBox temporaryDomain; - - /// - /// locEcpURL control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize locEcpURL; - - /// - /// ecpURL control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.TextBox ecpURL; - - /// - /// locEcpURLDescr control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize locEcpURLDescr; + protected global::System.Web.UI.WebControls.Localize FormComments; } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxSetupInstructions.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxSetupInstructions.ascx.cs index cd141527..5a868594 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxSetupInstructions.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxSetupInstructions.ascx.cs @@ -32,13 +32,14 @@ using WebsitePanel.EnterpriseServer; namespace WebsitePanel.Portal.ExchangeServer { public partial class ExchangeMailboxSetupInstructions : WebsitePanelModuleBase - { + { protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { BindInstructions(); } + } private void BindInstructions() @@ -56,7 +57,7 @@ namespace WebsitePanel.Portal.ExchangeServer // load user details UserInfo user = ES.Services.Users.GetUserById(package.UserId); txtTo.Text = user.Email; - + } protected void btnSend_Click(object sender, EventArgs e) @@ -81,5 +82,5 @@ namespace WebsitePanel.Portal.ExchangeServer return; } } - } + } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxSetupInstructions.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxSetupInstructions.ascx.designer.cs index f66a0fb3..b0cb1cf2 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxSetupInstructions.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxSetupInstructions.ascx.designer.cs @@ -1,22 +1,15 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.1378 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace WebsitePanel.Portal.ExchangeServer { - /// - /// ExchangeMailboxSetupInstructions class. - /// - /// - /// Auto-generated class. - /// public partial class ExchangeMailboxSetupInstructions { /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx index 6abb6ddf..03ffcb8f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxes.ascx @@ -31,22 +31,12 @@
- - 10 - 20 - 50 - - 100 - - - DisplayName - Email - AccountName - - DisplayName + Email + AccountName + Subscriber Number +
@@ -55,10 +45,10 @@ + DataSourceID="odsAccountsPaged"> - + - + + + protected global::System.Web.UI.WebControls.Panel SearchPanel; - /// - /// ddlPageSize control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.DropDownList ddlPageSize; - /// /// ddlSearchColumn control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeStorageLimits.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeStorageLimits.ascx deleted file mode 100644 index 34b14a98..00000000 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeStorageLimits.ascx +++ /dev/null @@ -1,91 +0,0 @@ -<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ExchangeStorageLimits.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.ExchangeStorageLimits" %> -<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> -<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> -<%@ Register Src="UserControls/SizeBox.ascx" TagName="SizeBox" TagPrefix="wsp" %> -<%@ Register Src="UserControls/DaysBox.ascx" TagName="DaysBox" TagPrefix="wsp" %> -<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> -<%@ Register TagPrefix="wsp" TagName="CollapsiblePanel" Src="../UserControls/CollapsiblePanel.ascx" %> -<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> - - - -
-
-
- -
-
- -
-
-
-
- - -
-
- - - - - - - - - - - - - - - - - - - - - -
- -
- -
- -
-
-
- - - - - - - - - - -
- -
-
-
- -
- - - -
- -
-
-
- -
-
-
-
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeStorageLimits.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeStorageLimits.ascx.cs deleted file mode 100644 index ca7afd16..00000000 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeStorageLimits.ascx.cs +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) 2012, Outercurve Foundation. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// - Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// - Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// - Neither the name of the Outercurve Foundation nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -using System; -using System.Data; -using System.Configuration; -using System.Collections; -using System.Web; -using System.Web.Security; -using System.Web.UI; -using System.Web.UI.WebControls; -using System.Web.UI.WebControls.WebParts; -using System.Web.UI.HtmlControls; - - -using WebsitePanel.Providers.HostedSolution; - -namespace WebsitePanel.Portal.ExchangeServer -{ - public partial class ExchangeStorageLimits : WebsitePanelModuleBase - { - protected void Page_Load(object sender, EventArgs e) - { - if (!IsPostBack) - { - BindLimits(); - } - } - - protected void btnSave_Click(object sender, EventArgs e) - { - SaveLimits(false); - } - - protected void btnSaveApply_Click(object sender, EventArgs e) - { - SaveLimits(true); - } - - private void BindLimits() - { - try - { - // read limits - Organization org = ES.Services.ExchangeServer.GetOrganizationStorageLimits( - PanelRequest.ItemID); - - - // bind data - sizeIssueWarning.ValueKB = org.IssueWarningKB; - sizeProhibitSend.ValueKB = org.ProhibitSendKB; - sizeProhibitSendReceive.ValueKB = org.ProhibitSendReceiveKB; - - daysKeepDeletedItems.ValueDays = org.KeepDeletedItemsDays; - } - catch (Exception ex) - { - messageBox.ShowErrorMessage("EXCHANGE_GET_ORG_LIMITS", ex); - } - } - - private void SaveLimits(bool applyToMailboxes) - { - if (!Page.IsValid) - return; - - try - { - if (((sizeIssueWarning.ValueKB <= sizeProhibitSend.ValueKB && sizeIssueWarning.ValueKB != -1) || sizeProhibitSend.ValueKB == -1) - && ((sizeProhibitSend.ValueKB <= sizeProhibitSendReceive.ValueKB && sizeProhibitSend.ValueKB != -1) || sizeProhibitSendReceive.ValueKB == -1)) - { - // set limits - int result = ES.Services.ExchangeServer.SetOrganizationStorageLimits(PanelRequest.ItemID, - sizeIssueWarning.ValueKB, - sizeProhibitSend.ValueKB, - sizeProhibitSendReceive.ValueKB, - daysKeepDeletedItems.ValueDays, - applyToMailboxes); - - if (result < 0) - { - messageBox.ShowResultMessage(result); - return; - } - - messageBox.ShowSuccessMessage("EXCHANGE_SET_ORG_LIMITS"); - } - else - { - messageBox.ShowErrorMessage("EXCHANGE_SET_ORG_LIMITS_VALIDATION"); - } - } - catch (Exception ex) - { - messageBox.ShowErrorMessage("EXCHANGE_SET_ORG_LIMITS", ex); - } - } - } -} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeStorageLimits.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeStorageLimits.ascx.designer.cs deleted file mode 100644 index 47fc5eee..00000000 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeStorageLimits.ascx.designer.cs +++ /dev/null @@ -1,223 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:2.0.50727.3053 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace WebsitePanel.Portal.ExchangeServer { - - - public partial class ExchangeStorageLimits { - - /// - /// 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; - - /// - /// secStorageLimits control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::WebsitePanel.Portal.CollapsiblePanel secStorageLimits; - - /// - /// StorageLimits control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Panel StorageLimits; - - /// - /// locWhenSizeExceeds control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize locWhenSizeExceeds; - - /// - /// locIssueWarning control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize locIssueWarning; - - /// - /// sizeIssueWarning control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::WebsitePanel.Portal.ExchangeServer.UserControls.SizeBox sizeIssueWarning; - - /// - /// locProhibitSend control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize locProhibitSend; - - /// - /// sizeProhibitSend control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::WebsitePanel.Portal.ExchangeServer.UserControls.SizeBox sizeProhibitSend; - - /// - /// locProhibitSendReceive control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize locProhibitSendReceive; - - /// - /// sizeProhibitSendReceive control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::WebsitePanel.Portal.ExchangeServer.UserControls.SizeBox sizeProhibitSendReceive; - - /// - /// secDeletionSettings control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::WebsitePanel.Portal.CollapsiblePanel secDeletionSettings; - - /// - /// DeletionSettings control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Panel DeletionSettings; - - /// - /// locKeepDeletedItems control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Localize locKeepDeletedItems; - - /// - /// daysKeepDeletedItems control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::WebsitePanel.Portal.ExchangeServer.UserControls.DaysBox daysKeepDeletedItems; - - /// - /// 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; - - /// - /// btnSaveApply control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.Button btnSaveApply; - - /// - /// 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/ExchangeServer/ExchangeStorageUsage.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeStorageUsage.ascx index e5cadbd0..5c78089b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeStorageUsage.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeStorageUsage.ascx @@ -28,7 +28,7 @@ - + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeStorageUsage.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeStorageUsage.ascx.cs index a487897e..6a70ca68 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeStorageUsage.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeStorageUsage.ascx.cs @@ -29,38 +29,40 @@ using System; using System.Web; using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.EnterpriseServer; namespace WebsitePanel.Portal.ExchangeServer { - public partial class ExchangeStorageUsage : WebsitePanelModuleBase - { - protected void Page_Load(object sender, EventArgs e) - { - if (!IsPostBack) - { - // bind quotas - BindQuotas(); - - - } - } + public partial class ExchangeStorageUsage : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + // bind quotas + BindQuotas(); - private void BindQuotas() - { - OrganizationStatistics stats = ES.Services.ExchangeServer.GetOrganizationStatistics(PanelRequest.ItemID); - btnUsedSize.Text = stats.UsedDiskSpace.ToString(); - } + } - protected void btnRecalculate_Click(object sender, EventArgs e) - { - ES.Services.ExchangeServer.CalculateOrganizationDiskspace(PanelRequest.ItemID); - } + } + + private void BindQuotas() + { + OrganizationStatistics stats = ES.Services.ExchangeServer.GetOrganizationStatistics(PanelRequest.ItemID); + + btnUsedSize.Text = stats.UsedDiskSpace.ToString(); + } + + protected void btnRecalculate_Click(object sender, EventArgs e) + { + ES.Services.ExchangeServer.CalculateOrganizationDiskspace(PanelRequest.ItemID); + } protected void btnUsedSize_Click(object sender, EventArgs e) { HttpContext.Current.Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "storage_usage_details", - "SpaceID=" + PanelSecurity.PackageId.ToString())); + "SpaceID=" + PanelSecurity.PackageId.ToString())); } - } + } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeStorageUsage.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeStorageUsage.ascx.designer.cs index 3f32adf0..8e7a159d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeStorageUsage.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeStorageUsage.ascx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.1433 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeStorageUsageBreakdown.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeStorageUsageBreakdown.ascx index 40e8b55b..8bcdb3be 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeStorageUsageBreakdown.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeStorageUsageBreakdown.ascx @@ -53,41 +53,6 @@

- - - - - - - - - - - -  <%# Utils.FormatDateTime((DateTime)Eval("LastAccessTime"))%> - - -  <%# Utils.FormatDateTime((DateTime)Eval("LastModificationTime")) %> - - - -
- - - - - - - - - -
177
100
-
-
- -
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeStorageUsageBreakdown.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeStorageUsageBreakdown.ascx.cs index 2fdceccc..65246294 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeStorageUsageBreakdown.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeStorageUsageBreakdown.ascx.cs @@ -38,56 +38,40 @@ using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.EnterpriseServer; namespace WebsitePanel.Portal.ExchangeServer { - public partial class ExchangeStorageUsageBreakdown : WebsitePanelModuleBase - { - protected void Page_Load(object sender, EventArgs e) - { - if (!IsPostBack) - { - BindStatistics(); - } - } + public partial class ExchangeStorageUsageBreakdown : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + BindStatistics(); + } - private void BindStatistics() - { - // total counters - int totalMailboxItems = 0; - int totalMailboxesSizeMB = 0; - int totalFolderItems = 0; - int totalFoldersSizeMB = 0; + } - // mailboxes - ExchangeItemStatistics[] mailboxes = ES.Services.ExchangeServer.GetMailboxesStatistics(PanelRequest.ItemID); - gvMailboxes.DataSource = mailboxes; - gvMailboxes.DataBind(); + private void BindStatistics() + { + // total counters + int totalMailboxItems = 0; + int totalMailboxesSizeMB = 0; - foreach (ExchangeItemStatistics item in mailboxes) - { - totalMailboxItems += item.TotalItems; - totalMailboxesSizeMB += item.TotalSizeMB; - } + // mailboxes + ExchangeItemStatistics[] mailboxes = ES.Services.ExchangeServer.GetMailboxesStatistics(PanelRequest.ItemID); + gvMailboxes.DataSource = mailboxes; + gvMailboxes.DataBind(); - lblTotalMailboxItems.Text = totalMailboxItems.ToString(); - lblTotalMailboxSize.Text = totalMailboxesSizeMB.ToString(); + foreach (ExchangeItemStatistics item in mailboxes) + { + totalMailboxItems += item.TotalItems; + totalMailboxesSizeMB += item.TotalSizeMB; + } - - - // public folders - ExchangeItemStatistics[] folders = ES.Services.ExchangeServer.GetPublicFoldersStatistics(PanelRequest.ItemID); - gvFolders.DataSource = folders; - gvFolders.DataBind(); - - foreach (ExchangeItemStatistics item in folders) - { - totalFolderItems += item.TotalItems; - totalFoldersSizeMB += item.TotalSizeMB; - } - - lblTotalFolderItems.Text = totalFolderItems.ToString(); - lblTotalFolderSize.Text = totalFoldersSizeMB.ToString(); - } - } + lblTotalMailboxItems.Text = totalMailboxItems.ToString(); + lblTotalMailboxSize.Text = totalMailboxesSizeMB.ToString(); + } + } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeStorageUsageBreakdown.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeStorageUsageBreakdown.ascx.designer.cs index 55d38f33..178be03f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeStorageUsageBreakdown.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeStorageUsageBreakdown.ascx.designer.cs @@ -1,35 +1,132 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.42 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace WebsitePanel.Portal.ExchangeServer { + public partial class ExchangeStorageUsageBreakdown { - protected WebsitePanel.Portal.ExchangeServer.UserControls.Breadcrumb breadcrumb; - protected WebsitePanel.Portal.ExchangeServer.UserControls.Menu menu; - protected System.Web.UI.WebControls.Image Image1; - protected System.Web.UI.WebControls.Localize locTitle; - protected WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; - protected WebsitePanel.Portal.CollapsiblePanel secMailboxesReport; - protected System.Web.UI.WebControls.Panel MailboxesReport; - protected System.Web.UI.WebControls.GridView gvMailboxes; - protected System.Web.UI.WebControls.Localize locTotalMailboxItems; - protected System.Web.UI.WebControls.Label lblTotalMailboxItems; - protected System.Web.UI.WebControls.Localize locTotalMailboxesSize; - protected System.Web.UI.WebControls.Label lblTotalMailboxSize; - protected WebsitePanel.Portal.CollapsiblePanel secPublicFoldersReport; - protected System.Web.UI.WebControls.Panel PublicFoldersReport; - protected System.Web.UI.WebControls.GridView gvFolders; - protected System.Web.UI.WebControls.Localize locTotalFolderItems; - protected System.Web.UI.WebControls.Label lblTotalFolderItems; - protected System.Web.UI.WebControls.Localize locTotalFoldersSize; - protected System.Web.UI.WebControls.Label lblTotalFolderSize; - protected System.Web.UI.WebControls.Localize FormComments; + + /// + /// 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; + + /// + /// secMailboxesReport control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secMailboxesReport; + + /// + /// MailboxesReport control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel MailboxesReport; + + /// + /// gvMailboxes control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvMailboxes; + + /// + /// locTotalMailboxItems control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTotalMailboxItems; + + /// + /// lblTotalMailboxItems control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblTotalMailboxItems; + + /// + /// locTotalMailboxesSize control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTotalMailboxesSize; + + /// + /// lblTotalMailboxSize control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblTotalMailboxSize; + + /// + /// FormComments control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize FormComments; } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateOrganization.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateOrganization.ascx index 4cd6922b..9f2fc04a 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateOrganization.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationCreateOrganization.ascx @@ -33,12 +33,13 @@
- + *
+ + +
@@ -52,15 +60,6 @@
- - - - - - -
- -
// This code was generated by a tool. -// Runtime Version:2.0.50727.1433 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ @@ -94,6 +93,33 @@ namespace WebsitePanel.Portal.HostedSolution { /// protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireDisplayName; + /// + /// locSubscriberNumber control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locSubscriberNumber; + + /// + /// txtSubscriberNumber control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtSubscriberNumber; + + /// + /// valRequireSubscriberNumber control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireSubscriberNumber; + /// /// locAccount control. /// @@ -130,24 +156,6 @@ namespace WebsitePanel.Portal.HostedSolution { /// protected global::WebsitePanel.Portal.PasswordControl password; - /// - /// chkSendInstructions control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.CheckBox chkSendInstructions; - - /// - /// sendInstructionEmail control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::WebsitePanel.Portal.UserControls.EmailControl sendInstructionEmail; - /// /// btnCreate control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx index e6dd021e..c4e91458 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx @@ -54,6 +54,7 @@ Text="Organization Statistics">
@@ -70,18 +72,6 @@
- -
-   -
@@ -114,25 +104,48 @@
- + - +
- -
-   -
+ +
+ + + +
+ +
+ + + +
-   + + +
+ + +
+ +

@@ -83,6 +87,10 @@
- - +
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs index c58697a3..1f2131dd 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs @@ -30,37 +30,51 @@ using System; using WebsitePanel.EnterpriseServer; using WebsitePanel.Providers.HostedSolution; using Microsoft.Security.Application; +using WebsitePanel.Providers.ResultObjects; namespace WebsitePanel.Portal.HostedSolution { - public partial class UserGeneralSettings : WebsitePanelModuleBase - { - protected void Page_Load(object sender, EventArgs e) - { + public partial class UserGeneralSettings : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { if (!IsPostBack) { BindSettings(); + } - } + } private void BindSettings() { try { password.SetPackagePolicy(PanelSecurity.PackageId, UserSettings.EXCHANGE_POLICY, "MailboxPasswordPolicy"); - password.EditMode = true; + PasswordPolicyResult passwordPolicy = ES.Services.Organizations.GetPasswordPolicy(PanelRequest.ItemID); + if (passwordPolicy.IsSuccess) + { + password.MinimumLength = passwordPolicy.Value.MinLength; + if (passwordPolicy.Value.IsComplexityEnable) + { + password.MinimumNumbers = 1; + password.MinimumSymbols = 1; + password.MinimumUppercase = 1; + } + } + + password.EditMode = password.ValidationEnabled = false; // get settings OrganizationUser user = ES.Services.Organizations.GetUserGeneralSettings(PanelRequest.ItemID, PanelRequest.AccountID); - litDisplayName.Text = AntiXss.HtmlEncode(user.DisplayName); + litDisplayName.Text = AntiXss.HtmlEncode(user.DisplayName); lblUserDomainName.Text = user.DomainUserName; - + // bind form txtDisplayName.Text = user.DisplayName; - + chkDisable.Checked = user.Disabled; txtFirstName.Text = user.FirstName; @@ -92,17 +106,29 @@ namespace WebsitePanel.Portal.HostedSolution txtExternalEmailAddress.Enabled = user.AccountType == ExchangeAccountType.User; lblUserDomainName.Text = user.DomainUserName; + txtSubscriberNumber.Text = user.SubscriberNumber; + + PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); + if (cntx.Quotas.ContainsKey(Quotas.EXCHANGE2007_ISCONSUMER)) + { + if (cntx.Quotas[Quotas.EXCHANGE2007_ISCONSUMER].QuotaAllocatedValue != 1) + { + locSubscriberNumber.Visible = false; + txtSubscriberNumber.Visible = false; + } + } + if (user.Locked) chkLocked.Enabled = true; else chkLocked.Enabled = false; - + chkLocked.Checked = user.Locked; - + } catch (Exception ex) { - messageBox.ShowErrorMessage("ORGANIZATION_GET_USER_SETTINGS", ex); + messageBox.ShowErrorMessage("ORGANIZATION_GET_USER_SETTINGS", ex); } } @@ -111,40 +137,46 @@ namespace WebsitePanel.Portal.HostedSolution if (!Page.IsValid) return; + string pwd = password.Password; + + if (!chkSetPassword.Checked) + pwd = string.Empty; + try { int result = ES.Services.Organizations.SetUserGeneralSettings( PanelRequest.ItemID, PanelRequest.AccountID, txtDisplayName.Text, - password.Password, + pwd, false, chkDisable.Checked, chkLocked.Checked, - + txtFirstName.Text, txtInitials.Text, txtLastName.Text, - + txtAddress.Text, txtCity.Text, txtState.Text, txtZip.Text, country.Country, - + txtJobTitle.Text, txtCompany.Text, txtDepartment.Text, txtOffice.Text, manager.GetAccount(), - + txtBusinessPhone.Text, txtFax.Text, txtHomePhone.Text, txtMobilePhone.Text, txtPager.Text, txtWebPage.Text, - txtNotes.Text, - txtExternalEmailAddress.Text); + txtNotes.Text, + txtExternalEmailAddress.Text, + txtSubscriberNumber.Text); if (result < 0) { @@ -152,16 +184,16 @@ namespace WebsitePanel.Portal.HostedSolution return; } - // update title - litDisplayName.Text = txtDisplayName.Text; + // update title + litDisplayName.Text = txtDisplayName.Text; if (!chkLocked.Checked) chkLocked.Enabled = false; - messageBox.ShowSuccessMessage("ORGANIZATION_UPDATE_USER_SETTINGS"); + messageBox.ShowSuccessMessage("ORGANIZATION_UPDATE_USER_SETTINGS"); } catch (Exception ex) { - messageBox.ShowErrorMessage("ORGANIZATION_UPDATE_USER_SETTINGS", ex); + messageBox.ShowErrorMessage("ORGANIZATION_UPDATE_USER_SETTINGS", ex); } } @@ -169,6 +201,12 @@ namespace WebsitePanel.Portal.HostedSolution { SaveSettings(); } - - } + + protected void chkSetPassword_CheckedChanged(object sender, EventArgs e) + { + + password.EditMode = password.ValidationEnabled = chkSetPassword.Checked; + } + + } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.designer.cs index b2bf2273..aabeb89d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.3053 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ @@ -130,6 +129,15 @@ namespace WebsitePanel.Portal.HostedSolution { /// protected global::WebsitePanel.Portal.PasswordControl password; + /// + /// chkSetPassword control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkSetPassword; + /// /// chkDisable control. /// @@ -202,6 +210,24 @@ namespace WebsitePanel.Portal.HostedSolution { /// protected global::System.Web.UI.WebControls.TextBox txtLastName; + /// + /// locSubscriberNumber control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locSubscriberNumber; + + /// + /// txtSubscriberNumber control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtSubscriberNumber; + /// /// locExternalEmailAddress control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserSetupInstructions.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserSetupInstructions.ascx.cs index 7ced46ad..64040d7f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserSetupInstructions.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserSetupInstructions.ascx.cs @@ -40,6 +40,7 @@ namespace WebsitePanel.Portal.ExchangeServer { BindInstructions(); } + } private void BindInstructions() @@ -53,7 +54,7 @@ namespace WebsitePanel.Portal.ExchangeServer PackageInfo package = ES.Services.Packages.GetPackage(PanelSecurity.PackageId); if (package == null) RedirectSpaceHomePage(); - + OrganizationUser account = ES.Services.Organizations.GetUserGeneralSettings(PanelRequest.ItemID, PanelRequest.AccountID); if (account != null) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserSetupInstructions.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserSetupInstructions.ascx.designer.cs index bc2bafe8..28af5836 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserSetupInstructions.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserSetupInstructions.ascx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.3053 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx index ec471992..5554db5d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx @@ -34,17 +34,11 @@
- - 10 - 20 - 50 - 100 - DisplayName Email AccountName + Subscriber Number @@ -54,8 +48,14 @@ - + DataSourceID="odsAccountsPaged"> + + + + + + + @@ -67,13 +67,22 @@ + + + + + + + + + - + protected global::System.Web.UI.WebControls.Panel SearchPanel; - /// - /// ddlPageSize control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::System.Web.UI.WebControls.DropDownList ddlPageSize; - /// /// ddlSearchColumn control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/Organizations.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/Organizations.ascx.cs index 317f24e7..072d101f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/Organizations.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/Organizations.ascx.cs @@ -32,53 +32,60 @@ using WebsitePanel.EnterpriseServer; namespace WebsitePanel.Portal.ExchangeServer { - public partial class Organizations : WebsitePanelModuleBase - { - protected void Page_Load(object sender, EventArgs e) - { - // set display preferences - gvOrgs.PageSize = UsersHelper.GetDisplayItemsPerPage(); + public partial class Organizations : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + // set display preferences + gvOrgs.PageSize = UsersHelper.GetDisplayItemsPerPage(); - // visibility - chkRecursive.Visible = (PanelSecurity.SelectedUser.Role != UserRole.User); - gvOrgs.Columns[2].Visible = gvOrgs.Columns[3].Visible = - (PanelSecurity.SelectedUser.Role != UserRole.User) && chkRecursive.Checked; - btnCreate.Enabled = (PanelSecurity.SelectedUser.Role != UserRole.Administrator); - } + // visibility + chkRecursive.Visible = (PanelSecurity.SelectedUser.Role != UserRole.User); + gvOrgs.Columns[2].Visible = gvOrgs.Columns[3].Visible = (PanelSecurity.SelectedUser.Role != UserRole.User) && chkRecursive.Checked; - protected void btnCreate_Click(object sender, EventArgs e) - { - Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "create_organization")); - } + if (PanelSecurity.LoggedUser.Role == UserRole.User) + { + gvOrgs.Columns[2].Visible = gvOrgs.Columns[3].Visible = gvOrgs.Columns[4].Visible = false; + btnCreate.Enabled = false; + } + else + if (gvOrgs.Rows.Count > 0) btnCreate.Enabled = false; - protected void odsOrgsPaged_Selected(object sender, ObjectDataSourceStatusEventArgs e) - { - if (e.Exception != null) - { - messageBox.ShowErrorMessage("GET_ORGS", e.Exception); - e.ExceptionHandled = true; - } - } + } - public string GetOrganizationEditUrl(string itemId) - { - return EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "organization_home", + protected void btnCreate_Click(object sender, EventArgs e) + { + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "create_organization")); + } + + protected void odsOrgsPaged_Selected(object sender, ObjectDataSourceStatusEventArgs e) + { + if (e.Exception != null) + { + messageBox.ShowErrorMessage("GET_ORGS", e.Exception); + e.ExceptionHandled = true; + } + } + + public string GetOrganizationEditUrl(string itemId) + { + return EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "organization_home", "ItemID=" + itemId); - } + } - public string GetUserHomePageUrl(int userId) - { - return PortalUtils.GetUserHomePageUrl(userId); - } + public string GetUserHomePageUrl(int userId) + { + return PortalUtils.GetUserHomePageUrl(userId); + } - public string GetSpaceHomePageUrl(int spaceId) - { - return NavigateURL(PortalUtils.SPACE_ID_PARAM, spaceId.ToString()); - } + public string GetSpaceHomePageUrl(int spaceId) + { + return NavigateURL(PortalUtils.SPACE_ID_PARAM, spaceId.ToString()); + } protected void gvOrgs_RowCommand(object sender, GridViewCommandEventArgs e) { - if (e.CommandName == "DeleteItem") + if (e.CommandName == "DeleteItem") { // delete organization int itemId = Utils.ParseInt(e.CommandArgument.ToString(), 0); @@ -95,13 +102,13 @@ namespace WebsitePanel.Portal.ExchangeServer // rebind grid gvOrgs.DataBind(); - orgsQuota.BindQuota(); + orgsQuota.BindQuota(); } catch (Exception ex) { - messageBox.ShowErrorMessage("DELETE_ORG", ex); + messageBox.ShowErrorMessage("DELETE_ORG", ex); } } } - } + } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/Organizations.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/Organizations.ascx.designer.cs index c6ddeecf..87987213 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/Organizations.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/Organizations.ascx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.3053 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/MailboxTabs.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/MailboxTabs.ascx.resx index a4f425dc..e969fd9b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/MailboxTabs.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/MailboxTabs.ascx.resx @@ -112,10 +112,10 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 E-mail Addresses @@ -135,15 +135,13 @@ Setup Instructions - - Permissions - - Mobile Devices Spam - + + Mailbox + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/Menu.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/Menu.ascx.resx index 41d8d98b..91cf60e9 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 @@ -112,10 +112,10 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 ActiveSync Policy @@ -127,17 +127,15 @@ Distribution Lists - Domain Names + Accepted Domains - + CRM Organization - - - CRM Users - - - + + CRM Users + + Exchange @@ -146,18 +144,16 @@ Organization's - + CRM - - + BlackBerry - - BlackBerry Users - - - + + BlackBerry Users + + Public Folders @@ -166,14 +162,13 @@ SharePoint - + OCS - - + OCS Users - + Site Collections @@ -185,4 +180,7 @@ Users + + Mailbox Plans + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/DomainSelector.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/DomainSelector.ascx.cs index 076c28f1..c56e96da 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/DomainSelector.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/DomainSelector.ascx.cs @@ -39,54 +39,54 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls get { return ddlDomain.SelectedItem.Text; } } - public int DomainId - { - get - { - return Convert.ToInt32(ddlDomain.SelectedValue); - } - } + public int DomainId + { + get + { + return Convert.ToInt32(ddlDomain.SelectedValue); + } + } - public int DomainsCount - { - get - { - return this.ddlDomain.Items.Count; - } - } + public int DomainsCount + { + get + { + return this.ddlDomain.Items.Count; + } + } - public bool ShowAt - { - get - { - return this.litAt.Visible; - } - set - { - this.litAt.Visible = value; - } - } + public bool ShowAt + { + get + { + return this.litAt.Visible; + } + set + { + this.litAt.Visible = value; + } + } protected void Page_Load(object sender, EventArgs e) { - if (!IsPostBack) - { - BindDomains(); - } + if (!IsPostBack) + { + BindDomains(); + } } - private void BindDomains() - { - // get domains - OrganizationDomainName[] domains = ES.Services.Organizations.GetOrganizationDomains(PanelRequest.ItemID); + private void BindDomains() + { + // get domains + OrganizationDomainName[] domains = ES.Services.Organizations.GetOrganizationDomains(PanelRequest.ItemID); - // bind domains - foreach (OrganizationDomainName domain in domains) - { - ListItem li = new ListItem(domain.DomainName, domain.DomainId.ToString()); - li.Selected = domain.IsDefault; - ddlDomain.Items.Add(li); - } - } + // bind domains + foreach (OrganizationDomainName domain in domains) + { + ListItem li = new ListItem(domain.DomainName, domain.DomainId.ToString()); + li.Selected = domain.IsDefault; + ddlDomain.Items.Add(li); + } + } } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/DomainSelector.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/DomainSelector.ascx.designer.cs index bca58a9f..b4a0e6a6 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/DomainSelector.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/DomainSelector.ascx.designer.cs @@ -1,22 +1,15 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.832 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace WebsitePanel.Portal.ExchangeServer.UserControls { - /// - /// DomainSelector class. - /// - /// - /// Auto-generated class. - /// public partial class DomainSelector { /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/MailboxPlanSelector.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/MailboxPlanSelector.ascx new file mode 100644 index 00000000..9718d6b2 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/MailboxPlanSelector.ascx @@ -0,0 +1,3 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MailboxPlanSelector.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.UserControls.MailboxPlanSelector" %> + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/MailboxPlanSelector.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/MailboxPlanSelector.ascx.cs new file mode 100644 index 00000000..b2cdfbd3 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/MailboxPlanSelector.ascx.cs @@ -0,0 +1,105 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +using System; +using System.Web.UI.WebControls; + +namespace WebsitePanel.Portal.ExchangeServer.UserControls +{ + public partial class MailboxPlanSelector : WebsitePanelControlBase + { + + private string mailboxPlanToSelect; + + public string MailboxPlanId + { + + get { return ddlMailboxPlan.SelectedItem.Value; } + set + { + mailboxPlanToSelect = value; + foreach (ListItem li in ddlMailboxPlan.Items) + { + if (li.Value == value) + { + ddlMailboxPlan.ClearSelection(); + li.Selected = true; + break; + } + } + } + } + + public int MailboxPlansCount + { + get + { + return this.ddlMailboxPlan.Items.Count; + } + } + + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + BindMailboxPlans(); + } + } + + private void BindMailboxPlans() + { + WebsitePanel.Providers.HostedSolution.ExchangeMailboxPlan[] plans = ES.Services.ExchangeServer.GetExchangeMailboxPlans(PanelRequest.ItemID); + + foreach (WebsitePanel.Providers.HostedSolution.ExchangeMailboxPlan plan in plans) + { + ListItem li = new ListItem(); + li.Text = plan.MailboxPlan; + li.Value = plan.MailboxPlanId.ToString(); + li.Selected = plan.IsDefault; + ddlMailboxPlan.Items.Add(li); + } + + foreach (ListItem li in ddlMailboxPlan.Items) + { + if (li.Value == mailboxPlanToSelect) + { + ddlMailboxPlan.ClearSelection(); + li.Selected = true; + break; + } + } + + } + + protected void ddlMailboxPlan_SelectedIndexChanged(object sender, EventArgs e) + { + + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/MailboxSelector.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/MailboxSelector.ascx.cs index 60a4aa40..62431785 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/MailboxSelector.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/MailboxSelector.ascx.cs @@ -37,24 +37,24 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls public partial class MailboxSelector : WebsitePanelControlBase { public const string DirectionString = "DirectionString"; - + public bool MailboxesEnabled - { - get { return ViewState["MailboxesEnabled"] != null ? (bool)ViewState["MailboxesEnabled"] : false; } - set { ViewState["MailboxesEnabled"] = value; } - } + { + get { return ViewState["MailboxesEnabled"] != null ? (bool)ViewState["MailboxesEnabled"] : false; } + set { ViewState["MailboxesEnabled"] = value; } + } - public bool ContactsEnabled - { - get { return ViewState["ContactsEnabled"] != null ? (bool)ViewState["ContactsEnabled"] : false; } - set { ViewState["ContactsEnabled"] = value; } - } + public bool ContactsEnabled + { + get { return ViewState["ContactsEnabled"] != null ? (bool)ViewState["ContactsEnabled"] : false; } + set { ViewState["ContactsEnabled"] = value; } + } - public bool DistributionListsEnabled - { - get { return ViewState["DistributionListsEnabled"] != null ? (bool)ViewState["DistributionListsEnabled"] : false; } - set { ViewState["DistributionListsEnabled"] = value; } - } + public bool DistributionListsEnabled + { + get { return ViewState["DistributionListsEnabled"] != null ? (bool)ViewState["DistributionListsEnabled"] : false; } + set { ViewState["DistributionListsEnabled"] = value; } + } public bool ShowOnlyMailboxes { @@ -62,20 +62,20 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls set { ViewState["ShowOnlyMailboxes"] = value; } } - public int ExcludeAccountId - { - get { return PanelRequest.AccountID; } - } + public int ExcludeAccountId + { + get { return PanelRequest.AccountID; } + } - public void SetAccount(ExchangeAccount account) - { - BindSelectedAccount(account); - } + public void SetAccount(ExchangeAccount account) + { + BindSelectedAccount(account); + } - public string GetAccount() - { - return (string)ViewState["AccountName"]; - } + public string GetAccount() + { + return (string)ViewState["AccountName"]; + } public int GetAccountId() { return Utils.ParseInt(ViewState["AccountId"], 0); @@ -84,11 +84,11 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls protected void Page_Load(object sender, EventArgs e) { - // toggle controls - if (!IsPostBack) - { + // toggle controls + if (!IsPostBack) + { chkIncludeMailboxes.Visible = MailboxesEnabled; - + chkIncludeRooms.Visible = MailboxesEnabled && !ShowOnlyMailboxes; chkIncludeEquipment.Visible = MailboxesEnabled && !ShowOnlyMailboxes; @@ -98,47 +98,47 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls chkIncludeRooms.Checked = MailboxesEnabled && !ShowOnlyMailboxes; chkIncludeEquipment.Checked = MailboxesEnabled && !ShowOnlyMailboxes; - + chkIncludeContacts.Visible = ContactsEnabled; - chkIncludeContacts.Checked = ContactsEnabled; - chkIncludeLists.Visible = DistributionListsEnabled; - chkIncludeLists.Checked = DistributionListsEnabled; - } + chkIncludeContacts.Checked = ContactsEnabled; + chkIncludeLists.Visible = DistributionListsEnabled; + chkIncludeLists.Checked = DistributionListsEnabled; + } } - private void BindSelectedAccount(ExchangeAccount account) - { - if (account != null) - { - txtDisplayName.Text = account.DisplayName; - ViewState["AccountName"] = account.AccountName; + private void BindSelectedAccount(ExchangeAccount account) + { + if (account != null) + { + txtDisplayName.Text = account.DisplayName; + ViewState["AccountName"] = account.AccountName; ViewState["PrimaryEmailAddress"] = account.PrimaryEmailAddress; ViewState["AccountId"] = account.AccountId; - } - else - { - txtDisplayName.Text = ""; - ViewState["AccountName"] = null; + } + else + { + txtDisplayName.Text = ""; + ViewState["AccountName"] = null; ViewState["PrimaryEmailAddress"] = null; ViewState["AccountId"] = null; - } - } + } + } - public string GetAccountImage(int accountTypeId) - { - ExchangeAccountType accountType = (ExchangeAccountType)accountTypeId; - string imgName = "mailbox_16.gif"; - if (accountType == ExchangeAccountType.Contact) - imgName = "contact_16.gif"; - else if (accountType == ExchangeAccountType.DistributionList) - imgName = "dlist_16.gif"; + public string GetAccountImage(int accountTypeId) + { + ExchangeAccountType accountType = (ExchangeAccountType)accountTypeId; + string imgName = "mailbox_16.gif"; + if (accountType == ExchangeAccountType.Contact) + imgName = "contact_16.gif"; + else if (accountType == ExchangeAccountType.DistributionList) + imgName = "dlist_16.gif"; else if (accountType == ExchangeAccountType.Room) imgName = "room_16.gif"; else if (accountType == ExchangeAccountType.Equipment) imgName = "equipment_16.gif"; - return GetThemedImage("Exchange/" + imgName); - } + return GetThemedImage("Exchange/" + imgName); + } private SortDirection Direction @@ -152,26 +152,26 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls return string.Compare(user1.DisplayName, user2.DisplayName); } - + private void BindPopupAccounts() - { - ExchangeAccount[] accounts = ES.Services.ExchangeServer.SearchAccounts(PanelRequest.ItemID, - chkIncludeMailboxes.Checked, chkIncludeContacts.Checked, chkIncludeLists.Checked, + { + ExchangeAccount[] accounts = ES.Services.ExchangeServer.SearchAccounts(PanelRequest.ItemID, + chkIncludeMailboxes.Checked, chkIncludeContacts.Checked, chkIncludeLists.Checked, chkIncludeRooms.Checked, chkIncludeEquipment.Checked, - ddlSearchColumn.SelectedValue, txtSearchValue.Text + "%", ""); + ddlSearchColumn.SelectedValue, txtSearchValue.Text + "%", ""); - if (ExcludeAccountId > 0) - { - List updatedAccounts = new List(); - foreach (ExchangeAccount account in accounts) - if (account.AccountId != ExcludeAccountId) - updatedAccounts.Add(account); + if (ExcludeAccountId > 0) + { + List updatedAccounts = new List(); + foreach (ExchangeAccount account in accounts) + if (account.AccountId != ExcludeAccountId) + updatedAccounts.Add(account); - accounts = updatedAccounts.ToArray(); - } + accounts = updatedAccounts.ToArray(); + } Array.Sort(accounts, CompareAccount); - + if (Direction == SortDirection.Ascending) { Array.Reverse(accounts); @@ -182,56 +182,56 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls gvPopupAccounts.DataSource = accounts; gvPopupAccounts.DataBind(); - - - } - protected void chkIncludeMailboxes_CheckedChanged(object sender, EventArgs e) - { - BindPopupAccounts(); - } - protected void cmdSearch_Click(object sender, ImageClickEventArgs e) - { - BindPopupAccounts(); - } + } - protected void cmdClear_Click(object sender, EventArgs e) - { - BindSelectedAccount(null); - } + protected void chkIncludeMailboxes_CheckedChanged(object sender, EventArgs e) + { + BindPopupAccounts(); + } - protected void ImageButton1_Click(object sender, ImageClickEventArgs e) - { - // bind all accounts - BindPopupAccounts(); + protected void cmdSearch_Click(object sender, ImageClickEventArgs e) + { + BindPopupAccounts(); + } - // show modal - SelectAccountsModal.Show(); - } + protected void cmdClear_Click(object sender, EventArgs e) + { + BindSelectedAccount(null); + } - protected void gvPopupAccounts_RowCommand(object sender, GridViewCommandEventArgs e) - { - if (e.CommandName == "SelectAccount") - { - string[] parts = e.CommandArgument.ToString().Split('|'); - ExchangeAccount account = new ExchangeAccount(); - account.AccountName = parts[0]; - account.DisplayName = parts[1]; + protected void ImageButton1_Click(object sender, ImageClickEventArgs e) + { + // bind all accounts + BindPopupAccounts(); + + // show modal + SelectAccountsModal.Show(); + } + + protected void gvPopupAccounts_RowCommand(object sender, GridViewCommandEventArgs e) + { + if (e.CommandName == "SelectAccount") + { + string[] parts = e.CommandArgument.ToString().Split('|'); + ExchangeAccount account = new ExchangeAccount(); + account.AccountName = parts[0]; + account.DisplayName = parts[1]; account.PrimaryEmailAddress = parts[2]; account.AccountId = Utils.ParseInt(parts[3]); - // set account - BindSelectedAccount(account); + // set account + BindSelectedAccount(account); - // hide popup - SelectAccountsModal.Hide(); + // hide popup + SelectAccountsModal.Hide(); - // update parent panel - MainUpdatePanel.Update(); - } - } + // update parent panel + MainUpdatePanel.Update(); + } + } protected void OnSorting(object sender, GridViewSortEventArgs e) { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/MailboxSelector.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/MailboxSelector.ascx.designer.cs index d19fbb89..4c796a4c 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/MailboxSelector.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/MailboxSelector.ascx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.4927 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/MailboxTabs.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/MailboxTabs.ascx.cs index f2ec5079..5994422d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/MailboxTabs.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/MailboxTabs.ascx.cs @@ -90,11 +90,10 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls private void BindTabs() { List tabsList = new List(); - tabsList.Add(CreateTab("mailbox_settings", "Tab.Settings")); + tabsList.Add(CreateTab("mailbox_settings", "Tab.Mailbox")); tabsList.Add(CreateTab("mailbox_addresses", "Tab.Addresses")); tabsList.Add(CreateTab("mailbox_mailflow", "Tab.Mailflow")); tabsList.Add(CreateTab("mailbox_permissions", "Tab.Permissions")); - tabsList.Add(CreateTab("mailbox_advanced", "Tab.Advanced")); tabsList.Add(CreateTab("mailbox_setup", "Tab.Setup")); tabsList.Add(CreateTab("mailbox_mobile", "Tab.Mobile")); //tabsList.Add(CreateTab("mailbddox_spam", "Tab.Spam")); 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 8ff532c6..baa30d3a 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 @@ -126,14 +126,17 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls if (CheckQouta(Quotas.EXCHANGE2007_PUBLICFOLDERS, cntx)) exchangeGroup.MenuItems.Add(CreateMenuItem("PublicFolders", "public_folders")); - - - exchangeGroup.MenuItems.Add(CreateMenuItem("StorageUsage", "storage_usage")); - exchangeGroup.MenuItems.Add(CreateMenuItem("StorageLimits", "storage_limits")); - - if (CheckQouta(Quotas.EXCHANGE2007_ACTIVESYNCENABLED, cntx)) + if (CheckQouta(Quotas.EXCHANGE2007_ACTIVESYNCALLOWED, cntx)) exchangeGroup.MenuItems.Add(CreateMenuItem("ActiveSyncPolicy", "activesync_policy")); + if (CheckQouta(Quotas.EXCHANGE2007_MAILBOXES, cntx)) + exchangeGroup.MenuItems.Add(CreateMenuItem("MailboxPlans", "mailboxplans")); + + if (CheckQouta(Quotas.ORGANIZATION_DOMAINS, cntx)) + exchangeGroup.MenuItems.Add(CreateMenuItem("DomainNames", "domains")); + + exchangeGroup.MenuItems.Add(CreateMenuItem("StorageUsage", "storage_usage")); + if (exchangeGroup.MenuItems.Count > 0) groups.Add(exchangeGroup); @@ -142,8 +145,8 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls private void PrepareOrganizationMenu(PackageContext cntx, List groups, string imagePath) { MenuGroup organizationGroup = new MenuGroup(GetLocalizedString("Text.OrganizationGroup"), imagePath + "company24.png"); - if (CheckQouta(Quotas.ORGANIZATION_DOMAINS, cntx)) - organizationGroup.MenuItems.Add(CreateMenuItem("DomainNames", "domains")); + //if (CheckQouta(Quotas.ORGANIZATION_DOMAINS, cntx)) + // organizationGroup.MenuItems.Add(CreateMenuItem("DomainNames", "domains")); if (CheckQouta(Quotas.ORGANIZATION_USERS, cntx)) organizationGroup.MenuItems.Add(CreateMenuItem("Users", "users")); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/SizeBox.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/SizeBox.ascx index 8aef6ce4..dc4977d2 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/SizeBox.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/SizeBox.ascx @@ -1,6 +1,8 @@ <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SizeBox.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.UserControls.SizeBox" %> + + // This code was generated by a tool. -// Runtime Version:2.0.50727.312 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ namespace WebsitePanel.Portal.ExchangeServer.UserControls { - /// - /// SizeBox class. - /// - /// - /// Auto-generated class. - /// public partial class SizeBox { /// @@ -37,6 +30,42 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls { /// protected global::System.Web.UI.WebControls.Localize locKB; + /// + /// locMB control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locMB; + + /// + /// locPct control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locPct; + + /// + /// _ValidatorCalloutExtender control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::AjaxControlToolkit.ValidatorCalloutExtender _ValidatorCalloutExtender; + + /// + /// ValidatorCalloutExtender1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::AjaxControlToolkit.ValidatorCalloutExtender ValidatorCalloutExtender1; + /// /// valRequireNumber control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserSelector.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserSelector.ascx index 1abeb777..a5c22ab2 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserSelector.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserSelector.ascx @@ -49,7 +49,7 @@ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserSelector.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserSelector.ascx.cs index 51e5e543..da7d0b53 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserSelector.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserSelector.ascx.cs @@ -11,7 +11,7 @@ // 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 +// - Neither the name of the SMB SAAS Systems Inc. nor the names of its // contributors may be used to endorse or promote products derived from this // software without specific prior written permission. // @@ -137,6 +137,12 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls return (string)ViewState["PrimaryEmailAddress"]; } + public string GetSubscriberNumber() + { + return (string)ViewState["SubscriberNumber"]; + } + + public int GetAccountId() { return Utils.ParseInt(ViewState["AccountId"], 0); @@ -158,6 +164,7 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls ViewState["PrimaryEmailAddress"] = account.PrimaryEmailAddress; ViewState["AccountId"] = account.AccountId; ViewState["SAMAccountName"] = account.SamAccountName; + ViewState["SubscriberNumber"] = account.SubscriberNumber; } else { @@ -167,7 +174,7 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls ViewState["PrimaryEmailAddress"] = null; ViewState["AccountId"] = null; ViewState["SAMAccountName"] = null; - + ViewState["SubscriberNumber"] = null; } } @@ -287,6 +294,7 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls account.PrimaryEmailAddress = parts[2]; account.AccountId = Utils.ParseInt(parts[3]); account.SamAccountName = parts[4]; + account.SubscriberNumber = parts[5]; // set account BindSelectedAccount(account); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserSelector.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserSelector.ascx.designer.cs index c4fe285f..4775df9a 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserSelector.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserSelector.ascx.designer.cs @@ -1,31 +1,3 @@ -// Copyright (c) 2012, Outercurve Foundation. -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, -// are permitted provided that the following conditions are met: -// -// - Redistributions of source code must retain the above copyright notice, this -// list of conditions and the following disclaimer. -// -// - Redistributions in binary form must reproduce the above copyright notice, -// this list of conditions and the following disclaimer in the documentation -// and/or other materials provided with the distribution. -// -// - Neither the name of the Outercurve Foundation nor the names of its -// contributors may be used to endorse or promote products derived from this -// software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR -// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - //------------------------------------------------------------------------------ // // This code was generated by a tool. diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/App_LocalResources/Exchange_Settings.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/App_LocalResources/Exchange_Settings.ascx.resx index ac2e6bc8..c2df5d53 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/App_LocalResources/Exchange_Settings.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/App_LocalResources/Exchange_Settings.ascx.resx @@ -112,10 +112,10 @@ 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Setup Instruction Variables @@ -189,4 +189,7 @@ Public Folder Server: + + Database Availability Group: + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/Exchange2010SP1_Settings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/Exchange2010SP1_Settings.ascx deleted file mode 100644 index de4edd16..00000000 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/Exchange2010SP1_Settings.ascx +++ /dev/null @@ -1,63 +0,0 @@ -<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Exchange2010SP1_Settings.ascx.cs" Inherits="WebsitePanel.Portal.ProviderControls.Exchange2010SP1_Settings" %> - -
- Organization Template - - - - - - - - - - <%-- - - - - - --%> -
Program ID: - - -
Offer ID: - - -
Location: - - - -
-
- -<%-- -
- Catch-All - - - - - -
Catch-all configuration path:
-
---%> - -
- Domain Templates - - - - - - - - - -
Temporary domain:organization_domain.
Exchange Control Panel URL: -
- You can use [DOMAIN_NAME] variable for organization default domain. -
-
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/Exchange2010SP1_Settings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/Exchange2010SP1_Settings.ascx.cs deleted file mode 100644 index 8897a13b..00000000 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/Exchange2010SP1_Settings.ascx.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Web; -using System.Web.UI; -using System.Web.UI.WebControls; -using System.Collections.Specialized; - -namespace WebsitePanel.Portal.ProviderControls -{ - public partial class Exchange2010SP1_Settings : WebsitePanelControlBase, IHostingServiceProviderSettings - { - protected void Page_Load(object sender, EventArgs e) - { - - } - - public void BindSettings(StringDictionary settings) - { - programID.Text = settings["programID"]; - offerID.Text = settings["offerID"]; - //location.Text = settings["location"]; - - //catchAllPath.Text = settings["catchAllPath"]; - - temporaryDomain.Text = settings["temporaryDomain"]; - ecpURL.Text = settings["ecpURL"]; - } - - public void SaveSettings(StringDictionary settings) - { - settings["programID"] = programID.Text.Trim(); - settings["offerID"] = offerID.Text.Trim(); - //settings["location"] = location.Text.Trim(); - - //settings["catchAllPath"] = catchAllPath.Text.Trim(); - - settings["temporaryDomain"] = temporaryDomain.Text.Trim(); - settings["ecpURL"] = ecpURL.Text.Trim(); - } - } -} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/Exchange_Settings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/Exchange_Settings.ascx index 16480e8d..48636a4d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/Exchange_Settings.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/Exchange_Settings.ascx @@ -13,11 +13,14 @@ + + // This code was generated by a tool. -// Runtime Version:2.0.50727.3053 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. //
//------------------------------------------------------------------------------ @@ -49,6 +48,15 @@ namespace WebsitePanel.Portal.ProviderControls { /// protected global::System.Web.UI.WebControls.Localize locMailboxDatabase; + /// + /// locMailboxDAG control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locMailboxDAG; + /// /// txtMailboxDatabase control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx index 5f62fea9..b436336c 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx @@ -51,6 +51,14 @@ Text="Create Space Resources" Checked="True" AutoPostBack="True" OnCheckedChanged="chkCreateResources_CheckedChanged" /> + + +
+ + + + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx.cs index 793b42f9..f6ada2d5 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx.cs @@ -41,6 +41,7 @@ namespace WebsitePanel.Portal { if (!IsPostBack) { + chkIntegratedOUProvisioning.Visible = false; ftpAccountName.SetUserPolicy(PanelSecurity.SelectedUserId, UserSettings.FTP_POLICY, "UserNamePolicy"); BindHostingPlans(PanelSecurity.SelectedUserId); BindHostingPlan(); @@ -106,6 +107,8 @@ namespace WebsitePanel.Portal chkCreateMailAccount.Checked &= mailEnabled; ftpAccountName.Visible = (rbFtpAccountName.SelectedIndex == 1); + + chkIntegratedOUProvisioning.Visible = chkCreateResources.Visible; } private void CreateHostingSpace() @@ -136,6 +139,28 @@ namespace WebsitePanel.Portal lblMessage.Text = AntiXss.HtmlEncode(GetExceedingQuotasMessage(result.ExceedingQuotas)); return; } + else + { + if ((chkIntegratedOUProvisioning.Checked) & !string.IsNullOrEmpty(domainName)) + { + UserInfo user = UsersHelper.GetUser(PanelSecurity.SelectedUserId); + + if (user != null) + { + if (user.Role != UserRole.Reseller) + { + + ES.Services.Organizations.CreateOrganization(result.Result, domainName.ToLower(), domainName.ToLower()); + + if (result.Result < 0) + { + ShowErrorMessage("USERWIZARD_CREATE_ACCOUNT"); + return; + } + } + } + } + } } catch (Exception ex) { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx.designer.cs index b280ff7a..e41d8992 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserCreateSpace.ascx.designer.cs @@ -1,10 +1,9 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.3074 // // Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// the code is regenerated. // //------------------------------------------------------------------------------ @@ -112,6 +111,15 @@ namespace WebsitePanel.Portal { /// protected global::System.Web.UI.WebControls.CheckBox chkCreateResources; + /// + /// chkIntegratedOUProvisioning control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkIntegratedOUProvisioning; + /// /// ResourcesPanel 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 2bc48ea9..6c2fe5c9 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj @@ -199,10 +199,31 @@ + + ExchangeAddMailboxPlan.ascx + ASPXCodeBehind + + + ExchangeAddMailboxPlan.ascx + + + ExchangeMailboxPlans.ascx + ASPXCodeBehind + + + ExchangeMailboxPlans.ascx + AccountsListWithPermissions.ascx ASPXCodeBehind + + MailboxPlanSelector.ascx + ASPXCodeBehind + + + MailboxPlanSelector.ascx + hMailServer5_EditAccount.ascx ASPXCodeBehind @@ -745,13 +766,6 @@ BlackBerry_Settings.ascx - - Exchange2010SP1_Settings.ascx - ASPXCodeBehind - - - Exchange2010SP1_Settings.ascx - Exchange_Settings.ascx ASPXCodeBehind @@ -1189,13 +1203,6 @@ ExchangeDomainRecords.ascx - - ExchangeMailboxAdvancedSettings.ascx - ASPXCodeBehind - - - ExchangeMailboxAdvancedSettings.ascx - ExchangeMailboxEmailAddresses.ascx ASPXCodeBehind @@ -1259,13 +1266,6 @@ ExchangePublicFolders.ascx - - ExchangeStorageLimits.ascx - ASPXCodeBehind - - - ExchangeStorageLimits.ascx - ExchangeStorageUsage.ascx ASPXCodeBehind @@ -3686,7 +3686,10 @@ + + + @@ -3736,7 +3739,6 @@ - @@ -4685,9 +4687,6 @@ Designer - - Designer - Designer @@ -4812,6 +4811,8 @@ Designer + + Designer @@ -5193,9 +5194,6 @@ Designer - - Designer - Designer @@ -5233,7 +5231,6 @@ - @@ -5243,7 +5240,6 @@ - @@ -5345,9 +5341,6 @@ Designer - - Designer - Designer diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/WebsitePanel.WebPortal.csproj b/WebsitePanel/Sources/WebsitePanel.WebPortal/WebsitePanel.WebPortal.csproj index 00a1c8b1..753293c1 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/WebsitePanel.WebPortal.csproj +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/WebsitePanel.WebPortal.csproj @@ -102,7 +102,10 @@ + + + diff --git a/WebsitePanel/Sources/generate_es_proxies.bat b/WebsitePanel/Sources/generate_es_proxies.bat index 1b2bb0fa..d190a83a 100644 --- a/WebsitePanel/Sources/generate_es_proxies.bat +++ b/WebsitePanel/Sources/generate_es_proxies.bat @@ -1,6 +1,6 @@ SET WSDL="C:\Program Files (x86)\Microsoft WSE\v3.0\Tools\WseWsdl3.exe" SET WSE_CLEAN=..\Tools\WseClean.exe -SET SERVER_URL=http://localhost:9002 +SET SERVER_URL=http://localhost:9005 -%WSDL% %SERVER_URL%/esExchangeHostedEdition.asmx /out:.\WebsitePanel.EnterpriseServer.Client\ExchangeHostedEditionProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient -%WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\ExchangeHostedEditionProxy.cs \ No newline at end of file +%WSDL% %SERVER_URL%/esExchangeServer.asmx /out:.\WebsitePanel.EnterpriseServer.Client\ExchangeServerProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient +%WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\ExchangeServerProxy.cs diff --git a/WebsitePanel/Sources/generate_server_proxies.bat b/WebsitePanel/Sources/generate_server_proxies.bat index 67384691..ee8580af 100644 --- a/WebsitePanel/Sources/generate_server_proxies.bat +++ b/WebsitePanel/Sources/generate_server_proxies.bat @@ -1,8 +1,8 @@ SET WSDL="C:\Program Files (x86)\Microsoft WSE\v3.0\Tools\WseWsdl3.exe" SET WSE_CLEAN=..\Tools\WseClean.exe -SET SERVER_URL=http://localhost:9003 +SET SERVER_URL=http://localhost:9006 -%WSDL% %SERVER_URL%/VirtualizationServerForPrivateCloud.asmx /out:.\WebsitePanel.Server.Client\VirtualizationServerForPrivateCloudProxy.cs /namespace:WebsitePanel.Providers.VirtualizationForPC /type:webClient /fields -%WSE_CLEAN% .\WebsitePanel.Server.Client\VirtualizationServerForPrivateCloudProxy.cs +%WSDL% %SERVER_URL%/Organizations.asmx /out:.\WebsitePanel.Server.Client\OrganizationProxy.cs /namespace:WebsitePanel.Providers.HostedSolution /type:webClient /fields +%WSE_CLEAN% .\WebsitePanel.Server.Client\OrganizationProxy.cs pause \ No newline at end of file