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 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

View file

@ -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

View file

@ -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;
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
@ -3436,7 +3435,7 @@ namespace WebsitePanel.EnterpriseServer {
/// <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)]
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]));
}
/// <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[] {
itemId,
accountId,
@ -3469,7 +3485,8 @@ namespace WebsitePanel.EnterpriseServer {
setupInstructionMailAddress,
mailboxPlanId,
archivedPlanId,
subscriberNumber}, callback, asyncState);
subscriberNumber,
EnableArchiving}, callback, asyncState);
}
/// <remarks/>
@ -3479,12 +3496,12 @@ namespace WebsitePanel.EnterpriseServer {
}
/// <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) {
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);
}
/// <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)) {
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 {
/// <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)]
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]));
}
/// <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[] {
itemId,
accountId,
mailboxPlanId,
archivePlanId}, callback, asyncState);
archivePlanId,
EnableArchiving}, callback, asyncState);
}
/// <remarks/>
@ -4058,12 +4078,12 @@ namespace WebsitePanel.EnterpriseServer {
}
/// <remarks/>
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);
}
/// <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)) {
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) {

View file

@ -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)
);
}

View file

@ -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,
@ -1610,12 +1612,12 @@ namespace WebsitePanel.EnterpriseServer
samAccountName,
CryptoUtils.Encrypt(accountPassword),
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,
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<ExchangeMailboxPlanRetentionPolicyTag> 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;
}

View file

@ -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);
}

View file

@ -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]

View file

@ -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; }
}
}
}

View file

@ -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

View file

@ -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; }
}
}

View file

@ -91,11 +91,6 @@ namespace WebsitePanel.Portal.ExchangeServer
if (RetentionPolicy)
{
chkEnableArchiving.Checked = plan.EnableArchiving;
archiveQuota.QuotaValue = plan.MailboxSizeMB;
archiveWarningQuota.ValueKB = plan.IssueWarningPct;
List<ExchangeMailboxPlanRetentionPolicyTag> tags = new List<ExchangeMailboxPlanRetentionPolicyTag>();
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,

View file

@ -147,6 +147,13 @@
</td>
<td>
<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>
</tr>
</table>

View file

@ -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)

View file

@ -336,6 +336,24 @@ namespace WebsitePanel.Portal.ExchangeServer {
/// </remarks>
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>
/// chkSendInstructions control.
/// </summary>

View file

@ -49,7 +49,7 @@
<tr>
<td class="FormLabel150"><asp:Localize ID="Localize2" runat="server" meta:resourcekey="locMailboxplanName" Text="Mailbox plan: *"></asp:Localize></td>
<td>
<wsp:MailboxPlanSelector ID="mailboxPlanSelector" runat="server" />
<wsp:MailboxPlanSelector ID="mailboxPlanSelector" runat="server" Changed="mailboxPlanSelector_Changed" />
</td>
</tr>
<tr>
@ -80,13 +80,8 @@
</table>
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
<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>
<!--
<tr>
@ -105,9 +100,30 @@
</td>
</tr>
</table>
</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>
</asp:Panel>
<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;">

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()
@ -99,6 +106,8 @@ namespace WebsitePanel.Portal.ExchangeServer
ExchangeMailboxStatistics stats = ES.Services.ExchangeServer.GetMailboxStatistics(PanelRequest.ItemID,
PanelRequest.AccountID);
// mailbox plan
// title
litDisplayName.Text = mailbox.DisplayName;
@ -147,6 +156,13 @@ namespace WebsitePanel.Portal.ExchangeServer
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)
{
@ -183,8 +199,10 @@ namespace WebsitePanel.Portal.ExchangeServer
int policyId = -1;
int.TryParse(mailboxRetentionPolicySelector.MailboxPlanId, out policyId);
bool EnableArchiving = chkEnableArchiving.Checked;
result = ES.Services.ExchangeServer.SetExchangeMailboxPlan(PanelRequest.ItemID, PanelRequest.AccountID, planId,
policyId);
policyId, EnableArchiving);
if (result < 0)
{
@ -262,5 +280,9 @@ namespace WebsitePanel.Portal.ExchangeServer
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>
// This code was generated by a tool.
@ -40,31 +12,6 @@ namespace WebsitePanel.Portal.ExchangeServer {
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>
/// Image1 control.
/// </summary>
@ -263,15 +210,6 @@ namespace WebsitePanel.Portal.ExchangeServer {
/// </remarks>
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>
/// chkEnableLitigationHold control.
/// </summary>
@ -299,6 +237,60 @@ namespace WebsitePanel.Portal.ExchangeServer {
/// </remarks>
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>
/// secCalendarSettings control.
/// </summary>

View file

@ -213,7 +213,7 @@ namespace WebsitePanel.Portal.ExchangeServer
foreach (ExchangeAccount a in Accounts)
{
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)
{
BindMailboxPlans();

View file

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