Fix archiving

This commit is contained in:
dev_amdtel 2014-05-15 20:52:56 +04:00
parent 2170367f8f
commit 56cf823559
19 changed files with 371 additions and 179 deletions

View file

@ -3451,18 +3451,18 @@ GO
-- Exchange2013 Archiving -- Exchange2013 Archiving
-- Exchange2013 Archiving Quotas -- Exchange2013 Archiving Quotas
IF EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Exchange2013.AllowArchiving') IF EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaID] = 424)
BEGIN BEGIN
UPDATE [dbo].[Quotas] SET [QuotaName]=N'Exchange2013.AllowRetentionPolicy', [QuotaDescription]=N'Allow Retention Policy' UPDATE [dbo].[Quotas] SET [QuotaName]=N'Exchange2013.AllowRetentionPolicy', [QuotaDescription]=N'Allow Retention Policy'
WHERE [QuotaName] = 'Exchange2013.AllowArchiving' WHERE [QuotaID] = 424
END END
GO GO
IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Exchange2013.AllowRetentionPolicy') IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Exchange2013.AllowRetentionPolicy')
BEGIN BEGIN
INSERT [dbo].[Quotas] ([QuotaID], [GroupID],[QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) 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 END
GO GO
IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Exchange2013.ArchivingStorage') IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Exchange2013.ArchivingStorage')
BEGIN BEGIN
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) 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 END
GO 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 -- 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') 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 BEGIN
@ -3500,6 +3507,15 @@ ALTER TABLE [dbo].[ExchangeMailboxPlans] ADD
END END
GO 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] ALTER PROCEDURE [dbo].[AddExchangeMailboxPlan]
( (
@MailboxPlanId int OUTPUT, @MailboxPlanId int OUTPUT,
@ -3527,7 +3543,9 @@ ALTER PROCEDURE [dbo].[AddExchangeMailboxPlan]
@LitigationHoldUrl nvarchar(256), @LitigationHoldUrl nvarchar(256),
@LitigationHoldMsg nvarchar(512), @LitigationHoldMsg nvarchar(512),
@Archiving bit, @Archiving bit,
@EnableArchiving bit @EnableArchiving bit,
@ArchiveSizeMB int,
@ArchiveWarningPct int
) )
AS AS
@ -3569,7 +3587,9 @@ INSERT INTO ExchangeMailboxPlans
LitigationHoldUrl, LitigationHoldUrl,
LitigationHoldMsg, LitigationHoldMsg,
Archiving, Archiving,
EnableArchiving EnableArchiving,
ArchiveSizeMB,
ArchiveWarningPct
) )
VALUES VALUES
( (
@ -3597,7 +3617,9 @@ VALUES
@LitigationHoldUrl, @LitigationHoldUrl,
@LitigationHoldMsg, @LitigationHoldMsg,
@Archiving, @Archiving,
@EnableArchiving @EnableArchiving,
@ArchiveSizeMB,
@ArchiveWarningPct
) )
SET @MailboxPlanId = SCOPE_IDENTITY() SET @MailboxPlanId = SCOPE_IDENTITY()
@ -3632,7 +3654,9 @@ ALTER PROCEDURE [dbo].[UpdateExchangeMailboxPlan]
@LitigationHoldUrl nvarchar(256), @LitigationHoldUrl nvarchar(256),
@LitigationHoldMsg nvarchar(512), @LitigationHoldMsg nvarchar(512),
@Archiving bit, @Archiving bit,
@EnableArchiving bit @EnableArchiving bit,
@ArchiveSizeMB int,
@ArchiveWarningPct int
) )
AS AS
@ -3660,9 +3684,9 @@ UPDATE ExchangeMailboxPlans SET
LitigationHoldUrl = @LitigationHoldUrl, LitigationHoldUrl = @LitigationHoldUrl,
LitigationHoldMsg = @LitigationHoldMsg, LitigationHoldMsg = @LitigationHoldMsg,
Archiving = @Archiving, Archiving = @Archiving,
EnableArchiving = @EnableArchiving EnableArchiving = @EnableArchiving,
ArchiveSizeMB = @ArchiveSizeMB,
ArchiveWarningPct = @ArchiveWarningPct
WHERE MailboxPlanId = @MailboxPlanId WHERE MailboxPlanId = @MailboxPlanId
RETURN RETURN
@ -3698,7 +3722,9 @@ SELECT
HideFromAddressBook, HideFromAddressBook,
MailboxPlanType, MailboxPlanType,
Archiving, Archiving,
EnableArchiving EnableArchiving,
ArchiveSizeMB,
ArchiveWarningPct
FROM FROM
ExchangeMailboxPlans ExchangeMailboxPlans
WHERE WHERE
@ -3741,7 +3767,9 @@ SELECT
LitigationHoldUrl, LitigationHoldUrl,
LitigationHoldMsg, LitigationHoldMsg,
Archiving, Archiving,
EnableArchiving EnableArchiving,
ArchiveSizeMB,
ArchiveWarningPct
FROM FROM
ExchangeMailboxPlans ExchangeMailboxPlans
WHERE WHERE
@ -3759,6 +3787,13 @@ ALTER TABLE [dbo].[ExchangeAccounts] ADD
END END
GO 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] ALTER PROCEDURE [dbo].[GetExchangeAccount]
( (
@ItemID int, @ItemID int,
@ -3781,7 +3816,8 @@ SELECT
E.SubscriberNumber, E.SubscriberNumber,
E.UserPrincipalName, E.UserPrincipalName,
E.ArchivingMailboxPlanId, E.ArchivingMailboxPlanId,
AP.MailboxPlan as 'ArchivingMailboxPlan' AP.MailboxPlan as 'ArchivingMailboxPlan',
E.EnableArchiving
FROM FROM
ExchangeAccounts AS E ExchangeAccounts AS E
LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId
@ -3816,7 +3852,8 @@ SELECT
E.SubscriberNumber, E.SubscriberNumber,
E.UserPrincipalName, E.UserPrincipalName,
E.ArchivingMailboxPlanId, E.ArchivingMailboxPlanId,
AP.MailboxPlan as 'ArchivingMailboxPlan' AP.MailboxPlan as 'ArchivingMailboxPlan',
E.EnableArchiving
FROM FROM
ExchangeAccounts AS E ExchangeAccounts AS E
LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId
@ -3857,7 +3894,8 @@ SELECT
E.SubscriberNumber, E.SubscriberNumber,
E.UserPrincipalName, E.UserPrincipalName,
E.ArchivingMailboxPlanId, E.ArchivingMailboxPlanId,
AP.MailboxPlan as 'ArchivingMailboxPlan' AP.MailboxPlan as 'ArchivingMailboxPlan',
E.EnableArchiving
FROM FROM
ExchangeAccounts AS E ExchangeAccounts AS E
LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId
@ -3888,7 +3926,8 @@ SELECT
E.SubscriberNumber, E.SubscriberNumber,
E.UserPrincipalName, E.UserPrincipalName,
E.ArchivingMailboxPlanId, E.ArchivingMailboxPlanId,
AP.MailboxPlan as 'ArchivingMailboxPlan' AP.MailboxPlan as 'ArchivingMailboxPlan',
E.EnableArchiving
FROM FROM
ExchangeAccounts AS E ExchangeAccounts AS E
LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId
@ -3915,7 +3954,8 @@ SELECT
E.SubscriberNumber, E.SubscriberNumber,
E.UserPrincipalName, E.UserPrincipalName,
E.ArchivingMailboxPlanId, E.ArchivingMailboxPlanId,
AP.MailboxPlan as 'ArchivingMailboxPlan' AP.MailboxPlan as 'ArchivingMailboxPlan',
E.EnableArchiving
FROM FROM
ExchangeAccounts AS E ExchangeAccounts AS E
LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId
@ -4024,13 +4064,15 @@ ALTER PROCEDURE [dbo].[SetExchangeAccountMailboxplan]
( (
@AccountID int, @AccountID int,
@MailboxPlanId int, @MailboxPlanId int,
@ArchivingMailboxPlanId int @ArchivingMailboxPlanId int,
@EnableArchiving bit
) )
AS AS
UPDATE ExchangeAccounts SET UPDATE ExchangeAccounts SET
MailboxPlanId = @MailboxPlanId, MailboxPlanId = @MailboxPlanId,
ArchivingMailboxPlanId = @ArchivingMailboxPlanId ArchivingMailboxPlanId = @ArchivingMailboxPlanId,
EnableArchiving = @EnableArchiving
WHERE WHERE
AccountID = @AccountID AccountID = @AccountID
@ -4052,7 +4094,8 @@ ALTER PROCEDURE [dbo].[UpdateExchangeAccount]
@Password varchar(200), @Password varchar(200),
@MailboxPlanId int, @MailboxPlanId int,
@ArchivingMailboxPlanId int, @ArchivingMailboxPlanId int,
@SubscriberNumber varchar(32) @SubscriberNumber varchar(32),
@EnableArchiving bit
) )
AS AS
@ -4073,7 +4116,8 @@ UPDATE ExchangeAccounts SET
SamAccountName = @SamAccountName, SamAccountName = @SamAccountName,
MailboxPlanId = @MailboxPlanId, MailboxPlanId = @MailboxPlanId,
SubscriberNumber = @SubscriberNumber, SubscriberNumber = @SubscriberNumber,
ArchivingMailboxPlanId = @ArchivingMailboxPlanId ArchivingMailboxPlanId = @ArchivingMailboxPlanId,
EnableArchiving = @EnableArchiving
WHERE WHERE
AccountID = @AccountID AccountID = @AccountID

View file

@ -118,9 +118,12 @@ order by rg.groupOrder
public const string EXCHANGE2007_ALLOWLITIGATIONHOLD = "Exchange2007.AllowLitigationHold"; public const string EXCHANGE2007_ALLOWLITIGATIONHOLD = "Exchange2007.AllowLitigationHold";
public const string EXCHANGE2007_RECOVERABLEITEMSSPACE = "Exchange2007.RecoverableItemsSpace"; public const string EXCHANGE2007_RECOVERABLEITEMSSPACE = "Exchange2007.RecoverableItemsSpace";
public const string EXCHANGE2007_DISCLAIMERSALLOWED = "Exchange2007.DisclaimersAllowed"; 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_ALLOWRETENTIONPOLICY = "Exchange2013.AllowRetentionPolicy"; // Archiving
public const string EXCHANGE2013_ARCHIVINGSTORAGE = "Exchange2013.ArchivingStorage"; public const string EXCHANGE2013_ARCHIVINGSTORAGE = "Exchange2013.ArchivingStorage";
public const string EXCHANGE2013_ARCHIVINGMAILBOXES = "Exchange2013.ArchivingMailboxes"; public const string EXCHANGE2013_ARCHIVINGMAILBOXES = "Exchange2013.ArchivingMailboxes";
public const string MSSQL2000_DATABASES = "MsSQL2000.Databases"; // Databases public const string MSSQL2000_DATABASES = "MsSQL2000.Databases"; // Databases
public const string MSSQL2000_USERS = "MsSQL2000.Users"; // Users public const string MSSQL2000_USERS = "MsSQL2000.Users"; // Users
public const string MSSQL2000_MAXDATABASESIZE = "MsSQL2000.MaxDatabaseSize"; // Max Database Size public const string MSSQL2000_MAXDATABASESIZE = "MsSQL2000.MaxDatabaseSize"; // Max Database Size

View file

