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,
|
'ExchangeAccounts' as ObjectName,
|
||||||
AccountID as ObjectID,
|
AccountID as ObjectID,
|
||||||
AccountType as ObjectType,
|
AccountType as ObjectType,
|
||||||
DisplayName as DisplayName
|
DisplayName as DisplayName,
|
||||||
|
0 as OwnerID
|
||||||
FROM
|
FROM
|
||||||
ExchangeAccounts
|
ExchangeAccounts
|
||||||
WHERE
|
WHERE
|
||||||
|
@ -7122,8 +7123,9 @@ UNION
|
||||||
SELECT
|
SELECT
|
||||||
'ExchangeAccountEmailAddresses' as ObjectName,
|
'ExchangeAccountEmailAddresses' as ObjectName,
|
||||||
eam.AddressID as ObjectID,
|
eam.AddressID as ObjectID,
|
||||||
eam.AccountID as ObjectType,
|
ea.AccountType as ObjectType,
|
||||||
eam.EmailAddress as DisplayName
|
eam.EmailAddress as DisplayName,
|
||||||
|
eam.AccountID as OwnerID
|
||||||
FROM
|
FROM
|
||||||
ExchangeAccountEmailAddresses as eam
|
ExchangeAccountEmailAddresses as eam
|
||||||
INNER JOIN
|
INNER JOIN
|
||||||
|
@ -7139,7 +7141,8 @@ SELECT
|
||||||
'LyncUsers' as ObjectName,
|
'LyncUsers' as ObjectName,
|
||||||
ea.AccountID as ObjectID,
|
ea.AccountID as ObjectID,
|
||||||
ea.AccountType as ObjectType,
|
ea.AccountType as ObjectType,
|
||||||
ea.DisplayName as DisplayName
|
ea.DisplayName as DisplayName,
|
||||||
|
0 as OwnerID
|
||||||
FROM
|
FROM
|
||||||
ExchangeAccounts ea
|
ExchangeAccounts ea
|
||||||
INNER JOIN
|
INNER JOIN
|
||||||
|
|
|
@ -32,7 +32,7 @@
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:Image ID="img1" runat="server" ImageUrl='<%# GetObjectImage(Eval("ObjectName").ToString(),(int)Eval("ObjectType")) %>' ImageAlign="AbsMiddle" />
|
<asp:Image ID="img1" runat="server" ImageUrl='<%# GetObjectImage(Eval("ObjectName").ToString(),(int)Eval("ObjectType")) %>' ImageAlign="AbsMiddle" />
|
||||||
<asp:hyperlink id="lnk1" runat="server"
|
<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") %>
|
<%# Eval("DisplayName") %>
|
||||||
</asp:hyperlink>
|
</asp:hyperlink>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
|
@ -48,7 +48,7 @@
|
||||||
<ItemStyle Width="10%"></ItemStyle>
|
<ItemStyle Width="10%"></ItemStyle>
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:hyperlink id="lnk2" runat="server"
|
<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:Literal id="lnkView" runat="server" Text="View" meta:resourcekey="lnkView" />
|
||||||
</asp:hyperlink>
|
</asp:hyperlink>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
|
@ -59,7 +59,7 @@
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:LinkButton id="lnkDelete" runat="server" Text="Delete" meta:resourcekey="lnkDelete"
|
<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 ...');"
|
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")) %>' />
|
Visible='<%# AllowDelete(Eval("ObjectName").ToString(), (int)Eval("ObjectType")) %>' />
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
|
|
|
@ -73,7 +73,22 @@ namespace WebsitePanel.Portal.ExchangeServer
|
||||||
|
|
||||||
public bool AllowDelete(string objectName, int objectType)
|
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);
|
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)
|
if (objectName == EXCHANGEACCOUNTS)
|
||||||
{
|
{
|
||||||
|
@ -158,11 +173,33 @@ namespace WebsitePanel.Portal.ExchangeServer
|
||||||
|
|
||||||
if (objectName == EXCHANGEACCOUNTEMAILADDRESSES)
|
if (objectName == EXCHANGEACCOUNTEMAILADDRESSES)
|
||||||
{
|
{
|
||||||
if (objectType>0)
|
string key = "";
|
||||||
return EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "mailbox_addresses",
|
|
||||||
"AccountID=" + objectType,
|
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);
|
"ItemID=" + PanelRequest.ItemID);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (objectName == LYNCUSERS)
|
if (objectName == LYNCUSERS)
|
||||||
{
|
{
|
||||||
|
@ -196,16 +233,40 @@ namespace WebsitePanel.Portal.ExchangeServer
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string[] arg = e.CommandArgument.ToString().Split(',');
|
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;
|
int accountID = 0;
|
||||||
if (!int.TryParse(arg[0], out accountID))
|
if (!int.TryParse(arg[0], out accountID))
|
||||||
return;
|
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);
|
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();
|
Bind();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue