diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroupGeneralSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroupGeneralSettings.ascx.cs
index d8f71bf4..1c0d244b 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroupGeneralSettings.ascx.cs
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroupGeneralSettings.ascx.cs
@@ -65,8 +65,6 @@ namespace WebsitePanel.Portal.ExchangeServer
// bind form
txtDisplayName.Text = securityGroup.DisplayName;
- manager.SetAccount(securityGroup.ManagerAccount);
-
members.SetAccounts(securityGroup.MembersAccounts);
txtNotes.Text = securityGroup.Notes;
@@ -75,8 +73,9 @@ namespace WebsitePanel.Portal.ExchangeServer
{
txtDisplayName.ReadOnly = true;
txtNotes.ReadOnly = true;
- manager.Enabled = false;
members.Enabled = false;
+
+ btnSave.Visible = false;
}
}
catch (Exception ex)
@@ -96,7 +95,6 @@ namespace WebsitePanel.Portal.ExchangeServer
PanelRequest.ItemID,
PanelRequest.AccountID,
txtDisplayName.Text,
- manager.GetAccount(),
members.GetAccounts(),
txtNotes.Text);
@@ -120,11 +118,5 @@ namespace WebsitePanel.Portal.ExchangeServer
{
SaveSettings();
}
-
- protected void valManager_ServerValidate(object source, ServerValidateEventArgs args)
- {
- args.IsValid = manager.GetAccount() != null;
-
- }
}
}
\ No newline at end of file
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroupGeneralSettings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroupGeneralSettings.ascx.designer.cs
index 15f2c099..5507f981 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroupGeneralSettings.ascx.designer.cs
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroupGeneralSettings.ascx.designer.cs
@@ -1,3 +1,32 @@
+// 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.
@@ -111,33 +140,6 @@ namespace WebsitePanel.Portal.ExchangeServer {
///
protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireDisplayName;
- ///
- /// locManager control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::System.Web.UI.WebControls.Localize locManager;
-
- ///
- /// manager control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::WebsitePanel.Portal.ExchangeServer.UserControls.UserSelector manager;
-
- ///
- /// valManager control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::System.Web.UI.WebControls.CustomValidator valManager;
-
///
/// locMembers control.
///
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroups.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroups.ascx
index 14eabbc4..13dcbc4c 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroups.ascx
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationSecurityGroups.ascx
@@ -53,7 +53,7 @@
DataSourceID="odsSecurityGroupsPaged" PageSize="20">
-
+
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserMemberOf.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserMemberOf.ascx
index 845db39c..36c12744 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserMemberOf.ascx
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserMemberOf.ascx
@@ -10,7 +10,7 @@
<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %>
<%@ Register Src="UserControls/EmailAddress.ascx" TagName="EmailAddress" TagPrefix="wsp" %>
<%@ Register Src="UserControls/AccountsList.ascx" TagName="AccountsList" TagPrefix="wsp" %>
-<%@ Register Src="UserControls/UsersList.ascx" TagName="UsersList" TagPrefix="wsp" %>
+<%@ Register Src="UserControls/GroupsList.ascx" TagName="GroupsList" TagPrefix="wsp" %>
@@ -63,11 +63,7 @@
-
+
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserMemberOf.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserMemberOf.ascx.cs
index 616eb0b4..cf175d4a 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserMemberOf.ascx.cs
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserMemberOf.ascx.cs
@@ -58,10 +58,17 @@ namespace WebsitePanel.Portal.HostedSolution
// title
litDisplayName.Text = mailbox.DisplayName;
-
+
+ //Distribution Lists
ExchangeAccount[] dLists = ES.Services.ExchangeServer.GetDistributionListsByMember(PanelRequest.ItemID, PanelRequest.AccountID);
distrlists.SetAccounts(dLists);
+
+ //Security Groups
+ ExchangeAccount[] securGroups = ES.Services.Organizations.GetSecurityGroupsByMember(PanelRequest.ItemID, PanelRequest.AccountID);
+
+ securegroups.SetAccounts(securGroups);
+
}
catch (Exception ex)
{
@@ -76,6 +83,7 @@ namespace WebsitePanel.Portal.HostedSolution
try
{
+ //Distribution Lists
ExchangeAccount[] oldDistributionLists = ES.Services.ExchangeServer.GetDistributionListsByMember(PanelRequest.ItemID, PanelRequest.AccountID);
List newDistributionLists = new List(distrlists.GetAccounts());
foreach (ExchangeAccount oldlist in oldDistributionLists)
@@ -89,7 +97,29 @@ namespace WebsitePanel.Portal.HostedSolution
foreach (string newlist in newDistributionLists)
ES.Services.ExchangeServer.AddDistributionListMember(PanelRequest.ItemID, newlist, PanelRequest.AccountID);
+ //Security Groups
+ ExchangeAccount[] oldDSecurityGroups = ES.Services.Organizations.GetSecurityGroupsByMember(PanelRequest.ItemID, PanelRequest.AccountID);
+ List newSecurityGroups = new List(securegroups.GetAccounts());
+ foreach (ExchangeAccount oldgroup in oldDSecurityGroups)
+ {
+ if (newSecurityGroups.Contains(oldgroup.AccountName))
+ {
+ newSecurityGroups.Remove(oldgroup.AccountName);
+ }
+ else
+ {
+ ES.Services.Organizations.DeleteUserFromSecurityGroup(PanelRequest.ItemID, PanelRequest.AccountID, oldgroup.AccountName);
+ }
+ }
+
+ foreach (string newgroup in newSecurityGroups)
+ {
+ ES.Services.Organizations.AddUserToSecurityGroup(PanelRequest.ItemID, PanelRequest.AccountID, newgroup);
+ }
+
messageBox.ShowSuccessMessage("EXCHANGE_UPDATE_MAILBOX_SETTINGS");
+
+
BindSettings();
}
catch (Exception ex)
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserMemberOf.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserMemberOf.ascx.designer.cs
index 0de5ac65..07a67d81 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserMemberOf.ascx.designer.cs
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserMemberOf.ascx.designer.cs
@@ -1,3 +1,32 @@
+// 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.
@@ -163,7 +192,7 @@ namespace WebsitePanel.Portal.HostedSolution {
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///
- protected global::WebsitePanel.Portal.ExchangeServer.UserControls.AccountsList securegroups;
+ protected global::WebsitePanel.Portal.ExchangeServer.UserControls.GroupsList securegroups;
///
/// btnSave control.
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/GroupsList.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/GroupsList.ascx.resx
new file mode 100644
index 00000000..58447d25
--- /dev/null
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/GroupsList.ascx.resx
@@ -0,0 +1,147 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ Add...
+
+
+ Add Groups
+
+
+ Cancel
+
+
+ Delete
+
+
+ Display Name
+
+
+ The list of groups is empty. Click "Add..." button to add groups.
+
+
+ Display Name
+
+
+ No groups found.
+
+
+ Groups
+
+
\ No newline at end of file
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/GroupsList.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/GroupsList.ascx
new file mode 100644
index 00000000..185955d8
--- /dev/null
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/GroupsList.ascx
@@ -0,0 +1,105 @@
+<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="GroupsList.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.UserControls.GroupsList" %>
+<%@ Register Src="../../UserControls/PopupHeader.ascx" TagName="PopupHeader" TagPrefix="wsp" %>
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/GroupsList.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/GroupsList.ascx.cs
new file mode 100644
index 00000000..85508aec
--- /dev/null
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/GroupsList.ascx.cs
@@ -0,0 +1,197 @@
+// 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.Collections.Generic;
+using System.Web.UI;
+using System.Web.UI.WebControls;
+using WebsitePanel.Providers.HostedSolution;
+using System.Linq;
+
+namespace WebsitePanel.Portal.ExchangeServer.UserControls
+{
+ public partial class GroupsList : WebsitePanelControlBase
+ {
+ private enum SelectedState
+ {
+ All,
+ Selected,
+ Unselected
+ }
+
+ public void SetAccounts(ExchangeAccount[] accounts)
+ {
+ BindAccounts(accounts, false);
+ }
+
+ public string[] GetAccounts()
+ {
+ // get selected accounts
+ List selectedAccounts = GetGridViewAccounts(gvGroups, SelectedState.All);
+
+ List accountNames = new List();
+ foreach (ExchangeAccount account in selectedAccounts)
+ accountNames.Add(account.AccountName);
+
+ return accountNames.ToArray();
+ }
+
+ protected void Page_Load(object sender, EventArgs e)
+ {
+ // register javascript
+ if (!Page.ClientScript.IsClientScriptBlockRegistered("SelectAllCheckboxes"))
+ {
+ string script = @" function SelectAllCheckboxes(box)
+ {
+ var state = box.checked;
+ var elm = box.parentElement.parentElement.parentElement.parentElement.getElementsByTagName(""INPUT"");
+ for(i = 0; i < elm.length; i++)
+ if(elm[i].type == ""checkbox"" && elm[i].id != box.id && elm[i].checked != state && !elm[i].disabled)
+ elm[i].checked = state;
+ }";
+ Page.ClientScript.RegisterClientScriptBlock(typeof(AccountsList), "SelectAllCheckboxes",
+ script, true);
+ }
+ }
+
+ public string GetAccountImage(int accountTypeId)
+ {
+ ExchangeAccountType accountType = (ExchangeAccountType)accountTypeId;
+ string imgName = "dlist_16.gif";
+
+ return GetThemedImage("Exchange/" + imgName);
+ }
+
+ protected void btnAdd_Click(object sender, EventArgs e)
+ {
+ // bind all accounts
+ BindPopupAccounts();
+
+ // show modal
+ AddGroupsModal.Show();
+ }
+
+ protected void btnDelete_Click(object sender, EventArgs e)
+ {
+ // get selected accounts
+ List selectedAccounts = GetGridViewAccounts(gvGroups, SelectedState.Unselected);
+
+ // add to the main list
+ BindAccounts(selectedAccounts.ToArray(), false);
+ }
+
+ protected void btnAddSelected_Click(object sender, EventArgs e)
+ {
+ // get selected accounts
+ List selectedAccounts = GetGridViewAccounts(gvPopupGroups, SelectedState.Selected);
+
+ // add to the main list
+ BindAccounts(selectedAccounts.ToArray(), true);
+ }
+
+ private void BindPopupAccounts()
+ {
+ ExchangeAccount[] accounts = ES.Services.Organizations.SearchSecurityGroups(PanelRequest.ItemID,
+ ddlSearchColumn.SelectedValue, txtSearchValue.Text + "%", "");
+
+ accounts = accounts.Where(x => !GetAccounts().Contains(x.AccountName)).ToArray();
+
+ gvPopupGroups.DataSource = accounts;
+ gvPopupGroups.DataBind();
+ }
+
+ private void BindAccounts(ExchangeAccount[] newAccounts, bool preserveExisting)
+ {
+ // get binded addresses
+ List accounts = new List();
+ if(preserveExisting)
+ accounts.AddRange(GetGridViewAccounts(gvGroups, SelectedState.All));
+
+ // add new accounts
+ if (newAccounts != null)
+ {
+ foreach (ExchangeAccount newAccount in newAccounts)
+ {
+ // check if exists
+ bool exists = false;
+ foreach (ExchangeAccount account in accounts)
+ {
+ if (String.Compare(newAccount.AccountName, account.AccountName, true) == 0)
+ {
+ exists = true;
+ break;
+ }
+ }
+
+ if (exists)
+ continue;
+
+ accounts.Add(newAccount);
+ }
+ }
+
+ gvGroups.DataSource = accounts;
+ gvGroups.DataBind();
+
+ btnDelete.Visible = gvGroups.Rows.Count > 0;
+ }
+
+ private List GetGridViewAccounts(GridView gv, SelectedState state)
+ {
+ List accounts = new List();
+ for (int i = 0; i < gv.Rows.Count; i++)
+ {
+ GridViewRow row = gv.Rows[i];
+ CheckBox chkSelect = (CheckBox)row.FindControl("chkSelect");
+ if (chkSelect == null)
+ continue;
+
+ ExchangeAccount account = new ExchangeAccount();
+ account.AccountType = (ExchangeAccountType)Enum.Parse(typeof(ExchangeAccountType), ((Literal)row.FindControl("litAccountType")).Text);
+ account.AccountName = (string)gv.DataKeys[i][0];
+ account.DisplayName = ((Literal)row.FindControl("litDisplayName")).Text;
+
+ if(state == SelectedState.All ||
+ (state == SelectedState.Selected && chkSelect.Checked) ||
+ (state == SelectedState.Unselected && !chkSelect.Checked))
+ accounts.Add(account);
+ }
+ return accounts;
+ }
+
+ protected void chkIncludeMailboxes_CheckedChanged(object sender, EventArgs e)
+ {
+ BindPopupAccounts();
+ }
+
+ protected void cmdSearch_Click(object sender, ImageClickEventArgs e)
+ {
+ BindPopupAccounts();
+ }
+ }
+}
\ No newline at end of file
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/GroupsList.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/GroupsList.ascx.designer.cs
new file mode 100644
index 00000000..b23a8c5d
--- /dev/null
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/GroupsList.ascx.designer.cs
@@ -0,0 +1,188 @@
+// 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.
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace WebsitePanel.Portal.ExchangeServer.UserControls {
+
+
+ public partial class GroupsList {
+
+ ///
+ /// GroupsUpdatePanel control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.UpdatePanel GroupsUpdatePanel;
+
+ ///
+ /// btnAdd control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Button btnAdd;
+
+ ///
+ /// btnDelete control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Button btnDelete;
+
+ ///
+ /// gvGroups control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.GridView gvGroups;
+
+ ///
+ /// AddGroupsPanel control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Panel AddGroupsPanel;
+
+ ///
+ /// headerAddGroups control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Localize headerAddGroups;
+
+ ///
+ /// AddGroupsUpdatePanel control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.UpdatePanel AddGroupsUpdatePanel;
+
+ ///
+ /// SearchPanel control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Panel SearchPanel;
+
+ ///
+ /// ddlSearchColumn control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.DropDownList ddlSearchColumn;
+
+ ///
+ /// txtSearchValue control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.TextBox txtSearchValue;
+
+ ///
+ /// cmdSearch control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.ImageButton cmdSearch;
+
+ ///
+ /// gvPopupGroups control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.GridView gvPopupGroups;
+
+ ///
+ /// btnAddSelected control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Button btnAddSelected;
+
+ ///
+ /// btnCancelAdd control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Button btnCancelAdd;
+
+ ///
+ /// btnAddAccountsFake control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Button btnAddAccountsFake;
+
+ ///
+ /// AddGroupsModal control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::AjaxControlToolkit.ModalPopupExtender AddGroupsModal;
+ }
+}
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserSelector.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserSelector.ascx
index 5912e0e5..de8190df 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserSelector.ascx
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserSelector.ascx
@@ -4,10 +4,9 @@
-<% if (Enabled) { %>
+
-<% } %>
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserSelector.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserSelector.ascx.cs
index c9d5788b..da7d0b53 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserSelector.ascx.cs
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UserSelector.ascx.cs
@@ -38,14 +38,6 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls
{
public const string DirectionString = "DirectionString";
- private bool _enabled = true;
-
- public bool Enabled
- {
- get { return _enabled; }
- set { _enabled = value; }
- }
-
public bool IncludeMailboxes
{
get
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UsersList.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UsersList.ascx.cs
index d518459a..b8311fd5 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UsersList.ascx.cs
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/UsersList.ascx.cs
@@ -31,6 +31,7 @@ using System.Collections.Generic;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebsitePanel.Providers.HostedSolution;
+using System.Linq;
namespace WebsitePanel.Portal.ExchangeServer.UserControls
{
@@ -218,6 +219,10 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls
OrganizationUser[] accounts = ES.Services.Organizations.SearchAccounts(PanelRequest.ItemID,
ddlSearchColumn.SelectedValue, txtSearchValue.Text + "%", "", IncludeMailboxes);
+ List newAccounts = new List();
+
+ accounts = accounts.Where(x => !GetAccounts().Contains(x.AccountName)).ToArray();
+
if (ExcludeAccountId > 0)
{
List updatedAccounts = new List();
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj
index 268e89bb..4b8e408a 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj
@@ -283,6 +283,13 @@
AccountsListWithPermissions.ascxASPXCodeBehind
+
+ GroupsList.ascx
+ ASPXCodeBehind
+
+
+ GroupsList.ascx
+ MailboxPlanSelector.ascxASPXCodeBehind
@@ -397,7 +404,6 @@
EnterpriseStorage_Settings.ascx
- ASPXCodeBehindEnterpriseStorage_Settings.ascx
@@ -3984,6 +3990,7 @@
+
@@ -5197,6 +5204,9 @@
+
+ Designer
+ Designer