@ -1,4 +1,4 @@
// Copyright (c) 2012, Outercurve Foundation. // Copyright (c) 2014, Outercurve Foundation.
// All rights reserved. // All rights reserved.
// //
// Redistribution and use in source and binary forms, with or without modification, // 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.OS;
using WebsitePanel.Providers.ResultObjects; using WebsitePanel.Providers.ResultObjects;
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.
@ -3436,7 +3435,7 @@ namespace WebsitePanel.EnterpriseServer {
/// <remarks/> /// <remarks/>
[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)] [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[] { object[] results = this.Invoke("CreateMailbox", new object[] {
itemId, itemId,
accountId, accountId,
@ -3450,12 +3449,29 @@ namespace WebsitePanel.EnterpriseServer {
setupInstructionMailAddress, setupInstructionMailAddress,
mailboxPlanId, mailboxPlanId,
archivedPlanId, archivedPlanId,
subscriberNumber}); subscriberNumber,
EnableArchiving});
return ((int)(results[0])); return ((int)(results[0]));
} }
/// <remarks/> /// <remarks/>
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[] { return this.BeginInvoke("CreateMailbox", new object[] {
itemId, itemId,
accountId, accountId,
@ -3469,7 +3485,8 @@ namespace WebsitePanel.EnterpriseServer {
setupInstructionMailAddress, setupInstructionMailAddress,
mailboxPlanId, mailboxPlanId,
archivedPlanId, archivedPlanId,
subscriberNumber}, callback, asyncState); subscriberNumber,
EnableArchiving}, callback, asyncState);
} }
/// <remarks/> /// <remarks/>
@ -3479,12 +3496,12 @@ namespace WebsitePanel.EnterpriseServer {
} }
/// <remarks/> /// <remarks/>
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) { 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, null); this.CreateMailboxAsync(itemId, accountId, accountType, accountName, displayName, name, domain, password, sendSetupInstructions, setupInstructionMailAddress, mailboxPlanId, archivedPlanId, subscriberNumber, EnableArchiving, null);
} }
/// <remarks/> /// <remarks/>
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)) { if ((this.CreateMailboxOperationCompleted == null)) {
this.CreateMailboxOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateMailboxOperationCompleted); this.CreateMailboxOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateMailboxOperationCompleted);
} }
@ -3501,7 +3518,8 @@ namespace WebsitePanel.EnterpriseServer {
setupInstructionMailAddress, setupInstructionMailAddress,
mailboxPlanId, mailboxPlanId,
archivedPlanId, archivedPlanId,
subscriberNumber}, this.CreateMailboxOperationCompleted, userState); subscriberNumber,
EnableArchiving}, this.CreateMailboxOperationCompleted, userState);
} }
private void OnCreateMailboxOperationCompleted(object arg) { private void OnCreateMailboxOperationCompleted(object arg) {
@ -4033,22 +4051,24 @@ namespace WebsitePanel.EnterpriseServer {
/// <remarks/> /// <remarks/>
[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)] [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[] { object[] results = this.Invoke("SetExchangeMailboxPlan", new object[] {
itemId, itemId,
accountId, accountId,
mailboxPlanId, mailboxPlanId,
archivePlanId}); archivePlanId,
EnableArchiving});
return ((int)(results[0])); return ((int)(results[0]));
} }
/// <remarks/> /// <remarks/>
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[] { return this.BeginInvoke("SetExchangeMailboxPlan", new object[] {
itemId, itemId,
accountId, accountId,
mailboxPlanId, mailboxPlanId,
archivePlanId}, callback, asyncState); archivePlanId,
EnableArchiving}, callback, asyncState);
} }
/// <remarks/> /// <remarks/>
@ -4058,12 +4078,12 @@ namespace WebsitePanel.EnterpriseServer {
} }
/// <remarks/> /// <remarks/>
public void SetExchangeMailboxPlanAsync(int itemId, int accountId, int mailboxPlanId, int archivePlanId) { public void SetExchangeMailboxPlanAsync(int itemId, int accountId, int mailboxPlanId, int archivePlanId, bool EnableArchiving) {
this.SetExchangeMailboxPlanAsync(itemId, accountId, mailboxPlanId, archivePlanId, null); this.SetExchangeMailboxPlanAsync(itemId, accountId, mailboxPlanId, archivePlanId, EnableArchiving, null);
} }
/// <remarks/> /// <remarks/>
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)) { if ((this.SetExchangeMailboxPlanOperationCompleted == null)) {
this.SetExchangeMailboxPlanOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetExchangeMailboxPlanOperationCompleted); this.SetExchangeMailboxPlanOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetExchangeMailboxPlanOperationCompleted);
} }
@ -4071,7 +4091,8 @@ namespace WebsitePanel.EnterpriseServer {
itemId, itemId,
accountId, accountId,
mailboxPlanId, mailboxPlanId,
archivePlanId}, this.SetExchangeMailboxPlanOperationCompleted, userState); archivePlanId,
EnableArchiving}, this.SetExchangeMailboxPlanOperationCompleted, userState);
} }
private void OnSetExchangeMailboxPlanOperationCompleted(object arg) { private void OnSetExchangeMailboxPlanOperationCompleted(object arg) {

View file

@ -2570,7 +2570,8 @@ namespace WebsitePanel.EnterpriseServer
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 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( SqlHelper.ExecuteNonQuery(
ConnectionString, ConnectionString,
@ -2587,7 +2588,8 @@ namespace WebsitePanel.EnterpriseServer
new SqlParameter("@SamAccountName", samAccountName), new SqlParameter("@SamAccountName", samAccountName),
new SqlParameter("@MailboxPlanId", (mailboxPlanId == 0) ? (object)DBNull.Value : (object)mailboxPlanId), 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("@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, bool isDefault, int issueWarningPct, int keepDeletedItemsDays, int mailboxSizeMB, int maxReceiveMessageSizeKB, int maxRecipients,
int maxSendMessageSizeKB, int prohibitSendPct, int prohibitSendReceivePct, bool hideFromAddressBook, int mailboxPlanType, int maxSendMessageSizeKB, int prohibitSendPct, int prohibitSendReceivePct, bool hideFromAddressBook, int mailboxPlanType,
bool enabledLitigationHold, long recoverabelItemsSpace, long recoverabelItemsWarning, string litigationHoldUrl, string litigationHoldMsg, 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); SqlParameter outParam = new SqlParameter("@MailboxPlanId", SqlDbType.Int);
outParam.Direction = ParameterDirection.Output; outParam.Direction = ParameterDirection.Output;
@ -2819,7 +2821,9 @@ namespace WebsitePanel.EnterpriseServer
new SqlParameter("@LitigationHoldUrl", litigationHoldUrl), new SqlParameter("@LitigationHoldUrl", litigationHoldUrl),
new SqlParameter("@LitigationHoldMsg", litigationHoldMsg), new SqlParameter("@LitigationHoldMsg", litigationHoldMsg),
new SqlParameter("@Archiving", archiving), 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); return Convert.ToInt32(outParam.Value);
@ -2831,7 +2835,7 @@ namespace WebsitePanel.EnterpriseServer
bool isDefault, int issueWarningPct, int keepDeletedItemsDays, int mailboxSizeMB, int maxReceiveMessageSizeKB, int maxRecipients, bool isDefault, int issueWarningPct, int keepDeletedItemsDays, int mailboxSizeMB, int maxReceiveMessageSizeKB, int maxRecipients,
int maxSendMessageSizeKB, int prohibitSendPct, int prohibitSendReceivePct, bool hideFromAddressBook, int mailboxPlanType, int maxSendMessageSizeKB, int prohibitSendPct, int prohibitSendReceivePct, bool hideFromAddressBook, int mailboxPlanType,
bool enabledLitigationHold, long recoverabelItemsSpace, long recoverabelItemsWarning, string litigationHoldUrl, string litigationHoldMsg, bool enabledLitigationHold, long recoverabelItemsSpace, long recoverabelItemsWarning, string litigationHoldUrl, string litigationHoldMsg,
bool Archiving, bool EnableArchiving) bool Archiving, bool EnableArchiving, int ArchiveSizeMB, int ArchiveWarningPct)
{ {
SqlHelper.ExecuteNonQuery( SqlHelper.ExecuteNonQuery(
ConnectionString, ConnectionString,
@ -2861,8 +2865,9 @@ namespace WebsitePanel.EnterpriseServer
new SqlParameter("@LitigationHoldUrl", litigationHoldUrl), new SqlParameter("@LitigationHoldUrl", litigationHoldUrl),
new SqlParameter("@LitigationHoldMsg", litigationHoldMsg), new SqlParameter("@LitigationHoldMsg", litigationHoldMsg),
new SqlParameter("@Archiving", Archiving), 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( SqlHelper.ExecuteNonQuery(
ConnectionString, ConnectionString,
@ -2931,7 +2936,8 @@ namespace WebsitePanel.EnterpriseServer
"SetExchangeAccountMailboxplan", "SetExchangeAccountMailboxplan",
new SqlParameter("@AccountID", accountId), new SqlParameter("@AccountID", accountId),
new SqlParameter("@MailboxPlanId", (mailboxPlanId == 0) ? (object)DBNull.Value : (object)mailboxPlanId), 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)
); );
} }

View file

@ -1224,7 +1224,8 @@ namespace WebsitePanel.EnterpriseServer
DataProvider.UpdateExchangeAccount(account.AccountId, account.AccountName, account.AccountType, account.DisplayName, DataProvider.UpdateExchangeAccount(account.AccountId, account.AccountName, account.AccountType, account.DisplayName,
account.PrimaryEmailAddress, account.MailEnabledPublicFolder, account.PrimaryEmailAddress, account.MailEnabledPublicFolder,
account.MailboxManagerActions.ToString(), account.SamAccountName, account.AccountPassword, account.MailboxPlanId, account.ArchivingMailboxPlanId, 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) 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, private static void UpdateExchangeAccount(int accountId, string accountName, ExchangeAccountType accountType,
string displayName, string primaryEmailAddress, bool mailEnabledPublicFolder, 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, DataProvider.UpdateExchangeAccount(accountId,
accountName, accountName,
@ -1609,13 +1611,13 @@ namespace WebsitePanel.EnterpriseServer
mailboxManagerActions, mailboxManagerActions,
samAccountName, samAccountName,
CryptoUtils.Encrypt(accountPassword), CryptoUtils.Encrypt(accountPassword),
mailboxPlanId, archivePlanId, mailboxPlanId, archivePlanId,
(string.IsNullOrEmpty(subscriberNumber) ? null : subscriberNumber.Trim())); (string.IsNullOrEmpty(subscriberNumber) ? null : subscriberNumber.Trim()), EnableArchiving);
} }
public static int CreateMailbox(int itemId, int accountId, ExchangeAccountType accountType, string accountName, 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 // check account
int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);
@ -1724,6 +1726,24 @@ namespace WebsitePanel.EnterpriseServer
return BusinessErrorCodes.ERROR_EXCHANGE_STORAGE_QUOTAS_EXCEED_HOST_VALUES; 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 //GetServiceSettings
StringDictionary primSettings = ServerController.GetServiceSettings(exchangeServiceId); StringDictionary primSettings = ServerController.GetServiceSettings(exchangeServiceId);
@ -1756,10 +1776,10 @@ namespace WebsitePanel.EnterpriseServer
| MailboxManagerActions.EmailAddresses; | 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 }; 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) if (!resPolicy.IsSuccess)
{ {
TaskManager.WriteError("Error SetMailBoxRetentionPolicy", resPolicy.ErrorCodes.ToArray()); TaskManager.WriteError("Error SetMailBoxRetentionPolicy", resPolicy.ErrorCodes.ToArray());
@ -2605,7 +2625,7 @@ namespace WebsitePanel.EnterpriseServer
#region Mailbox plan #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 // check account
int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);
@ -2707,13 +2727,13 @@ namespace WebsitePanel.EnterpriseServer
plan.LitigationHoldMsg); plan.LitigationHoldMsg);
ResultObject resPolicy = new ResultObject() { IsSuccess = true }; 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) if (!resPolicy.IsSuccess)
{ {
TaskManager.WriteError("Error SetMailBoxRetentionPolicy", resPolicy.ErrorCodes.ToArray()); TaskManager.WriteError("Error SetMailBoxRetentionPolicy", resPolicy.ErrorCodes.ToArray());
} }
DataProvider.SetExchangeAccountMailboxPlan(accountId, mailboxPlanId, archivePlanId); DataProvider.SetExchangeAccountMailboxPlan(accountId, mailboxPlanId, archivePlanId, EnableArchiving);
return 0; return 0;
} }
@ -2893,7 +2913,8 @@ namespace WebsitePanel.EnterpriseServer
mailboxPlan.IsDefault, mailboxPlan.IssueWarningPct, mailboxPlan.KeepDeletedItemsDays, mailboxPlan.MailboxSizeMB, mailboxPlan.MaxReceiveMessageSizeKB, mailboxPlan.MaxRecipients, mailboxPlan.IsDefault, mailboxPlan.IssueWarningPct, mailboxPlan.KeepDeletedItemsDays, mailboxPlan.MailboxSizeMB, mailboxPlan.MaxReceiveMessageSizeKB, mailboxPlan.MaxRecipients,
mailboxPlan.MaxSendMessageSizeKB, mailboxPlan.ProhibitSendPct, mailboxPlan.ProhibitSendReceivePct, mailboxPlan.HideFromAddressBook, mailboxPlan.MailboxPlanType, mailboxPlan.MaxSendMessageSizeKB, mailboxPlan.ProhibitSendPct, mailboxPlan.ProhibitSendReceivePct, mailboxPlan.HideFromAddressBook, mailboxPlan.MailboxPlanType,
mailboxPlan.AllowLitigationHold, mailboxPlan.RecoverableItemsSpace, mailboxPlan.RecoverableItemsWarningPct, 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) catch (Exception ex)
{ {
@ -2964,7 +2985,8 @@ namespace WebsitePanel.EnterpriseServer
mailboxPlan.MaxSendMessageSizeKB, mailboxPlan.ProhibitSendPct, mailboxPlan.ProhibitSendReceivePct, mailboxPlan.HideFromAddressBook, mailboxPlan.MailboxPlanType, mailboxPlan.MaxSendMessageSizeKB, mailboxPlan.ProhibitSendPct, mailboxPlan.ProhibitSendReceivePct, mailboxPlan.HideFromAddressBook, mailboxPlan.MailboxPlanType,
mailboxPlan.AllowLitigationHold, mailboxPlan.RecoverableItemsSpace, mailboxPlan.RecoverableItemsWarningPct, mailboxPlan.AllowLitigationHold, mailboxPlan.RecoverableItemsSpace, mailboxPlan.RecoverableItemsWarningPct,
mailboxPlan.LitigationHoldUrl, mailboxPlan.LitigationHoldMsg, mailboxPlan.LitigationHoldUrl, mailboxPlan.LitigationHoldMsg,
mailboxPlan.Archiving, mailboxPlan.EnableArchiving); mailboxPlan.Archiving, mailboxPlan.EnableArchiving,
mailboxPlan.ArchiveSizeMB, mailboxPlan.ArchiveWarningPct);
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -3027,22 +3049,25 @@ namespace WebsitePanel.EnterpriseServer
#region Exchange Retention Policy Tags #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 archiveQuotaKB = 0;
long archiveWarningQuotaKB = 0; long archiveWarningQuotaKB = 0;
string RetentionPolicy = ""; string RetentionPolicy = "";
if (retentionPolicyId > 0) 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); ExchangeMailboxPlan retentionPolicy = GetExchangeMailboxPlan(itemId, retentionPolicyId);
if (retentionPolicy != null) 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 // update PlanRetentionPolicy and Tags
List<ExchangeMailboxPlanRetentionPolicyTag> listtags = GetExchangeMailboxPlanRetentionPolicyTags(retentionPolicyId); List<ExchangeMailboxPlanRetentionPolicyTag> listtags = GetExchangeMailboxPlanRetentionPolicyTags(retentionPolicyId);
foreach(ExchangeMailboxPlanRetentionPolicyTag listtag in listtags) 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.ErrorCodes.AddRange(res.ErrorCodes);
result.IsSuccess = result.IsSuccess && res.IsSuccess; result.IsSuccess = result.IsSuccess && res.IsSuccess;
} }

View file

@ -2121,7 +2121,8 @@ namespace WebsitePanel.EnterpriseServer
DataProvider.UpdateExchangeAccount(account.AccountId, account.AccountName, account.AccountType, account.DisplayName, DataProvider.UpdateExchangeAccount(account.AccountId, account.AccountName, account.AccountType, account.DisplayName,
account.PrimaryEmailAddress, account.MailEnabledPublicFolder, account.PrimaryEmailAddress, account.MailEnabledPublicFolder,
account.MailboxManagerActions.ToString(), account.SamAccountName, account.AccountPassword, account.MailboxPlanId, account.ArchivingMailboxPlanId, 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);
} }

View file

@ -222,9 +222,9 @@ namespace WebsitePanel.EnterpriseServer
#region Mailboxes #region Mailboxes
[WebMethod] [WebMethod]
public int CreateMailbox(int itemId, int accountId, ExchangeAccountType accountType, string accountName, string displayName, 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] [WebMethod]
@ -303,9 +303,9 @@ namespace WebsitePanel.EnterpriseServer
[WebMethod] [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] [WebMethod]

View file

@ -170,6 +170,13 @@ namespace WebsitePanel.Providers.HostedSolution
set { this.archivingMailboxPlan = value; } set { this.archivingMailboxPlan = value; }
} }
bool enableArchiving;
public bool EnableArchiving
{
get { return this.enableArchiving; }
set { this.enableArchiving = value; }
}
} }
} }

View file

@ -225,6 +225,20 @@ namespace WebsitePanel.Providers.HostedSolution
set { this.enableArchiving = value; } 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 public string WSPUniqueName
{ {
get get

View file

@ -55,5 +55,11 @@ namespace WebsitePanel.Providers.HostedSolution
public ExchangeAccountType MailboxType { get; set; } public ExchangeAccountType MailboxType { get; set; }
public bool BlackberryEnabled { get; set; } public bool BlackberryEnabled { get; set; }
public string MailboxPlan { get; set; } public string MailboxPlan { get; set; }
public long ArchivingTotalSize { get; set; }
public long ArchivingTotalItems { get; set; }
public long ArchivingMaxSize { get; set; }
} }
} }

View file

@ -91,11 +91,6 @@ namespace WebsitePanel.Portal.ExchangeServer
if (RetentionPolicy) if (RetentionPolicy)
{ {
chkEnableArchiving.Checked = plan.EnableArchiving;
archiveQuota.QuotaValue = plan.MailboxSizeMB;
archiveWarningQuota.ValueKB = plan.IssueWarningPct;
List<ExchangeMailboxPlanRetentionPolicyTag> tags = new List<ExchangeMailboxPlanRetentionPolicyTag>(); List<ExchangeMailboxPlanRetentionPolicyTag> tags = new List<ExchangeMailboxPlanRetentionPolicyTag>();
tags.AddRange(ES.Services.ExchangeServer.GetExchangeMailboxPlanRetentionPolicyTags(plan.MailboxPlanId)); tags.AddRange(ES.Services.ExchangeServer.GetExchangeMailboxPlanRetentionPolicyTags(plan.MailboxPlanId));
@ -124,6 +119,11 @@ namespace WebsitePanel.Portal.ExchangeServer
recoverableItemsWarning.ValueKB = plan.RecoverableItemsWarningPct; recoverableItemsWarning.ValueKB = plan.RecoverableItemsWarningPct;
txtLitigationHoldMsg.Text = plan.LitigationHoldMsg; txtLitigationHoldMsg.Text = plan.LitigationHoldMsg;
txtLitigationHoldUrl.Text = plan.LitigationHoldUrl; txtLitigationHoldUrl.Text = plan.LitigationHoldUrl;
chkEnableArchiving.Checked = plan.EnableArchiving;
archiveQuota.QuotaValue = plan.ArchiveSizeMB;
archiveWarningQuota.ValueKB = plan.ArchiveWarningPct;
} }
locTitle.Text = plan.MailboxPlan; locTitle.Text = plan.MailboxPlan;
@ -198,7 +198,7 @@ namespace WebsitePanel.Portal.ExchangeServer
RetentionPolicy = PanelRequest.GetBool("archiving", false); RetentionPolicy = PanelRequest.GetBool("archiving", false);
if (RetentionPolicy) if (!RetentionPolicy)
{ {
chkEnableArchiving.Checked = true; chkEnableArchiving.Checked = true;
archiveQuota.QuotaValue = cntx.Quotas[Quotas.EXCHANGE2013_ARCHIVINGSTORAGE].QuotaAllocatedValue; archiveQuota.QuotaValue = cntx.Quotas[Quotas.EXCHANGE2013_ARCHIVINGSTORAGE].QuotaAllocatedValue;
@ -230,7 +230,8 @@ namespace WebsitePanel.Portal.ExchangeServer
secDeleteRetention.Visible = !RetentionPolicy; secDeleteRetention.Visible = !RetentionPolicy;
secLitigationHold.Visible = !RetentionPolicy; secLitigationHold.Visible = !RetentionPolicy;
secArchiving.Visible = RetentionPolicy; secArchiving.Visible = !RetentionPolicy;
secRetentionPolicyTags.Visible = RetentionPolicy; secRetentionPolicyTags.Visible = RetentionPolicy;
valRequireMailboxPlan.ValidationGroup = MainValidationGroup; valRequireMailboxPlan.ValidationGroup = MainValidationGroup;
@ -283,11 +284,6 @@ namespace WebsitePanel.Portal.ExchangeServer
if (RetentionPolicy) if (RetentionPolicy)
{ {
plan.EnableArchiving = chkEnableArchiving.Checked;
plan.MailboxSizeMB = archiveQuota.QuotaValue;
plan.IssueWarningPct = archiveWarningQuota.ValueKB;
if ((plan.IssueWarningPct == 0)) plan.IssueWarningPct = 100;
} }
else else
@ -317,6 +313,13 @@ namespace WebsitePanel.Portal.ExchangeServer
if ((plan.RecoverableItemsWarningPct == 0)) plan.RecoverableItemsWarningPct = 100; if ((plan.RecoverableItemsWarningPct == 0)) plan.RecoverableItemsWarningPct = 100;
plan.LitigationHoldMsg = txtLitigationHoldMsg.Text.Trim(); plan.LitigationHoldMsg = txtLitigationHoldMsg.Text.Trim();
plan.LitigationHoldUrl = txtLitigationHoldUrl.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, int planId = ES.Services.ExchangeServer.AddExchangeMailboxPlan(PanelRequest.ItemID,

View file

@ -147,6 +147,13 @@
</td> </td>
<td> <td>
<wsp:MailboxPlanSelector ID="archivingMailboxPlanSelector" runat="server" Archiving="true" AddNone="true" /> <wsp:MailboxPlanSelector ID="archivingMailboxPlanSelector" runat="server" Archiving="true" AddNone="true" />
</td>
</tr>
<tr id="rowArchiving" runat="server">
<td class="FormLabel150">
</td>
<td>
<asp:CheckBox ID="chkEnableArchiving" runat="server" meta:resourcekey="chkEnableArchiving" Text="Enable archiving" />
</td> </td>
</tr> </tr>
</table> </table>

View file

@ -101,6 +101,7 @@ namespace WebsitePanel.Portal.ExchangeServer
} }
rowRetentionPolicy.Visible = Utils.CheckQouta(Quotas.EXCHANGE2013_ALLOWRETENTIONPOLICY, cntx); 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 displayName = IsNewUser ? txtDisplayName.Text.Trim() : userSelector.GetDisplayName();
string accountName = IsNewUser ? string.Empty : userSelector.GetAccount(); string accountName = IsNewUser ? string.Empty : userSelector.GetAccount();
bool enableArchive = chkEnableArchiving.Checked;
ExchangeAccountType type = IsNewUser ExchangeAccountType type = IsNewUser
? (ExchangeAccountType)Utils.ParseInt(rbMailboxType.SelectedValue, 1) ? (ExchangeAccountType)Utils.ParseInt(rbMailboxType.SelectedValue, 1)
: ExchangeAccountType.Mailbox; : ExchangeAccountType.Mailbox;
@ -141,7 +144,7 @@ namespace WebsitePanel.Portal.ExchangeServer
sendInstructionEmail.Text, sendInstructionEmail.Text,
Convert.ToInt32(mailboxPlanSelector.MailboxPlanId), Convert.ToInt32(mailboxPlanSelector.MailboxPlanId),
Convert.ToInt32(archivingMailboxPlanSelector.MailboxPlanId), Convert.ToInt32(archivingMailboxPlanSelector.MailboxPlanId),
subscriberNumber); subscriberNumber, enableArchive);
if (accountId < 0) if (accountId < 0)

