wsp-10106: Implement Exchange Tenant Disclaimer.

This commit is contained in:
dev_amdtel 2013-06-25 22:09:35 +04:00
parent eee5d732fb
commit 0ec87fc5f4
28 changed files with 11296 additions and 7215 deletions

View file

@ -454,3 +454,182 @@ GO
-- add Application Pools Restart Quota
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID], [HideQuota]) VALUES (411, 2, 13, N'Web.AppPoolsRestart', N'Application Pools Restart', 1, 0, NULL, NULL)
GO
-- Disclaimers
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ExchangeDisclaimers](
[ExchangeDisclaimerId] [int] IDENTITY(1,1) NOT NULL,
[ItemID] [int] NOT NULL,
[DisclaimerName] [nvarchar](300) NOT NULL,
[DisclaimerText] [nvarchar](1024),
CONSTRAINT [PK_ExchangeDisclaimers] PRIMARY KEY CLUSTERED
(
[ExchangeDisclaimerId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON)
)
IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'GetExchangeDisclaimers')
BEGIN
EXEC sp_executesql N'CREATE PROCEDURE [dbo].[GetExchangeDisclaimers]
(
@ItemID int
)
AS
SELECT
ExchangeDisclaimerId,
ItemID,
DisclaimerName,
DisclaimerText
FROM
ExchangeDisclaimers
WHERE
ItemID = @ItemID
ORDER BY DisclaimerName
RETURN'
END
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'DeleteExchangeDisclaimer')
BEGIN
EXEC sp_executesql N'CREATE PROCEDURE [dbo].[DeleteExchangeDisclaimer]
(
@ExchangeDisclaimerId int
)
AS
DELETE FROM ExchangeDisclaimers
WHERE ExchangeDisclaimerId = @ExchangeDisclaimerId
RETURN'
END
GO
--
IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'UpdateExchangeDisclaimer')
BEGIN
EXEC sp_executesql N' CREATE PROCEDURE [dbo].[UpdateExchangeDisclaimer]
(
@ExchangeDisclaimerId int,
@DisclaimerName nvarchar(300),
@DisclaimerText nvarchar(1024)
)
AS
UPDATE ExchangeDisclaimers SET
DisclaimerName = @DisclaimerName,
DisclaimerText = @DisclaimerText
WHERE ExchangeDisclaimerId = @ExchangeDisclaimerId
RETURN'
END
GO
--
IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'AddExchangeDisclaimer')
BEGIN
EXEC sp_executesql N'CREATE PROCEDURE [dbo].[AddExchangeDisclaimer]
(
@ExchangeDisclaimerId int OUTPUT,
@ItemID int,
@DisclaimerName nvarchar(300),
@DisclaimerText nvarchar(1024)
)
AS
INSERT INTO ExchangeDisclaimers
(
ItemID,
DisclaimerName,
DisclaimerText
)
VALUES
(
@ItemID,
@DisclaimerName,
@DisclaimerText
)
SET @ExchangeDisclaimerId = SCOPE_IDENTITY()
RETURN'
END
GO
--
IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'GetExchangeDisclaimer')
BEGIN
EXEC sp_executesql N'CREATE PROCEDURE [dbo].[GetExchangeDisclaimer]
(
@ExchangeDisclaimerId int
)
AS
SELECT
ExchangeDisclaimerId,
ItemID,
DisclaimerName,
DisclaimerText
FROM
ExchangeDisclaimers
WHERE
ExchangeDisclaimerId = @ExchangeDisclaimerId
RETURN'
END
GO
BEGIN
ALTER TABLE [dbo].[ExchangeAccounts] ADD
[ExchangeDisclaimerId] [int] NULL
END
Go
IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'SetExchangeAccountDisclaimerId')
BEGIN
EXEC sp_executesql N' CREATE PROCEDURE [dbo].[SetExchangeAccountDisclaimerId]
(
@AccountID int,
@ExchangeDisclaimerId int
)
AS
UPDATE ExchangeAccounts SET
ExchangeDisclaimerId = @ExchangeDisclaimerId
WHERE AccountID = @AccountID
RETURN'
END
GO
IF NOT EXISTS (SELECT * FROM sys.objects WHERE type_desc = N'SQL_STORED_PROCEDURE' AND name = N'GetExchangeAccountDisclaimerId')
BEGIN
EXEC sp_executesql N'CREATE PROCEDURE [dbo].[GetExchangeAccountDisclaimerId]
(
@AccountID int
)
AS
SELECT
ExchangeDisclaimerId
FROM
ExchangeAccounts
WHERE
AccountID= @AccountID
RETURN'
END
GO

View file

@ -2679,6 +2679,98 @@ namespace WebsitePanel.EnterpriseServer
#endregion
#region Exchange Disclaimer
public static int AddExchangeDisclaimer(int itemID, ExchangeDisclaimer disclaimer)
{
SqlParameter outParam = new SqlParameter("@ExchangeDisclaimerId", SqlDbType.Int);
outParam.Direction = ParameterDirection.Output;
SqlHelper.ExecuteNonQuery(
ConnectionString,
CommandType.StoredProcedure,
"AddExchangeDisclaimer",
outParam,
new SqlParameter("@ItemID", itemID),
new SqlParameter("@DisclaimerName", disclaimer.DisclaimerName),
new SqlParameter("@DisclaimerText", disclaimer.DisclaimerText)
);
return Convert.ToInt32(outParam.Value);
}
public static void UpdateExchangeDisclaimer(int itemID, ExchangeDisclaimer disclaimer)
{
SqlHelper.ExecuteNonQuery(
ConnectionString,
CommandType.StoredProcedure,
"UpdateExchangeDisclaimer",
new SqlParameter("@ExchangeDisclaimerId", disclaimer.ExchangeDisclaimerId),
new SqlParameter("@DisclaimerName", disclaimer.DisclaimerName),
new SqlParameter("@DisclaimerText", disclaimer.DisclaimerText)
);
}
public static void DeleteExchangeDisclaimer(int exchangeDisclaimerId)
{
SqlHelper.ExecuteNonQuery(
ConnectionString,
CommandType.StoredProcedure,
"DeleteExchangeDisclaimer",
new SqlParameter("@ExchangeDisclaimerId", exchangeDisclaimerId)
);
}
public static IDataReader GetExchangeDisclaimer(int exchangeDisclaimerId)
{
return SqlHelper.ExecuteReader(
ConnectionString,
CommandType.StoredProcedure,
"GetExchangeDisclaimer",
new SqlParameter("@ExchangeDisclaimerId", exchangeDisclaimerId)
);
}
public static IDataReader GetExchangeDisclaimers(int itemId)
{
return SqlHelper.ExecuteReader(
ConnectionString,
CommandType.StoredProcedure,
"GetExchangeDisclaimers",
new SqlParameter("@ItemID", itemId)
);
}
public static void SetExchangeAccountDisclaimerId(int AccountID, int ExchangeDisclaimerId)
{
object id = null;
if (ExchangeDisclaimerId != -1) id = ExchangeDisclaimerId;
SqlHelper.ExecuteNonQuery(
ConnectionString,
CommandType.StoredProcedure,
"SetExchangeAccountDisclaimerId",
new SqlParameter("@AccountID", AccountID),
new SqlParameter("@ExchangeDisclaimerId", id)
);
}
public static int GetExchangeAccountDisclaimerId(int AccountID)
{
object objReturn = SqlHelper.ExecuteScalar(
ConnectionString,
CommandType.StoredProcedure,
"GetExchangeAccountDisclaimerId",
new SqlParameter("@AccountID", AccountID)
);
int ret;
if (!int.TryParse(objReturn.ToString(), out ret)) return -1;
return ret;
}
#endregion
#region Organizations
public static void DeleteOrganizationUser(int itemId)

View file

@ -4956,5 +4956,194 @@ namespace WebsitePanel.EnterpriseServer
TaskManager.CompleteTask();
}
}
public static int AddExchangeDisclaimer(int itemID, ExchangeDisclaimer disclaimer)
{
int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);
if (accountCheck < 0) return accountCheck;
// place log record
TaskManager.StartTask("EXCHANGE", "ADD_EXCHANGE_EXCHANGEDISCLAIMER");
TaskManager.ItemId = itemID;
try
{
return DataProvider.AddExchangeDisclaimer(itemID, disclaimer);
}
catch (Exception ex)
{
throw TaskManager.WriteError(ex);
}
finally
{
TaskManager.CompleteTask();
}
}
public static int UpdateExchangeDisclaimer(int itemID, ExchangeDisclaimer disclaimer)
{
int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);
if (accountCheck < 0) return accountCheck;
// place log record
TaskManager.StartTask("EXCHANGE", "UPDATE_EXCHANGE_EXCHANGEDISCLAIMER");
TaskManager.ItemId = itemID;
try
{
DataProvider.UpdateExchangeDisclaimer(itemID, disclaimer);
}
catch (Exception ex)
{
throw TaskManager.WriteError(ex);
}
finally
{
TaskManager.CompleteTask();
}
return 0;
}
public static int DeleteExchangeDisclaimer(int itemId, int exchangeDisclaimerId)
{
int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);
if (accountCheck < 0) return accountCheck;
TaskManager.StartTask("EXCHANGE", "DELETE_EXCHANGE_EXCHANGEDISCLAIMER");
TaskManager.ItemId = itemId;
try
{
DataProvider.DeleteExchangeDisclaimer(exchangeDisclaimerId);
}
catch (Exception ex)
{
throw TaskManager.WriteError(ex);
}
finally
{
TaskManager.CompleteTask();
}
return 0;
}
public static ExchangeDisclaimer GetExchangeDisclaimer(int itemId, int exchangeDisclaimerId)
{
TaskManager.StartTask("EXCHANGE", "GET_EXCHANGE_EXCHANGEDISCLAIMER");
TaskManager.ItemId = itemId;
try
{
return ObjectUtils.FillObjectFromDataReader<ExchangeDisclaimer>(
DataProvider.GetExchangeDisclaimer(exchangeDisclaimerId));
}
catch (Exception ex)
{
throw TaskManager.WriteError(ex);
}
finally
{
TaskManager.CompleteTask();
}
}
public static List<ExchangeDisclaimer> GetExchangeDisclaimers(int itemId)
{
TaskManager.StartTask("EXCHANGE", "GET_EXCHANGE_EXCHANGEDISCLAIMER");
TaskManager.ItemId = itemId;
try
{
List<ExchangeDisclaimer> disclaimers = ObjectUtils.CreateListFromDataReader<ExchangeDisclaimer>(DataProvider.GetExchangeDisclaimers(itemId));
return disclaimers;
}
catch (Exception ex)
{
throw TaskManager.WriteError(ex);
}
finally
{
TaskManager.CompleteTask();
}
}
public static int SetExchangeAccountDisclaimerId(int itemId, int AccountID, int ExchangeDisclaimerId)
{
int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);
if (accountCheck < 0) return accountCheck;
// place log record
TaskManager.StartTask("EXCHANGE", "SET_EXCHANGE_ACCOUNTDISCLAIMERID");
TaskManager.ItemId = AccountID;
try
{
ExchangeDisclaimer disclaimer = null;
if (ExchangeDisclaimerId != -1)
disclaimer = GetExchangeDisclaimer(itemId, ExchangeDisclaimerId);
// load account
ExchangeAccount account = GetAccount(itemId, AccountID);
Organization org = (Organization)PackageController.GetPackageItem(itemId);
if (org == null)
return -1;
int exchangeServiceId = GetExchangeServiceID(org.PackageId);
ExchangeServer exchange = GetExchangeServer(exchangeServiceId, org.ServiceId);
string transportRuleName = org.Name + "_" + account.PrimaryEmailAddress;
exchange.RemoveTransportRule(transportRuleName);
if (disclaimer != null)
{
if (!string.IsNullOrEmpty(disclaimer.DisclaimerText))
exchange.NewDisclaimerTransportRule(transportRuleName, account.PrimaryEmailAddress, disclaimer.DisclaimerText);
}
DataProvider.SetExchangeAccountDisclaimerId(AccountID, ExchangeDisclaimerId);
}
catch (Exception ex)
{
throw TaskManager.WriteError(ex);
}
finally
{
TaskManager.CompleteTask();
}
return 0;
}
public static int GetExchangeAccountDisclaimerId(int itemId, int AccountID)
{
TaskManager.StartTask("EXCHANGE", "GET_EXCHANGE_ACCOUNTDISCLAIMERID");
TaskManager.ItemId = AccountID;
try
{
return DataProvider.GetExchangeAccountDisclaimerId(AccountID);
}
catch (Exception ex)
{
throw TaskManager.WriteError(ex);
}
finally
{
TaskManager.CompleteTask();
}
}
}
}

View file

@ -37,15 +37,15 @@ using Microsoft.Web.Services3;
namespace WebsitePanel.EnterpriseServer
{
/// <summary>
/// Summary description for esApplicationsInstaller
/// </summary>
[WebService(Namespace = "http://smbsaas/websitepanel/enterpriseserver")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[Policy("ServerPolicy")]
[ToolboxItem(false)]
public class esExchangeServer : WebService
{
/// <summary>
/// Summary description for esApplicationsInstaller
/// </summary>
[WebService(Namespace = "http://smbsaas/websitepanel/enterpriseserver")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[Policy("ServerPolicy")]
[ToolboxItem(false)]
public class esExchangeServer : WebService
{
#region Organizations
[WebMethod]
public DataSet GetRawExchangeOrganizationsPaged(int packageId, bool recursive,
@ -547,94 +547,138 @@ namespace WebsitePanel.EnterpriseServer
#endregion
#region Public Folders
[WebMethod]
public int CreatePublicFolder(int itemId, string parentFolder, string folderName,
bool mailEnabled, string accountName, string domain)
{
return ExchangeServerController.CreatePublicFolder(itemId, parentFolder, folderName,
mailEnabled, accountName, domain);
}
#region Public Folders
[WebMethod]
public int CreatePublicFolder(int itemId, string parentFolder, string folderName,
bool mailEnabled, string accountName, string domain)
{
return ExchangeServerController.CreatePublicFolder(itemId, parentFolder, folderName,
mailEnabled, accountName, domain);
}
[WebMethod]
public int DeletePublicFolders(int itemId, int[] accountIds)
{
return ExchangeServerController.DeletePublicFolders(itemId, accountIds);
}
[WebMethod]
public int DeletePublicFolders(int itemId, int[] accountIds)
{
return ExchangeServerController.DeletePublicFolders(itemId, accountIds);
}
[WebMethod]
public int DeletePublicFolder(int itemId, int accountId)
{
return ExchangeServerController.DeletePublicFolder(itemId, accountId);
}
[WebMethod]
public int DeletePublicFolder(int itemId, int accountId)
{
return ExchangeServerController.DeletePublicFolder(itemId, accountId);
}
[WebMethod]
public int EnableMailPublicFolder(int itemId, int accountId,
string name, string domain)
{
return ExchangeServerController.EnableMailPublicFolder(itemId, accountId, name, domain);
}
[WebMethod]
public int EnableMailPublicFolder(int itemId, int accountId,
string name, string domain)
{
return ExchangeServerController.EnableMailPublicFolder(itemId, accountId, name, domain);
}
[WebMethod]
public int DisableMailPublicFolder(int itemId, int accountId)
{
return ExchangeServerController.DisableMailPublicFolder(itemId, accountId);
}
[WebMethod]
public int DisableMailPublicFolder(int itemId, int accountId)
{
return ExchangeServerController.DisableMailPublicFolder(itemId, accountId);
}
[WebMethod]
public ExchangePublicFolder GetPublicFolderGeneralSettings(int itemId, int accountId)
{
return ExchangeServerController.GetPublicFolderGeneralSettings(itemId, accountId);
}
[WebMethod]
public ExchangePublicFolder GetPublicFolderGeneralSettings(int itemId, int accountId)
{
return ExchangeServerController.GetPublicFolderGeneralSettings(itemId, accountId);
}
[WebMethod]
public int SetPublicFolderGeneralSettings(int itemId, int accountId, string newName,
bool hideAddressBook, ExchangeAccount[] accounts)
{
return ExchangeServerController.SetPublicFolderGeneralSettings(itemId, accountId, newName,
hideAddressBook, accounts);
}
[WebMethod]
public int SetPublicFolderGeneralSettings(int itemId, int accountId, string newName,
bool hideAddressBook, ExchangeAccount[] accounts)
{
return ExchangeServerController.SetPublicFolderGeneralSettings(itemId, accountId, newName,
hideAddressBook, accounts);
}
[WebMethod]
public ExchangePublicFolder GetPublicFolderMailFlowSettings(int itemId, int accountId)
{
return ExchangeServerController.GetPublicFolderMailFlowSettings(itemId, accountId);
}
[WebMethod]
public ExchangePublicFolder GetPublicFolderMailFlowSettings(int itemId, int accountId)
{
return ExchangeServerController.GetPublicFolderMailFlowSettings(itemId, accountId);
}
[WebMethod]
public int SetPublicFolderMailFlowSettings(int itemId, int accountId,
string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication)
{
return ExchangeServerController.SetPublicFolderMailFlowSettings(itemId, accountId,
acceptAccounts, rejectAccounts, requireSenderAuthentication);
}
[WebMethod]
public int SetPublicFolderMailFlowSettings(int itemId, int accountId,
string[] acceptAccounts, string[] rejectAccounts, bool requireSenderAuthentication)
{
return ExchangeServerController.SetPublicFolderMailFlowSettings(itemId, accountId,
acceptAccounts, rejectAccounts, requireSenderAuthentication);
}
[WebMethod]
public ExchangeEmailAddress[] GetPublicFolderEmailAddresses(int itemId, int accountId)
{
return ExchangeServerController.GetPublicFolderEmailAddresses(itemId, accountId);
}
[WebMethod]
public ExchangeEmailAddress[] GetPublicFolderEmailAddresses(int itemId, int accountId)
{
return ExchangeServerController.GetPublicFolderEmailAddresses(itemId, accountId);
}
[WebMethod]
public int AddPublicFolderEmailAddress(int itemId, int accountId, string emailAddress)
{
return ExchangeServerController.AddPublicFolderEmailAddress(itemId, accountId, emailAddress);
}
[WebMethod]
public int AddPublicFolderEmailAddress(int itemId, int accountId, string emailAddress)
{
return ExchangeServerController.AddPublicFolderEmailAddress(itemId, accountId, emailAddress);
}
[WebMethod]
public int SetPublicFolderPrimaryEmailAddress(int itemId, int accountId, string emailAddress)
{
return ExchangeServerController.SetPublicFolderPrimaryEmailAddress(itemId, accountId, emailAddress);
}
[WebMethod]
public int SetPublicFolderPrimaryEmailAddress(int itemId, int accountId, string emailAddress)
{
return ExchangeServerController.SetPublicFolderPrimaryEmailAddress(itemId, accountId, emailAddress);
}
[WebMethod]
public int DeletePublicFolderEmailAddresses(int itemId, int accountId, string[] emailAddresses)
{
return ExchangeServerController.DeletePublicFolderEmailAddresses(itemId, accountId, emailAddresses);
}
#endregion
[WebMethod]
public int DeletePublicFolderEmailAddresses(int itemId, int accountId, string[] emailAddresses)
{
return ExchangeServerController.DeletePublicFolderEmailAddresses(itemId, accountId, emailAddresses);
}
#endregion
#region Disclaimers
[WebMethod]
public int AddExchangeDisclaimer(int itemId, ExchangeDisclaimer disclaimer)
{
return ExchangeServerController.AddExchangeDisclaimer(itemId, disclaimer);
}
[WebMethod]
public int UpdateExchangeDisclaimer(int itemId, ExchangeDisclaimer disclaimer)
{
return ExchangeServerController.UpdateExchangeDisclaimer(itemId, disclaimer);
}
[WebMethod]
public int DeleteExchangeDisclaimer(int itemId, int exchangeDisclaimerId)
{
return ExchangeServerController.DeleteExchangeDisclaimer(itemId, exchangeDisclaimerId);
}
[WebMethod]
public ExchangeDisclaimer GetExchangeDisclaimer(int itemId, int exchangeDisclaimerId)
{
return ExchangeServerController.GetExchangeDisclaimer(itemId, exchangeDisclaimerId);
}
[WebMethod]
public List<ExchangeDisclaimer> GetExchangeDisclaimers(int itemId)
{
return ExchangeServerController.GetExchangeDisclaimers(itemId);
}
[WebMethod]
public int SetExchangeAccountDisclaimerId(int itemId, int AccountID, int ExchangeDisclaimerId)
{
return ExchangeServerController.SetExchangeAccountDisclaimerId(itemId, AccountID, ExchangeDisclaimerId);
}
[WebMethod]
public int GetExchangeAccountDisclaimerId(int itemId, int AccountID)
{
return ExchangeServerController.GetExchangeAccountDisclaimerId(itemId, AccountID);
}
#endregion
}
}

View file

@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace WebsitePanel.Providers.HostedSolution
{
public class ExchangeDisclaimer
{
int exchangeDisclaimerId;
int itemId;
string disclaimerName;
string disclaimerText;
public int ItemId
{
get { return this.itemId; }
set { this.itemId = value; }
}
public int ExchangeDisclaimerId
{
get { return this.exchangeDisclaimerId; }
set { this.exchangeDisclaimerId = value; }
}
public string DisclaimerName
{
get { return this.disclaimerName; }
set { this.disclaimerName = value; }
}
public string DisclaimerText
{
get { return this.disclaimerText; }
set { this.disclaimerText = value; }
}
}
}

View file

@ -126,5 +126,9 @@ namespace WebsitePanel.Providers.HostedSolution
void WipeDataFromDevice(string id);
void CancelRemoteWipeRequest(string id);
void RemoveDevice(string id);
// Disclaimers
int NewDisclaimerTransportRule(string Name, string From, string Text);
int RemoveTransportRule(string Name);
}
}

View file

@ -83,6 +83,7 @@
<Compile Include="HostedSolution\BlackBerryErrorsCodes.cs" />
<Compile Include="HostedSolution\BlackBerryStatsItem.cs" />
<Compile Include="HostedSolution\BlackBerryUserDeleteState.cs" />
<Compile Include="HostedSolution\ExchangeDisclaimer.cs" />
<Compile Include="HostedSolution\ExchangeOrganization.cs" />
<Compile Include="HostedSolution\ExchangeAcceptedDomainType.cs" />
<Compile Include="HostedSolution\ExchangeMailboxPlanType.cs" />

View file

@ -7222,6 +7222,78 @@ namespace WebsitePanel.Providers.HostedSolution
}
return bResult;
}
#region Disclaimers
public int NewDisclaimerTransportRule(string Name, string From, string Text)
{
return NewDisclaimerTransportRuleInternal(Name, From, Text);
}
public int RemoveTransportRule(string Name)
{
return RemoveTransportRuleInternal(Name);
}
internal virtual int NewDisclaimerTransportRuleInternal(string Name, string From, string Text)
{
ExchangeLog.LogStart("NewDisclaimerTransportRuleInternal");
Runspace runSpace = null;
try
{
runSpace = OpenRunspace();
Command cmd = new Command("New-TransportRule");
cmd.Parameters.Add("Name", Name);
cmd.Parameters.Add("From", From);
cmd.Parameters.Add("Enabled", true);
cmd.Parameters.Add("ApplyHtmlDisclaimerLocation", "Append");
cmd.Parameters.Add("ApplyHtmlDisclaimerText", Text);
cmd.Parameters.Add("ApplyHtmlDisclaimerFallbackAction", "Wrap");
ExecuteShellCommand(runSpace, cmd);
}
catch (Exception exc)
{
ExchangeLog.LogError(exc);
return -1;
}
finally
{
CloseRunspace(runSpace);
}
ExchangeLog.LogEnd("NewDisclaimerTransportRuleInternal");
return 0;
}
internal virtual int RemoveTransportRuleInternal(string Name)
{
ExchangeLog.LogStart("RemoveTransportRuleInternal");
Runspace runSpace = null;
try
{
runSpace = OpenRunspace();
Command cmd = new Command("Remove-TransportRule");
cmd.Parameters.Add("Identity", Name);
cmd.Parameters.Add("Confirm", true);
ExecuteShellCommand(runSpace, cmd);
}
catch (Exception exc)
{
ExchangeLog.LogError(exc);
return -1;
}
finally
{
CloseRunspace(runSpace);
}
ExchangeLog.LogEnd("RemoveTransportRuleInternal");
return 0;
}
#endregion
}
}

