Approaches with mailbox plan changed: ServerAdmin and Reseller are able to

define global plans. The plans will accumulate through out the tree.

Various UI optimizations

Before defining global plans ensure you create a hosted organization for each
reseller. Spaces -> Hosted Organization -> New Organization
This commit is contained in:
robvde 2012-08-05 23:16:48 +04:00
parent a99d7f8edd
commit 3be20ebaa4
32 changed files with 1745 additions and 580 deletions

View file

@ -60,6 +60,7 @@ CREATE TABLE [dbo].[ExchangeMailboxPlans](
[MailboxPlanId] [int] IDENTITY(1,1) NOT NULL, [MailboxPlanId] [int] IDENTITY(1,1) NOT NULL,
[ItemID] [int] NOT NULL, [ItemID] [int] NOT NULL,
[MailboxPlan] [nvarchar](300) COLLATE Latin1_General_CI_AS NOT NULL, [MailboxPlan] [nvarchar](300) COLLATE Latin1_General_CI_AS NOT NULL,
[MailboxPlanType] [int] NULL,
[EnableActiveSync] [bit] NOT NULL, [EnableActiveSync] [bit] NOT NULL,
[EnableIMAP] [bit] NOT NULL, [EnableIMAP] [bit] NOT NULL,
[EnableMAPI] [bit] NOT NULL, [EnableMAPI] [bit] NOT NULL,
@ -211,6 +212,101 @@ GO
CREATE PROCEDURE [dbo].[GetUserByExchangeOrganizationIdInternally]
(
@ItemID int
)
AS
SELECT
U.UserID,
U.RoleID,
U.StatusID,
U.LoginStatusId,
U.FailedLogins,
U.OwnerID,
U.Created,
U.Changed,
U.IsDemo,
U.Comments,
U.IsPeer,
U.Username,
U.Password,
U.FirstName,
U.LastName,
U.Email,
U.SecondaryEmail,
U.Address,
U.City,
U.State,
U.Country,
U.Zip,
U.PrimaryPhone,
U.SecondaryPhone,
U.Fax,
U.InstantMessenger,
U.HtmlMail,
U.CompanyName,
U.EcommerceEnabled,
U.[AdditionalParams]
FROM Users AS U
WHERE U.UserID IN (SELECT UserID FROM Packages WHERE PackageID IN (
SELECT PackageID FROM ServiceItems WHERE ItemID = @ItemID))
RETURN
GO
CREATE PROCEDURE [dbo].[UpdateExchangeMailboxPlan]
(
@MailboxPlanId int,
@MailboxPlan nvarchar(300),
@EnableActiveSync bit,
@EnableIMAP bit,
@EnableMAPI bit,
@EnableOWA bit,
@EnablePOP bit,
@IsDefault bit,
@IssueWarningPct int,
@KeepDeletedItemsDays int,
@MailboxSizeMB int,
@MaxReceiveMessageSizeKB int,
@MaxRecipients int,
@MaxSendMessageSizeKB int,
@ProhibitSendPct int,
@ProhibitSendReceivePct int ,
@HideFromAddressBook bit,
@MailboxPlanType int
)
AS
UPDATE ExchangeMailboxPlans SET
MailboxPlan = @MailboxPlan,
EnableActiveSync = @EnableActiveSync,
EnableIMAP = @EnableIMAP,
EnableMAPI = @EnableMAPI,
EnableOWA = @EnableOWA,
EnablePOP = @EnablePOP,
IsDefault = @IsDefault,
IssueWarningPct= @IssueWarningPct,
KeepDeletedItemsDays = @KeepDeletedItemsDays,
MailboxSizeMB= @MailboxSizeMB,
MaxReceiveMessageSizeKB= @MaxReceiveMessageSizeKB,
MaxRecipients= @MaxRecipients,
MaxSendMessageSizeKB= @MaxSendMessageSizeKB,
ProhibitSendPct= @ProhibitSendPct,
ProhibitSendReceivePct = @ProhibitSendReceivePct,
HideFromAddressBook = @HideFromAddressBook,
MailboxPlanType = @MailboxPlanType
WHERE MailboxPlanId = @MailboxPlanId
RETURN
GO
@ -222,8 +318,6 @@ CREATE PROCEDURE [dbo].[GetExchangeAccountByMailboxPlanId]
) )
AS AS
DECLARE @condition nvarchar(64)
IF (@MailboxPlanId < 0) IF (@MailboxPlanId < 0)
BEGIN BEGIN
SELECT SELECT
@ -249,6 +343,30 @@ WHERE
E.AccountType IN (1,5) E.AccountType IN (1,5)
RETURN RETURN
END
ELSE
IF (@ItemId = 0)
BEGIN
SELECT
E.AccountID,
E.ItemID,
E.AccountType,
E.AccountName,
E.DisplayName,
E.PrimaryEmailAddress,
E.MailEnabledPublicFolder,
E.MailboxManagerActions,
E.SamAccountName,
E.AccountPassword,
E.MailboxPlanId,
P.MailboxPlan,
E.SubscriberNumber
FROM
ExchangeAccounts AS E
LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId
WHERE
E.MailboxPlanId = @MailboxPlanId AND
E.AccountType IN (1,5)
END END
ELSE ELSE
BEGIN BEGIN
@ -275,8 +393,6 @@ WHERE
E.AccountType IN (1,5) E.AccountType IN (1,5)
RETURN RETURN
END END
GO
@ -24151,6 +24267,23 @@ SELECT @ItemTypeID = ItemTypeID FROM ServiceItemTypes
WHERE TypeName = @ItemTypeName WHERE TypeName = @ItemTypeName
AND ((@GroupID IS NULL) OR (@GroupID IS NOT NULL AND GroupID = @GroupID)) AND ((@GroupID IS NULL) OR (@GroupID IS NOT NULL AND GroupID = @GroupID))
-- Fix to allow plans assigned to serveradmin
IF (@ItemTypeName = 'WebsitePanel.Providers.HostedSolution.Organization, WebsitePanel.Providers.Base')
BEGIN
IF NOT EXISTS (SELECT * FROM ServiceItems WHERE PackageID = 1)
BEGIN
INSERT INTO ServiceItems (PackageID, ItemTypeID,ServiceID,ItemName,CreatedDate)
VALUES(1, @ItemTypeID, @ServiceID, 'System', @CreatedDate)
DECLARE @TempItemID int
SET @TempItemID = SCOPE_IDENTITY()
INSERT INTO ExchangeOrganizations (ItemID, OrganizationID)
VALUES(@TempItemID, 'System')
END
END
-- add item -- add item
INSERT INTO ServiceItems INSERT INTO ServiceItems
( (
@ -24218,6 +24351,9 @@ RETURN
@ -24683,16 +24819,16 @@ GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (65, N'ServerIPAddress', N'127.0.0.1;127.0.0.1') INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (65, N'ServerIPAddress', N'127.0.0.1;127.0.0.1')
GO GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (65, N'ServiceUrl', N'http://localhost:9998/services/') INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (65, N'ServiceUrl', N'http://localhost:9998/services/')
GO GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (66, N'AdminPassword', N'') INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (66, N'AdminPassword', N'')
GO GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (66, N'AdminUsername', N'admin') INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (66, N'AdminUsername', N'admin')
GO GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (66, N'DomainsPath', N'%SYSTEMDRIVE%\SmarterMail') INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (66, N'DomainsPath', N'%SYSTEMDRIVE%\SmarterMail')
GO GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (66, N'ServerIPAddress', N'127.0.0.1;127.0.0.1') INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (66, N'ServerIPAddress', N'127.0.0.1;127.0.0.1')
GO GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (66, N'ServiceUrl', N'http://localhost:9998/services/') INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (66, N'ServiceUrl', N'http://localhost:9998/services/')
GO GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (100, N'UsersHome', N'%SYSTEMDRIVE%\HostingSpaces') INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (100, N'UsersHome', N'%SYSTEMDRIVE%\HostingSpaces')
GO GO
@ -44838,17 +44974,18 @@ CREATE PROCEDURE [dbo].[AddExchangeMailboxPlan]
@MaxSendMessageSizeKB int, @MaxSendMessageSizeKB int,
@ProhibitSendPct int, @ProhibitSendPct int,
@ProhibitSendReceivePct int , @ProhibitSendReceivePct int ,
@HideFromAddressBook bit @HideFromAddressBook bit,
@MailboxPlanType int
) )
AS AS
IF ((SELECT Count(*) FROM ExchangeMailboxPlans WHERE ItemId = @ItemID) = 0) IF (((SELECT Count(*) FROM ExchangeMailboxPlans WHERE ItemId = @ItemID) = 0) AND (@MailboxPlanType=0))
BEGIN BEGIN
SET @IsDefault = 1 SET @IsDefault = 1
END END
ELSE ELSE
BEGIN BEGIN
IF @IsDefault = 1 IF ((@IsDefault = 1) AND (@MailboxPlanType=0))
BEGIN BEGIN
UPDATE ExchangeMailboxPlans SET IsDefault = 0 WHERE ItemID = @ItemID UPDATE ExchangeMailboxPlans SET IsDefault = 0 WHERE ItemID = @ItemID
END END
@ -44874,7 +45011,8 @@ INSERT INTO ExchangeMailboxPlans
MaxSendMessageSizeKB, MaxSendMessageSizeKB,
ProhibitSendPct, ProhibitSendPct,
ProhibitSendReceivePct, ProhibitSendReceivePct,
HideFromAddressBook HideFromAddressBook,
MailboxPlanType
) )
VALUES VALUES
( (
@ -44894,7 +45032,8 @@ VALUES
@MaxSendMessageSizeKB, @MaxSendMessageSizeKB,
@ProhibitSendPct, @ProhibitSendPct,
@ProhibitSendReceivePct, @ProhibitSendReceivePct,
@HideFromAddressBook @HideFromAddressBook,
@MailboxPlanType
) )
SET @MailboxPlanId = SCOPE_IDENTITY() SET @MailboxPlanId = SCOPE_IDENTITY()
@ -44991,7 +45130,8 @@ SELECT
MaxSendMessageSizeKB, MaxSendMessageSizeKB,
ProhibitSendPct, ProhibitSendPct,
ProhibitSendReceivePct, ProhibitSendReceivePct,
HideFromAddressBook HideFromAddressBook,
MailboxPlanType
FROM FROM
ExchangeMailboxPlans ExchangeMailboxPlans
WHERE WHERE
@ -45032,7 +45172,8 @@ SELECT
MaxSendMessageSizeKB, MaxSendMessageSizeKB,
ProhibitSendPct, ProhibitSendPct,
ProhibitSendReceivePct, ProhibitSendReceivePct,
HideFromAddressBook HideFromAddressBook,
MailboxPlanType
FROM FROM
ExchangeMailboxPlans ExchangeMailboxPlans
WHERE WHERE

View file

