From 4b631cff90370c613b8cfce60ba87dc51f22f452 Mon Sep 17 00:00:00 2001 From: robvde Date: Wed, 28 Nov 2012 08:25:53 +0400 Subject: [PATCH] Fixed: MailboxEmailAddresses unable to select userprincipalName Fixed: MailboxEmailAddresses after trying to delete userPrincipalName, warning displayed --- .../WebsitePanel.EnterpriseServer/Web.config | 24 ++++++++++------ .../WebsitePanel_SharedResources.ascx.resx | 4 +++ .../ExchangeMailboxEmailAddresses.ascx | 2 +- .../ExchangeMailboxEmailAddresses.ascx.cs | 22 +++++++++++++++ ...angeMailboxEmailAddresses.ascx.designer.cs | 28 ------------------- 5 files changed, 43 insertions(+), 37 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config index 3766094f..ac809ac4 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Web.config @@ -4,14 +4,22 @@
- - - - - - - - + + + + + + + + + + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx index e5ac1de2..f90f4aca 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx @@ -3336,6 +3336,10 @@ Please select E-mail address you want to delete from Distribution List + + Please note not all email address are deleted + + There are no public folders to delete diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxEmailAddresses.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxEmailAddresses.ascx index 6f74c098..19fd2a07 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxEmailAddresses.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxEmailAddresses.ascx @@ -73,7 +73,7 @@ - + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxEmailAddresses.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxEmailAddresses.ascx.cs index 816e6d19..b0d31a98 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxEmailAddresses.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxEmailAddresses.ascx.cs @@ -163,13 +163,30 @@ namespace WebsitePanel.Portal.ExchangeServer { // get selected e-mail addresses List emails = new List(); + bool containsUPN = false; + EntServer.ExchangeEmailAddress[] tmpEmails = ES.Services.ExchangeServer.GetMailboxEmailAddresses( PanelRequest.ItemID, PanelRequest.AccountID); + for (int i = 0; i < gvEmails.Rows.Count; i++) { GridViewRow row = gvEmails.Rows[i]; CheckBox chkSelect = (CheckBox)row.FindControl("chkSelect"); if (chkSelect.Checked) + { emails.Add(gvEmails.DataKeys[i].Value.ToString()); + foreach (EntServer.ExchangeEmailAddress tmpEmail in tmpEmails) + { + if (gvEmails.DataKeys[i].Value.ToString() == tmpEmail.EmailAddress) + { + if (tmpEmail.IsUserPrincipalName) + { + containsUPN = true; + break; + } + + } + } + } } if (emails.Count == 0) @@ -187,6 +204,11 @@ namespace WebsitePanel.Portal.ExchangeServer messageBox.ShowResultMessage(result); return; } + else + { + if (containsUPN) + messageBox.ShowWarningMessage("NOT_ALL_EMAIL_ADDRESSES_DELETED"); + } // rebind BindEmails(); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxEmailAddresses.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxEmailAddresses.ascx.designer.cs index 4f605860..b9a27568 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxEmailAddresses.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxEmailAddresses.ascx.designer.cs @@ -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. - //------------------------------------------------------------------------------ // // This code was generated by a tool.