View file

@ -6874,5 +6874,76 @@ namespace WebsitePanel.Providers.HostedSolution
}
}
#endregion
#region Disclaimers
public int NewDisclaimerTransportRule(string Name, string From, string Text)
{
return NewDisclaimerTransportRuleInternal(Name, From, Text);
}
public int RemoveTransportRule(string Name)
{
return RemoveTransportRuleInternal(Name);
}
internal virtual int NewDisclaimerTransportRuleInternal(string Name, string From, string Text)
{
ExchangeLog.LogStart("NewDisclaimerTransportRuleInternal");
Runspace runSpace = null;
try
{
runSpace = OpenRunspace();
Command cmd = new Command("New-TransportRule");
cmd.Parameters.Add("Name", Name);
cmd.Parameters.Add("From", From);
cmd.Parameters.Add("Enabled", true);
cmd.Parameters.Add("ApplyHtmlDisclaimerLocation", "Append");
cmd.Parameters.Add("ApplyHtmlDisclaimerText", Text);
cmd.Parameters.Add("ApplyHtmlDisclaimerFallbackAction", "Wrap");
ExecuteShellCommand(runSpace, cmd);
}
catch (Exception exc)
{
ExchangeLog.LogError(exc);
return -1;
}
finally
{
CloseRunspace(runSpace);
}
ExchangeLog.LogEnd("NewDisclaimerTransportRuleInternal");
return 0;
}
internal virtual int RemoveTransportRuleInternal(string Name)
{
ExchangeLog.LogStart("RemoveTransportRuleInternal");
Runspace runSpace = null;
try
{
runSpace = OpenRunspace();
Command cmd = new Command("Remove-TransportRule");
cmd.Parameters.Add("Identity", Name);
cmd.Parameters.Add("Confirm", false);
ExecuteShellCommand(runSpace, cmd);
}
catch(Exception exc)
{
ExchangeLog.LogError(exc);
return -1;
}
finally
{
CloseRunspace(runSpace);
}
ExchangeLog.LogEnd("RemoveTransportRuleInternal");
return 0;
}
#endregion
}
}

View file

@ -818,10 +818,24 @@ namespace WebsitePanel.Server
#endregion
#region Disclaimers
[WebMethod, SoapHeader("settings")]
public int NewDisclaimerTransportRule(string Name, string From, string Text)
{
return ES.NewDisclaimerTransportRule(Name, From, Text);
}
[WebMethod, SoapHeader("settings")]
public int RemoveTransportRule(string Name)
{
return ES.RemoveTransportRule(Name);
}
#endregion
#region Public Folders
[WebMethod, SoapHeader("settings")]
[WebMethod, SoapHeader("settings")]
public void CreatePublicFolder(string organizationDistinguishedName, string organizationId, string securityGroup, string parentFolder,
string folderName, bool mailEnabled, string accountName, string name, string domain)
{

View file

@ -474,7 +474,10 @@
<Control key="dlist_mailflow" src="WebsitePanel/ExchangeServer/ExchangeDistributionListMailFlowSettings.ascx" title="ExchangeDistributionListMailFlowSettings" type="View" />
<Control key="dlist_permissions" src="WebsitePanel/ExchangeServer/ExchangeDistributionListPermissions.ascx" title="ExchangeDistributionListMailFlowSettings" type="View" />
<Control key="public_folders" src="WebsitePanel/ExchangeServer/ExchangePublicFolders.ascx" title="ExchangePublicFolders" type="View" />
<Control key="disclaimers" src="WebsitePanel/ExchangeServer/ExchangeDisclaimers.ascx" title="ExchangeDisclaimers" type="View" />
<Control key="disclaimers_settings" src="WebsitePanel/ExchangeServer/ExchangeDisclaimerGeneralSettings.ascx" title="ExchangeDisclaimerGeneralSettings" type="View" />
<Control key="public_folders" src="WebsitePanel/ExchangeServer/ExchangePublicFolders.ascx" title="ExchangePublicFolders" type="View" />
<Control key="create_public_folder" src="WebsitePanel/ExchangeServer/ExchangeCreatePublicFolder.ascx" title="ExchangeCreatePublicFolder" type="View" />
<Control key="public_folder_settings" src="WebsitePanel/ExchangeServer/ExchangePublicFolderGeneralSettings.ascx" title="ExchangePublicFolderGeneralSettings" type="View" />
<Control key="public_folder_addresses" src="WebsitePanel/ExchangeServer/ExchangePublicFolderEmailAddresses.ascx" title="ExchangePublicFolderEmailAddresses" type="View" />

View file

@ -2919,6 +2919,9 @@
<data name="Error.EXCHANGE_DELETE_DISTRIBUTION_LIST" xml:space="preserve">
<value>Error deleting distribution list. See audit log for more details.</value>
</data>
<data name="Error.EXCHANGE_DELETE_DISCLAIMER" xml:space="preserve">
<value>Error deleting disclaimer. See audit log for more details.</value>
</data>
<data name="Error.EXCHANGE_DELETE_MAILBOX" xml:space="preserve">
<value>Error deleting mailbox. See audit log for more details.</value>
</data>
@ -2980,6 +2983,9 @@
<data name="Error.EXCHANGE_GET_DLIST_SETTINGS" xml:space="preserve">
<value>Error reading distribution list general settings. See audit log for more details.</value>
</data>
<data name="Error.EXCHANGE_GET_DISCLAIMER_SETTINGS" xml:space="preserve">
<value>Error reading disclaimer. See audit log for more details.</value>
</data>
<data name="Error.EXCHANGE_GET_MAILBOX_ADVANCED" xml:space="preserve">
<value>Error reading mailbox advanced settings. See audit log for more details.</value>
</data>
@ -3031,6 +3037,9 @@
<data name="Error.EXCHANGE_UPDATE_DLIST_SETTINGS" xml:space="preserve">
<value>Error updating distribution list general settings. See audit log for more details.</value>
</data>
<data name="Error.EXCHANGE_UPDATE_DISCLAIMER_SETTINGS" xml:space="preserve">
<value>Error updating disclaimer. See audit log for more details.</value>
</data>
<data name="Error.EXCHANGE_UPDATE_MAILBOX_ADVANCED" xml:space="preserve">
<value>Error updating mailbox advanced settings. See audit log for more details.</value>
</data>
@ -3064,6 +3073,9 @@
<data name="Error.EXCHANGE_GET_LISTS" xml:space="preserve">
<value>Error reading organization distribution lists</value>
</data>
<data name="Error.EXCHANGE_DISCLAIMERS_LISTS" xml:space="preserve">
<value>Error reading organization disclaimer lists</value>
</data>
<data name="Error.HOSTED_SHAREPOINT_UPDATE_QUOTAS" xml:space="preserve">
<value>Error updating storage settings. See audit log for more details.</value>
</data>
@ -3122,6 +3134,9 @@
<data name="Success.EXCHANGE_UPDATE_DLIST_SETTINGS" xml:space="preserve">
<value>Distribution list general settings have been successfully updated.</value>
</data>
<data name="Success.EXCHANGE_UPDATE_DISCLAIMER_SETTINGS" xml:space="preserve">
<value>Disclaimer successfully updated.</value>
</data>
<data name="Success.EXCHANGE_UPDATE_PFOLDER_MAILFLOW" xml:space="preserve">
<value>Public folder mail flow settings have been successfully updated.</value>
</data>

View file

@ -0,0 +1,144 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="btnSave.OnClientClick" xml:space="preserve">
<value>ShowProgressDialog('Updating Disclaimer ...');</value>
</data>
<data name="btnSave.Text" xml:space="preserve">
<value>Save Changes</value>
</data>
<data name="FormComments.Text" xml:space="preserve">
<value />
</data>
<data name="locNotes.Text" xml:space="preserve">
<value>Text:</value>
</data>
<data name="locTitle.Text" xml:space="preserve">
<value>Edit Disclaimer</value>
</data>
<data name="Text.PageName" xml:space="preserve">
<value>Disclaimer</value>
</data>
<data name="valRequireDisplayName.ErrorMessage" xml:space="preserve">
<value>Enter Display Name</value>
</data>
<data name="valRequireDisplayName.Text" xml:space="preserve">
<value>*</value>
</data>
</root>

View file

@ -0,0 +1,156 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="btnCreateList.Text" xml:space="preserve">
<value>Create New Disclaimer</value>
</data>
<data name="cmdDelete.OnClientClick" xml:space="preserve">
<value>if(!confirm('Are you sure you want to delete this disclaimer?')) return false; else ShowProgressDialog('Deleting disclaimer list...');</value>
</data>
<data name="cmdDelete.Text" xml:space="preserve">
<value>Delete</value>
</data>
<data name="cmdDelete.ToolTip" xml:space="preserve">
<value>Delete Disclaimer</value>
</data>
<data name="cmdSearch.AlternateText" xml:space="preserve">
<value>Search</value>
</data>
<data name="ddlSearchColumnDisplayName.Text" xml:space="preserve">
<value>Display Name</value>
</data>
<data name="FormComments.Text" xml:space="preserve">
<value />
</data>
<data name="gvLists.Empty" xml:space="preserve">
<value>No disclaimer have been created. To create a new disclaimer click "Create New Disclaimer" button.</value>
</data>
<data name="gvListsDisplayName.Header" xml:space="preserve">
<value>Display Name</value>
</data>
<data name="locQuota.Text" xml:space="preserve">
<value>Disclaimer Created:</value>
</data>
<data name="locTitle.Text" xml:space="preserve">
<value>Disclaimers</value>
</data>
<data name="Text.PageName" xml:space="preserve">
<value>Disclaimers</value>
</data>
</root>

View file

@ -0,0 +1,56 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ExchangeDisclaimerGeneralSettings.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.ExchangeDisclaimerGeneralSettings" %>
<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %>
<%@ Register Src="UserControls/AccountsList.ascx" TagName="AccountsList" TagPrefix="wsp" %>
<%@ Register Src="UserControls/MailboxSelector.ascx" TagName="MailboxSelector" TagPrefix="wsp" %>
<%@ Register Src="UserControls/DistributionListTabs.ascx" TagName="DistributionListTabs" TagPrefix="wsp" %>
<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %>
<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %>
<%@ Register TagPrefix="wsp" TagName="CollapsiblePanel" Src="../UserControls/CollapsiblePanel.ascx" %>
<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %>
<wsp:EnableAsyncTasksSupport id="asyncTasks" runat="server"/>
<div id="ExchangeContainer">
<div class="Module">
<div class="Header">
<wsp:Breadcrumb id="breadcrumb" runat="server" PageName="Text.PageName" />
</div>
<div class="Left">
<wsp:Menu id="menu" runat="server" SelectedItem="dlists" />
</div>
<div class="Content">
<div class="Center">
<div class="Title">
<asp:Image ID="Image1" SkinID="ExchangeList48" runat="server" />
<asp:Localize ID="locTitle" runat="server" meta:resourcekey="locTitle" Text="Edit Distribution List"></asp:Localize>
-
<asp:Literal ID="litDisplayName" runat="server" Text="" />
</div>
<div class="FormBody">
<wsp:SimpleMessageBox id="messageBox" runat="server" />
<table>
<tr>
<td class="FormLabel150"><asp:Localize ID="locDisplayName" runat="server" meta:resourcekey="locDisplayName" Text="Display Name: *"></asp:Localize></td>
<td>
<asp:TextBox ID="txtDisplayName" runat="server" CssClass="HugeTextBox200" ValidationGroup="CreateMailbox"></asp:TextBox>
<asp:RequiredFieldValidator ID="valRequireDisplayName" runat="server" meta:resourcekey="valRequireDisplayName" ControlToValidate="txtDisplayName"
ErrorMessage="Enter Display Name" ValidationGroup="EditList" Display="Dynamic" Text="*" SetFocusOnError="True"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="FormLabel200"><asp:Localize ID="locNotes" runat="server" meta:resourcekey="locNotes" Text="Text:"></asp:Localize></td>
<td>
<asp:TextBox ID="txtNotes" runat="server" CssClass="TextBox200" Rows="4" TextMode="MultiLine"></asp:TextBox>
</td>
</tr>
</table>
<div class="FormFooterClean">
<asp:Button id="btnSave" runat="server" Text="Save Changes" CssClass="Button1" meta:resourcekey="btnSave" ValidationGroup="EditList" OnClick="btnSave_Click"></asp:Button>
<asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="True" ShowSummary="False" ValidationGroup="EditList" />
</div>
</div>
</div>
</div>
</div>
</div>

View file

@ -0,0 +1,126 @@
// Copyright (c) 2012, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using WebsitePanel.Providers.HostedSolution;
using WebsitePanel.EnterpriseServer;
namespace WebsitePanel.Portal.ExchangeServer
{
public partial class ExchangeDisclaimerGeneralSettings : WebsitePanelModuleBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindSettings();
}
}
private void BindSettings()
{
try
{
if (PanelRequest.AccountID != 0)
{
// get settings
ExchangeDisclaimer disclaimer = ES.Services.ExchangeServer.GetExchangeDisclaimer(
PanelRequest.ItemID, PanelRequest.AccountID);
litDisplayName.Text = PortalAntiXSS.Encode(disclaimer.DisclaimerName);
// bind form
txtDisplayName.Text = disclaimer.DisclaimerName;
txtNotes.Text = disclaimer.DisclaimerText;
}
}
catch (Exception ex)
{
messageBox.ShowErrorMessage("EXCHANGE_GET_DISCLAIMER_SETTINGS", ex);
}
}
private void SaveSettings()
{
if (!Page.IsValid)
return;
try
{
int result = 0;
ExchangeDisclaimer disclaimer = new ExchangeDisclaimer();
disclaimer.DisclaimerName = txtDisplayName.Text;
disclaimer.DisclaimerText = txtNotes.Text;
if (PanelRequest.AccountID == 0)
{
int id = ES.Services.ExchangeServer.AddExchangeDisclaimer(PanelRequest.ItemID, disclaimer);
}
else
{
disclaimer.ExchangeDisclaimerId = PanelRequest.AccountID;
result = ES.Services.ExchangeServer.UpdateExchangeDisclaimer(
PanelRequest.ItemID, disclaimer);
}
if (result < 0)
{
messageBox.ShowResultMessage(result);
return;
}
litDisplayName.Text = PortalAntiXSS.Encode(txtDisplayName.Text);
messageBox.ShowSuccessMessage("EXCHANGE_UPDATE_DISCLAIMER_SETTINGS");
}
catch (Exception ex)
{
messageBox.ShowErrorMessage("EXCHANGE_UPDATE_DISCLAIMER_SETTINGS", ex);
}
}
protected void btnSave_Click(object sender, EventArgs e)
{
SaveSettings();
}
}
}