@ -149,24 +149,38 @@ INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDe
END END
GO GO
UPDATE [dbo].[Quotas] SET [QuotaTypeID] = 1 WHERE [QuotaID] = 364
GO
IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Exchange2007.MaxRecipients') IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Exchange2007.MaxRecipients')
BEGIN BEGIN
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (365, 12, 20, N'Exchange2007.MaxRecipients', N'Maximum Recipients', 3, 0, NULL) INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (365, 12, 20, N'Exchange2007.MaxRecipients', N'Maximum Recipients', 3, 0, NULL)
END END
GO GO
UPDATE [dbo].[Quotas] SET [QuotaTypeID] = 3 WHERE [QuotaID] = 365
GO
IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Exchange2007.MaxSendMessageSizeKB') IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Exchange2007.MaxSendMessageSizeKB')
BEGIN BEGIN
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (366, 12, 21, N'Exchange2007.MaxSendMessageSizeKB', N'Maximum Send Message Size (Kb)', 3, 0, NULL) INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (366, 12, 21, N'Exchange2007.MaxSendMessageSizeKB', N'Maximum Send Message Size (Kb)', 3, 0, NULL)
END END
GO GO
UPDATE [dbo].[Quotas] SET [QuotaTypeID] = 3 WHERE [QuotaID] = 366
GO
IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Exchange2007.MaxReceiveMessageSizeKB') IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Exchange2007.MaxReceiveMessageSizeKB')
BEGIN BEGIN
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (367, 12, 22, N'Exchange2007.MaxReceiveMessageSizeKB', N'Maximum Receive Message Size (Kb)', 3, 0, NULL) INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (367, 12, 22, N'Exchange2007.MaxReceiveMessageSizeKB', N'Maximum Receive Message Size (Kb)', 3, 0, NULL)
END END
GO GO
UPDATE [dbo].[Quotas] SET [QuotaTypeID] = 3 WHERE [QuotaID] = 367
GO
IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Exchange2007.IsConsumer') IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Exchange2007.IsConsumer')
BEGIN BEGIN
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (368, 12, 1, N'Exchange2007.IsConsumer',N'Is Consumer Organization', 1, 0, NULL) INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (368, 12, 1, N'Exchange2007.IsConsumer',N'Is Consumer Organization', 1, 0, NULL)
@ -273,14 +287,23 @@ GO
DELETE FROM [dbo].[PackageQuotas] WHERE [QuotaID] IN (SELECT [QuotaID] FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.POP3Enabled')
DELETE FROM [dbo].[HostingPlanQuotas] WHERE [QuotaID] IN (SELECT [QuotaID] FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.POP3Enabled') DELETE FROM [dbo].[HostingPlanQuotas] WHERE [QuotaID] IN (SELECT [QuotaID] FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.POP3Enabled')
DELETE FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.POP3Enabled' DELETE FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.POP3Enabled'
DELETE FROM [dbo].[PackageQuotas] WHERE [QuotaID] IN (SELECT [QuotaID] FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.IMAPEnabled')
DELETE FROM [dbo].[HostingPlanQuotas] WHERE [QuotaID] IN (SELECT [QuotaID] FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.IMAPEnabled') DELETE FROM [dbo].[HostingPlanQuotas] WHERE [QuotaID] IN (SELECT [QuotaID] FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.IMAPEnabled')
DELETE FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.IMAPEnabled' DELETE FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.IMAPEnabled'
DELETE FROM [dbo].[PackageQuotas] WHERE [QuotaID] IN (SELECT [QuotaID] FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.OWAEnabled')
DELETE FROM [dbo].[HostingPlanQuotas] WHERE [QuotaID] IN (SELECT [QuotaID] FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.OWAEnabled') DELETE FROM [dbo].[HostingPlanQuotas] WHERE [QuotaID] IN (SELECT [QuotaID] FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.OWAEnabled')
DELETE FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.OWAEnabled' DELETE FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.OWAEnabled'
DELETE FROM [dbo].[PackageQuotas] WHERE [QuotaID] IN (SELECT [QuotaID] FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.MAPIEnabled')
DELETE FROM [dbo].[HostingPlanQuotas] WHERE [QuotaID] IN (SELECT [QuotaID] FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.MAPIEnabled') DELETE FROM [dbo].[HostingPlanQuotas] WHERE [QuotaID] IN (SELECT [QuotaID] FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.MAPIEnabled')
DELETE FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.MAPIEnabled' DELETE FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.MAPIEnabled'
DELETE FROM [dbo].[PackageQuotas] WHERE [QuotaID] IN (SELECT [QuotaID] FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.ActiveSyncEnabled')
DELETE FROM [dbo].[HostingPlanQuotas] WHERE [QuotaID] IN (SELECT [QuotaID] FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.ActiveSyncEnabled') DELETE FROM [dbo].[HostingPlanQuotas] WHERE [QuotaID] IN (SELECT [QuotaID] FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.ActiveSyncEnabled')
DELETE FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.ActiveSyncEnabled' DELETE FROM [dbo].[Quotas] WHERE [QuotaName] = N'Exchange2007.ActiveSyncEnabled'
@ -1033,6 +1056,7 @@ ALTER TABLE [dbo].[ResourceGroups] ADD [ShowGroup] [bit] NULL
END END
GO GO
UPDATE [dbo].[ResourceGroups] SET ShowGroup=1 UPDATE [dbo].[ResourceGroups] SET ShowGroup=1
GO GO
@ -1734,6 +1758,7 @@ CREATE TABLE [dbo].[ExchangeMailboxPlans](
[MailboxPlanId] [int] IDENTITY(1,1) NOT NULL, [MailboxPlanId] [int] IDENTITY(1,1) NOT NULL,
[ItemID] [int] NOT NULL, [ItemID] [int] NOT NULL,
[MailboxPlan] [nvarchar](300) COLLATE Latin1_General_CI_AS NOT NULL, [MailboxPlan] [nvarchar](300) COLLATE Latin1_General_CI_AS NOT NULL,
[MailboxPlanType] [int] NULL,
[EnableActiveSync] [bit] NOT NULL, [EnableActiveSync] [bit] NOT NULL,
[EnableIMAP] [bit] NOT NULL, [EnableIMAP] [bit] NOT NULL,
[EnableMAPI] [bit] NOT NULL, [EnableMAPI] [bit] NOT NULL,
@ -1800,7 +1825,12 @@ GO
ALTER TABLE [dbo].[ExchangeOrganizations] ALTER COLUMN [OrganizationID] [nvarchar](128) COLLATE Latin1_General_CI_AS NOT NULL ALTER TABLE [dbo].[ExchangeOrganizations] ALTER COLUMN [OrganizationID] [nvarchar](128) COLLATE Latin1_General_CI_AS NOT NULL
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='MailboxPlanType')
BEGIN
ALTER TABLE [dbo].[ExchangeMailboxPlans] ADD
[MailboxPlanType] [int] NULL
END
GO
-- LyncUsers -- LyncUsers
IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[LyncUsers]') AND type in (N'U')) IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[LyncUsers]') AND type in (N'U'))
@ -1957,17 +1987,18 @@ CREATE PROCEDURE [dbo].[AddExchangeMailboxPlan]
@MaxSendMessageSizeKB int, @MaxSendMessageSizeKB int,
@ProhibitSendPct int, @ProhibitSendPct int,
@ProhibitSendReceivePct int , @ProhibitSendReceivePct int ,
@HideFromAddressBook bit @HideFromAddressBook bit,
@MailboxPlanType int
) )
AS AS
IF ((SELECT Count(*) FROM ExchangeMailboxPlans WHERE ItemId = @ItemID) = 0) IF (((SELECT Count(*) FROM ExchangeMailboxPlans WHERE ItemId = @ItemID) = 0) AND (@MailboxPlanType=0))
BEGIN BEGIN
SET @IsDefault = 1 SET @IsDefault = 1
END END
ELSE ELSE
BEGIN BEGIN
IF @IsDefault = 1 IF ((@IsDefault = 1) AND (@MailboxPlanType=0))
BEGIN BEGIN
UPDATE ExchangeMailboxPlans SET IsDefault = 0 WHERE ItemID = @ItemID UPDATE ExchangeMailboxPlans SET IsDefault = 0 WHERE ItemID = @ItemID
END END
@ -1992,7 +2023,8 @@ INSERT INTO ExchangeMailboxPlans
MaxSendMessageSizeKB, MaxSendMessageSizeKB,
ProhibitSendPct, ProhibitSendPct,
ProhibitSendReceivePct, ProhibitSendReceivePct,
HideFromAddressBook HideFromAddressBook,
MailboxPlanType
) )
VALUES VALUES
( (
@ -2012,7 +2044,8 @@ VALUES
@MaxSendMessageSizeKB, @MaxSendMessageSizeKB,
@ProhibitSendPct, @ProhibitSendPct,
@ProhibitSendReceivePct, @ProhibitSendReceivePct,
@HideFromAddressBook @HideFromAddressBook,
@MailboxPlanType
) )
SET @MailboxPlanId = SCOPE_IDENTITY() SET @MailboxPlanId = SCOPE_IDENTITY()
@ -2045,17 +2078,18 @@ ALTER PROCEDURE [dbo].[AddExchangeMailboxPlan]
@MaxSendMessageSizeKB int, @MaxSendMessageSizeKB int,
@ProhibitSendPct int, @ProhibitSendPct int,
@ProhibitSendReceivePct int , @ProhibitSendReceivePct int ,
@HideFromAddressBook bit @HideFromAddressBook bit,
@MailboxPlanType int
) )
AS AS
IF ((SELECT Count(*) FROM ExchangeMailboxPlans WHERE ItemId = @ItemID) = 0) IF (((SELECT Count(*) FROM ExchangeMailboxPlans WHERE ItemId = @ItemID) = 0) AND (@MailboxPlanType=0))
BEGIN BEGIN
SET @IsDefault = 1 SET @IsDefault = 1
END END
ELSE ELSE
BEGIN BEGIN
IF @IsDefault = 1 IF ((@IsDefault = 1) AND (@MailboxPlanType=0))
BEGIN BEGIN
UPDATE ExchangeMailboxPlans SET IsDefault = 0 WHERE ItemID = @ItemID UPDATE ExchangeMailboxPlans SET IsDefault = 0 WHERE ItemID = @ItemID
END END
@ -2079,7 +2113,8 @@ INSERT INTO ExchangeMailboxPlans
MaxSendMessageSizeKB, MaxSendMessageSizeKB,
ProhibitSendPct, ProhibitSendPct,
ProhibitSendReceivePct, ProhibitSendReceivePct,
HideFromAddressBook HideFromAddressBook,
MailboxPlanType
) )
VALUES VALUES
( (
@ -2099,7 +2134,8 @@ VALUES
@MaxSendMessageSizeKB, @MaxSendMessageSizeKB,
@ProhibitSendPct, @ProhibitSendPct,
@ProhibitSendReceivePct, @ProhibitSendReceivePct,
@HideFromAddressBook @HideFromAddressBook,
@MailboxPlanType
) )
SET @MailboxPlanId = SCOPE_IDENTITY() SET @MailboxPlanId = SCOPE_IDENTITY()
@ -2325,6 +2361,112 @@ GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'UpdateExchangeMailboxPlan')
BEGIN
EXEC sp_executesql N'
CREATE PROCEDURE [dbo].[UpdateExchangeMailboxPlan]
(
@MailboxPlanId int,
@MailboxPlan nvarchar(300),
@EnableActiveSync bit,
@EnableIMAP bit,
@EnableMAPI bit,
@EnableOWA bit,
@EnablePOP bit,
@IsDefault bit,
@IssueWarningPct int,
@KeepDeletedItemsDays int,
@MailboxSizeMB int,
@MaxReceiveMessageSizeKB int,
@MaxRecipients int,
@MaxSendMessageSizeKB int,
@ProhibitSendPct int,
@ProhibitSendReceivePct int ,
@HideFromAddressBook bit,
@MailboxPlanType int
)
AS
UPDATE ExchangeMailboxPlans SET
MailboxPlan = @MailboxPlan,
EnableActiveSync = @EnableActiveSync,
EnableIMAP = @EnableIMAP,
EnableMAPI = @EnableMAPI,
EnableOWA = @EnableOWA,
EnablePOP = @EnablePOP,
IsDefault = @IsDefault,
IssueWarningPct= @IssueWarningPct,
KeepDeletedItemsDays = @KeepDeletedItemsDays,
MailboxSizeMB= @MailboxSizeMB,
MaxReceiveMessageSizeKB= @MaxReceiveMessageSizeKB,
MaxRecipients= @MaxRecipients,
MaxSendMessageSizeKB= @MaxSendMessageSizeKB,
ProhibitSendPct= @ProhibitSendPct,
ProhibitSendReceivePct = @ProhibitSendReceivePct,
HideFromAddressBook = @HideFromAddressBook,
MailboxPlanType = @MailboxPlanType
WHERE MailboxPlanId = @MailboxPlanId
RETURN'
END
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'GetUserByExchangeOrganizationIdInternally')
BEGIN
EXEC sp_executesql N'
CREATE PROCEDURE [dbo].[GetUserByExchangeOrganizationIdInternally]
(
@ItemID int
)
AS
SELECT
U.UserID,
U.RoleID,
U.StatusID,
U.LoginStatusId,
U.FailedLogins,
U.OwnerID,
U.Created,
U.Changed,
U.IsDemo,
U.Comments,
U.IsPeer,
U.Username,
U.Password,
U.FirstName,
U.LastName,
U.Email,
U.SecondaryEmail,
U.Address,
U.City,
U.State,
U.Country,
U.Zip,
U.PrimaryPhone,
U.SecondaryPhone,
U.Fax,
U.InstantMessenger,
U.HtmlMail,
U.CompanyName,
U.EcommerceEnabled,
U.[AdditionalParams]
FROM Users AS U
WHERE U.UserID IN (SELECT UserID FROM Packages WHERE PackageID IN (
SELECT PackageID FROM ServiceItems WHERE ItemID = @ItemID))
RETURN'
END
GO
@ -2523,10 +2665,6 @@ GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'GetExchangeAccountByMailboxPlanId') IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'GetExchangeAccountByMailboxPlanId')
BEGIN BEGIN
EXEC sp_executesql N'CREATE PROCEDURE [dbo].[GetExchangeAccountByMailboxPlanId] EXEC sp_executesql N'CREATE PROCEDURE [dbo].[GetExchangeAccountByMailboxPlanId]
@ -2561,6 +2699,30 @@ WHERE
E.AccountType IN (1,5) E.AccountType IN (1,5)
RETURN RETURN
END
ELSE
IF (@ItemId = 0)
BEGIN
SELECT
E.AccountID,
E.ItemID,
E.AccountType,
E.AccountName,
E.DisplayName,
E.PrimaryEmailAddress,
E.MailEnabledPublicFolder,
E.MailboxManagerActions,
E.SamAccountName,
E.AccountPassword,
E.MailboxPlanId,
P.MailboxPlan,
E.SubscriberNumber
FROM
ExchangeAccounts AS E
LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId
WHERE
E.MailboxPlanId = @MailboxPlanId AND
E.AccountType IN (1,5)
END END
ELSE ELSE
BEGIN BEGIN
@ -2595,11 +2757,98 @@ GO
ALTER PROCEDURE [dbo].[GetExchangeAccountByMailboxPlanId]
(
@ItemID int,
@MailboxPlanId int
)
AS
IF (@MailboxPlanId < 0)
BEGIN
SELECT
E.AccountID,
E.ItemID,
E.AccountType,
E.AccountName,
E.DisplayName,
E.PrimaryEmailAddress,
E.MailEnabledPublicFolder,
E.MailboxManagerActions,
E.SamAccountName,
E.AccountPassword,
E.MailboxPlanId,
P.MailboxPlan,
E.SubscriberNumber
FROM
ExchangeAccounts AS E
LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId
WHERE
E.ItemID = @ItemID AND
E.MailboxPlanId IS NULL AND
E.AccountType IN (1,5)
RETURN
END
ELSE
IF (@ItemId = 0)
BEGIN
SELECT
E.AccountID,
E.ItemID,
E.AccountType,
E.AccountName,
E.DisplayName,
E.PrimaryEmailAddress,
E.MailEnabledPublicFolder,
E.MailboxManagerActions,
E.SamAccountName,
E.AccountPassword,
E.MailboxPlanId,
P.MailboxPlan,
E.SubscriberNumber
FROM
ExchangeAccounts AS E
LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId
WHERE
E.MailboxPlanId = @MailboxPlanId AND
E.AccountType IN (1,5)
END
ELSE
BEGIN
SELECT
E.AccountID,
E.ItemID,
E.AccountType,
E.AccountName,
E.DisplayName,
E.PrimaryEmailAddress,
E.MailEnabledPublicFolder,
E.MailboxManagerActions,
E.SamAccountName,
E.AccountPassword,
E.MailboxPlanId,
P.MailboxPlan,
E.SubscriberNumber
FROM
ExchangeAccounts AS E
LEFT OUTER JOIN ExchangeMailboxPlans AS P ON E.MailboxPlanId = P.MailboxPlanId
WHERE
E.ItemID = @ItemID AND
E.MailboxPlanId = @MailboxPlanId AND
E.AccountType IN (1,5)
RETURN
END
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'GetExchangeMailboxPlan') IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'GetExchangeMailboxPlan')
BEGIN BEGIN
EXEC sp_executesql N' CREATE PROCEDURE [dbo].[GetExchangeMailboxPlan] EXEC sp_executesql N'CREATE PROCEDURE [dbo].[GetExchangeMailboxPlan]
( (
@MailboxPlanId int @MailboxPlanId int
) )
@ -2622,7 +2871,8 @@ SELECT
MaxSendMessageSizeKB, MaxSendMessageSizeKB,
ProhibitSendPct, ProhibitSendPct,
ProhibitSendReceivePct, ProhibitSendReceivePct,
HideFromAddressBook HideFromAddressBook,
MailboxPlanType
FROM FROM
ExchangeMailboxPlans ExchangeMailboxPlans
WHERE WHERE
@ -2636,6 +2886,42 @@ GO
ALTER PROCEDURE [dbo].[GetExchangeMailboxPlan]
(
@MailboxPlanId int
)
AS
SELECT
MailboxPlanId,
ItemID,
MailboxPlan,
EnableActiveSync,
EnableIMAP,
EnableMAPI,
EnableOWA,
EnablePOP,
IsDefault,
IssueWarningPct,
KeepDeletedItemsDays,
MailboxSizeMB,
MaxReceiveMessageSizeKB,
MaxRecipients,
MaxSendMessageSizeKB,
ProhibitSendPct,
ProhibitSendReceivePct,
HideFromAddressBook,
MailboxPlanType
FROM
ExchangeMailboxPlans
WHERE
MailboxPlanId = @MailboxPlanId
RETURN
GO
@ -2674,7 +2960,8 @@ SELECT
MaxSendMessageSizeKB, MaxSendMessageSizeKB,
ProhibitSendPct, ProhibitSendPct,
ProhibitSendReceivePct, ProhibitSendReceivePct,
HideFromAddressBook HideFromAddressBook,
MailboxPlanType
FROM FROM
ExchangeMailboxPlans ExchangeMailboxPlans
WHERE WHERE
@ -2691,6 +2978,44 @@ GO
ALTER PROCEDURE [dbo].[GetExchangeMailboxPlans]
(
@ItemID int
)
AS
SELECT
MailboxPlanId,
ItemID,
MailboxPlan,
EnableActiveSync,
EnableIMAP,
EnableMAPI,
EnableOWA,
EnablePOP,
IsDefault,
IssueWarningPct,
KeepDeletedItemsDays,
MailboxSizeMB,
MaxReceiveMessageSizeKB,
MaxRecipients,
MaxSendMessageSizeKB,
ProhibitSendPct,
ProhibitSendReceivePct,
HideFromAddressBook,
MailboxPlanType
FROM
ExchangeMailboxPlans
WHERE
ItemID = @ItemID
ORDER BY MailboxPlan
RETURN
GO
@ -4740,3 +5065,105 @@ BEGIN
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (66, N'ServiceUrl', N'http://localhost:9998/services/') INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (66, N'ServiceUrl', N'http://localhost:9998/services/')
END END
GO GO
ALTER PROCEDURE [dbo].[AddServiceItem]
(
@ActorID int,
@PackageID int,
@ServiceID int,
@ItemName nvarchar(500),
@ItemTypeName nvarchar(200),
@ItemID int OUTPUT,
@XmlProperties ntext,
@CreatedDate datetime
)
AS
BEGIN TRAN
-- check rights
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
-- get GroupID
DECLARE @GroupID int
SELECT
@GroupID = PROV.GroupID
FROM Services AS S
INNER JOIN Providers AS PROV ON S.ProviderID = PROV.ProviderID
WHERE S.ServiceID = @ServiceID
DECLARE @ItemTypeID int
SELECT @ItemTypeID = ItemTypeID FROM ServiceItemTypes
WHERE TypeName = @ItemTypeName
AND ((@GroupID IS NULL) OR (@GroupID IS NOT NULL AND GroupID = @GroupID))
-- Fix to allow plans assigned to serveradmin
IF (@ItemTypeName = 'WebsitePanel.Providers.HostedSolution.Organization, WebsitePanel.Providers.Base')
BEGIN
IF NOT EXISTS (SELECT * FROM ServiceItems WHERE PackageID = 1)
BEGIN
INSERT INTO ServiceItems (PackageID, ItemTypeID,ServiceID,ItemName,CreatedDate)
VALUES(1, @ItemTypeID, @ServiceID, 'System', @CreatedDate)
DECLARE @TempItemID int
SET @TempItemID = SCOPE_IDENTITY()
INSERT INTO ExchangeOrganizations (ItemID, OrganizationID)
VALUES(@TempItemID, 'System')
END
END
-- add item
INSERT INTO ServiceItems
(
PackageID,
ServiceID,
ItemName,
ItemTypeID,
CreatedDate
)
VALUES
(
@PackageID,
@ServiceID,
@ItemName,
@ItemTypeID,
@CreatedDate
)
SET @ItemID = SCOPE_IDENTITY()
DECLARE @idoc int
--Create an internal representation of the XML document.
EXEC sp_xml_preparedocument @idoc OUTPUT, @XmlProperties
-- Execute a SELECT statement that uses the OPENXML rowset provider.
DELETE FROM ServiceItemProperties
WHERE ItemID = @ItemID
INSERT INTO ServiceItemProperties
(
ItemID,
PropertyName,
PropertyValue
)
SELECT
@ItemID,
PropertyName,
PropertyValue
FROM OPENXML(@idoc, '/properties/property',1) WITH
(
PropertyName nvarchar(50) '@name',
PropertyValue nvarchar(3000) '@value'
) as PV
-- remove document
exec sp_xml_removedocument @idoc
COMMIT TRAN
RETURN
GO