View file

@ -336,6 +336,24 @@ namespace WebsitePanel.Portal.ExchangeServer {
/// </remarks> /// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.MailboxPlanSelector archivingMailboxPlanSelector; protected global::WebsitePanel.Portal.ExchangeServer.UserControls.MailboxPlanSelector archivingMailboxPlanSelector;
/// <summary>
/// rowArchiving control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlTableRow rowArchiving;
/// <summary>
/// chkEnableArchiving control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.CheckBox chkEnableArchiving;
/// <summary> /// <summary>
/// chkSendInstructions control. /// chkSendInstructions control.
/// </summary> /// </summary>

View file

@ -49,7 +49,7 @@
<tr> <tr>
<td class="FormLabel150"><asp:Localize ID="Localize2" runat="server" meta:resourcekey="locMailboxplanName" Text="Mailbox plan: *"></asp:Localize></td> <td class="FormLabel150"><asp:Localize ID="Localize2" runat="server" meta:resourcekey="locMailboxplanName" Text="Mailbox plan: *"></asp:Localize></td>
<td> <td>
<wsp:MailboxPlanSelector ID="mailboxPlanSelector" runat="server" /> <wsp:MailboxPlanSelector ID="mailboxPlanSelector" runat="server" Changed="mailboxPlanSelector_Changed" />
</td> </td>
</tr> </tr>
<tr> <tr>
@ -80,13 +80,8 @@
</table> </table>
</asp:Panel> </asp:Panel>
</ContentTemplate> <wsp:CollapsiblePanel id="secLitigationHoldSettings" runat="server" TargetControlID="LitigationHoldSettings" meta:resourcekey="secLitigationHoldSettings" Text="Litigation Hold"></wsp:CollapsiblePanel>
</asp:UpdatePanel> <asp:Panel ID="LitigationHoldSettings" runat="server" Height="0" style="overflow:hidden;">
<wsp:CollapsiblePanel id="secLitigationHoldSettings" runat="server" TargetControlID="LitigationHoldSettings" meta:resourcekey="secLitigationHoldSettings" Text="Litigation Hold"></wsp:CollapsiblePanel>
<asp:Panel ID="LitigationHoldSettings" runat="server" Height="0" style="overflow:hidden;">
<asp:UpdatePanel ID="LitigationHoldUpdatePanel" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
<ContentTemplate>
<table> <table>
<!-- <!--
<tr> <tr>
@ -105,9 +100,30 @@
</td> </td>
</tr> </tr>
</table> </table>
</ContentTemplate> </asp:Panel>
</asp:UpdatePanel>
</asp:Panel> <wsp:CollapsiblePanel id="secArchiving" runat="server" TargetControlID="Archiving" meta:resourcekey="secArchiving" Text="Archiving"></wsp:CollapsiblePanel>
<asp:Panel ID="Archiving" runat="server" Height="0" style="overflow:hidden;">
<table>
<tr>
<td class="FormLabel150"></td>
<td>
<asp:CheckBox ID="chkEnableArchiving" runat="server" meta:resourcekey="chkEnableArchiving" Text="Enable archiving" AutoPostBack="true" />
<br />
</td>
</tr>
<tr id="rowArchiving" runat="server">
<td class="FormLabel150"><asp:Localize ID="locArchivingQuotaViewer" runat="server" meta:resourcekey="locArchivingQuotaViewer" Text="Archive Size:"></asp:Localize></td>
<td>
<wsp:QuotaViewer ID="archivingQuotaViewer" runat="server" QuotaTypeId="2" DisplayGauge="true" /> MB
</td>
</tr>
</table>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
<wsp:CollapsiblePanel id="secCalendarSettings" runat="server" TargetControlID="CalendarSettings" meta:resourcekey="secCalendarSettings" Text="General"></wsp:CollapsiblePanel> <wsp:CollapsiblePanel id="secCalendarSettings" runat="server" TargetControlID="CalendarSettings" meta:resourcekey="secCalendarSettings" Text="General"></wsp:CollapsiblePanel>
<asp:Panel ID="CalendarSettings" runat="server" Height="0" style="overflow:hidden;"> <asp:Panel ID="CalendarSettings" runat="server" Height="0" style="overflow:hidden;">

View file

@ -85,6 +85,13 @@ namespace WebsitePanel.Portal.ExchangeServer
} }
int planId = -1;
int.TryParse(mailboxPlanSelector.MailboxPlanId, out planId);
ExchangeMailboxPlan plan = ES.Services.ExchangeServer.GetExchangeMailboxPlan(PanelRequest.ItemID, planId);
secArchiving.Visible = Utils.CheckQouta(Quotas.EXCHANGE2013_ALLOWARCHIVING, cntx) && plan.EnableArchiving;
rowArchiving.Visible = chkEnableArchiving.Checked;
} }
private void BindSettings() private void BindSettings()
@ -99,6 +106,8 @@ namespace WebsitePanel.Portal.ExchangeServer
ExchangeMailboxStatistics stats = ES.Services.ExchangeServer.GetMailboxStatistics(PanelRequest.ItemID, ExchangeMailboxStatistics stats = ES.Services.ExchangeServer.GetMailboxStatistics(PanelRequest.ItemID,
PanelRequest.AccountID); PanelRequest.AccountID);
// mailbox plan
// title // title
litDisplayName.Text = mailbox.DisplayName; litDisplayName.Text = mailbox.DisplayName;
@ -147,6 +156,13 @@ namespace WebsitePanel.Portal.ExchangeServer
ddDisclaimer.SelectedValue = disclaimerId.ToString(); ddDisclaimer.SelectedValue = disclaimerId.ToString();
} }
if (Utils.CheckQouta(Quotas.EXCHANGE2013_ALLOWARCHIVING, Cntx))
{
chkEnableArchiving.Checked = account.EnableArchiving;
archivingQuotaViewer.QuotaUsedValue = Convert.ToInt32(stats.ArchivingTotalSize / 1024 / 1024);
archivingQuotaViewer.QuotaValue = (stats.ArchivingMaxSize == -1) ? -1 : (int)Math.Round((double)(stats.ArchivingMaxSize / 1024 / 1024));
}
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -183,8 +199,10 @@ namespace WebsitePanel.Portal.ExchangeServer
int policyId = -1; int policyId = -1;
int.TryParse(mailboxRetentionPolicySelector.MailboxPlanId, out policyId); int.TryParse(mailboxRetentionPolicySelector.MailboxPlanId, out policyId);
bool EnableArchiving = chkEnableArchiving.Checked;
result = ES.Services.ExchangeServer.SetExchangeMailboxPlan(PanelRequest.ItemID, PanelRequest.AccountID, planId, result = ES.Services.ExchangeServer.SetExchangeMailboxPlan(PanelRequest.ItemID, PanelRequest.AccountID, planId,
policyId); policyId, EnableArchiving);
if (result < 0) if (result < 0)
{ {
@ -262,5 +280,9 @@ namespace WebsitePanel.Portal.ExchangeServer
return result; return result;
} }
public void mailboxPlanSelector_Changed(object sender, EventArgs e)
{
}
} }
} }

