fix page Domain Dependencies
This commit is contained in:
parent
48b89d292f
commit
7f6c3cc09e
3 changed files with 80 additions and 16 deletions
|
@ -7113,7 +7113,8 @@ SELECT
|
|||
'ExchangeAccounts' as ObjectName,
|
||||
AccountID as ObjectID,
|
||||
AccountType as ObjectType,
|
||||
DisplayName as DisplayName
|
||||
DisplayName as DisplayName,
|
||||
0 as OwnerID
|
||||
FROM
|
||||
ExchangeAccounts
|
||||
WHERE
|
||||
|
@ -7122,8 +7123,9 @@ UNION
|
|||
SELECT
|
||||
'ExchangeAccountEmailAddresses' as ObjectName,
|
||||
eam.AddressID as ObjectID,
|
||||
eam.AccountID as ObjectType,
|
||||
eam.EmailAddress as DisplayName
|
||||
ea.AccountType as ObjectType,
|
||||
eam.EmailAddress as DisplayName,
|
||||
eam.AccountID as OwnerID
|
||||
FROM
|
||||
ExchangeAccountEmailAddresses as eam
|
||||
INNER JOIN
|
||||
|
@ -7139,7 +7141,8 @@ SELECT
|
|||
'LyncUsers' as ObjectName,
|
||||
ea.AccountID as ObjectID,
|
||||
ea.AccountType as ObjectType,
|
||||
ea.DisplayName as DisplayName
|
||||
ea.DisplayName as DisplayName,
|
||||
0 as OwnerID
|
||||
FROM
|
||||
ExchangeAccounts ea
|
||||
INNER JOIN
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
<ItemTemplate>
|
||||
<asp:Image ID="img1" runat="server" ImageUrl='<%# GetObjectImage(Eval("ObjectName").ToString(),(int)Eval("ObjectType")) %>' ImageAlign="AbsMiddle" />
|
||||
<asp:hyperlink id="lnk1" runat="server"
|
||||
NavigateUrl='<%# GetEditUrl(Eval("ObjectName").ToString(),(int)Eval("ObjectType"),Eval("ObjectID").ToString()) %>'>
|
||||
NavigateUrl='<%# GetEditUrl(Eval("ObjectName").ToString(),(int)Eval("ObjectType"),Eval("ObjectID").ToString(),Eval("OwnerID").ToString()) %>'>
|
||||
<%# Eval("DisplayName") %>
|
||||
</asp:hyperlink>
|
||||
</ItemTemplate>
|
||||
|
@ -48,7 +48,7 @@
|
|||
<ItemStyle Width="10%"></ItemStyle>
|
||||
<ItemTemplate>
|
||||
<asp:hyperlink id="lnk2" runat="server"
|
||||
NavigateUrl='<%# GetEditUrl(Eval("ObjectName").ToString(),(int)Eval("ObjectType"),Eval("ObjectID").ToString()) %>'>
|
||||
NavigateUrl='<%# GetEditUrl(Eval("ObjectName").ToString(),(int)Eval("ObjectType"),Eval("ObjectID").ToString(),Eval("OwnerID").ToString()) %>'>
|
||||
<asp:Literal id="lnkView" runat="server" Text="View" meta:resourcekey="lnkView" />
|
||||
</asp:hyperlink>
|
||||
</ItemTemplate>
|
||||
|
@ -59,7 +59,7 @@
|
|||
<ItemTemplate>
|
||||
<asp:LinkButton id="lnkDelete" runat="server" Text="Delete" meta:resourcekey="lnkDelete"
|
||||
OnClientClick="if(!confirm('Are you sure you want to delete ?')) return false; else ShowProgressDialog('Deleting ...');"
|
||||
CommandName="DeleteItem" CommandArgument='<%# Eval("ObjectType").ToString() + "," + Eval("DisplayName") %>'
|
||||
CommandName="DeleteItem" CommandArgument='<%# Eval("OwnerID").ToString() + "," + Eval("ObjectType").ToString() + "," + Eval("DisplayName") %>'
|
||||
Visible='<%# AllowDelete(Eval("ObjectName").ToString(), (int)Eval("ObjectType")) %>' />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
|
|
|
@ -73,7 +73,22 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
|
||||
public bool AllowDelete(string objectName, int objectType)
|
||||
{
|
||||
return objectName == EXCHANGEACCOUNTEMAILADDRESSES;
|
||||
if (objectName == EXCHANGEACCOUNTEMAILADDRESSES)
|
||||
{
|
||||
ExchangeAccountType accountType = (ExchangeAccountType)objectType;
|
||||
switch (accountType)
|
||||
{
|
||||
case ExchangeAccountType.Room:
|
||||
case ExchangeAccountType.Equipment:
|
||||
case ExchangeAccountType.SharedMailbox:
|
||||
case ExchangeAccountType.Mailbox:
|
||||
case ExchangeAccountType.DistributionList:
|
||||
case ExchangeAccountType.PublicFolder:
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
@ -114,7 +129,7 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
return GetThemedImage("Exchange/" + imgName);
|
||||
}
|
||||
|
||||
public string GetEditUrl(string objectName, int objectType, string objectId)
|
||||
public string GetEditUrl(string objectName, int objectType, string objectId, string ownerId)
|
||||
{
|
||||
if (objectName == EXCHANGEACCOUNTS)
|
||||
{
|
||||
|
@ -158,11 +173,33 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
|
||||
if (objectName == EXCHANGEACCOUNTEMAILADDRESSES)
|
||||
{
|
||||
if (objectType>0)
|
||||
return EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "mailbox_addresses",
|
||||
"AccountID=" + objectType,
|
||||
string key = "";
|
||||
|
||||
ExchangeAccountType accountType = (ExchangeAccountType)objectType;
|
||||
|
||||
switch (accountType)
|
||||
{
|
||||
case ExchangeAccountType.Mailbox:
|
||||
case ExchangeAccountType.Room:
|
||||
case ExchangeAccountType.Equipment:
|
||||
case ExchangeAccountType.SharedMailbox:
|
||||
key = "mailbox_addresses";
|
||||
break;
|
||||
case ExchangeAccountType.DistributionList:
|
||||
key = "dlist_addresses";
|
||||
break;
|
||||
case ExchangeAccountType.PublicFolder:
|
||||
key = "public_folder_addresses";
|
||||
break;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(key))
|
||||
{
|
||||
return EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), key,
|
||||
"AccountID=" + ownerId,
|
||||
"ItemID=" + PanelRequest.ItemID);
|
||||
}
|
||||
}
|
||||
|
||||
if (objectName == LYNCUSERS)
|
||||
{
|
||||
|
@ -196,16 +233,40 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
try
|
||||
{
|
||||
string[] arg = e.CommandArgument.ToString().Split(',');
|
||||
if (arg.Length != 2) return;
|
||||
if (arg.Length != 3) return;
|
||||
|
||||
string[] emails = { arg[1] };
|
||||
string[] emails = { arg[2] };
|
||||
|
||||
int accountID = 0;
|
||||
if (!int.TryParse(arg[0], out accountID))
|
||||
return;
|
||||
|
||||
int result = ES.Services.ExchangeServer.DeleteMailboxEmailAddresses(
|
||||
int accountTypeID = 0;
|
||||
if (!int.TryParse(arg[1], out accountTypeID))
|
||||
return;
|
||||
|
||||
ExchangeAccountType accountType = (ExchangeAccountType)accountTypeID;
|
||||
|
||||
int result;
|
||||
|
||||
switch(accountType)
|
||||
{
|
||||
case ExchangeAccountType.Room:
|
||||
case ExchangeAccountType.Equipment:
|
||||
case ExchangeAccountType.SharedMailbox:
|
||||
case ExchangeAccountType.Mailbox:
|
||||
result = ES.Services.ExchangeServer.DeleteMailboxEmailAddresses(
|
||||
PanelRequest.ItemID, accountID, emails);
|
||||
break;
|
||||
case ExchangeAccountType.DistributionList:
|
||||
result = ES.Services.ExchangeServer.DeleteDistributionListEmailAddresses(
|
||||
PanelRequest.ItemID, accountID, emails);
|
||||
break;
|
||||
case ExchangeAccountType.PublicFolder:
|
||||
result = ES.Services.ExchangeServer.DeletePublicFolderEmailAddresses(
|
||||
PanelRequest.ItemID, accountID, emails);
|
||||
break;
|
||||
}
|
||||
|
||||
Bind();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue