diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index eaf5b428..921a552f 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -3451,18 +3451,18 @@ GO + -- Exchange2013 Archiving -- Exchange2013 Archiving Quotas -IF EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Exchange2013.AllowArchiving') +IF EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaID] = 424) BEGIN UPDATE [dbo].[Quotas] SET [QuotaName]=N'Exchange2013.AllowRetentionPolicy', [QuotaDescription]=N'Allow Retention Policy' -WHERE [QuotaName] = 'Exchange2013.AllowArchiving' +WHERE [QuotaID] = 424 END GO - IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Exchange2013.AllowRetentionPolicy') BEGIN INSERT [dbo].[Quotas] ([QuotaID], [GroupID],[QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) @@ -3470,7 +3470,6 @@ VALUES (424, 12, 27,N'Exchange2013.AllowRetentionPolicy',N'Allow Retention Polic END GO - IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Exchange2013.ArchivingStorage') BEGIN INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) @@ -3485,6 +3484,14 @@ VALUES (426, 12, 28, N'Exchange2013.ArchivingMailboxes', N'Archiving Mailboxes p END GO +IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Exchange2013.AllowArchiving') +BEGIN +INSERT [dbo].[Quotas] ([QuotaID], [GroupID],[QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) +VALUES (427, 12, 27,N'Exchange2013.AllowArchiving',N'Allow Archiving',1, 0 , NULL, NULL) +END +GO + + -- Exchange2013 Archiving Plans 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='ExchangeMailboxPlans' AND COLS.name='Archiving') BEGIN @@ -3500,6 +3507,15 @@ ALTER TABLE [dbo].[ExchangeMailboxPlans] ADD END GO +IF NOT EXISTS(select 1 from sys.columns COLS INNER JOIN sys.objects OBJS ON OBJS.object_id=COLS.object_id and OBJS.type='U' AND OBJS.name='ExchangeMailboxPlans' AND COLS.name='ArchiveSizeMB') +BEGIN +ALTER TABLE [dbo].[ExchangeMailboxPlans] ADD +[ArchiveSizeMB] [int] NULL, +[ArchiveWarningPct] [int] NULL +END +GO + + ALTER PROCEDURE [dbo].[AddExchangeMailboxPlan] ( @MailboxPlanId int OUTPUT, @@ -3527,7 +3543,9 @@ ALTER PROCEDURE [dbo].[AddExchangeMailboxPlan] @LitigationHoldUrl nvarchar(256), @LitigationHoldMsg nvarchar(512), @Archiving bit, - @EnableArchiving bit + @EnableArchiving bit, + @ArchiveSizeMB int, + @ArchiveWarningPct int ) AS @@ -3569,7 +3587,9 @@ INSERT INTO ExchangeMailboxPlans LitigationHoldUrl, LitigationHoldMsg, Archiving, - EnableArchiving + EnableArchiving, + ArchiveSizeMB, + ArchiveWarningPct ) VALUES ( @@ -3597,7 +3617,9 @@ VALUES @LitigationHoldUrl, @LitigationHoldMsg, @Archiving, - @EnableArchiving + @EnableArchiving, + @ArchiveSizeMB, + @ArchiveWarningPct ) SET @MailboxPlanId = SCOPE_IDENTITY() @@ -3632,7 +3654,9 @@ ALTER PROCEDURE [dbo].[UpdateExchangeMailboxPlan] @LitigationHoldUrl nvarchar(256), @LitigationHoldMsg nvarchar(512), @Archiving bit, - @EnableArchiving bit + @EnableArchiving bit, + @ArchiveSizeMB int, + @ArchiveWarningPct int ) AS @@ -3660,9 +3684,9 @@ UPDATE ExchangeMailboxPlans SET LitigationHoldUrl = @LitigationHoldUrl, LitigationHoldMsg = @LitigationHoldMsg, Archiving = @Archiving, - EnableArchiving = @EnableArchiving - - + EnableArchiving = @EnableArchiving, + ArchiveSizeMB = @ArchiveSizeMB, + ArchiveWarningPct = @ArchiveWarningPct WHERE MailboxPlanId = @MailboxPlanId RETURN @@ -3698,7 +3722,9 @@ SELECT HideFromAddressBook, MailboxPlanType, Archiving, - EnableArchiving + EnableArchiving, + ArchiveSizeMB, + ArchiveWarningPct FROM ExchangeMailboxPlans WHERE @@ -3741,7 +3767,9 @@ SELECT LitigationHoldUrl, LitigationHoldMsg, Archiving, - EnableArchiving + EnableArchiving, + ArchiveSizeMB, + ArchiveWarningPct FROM ExchangeMailboxPlans WHERE @@ -3759,6 +3787,13 @@ ALTER TABLE [dbo].[ExchangeAccounts] ADD END GO +IF NOT EXISTS(select 1 from sys.columns COLS INNER JOIN sys.objects OBJS ON OBJS.object_id=COLS.object_id and OBJS.type='U' AND OBJS.name='ExchangeAccounts' AND COLS.name='EnableArchiving') +BEGIN +ALTER TABLE [dbo].[ExchangeAccounts] ADD +[EnableArchiving] [bit] NULL +END +GO + ALTER PROCEDURE [dbo].[GetExchangeAccount] ( @ItemID int, @@ -3781,7 +3816,8 @@ SELECT E.SubscriberNumber, E.UserPrincipalName, E.ArchivingMailboxPlanId, - AP.MailboxPlan as 'ArchivingMailboxPlan' + AP.MailboxPlan as 'ArchivingMailboxPlan', + E.EnableArchiving FROM ExchangeAccounts AS E LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId @@ -3816,7 +3852,8 @@ SELECT E.SubscriberNumber, E.UserPrincipalName, E.ArchivingMailboxPlanId, - AP.MailboxPlan as 'ArchivingMailboxPlan' + AP.MailboxPlan as 'ArchivingMailboxPlan', + E.EnableArchiving FROM ExchangeAccounts AS E LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId @@ -3857,7 +3894,8 @@ SELECT E.SubscriberNumber, E.UserPrincipalName, E.ArchivingMailboxPlanId, - AP.MailboxPlan as 'ArchivingMailboxPlan' + AP.MailboxPlan as 'ArchivingMailboxPlan', + E.EnableArchiving FROM ExchangeAccounts AS E LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId @@ -3888,7 +3926,8 @@ SELECT E.SubscriberNumber, E.UserPrincipalName, E.ArchivingMailboxPlanId, - AP.MailboxPlan as 'ArchivingMailboxPlan' + AP.MailboxPlan as 'ArchivingMailboxPlan', + E.EnableArchiving FROM ExchangeAccounts AS E LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId @@ -3915,7 +3954,8 @@ SELECT E.SubscriberNumber, E.UserPrincipalName, E.ArchivingMailboxPlanId, - AP.MailboxPlan as 'ArchivingMailboxPlan' + AP.MailboxPlan as 'ArchivingMailboxPlan', + E.EnableArchiving FROM ExchangeAccounts AS E LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId @@ -4024,13 +4064,15 @@ ALTER PROCEDURE [dbo].[SetExchangeAccountMailboxplan] ( @AccountID int, @MailboxPlanId int, - @ArchivingMailboxPlanId int + @ArchivingMailboxPlanId int, + @EnableArchiving bit ) AS UPDATE ExchangeAccounts SET MailboxPlanId = @MailboxPlanId, - ArchivingMailboxPlanId = @ArchivingMailboxPlanId + ArchivingMailboxPlanId = @ArchivingMailboxPlanId, + EnableArchiving = @EnableArchiving WHERE AccountID = @AccountID @@ -4052,7 +4094,8 @@ ALTER PROCEDURE [dbo].[UpdateExchangeAccount] @Password varchar(200), @MailboxPlanId int, @ArchivingMailboxPlanId int, - @SubscriberNumber varchar(32) + @SubscriberNumber varchar(32), + @EnableArchiving bit ) AS @@ -4073,7 +4116,8 @@ UPDATE ExchangeAccounts SET SamAccountName = @SamAccountName, MailboxPlanId = @MailboxPlanId, SubscriberNumber = @SubscriberNumber, - ArchivingMailboxPlanId = @ArchivingMailboxPlanId + ArchivingMailboxPlanId = @ArchivingMailboxPlanId, + EnableArchiving = @EnableArchiving WHERE AccountID = @AccountID diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs index a351f386..888e9a0e 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs @@ -118,9 +118,12 @@ order by rg.groupOrder public const string EXCHANGE2007_ALLOWLITIGATIONHOLD = "Exchange2007.AllowLitigationHold"; public const string EXCHANGE2007_RECOVERABLEITEMSSPACE = "Exchange2007.RecoverableItemsSpace"; public const string EXCHANGE2007_DISCLAIMERSALLOWED = "Exchange2007.DisclaimersAllowed"; + + public const string EXCHANGE2013_ALLOWARCHIVING = "Exchange2013.AllowArchiving"; public const string EXCHANGE2013_ALLOWRETENTIONPOLICY = "Exchange2013.AllowRetentionPolicy"; // Archiving public const string EXCHANGE2013_ARCHIVINGSTORAGE = "Exchange2013.ArchivingStorage"; public const string EXCHANGE2013_ARCHIVINGMAILBOXES = "Exchange2013.ArchivingMailboxes"; + 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 dd7f085b..bc5a1571 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/ExchangeServerProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/ExchangeServerProxy.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2012, Outercurve Foundation. +// Copyright (c) 2014, Outercurve Foundation. // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, @@ -33,7 +33,6 @@ using WebsitePanel.Providers.HostedSolution; using WebsitePanel.Providers.OS; using WebsitePanel.Providers.ResultObjects; - //------------------------------------------------------------------------------ // // This code was generated by a tool. @@ -3436,7 +3435,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, int mailboxPlanId, int archivedPlanId, string subscriberNumber) { + 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, int archivedPlanId, string subscriberNumber, bool EnableArchiving) { object[] results = this.Invoke("CreateMailbox", new object[] { itemId, accountId, @@ -3450,12 +3449,29 @@ namespace WebsitePanel.EnterpriseServer { setupInstructionMailAddress, mailboxPlanId, archivedPlanId, - subscriberNumber}); + subscriberNumber, + EnableArchiving}); 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, int mailboxPlanId, int archivedPlanId, string subscriberNumber, 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, + int archivedPlanId, + string subscriberNumber, + bool EnableArchiving, + System.AsyncCallback callback, + object asyncState) { return this.BeginInvoke("CreateMailbox", new object[] { itemId, accountId, @@ -3469,7 +3485,8 @@ namespace WebsitePanel.EnterpriseServer { setupInstructionMailAddress, mailboxPlanId, archivedPlanId, - subscriberNumber}, callback, asyncState); + subscriberNumber, + EnableArchiving}, callback, asyncState); } /// @@ -3479,12 +3496,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, int mailboxPlanId, int archivedPlanId, string subscriberNumber) { - this.CreateMailboxAsync(itemId, accountId, accountType, accountName, displayName, name, domain, password, sendSetupInstructions, setupInstructionMailAddress, mailboxPlanId, archivedPlanId, 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, int mailboxPlanId, int archivedPlanId, string subscriberNumber, bool EnableArchiving) { + this.CreateMailboxAsync(itemId, accountId, accountType, accountName, displayName, name, domain, password, sendSetupInstructions, setupInstructionMailAddress, mailboxPlanId, archivedPlanId, subscriberNumber, EnableArchiving, 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, int archivedPlanId, string subscriberNumber, 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, int archivedPlanId, string subscriberNumber, bool EnableArchiving, object userState) { if ((this.CreateMailboxOperationCompleted == null)) { this.CreateMailboxOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateMailboxOperationCompleted); } @@ -3501,7 +3518,8 @@ namespace WebsitePanel.EnterpriseServer { setupInstructionMailAddress, mailboxPlanId, archivedPlanId, - subscriberNumber}, this.CreateMailboxOperationCompleted, userState); + subscriberNumber, + EnableArchiving}, this.CreateMailboxOperationCompleted, userState); } private void OnCreateMailboxOperationCompleted(object arg) { @@ -4033,22 +4051,24 @@ namespace WebsitePanel.EnterpriseServer { /// [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, int archivePlanId) { + public int SetExchangeMailboxPlan(int itemId, int accountId, int mailboxPlanId, int archivePlanId, bool EnableArchiving) { object[] results = this.Invoke("SetExchangeMailboxPlan", new object[] { itemId, accountId, mailboxPlanId, - archivePlanId}); + archivePlanId, + EnableArchiving}); return ((int)(results[0])); } /// - public System.IAsyncResult BeginSetExchangeMailboxPlan(int itemId, int accountId, int mailboxPlanId, int archivePlanId, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginSetExchangeMailboxPlan(int itemId, int accountId, int mailboxPlanId, int archivePlanId, bool EnableArchiving, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("SetExchangeMailboxPlan", new object[] { itemId, accountId, mailboxPlanId, - archivePlanId}, callback, asyncState); + archivePlanId, + EnableArchiving}, callback, asyncState); } /// @@ -4058,12 +4078,12 @@ namespace WebsitePanel.EnterpriseServer { } /// - public void SetExchangeMailboxPlanAsync(int itemId, int accountId, int mailboxPlanId, int archivePlanId) { - this.SetExchangeMailboxPlanAsync(itemId, accountId, mailboxPlanId, archivePlanId, null); + public void SetExchangeMailboxPlanAsync(int itemId, int accountId, int mailboxPlanId, int archivePlanId, bool EnableArchiving) { + this.SetExchangeMailboxPlanAsync(itemId, accountId, mailboxPlanId, archivePlanId, EnableArchiving, null); } /// - public void SetExchangeMailboxPlanAsync(int itemId, int accountId, int mailboxPlanId, int archivePlanId, object userState) { + public void SetExchangeMailboxPlanAsync(int itemId, int accountId, int mailboxPlanId, int archivePlanId, bool EnableArchiving, object userState) { if ((this.SetExchangeMailboxPlanOperationCompleted == null)) { this.SetExchangeMailboxPlanOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetExchangeMailboxPlanOperationCompleted); } @@ -4071,7 +4091,8 @@ namespace WebsitePanel.EnterpriseServer { itemId, accountId, mailboxPlanId, - archivePlanId}, this.SetExchangeMailboxPlanOperationCompleted, userState); + archivePlanId, + EnableArchiving}, this.SetExchangeMailboxPlanOperationCompleted, userState); } private void OnSetExchangeMailboxPlanOperationCompleted(object arg) { diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs index ff34801b..ef79edce 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs @@ -2570,7 +2570,8 @@ namespace WebsitePanel.EnterpriseServer public static void UpdateExchangeAccount(int accountId, string accountName, ExchangeAccountType accountType, string displayName, string primaryEmailAddress, bool mailEnabledPublicFolder, - string mailboxManagerActions, string samAccountName, string accountPassword, int mailboxPlanId, int archivePlanId, string subscriberNumber) + string mailboxManagerActions, string samAccountName, string accountPassword, int mailboxPlanId, int archivePlanId, string subscriberNumber, + bool EnableArchiving) { SqlHelper.ExecuteNonQuery( ConnectionString, @@ -2587,7 +2588,8 @@ namespace WebsitePanel.EnterpriseServer new SqlParameter("@SamAccountName", samAccountName), new SqlParameter("@MailboxPlanId", (mailboxPlanId == 0) ? (object)DBNull.Value : (object)mailboxPlanId), new SqlParameter("@ArchivingMailboxPlanId", (archivePlanId < 1) ? (object)DBNull.Value : (object)archivePlanId), - new SqlParameter("@SubscriberNumber", (string.IsNullOrEmpty(subscriberNumber) ? (object)DBNull.Value : (object)subscriberNumber)) + new SqlParameter("@SubscriberNumber", (string.IsNullOrEmpty(subscriberNumber) ? (object)DBNull.Value : (object)subscriberNumber)), + new SqlParameter("@EnableArchiving", EnableArchiving) ); } @@ -2785,7 +2787,7 @@ namespace WebsitePanel.EnterpriseServer bool isDefault, int issueWarningPct, int keepDeletedItemsDays, int mailboxSizeMB, int maxReceiveMessageSizeKB, int maxRecipients, int maxSendMessageSizeKB, int prohibitSendPct, int prohibitSendReceivePct, bool hideFromAddressBook, int mailboxPlanType, bool enabledLitigationHold, long recoverabelItemsSpace, long recoverabelItemsWarning, string litigationHoldUrl, string litigationHoldMsg, - bool archiving, bool EnableArchiving) + bool archiving, bool EnableArchiving, int ArchiveSizeMB, int ArchiveWarningPct) { SqlParameter outParam = new SqlParameter("@MailboxPlanId", SqlDbType.Int); outParam.Direction = ParameterDirection.Output; @@ -2819,7 +2821,9 @@ namespace WebsitePanel.EnterpriseServer new SqlParameter("@LitigationHoldUrl", litigationHoldUrl), new SqlParameter("@LitigationHoldMsg", litigationHoldMsg), new SqlParameter("@Archiving", archiving), - new SqlParameter("@EnableArchiving", EnableArchiving) + new SqlParameter("@EnableArchiving", EnableArchiving), + new SqlParameter("@ArchiveSizeMB", ArchiveSizeMB), + new SqlParameter("@ArchiveWarningPct", ArchiveWarningPct) ); return Convert.ToInt32(outParam.Value); @@ -2831,7 +2835,7 @@ namespace WebsitePanel.EnterpriseServer bool isDefault, int issueWarningPct, int keepDeletedItemsDays, int mailboxSizeMB, int maxReceiveMessageSizeKB, int maxRecipients, int maxSendMessageSizeKB, int prohibitSendPct, int prohibitSendReceivePct, bool hideFromAddressBook, int mailboxPlanType, bool enabledLitigationHold, long recoverabelItemsSpace, long recoverabelItemsWarning, string litigationHoldUrl, string litigationHoldMsg, - bool Archiving, bool EnableArchiving) + bool Archiving, bool EnableArchiving, int ArchiveSizeMB, int ArchiveWarningPct) { SqlHelper.ExecuteNonQuery( ConnectionString, @@ -2861,8 +2865,9 @@ namespace WebsitePanel.EnterpriseServer new SqlParameter("@LitigationHoldUrl", litigationHoldUrl), new SqlParameter("@LitigationHoldMsg", litigationHoldMsg), new SqlParameter("@Archiving", Archiving), - new SqlParameter("@EnableArchiving", EnableArchiving) - + new SqlParameter("@EnableArchiving", EnableArchiving), + new SqlParameter("@ArchiveSizeMB", ArchiveSizeMB), + new SqlParameter("@ArchiveWarningPct", ArchiveWarningPct) ); } @@ -2923,7 +2928,7 @@ namespace WebsitePanel.EnterpriseServer ); } - public static void SetExchangeAccountMailboxPlan(int accountId, int mailboxPlanId, int archivePlanId) + public static void SetExchangeAccountMailboxPlan(int accountId, int mailboxPlanId, int archivePlanId, bool EnableArchiving) { SqlHelper.ExecuteNonQuery( ConnectionString, @@ -2931,7 +2936,8 @@ namespace WebsitePanel.EnterpriseServer "SetExchangeAccountMailboxplan", new SqlParameter("@AccountID", accountId), new SqlParameter("@MailboxPlanId", (mailboxPlanId == 0) ? (object)DBNull.Value : (object)mailboxPlanId), - new SqlParameter("@ArchivingMailboxPlanId", (archivePlanId < 1) ? (object)DBNull.Value : (object)archivePlanId) + new SqlParameter("@ArchivingMailboxPlanId", (archivePlanId < 1) ? (object)DBNull.Value : (object)archivePlanId), + new SqlParameter("@EnableArchiving", EnableArchiving) ); } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs index 9ecbc2de..0083dc42 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs @@ -1224,7 +1224,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.MailboxPlanId, account.ArchivingMailboxPlanId, - (string.IsNullOrEmpty(account.SubscriberNumber) ? null : account.SubscriberNumber.Trim())); + (string.IsNullOrEmpty(account.SubscriberNumber) ? null : account.SubscriberNumber.Trim()), + account.EnableArchiving); } private static void DeleteAccount(int itemId, int accountId) @@ -1598,7 +1599,8 @@ namespace WebsitePanel.EnterpriseServer private static void UpdateExchangeAccount(int accountId, string accountName, ExchangeAccountType accountType, string displayName, string primaryEmailAddress, bool mailEnabledPublicFolder, - string mailboxManagerActions, string samAccountName, string accountPassword, int mailboxPlanId, int archivePlanId, string subscriberNumber) + string mailboxManagerActions, string samAccountName, string accountPassword, int mailboxPlanId, int archivePlanId, string subscriberNumber, + bool EnableArchiving) { DataProvider.UpdateExchangeAccount(accountId, accountName, @@ -1609,13 +1611,13 @@ namespace WebsitePanel.EnterpriseServer mailboxManagerActions, samAccountName, CryptoUtils.Encrypt(accountPassword), - mailboxPlanId, archivePlanId, - (string.IsNullOrEmpty(subscriberNumber) ? null : subscriberNumber.Trim())); + mailboxPlanId, archivePlanId, + (string.IsNullOrEmpty(subscriberNumber) ? null : subscriberNumber.Trim()), EnableArchiving); } 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, int archivedPlanId, string subscriberNumber) + string displayName, string name, string domain, string password, bool sendSetupInstructions, string setupInstructionMailAddress, int mailboxPlanId, int archivedPlanId, string subscriberNumber, bool EnableArchiving) { // check account int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); @@ -1724,6 +1726,24 @@ namespace WebsitePanel.EnterpriseServer return BusinessErrorCodes.ERROR_EXCHANGE_STORAGE_QUOTAS_EXCEED_HOST_VALUES; } + int maxArchivingStorage = -1; + int quotaArchivingStorageUsed = 0; + if (cntx.Quotas.ContainsKey(Quotas.EXCHANGE2013_ARCHIVINGSTORAGE) + && cntx.Quotas[Quotas.EXCHANGE2013_ARCHIVINGSTORAGE].QuotaAllocatedValue > 0) + { + maxArchivingStorage = cntx.Quotas[Quotas.EXCHANGE2013_ARCHIVINGSTORAGE].QuotaAllocatedValue; + quotaArchivingStorageUsed = cntx.Quotas[Quotas.EXCHANGE2013_ARCHIVINGSTORAGE].QuotaUsedValue; + } + + if (maxArchivingStorage != -1) + { + if (plan.MailboxSizeMB == -1) + return BusinessErrorCodes.ERROR_EXCHANGE_STORAGE_QUOTAS_EXCEED_HOST_VALUES; + + if ((quotaArchivingStorageUsed + plan.MailboxSizeMB) > (maxArchivingStorage)) + return BusinessErrorCodes.ERROR_EXCHANGE_STORAGE_QUOTAS_EXCEED_HOST_VALUES; + } + //GetServiceSettings StringDictionary primSettings = ServerController.GetServiceSettings(exchangeServiceId); @@ -1756,10 +1776,10 @@ namespace WebsitePanel.EnterpriseServer | MailboxManagerActions.EmailAddresses; - UpdateExchangeAccount(accountId, accountName, accountType, displayName, email, false, pmmActions.ToString(), samAccount, password, mailboxPlanId, archivedPlanId, subscriberNumber); + UpdateExchangeAccount(accountId, accountName, accountType, displayName, email, false, pmmActions.ToString(), samAccount, password, mailboxPlanId, archivedPlanId, subscriberNumber, EnableArchiving); ResultObject resPolicy = new ResultObject() { IsSuccess = true }; - SetMailBoxRetentionPolicy(itemId, archivedPlanId, accountName, exchange, org.OrganizationId, resPolicy); + SetMailBoxRetentionPolicyAndArchiving(itemId, mailboxPlanId, archivedPlanId, accountName, exchange, org.OrganizationId, resPolicy, EnableArchiving); if (!resPolicy.IsSuccess) { TaskManager.WriteError("Error SetMailBoxRetentionPolicy", resPolicy.ErrorCodes.ToArray()); @@ -2605,7 +2625,7 @@ namespace WebsitePanel.EnterpriseServer #region Mailbox plan - public static int SetExchangeMailboxPlan(int itemId, int accountId, int mailboxPlanId, int archivePlanId) + public static int SetExchangeMailboxPlan(int itemId, int accountId, int mailboxPlanId, int archivePlanId, bool EnableArchiving) { // check account int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); @@ -2707,13 +2727,13 @@ namespace WebsitePanel.EnterpriseServer plan.LitigationHoldMsg); ResultObject resPolicy = new ResultObject() { IsSuccess = true }; - SetMailBoxRetentionPolicy(itemId, archivePlanId, account.UserPrincipalName, exchange, org.OrganizationId, resPolicy); + SetMailBoxRetentionPolicyAndArchiving(itemId, mailboxPlanId, archivePlanId, account.UserPrincipalName, exchange, org.OrganizationId, resPolicy, EnableArchiving); if (!resPolicy.IsSuccess) { TaskManager.WriteError("Error SetMailBoxRetentionPolicy", resPolicy.ErrorCodes.ToArray()); } - DataProvider.SetExchangeAccountMailboxPlan(accountId, mailboxPlanId, archivePlanId); + DataProvider.SetExchangeAccountMailboxPlan(accountId, mailboxPlanId, archivePlanId, EnableArchiving); return 0; } @@ -2893,7 +2913,8 @@ namespace WebsitePanel.EnterpriseServer mailboxPlan.IsDefault, mailboxPlan.IssueWarningPct, mailboxPlan.KeepDeletedItemsDays, mailboxPlan.MailboxSizeMB, mailboxPlan.MaxReceiveMessageSizeKB, mailboxPlan.MaxRecipients, mailboxPlan.MaxSendMessageSizeKB, mailboxPlan.ProhibitSendPct, mailboxPlan.ProhibitSendReceivePct, mailboxPlan.HideFromAddressBook, mailboxPlan.MailboxPlanType, mailboxPlan.AllowLitigationHold, mailboxPlan.RecoverableItemsSpace, mailboxPlan.RecoverableItemsWarningPct, - mailboxPlan.LitigationHoldUrl, mailboxPlan.LitigationHoldMsg, mailboxPlan.Archiving, mailboxPlan.EnableArchiving); + mailboxPlan.LitigationHoldUrl, mailboxPlan.LitigationHoldMsg, mailboxPlan.Archiving, mailboxPlan.EnableArchiving, + mailboxPlan.ArchiveSizeMB, mailboxPlan.ArchiveWarningPct); } catch (Exception ex) { @@ -2964,7 +2985,8 @@ namespace WebsitePanel.EnterpriseServer mailboxPlan.MaxSendMessageSizeKB, mailboxPlan.ProhibitSendPct, mailboxPlan.ProhibitSendReceivePct, mailboxPlan.HideFromAddressBook, mailboxPlan.MailboxPlanType, mailboxPlan.AllowLitigationHold, mailboxPlan.RecoverableItemsSpace, mailboxPlan.RecoverableItemsWarningPct, mailboxPlan.LitigationHoldUrl, mailboxPlan.LitigationHoldMsg, - mailboxPlan.Archiving, mailboxPlan.EnableArchiving); + mailboxPlan.Archiving, mailboxPlan.EnableArchiving, + mailboxPlan.ArchiveSizeMB, mailboxPlan.ArchiveWarningPct); } catch (Exception ex) { @@ -3027,22 +3049,25 @@ namespace WebsitePanel.EnterpriseServer #region Exchange Retention Policy Tags - private static void SetMailBoxRetentionPolicy(int itemId, int retentionPolicyId, string accountName, ExchangeServer exchange, string orgId, ResultObject result) + private static void SetMailBoxRetentionPolicyAndArchiving(int itemId, int mailboxPlanId, int retentionPolicyId, string accountName, ExchangeServer exchange, string orgId, ResultObject result, bool EnableArchiving) { - bool archive = false; long archiveQuotaKB = 0; long archiveWarningQuotaKB = 0; string RetentionPolicy = ""; if (retentionPolicyId > 0) { + ExchangeMailboxPlan mailboxPlan = GetExchangeMailboxPlan(itemId, mailboxPlanId); + if ( mailboxPlan != null) + { + archiveQuotaKB = mailboxPlan.ArchiveSizeMB != -1 ? ((long)mailboxPlan.ArchiveSizeMB * 1024) : -1; + archiveWarningQuotaKB = mailboxPlan.ArchiveSizeMB != -1 ? (((long)mailboxPlan.ArchiveWarningPct * (long) mailboxPlan.ArchiveSizeMB * 1024) / 100) : -1; + } + + ExchangeMailboxPlan retentionPolicy = GetExchangeMailboxPlan(itemId, retentionPolicyId); if (retentionPolicy != null) { - archive = retentionPolicy.EnableArchiving; - archiveQuotaKB = retentionPolicy.MailboxSizeMB != -1 ? ((long)retentionPolicy.MailboxSizeMB * 1024) : -1; - archiveWarningQuotaKB = retentionPolicy.MailboxSizeMB != -1 ? (((long)retentionPolicy.IssueWarningPct * (long)retentionPolicy.MailboxSizeMB * 1024) / 100) : -1; - // update PlanRetentionPolicy and Tags List listtags = GetExchangeMailboxPlanRetentionPolicyTags(retentionPolicyId); foreach(ExchangeMailboxPlanRetentionPolicyTag listtag in listtags) @@ -3056,7 +3081,7 @@ namespace WebsitePanel.EnterpriseServer } } - ResultObject res = exchange.SetMailBoxArchiving(orgId, accountName, archive, archiveQuotaKB, archiveWarningQuotaKB, RetentionPolicy); + ResultObject res = exchange.SetMailBoxArchiving(orgId, accountName, EnableArchiving, archiveQuotaKB, archiveWarningQuotaKB, RetentionPolicy); result.ErrorCodes.AddRange(res.ErrorCodes); result.IsSuccess = result.IsSuccess && res.IsSuccess; } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs index c1c58d8f..0bde22d7 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs @@ -2121,7 +2121,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.MailboxPlanId, account.ArchivingMailboxPlanId, - (string.IsNullOrEmpty(account.SubscriberNumber) ? null : account.SubscriberNumber.Trim())); + (string.IsNullOrEmpty(account.SubscriberNumber) ? null : account.SubscriberNumber.Trim()), + account.EnableArchiving); } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esExchangeServer.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esExchangeServer.asmx.cs index cd7990be..8295d09d 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esExchangeServer.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esExchangeServer.asmx.cs @@ -222,9 +222,9 @@ namespace WebsitePanel.EnterpriseServer #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, int archivedPlanId, string subscriberNumber) + string name, string domain, string password, bool sendSetupInstructions, string setupInstructionMailAddress, int mailboxPlanId, int archivedPlanId, string subscriberNumber, bool EnableArchiving) { - return ExchangeServerController.CreateMailbox(itemId, accountId, accountType, accountName, displayName, name, domain, password, sendSetupInstructions, setupInstructionMailAddress, mailboxPlanId, archivedPlanId, subscriberNumber); + return ExchangeServerController.CreateMailbox(itemId, accountId, accountType, accountName, displayName, name, domain, password, sendSetupInstructions, setupInstructionMailAddress, mailboxPlanId, archivedPlanId, subscriberNumber, EnableArchiving); } [WebMethod] @@ -303,9 +303,9 @@ namespace WebsitePanel.EnterpriseServer [WebMethod] - public int SetExchangeMailboxPlan(int itemId, int accountId, int mailboxPlanId, int archivePlanId) + public int SetExchangeMailboxPlan(int itemId, int accountId, int mailboxPlanId, int archivePlanId, bool EnableArchiving) { - return ExchangeServerController.SetExchangeMailboxPlan(itemId, accountId, mailboxPlanId, archivePlanId); + return ExchangeServerController.SetExchangeMailboxPlan(itemId, accountId, mailboxPlanId, archivePlanId, EnableArchiving); } [WebMethod] diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeAccount.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeAccount.cs index 55d9c97d..ebcf44fa 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeAccount.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeAccount.cs @@ -170,6 +170,13 @@ namespace WebsitePanel.Providers.HostedSolution set { this.archivingMailboxPlan = value; } } + bool enableArchiving; + public bool EnableArchiving + { + get { return this.enableArchiving; } + set { this.enableArchiving = value; } + } + } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeMailboxPlan.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeMailboxPlan.cs index b5633a2e..03435769 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeMailboxPlan.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeMailboxPlan.cs @@ -225,6 +225,20 @@ namespace WebsitePanel.Providers.HostedSolution set { this.enableArchiving = value; } } + int archiveSizeMB; + public int ArchiveSizeMB + { + get { return this.archiveSizeMB; } + set { this.archiveSizeMB = value; } + } + + int archiveWarningPct; + public int ArchiveWarningPct + { + get { return this.archiveWarningPct; } + set { this.archiveWarningPct = value; } + } + public string WSPUniqueName { get diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeMailboxStatistics.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeMailboxStatistics.cs index ba9095a1..80cd784c 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeMailboxStatistics.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeMailboxStatistics.cs @@ -55,5 +55,11 @@ namespace WebsitePanel.Providers.HostedSolution public ExchangeAccountType MailboxType { get; set; } public bool BlackberryEnabled { get; set; } public string MailboxPlan { get; set; } + + + public long ArchivingTotalSize { get; set; } + public long ArchivingTotalItems { get; set; } + public long ArchivingMaxSize { get; set; } + } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddMailboxPlan.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddMailboxPlan.ascx.cs index 40361bd5..da41fa92 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddMailboxPlan.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddMailboxPlan.ascx.cs @@ -91,11 +91,6 @@ namespace WebsitePanel.Portal.ExchangeServer if (RetentionPolicy) { - chkEnableArchiving.Checked = plan.EnableArchiving; - - archiveQuota.QuotaValue = plan.MailboxSizeMB; - archiveWarningQuota.ValueKB = plan.IssueWarningPct; - List tags = new List(); tags.AddRange(ES.Services.ExchangeServer.GetExchangeMailboxPlanRetentionPolicyTags(plan.MailboxPlanId)); @@ -124,6 +119,11 @@ namespace WebsitePanel.Portal.ExchangeServer recoverableItemsWarning.ValueKB = plan.RecoverableItemsWarningPct; txtLitigationHoldMsg.Text = plan.LitigationHoldMsg; txtLitigationHoldUrl.Text = plan.LitigationHoldUrl; + + chkEnableArchiving.Checked = plan.EnableArchiving; + archiveQuota.QuotaValue = plan.ArchiveSizeMB; + archiveWarningQuota.ValueKB = plan.ArchiveWarningPct; + } locTitle.Text = plan.MailboxPlan; @@ -198,7 +198,7 @@ namespace WebsitePanel.Portal.ExchangeServer RetentionPolicy = PanelRequest.GetBool("archiving", false); - if (RetentionPolicy) + if (!RetentionPolicy) { chkEnableArchiving.Checked = true; archiveQuota.QuotaValue = cntx.Quotas[Quotas.EXCHANGE2013_ARCHIVINGSTORAGE].QuotaAllocatedValue; @@ -230,7 +230,8 @@ namespace WebsitePanel.Portal.ExchangeServer secDeleteRetention.Visible = !RetentionPolicy; secLitigationHold.Visible = !RetentionPolicy; - secArchiving.Visible = RetentionPolicy; + secArchiving.Visible = !RetentionPolicy; + secRetentionPolicyTags.Visible = RetentionPolicy; valRequireMailboxPlan.ValidationGroup = MainValidationGroup; @@ -283,11 +284,6 @@ namespace WebsitePanel.Portal.ExchangeServer if (RetentionPolicy) { - plan.EnableArchiving = chkEnableArchiving.Checked; - - plan.MailboxSizeMB = archiveQuota.QuotaValue; - plan.IssueWarningPct = archiveWarningQuota.ValueKB; - if ((plan.IssueWarningPct == 0)) plan.IssueWarningPct = 100; } else @@ -317,6 +313,13 @@ namespace WebsitePanel.Portal.ExchangeServer if ((plan.RecoverableItemsWarningPct == 0)) plan.RecoverableItemsWarningPct = 100; plan.LitigationHoldMsg = txtLitigationHoldMsg.Text.Trim(); plan.LitigationHoldUrl = txtLitigationHoldUrl.Text.Trim(); + + plan.EnableArchiving = chkEnableArchiving.Checked; + + plan.ArchiveSizeMB = archiveQuota.QuotaValue; + plan.ArchiveWarningPct = archiveWarningQuota.ValueKB; + if ((plan.ArchiveWarningPct == 0)) plan.ArchiveWarningPct = 100; + } int planId = ES.Services.ExchangeServer.AddExchangeMailboxPlan(PanelRequest.ItemID, diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx index 46de6827..3388837e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx @@ -147,6 +147,13 @@ + + + + + + + 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 c4a55052..9bc3ca63 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx.cs @@ -101,6 +101,7 @@ namespace WebsitePanel.Portal.ExchangeServer } rowRetentionPolicy.Visible = Utils.CheckQouta(Quotas.EXCHANGE2013_ALLOWRETENTIONPOLICY, cntx); + rowArchiving.Visible = Utils.CheckQouta(Quotas.EXCHANGE2013_ALLOWARCHIVING, cntx); } } @@ -121,6 +122,8 @@ namespace WebsitePanel.Portal.ExchangeServer string displayName = IsNewUser ? txtDisplayName.Text.Trim() : userSelector.GetDisplayName(); string accountName = IsNewUser ? string.Empty : userSelector.GetAccount(); + bool enableArchive = chkEnableArchiving.Checked; + ExchangeAccountType type = IsNewUser ? (ExchangeAccountType)Utils.ParseInt(rbMailboxType.SelectedValue, 1) : ExchangeAccountType.Mailbox; @@ -141,7 +144,7 @@ namespace WebsitePanel.Portal.ExchangeServer sendInstructionEmail.Text, Convert.ToInt32(mailboxPlanSelector.MailboxPlanId), Convert.ToInt32(archivingMailboxPlanSelector.MailboxPlanId), - subscriberNumber); + subscriberNumber, enableArchive); if (accountId < 0) 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 af351b6d..63287c31 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 @@ -336,6 +336,24 @@ namespace WebsitePanel.Portal.ExchangeServer { /// protected global::WebsitePanel.Portal.ExchangeServer.UserControls.MailboxPlanSelector archivingMailboxPlanSelector; + /// + /// rowArchiving control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlTableRow rowArchiving; + + /// + /// chkEnableArchiving control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkEnableArchiving; + /// /// chkSendInstructions control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx index 03be3f5b..d3764b2f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx @@ -49,7 +49,7 @@ - + @@ -80,13 +80,8 @@ - - - - - - - + +