View file

@ -0,0 +1,141 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WebsitePanel.Portal.ExchangeServer {
public partial class ExchangeDisclaimerGeneralSettings {
/// <summary>
/// asyncTasks control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks;
/// <summary>
/// breadcrumb control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Breadcrumb breadcrumb;
/// <summary>
/// menu control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Menu menu;
/// <summary>
/// Image1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Image Image1;
/// <summary>
/// locTitle control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locTitle;
/// <summary>
/// litDisplayName 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.Literal litDisplayName;
/// <summary>
/// messageBox control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox;
/// <summary>
/// locDisplayName control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locDisplayName;
/// <summary>
/// txtDisplayName 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 txtDisplayName;
/// <summary>
/// valRequireDisplayName 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.RequiredFieldValidator valRequireDisplayName;
/// <summary>
/// locNotes control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locNotes;
/// <summary>
/// txtNotes 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 txtNotes;
/// <summary>
/// btnSave 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 btnSave;
/// <summary>
/// ValidationSummary1 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.ValidationSummary ValidationSummary1;
}
}

View file

@ -0,0 +1,86 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ExchangeDisclaimers.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.ExchangeDisclaimers" %>
<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %>
<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %>
<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %>
<%@ Register Src="../UserControls/QuotaViewer.ascx" TagName="QuotaViewer" TagPrefix="wsp" %>
<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %>
<wsp:EnableAsyncTasksSupport id="asyncTasks" runat="server"/>
<div id="ExchangeContainer">
<div class="Module">
<div class="Header">
<wsp:Breadcrumb id="breadcrumb" runat="server" PageName="Text.PageName" />
</div>
<div class="Left">
<wsp:Menu id="menu" runat="server" SelectedItem="dlists" />
</div>
<div class="Content">
<div class="Center">
<div class="Title">
<asp:Image ID="Image1" SkinID="ExchangeList48" runat="server" />
<asp:Localize ID="locTitle" runat="server" meta:resourcekey="locTitle" Text="Lists"></asp:Localize>
</div>
<div class="FormBody">
<wsp:SimpleMessageBox id="messageBox" runat="server" />
<div class="FormButtonsBarClean">
<div class="FormButtonsBarCleanLeft">
<asp:Button ID="btnCreateList" runat="server" meta:resourcekey="btnCreateList"
Text="Create New Distribution List" CssClass="Button1" OnClick="btnCreateList_Click" />
</div>
<div class="FormButtonsBarCleanRight">
<%--
<asp:Panel ID="SearchPanel" runat="server" DefaultButton="cmdSearch">
<asp:Localize ID="locSearch" runat="server" meta:resourcekey="locSearch" Visible="false"></asp:Localize>
<asp:DropDownList ID="ddlPageSize" runat="server" AutoPostBack="True"
onselectedindexchanged="ddlPageSize_SelectedIndexChanged">
<asp:ListItem>10</asp:ListItem>
<asp:ListItem Selected="True">20</asp:ListItem>
<asp:ListItem>50</asp:ListItem>
<asp:ListItem>100</asp:ListItem>
</asp:DropDownList>
<asp:DropDownList ID="ddlSearchColumn" runat="server" CssClass="NormalTextBox">
<asp:ListItem Value="DisplayName" meta:resourcekey="ddlSearchColumnDisplayName">DisplayName</asp:ListItem>
</asp:DropDownList><asp:TextBox ID="txtSearchValue" runat="server" CssClass="NormalTextBox" Width="100"></asp:TextBox><asp:ImageButton ID="cmdSearch" Runat="server" meta:resourcekey="cmdSearch" SkinID="SearchButton"
CausesValidation="false"/>
</asp:Panel>
--%>
</div>
</div>
<asp:GridView ID="gvLists" runat="server" AutoGenerateColumns="False" EnableViewState="true"
Width="100%" EmptyDataText="gvLists" CssSelectorClass="NormalGridView"
OnRowCommand="gvLists_RowCommand" AllowPaging="True" AllowSorting="True"
PageSize="20">
<Columns>
<asp:TemplateField HeaderText="gvListsDisplayName" SortExpression="DisplayName">
<ItemStyle Width="80%"></ItemStyle>
<ItemTemplate>
<asp:hyperlink id="lnk1" runat="server"
NavigateUrl='<%# GetListEditUrl(Eval("ExchangeDisclaimerId").ToString()) %>'>
<%# Eval("DisclaimerName")%>
</asp:hyperlink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:ImageButton ID="cmdDelete" runat="server" Text="Delete" SkinID="ExchangeDelete"
CommandName="DeleteItem" CommandArgument='<%# Eval("ExchangeDisclaimerId") %>'
meta:resourcekey="cmdDelete" OnClientClick="return confirm('Remove this item?');"></asp:ImageButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<br />
<asp:Localize ID="locQuota" runat="server" meta:resourcekey="locQuota" Text="Total Distribution Lists Created:"></asp:Localize>
&nbsp;&nbsp;&nbsp;
<wsp:QuotaViewer ID="listsQuota" runat="server" QuotaTypeId="2" />
</div>
</div>
</div>
</div>
</div>

View file

@ -0,0 +1,137 @@
// Copyright (c) 2012, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using WebsitePanel.Providers.HostedSolution;
using WebsitePanel.EnterpriseServer;
namespace WebsitePanel.Portal.ExchangeServer
{
public partial class ExchangeDisclaimers : WebsitePanelModuleBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindDisclaimers();
BindStats();
}
}
ExchangeDisclaimer[] disclaimerList = null;
private void BindDisclaimers()
{
disclaimerList = ES.Services.ExchangeServer.GetExchangeDisclaimers(PanelRequest.ItemID);
gvLists.DataSource = disclaimerList;
gvLists.DataBind();
}
private void BindStats()
{
listsQuota.QuotaValue = -1;
if (disclaimerList!=null)
listsQuota.QuotaUsedValue = disclaimerList.Length;
}
protected void btnCreateList_Click(object sender, EventArgs e)
{
Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "disclaimers_settings",
"SpaceID=" + PanelSecurity.PackageId.ToString()));
}
public string GetListEditUrl(string accountId)
{
return EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "disclaimers_settings",
"AccountID=" + accountId,
"ItemID=" + PanelRequest.ItemID.ToString());
}
protected void odsAccountsPaged_Selected(object sender, ObjectDataSourceStatusEventArgs e)
{
if (e.Exception != null)
{
messageBox.ShowErrorMessage("EXCHANGE_DISCLAIMERS_LISTS", e.Exception);
e.ExceptionHandled = true;
}
}
protected void gvLists_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "DeleteItem")
{
// delete distribution list
int accountId = Utils.ParseInt(e.CommandArgument.ToString(), 0);
try
{
int result = ES.Services.ExchangeServer.DeleteExchangeDisclaimer(PanelRequest.ItemID, accountId);
if (result < 0)
{
messageBox.ShowResultMessage(result);
return;
}
// rebind grid
BindDisclaimers();
BindStats();
}
catch (Exception ex)
{
messageBox.ShowErrorMessage("EXCHANGE_DELETE_DISCLAIMER", ex);
}
}
}
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
//gvLists.PageSize = Convert.ToInt16(ddlPageSize.SelectedValue);
// rebind grid
BindDisclaimers();
// bind stats
BindStats();
}
}
}

View file

@ -0,0 +1,105 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WebsitePanel.Portal.ExchangeServer {
public partial class ExchangeDisclaimers {
/// <summary>
/// asyncTasks control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks;
/// <summary>
/// breadcrumb control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Breadcrumb breadcrumb;
/// <summary>
/// menu control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Menu menu;
/// <summary>
/// Image1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Image Image1;
/// <summary>
/// locTitle control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locTitle;
/// <summary>
/// messageBox control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox;
/// <summary>
/// btnCreateList 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 btnCreateList;
/// <summary>
/// gvLists 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.GridView gvLists;
/// <summary>
/// locQuota control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locQuota;
/// <summary>
/// listsQuota control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.QuotaViewer listsQuota;
}
}

View file

@ -55,6 +55,12 @@
<td class="FormLabel150"><asp:Localize ID="Localize2" runat="server" meta:resourcekey="locMailboxplanName" Text="Mailbox plan: *"></asp:Localize></td>
<td>
<wsp:MailboxPlanSelector ID="mailboxPlanSelector" runat="server" />
</td>
</tr>
<tr>
<td class="FormLabel150"><asp:Localize ID="Localize1" runat="server" meta:resourcekey="locDisclaimer" Text="Disclaimer: "></asp:Localize></td>
<td>
<asp:DropDownList ID="ddDisclaimer" runat="server" />
</td>
</tr>
<tr>

View file

