add "security groups" functional excepting "users memberof"

This commit is contained in:
vfedosevich 2013-08-22 19:22:35 +03:00
parent 52cf12187f
commit 4eff42511b
25 changed files with 468 additions and 163 deletions

View file

@ -135,9 +135,6 @@
<data name="ddlSearchColumnDisplayName.Text" xml:space="preserve">
<value>Display Name</value>
</data>
<data name="ddlSearchColumnEmail.Text" xml:space="preserve">
<value>E-mail Address</value>
</data>
<data name="FormComments.Text" xml:space="preserve">
<value />
</data>

View file

@ -1,6 +1,5 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="OrganizationSecurityGroupGeneralSettings.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.OrganizationSecurityGroupGeneralSettings" %>
<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %>
<%--<%@ Register Src="UserControls/AccountsList.ascx" TagName="AccountsList" TagPrefix="wsp" %>--%>
<%@ Register Src="UserControls/UsersList.ascx" TagName="UsersList" TagPrefix="wsp"%>
<%@ Register Src="UserControls/UserSelector.ascx" TagName="UserSelector" TagPrefix="wsp" %>
<%@ Register Src="UserControls/SecurityGroupTabs.ascx" TagName="SecurityGroupTabs" TagPrefix="wsp"%>
@ -17,13 +16,13 @@
<wsp:Breadcrumb id="breadcrumb" runat="server" PageName="Text.PageName" />
</div>
<div class="Left">
<wsp:Menu id="menu" runat="server" SelectedItem="dlists" />
<wsp:Menu id="menu" runat="server" SelectedItem="secur_groups" />
</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:Localize ID="locTitle" runat="server" meta:resourcekey="locTitle" Text="Edit Security Group"></asp:Localize>
<asp:Literal ID="litDisplayName" runat="server" Text="John Smith" />
</div>

View file

@ -70,10 +70,18 @@ namespace WebsitePanel.Portal.ExchangeServer
members.SetAccounts(securityGroup.MembersAccounts);
txtNotes.Text = securityGroup.Notes;
if (securityGroup.IsDefault)
{
txtDisplayName.ReadOnly = true;
txtNotes.ReadOnly = true;
manager.Enabled = false;
members.Enabled = false;
}
}
catch (Exception ex)
{
messageBox.ShowErrorMessage("EXCHANGE_GET_DLIST_SETTINGS", ex);
messageBox.ShowErrorMessage("ORGANIZATION_GET_SECURITY_GROUP_SETTINGS", ex);
}
}
@ -84,15 +92,12 @@ namespace WebsitePanel.Portal.ExchangeServer
try
{
int result = ES.Services.ExchangeServer.SetDistributionListGeneralSettings(
PanelRequest.ItemID, PanelRequest.AccountID,
int result = ES.Services.Organizations.SetSecurityGroupGeneralSettings(
PanelRequest.ItemID,
PanelRequest.AccountID,
txtDisplayName.Text,
false,
manager.GetAccount(),
members.GetAccounts(),
txtNotes.Text);
if (result < 0)
@ -103,11 +108,11 @@ namespace WebsitePanel.Portal.ExchangeServer
litDisplayName.Text = PortalAntiXSS.Encode(txtDisplayName.Text);
messageBox.ShowSuccessMessage("EXCHANGE_UPDATE_DLIST_SETTINGS");
messageBox.ShowSuccessMessage("ORGANIZATION_UPDATE_SECURITY_GROUP_SETTINGS");
}
catch (Exception ex)
{
messageBox.ShowErrorMessage("EXCHANGE_UPDATE_DLIST_SETTINGS", ex);
messageBox.ShowErrorMessage("ORGANIZATION_UPDATE_SECURITY_GROUP_SETTINGS", ex);
}
}

View file

@ -2,7 +2,6 @@
<%@ 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"/>
@ -13,13 +12,13 @@
<wsp:Breadcrumb id="breadcrumb" runat="server" PageName="Text.PageName" />
</div>
<div class="Left">
<wsp:Menu id="menu" runat="server" SelectedItem="dlists" />
<wsp:Menu id="menu" runat="server" SelectedItem="secur_groups" />
</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>
<asp:Localize ID="locTitle" runat="server" meta:resourcekey="locTitle" Text="Groups"></asp:Localize>
</div>
<div class="FormBody">
@ -42,7 +41,6 @@
<asp:DropDownList ID="ddlSearchColumn" runat="server" CssClass="NormalTextBox">
<asp:ListItem Value="DisplayName" meta:resourcekey="ddlSearchColumnDisplayName">DisplayName</asp:ListItem>
<asp:ListItem Value="PrimaryEmailAddress" meta:resourcekey="ddlSearchColumnEmail">Email</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>
@ -51,7 +49,7 @@
<asp:GridView ID="gvGroups" runat="server" AutoGenerateColumns="False" EnableViewState="true"
Width="100%" EmptyDataText="gvGroups" CssSelectorClass="NormalGridView"
OnRowCommand="gvLists_RowCommand" AllowPaging="True" AllowSorting="True"
OnRowCommand="gvSecurityGroups_RowCommand" AllowPaging="True" AllowSorting="True"
DataSourceID="odsSecurityGroupsPaged" PageSize="20">
<Columns>
<asp:TemplateField HeaderText="gvGroupsDisplayName" SortExpression="DisplayName">
@ -66,7 +64,7 @@
<asp:TemplateField>
<ItemTemplate>
<asp:ImageButton ID="cmdDelete" runat="server" Text="Delete" SkinID="ExchangeDelete"
CommandName="DeleteItem" CommandArgument='<%# Eval("AccountId") %>'
CommandName="DeleteItem" CommandArgument='<%# Eval("AccountId") %>' Visible='<%# IsNotDefault(Eval("AccountType").ToString()) %>'
meta:resourcekey="cmdDelete" OnClientClick="return confirm('Remove this item?');"></asp:ImageButton>
</ItemTemplate>
</asp:TemplateField>
@ -80,7 +78,7 @@
OnSelected="odsSecurityGroupsPaged_Selected">
<SelectParameters>
<asp:QueryStringParameter Name="itemId" QueryStringField="ItemID" DefaultValue="0" />
<asp:Parameter Name="accountTypes" DefaultValue="3" />
<asp:Parameter Name="accountTypes" DefaultValue="8" />
<asp:ControlParameter Name="filterColumn" ControlID="ddlSearchColumn" PropertyName="SelectedValue" />
<asp:ControlParameter Name="filterValue" ControlID="txtSearchValue" PropertyName="Text" />
</SelectParameters>

View file

@ -46,14 +46,7 @@ namespace WebsitePanel.Portal.ExchangeServer
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindStats();
}
}
private void BindStats()
{
}
protected void btnCreateGroup_Click(object sender, EventArgs e)
@ -69,6 +62,11 @@ namespace WebsitePanel.Portal.ExchangeServer
"ItemID=" + PanelRequest.ItemID.ToString());
}
public bool IsNotDefault(string accountType)
{
return (ExchangeAccountType)Enum.Parse(typeof(ExchangeAccountType), accountType) != ExchangeAccountType.DefaultSecurityGroup;
}
protected void odsSecurityGroupsPaged_Selected(object sender, ObjectDataSourceStatusEventArgs e)
{
if (e.Exception != null)
@ -78,7 +76,7 @@ namespace WebsitePanel.Portal.ExchangeServer
}
}
protected void gvLists_RowCommand(object sender, GridViewCommandEventArgs e)
protected void gvSecurityGroups_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "DeleteItem")
{
@ -96,8 +94,6 @@ namespace WebsitePanel.Portal.ExchangeServer
// rebind grid
gvGroups.DataBind();
BindStats();
}
catch (Exception ex)
{
@ -112,10 +108,7 @@ namespace WebsitePanel.Portal.ExchangeServer
// rebind grid
gvGroups.DataBind();
// bind stats
BindStats();
}
}
}

View file

@ -10,6 +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" %>
@ -42,9 +43,9 @@
<uc1:MailboxTabs ID="MailboxTabsId" runat="server" SelectedTab="user_memberof" />
<wsp:SimpleMessageBox id="messageBox" runat="server" />
<wsp:CollapsiblePanel id="secDistributionLists" runat="server" TargetControlID="DistributionLists" meta:resourcekey="secDistributionLists" Text="Distribution Lists"></wsp:CollapsiblePanel>
<asp:Panel ID="DistributionLists" runat="server" Height="0" style="overflow:hidden;">
<asp:UpdatePanel ID="GeneralUpdatePanel" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
<wsp:CollapsiblePanel id="secDistributionLists" runat="server" TargetControlID="DistributionListsPanel" meta:resourcekey="secDistributionLists" Text="Distribution Lists"></wsp:CollapsiblePanel>
<asp:Panel ID="DistributionListsPanel" runat="server" Height="0" style="overflow:hidden;">
<asp:UpdatePanel ID="DLGeneralUpdatePanel" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
<ContentTemplate>
<wsp:AccountsList id="distrlists" runat="server"
@ -57,6 +58,20 @@
</asp:UpdatePanel>
</asp:Panel>
<wsp:CollapsiblePanel id="secSecurityGroups" runat="server" TargetControlID="SecurityGroupsPanel" meta:resourcekey="secSecurityGroups" Text="Security Groups"></wsp:CollapsiblePanel>
<asp:Panel ID="SecurityGroupsPanel" runat="server" Height="0" style="overflow:hidden;">
<asp:UpdatePanel ID="SCGeneralUpdatePanel" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
<ContentTemplate>
<wsp:AccountsList id="securegroups" runat="server"
MailboxesEnabled="false"
EnableMailboxOnly="false"
ContactsEnabled="false"
DistributionListsEnabled="false" />
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
<div class="FormFooterClean">
<asp:Button id="btnSave" runat="server" Text="Save Changes" CssClass="Button1"

View file

@ -62,7 +62,6 @@ namespace WebsitePanel.Portal.HostedSolution
ExchangeAccount[] dLists = ES.Services.ExchangeServer.GetDistributionListsByMember(PanelRequest.ItemID, PanelRequest.AccountID);
distrlists.SetAccounts(dLists);
}
catch (Exception ex)
{

View file

@ -103,22 +103,22 @@ namespace WebsitePanel.Portal.HostedSolution {
protected global::WebsitePanel.Portal.CollapsiblePanel secDistributionLists;
/// <summary>
/// DistributionLists control.
/// DistributionListsPanel 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.Panel DistributionLists;
protected global::System.Web.UI.WebControls.Panel DistributionListsPanel;
/// <summary>
/// GeneralUpdatePanel control.
/// DLGeneralUpdatePanel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.UpdatePanel GeneralUpdatePanel;
protected global::System.Web.UI.UpdatePanel DLGeneralUpdatePanel;
/// <summary>
/// distrlists control.
@ -129,6 +129,42 @@ namespace WebsitePanel.Portal.HostedSolution {
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.AccountsList distrlists;
/// <summary>
/// secSecurityGroups control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.CollapsiblePanel secSecurityGroups;
/// <summary>
/// SecurityGroupsPanel 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.Panel SecurityGroupsPanel;
/// <summary>
/// SCGeneralUpdatePanel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.UpdatePanel SCGeneralUpdatePanel;
/// <summary>
/// securegroups 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.AccountsList securegroups;
/// <summary>
/// btnSave control.
/// </summary>

View file

@ -4,8 +4,10 @@
<ContentTemplate>
<asp:TextBox ID="txtDisplayName" runat="server" CssClass="TextBox200" ReadOnly="true"></asp:TextBox>
<% if (Enabled) { %>
<asp:ImageButton ID="ImageButton1" SkinID="ExchangeAddressBook16" runat="server" CausesValidation="false" OnClick="ImageButton1_Click" />
<asp:LinkButton ID="cmdClear" runat="server" meta:resourcekey="cmdClear" OnClick="cmdClear_Click" CausesValidation="False"></asp:LinkButton>
<% } %>
<asp:Panel ID="AddAccountsPanel" runat="server" CssClass="Popup" style="display:none">
<table class="Popup-Header" cellpadding="0" cellspacing="0">

View file

@ -38,6 +38,14 @@ 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

View file

@ -59,7 +59,7 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls
PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId);
if (Utils.CheckQouta(Quotas.EXCHANGE2007_DISTRIBUTIONLISTS, cntx))
if (Utils.CheckQouta(Quotas.ORGANIZATION_SECURITYGROUPMANAGEMENT, cntx) || Utils.CheckQouta(Quotas.EXCHANGE2007_DISTRIBUTIONLISTS, cntx))
tabsList.Add(CreateTab("user_memberof", "Tab.MemberOf"));
// find selected menu item

View file

@ -3,9 +3,8 @@
<asp:UpdatePanel ID="AccountsUpdatePanel" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
<ContentTemplate>
<div class="FormButtonsBarClean">
<asp:Button ID="btnAdd" runat="server" Text="Add..." CssClass="Button1" OnClick="btnAdd_Click" meta:resourcekey="btnAdd" />
<asp:Button ID="btnAdd" runat="server" Text="Add..." CssClass="Button1" OnClick="btnAdd_Click" meta:resourcekey="btnAdd" />
<asp:Button ID="btnDelete" runat="server" Text="Delete" CssClass="Button1" OnClick="btnDelete_Click" meta:resourcekey="btnDelete"/>
</div>
<asp:GridView ID="gvAccounts" runat="server" meta:resourcekey="gvAccounts" AutoGenerateColumns="False"

View file

@ -38,6 +38,14 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls
{
public const string DirectionString = "DirectionString";
private bool _enabled = true;
public bool Enabled
{
get { return _enabled; }
set { _enabled = value; }
}
private enum SelectedState
{
All,
@ -150,6 +158,11 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls
Page.ClientScript.RegisterClientScriptBlock(typeof(AccountsList), "SelectAllCheckboxes",
script, true);
}
btnAdd.Visible = Enabled;
btnDelete.Visible = Enabled;
gvAccounts.Columns[0].Visible = Enabled;
}
protected void btnAdd_Click(object sender, EventArgs e)
@ -279,7 +292,7 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls
bool exists = false;
foreach (OrganizationUser account in accounts)
{
if (String.Compare(newAccount.SamAccountName, account.SamAccountName, true) == 0)
if (String.Compare(newAccount.AccountName, account.AccountName, true) == 0)
{
exists = true;
break;

View file

@ -299,9 +299,10 @@
</Compile>
<Compile Include="ExchangeServer\UserControls\UsersList.ascx.cs">
<SubType>ASPXCodeBehind</SubType>
<DependentUpon>UsersList.ascx</DependentUpon>
</Compile>
<Compile Include="ExchangeServer\UserControls\UsersList.ascx.designer.cs">
<DependentUpon>UsersList.ascx.cs</DependentUpon>
<DependentUpon>UsersList.ascx</DependentUpon>
</Compile>
<Compile Include="ExchangeServer\UserControls\UserTabs.ascx.cs">
<DependentUpon>UserTabs.ascx</DependentUpon>
@ -3928,6 +3929,7 @@
<Content Include="ExchangeServer\OrganizationSecurityGroups.ascx" />
<Content Include="ExchangeServer\OrganizationUserMemberOf.ascx" />
<Content Include="ExchangeServer\UserControls\SecurityGroupTabs.ascx" />
<Content Include="ExchangeServer\UserControls\UsersList.ascx" />
<Content Include="Lync\UserControls\LyncUserSettings.ascx" />
<Content Include="ProviderControls\CRM2011_Settings.ascx" />
<Content Include="ProviderControls\HeliconZoo_Settings.ascx" />