View file

@ -1,31 +1,3 @@
// Copyright (c) 2014, 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.
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.
@ -40,31 +12,6 @@ namespace WebsitePanel.Portal.ExchangeServer {
public partial class ExchangeMailboxGeneralSettings { public partial class ExchangeMailboxGeneralSettings {
/// <summary>
/// asyncTasks control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks;
/// breadcrumb control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Breadcrumb breadcrumb;
/// <summary>
/// menu control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Menu menu;
/// <summary> /// <summary>
/// Image1 control. /// Image1 control.
/// </summary> /// </summary>
@ -263,15 +210,6 @@ namespace WebsitePanel.Portal.ExchangeServer {
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.Panel LitigationHoldSettings; protected global::System.Web.UI.WebControls.Panel LitigationHoldSettings;
/// <summary>
/// LitigationHoldUpdatePanel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.UpdatePanel LitigationHoldUpdatePanel;
/// <summary> /// <summary>
/// chkEnableLitigationHold control. /// chkEnableLitigationHold control.
/// </summary> /// </summary>
@ -299,6 +237,60 @@ namespace WebsitePanel.Portal.ExchangeServer {
/// </remarks> /// </remarks>
protected global::WebsitePanel.Portal.QuotaViewer litigationHoldSpace; protected global::WebsitePanel.Portal.QuotaViewer litigationHoldSpace;
/// <summary>
/// secArchiving control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.CollapsiblePanel secArchiving;
/// <summary>
/// Archiving control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Panel Archiving;
/// <summary>
/// chkEnableArchiving control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.CheckBox chkEnableArchiving;
/// <summary>
/// rowArchiving control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlTableRow rowArchiving;
/// <summary>
/// locArchivingQuotaViewer control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locArchivingQuotaViewer;
/// <summary>
/// archivingQuotaViewer control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.QuotaViewer archivingQuotaViewer;
/// <summary> /// <summary>
/// secCalendarSettings control. /// secCalendarSettings control.
/// </summary> /// </summary>

View file

@ -213,7 +213,7 @@ namespace WebsitePanel.Portal.ExchangeServer
foreach (ExchangeAccount a in Accounts) foreach (ExchangeAccount a in Accounts)
{ {
txtStatus.Text = "Completed"; txtStatus.Text = "Completed";
int result = ES.Services.ExchangeServer.SetExchangeMailboxPlan(PanelRequest.ItemID, a.AccountId, Convert.ToInt32(mailboxPlanSelectorTarget.MailboxPlanId), a.ArchivingMailboxPlanId); int result = ES.Services.ExchangeServer.SetExchangeMailboxPlan(PanelRequest.ItemID, a.AccountId, Convert.ToInt32(mailboxPlanSelectorTarget.MailboxPlanId), a.ArchivingMailboxPlanId, a.EnableArchiving);
if (result < 0) if (result < 0)
{ {
BindMailboxPlans(); BindMailboxPlans();

View file

@ -83,7 +83,7 @@ namespace WebsitePanel.Portal
secDeleteRetention.Visible = !RetentionPolicy; secDeleteRetention.Visible = !RetentionPolicy;
secLitigationHold.Visible = !RetentionPolicy; secLitigationHold.Visible = !RetentionPolicy;
secArchiving.Visible = RetentionPolicy; secArchiving.Visible = !RetentionPolicy;
secRetentionPolicyTags.Visible = RetentionPolicy; secRetentionPolicyTags.Visible = RetentionPolicy;
gvMailboxPlans.Columns[4].Visible = !RetentionPolicy; gvMailboxPlans.Columns[4].Visible = !RetentionPolicy;
@ -142,11 +142,6 @@ namespace WebsitePanel.Portal
if (RetentionPolicy) if (RetentionPolicy)
{ {
plan.EnableArchiving = chkEnableArchiving.Checked;
plan.MailboxSizeMB = archiveQuota.QuotaValue;
plan.IssueWarningPct = archiveWarningQuota.ValueKB;
if ((plan.IssueWarningPct == 0)) plan.IssueWarningPct = 100;
} }
else else
@ -176,6 +171,13 @@ namespace WebsitePanel.Portal
if ((plan.RecoverableItemsWarningPct == 0)) plan.RecoverableItemsWarningPct = 100; if ((plan.RecoverableItemsWarningPct == 0)) plan.RecoverableItemsWarningPct = 100;
plan.LitigationHoldMsg = txtLitigationHoldMsg.Text.Trim(); plan.LitigationHoldMsg = txtLitigationHoldMsg.Text.Trim();
plan.LitigationHoldUrl = txtLitigationHoldUrl.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;
} }
if (PanelSecurity.SelectedUser.Role == UserRole.Administrator) if (PanelSecurity.SelectedUser.Role == UserRole.Administrator)
@ -327,11 +329,6 @@ namespace WebsitePanel.Portal
if (RetentionPolicy) if (RetentionPolicy)
{ {
chkEnableArchiving.Checked = plan.EnableArchiving;
archiveQuota.QuotaValue = plan.MailboxSizeMB;
archiveWarningQuota.ValueKB = plan.IssueWarningPct;
List<ExchangeMailboxPlanRetentionPolicyTag> tags = new List<ExchangeMailboxPlanRetentionPolicyTag>(); List<ExchangeMailboxPlanRetentionPolicyTag> tags = new List<ExchangeMailboxPlanRetentionPolicyTag>();
tags.AddRange(ES.Services.ExchangeServer.GetExchangeMailboxPlanRetentionPolicyTags(plan.MailboxPlanId)); tags.AddRange(ES.Services.ExchangeServer.GetExchangeMailboxPlanRetentionPolicyTags(plan.MailboxPlanId));
@ -363,6 +360,12 @@ namespace WebsitePanel.Portal
recoverableItemsWarning.ValueKB = plan.RecoverableItemsWarningPct; recoverableItemsWarning.ValueKB = plan.RecoverableItemsWarningPct;
txtLitigationHoldMsg.Text = plan.LitigationHoldMsg; txtLitigationHoldMsg.Text = plan.LitigationHoldMsg;
txtLitigationHoldUrl.Text = plan.LitigationHoldUrl; txtLitigationHoldUrl.Text = plan.LitigationHoldUrl;
chkEnableArchiving.Checked = plan.EnableArchiving;
archiveQuota.QuotaValue = plan.ArchiveSizeMB;
archiveWarningQuota.ValueKB = plan.ArchiveWarningPct;
} }
@ -455,12 +458,6 @@ namespace WebsitePanel.Portal
if (RetentionPolicy) if (RetentionPolicy)
{ {
plan.EnableArchiving = chkEnableArchiving.Checked;
plan.MailboxSizeMB = archiveQuota.QuotaValue;
plan.IssueWarningPct = archiveWarningQuota.ValueKB;
if ((plan.IssueWarningPct == 0)) plan.IssueWarningPct = 100;
} }
else else
{ {
@ -489,6 +486,13 @@ namespace WebsitePanel.Portal
if ((plan.RecoverableItemsWarningPct == 0)) plan.RecoverableItemsWarningPct = 100; if ((plan.RecoverableItemsWarningPct == 0)) plan.RecoverableItemsWarningPct = 100;
plan.LitigationHoldMsg = txtLitigationHoldMsg.Text.Trim(); plan.LitigationHoldMsg = txtLitigationHoldMsg.Text.Trim();
plan.LitigationHoldUrl = txtLitigationHoldUrl.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;
} }
@ -575,7 +579,7 @@ namespace WebsitePanel.Portal
foreach (ExchangeAccount a in Accounts) foreach (ExchangeAccount a in Accounts)
{ {
txtStatus.Text = "Completed"; txtStatus.Text = "Completed";
int result = ES.Services.ExchangeServer.SetExchangeMailboxPlan(org.Id, a.AccountId, destinationMailboxPlanId, a.ArchivingMailboxPlanId); int result = ES.Services.ExchangeServer.SetExchangeMailboxPlan(org.Id, a.AccountId, destinationMailboxPlanId, a.ArchivingMailboxPlanId, a.EnableArchiving);
if (result < 0) if (result < 0)
{ {
BindMailboxPlans(); BindMailboxPlans();