@ -38,6 +38,11 @@ namespace WebsitePanel.Portal.ExchangeServer
{
if (!IsPostBack)
{
ddDisclaimer.Items.Add(new System.Web.UI.WebControls.ListItem("None", "-1"));
ExchangeDisclaimer[] disclaimers = ES.Services.ExchangeServer.GetExchangeDisclaimers(PanelRequest.ItemID);
foreach (ExchangeDisclaimer disclaimer in disclaimers)
ddDisclaimer.Items.Add(new System.Web.UI.WebControls.ListItem(disclaimer.DisclaimerName, disclaimer.ExchangeDisclaimerId.ToString()));
BindSettings();
UserInfo user = UsersHelper.GetUser(PanelSecurity.EffectiveUserId);
@ -98,7 +103,7 @@ namespace WebsitePanel.Portal.ExchangeServer
}
mailboxSize.QuotaUsedValue = Convert.ToInt32(stats.TotalSize / 1024 / 1024);
mailboxSize.QuotaValue = (stats.MaxSize == -1) ? -1: (int)Math.Round((double)(stats.MaxSize / 1024 / 1024));
mailboxSize.QuotaValue = (stats.MaxSize == -1) ? -1 : (int)Math.Round((double)(stats.MaxSize / 1024 / 1024));
secCalendarSettings.Visible = ((account.AccountType == ExchangeAccountType.Equipment) | (account.AccountType == ExchangeAccountType.Room));
@ -107,7 +112,8 @@ namespace WebsitePanel.Portal.ExchangeServer
litigationHoldSpace.QuotaUsedValue = Convert.ToInt32(stats.LitigationHoldTotalSize / 1024 / 1024);
litigationHoldSpace.QuotaValue = (stats.LitigationHoldMaxSize == -1) ? -1 : (int)Math.Round((double)(stats.LitigationHoldMaxSize / 1024 / 1024));
int disclaimerId = ES.Services.ExchangeServer.GetExchangeAccountDisclaimerId(PanelRequest.ItemID, PanelRequest.AccountID);
ddDisclaimer.SelectedValue = disclaimerId.ToString();
}
catch (Exception ex)
@ -149,6 +155,10 @@ namespace WebsitePanel.Portal.ExchangeServer
}
}
int disclaimerId;
if (int.TryParse(ddDisclaimer.SelectedValue, out disclaimerId))
ES.Services.ExchangeServer.SetExchangeAccountDisclaimerId(PanelRequest.ItemID, PanelRequest.AccountID, disclaimerId);
messageBox.ShowSuccessMessage("EXCHANGE_UPDATE_MAILBOX_SETTINGS");
BindSettings();
}

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>
// This code was generated by a tool.
@ -175,6 +147,24 @@ namespace WebsitePanel.Portal.ExchangeServer {
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.MailboxPlanSelector mailboxPlanSelector;
/// <summary>
/// Localize1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize Localize1;
/// <summary>
/// ddDisclaimer 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.DropDownList ddDisclaimer;
/// <summary>
/// locQuota control.
/// </summary>

View file

@ -126,6 +126,9 @@
<data name="Text.DistributionLists" xml:space="preserve">
<value>Distribution Lists</value>
</data>
<data name="Text.Disclaimers" xml:space="preserve">
<value>Disclaimers</value>
</data>
<data name="Text.DomainNames" xml:space="preserve">
<value>Domains</value>
</data>

View file

@ -32,8 +32,8 @@ using WebsitePanel.WebPortal;
using WebsitePanel.EnterpriseServer;
namespace WebsitePanel.Portal.ExchangeServer.UserControls
{
public partial class Menu : WebsitePanelControlBase
{
public partial class Menu : WebsitePanelControlBase
{
public class MenuGroup
{
@ -56,7 +56,7 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls
public string ImageUrl
{
get { return imageUrl; }
set { imageUrl = value;}
set { imageUrl = value; }
}
public MenuGroup(string text, string imageUrl)
@ -69,38 +69,38 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls
}
public class MenuItem
{
{
private string url;
private string text;
private string key;
private string text;
private string key;
public string Url
{
get { return url; }
set { url = value; }
}
{
get { return url; }
set { url = value; }
}
public string Text
{
get { return text; }
set { text = value; }
}
public string Text
{
get { return text; }
set { text = value; }
}
public string Key
{
get { return key; }
set { key = value; }
}
public string Key
{
get { return key; }
set { key = value; }
}
}
}
private string selectedItem;
public string SelectedItem
{
get { return selectedItem; }
set { selectedItem = value; }
}
private string selectedItem;
public string SelectedItem
{
get { return selectedItem; }
set { selectedItem = value; }
}
private void PrepareExchangeMenu(PackageContext cntx, List<MenuGroup> groups, string imagePath)
@ -143,7 +143,10 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls
if (!hideItems)
if (Utils.CheckQouta(Quotas.EXCHANGE2007_MAILBOXES, cntx))
exchangeGroup.MenuItems.Add(CreateMenuItem("StorageUsage", "storage_usage"));
exchangeGroup.MenuItems.Add(CreateMenuItem("StorageUsage", "storage_usage"));
if (!hideItems)
exchangeGroup.MenuItems.Add(CreateMenuItem("Disclaimers", "disclaimers"));
if (exchangeGroup.MenuItems.Count > 0)
groups.Add(exchangeGroup);
@ -243,7 +246,7 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls
}
private List<MenuGroup> PrepareMenu()
{
{
PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId);
List<MenuGroup> groups = new List<MenuGroup>();
@ -283,36 +286,36 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls
PrepareLyncMenu(cntx, groups, imagePath);
return groups;
}
}
protected void Page_Load(object sender, EventArgs e)
{
{
List<MenuGroup> groups = PrepareMenu();
/*repMenu.SelectedIndex = -1;
for(int i = 0; i < items.Count; i++)
{
if (String.Compare(SelectedItem, items[i].Key, true) == 0)
{
repMenu.SelectedIndex = i;
break;
}
}*/
for(int i = 0; i < items.Count; i++)
{
if (String.Compare(SelectedItem, items[i].Key, true) == 0)
{
repMenu.SelectedIndex = i;
break;
}
}*/
// bind
// bind
repMenu.DataSource = groups;
repMenu.DataBind();
}
repMenu.DataBind();
}
private MenuItem CreateMenuItem(string text, string key)
{
MenuItem item = new MenuItem();
item.Key = key;
item.Text = GetLocalizedString("Text." + text);
item.Url = HostModule.EditUrl("ItemID", PanelRequest.ItemID.ToString(), key,
"SpaceID=" + PanelSecurity.PackageId);
return item;
}
}
private MenuItem CreateMenuItem(string text, string key)
{
MenuItem item = new MenuItem();
item.Key = key;
item.Text = GetLocalizedString("Text." + text);
item.Url = HostModule.EditUrl("ItemID", PanelRequest.ItemID.ToString(), key,
"SpaceID=" + PanelSecurity.PackageId);
return item;
}
}
}

View file

@ -255,6 +255,20 @@
<Compile Include="ExchangeServer\UserControls\UserTabs.ascx.designer.cs">
<DependentUpon>UserTabs.ascx</DependentUpon>
</Compile>
<Compile Include="ExchangeServer\ExchangeDisclaimers.ascx.cs">
<DependentUpon>ExchangeDisclaimers.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="ExchangeServer\ExchangeDisclaimers.ascx.designer.cs">
<DependentUpon>ExchangeDisclaimers.ascx</DependentUpon>
</Compile>
<Compile Include="ExchangeServer\ExchangeDisclaimerGeneralSettings.ascx.cs">
<DependentUpon>ExchangeDisclaimerGeneralSettings.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="ExchangeServer\ExchangeDisclaimerGeneralSettings.ascx.designer.cs">
<DependentUpon>ExchangeDisclaimerGeneralSettings.ascx</DependentUpon>
</Compile>
<Compile Include="Lync\LyncAddFederationDomain.ascx.cs">
<DependentUpon>LyncAddFederationDomain.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@ -3850,6 +3864,8 @@
<Content Include="ExchangeServer\OrganizationAddDomainName.ascx" />
<Content Include="ExchangeServer\OrganizationDomainNames.ascx" />
<Content Include="ExchangeServer\ExchangeAddMailboxPlan.ascx" />
<Content Include="ExchangeServer\ExchangeDisclaimers.ascx" />
<Content Include="ExchangeServer\ExchangeDisclaimerGeneralSettings.ascx" />
<Content Include="Lync\UserControls\LyncUserSettings.ascx" />
<Content Include="ProviderControls\CRM2011_Settings.ascx" />
<Content Include="ProviderControls\HeliconZoo_Settings.ascx" />
@ -5021,6 +5037,12 @@
<Content Include="UserControls\App_LocalResources\OrgIdPolicyEditor.ascx.resx" />
<None Include="Resources\Windows2008_Settings.ascx.resx" />
<Content Include="App_LocalResources\WebSitesHeliconZooControl.ascx.resx" />
<Content Include="ExchangeServer\App_LocalResources\ExchangeDisclaimers.ascx.resx">
<SubType>Designer</SubType>
</Content>
<Content Include="ExchangeServer\App_LocalResources\ExchangeDisclaimerGeneralSettings.ascx.resx">
<SubType>Designer</SubType>
</Content>
<EmbeddedResource Include="UserControls\App_LocalResources\EditDomainsList.ascx.resx">
<SubType>Designer</SubType>
</EmbeddedResource>