View file

@ -160,6 +160,15 @@ namespace WebsitePanel.EnterpriseServer
new SqlParameter("@userId", userId)); new SqlParameter("@userId", userId));
} }
public static IDataReader GetUserByExchangeOrganizationIdInternally(int itemId)
{
return (IDataReader)SqlHelper.ExecuteReader(ConnectionString, CommandType.StoredProcedure,
ObjectQualifier + "GetUserByExchangeOrganizationIdInternally",
new SqlParameter("@ItemID", itemId));
}
public static IDataReader GetUserByIdInternally(int userId) public static IDataReader GetUserByIdInternally(int userId)
{ {
return (IDataReader)SqlHelper.ExecuteReader(ConnectionString, CommandType.StoredProcedure, return (IDataReader)SqlHelper.ExecuteReader(ConnectionString, CommandType.StoredProcedure,
@ -2440,7 +2449,7 @@ namespace WebsitePanel.EnterpriseServer
#region Exchange Mailbox Plans #region Exchange Mailbox Plans
public static int AddExchangeMailboxPlan(int itemID, string mailboxPlan, bool enableActiveSync, bool enableIMAP, bool enableMAPI, bool enableOWA, bool enablePOP, public static int AddExchangeMailboxPlan(int itemID, string mailboxPlan, bool enableActiveSync, bool enableIMAP, bool enableMAPI, bool enableOWA, bool enablePOP,
bool isDefault, int issueWarningPct, int keepDeletedItemsDays, int mailboxSizeMB, int maxReceiveMessageSizeKB, int maxRecipients, bool isDefault, int issueWarningPct, int keepDeletedItemsDays, int mailboxSizeMB, int maxReceiveMessageSizeKB, int maxRecipients,
int maxSendMessageSizeKB, int prohibitSendPct, int prohibitSendReceivePct, bool hideFromAddressBook) int maxSendMessageSizeKB, int prohibitSendPct, int prohibitSendReceivePct, bool hideFromAddressBook, int mailboxPlanType)
{ {
SqlParameter outParam = new SqlParameter("@MailboxPlanId", SqlDbType.Int); SqlParameter outParam = new SqlParameter("@MailboxPlanId", SqlDbType.Int);
outParam.Direction = ParameterDirection.Output; outParam.Direction = ParameterDirection.Output;
@ -2466,13 +2475,46 @@ namespace WebsitePanel.EnterpriseServer
new SqlParameter("@MaxSendMessageSizeKB", maxSendMessageSizeKB), new SqlParameter("@MaxSendMessageSizeKB", maxSendMessageSizeKB),
new SqlParameter("@ProhibitSendPct", prohibitSendPct), new SqlParameter("@ProhibitSendPct", prohibitSendPct),
new SqlParameter("@ProhibitSendReceivePct", prohibitSendReceivePct), new SqlParameter("@ProhibitSendReceivePct", prohibitSendReceivePct),
new SqlParameter("@HideFromAddressBook", hideFromAddressBook) new SqlParameter("@HideFromAddressBook", hideFromAddressBook),
new SqlParameter("@MailboxPlanType", mailboxPlanType)
); );
return Convert.ToInt32(outParam.Value); return Convert.ToInt32(outParam.Value);
} }
public static void UpdateExchangeMailboxPlan(int mailboxPlanID, string mailboxPlan, bool enableActiveSync, bool enableIMAP, bool enableMAPI, bool enableOWA, bool enablePOP,
bool isDefault, int issueWarningPct, int keepDeletedItemsDays, int mailboxSizeMB, int maxReceiveMessageSizeKB, int maxRecipients,
int maxSendMessageSizeKB, int prohibitSendPct, int prohibitSendReceivePct, bool hideFromAddressBook, int mailboxPlanType)
{
SqlHelper.ExecuteNonQuery(
ConnectionString,
CommandType.StoredProcedure,
"UpdateExchangeMailboxPlan",
new SqlParameter("@MailboxPlanID", mailboxPlanID),
new SqlParameter("@MailboxPlan", mailboxPlan),
new SqlParameter("@EnableActiveSync", enableActiveSync),
new SqlParameter("@EnableIMAP", enableIMAP),
new SqlParameter("@EnableMAPI", enableMAPI),
new SqlParameter("@EnableOWA", enableOWA),
new SqlParameter("@EnablePOP", enablePOP),
new SqlParameter("@IsDefault", isDefault),
new SqlParameter("@IssueWarningPct", issueWarningPct),
new SqlParameter("@KeepDeletedItemsDays", keepDeletedItemsDays),
new SqlParameter("@MailboxSizeMB", mailboxSizeMB),
new SqlParameter("@MaxReceiveMessageSizeKB", maxReceiveMessageSizeKB),
new SqlParameter("@MaxRecipients", maxRecipients),
new SqlParameter("@MaxSendMessageSizeKB", maxSendMessageSizeKB),
new SqlParameter("@ProhibitSendPct", prohibitSendPct),
new SqlParameter("@ProhibitSendReceivePct", prohibitSendReceivePct),
new SqlParameter("@HideFromAddressBook", hideFromAddressBook),
new SqlParameter("@MailboxPlanType", mailboxPlanType)
);
}
public static void DeleteExchangeMailboxPlan(int mailboxPlanId) public static void DeleteExchangeMailboxPlan(int mailboxPlanId)
{ {
SqlHelper.ExecuteNonQuery( SqlHelper.ExecuteNonQuery(

View file

@ -1543,9 +1543,9 @@ namespace WebsitePanel.EnterpriseServer
plan.EnableOWA, plan.EnableOWA,
plan.EnableMAPI, plan.EnableMAPI,
plan.EnableActiveSync, plan.EnableActiveSync,
(int)Math.Round((double)((plan.IssueWarningPct * plan.MailboxSizeMB * 1024) / 100)), plan.MailboxSizeMB != -1 ? (int)Math.Round((double)((plan.IssueWarningPct * plan.MailboxSizeMB * 1024) / 100)) : -1,
(int)Math.Round((double)((plan.ProhibitSendPct * plan.MailboxSizeMB * 1024) / 100)), plan.MailboxSizeMB != -1 ? (int)Math.Round((double)((plan.ProhibitSendPct * plan.MailboxSizeMB * 1024) / 100)) : -1,
(int)Math.Round((double)((plan.ProhibitSendReceivePct * plan.MailboxSizeMB * 1024) / 100)), plan.MailboxSizeMB != -1 ? (int)Math.Round((double)((plan.ProhibitSendReceivePct * plan.MailboxSizeMB * 1024) / 100)) : -1,
plan.KeepDeletedItemsDays, plan.KeepDeletedItemsDays,
plan.MaxRecipients, plan.MaxRecipients,
plan.MaxSendMessageSizeKB, plan.MaxSendMessageSizeKB,
@ -2463,9 +2463,9 @@ namespace WebsitePanel.EnterpriseServer
plan.EnableOWA, plan.EnableOWA,
plan.EnableMAPI, plan.EnableMAPI,
plan.EnableActiveSync, plan.EnableActiveSync,
(int)Math.Round((double)((plan.IssueWarningPct * plan.MailboxSizeMB * 1024) / 100)), plan.MailboxSizeMB != -1 ? (int)Math.Round((double)((plan.IssueWarningPct * plan.MailboxSizeMB * 1024) / 100)) : -1,
(int)Math.Round((double)((plan.ProhibitSendPct * plan.MailboxSizeMB * 1024) / 100)), plan.MailboxSizeMB != -1 ? (int)Math.Round((double)((plan.ProhibitSendPct * plan.MailboxSizeMB * 1024) / 100)) : -1,
(int)Math.Round((double)((plan.ProhibitSendReceivePct * plan.MailboxSizeMB * 1024) / 100)), plan.MailboxSizeMB != -1 ? (int)Math.Round((double)((plan.ProhibitSendReceivePct * plan.MailboxSizeMB * 1024) / 100)) : -1,
plan.KeepDeletedItemsDays, plan.KeepDeletedItemsDays,
plan.MaxRecipients, plan.MaxRecipients,
plan.MaxSendMessageSizeKB, plan.MaxSendMessageSizeKB,
@ -2493,8 +2493,13 @@ namespace WebsitePanel.EnterpriseServer
try try
{ {
return ObjectUtils.CreateListFromDataReader<ExchangeMailboxPlan>( List<ExchangeMailboxPlan> mailboxPlans = new List<ExchangeMailboxPlan>();
DataProvider.GetExchangeMailboxPlans(itemId));
UserInfo user = ObjectUtils.FillObjectFromDataReader<UserInfo>(DataProvider.GetUserByExchangeOrganizationIdInternally(itemId));
ExchangeServerController.GetExchangeMailboxPlansByUser(user, ref mailboxPlans);
return mailboxPlans;
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -2506,6 +2511,43 @@ namespace WebsitePanel.EnterpriseServer
} }
} }
private static void GetExchangeMailboxPlansByUser(UserInfo user, ref List<ExchangeMailboxPlan>mailboxPlans)
{
if ((user != null))
{
List<Organization> orgs = null;
if (user.UserId != 1)
{
List<PackageInfo> Packages = PackageController.GetPackages(user.UserId);
if ((Packages != null) & (Packages.Count > 0))
{
orgs = GetExchangeOrganizations(Packages[0].PackageId, false);
}
}
else
{
orgs = GetExchangeOrganizations(1, false);
}
if ((orgs != null) &(orgs.Count > 0))
{
List<ExchangeMailboxPlan> Plans = ObjectUtils.CreateListFromDataReader<ExchangeMailboxPlan>(DataProvider.GetExchangeMailboxPlans(orgs[0].Id));
foreach (ExchangeMailboxPlan p in Plans)
{
mailboxPlans.Add(p);
}
}
UserInfo owner = UserController.GetUserInternally(user.OwnerId);
GetExchangeMailboxPlansByUser(owner, ref mailboxPlans);
}
}
public static ExchangeMailboxPlan GetExchangeMailboxPlan(int itemID, int mailboxPlanId) public static ExchangeMailboxPlan GetExchangeMailboxPlan(int itemID, int mailboxPlanId)
{ {
@ -2543,28 +2585,40 @@ namespace WebsitePanel.EnterpriseServer
// load package context // load package context
PackageContext cntx = PackageController.GetPackageContext(org.PackageId); PackageContext cntx = PackageController.GetPackageContext(org.PackageId);
mailboxPlan.EnableActiveSync = mailboxPlan.EnableActiveSync & Convert.ToBoolean(cntx.Quotas[Quotas.EXCHANGE2007_ACTIVESYNCALLOWED].QuotaAllocatedValue); if (org.PackageId > 1)
mailboxPlan.EnableIMAP = mailboxPlan.EnableIMAP & Convert.ToBoolean(cntx.Quotas[Quotas.EXCHANGE2007_IMAPALLOWED].QuotaAllocatedValue); {
mailboxPlan.EnableMAPI = mailboxPlan.EnableMAPI & Convert.ToBoolean(cntx.Quotas[Quotas.EXCHANGE2007_MAPIALLOWED].QuotaAllocatedValue); mailboxPlan.EnableActiveSync = mailboxPlan.EnableActiveSync & Convert.ToBoolean(cntx.Quotas[Quotas.EXCHANGE2007_ACTIVESYNCALLOWED].QuotaAllocatedValue);
mailboxPlan.EnableOWA = mailboxPlan.EnableOWA & Convert.ToBoolean(cntx.Quotas[Quotas.EXCHANGE2007_OWAALLOWED].QuotaAllocatedValue); mailboxPlan.EnableIMAP = mailboxPlan.EnableIMAP & Convert.ToBoolean(cntx.Quotas[Quotas.EXCHANGE2007_IMAPALLOWED].QuotaAllocatedValue);
mailboxPlan.EnablePOP = mailboxPlan.EnablePOP & Convert.ToBoolean(cntx.Quotas[Quotas.EXCHANGE2007_POP3ALLOWED].QuotaAllocatedValue); mailboxPlan.EnableMAPI = mailboxPlan.EnableMAPI & Convert.ToBoolean(cntx.Quotas[Quotas.EXCHANGE2007_MAPIALLOWED].QuotaAllocatedValue);
if (mailboxPlan.KeepDeletedItemsDays > cntx.Quotas[Quotas.EXCHANGE2007_KEEPDELETEDITEMSDAYS].QuotaAllocatedValue) mailboxPlan.EnableOWA = mailboxPlan.EnableOWA & Convert.ToBoolean(cntx.Quotas[Quotas.EXCHANGE2007_OWAALLOWED].QuotaAllocatedValue);
mailboxPlan.KeepDeletedItemsDays = cntx.Quotas[Quotas.EXCHANGE2007_KEEPDELETEDITEMSDAYS].QuotaAllocatedValue; mailboxPlan.EnablePOP = mailboxPlan.EnablePOP & Convert.ToBoolean(cntx.Quotas[Quotas.EXCHANGE2007_POP3ALLOWED].QuotaAllocatedValue);
if (cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue != -1)
if (mailboxPlan.MailboxSizeMB > cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue) if (cntx.Quotas[Quotas.EXCHANGE2007_KEEPDELETEDITEMSDAYS].QuotaAllocatedValue != -1)
mailboxPlan.MailboxSizeMB = cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue; if (mailboxPlan.KeepDeletedItemsDays > cntx.Quotas[Quotas.EXCHANGE2007_KEEPDELETEDITEMSDAYS].QuotaAllocatedValue)
if (mailboxPlan.MaxReceiveMessageSizeKB > cntx.Quotas[Quotas.EXCHANGE2007_MAXRECEIVEMESSAGESIZEKB].QuotaAllocatedValue) mailboxPlan.KeepDeletedItemsDays = cntx.Quotas[Quotas.EXCHANGE2007_KEEPDELETEDITEMSDAYS].QuotaAllocatedValue;
mailboxPlan.MaxReceiveMessageSizeKB = cntx.Quotas[Quotas.EXCHANGE2007_MAXRECEIVEMESSAGESIZEKB].QuotaAllocatedValue;
if (mailboxPlan.MaxSendMessageSizeKB > cntx.Quotas[Quotas.EXCHANGE2007_MAXSENDMESSAGESIZEKB].QuotaAllocatedValue) if (cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue != -1)
mailboxPlan.MaxSendMessageSizeKB = cntx.Quotas[Quotas.EXCHANGE2007_MAXSENDMESSAGESIZEKB].QuotaAllocatedValue; if (mailboxPlan.MailboxSizeMB > cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue)
if (cntx.Quotas[Quotas.EXCHANGE2007_MAXRECIPIENTS].QuotaAllocatedValue != -1) mailboxPlan.MailboxSizeMB = cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue;
if (mailboxPlan.MaxRecipients > cntx.Quotas[Quotas.EXCHANGE2007_MAXRECIPIENTS].QuotaAllocatedValue)
mailboxPlan.MaxRecipients = cntx.Quotas[Quotas.EXCHANGE2007_MAXRECIPIENTS].QuotaAllocatedValue; if (cntx.Quotas[Quotas.EXCHANGE2007_MAXRECEIVEMESSAGESIZEKB].QuotaAllocatedValue != -1)
if (Convert.ToBoolean(cntx.Quotas[Quotas.EXCHANGE2007_ISCONSUMER].QuotaAllocatedValue)) mailboxPlan.HideFromAddressBook = true; if (mailboxPlan.MaxReceiveMessageSizeKB > cntx.Quotas[Quotas.EXCHANGE2007_MAXRECEIVEMESSAGESIZEKB].QuotaAllocatedValue)
mailboxPlan.MaxReceiveMessageSizeKB = cntx.Quotas[Quotas.EXCHANGE2007_MAXRECEIVEMESSAGESIZEKB].QuotaAllocatedValue;
if (cntx.Quotas[Quotas.EXCHANGE2007_MAXSENDMESSAGESIZEKB].QuotaAllocatedValue != -1)
if (mailboxPlan.MaxSendMessageSizeKB > cntx.Quotas[Quotas.EXCHANGE2007_MAXSENDMESSAGESIZEKB].QuotaAllocatedValue)
mailboxPlan.MaxSendMessageSizeKB = cntx.Quotas[Quotas.EXCHANGE2007_MAXSENDMESSAGESIZEKB].QuotaAllocatedValue;
if (cntx.Quotas[Quotas.EXCHANGE2007_MAXRECIPIENTS].QuotaAllocatedValue != -1)
if (mailboxPlan.MaxRecipients > cntx.Quotas[Quotas.EXCHANGE2007_MAXRECIPIENTS].QuotaAllocatedValue)
mailboxPlan.MaxRecipients = cntx.Quotas[Quotas.EXCHANGE2007_MAXRECIPIENTS].QuotaAllocatedValue;
if (Convert.ToBoolean(cntx.Quotas[Quotas.EXCHANGE2007_ISCONSUMER].QuotaAllocatedValue)) mailboxPlan.HideFromAddressBook = true;
}
return DataProvider.AddExchangeMailboxPlan(itemID, mailboxPlan.MailboxPlan, mailboxPlan.EnableActiveSync, mailboxPlan.EnableIMAP, mailboxPlan.EnableMAPI, mailboxPlan.EnableOWA, mailboxPlan.EnablePOP, return DataProvider.AddExchangeMailboxPlan(itemID, mailboxPlan.MailboxPlan, mailboxPlan.EnableActiveSync, mailboxPlan.EnableIMAP, mailboxPlan.EnableMAPI, mailboxPlan.EnableOWA, mailboxPlan.EnablePOP,
mailboxPlan.IsDefault, mailboxPlan.IssueWarningPct, mailboxPlan.KeepDeletedItemsDays, mailboxPlan.MailboxSizeMB, mailboxPlan.MaxReceiveMessageSizeKB, mailboxPlan.MaxRecipients, mailboxPlan.IsDefault, mailboxPlan.IssueWarningPct, mailboxPlan.KeepDeletedItemsDays, mailboxPlan.MailboxSizeMB, mailboxPlan.MaxReceiveMessageSizeKB, mailboxPlan.MaxRecipients,
mailboxPlan.MaxSendMessageSizeKB, mailboxPlan.ProhibitSendPct, mailboxPlan.ProhibitSendReceivePct, mailboxPlan.HideFromAddressBook); mailboxPlan.MaxSendMessageSizeKB, mailboxPlan.ProhibitSendPct, mailboxPlan.ProhibitSendReceivePct, mailboxPlan.HideFromAddressBook, mailboxPlan.MailboxPlanType);
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -2577,6 +2631,72 @@ namespace WebsitePanel.EnterpriseServer
} }
public static int UpdateExchangeMailboxPlan(int itemID, ExchangeMailboxPlan mailboxPlan)
{
// place log record
TaskManager.StartTask("EXCHANGE", "UPDATE_EXCHANGE_MAILBOXPLAN");
TaskManager.ItemId = itemID;
try
{
Organization org = GetOrganization(itemID);
if (org == null)
return -1;
// load package context
PackageContext cntx = PackageController.GetPackageContext(org.PackageId);
if (org.PackageId > 1)
{
mailboxPlan.EnableActiveSync = mailboxPlan.EnableActiveSync & Convert.ToBoolean(cntx.Quotas[Quotas.EXCHANGE2007_ACTIVESYNCALLOWED].QuotaAllocatedValue);
mailboxPlan.EnableIMAP = mailboxPlan.EnableIMAP & Convert.ToBoolean(cntx.Quotas[Quotas.EXCHANGE2007_IMAPALLOWED].QuotaAllocatedValue);
mailboxPlan.EnableMAPI = mailboxPlan.EnableMAPI & Convert.ToBoolean(cntx.Quotas[Quotas.EXCHANGE2007_MAPIALLOWED].QuotaAllocatedValue);
mailboxPlan.EnableOWA = mailboxPlan.EnableOWA & Convert.ToBoolean(cntx.Quotas[Quotas.EXCHANGE2007_OWAALLOWED].QuotaAllocatedValue);
mailboxPlan.EnablePOP = mailboxPlan.EnablePOP & Convert.ToBoolean(cntx.Quotas[Quotas.EXCHANGE2007_POP3ALLOWED].QuotaAllocatedValue);
if (cntx.Quotas[Quotas.EXCHANGE2007_KEEPDELETEDITEMSDAYS].QuotaAllocatedValue != -1)
if (mailboxPlan.KeepDeletedItemsDays > cntx.Quotas[Quotas.EXCHANGE2007_KEEPDELETEDITEMSDAYS].QuotaAllocatedValue)
mailboxPlan.KeepDeletedItemsDays = cntx.Quotas[Quotas.EXCHANGE2007_KEEPDELETEDITEMSDAYS].QuotaAllocatedValue;
if (cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue != -1)
if (mailboxPlan.MailboxSizeMB > cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue)
mailboxPlan.MailboxSizeMB = cntx.Quotas[Quotas.EXCHANGE2007_DISKSPACE].QuotaAllocatedValue;
if (cntx.Quotas[Quotas.EXCHANGE2007_MAXRECEIVEMESSAGESIZEKB].QuotaAllocatedValue != -1)
if (mailboxPlan.MaxReceiveMessageSizeKB > cntx.Quotas[Quotas.EXCHANGE2007_MAXRECEIVEMESSAGESIZEKB].QuotaAllocatedValue)
mailboxPlan.MaxReceiveMessageSizeKB = cntx.Quotas[Quotas.EXCHANGE2007_MAXRECEIVEMESSAGESIZEKB].QuotaAllocatedValue;
if (cntx.Quotas[Quotas.EXCHANGE2007_MAXSENDMESSAGESIZEKB].QuotaAllocatedValue != -1)
if (mailboxPlan.MaxSendMessageSizeKB > cntx.Quotas[Quotas.EXCHANGE2007_MAXSENDMESSAGESIZEKB].QuotaAllocatedValue)
mailboxPlan.MaxSendMessageSizeKB = cntx.Quotas[Quotas.EXCHANGE2007_MAXSENDMESSAGESIZEKB].QuotaAllocatedValue;
if (cntx.Quotas[Quotas.EXCHANGE2007_MAXRECIPIENTS].QuotaAllocatedValue != -1)
if (mailboxPlan.MaxRecipients > cntx.Quotas[Quotas.EXCHANGE2007_MAXRECIPIENTS].QuotaAllocatedValue)
mailboxPlan.MaxRecipients = cntx.Quotas[Quotas.EXCHANGE2007_MAXRECIPIENTS].QuotaAllocatedValue;
if (Convert.ToBoolean(cntx.Quotas[Quotas.EXCHANGE2007_ISCONSUMER].QuotaAllocatedValue)) mailboxPlan.HideFromAddressBook = true;
}
DataProvider.UpdateExchangeMailboxPlan(mailboxPlan.MailboxPlanId, mailboxPlan.MailboxPlan, mailboxPlan.EnableActiveSync, mailboxPlan.EnableIMAP, mailboxPlan.EnableMAPI, mailboxPlan.EnableOWA, mailboxPlan.EnablePOP,
mailboxPlan.IsDefault, mailboxPlan.IssueWarningPct, mailboxPlan.KeepDeletedItemsDays, mailboxPlan.MailboxSizeMB, mailboxPlan.MaxReceiveMessageSizeKB, mailboxPlan.MaxRecipients,
mailboxPlan.MaxSendMessageSizeKB, mailboxPlan.ProhibitSendPct, mailboxPlan.ProhibitSendReceivePct, mailboxPlan.HideFromAddressBook, mailboxPlan.MailboxPlanType);
}
catch (Exception ex)
{
throw TaskManager.WriteError(ex);
}
finally
{
TaskManager.CompleteTask();
}
return 0;
}
public static int DeleteExchangeMailboxPlan(int itemID, int mailboxPlanId) public static int DeleteExchangeMailboxPlan(int itemID, int mailboxPlanId)
{ {
TaskManager.StartTask("EXCHANGE", "DELETE_EXCHANGE_MAILBOXPLAN"); TaskManager.StartTask("EXCHANGE", "DELETE_EXCHANGE_MAILBOXPLAN");

View file

@ -521,6 +521,13 @@ namespace WebsitePanel.EnterpriseServer
return ExchangeServerController.AddExchangeMailboxPlan(itemId, mailboxPlan); return ExchangeServerController.AddExchangeMailboxPlan(itemId, mailboxPlan);
} }
[WebMethod]
public int UpdateExchangeMailboxPlan(int itemId, ExchangeMailboxPlan mailboxPlan)
{
return ExchangeServerController.UpdateExchangeMailboxPlan(itemId, mailboxPlan);
}
[WebMethod] [WebMethod]
public int DeleteExchangeMailboxPlan(int itemId, int mailboxPlanId) public int DeleteExchangeMailboxPlan(int itemId, int mailboxPlanId)
{ {

View file

@ -34,6 +34,7 @@ namespace WebsitePanel.Providers.HostedSolution
{ {
public class ExchangeMailboxPlan public class ExchangeMailboxPlan
{ {
int itemId;
int mailboxPlanId; int mailboxPlanId;
string mailboxPlan; string mailboxPlan;
int mailboxSizeMB; int mailboxSizeMB;
@ -53,6 +54,15 @@ namespace WebsitePanel.Providers.HostedSolution
int keepDeletedItemsDays; int keepDeletedItemsDays;
bool isDefault; bool isDefault;
bool hideFromAddressBook; bool hideFromAddressBook;
int mailboxPlanType;
public int ItemId
{
get { return this.itemId; }
set { this.itemId = value; }
}
public int MailboxPlanId public int MailboxPlanId
{ {
@ -66,6 +76,13 @@ namespace WebsitePanel.Providers.HostedSolution
set { this.mailboxPlan = value; } set { this.mailboxPlan = value; }
} }
public int MailboxPlanType
{
get { return this.mailboxPlanType; }
set { this.mailboxPlanType = value; }
}
public int MailboxSizeMB public int MailboxSizeMB
{ {
get { return this.mailboxSizeMB; } get { return this.mailboxSizeMB; }

View file

@ -0,0 +1,37 @@
// Copyright (c) 2012, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
namespace WebsitePanel.Providers.HostedSolution
{
public enum ExchangeMailboxPlanType
{
User = 0,
Reseller = 1,
Administrator = 2
}
}

View file

@ -80,6 +80,7 @@
<Compile Include="HostedSolution\BlackBerryErrorsCodes.cs" /> <Compile Include="HostedSolution\BlackBerryErrorsCodes.cs" />
<Compile Include="HostedSolution\BlackBerryStatsItem.cs" /> <Compile Include="HostedSolution\BlackBerryStatsItem.cs" />
<Compile Include="HostedSolution\BlackBerryUserDeleteState.cs" /> <Compile Include="HostedSolution\BlackBerryUserDeleteState.cs" />
<Compile Include="HostedSolution\ExchangeMailboxPlanType.cs" />
<Compile Include="HostedSolution\ExchangeMailboxPlan.cs" /> <Compile Include="HostedSolution\ExchangeMailboxPlan.cs" />
<Compile Include="HostedSolution\ILyncServer.cs" /> <Compile Include="HostedSolution\ILyncServer.cs" />
<Compile Include="HostedSolution\LyncConstants.cs" /> <Compile Include="HostedSolution\LyncConstants.cs" />

View file

@ -3,7 +3,7 @@
<!-- Display Settings --> <!-- Display Settings -->
<PortalName>WebsitePanel</PortalName> <PortalName>WebsitePanel</PortalName>
<!-- Enterprise Server --> <!-- Enterprise Server -->
<EnterpriseServer>http://localhost:9005</EnterpriseServer> <EnterpriseServer>http://localhost:9002</EnterpriseServer>
<!-- General Settings --> <!-- General Settings -->
<CultureCookieName>UserCulture</CultureCookieName> <CultureCookieName>UserCulture</CultureCookieName>
<ThemeCookieName>UserTheme</ThemeCookieName> <ThemeCookieName>UserTheme</ThemeCookieName>

View file

@ -5155,6 +5155,9 @@
<data name="Error.EXCHANGE_SET_DEFAULT_MAILBOXPLAN" xml:space="preserve"> <data name="Error.EXCHANGE_SET_DEFAULT_MAILBOXPLAN" xml:space="preserve">
<value>Failed to set default mailbox plan.</value> <value>Failed to set default mailbox plan.</value>
</data> </data>
<data name="Error.EXCHANGE_UNABLE_USE_SYSTEMPLAN" xml:space="preserve">
<value>Not possible to perform requested action on a system defined plan.</value>
</data>
<data name="Error.EXCHANGE_FAILED_TO_STAMP" xml:space="preserve"> <data name="Error.EXCHANGE_FAILED_TO_STAMP" xml:space="preserve">
<value>Failed to stamp mailbox with a mailbox plan. See storage allocation.</value> <value>Failed to stamp mailbox with a mailbox plan. See storage allocation.</value>
</data> </data>
@ -5176,10 +5179,30 @@
<data name="Success.EXCHANGE_MATCHPLANS" xml:space="preserve"> <data name="Success.EXCHANGE_MATCHPLANS" xml:space="preserve">
<value>Succesfully plans matched and applied</value> <value>Succesfully plans matched and applied</value>
</data> </data>
<data name="Error.EXCHANGE_STAMPMAILBOXES" xml:space="preserve">
<value>Failed to stamp mailboxes</value>
</data>
<data name="Success.EXCHANGE_STAMPMAILBOXES" xml:space="preserve">
<value>Succesfully stamp mailboxes</value>
</data>
<data name="Error.EXCHANGE_UPDATEPLANS" xml:space="preserve">
<value>Mailbox plan update failed</value>
</data>
<data name="Success.EXCHANGE_UPDATEPLANS" xml:space="preserve">
<value>Mailbox plan updated</value>
</data>
<data name="Error.LYNC_APPLYPLANTEMPLATE" xml:space="preserve"> <data name="Error.LYNC_APPLYPLANTEMPLATE" xml:space="preserve">
<value>Failed to apply plans template</value> <value>Failed to apply plans template</value>
</data> </data>
<data name="Success.LYNC_APPLYPLANTEMPLATE" xml:space="preserve"> <data name="Success.LYNC_APPLYPLANTEMPLATE" xml:space="preserve">
<value>Succesfully applied plans template</value> <value>Succesfully applied plans template</value>
</data> </data>
<data name="Success.REQUEST_COMPLETED_SUCCESFULLY" xml:space="preserve">
<value>Request Completed Succesfully</value>
</data>
</root> </root>

View file

@ -219,6 +219,22 @@ TEXTAREA.TextBox200
width: 200px; width: 200px;
} }
TEXTAREA.TextBox300
{
border: solid 1px #909090;
padding-left: 2px;
padding-top: 1px;
width: 300px;
}
TEXTAREA.TextBox400
{
border: solid 1px #909090;
padding-left: 2px;
padding-top: 1px;
width: 400px;
}
.HugeTextBox .HugeTextBox
{ {
font-family: Tahoma; font-family: Tahoma;

View file

@ -219,4 +219,13 @@
<data name="btnMatchMailboxPlanToUser.Text" xml:space="preserve"> <data name="btnMatchMailboxPlanToUser.Text" xml:space="preserve">
<value>Match Mailbox Plan to User</value> <value>Match Mailbox Plan to User</value>
</data> </data>
<data name="secTools.Text" xml:space="preserve">
<value>Tools</value>
</data>
<data name="btnStamp.Text" xml:space="preserve">
<value>Restamp all mailboxes</value>
</data>
<data name="btnUpdateMailboxPlan.Text" xml:space="preserve">
<value>Update Mailbox Plan</value>
</data>
</root> </root>

View file

@ -136,7 +136,7 @@
<value>POP3</value> <value>POP3</value>
</data> </data>
<data name="FormComments.Text" xml:space="preserve"> <data name="FormComments.Text" xml:space="preserve">
<value>&lt;p&gt; A Mailbox plan is a template that defines the characteristics of a mailbox &lt;/p&gt; &lt;p&gt;The mailbox plan name needs to be unique. A mailbox plan cannot be modified. In case a mailbox needs a mailbox plan with another characteristics, a new mailbox plan needs to be created and assigned to the mailbox. A mailbox plan can only be deleted when the plan is not assigned to any mailboxes. &lt;/p&gt;</value> <value>&lt;p&gt; A Mailbox plan is a template that defines the characteristics of a mailbox &lt;/p&gt; &lt;p&gt;The mailbox plan name needs to be unique. A mailbox plan cannot be modified. In case a mailbox needs a mailbox plan with another characteristics, a new mailbox plan needs to be created and assigned to the mailbox. A mailbox plan can only be deleted when the plan is not assigned to any mailboxes. &lt;/p&gt;&lt;p&gt; Empty value indicates &lt;b&gt;'Unlimited'&lt;/b&gt;, percentages have to be a value between 0 and 100 (a value of 0 can block the mailbox from sending and receiving email) &lt;/p&gt; &lt;p&gt; Unllimited values can only be used when the hosting plan allows to do so&lt;/p&gt;</value>
</data> </data>
<data name="locDays.Text" xml:space="preserve"> <data name="locDays.Text" xml:space="preserve">
<value>days</value> <value>days</value>

View file

@ -139,7 +139,7 @@
<value>Mailbox plan</value> <value>Mailbox plan</value>
</data> </data>
<data name="gvMailboxPlanDefault.Header" xml:space="preserve"> <data name="gvMailboxPlanDefault.Header" xml:space="preserve">
<value>Default Mailbox plan</value> <value>Default</value>
</data> </data>
<data name="gvMailboxPlans.Empty" xml:space="preserve"> <data name="gvMailboxPlans.Empty" xml:space="preserve">
<value>No mailbox plans have been added yet. To add a new mailbox plan click "Add New Mailbox plan" button.</value> <value>No mailbox plans have been added yet. To add a new mailbox plan click "Add New Mailbox plan" button.</value>

View file

@ -101,25 +101,25 @@
<tr> <tr>
<td class="FormLabel200" align="right"><asp:Localize ID="locMailboxSize" runat="server" meta:resourcekey="locMailboxSize" Text="Mailbox size:"></asp:Localize></td> <td class="FormLabel200" align="right"><asp:Localize ID="locMailboxSize" runat="server" meta:resourcekey="locMailboxSize" Text="Mailbox size:"></asp:Localize></td>
<td> <td>
<wsp:SizeBox id="mailboxSize" runat="server" ValidationGroup="CreateMailboxPlan" DisplayUnitsKB="false" DisplayUnitsMB="true" DisplayUnitsPct="false" RequireValidatorEnabled="true"/> <wsp:SizeBox id="mailboxSize" runat="server" ValidationGroup="CreateMailboxPlan" DisplayUnitsKB="false" DisplayUnitsMB="true" DisplayUnitsPct="false"/>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="FormLabel200" align="right"><asp:Localize ID="locMaxRecipients" runat="server" meta:resourcekey="locMaxRecipients" Text="Maximum Recipients:"></asp:Localize></td> <td class="FormLabel200" align="right"><asp:Localize ID="locMaxRecipients" runat="server" meta:resourcekey="locMaxRecipients" Text="Maximum Recipients:"></asp:Localize></td>
<td> <td>
<wsp:SizeBox id="maxRecipients" runat="server" ValidationGroup="CreateMailboxPlan" DisplayUnitsKB="false" DisplayUnitsMB="false" DisplayUnitsPct="false" RequireValidatorEnabled="true"/> <wsp:SizeBox id="maxRecipients" runat="server" ValidationGroup="CreateMailboxPlan" DisplayUnitsKB="false" DisplayUnitsMB="false" DisplayUnitsPct="false"/>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="FormLabel200" align="right"><asp:Localize ID="locMaxSendMessageSizeKB" runat="server" meta:resourcekey="locMaxSendMessageSizeKB" Text="Maximum Send Message Size (Kb):"></asp:Localize></td> <td class="FormLabel200" align="right"><asp:Localize ID="locMaxSendMessageSizeKB" runat="server" meta:resourcekey="locMaxSendMessageSizeKB" Text="Maximum Send Message Size (Kb):"></asp:Localize></td>
<td> <td>
<wsp:SizeBox id="maxSendMessageSizeKB" runat="server" ValidationGroup="CreateMailboxPlan" DisplayUnitsKB="true" DisplayUnitsMB="false" DisplayUnitsPct="false" RequireValidatorEnabled="true"/> <wsp:SizeBox id="maxSendMessageSizeKB" runat="server" ValidationGroup="CreateMailboxPlan" DisplayUnitsKB="true" DisplayUnitsMB="false" DisplayUnitsPct="false"/>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="FormLabel200" align="right"><asp:Localize ID="locMaxReceiveMessageSizeKB" runat="server" meta:resourcekey="locMaxReceiveMessageSizeKB" Text="Maximum Receive Message Size (Kb):"></asp:Localize></td> <td class="FormLabel200" align="right"><asp:Localize ID="locMaxReceiveMessageSizeKB" runat="server" meta:resourcekey="locMaxReceiveMessageSizeKB" Text="Maximum Receive Message Size (Kb):"></asp:Localize></td>
<td> <td>
<wsp:SizeBox id="maxReceiveMessageSizeKB" runat="server" ValidationGroup="CreateMailboxPlan" DisplayUnitsKB="true" DisplayUnitsMB="false" DisplayUnitsPct="false" RequireValidatorEnabled="true"/> <wsp:SizeBox id="maxReceiveMessageSizeKB" runat="server" ValidationGroup="CreateMailboxPlan" DisplayUnitsKB="true" DisplayUnitsMB="false" DisplayUnitsPct="false"/>
</td> </td>
</tr> </tr>

View file

@ -40,14 +40,20 @@ namespace WebsitePanel.Portal.ExchangeServer
if (!IsPostBack) if (!IsPostBack)
{ {
PackageContext cntx = ES.Services.Packages.GetPackageContext(PanelSecurity.PackageId);
if (PanelRequest.GetInt("MailboxPlanId") != 0) if (PanelRequest.GetInt("MailboxPlanId") != 0)
{ {
Providers.HostedSolution.ExchangeMailboxPlan plan = ES.Services.ExchangeServer.GetExchangeMailboxPlan(PanelRequest.ItemID, PanelRequest.GetInt("MailboxPlanId")); Providers.HostedSolution.ExchangeMailboxPlan plan = ES.Services.ExchangeServer.GetExchangeMailboxPlan(PanelRequest.ItemID, PanelRequest.GetInt("MailboxPlanId"));
txtMailboxPlan.Text = plan.MailboxPlan; txtMailboxPlan.Text = plan.MailboxPlan;
mailboxSize.ValueKB = plan.MailboxSizeMB; if (plan.MailboxSizeMB != -1)
maxRecipients.ValueKB = plan.MaxRecipients; mailboxSize.ValueKB = plan.MailboxSizeMB;
maxSendMessageSizeKB.ValueKB = plan.MaxSendMessageSizeKB; if (plan.MaxRecipients != -1)
maxReceiveMessageSizeKB.ValueKB = plan.MaxReceiveMessageSizeKB; maxRecipients.ValueKB = plan.MaxRecipients;
if (plan.MaxSendMessageSizeKB != -1)
maxSendMessageSizeKB.ValueKB = plan.MaxSendMessageSizeKB;
if (plan.MaxReceiveMessageSizeKB != -1)
maxReceiveMessageSizeKB.ValueKB = plan.MaxReceiveMessageSizeKB;
chkPOP3.Checked = plan.EnablePOP; chkPOP3.Checked = plan.EnablePOP;
chkIMAP.Checked = plan.EnableIMAP; chkIMAP.Checked = plan.EnableIMAP;
chkOWA.Checked = plan.EnableOWA; chkOWA.Checked = plan.EnableOWA;
@ -85,21 +91,47 @@ namespace WebsitePanel.Portal.ExchangeServer
} }
else else
{ {
PackageContext cntx = ES.Services.Packages.GetPackageContext(PanelSecurity.PackageId);
if (cntx != null) if (cntx != null)
{ {
foreach (QuotaValueInfo quota in cntx.QuotasArray) foreach (QuotaValueInfo quota in cntx.QuotasArray)
{ {
switch (quota.QuotaId) switch (quota.QuotaId)
{ {
case 77:
if (quota.QuotaAllocatedValue != -1)
{
mailboxSize.RequireValidatorEnabled = true;
}
else
mailboxSize.RequireValidatorEnabled = false;
break;
case 365: case 365:
maxRecipients.ValueKB = quota.QuotaAllocatedValue; if (quota.QuotaAllocatedValue != -1)
{
maxRecipients.ValueKB = quota.QuotaAllocatedValue;
maxRecipients.RequireValidatorEnabled = true;
}
else
maxRecipients.RequireValidatorEnabled = false;
break; break;
case 366: case 366:
maxSendMessageSizeKB.ValueKB = quota.QuotaAllocatedValue; if (quota.QuotaAllocatedValue != -1)
{
maxSendMessageSizeKB.ValueKB = quota.QuotaAllocatedValue;
maxSendMessageSizeKB.RequireValidatorEnabled = true;
}
else
maxSendMessageSizeKB.RequireValidatorEnabled = false;
break; break;
case 367: case 367:
maxReceiveMessageSizeKB.ValueKB = quota.QuotaAllocatedValue; if (quota.QuotaAllocatedValue != -1)
{
maxReceiveMessageSizeKB.ValueKB = quota.QuotaAllocatedValue;
maxReceiveMessageSizeKB.RequireValidatorEnabled = true;
}
else
maxReceiveMessageSizeKB.RequireValidatorEnabled = false;
break; break;
case 83: case 83:
chkPOP3.Checked = Convert.ToBoolean(quota.QuotaAllocatedValue); chkPOP3.Checked = Convert.ToBoolean(quota.QuotaAllocatedValue);
@ -123,6 +155,7 @@ namespace WebsitePanel.Portal.ExchangeServer
break; break;
case 364: case 364:
daysKeepDeletedItems.ValueDays = quota.QuotaAllocatedValue; daysKeepDeletedItems.ValueDays = quota.QuotaAllocatedValue;
daysKeepDeletedItems.RequireValidatorEnabled = true;
break; break;
} }
@ -149,13 +182,13 @@ namespace WebsitePanel.Portal.ExchangeServer
{ {
Providers.HostedSolution.ExchangeMailboxPlan plan = new Providers.HostedSolution.ExchangeMailboxPlan(); Providers.HostedSolution.ExchangeMailboxPlan plan = new Providers.HostedSolution.ExchangeMailboxPlan();
plan.MailboxPlan = txtMailboxPlan.Text; plan.MailboxPlan = txtMailboxPlan.Text;
plan.MailboxSizeMB = mailboxSize.ValueKB; plan.MailboxSizeMB = mailboxSize.ValueKB;
if ((plan.MailboxSizeMB == 0)) plan.MailboxSizeMB = 1;
plan.IsDefault = false; plan.IsDefault = false;
plan.MaxRecipients = maxRecipients.ValueKB; plan.MaxRecipients = maxRecipients.ValueKB;
plan.MaxSendMessageSizeKB = maxSendMessageSizeKB.ValueKB; plan.MaxSendMessageSizeKB = maxSendMessageSizeKB.ValueKB;
plan.MaxReceiveMessageSizeKB = maxReceiveMessageSizeKB.ValueKB; plan.MaxReceiveMessageSizeKB = maxReceiveMessageSizeKB.ValueKB;
plan.EnablePOP = chkPOP3.Checked; plan.EnablePOP = chkPOP3.Checked;
plan.EnableIMAP = chkIMAP.Checked; plan.EnableIMAP = chkIMAP.Checked;
plan.EnableOWA = chkOWA.Checked; plan.EnableOWA = chkOWA.Checked;

View file

@ -62,7 +62,7 @@
<tr> <tr>
<td class="FormLabel150"><asp:Localize ID="locQuota" runat="server" meta:resourcekey="locQuota" Text="Mailbox Size:"></asp:Localize></td> <td class="FormLabel150"><asp:Localize ID="locQuota" runat="server" meta:resourcekey="locQuota" Text="Mailbox Size:"></asp:Localize></td>
<td> <td>
<wsp:QuotaViewer ID="mailboxSize" runat="server" QuotaTypeId="2" /> MB <wsp:QuotaViewer ID="mailboxSize" runat="server" QuotaTypeId="2" DisplayGauge="true" /> MB
</td> </td>
</tr> </tr>

View file

@ -78,7 +78,7 @@ namespace WebsitePanel.Portal.ExchangeServer
} }
mailboxSize.QuotaUsedValue = Convert.ToInt32(stats.TotalSize / 1024 / 1024); mailboxSize.QuotaUsedValue = Convert.ToInt32(stats.TotalSize / 1024 / 1024);
mailboxSize.QuotaValue = (int)Math.Round((double)(stats.MaxSize / 1024 / 1024)); mailboxSize.QuotaValue = (stats.MaxSize == -1) ? -1: (int)Math.Round((double)(stats.MaxSize / 1024 / 1024));
if ((account.AccountType == ExchangeAccountType.Equipment) | (account.AccountType == ExchangeAccountType.Room)) if ((account.AccountType == ExchangeAccountType.Equipment) | (account.AccountType == ExchangeAccountType.Room))
secCalendarSettings.Visible = true; secCalendarSettings.Visible = true;

View file

@ -34,6 +34,12 @@
<asp:GridView ID="gvMailboxPlans" runat="server" AutoGenerateColumns="False" EnableViewState="true" <asp:GridView ID="gvMailboxPlans" runat="server" AutoGenerateColumns="False" EnableViewState="true"
Width="100%" EmptyDataText="gvMailboxPlans" CssSelectorClass="NormalGridView" OnRowCommand="gvMailboxPlan_RowCommand"> Width="100%" EmptyDataText="gvMailboxPlans" CssSelectorClass="NormalGridView" OnRowCommand="gvMailboxPlan_RowCommand">
<Columns> <Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Image ID="img2" runat="server" Width="16px" Height="16px" ImageUrl='<%# GetPlanType((int)Eval("MailboxPlanType")) %>' ImageAlign="AbsMiddle" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="gvMailboxPlan"> <asp:TemplateField HeaderText="gvMailboxPlan">
<ItemStyle Width="70%"></ItemStyle> <ItemStyle Width="70%"></ItemStyle>
<ItemTemplate> <ItemTemplate>
@ -50,11 +56,11 @@
</div> </div>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField> <asp:TemplateField >
<ItemTemplate> <ItemTemplate>
&nbsp;<asp:ImageButton ID="imgDelMailboxPlan" runat="server" Text="Delete" SkinID="ExchangeDelete" &nbsp;<asp:ImageButton ID="imgDelMailboxPlan" runat="server" Text="Delete" SkinID="ExchangeDelete"
CommandName="DeleteItem" CommandArgument='<%# Eval("MailboxPlanId") %>' CommandName="DeleteItem" CommandArgument='<%# Eval("MailboxPlanId") %>'
meta:resourcekey="cmdDelete" OnClientClick="return confirm('Are you sure you want to delete selected mailbox plan?')"></asp:ImageButton> meta:resourcekey="cmdDelete" OnClientClick="return confirm('Are you sure you want to delete selected mailbox plan?')" ></asp:ImageButton>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
</Columns> </Columns>
@ -85,7 +91,7 @@
<td> <td>
</td> </td>
<td> <td>
<asp:TextBox ID="txtStatus" runat="server" CssClass="TextBox200" MaxLength="128" ReadOnly="true"></asp:TextBox> <asp:TextBox ID="txtStatus" runat="server" CssClass="TextBox400" MaxLength="128" ReadOnly="true"></asp:TextBox>
</td> </td>
</tr> </tr>
<tr> <tr>

View file

@ -102,9 +102,19 @@ namespace WebsitePanel.Portal.ExchangeServer
if (e.CommandName == "DeleteItem") if (e.CommandName == "DeleteItem")
{ {
int mailboxPlanId = Utils.ParseInt(e.CommandArgument.ToString(), 0); int mailboxPlanId = Utils.ParseInt(e.CommandArgument.ToString(), 0);
try try
{ {
ExchangeMailboxPlan plan = ES.Services.ExchangeServer.GetExchangeMailboxPlan(PanelRequest.ItemID, mailboxPlanId);
if (plan.MailboxPlanType > 0)
{
ShowErrorMessage("EXCHANGE_UNABLE_USE_SYSTEMPLAN");
BindMailboxPlans();
return;
}
int result = ES.Services.ExchangeServer.DeleteExchangeMailboxPlan(PanelRequest.ItemID, mailboxPlanId); int result = ES.Services.ExchangeServer.DeleteExchangeMailboxPlan(PanelRequest.ItemID, mailboxPlanId);
if (result < 0) if (result < 0)
@ -112,6 +122,8 @@ namespace WebsitePanel.Portal.ExchangeServer
messageBox.ShowResultMessage(result); messageBox.ShowResultMessage(result);
return; return;
} }
else
ShowSuccessMessage("REQUEST_COMPLETED_SUCCESFULLY");
} }
catch (Exception) catch (Exception)
@ -130,8 +142,20 @@ namespace WebsitePanel.Portal.ExchangeServer
try try
{ {
ExchangeMailboxPlan plan = ES.Services.ExchangeServer.GetExchangeMailboxPlan(PanelRequest.ItemID, mailboxPlanId);
if (plan.MailboxPlanType > 0)
{
ShowErrorMessage("EXCHANGE_UNABLE_USE_SYSTEMPLAN");
BindMailboxPlans();
return;
}
ES.Services.ExchangeServer.SetOrganizationDefaultExchangeMailboxPlan(PanelRequest.ItemID, mailboxPlanId); ES.Services.ExchangeServer.SetOrganizationDefaultExchangeMailboxPlan(PanelRequest.ItemID, mailboxPlanId);
ShowSuccessMessage("REQUEST_COMPLETED_SUCCESFULLY");
// rebind domains // rebind domains
BindMailboxPlans(); BindMailboxPlans();
} }
@ -167,6 +191,31 @@ namespace WebsitePanel.Portal.ExchangeServer
{ {
ShowErrorMessage("EXCHANGE_FAILED_TO_STAMP", ex); ShowErrorMessage("EXCHANGE_FAILED_TO_STAMP", ex);
} }
BindMailboxPlans();
} }
public string GetPlanType(int mailboxPlanType)
{
string imgName = string.Empty;
ExchangeMailboxPlanType planType = (ExchangeMailboxPlanType)mailboxPlanType;
switch (planType)
{
case ExchangeMailboxPlanType.Reseller:
imgName = "company24.png";
break;
case ExchangeMailboxPlanType.Administrator:
imgName = "company24.png";
break;
default:
imgName = "admin_16.png";
break;
}
return GetThemedImage("Exchange/" + imgName);
}
} }
} }

View file

@ -1,33 +1,4 @@
// Copyright (c) 2012, Outercurve Foundation. //------------------------------------------------------------------------------
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.
// //
@ -36,13 +7,11 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace WebsitePanel.Portal.ExchangeServer namespace WebsitePanel.Portal.ExchangeServer {
{
public partial class ExchangeMailboxPlans {
public partial class ExchangeMailboxPlans
{
/// <summary> /// <summary>
/// asyncTasks control. /// asyncTasks control.
/// </summary> /// </summary>
@ -51,7 +20,7 @@ namespace WebsitePanel.Portal.ExchangeServer
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks;
/// <summary> /// <summary>
/// breadcrumb control. /// breadcrumb control.
/// </summary> /// </summary>
@ -60,7 +29,7 @@ namespace WebsitePanel.Portal.ExchangeServer
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Breadcrumb breadcrumb; protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Breadcrumb breadcrumb;
/// <summary> /// <summary>
/// menu control. /// menu control.
/// </summary> /// </summary>
@ -69,7 +38,7 @@ namespace WebsitePanel.Portal.ExchangeServer
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Menu menu; protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Menu menu;
/// <summary> /// <summary>
/// Image1 control. /// Image1 control.
/// </summary> /// </summary>
@ -78,7 +47,7 @@ namespace WebsitePanel.Portal.ExchangeServer
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.Image Image1; protected global::System.Web.UI.WebControls.Image Image1;
/// <summary> /// <summary>
/// locTitle control. /// locTitle control.
/// </summary> /// </summary>
@ -87,7 +56,7 @@ namespace WebsitePanel.Portal.ExchangeServer
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.Localize locTitle; protected global::System.Web.UI.WebControls.Localize locTitle;
/// <summary> /// <summary>
/// messageBox control. /// messageBox control.
/// </summary> /// </summary>
@ -96,7 +65,7 @@ namespace WebsitePanel.Portal.ExchangeServer
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox;
/// <summary> /// <summary>
/// btnAddMailboxPlan control. /// btnAddMailboxPlan control.
/// </summary> /// </summary>
@ -105,7 +74,7 @@ namespace WebsitePanel.Portal.ExchangeServer
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.Button btnAddMailboxPlan; protected global::System.Web.UI.WebControls.Button btnAddMailboxPlan;
/// <summary> /// <summary>
/// gvMailboxPlans control. /// gvMailboxPlans control.
/// </summary> /// </summary>
@ -114,7 +83,7 @@ namespace WebsitePanel.Portal.ExchangeServer
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.GridView gvMailboxPlans; protected global::System.Web.UI.WebControls.GridView gvMailboxPlans;
/// <summary> /// <summary>
/// btnSetDefaultMailboxPlan control. /// btnSetDefaultMailboxPlan control.
/// </summary> /// </summary>
@ -123,7 +92,7 @@ namespace WebsitePanel.Portal.ExchangeServer
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.Button btnSetDefaultMailboxPlan; protected global::System.Web.UI.WebControls.Button btnSetDefaultMailboxPlan;
/// <summary> /// <summary>
/// secMainTools control. /// secMainTools control.
/// </summary> /// </summary>
@ -132,7 +101,7 @@ namespace WebsitePanel.Portal.ExchangeServer
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::WebsitePanel.Portal.CollapsiblePanel secMainTools; protected global::WebsitePanel.Portal.CollapsiblePanel secMainTools;
/// <summary> /// <summary>
/// ToolsPanel control. /// ToolsPanel control.
/// </summary> /// </summary>
@ -141,7 +110,7 @@ namespace WebsitePanel.Portal.ExchangeServer
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.Panel ToolsPanel; protected global::System.Web.UI.WebControls.Panel ToolsPanel;
/// <summary> /// <summary>
/// tblMaintenance control. /// tblMaintenance control.
/// </summary> /// </summary>
@ -150,7 +119,7 @@ namespace WebsitePanel.Portal.ExchangeServer
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlTable tblMaintenance; protected global::System.Web.UI.HtmlControls.HtmlTable tblMaintenance;
/// <summary> /// <summary>
/// lblSourcePlan control. /// lblSourcePlan control.
/// </summary> /// </summary>
@ -159,7 +128,7 @@ namespace WebsitePanel.Portal.ExchangeServer
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.Localize lblSourcePlan; protected global::System.Web.UI.WebControls.Localize lblSourcePlan;
/// <summary> /// <summary>
/// mailboxPlanSelectorSource control. /// mailboxPlanSelectorSource control.
/// </summary> /// </summary>
@ -168,7 +137,7 @@ namespace WebsitePanel.Portal.ExchangeServer
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.MailboxPlanSelector mailboxPlanSelectorSource; protected global::WebsitePanel.Portal.ExchangeServer.UserControls.MailboxPlanSelector mailboxPlanSelectorSource;
/// <summary> /// <summary>
/// lblTargetPlan control. /// lblTargetPlan control.
/// </summary> /// </summary>
@ -177,7 +146,7 @@ namespace WebsitePanel.Portal.ExchangeServer
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.Localize lblTargetPlan; protected global::System.Web.UI.WebControls.Localize lblTargetPlan;
/// <summary> /// <summary>
/// mailboxPlanSelectorTarget control. /// mailboxPlanSelectorTarget control.
/// </summary> /// </summary>
@ -186,7 +155,7 @@ namespace WebsitePanel.Portal.ExchangeServer
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.MailboxPlanSelector mailboxPlanSelectorTarget; protected global::WebsitePanel.Portal.ExchangeServer.UserControls.MailboxPlanSelector mailboxPlanSelectorTarget;
/// <summary> /// <summary>
/// txtStatus control. /// txtStatus control.
/// </summary> /// </summary>
@ -195,7 +164,7 @@ namespace WebsitePanel.Portal.ExchangeServer
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtStatus; protected global::System.Web.UI.WebControls.TextBox txtStatus;
/// <summary> /// <summary>
/// btnSave control. /// btnSave control.
/// </summary> /// </summary>
@ -204,7 +173,7 @@ namespace WebsitePanel.Portal.ExchangeServer
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.Button btnSave; protected global::System.Web.UI.WebControls.Button btnSave;
/// <summary> /// <summary>
/// FormComments control. /// FormComments control.
/// </summary> /// </summary>

View file

@ -112,16 +112,16 @@
<value>2.0</value> <value>2.0</value>
</resheader> </resheader>
<resheader name="reader"> <resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<data name="locKB.Text" xml:space="preserve"> <data name="locKB.Text" xml:space="preserve">
<value>KB</value> <value>KB</value>
</data> </data>
<data name="valRequireCorrectNumber.ErrorMessage" xml:space="preserve"> <data name="valRequireCorrectNumber.ErrorMessage" xml:space="preserve">
<value>Please enter correct number. The number should be positive. Empty value = "Unlimited".</value> <value>Please enter correct number. The number should be positive. Percentage should be between 0 and 100. Empty value = "Unlimited".</value>
</data> </data>
<data name="valRequireCorrectNumber.Text" xml:space="preserve"> <data name="valRequireCorrectNumber.Text" xml:space="preserve">
<value /> <value />

View file

@ -41,7 +41,15 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls
{ {
public partial class DaysBox : System.Web.UI.UserControl public partial class DaysBox : System.Web.UI.UserControl
{ {
public string ValidationGroup int emptyValue = -1;
public int EmptyValue
{
get { return emptyValue; }
set { emptyValue = value; }
}
public string ValidationGroup
{ {
get { return valRequireCorrectNumber.ValidationGroup; } get { return valRequireCorrectNumber.ValidationGroup; }
set { valRequireCorrectNumber.ValidationGroup = valRequireNumber.ValidationGroup = value; } set { valRequireCorrectNumber.ValidationGroup = valRequireNumber.ValidationGroup = value; }
@ -58,18 +66,25 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls
} }
} }
public bool RequireValidatorEnabled
{
get { return valRequireNumber.Enabled; }
set { valRequireNumber.Enabled = value; }
}
public int ValueDays public int ValueDays
{ {
get get
{ {
string val = txtValue.Text.Trim(); string val = txtValue.Text.Trim();
return Utils.ParseInt(val, 0); return val == "" ? emptyValue : Utils.ParseInt(val, 0);
} }
set set
{ {
txtValue.Text = value.ToString(); txtValue.Text = value == emptyValue ? "" : value.ToString();
} }
} }
protected void Page_Load(object sender, EventArgs e) protected void Page_Load(object sender, EventArgs e)
{ {

View file

@ -18,4 +18,4 @@
<asp:RequiredFieldValidator ID="valRequireNumber" runat="server" meta:resourcekey="valRequireNumber" Enabled="false" <asp:RequiredFieldValidator ID="valRequireNumber" runat="server" meta:resourcekey="valRequireNumber" Enabled="false"
ErrorMessage="Please enter value" ControlToValidate="txtValue" Display="None" SetFocusOnError="True"></asp:RequiredFieldValidator> ErrorMessage="Please enter value" ControlToValidate="txtValue" Display="None" SetFocusOnError="True"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="valRequireCorrectNumber" runat="server" meta:resourcekey="valRequireCorrectNumber" <asp:RegularExpressionValidator ID="valRequireCorrectNumber" runat="server" meta:resourcekey="valRequireCorrectNumber"
ErrorMessage="Enter correct number" ControlToValidate="txtValue" Display="None" ValidationExpression="[0-9]{0,15}" SetFocusOnError="True"></asp:RegularExpressionValidator> ErrorMessage="Enter correct number" ControlToValidate="txtValue" Display="None" SetFocusOnError="True"></asp:RegularExpressionValidator>

View file

@ -78,24 +78,38 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls
public bool DisplayUnitsKB public bool DisplayUnitsKB
{ {
get { return locKB.Visible; } get { return locKB.Visible; }
set { locKB.Visible = value; } set {
locKB.Visible = value;
}
} }
public bool DisplayUnitsMB public bool DisplayUnitsMB
{ {
get { return locMB.Visible; } get { return locMB.Visible; }
set { locMB.Visible = value; } set {
locMB.Visible = value;
}
} }
public bool DisplayUnitsPct public bool DisplayUnitsPct
{ {
get { return locPct.Visible; } get { return locPct.Visible; }
set { locPct.Visible = value; } set {
locPct.Visible = value;
}
} }
protected void Page_Load(object sender, EventArgs e) protected void Page_Load(object sender, EventArgs e)
{ {
if (locPct.Visible)
{
valRequireCorrectNumber.ValidationExpression = @"(^100)$|^([0-9]{1,2})$";
}
else
valRequireCorrectNumber.ValidationExpression = @"[0-9]{0,15}";
} }
} }
} }

View file

@ -15,19 +15,17 @@
<asp:ImageButton ID="cmdEdit" runat="server" SkinID="EditSmall" CommandName="EditItem" AlternateText="Edit record" CommandArgument='<%# Eval("MailboxPlanId") %>' ></asp:ImageButton> <asp:ImageButton ID="cmdEdit" runat="server" SkinID="EditSmall" CommandName="EditItem" AlternateText="Edit record" CommandArgument='<%# Eval("MailboxPlanId") %>' ></asp:ImageButton>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Image ID="img2" runat="server" Width="16px" Height="16px" ImageUrl='<%# GetPlanType((int)Eval("MailboxPlanType")) %>' ImageAlign="AbsMiddle" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="gvMailboxPlan"> <asp:TemplateField HeaderText="gvMailboxPlan">
<ItemStyle Width="70%"></ItemStyle> <ItemStyle Width="70%"></ItemStyle>
<ItemTemplate> <ItemTemplate>
<asp:Label id="lnkDisplayMailboxPlan" runat="server" EnableViewState="true" ><%# Eval("MailboxPlan")%></asp:Label> <asp:Label id="lnkDisplayMailboxPlan" runat="server" EnableViewState="true" ><%# Eval("MailboxPlan")%></asp:Label>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField HeaderText="gvMailboxPlanDefault">
<ItemTemplate>
<div style="text-align:center">
<input type="radio" name="DefaultMailboxPlan" value='<%# Eval("MailboxPlanId") %>' <%# IsChecked((bool)Eval("IsDefault")) %> />
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField> <asp:TemplateField>
<ItemTemplate> <ItemTemplate>
&nbsp;<asp:ImageButton id="imgDelMailboxPlan" runat="server" Text="Delete" SkinID="ExchangeDelete" &nbsp;<asp:ImageButton id="imgDelMailboxPlan" runat="server" Text="Delete" SkinID="ExchangeDelete"
@ -38,10 +36,6 @@
</Columns> </Columns>
</asp:GridView> </asp:GridView>
<br /> <br />
<div style="text-align: center">
<asp:Button ID="btnSetDefaultMailboxPlan" runat="server" meta:resourcekey="btnSetDefaultMailboxPlan"
Text="Set Default Mailboxplan" CssClass="Button1" OnClick="btnSetDefaultMailboxPlan_Click" />
</div>
<wsp:CollapsiblePanel id="secMailboxPlan" runat="server" <wsp:CollapsiblePanel id="secMailboxPlan" runat="server"
TargetControlID="MailboxPlan" meta:resourcekey="secMailboxPlan" Text="Mailboxplan"> TargetControlID="MailboxPlan" meta:resourcekey="secMailboxPlan" Text="Mailboxplan">
</wsp:CollapsiblePanel> </wsp:CollapsiblePanel>
@ -52,7 +46,8 @@
</td> </td>
<td> <td>
<asp:TextBox ID="txtMailboxPlan" runat="server" CssClass="TextBox200" ></asp:TextBox> <asp:TextBox ID="txtMailboxPlan" runat="server" CssClass="TextBox200"
ontextchanged="txtMailboxPlan_TextChanged" ></asp:TextBox>
<asp:RequiredFieldValidator ID="valRequireMailboxPlan" runat="server" meta:resourcekey="valRequireMailboxPlan" ControlToValidate="txtMailboxPlan" <asp:RequiredFieldValidator ID="valRequireMailboxPlan" runat="server" meta:resourcekey="valRequireMailboxPlan" ControlToValidate="txtMailboxPlan"
ErrorMessage="Enter mailbox plan name" ValidationGroup="CreateMailboxPlan" Display="Dynamic" Text="*" SetFocusOnError="True"></asp:RequiredFieldValidator> ErrorMessage="Enter mailbox plan name" ValidationGroup="CreateMailboxPlan" Display="Dynamic" Text="*" SetFocusOnError="True"></asp:RequiredFieldValidator>
</td> </td>
@ -117,25 +112,25 @@
<tr> <tr>
<td class="FormLabel200" align="right"><asp:Localize ID="locMailboxSize" runat="server" meta:resourcekey="locMailboxSize" Text="Mailbox size:"></asp:Localize></td> <td class="FormLabel200" align="right"><asp:Localize ID="locMailboxSize" runat="server" meta:resourcekey="locMailboxSize" Text="Mailbox size:"></asp:Localize></td>
<td> <td>
<wsp:SizeBox id="mailboxSize" runat="server" ValidationGroup="CreateMailboxPlan" DisplayUnitsKB="false" DisplayUnitsMB="true" DisplayUnitsPct="false" RequireValidatorEnabled="true"/> <wsp:SizeBox id="mailboxSize" runat="server" ValidationGroup="CreateMailboxPlan" DisplayUnitsKB="false" DisplayUnitsMB="true" DisplayUnitsPct="false" RequireValidatorEnabled="false"/>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="FormLabel200" align="right"><asp:Localize ID="locMaxRecipients" runat="server" meta:resourcekey="locMaxRecipients" Text="Maximum Recipients:"></asp:Localize></td> <td class="FormLabel200" align="right"><asp:Localize ID="locMaxRecipients" runat="server" meta:resourcekey="locMaxRecipients" Text="Maximum Recipients:"></asp:Localize></td>
<td> <td>
<wsp:SizeBox id="maxRecipients" runat="server" ValidationGroup="CreateMailboxPlan" DisplayUnitsKB="false" DisplayUnitsMB="false" DisplayUnitsPct="false" RequireValidatorEnabled="true"/> <wsp:SizeBox id="maxRecipients" runat="server" ValidationGroup="CreateMailboxPlan" DisplayUnitsKB="false" DisplayUnitsMB="false" DisplayUnitsPct="false" RequireValidatorEnabled="false"/>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="FormLabel200" align="right"><asp:Localize ID="locMaxSendMessageSizeKB" runat="server" meta:resourcekey="locMaxSendMessageSizeKB" Text="Maximum Send Message Size (Kb):"></asp:Localize></td> <td class="FormLabel200" align="right"><asp:Localize ID="locMaxSendMessageSizeKB" runat="server" meta:resourcekey="locMaxSendMessageSizeKB" Text="Maximum Send Message Size (Kb):"></asp:Localize></td>
<td> <td>
<wsp:SizeBox id="maxSendMessageSizeKB" runat="server" ValidationGroup="CreateMailboxPlan" DisplayUnitsKB="true" DisplayUnitsMB="false" DisplayUnitsPct="false" RequireValidatorEnabled="true"/> <wsp:SizeBox id="maxSendMessageSizeKB" runat="server" ValidationGroup="CreateMailboxPlan" DisplayUnitsKB="true" DisplayUnitsMB="false" DisplayUnitsPct="false" RequireValidatorEnabled="false"/>
</td> </td>
</tr> </tr>
<tr> <tr>
<td class="FormLabel200" align="right"><asp:Localize ID="locMaxReceiveMessageSizeKB" runat="server" meta:resourcekey="locMaxReceiveMessageSizeKB" Text="Maximum Receive Message Size (Kb):"></asp:Localize></td> <td class="FormLabel200" align="right"><asp:Localize ID="locMaxReceiveMessageSizeKB" runat="server" meta:resourcekey="locMaxReceiveMessageSizeKB" Text="Maximum Receive Message Size (Kb):"></asp:Localize></td>
<td> <td>
<wsp:SizeBox id="maxReceiveMessageSizeKB" runat="server" ValidationGroup="CreateMailboxPlan" DisplayUnitsKB="true" DisplayUnitsMB="false" DisplayUnitsPct="false" RequireValidatorEnabled="true"/> <wsp:SizeBox id="maxReceiveMessageSizeKB" runat="server" ValidationGroup="CreateMailboxPlan" DisplayUnitsKB="true" DisplayUnitsMB="false" DisplayUnitsPct="false" RequireValidatorEnabled="false"/>
</td> </td>
</tr> </tr>
@ -165,37 +160,61 @@
</asp:Panel> </asp:Panel>
<wsp:CollapsiblePanel id="secDeleteRetention" runat="server" <wsp:CollapsiblePanel id="secDeleteRetention" runat="server" TargetControlID="DeleteRetention" meta:resourcekey="secDeleteRetention" Text="Delete Item Retention">
TargetControlID="DeleteRetention" meta:resourcekey="secDeleteRetention" Text="Delete Item Retention">
</wsp:CollapsiblePanel> </wsp:CollapsiblePanel>
<asp:Panel ID="DeleteRetention" runat="server" Height="0" style="overflow:hidden;"> <asp:Panel ID="DeleteRetention" runat="server" Height="0" style="overflow:hidden;">
<table> <table>
<tr> <tr>
<td class="FormLabel200" align="right"><asp:Localize ID="locKeepDeletedItems" runat="server" meta:resourcekey="locKeepDeletedItems" Text="Keep deleted items for:"></asp:Localize></td> <td class="FormLabel200" align="right"><asp:Localize ID="locKeepDeletedItems" runat="server" meta:resourcekey="locKeepDeletedItems" Text="Keep deleted items for:"></asp:Localize></td>
<td> <td>
<wsp:DaysBox id="daysKeepDeletedItems" runat="server" ValidationGroup="CreateMailboxPlan" /> <wsp:DaysBox id="daysKeepDeletedItems" runat="server" ValidationGroup="CreateMailboxPlan" RequireValidatorEnabled="true"/>
</td> </td>
</tr> </tr>
</table> </table>
<br /> <br />
</asp:Panel> </asp:Panel>
<br /> <table>
<tr>
<td>
<div class="FormButtonsBarClean">
<asp:Button ID="btnAddMailboxPlan" runat="server" meta:resourcekey="btnAddMailboxPlan"
Text="Add New Mailboxplan" CssClass="Button1" OnClick="btnAddMailboxPlan_Click" />
</div>
</td>
<td>
<div class="FormButtonsBarClean">
<asp:Button ID="btnUpdateMailboxPlan" runat="server" meta:resourcekey="btnUpdateMailboxPlan"
Text="Update Mailboxplan" CssClass="Button1" OnClick="btnUpdateMailboxPlan_Click" />
</td>
</tr>
</table>
<div class="FormButtonsBarClean"> <br />
<asp:Button ID="btnAddMailboxPlan" runat="server" meta:resourcekey="btnAddMailboxPlan"
Text="Add New Mailboxplan" CssClass="Button1" OnClick="btnAddMailboxPlan_Click" />
</div>
<div class="FormButtonsBarClean"> <wsp:CollapsiblePanel id="secTools" runat="server" TargetControlID="Tools" meta:resourcekey="secTools" Text="Tools">
<asp:Button ID="btnAddMailboxPlanToOrganizations" runat="server" meta:resourcekey="btnAddMailboxPlanToOrganizations" </wsp:CollapsiblePanel>
Text="Add Mailbox Plans Template to All Organizations" CssClass="Button1" OnClick="btnAddMailboxPlanToOrganizations_Click" OnClientClick="if (confirm('Plans with an existing name will not be added. \nAre you sure you want to add the plans template to all tenants ?')) ShowProgressDialog('Adding mailbox plans, this might take a while ...'); else return false;"/> <asp:Panel ID="Tools" runat="server" Height="0" style="overflow:hidden;">
</div> <table>
<tr>
<td>
<asp:Button ID="btnStamp" runat="server" meta:resourcekey="btnStamp"
Text="Restamp all mailboxes" CssClass="Button1" OnClick="btnStampClick" OnClientClick="if (confirm('Restamp mailboxes with these plans. \nAre you sure you want to restamp the mailbox plans ?')) ShowProgressDialog('Stamping mailboxes, this might take a while ...'); else return false;"/>
</td>
<td>
<asp:TextBox ID="txtStatus" runat="server" CssClass="TextBox400" MaxLength="128" ReadOnly="true"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:Button ID="btnMatchMailboxPlanToUser" runat="server" meta:resourcekey="btnMatchMailboxPlanToUser"
Text="Match Plan to User" CssClass="Button1"
OnClientClick="if (confirm('Mail enabled users with no mailbox plan assigned will get a matching mailbox plan applied.\nMatching takes place on mailbox size and the MAPI properties.\n\nAre you sure you want to continue with this ?')) ShowProgressDialog('Applying mailbox plans, this might take a while ...'); else return false;"
onclick="btnMatchMailboxPlanToUser_Click" />
</td>
</tr>
</table>
<br />
</asp:Panel>
<div class="FormButtonsBarClean">
<asp:Button ID="btnMatchMailboxPlanToUser" runat="server" meta:resourcekey="btnMatchMailboxPlanToUser"
Text="Match Plan to User" CssClass="Button1"
OnClientClick="if (confirm('Mail enabled users with no mailbox plan assigned will get a matching mailbox plan applied.\nMatching takes place on mailbox size and the MAPI properties.\n\nAre you sure you want to continue with this ?')) ShowProgressDialog('Applying mailbox plans, this might take a while ...'); else return false;"
onclick="btnMatchMailboxPlanToUser_Click" />
</div>

View file

@ -53,63 +53,56 @@ namespace WebsitePanel.Portal
public partial class SettingsExchangeMailboxPlansPolicy : WebsitePanelControlBase, IUserSettingsEditorControl public partial class SettingsExchangeMailboxPlansPolicy : WebsitePanelControlBase, IUserSettingsEditorControl
{ {
internal static List<ExchangeMailboxPlan> list;
public void BindSettings(UserSettings settings) public void BindSettings(UserSettings settings)
{ {
BindMailboxPlans();
if (list == null) txtStatus.Visible = false;
list = new List<ExchangeMailboxPlan>();
if (!string.IsNullOrEmpty(settings[UserSettings.DEFAULT_MAILBOXPLANS]))
{
XmlSerializer serializer = new XmlSerializer(list.GetType());
StringReader reader = new StringReader(settings[UserSettings.DEFAULT_MAILBOXPLANS]);
list = (List<ExchangeMailboxPlan>)serializer.Deserialize(reader);
}
gvMailboxPlans.DataSource = list;
gvMailboxPlans.DataBind();
if (gvMailboxPlans.Rows.Count <= 1)
{
btnSetDefaultMailboxPlan.Enabled = false;
}
else
btnSetDefaultMailboxPlan.Enabled = true;
} }
private void BindMailboxPlans()
public string IsChecked(bool val)
{ {
return val ? "checked" : ""; Providers.HostedSolution.Organization[] orgs = null;
if (PanelSecurity.SelectedUserId != 1)
{
PackageInfo[] Packages = ES.Services.Packages.GetPackages(PanelSecurity.SelectedUserId);
if ((Packages != null) & (Packages.GetLength(0) > 0))
{
orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(Packages[0].PackageId, false);
}
}
else
{
orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(1, false);
}
if ((orgs != null) & (orgs.GetLength(0) > 0))
{
ExchangeMailboxPlan[] list = ES.Services.ExchangeServer.GetExchangeMailboxPlans(orgs[0].Id);
gvMailboxPlans.DataSource = list;
gvMailboxPlans.DataBind();
}
btnUpdateMailboxPlan.Enabled = (string.IsNullOrEmpty(txtMailboxPlan.Text)) ? false : true;
} }
public void btnAddMailboxPlan_Click(object sender, EventArgs e) public void btnAddMailboxPlan_Click(object sender, EventArgs e)
{ {
int count = 0; Page.Validate("CreateMailboxPlan");
if (list != null)
{
foreach (ExchangeMailboxPlan p in list)
{
p.MailboxPlanId = count;
count++;
}
}
if (!Page.IsValid)
ExchangeMailboxPlan plan = new ExchangeMailboxPlan(); return;
Providers.HostedSolution.ExchangeMailboxPlan plan = new Providers.HostedSolution.ExchangeMailboxPlan();
plan.MailboxPlan = txtMailboxPlan.Text; plan.MailboxPlan = txtMailboxPlan.Text;
plan.MailboxSizeMB = mailboxSize.ValueKB; plan.MailboxSizeMB = mailboxSize.ValueKB;
if ((plan.MailboxSizeMB == 0)) plan.MailboxSizeMB = 1;
plan.MailboxPlanId = count;
plan.IsDefault = false; plan.IsDefault = false;
plan.MaxRecipients = maxRecipients.ValueKB; plan.MaxRecipients = maxRecipients.ValueKB;
plan.MaxSendMessageSizeKB = maxSendMessageSizeKB.ValueKB; plan.MaxSendMessageSizeKB = maxSendMessageSizeKB.ValueKB;
@ -128,170 +121,277 @@ namespace WebsitePanel.Portal
plan.KeepDeletedItemsDays = daysKeepDeletedItems.ValueDays; plan.KeepDeletedItemsDays = daysKeepDeletedItems.ValueDays;
plan.HideFromAddressBook = chkHideFromAddressBook.Checked; plan.HideFromAddressBook = chkHideFromAddressBook.Checked;
if (list == null) if (PanelSecurity.SelectedUser.Role == UserRole.Administrator)
list = new List<ExchangeMailboxPlan>(); plan.MailboxPlanType = (int)ExchangeMailboxPlanType.Administrator;
else
if (PanelSecurity.SelectedUser.Role == UserRole.Reseller)
plan.MailboxPlanType = (int)ExchangeMailboxPlanType.Reseller;
list.Add(plan); Providers.HostedSolution.Organization[] orgs = null;
gvMailboxPlans.DataSource = list;
gvMailboxPlans.DataBind();
if (gvMailboxPlans.Rows.Count <= 1) if (PanelSecurity.SelectedUserId != 1)
{ {
btnSetDefaultMailboxPlan.Enabled = false; PackageInfo[] Packages = ES.Services.Packages.GetPackages(PanelSecurity.SelectedUserId);
if ((Packages != null) & (Packages.GetLength(0) > 0))
{
orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(Packages[0].PackageId, false);
}
} }
else else
btnSetDefaultMailboxPlan.Enabled = true; {
orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(1, false);
}
if ((orgs != null) & (orgs.GetLength(0) > 0))
{
int result = ES.Services.ExchangeServer.AddExchangeMailboxPlan(orgs[0].Id, plan);
if (result < 0)
{
messageBox.ShowResultMessage(result);
return;
}
}
BindMailboxPlans();
} }
protected void gvMailboxPlan_RowCommand(object sender, GridViewCommandEventArgs e) protected void gvMailboxPlan_RowCommand(object sender, GridViewCommandEventArgs e)
{ {
int mailboxPlanId = Utils.ParseInt(e.CommandArgument.ToString(), 0); int mailboxPlanId = Utils.ParseInt(e.CommandArgument.ToString(), 0);
Providers.HostedSolution.Organization[] orgs = null;
Providers.HostedSolution.ExchangeMailboxPlan plan;
switch (e.CommandName) switch (e.CommandName)
{ {
case "DeleteItem": case "DeleteItem":
try
foreach (ExchangeMailboxPlan p in list)
{ {
if (p.MailboxPlanId == mailboxPlanId)
if (PanelSecurity.SelectedUserId != 1)
{ {
list.Remove(p); PackageInfo[] Packages = ES.Services.Packages.GetPackages(PanelSecurity.SelectedUserId);
break;
if ((Packages != null) & (Packages.GetLength(0) > 0))
{
orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(Packages[0].PackageId, false);
}
} }
else
{
orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(1, false);
}
plan = ES.Services.ExchangeServer.GetExchangeMailboxPlan(orgs[0].Id, mailboxPlanId);
if (plan.ItemId != orgs[0].Id)
{
messageBox.ShowErrorMessage("EXCHANGE_UNABLE_USE_SYSTEMPLAN");
BindMailboxPlans();
return;
}
int result = ES.Services.ExchangeServer.DeleteExchangeMailboxPlan(orgs[0].Id, mailboxPlanId);
if (result < 0)
{
messageBox.ShowResultMessage(result);
return;
}
ViewState["MailboxPlanID"] = null;
txtMailboxPlan.Text = string.Empty;
mailboxSize.ValueKB = -1;
maxRecipients.ValueKB = -1;
maxSendMessageSizeKB.ValueKB = -1;
maxReceiveMessageSizeKB.ValueKB = 01;
chkPOP3.Checked = false;
chkIMAP.Checked = false;
chkOWA.Checked = false;
chkMAPI.Checked = false;
chkActiveSync.Checked = false;
sizeIssueWarning.ValueKB = -1;
sizeProhibitSend.ValueKB = -1;
sizeProhibitSendReceive.ValueKB = -1;
daysKeepDeletedItems.ValueDays = -1;
chkHideFromAddressBook.Checked = false;
btnUpdateMailboxPlan.Enabled = (string.IsNullOrEmpty(txtMailboxPlan.Text)) ? false : true;
} }
catch (Exception)
gvMailboxPlans.DataSource = list;
gvMailboxPlans.DataBind();
if (gvMailboxPlans.Rows.Count <= 1)
{ {
btnSetDefaultMailboxPlan.Enabled = false; messageBox.ShowErrorMessage("EXCHANGE_DELETE_MAILBOXPLAN");
} }
else
btnSetDefaultMailboxPlan.Enabled = true; BindMailboxPlans();
break; break;
case "EditItem": case "EditItem":
foreach (ExchangeMailboxPlan p in list) ViewState["MailboxPlanID"] = mailboxPlanId;
{
if (p.MailboxPlanId == mailboxPlanId) if (PanelSecurity.SelectedUserId != 1)
{ {
PackageInfo[] Packages = ES.Services.Packages.GetPackages(PanelSecurity.SelectedUserId);
txtMailboxPlan.Text = p.MailboxPlan; if ((Packages != null) & (Packages.GetLength(0) > 0))
mailboxSize.ValueKB = p.MailboxSizeMB; {
maxRecipients.ValueKB = p.MaxRecipients; orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(Packages[0].PackageId, false);
maxSendMessageSizeKB.ValueKB = p.MaxSendMessageSizeKB; }
maxReceiveMessageSizeKB.ValueKB = p.MaxReceiveMessageSizeKB;
chkPOP3.Checked = p.EnablePOP;
chkIMAP.Checked = p.EnableIMAP;
chkOWA.Checked = p.EnableOWA;
chkMAPI.Checked = p.EnableMAPI;
chkActiveSync.Checked = p.EnableActiveSync;
sizeIssueWarning.ValueKB = p.IssueWarningPct;
sizeProhibitSend.ValueKB = p.ProhibitSendPct;
sizeProhibitSendReceive.ValueKB = p.ProhibitSendReceivePct;
daysKeepDeletedItems.ValueDays = p.KeepDeletedItemsDays;
chkHideFromAddressBook.Checked = p.HideFromAddressBook;
break;
} }
} else
{
orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(1, false);
}
plan = ES.Services.ExchangeServer.GetExchangeMailboxPlan(orgs[0].Id, mailboxPlanId);
txtMailboxPlan.Text = plan.MailboxPlan;
if (plan.MailboxSizeMB != -1)
mailboxSize.ValueKB = plan.MailboxSizeMB;
if (plan.MaxRecipients != -1)
maxRecipients.ValueKB = plan.MaxRecipients;
if (plan.MaxSendMessageSizeKB != -1)
maxSendMessageSizeKB.ValueKB = plan.MaxSendMessageSizeKB;
if (plan.MaxReceiveMessageSizeKB != -1)
maxReceiveMessageSizeKB.ValueKB = plan.MaxReceiveMessageSizeKB;
chkPOP3.Checked = plan.EnablePOP;
chkIMAP.Checked = plan.EnableIMAP;
chkOWA.Checked = plan.EnableOWA;
chkMAPI.Checked = plan.EnableMAPI;
chkActiveSync.Checked = plan.EnableActiveSync;
sizeIssueWarning.ValueKB = plan.IssueWarningPct;
sizeProhibitSend.ValueKB = plan.ProhibitSendPct;
sizeProhibitSendReceive.ValueKB = plan.ProhibitSendReceivePct;
if (plan.KeepDeletedItemsDays != -1)
daysKeepDeletedItems.ValueDays = plan.KeepDeletedItemsDays;
chkHideFromAddressBook.Checked = plan.HideFromAddressBook;
btnUpdateMailboxPlan.Enabled = (string.IsNullOrEmpty(txtMailboxPlan.Text)) ? false : true;
break; break;
} }
} }
protected void btnSetDefaultMailboxPlan_Click(object sender, EventArgs e)
public string GetPlanType(int mailboxPlanType)
{ {
// get domain string imgName = string.Empty;
int mailboxPlanId = Utils.ParseInt(Request.Form["DefaultMailboxPlan"], 0);
ExchangeMailboxPlanType planType = (ExchangeMailboxPlanType)mailboxPlanType;
switch (planType)
foreach (ExchangeMailboxPlan p in list)
{ {
p.IsDefault = false; case ExchangeMailboxPlanType.Reseller:
} imgName = "company24.png";
break;
foreach (ExchangeMailboxPlan p in list) case ExchangeMailboxPlanType.Administrator:
{ imgName = "company24.png";
if (p.MailboxPlanId == mailboxPlanId) break;
{ default:
p.IsDefault = true; imgName = "admin_16.png";
break; break;
}
} }
gvMailboxPlans.DataSource = list; return GetThemedImage("Exchange/" + imgName);
gvMailboxPlans.DataBind();
} }
public void SaveSettings(UserSettings settings) public void SaveSettings(UserSettings settings)
{ {
XmlSerializer serializer = new XmlSerializer(list.GetType()); settings["ExchangeMailboxPlansPolicy"] = "";
StringWriter writer = new StringWriter();
serializer.Serialize(writer, list);
settings[UserSettings.DEFAULT_MAILBOXPLANS] = writer.ToString();
} }
protected void btnAddMailboxPlanToOrganizations_Click(object sender, EventArgs e) protected void btnUpdateMailboxPlan_Click(object sender, EventArgs e)
{ {
AddMailboxPlanToOrganizations("ServerAdmin");
}
private void AddMailboxPlanToOrganizations(string serverAdmin) if (ViewState["MailboxPlanID"] == null)
{ return;
UserInfo ServerAdminInfo = ES.Services.Users.GetUserByUsername(serverAdmin);
if (ServerAdminInfo == null) return; int mailboxPlanId = (int)ViewState["MailboxPlanID"];
Providers.HostedSolution.Organization[] orgs = null;
Providers.HostedSolution.ExchangeMailboxPlan plan;
UserInfo[] UsersInfo = ES.Services.Users.GetUsers(ServerAdminInfo.UserId, true);
try if (PanelSecurity.SelectedUserId != 1)
{ {
foreach (UserInfo ui in UsersInfo) PackageInfo[] Packages = ES.Services.Packages.GetPackages(PanelSecurity.SelectedUserId);
if ((Packages != null) & (Packages.GetLength(0) > 0))
{ {
PackageInfo[] Packages = ES.Services.Packages.GetPackages(ui.UserId); orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(Packages[0].PackageId, false);
if ((Packages != null) & (Packages.GetLength(0) > 0))
{
foreach (PackageInfo Package in Packages)
{
Providers.HostedSolution.Organization[] orgs = null;
orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(Package.PackageId, false);
if ((orgs != null) & (orgs.GetLength(0) > 0))
{
foreach (Organization org in orgs)
{
if (!string.IsNullOrEmpty(org.GlobalAddressList))
{
ExchangeMailboxPlan[] plans = ES.Services.ExchangeServer.GetExchangeMailboxPlans(org.Id);
foreach (ExchangeMailboxPlan p in list)
{
if (!PlanExists(p, plans)) ES.Services.ExchangeServer.AddExchangeMailboxPlan(org.Id, p);
}
}
}
}
}
}
} }
messageBox.ShowSuccessMessage("EXCHANGE_APPLYPLANTEMPLATE");
} }
catch (Exception ex) else
{ {
messageBox.ShowErrorMessage("EXCHANGE_APPLYPLANTEMPLATE", ex); orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(1, false);
} }
plan = ES.Services.ExchangeServer.GetExchangeMailboxPlan(orgs[0].Id, mailboxPlanId);
if (plan.ItemId != orgs[0].Id)
{
messageBox.ShowErrorMessage("EXCHANGE_UNABLE_USE_SYSTEMPLAN");
BindMailboxPlans();
return;
}
plan = new Providers.HostedSolution.ExchangeMailboxPlan();
plan.MailboxPlanId = (int)ViewState["MailboxPlanID"];
plan.MailboxPlan = txtMailboxPlan.Text;
plan.MailboxSizeMB = mailboxSize.ValueKB;
plan.IsDefault = false;
plan.MaxRecipients = maxRecipients.ValueKB;
plan.MaxSendMessageSizeKB = maxSendMessageSizeKB.ValueKB;
plan.MaxReceiveMessageSizeKB = maxReceiveMessageSizeKB.ValueKB;
plan.EnablePOP = chkPOP3.Checked;
plan.EnableIMAP = chkIMAP.Checked;
plan.EnableOWA = chkOWA.Checked;
plan.EnableMAPI = chkMAPI.Checked;
plan.EnableActiveSync = chkActiveSync.Checked;
plan.IssueWarningPct = sizeIssueWarning.ValueKB;
if ((plan.IssueWarningPct == 0)) plan.IssueWarningPct = 100;
plan.ProhibitSendPct = sizeProhibitSend.ValueKB;
if ((plan.ProhibitSendPct == 0)) plan.ProhibitSendPct = 100;
plan.ProhibitSendReceivePct = sizeProhibitSendReceive.ValueKB;
if ((plan.ProhibitSendReceivePct == 0)) plan.ProhibitSendReceivePct = 100;
plan.KeepDeletedItemsDays = daysKeepDeletedItems.ValueDays;
plan.HideFromAddressBook = chkHideFromAddressBook.Checked;
if (PanelSecurity.SelectedUser.Role == UserRole.Administrator)
plan.MailboxPlanType = (int)ExchangeMailboxPlanType.Administrator;
else
if (PanelSecurity.SelectedUser.Role == UserRole.Reseller)
plan.MailboxPlanType = (int)ExchangeMailboxPlanType.Reseller;
if ((orgs != null) & (orgs.GetLength(0) > 0))
{
int result = ES.Services.ExchangeServer.UpdateExchangeMailboxPlan(orgs[0].Id, plan);
if (result < 0)
{
messageBox.ShowErrorMessage("EXCHANGE_UPDATEPLANS");
}
else
{
messageBox.ShowSuccessMessage("EXCHANGE_UPDATEPLANS");
}
}
BindMailboxPlans();
} }
private bool PlanExists(ExchangeMailboxPlan plan, ExchangeMailboxPlan[] plans) private bool PlanExists(ExchangeMailboxPlan plan, ExchangeMailboxPlan[] plans)
{ {
bool result = false; bool result = false;
@ -388,6 +488,13 @@ namespace WebsitePanel.Portal
ExchangeMailboxPlan p3 = null; ExchangeMailboxPlan p3 = null;
foreach (ExchangeMailboxPlan p2 in pl) foreach (ExchangeMailboxPlan p2 in pl)
{ {
if ((p2.MailboxSizeMB == -1) & (mailbox.ProhibitSendReceiveKB == -1))
{
p3 = p2;
break;
}
if (p2.MailboxSizeMB >= (mailbox.ProhibitSendReceiveKB / 1024)) if (p2.MailboxSizeMB >= (mailbox.ProhibitSendReceiveKB / 1024))
{ {
if (p3 == null) if (p3 == null)
@ -403,6 +510,12 @@ namespace WebsitePanel.Portal
{ {
foreach (ExchangeMailboxPlan p in plans) foreach (ExchangeMailboxPlan p in plans)
{ {
if ((p.MailboxSizeMB == -1) & (mailbox.ProhibitSendReceiveKB == -1))
{
p3 = p;
break;
}
if (p.MailboxSizeMB >= (mailbox.ProhibitSendReceiveKB / 1024)) if (p.MailboxSizeMB >= (mailbox.ProhibitSendReceiveKB / 1024))
{ {
if (p3 == null) if (p3 == null)
@ -421,5 +534,66 @@ namespace WebsitePanel.Portal
} }
} }
protected void txtMailboxPlan_TextChanged(object sender, EventArgs e)
{
btnUpdateMailboxPlan.Enabled = (string.IsNullOrEmpty(txtMailboxPlan.Text)) ? false : true;
}
protected void btnStampClick(object sender, EventArgs e)
{
txtStatus.Visible = true;
try
{
Providers.HostedSolution.Organization[] orgs = null;
if (PanelSecurity.SelectedUserId != 1)
{
PackageInfo[] Packages = ES.Services.Packages.GetPackages(PanelSecurity.SelectedUserId);
if ((Packages != null) & (Packages.GetLength(0) > 0))
{
orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(Packages[0].PackageId, false);
}
}
else
{
orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(1, false);
}
if ((orgs != null) & (orgs.GetLength(0) > 0))
{
ExchangeMailboxPlan[] list = ES.Services.ExchangeServer.GetExchangeMailboxPlans(orgs[0].Id);
foreach (ExchangeMailboxPlan p in list)
{
ExchangeAccount[] Accounts = ES.Services.ExchangeServer.GetExchangeAccountByMailboxPlanId(0, p.MailboxPlanId);
foreach (ExchangeAccount a in Accounts)
{
txtStatus.Text = "Completed";
int result = ES.Services.ExchangeServer.SetExchangeMailboxPlan(a.ItemId, a.AccountId, p.MailboxPlanId);
if (result < 0)
{
BindMailboxPlans();
txtStatus.Text = "Error: " + a.AccountName;
messageBox.ShowErrorMessage("EXCHANGE_STAMPMAILBOXES");
return;
}
}
}
}
messageBox.ShowSuccessMessage("EXCHANGE_STAMPMAILBOXES");
}
catch (Exception ex)
{
messageBox.ShowErrorMessage("EXCHANGE_STAMPMAILBOXES",ex);
}
BindMailboxPlans();
}
} }
} }

View file

@ -39,15 +39,6 @@ namespace WebsitePanel.Portal {
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.GridView gvMailboxPlans; protected global::System.Web.UI.WebControls.GridView gvMailboxPlans;
/// <summary>
/// btnSetDefaultMailboxPlan 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.Button btnSetDefaultMailboxPlan;
/// <summary> /// <summary>
/// secMailboxPlan control. /// secMailboxPlan control.
/// </summary> /// </summary>
@ -373,13 +364,49 @@ namespace WebsitePanel.Portal {
protected global::System.Web.UI.WebControls.Button btnAddMailboxPlan; protected global::System.Web.UI.WebControls.Button btnAddMailboxPlan;
/// <summary> /// <summary>
/// btnAddMailboxPlanToOrganizations control. /// btnUpdateMailboxPlan control.
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// Auto-generated field. /// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.Button btnAddMailboxPlanToOrganizations; protected global::System.Web.UI.WebControls.Button btnUpdateMailboxPlan;
/// <summary>
/// secTools control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.CollapsiblePanel secTools;
/// <summary>
/// Tools 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 Tools;
/// <summary>
/// btnStamp 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.Button btnStamp;
/// <summary>
/// txtStatus 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.TextBox txtStatus;
/// <summary> /// <summary>
/// btnMatchMailboxPlanToUser control. /// btnMatchMailboxPlanToUser control.

View file

@ -11,7 +11,7 @@
</li> </li>
<li> <li>
<asp:HyperLink ID="lnkExchangeMailboxPlansPolicy" runat="server" meta:resourcekey="lnkExchangeMailboxPlansPolicy" <asp:HyperLink ID="lnkExchangeMailboxPlansPolicy" runat="server" meta:resourcekey="lnkExchangeMailboxPlansPolicy"
Text="Exchange Mailboxplan Policy" NavigateUrl='<%# GetSettingsLink("ExchangeMailboxPlansPolicy", "SettingsExchangeMailboxPlansPolicy") %>'></asp:HyperLink> Text="Global Exchange Mailbox Plans" NavigateUrl='<%# GetSettingsLink("ExchangeMailboxPlansPolicy", "SettingsExchangeMailboxPlansPolicy") %>'></asp:HyperLink>
</li> </li>
<li> <li>

View file

@ -1,31 +1,3 @@
// Copyright (c) 2012, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.

View file

@ -26,13 +26,13 @@ REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\CRMProxy.cs
REM %WSDL% %SERVER_URL%/esDatabaseServers.asmx /out:.\WebsitePanel.EnterpriseServer.Client\DatabaseServersProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient REM %WSDL% %SERVER_URL%/esDatabaseServers.asmx /out:.\WebsitePanel.EnterpriseServer.Client\DatabaseServersProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient
REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\DatabaseServersProxy.cs REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\DatabaseServersProxy.cs
REM %WSDL% %SERVER_URL%/ecServiceHandler.asmx /out:.\WebsitePanel.EnterpriseServer.Client\ecServiceHandlerProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient REM %WSDL% %SERVER_URL%/ecServiceHandler.asmx /out:.\WebsitePanel.EnterpriseServer.Client\ecServiceHandlerProxy.cs /namespace:WebsitePanel.Ecommerce.EnterpriseServer /type:webClient
REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\ecServiceHandlerProxy.cs REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\ecServiceHandlerProxy.cs
REM %WSDL% %SERVER_URL%/ecStorefront.asmx /out:.\WebsitePanel.EnterpriseServer.Client\ecStorefrontProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient REM %WSDL% %SERVER_URL%/ecStorefront.asmx /out:.\WebsitePanel.EnterpriseServer.Client\ecStorefrontProxy.cs /namespace:WebsitePanel.Ecommerce.EnterpriseServer /type:webClient
REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\ecStorefrontProxy.cs REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\ecStorefrontProxy.cs
REM %WSDL% %SERVER_URL%/ecStorehouse.asmx /out:.\WebsitePanel.EnterpriseServer.Client\ecStorehouseProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient REM %WSDL% %SERVER_URL%/ecStorehouse.asmx /out:.\WebsitePanel.EnterpriseServer.Client\ecStorehouseProxy.cs /namespace:WebsitePanel.Ecommerce.EnterpriseServer /type:webClient
REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\ecStorehouseProxy.cs REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\ecStorehouseProxy.cs
%WSDL% %SERVER_URL%/esExchangeServer.asmx /out:.\WebsitePanel.EnterpriseServer.Client\ExchangeServerProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient %WSDL% %SERVER_URL%/esExchangeServer.asmx /out:.\WebsitePanel.EnterpriseServer.Client\ExchangeServerProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient