Merge
This commit is contained in:
commit
6efa554058
21 changed files with 289 additions and 335 deletions
|
@ -1058,7 +1058,7 @@ namespace WebsitePanel.EnterpriseServer
|
|||
var accountNames = users.Select(x => x.AccountName).ToList();
|
||||
|
||||
//Set on server
|
||||
rds.SetUsersInCollection(org.OrganizationId, collection.Name, users.Select(x => x.SamAccountName).ToArray());
|
||||
rds.SetUsersInCollection(org.OrganizationId, collection.Name, users.Select(x => x.AccountName).ToArray());
|
||||
|
||||
//Remove from db
|
||||
foreach (var userInDb in usersInDb)
|
||||
|
|
|
@ -381,7 +381,10 @@ namespace WebsitePanel.EnterpriseServer
|
|||
site.PerlInstalled = Utils.ParseBool(webPolicy["PerlInstalled"], false);
|
||||
site.PythonInstalled = Utils.ParseBool(webPolicy["PythonInstalled"], false);
|
||||
site.CgiBinInstalled = Utils.ParseBool(webPolicy["CgiBinInstalled"], false);
|
||||
site.ColdFusionInstalled = false;
|
||||
QuotaValueInfo quotaInfoCF = PackageController.GetPackageQuota(packageId, Quotas.WEB_COLDFUSION);
|
||||
site.ColdFusionInstalled = (quotaInfoCF.QuotaAllocatedValue > 0) && Utils.ParseBool(webPolicy["ColdFusionInstalled"], false);
|
||||
QuotaValueInfo quotaInfoCFV = PackageController.GetPackageQuota(packageId, Quotas.WEB_CFVIRTUALDIRS);
|
||||
site.CreateCFVirtualDirectoriesPol = (quotaInfoCFV.QuotaAllocatedValue > 0) && Utils.ParseBool(webPolicy["CreateCFVirtualDirectoriesPol"], false);
|
||||
|
||||
}
|
||||
else
|
||||
|
@ -404,6 +407,7 @@ namespace WebsitePanel.EnterpriseServer
|
|||
site.PythonInstalled = false;
|
||||
site.CgiBinInstalled = false;
|
||||
site.ColdFusionInstalled = false;
|
||||
site.CreateCFVirtualDirectoriesPol = false;
|
||||
}
|
||||
|
||||
site.HttpRedirect = "";
|
||||
|
|
|
@ -380,7 +380,10 @@ namespace WebsitePanel.EnterpriseServer
|
|||
site.PerlInstalled = Utils.ParseBool(webPolicy["PerlInstalled"], false);
|
||||
site.PythonInstalled = Utils.ParseBool(webPolicy["PythonInstalled"], false);
|
||||
site.CgiBinInstalled = Utils.ParseBool(webPolicy["CgiBinInstalled"], false);
|
||||
site.ColdFusionInstalled = false;
|
||||
QuotaValueInfo quotaInfoCF = PackageController.GetPackageQuota(packageId, Quotas.WEB_COLDFUSION);
|
||||
site.ColdFusionInstalled = (quotaInfoCF.QuotaAllocatedValue > 0) && Utils.ParseBool(webPolicy["ColdFusionInstalled"], false);
|
||||
QuotaValueInfo quotaInfoCFV = PackageController.GetPackageQuota(packageId, Quotas.WEB_CFVIRTUALDIRS);
|
||||
site.CreateCFVirtualDirectoriesPol = (quotaInfoCFV.QuotaAllocatedValue > 0) && Utils.ParseBool(webPolicy["CreateCFVirtualDirectoriesPol"], false);
|
||||
|
||||
}
|
||||
else
|
||||
|
@ -403,6 +406,7 @@ namespace WebsitePanel.EnterpriseServer
|
|||
site.PythonInstalled = false;
|
||||
site.CgiBinInstalled = false;
|
||||
site.ColdFusionInstalled = false;
|
||||
site.CreateCFVirtualDirectoriesPol = false;
|
||||
}
|
||||
|
||||
site.HttpRedirect = "";
|
||||
|
|
|
@ -55,6 +55,7 @@ namespace WebsitePanel.Providers.Web
|
|||
private bool frontPageInstalled;
|
||||
private bool coldFusionAvailable;
|
||||
private bool createCFVirtualDirectories;
|
||||
private bool createCFVirtualDirectoriesPol;
|
||||
private string frontPageAccount;
|
||||
private string frontPagePassword;
|
||||
private string coldFusionVersion;
|
||||
|
@ -158,6 +159,12 @@ namespace WebsitePanel.Providers.Web
|
|||
set { this.createCFVirtualDirectories = value; }
|
||||
}
|
||||
|
||||
public bool CreateCFVirtualDirectoriesPol
|
||||
{
|
||||
get { return this.createCFVirtualDirectoriesPol; }
|
||||
set { this.createCFVirtualDirectoriesPol = value; }
|
||||
}
|
||||
|
||||
public ServerState SiteState
|
||||
{
|
||||
get { return this.siteState; }
|
||||
|
|
|
@ -527,6 +527,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
catch (Exception e)
|
||||
{
|
||||
result = false;
|
||||
Log.WriteWarning(e.ToString());
|
||||
}
|
||||
|
||||
return result;
|
||||
|
@ -672,6 +673,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
|
||||
try
|
||||
{
|
||||
Log.WriteWarning(string.Format("App alias: {0}\r\nCollection Name:{2}\r\nUsers: {1}", remoteApp.Alias, string.Join("; ", users), collectionName));
|
||||
runspace = OpenRunspace();
|
||||
|
||||
Command cmd = new Command("Set-RDRemoteApp");
|
||||
|
@ -680,8 +682,18 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
cmd.Parameters.Add("DisplayName", remoteApp.DisplayName);
|
||||
cmd.Parameters.Add("UserGroups", users);
|
||||
cmd.Parameters.Add("Alias", remoteApp.Alias);
|
||||
object[] errors;
|
||||
|
||||
ExecuteShellCommand(runspace, cmd, false).FirstOrDefault();
|
||||
ExecuteShellCommand(runspace, cmd, false, out errors).FirstOrDefault();
|
||||
|
||||
if (errors.Any())
|
||||
{
|
||||
Log.WriteWarning(string.Format("{0} adding users errors: {1}", remoteApp.DisplayName, string.Join("\r\n", errors.Select(e => e.ToString()).ToArray())));
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.WriteWarning(string.Format("{0} users added successfully", remoteApp.DisplayName));
|
||||
}
|
||||
}
|
||||
catch(Exception)
|
||||
{
|
||||
|
@ -986,14 +998,22 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
|||
//adding users to group
|
||||
foreach (var user in users)
|
||||
{
|
||||
var samName = user.Split('\\').Last();
|
||||
var userPath = GetUserPath(organizationId, samName);
|
||||
var userPath = GetUserPath(organizationId, user);
|
||||
Log.WriteWarning(string.Format("User Path: {0}", userPath));
|
||||
Log.WriteWarning(string.Format("Group Name: {0}", usersGroupName));
|
||||
|
||||
if (ActiveDirectoryUtils.AdObjectExists(userPath))
|
||||
{
|
||||
var userObject = ActiveDirectoryUtils.GetADObject(userPath);
|
||||
var samName = (string)ActiveDirectoryUtils.GetADObjectProperty(userObject, "sAMAccountName");
|
||||
Log.WriteWarning(string.Format("SAMAccountName: {0}", samName));
|
||||
|
||||
if (!ActiveDirectoryUtils.IsUserInGroup(samName, usersGroupName))
|
||||
{
|
||||
ActiveDirectoryUtils.AddObjectToGroup(userPath, GetUsersGroupPath(organizationId, collectionName));
|
||||
Log.WriteWarning(string.Format("{0} not exists in {1}", samName, usersGroupName));
|
||||
var userGroupsPath = GetUsersGroupPath(organizationId, collectionName);
|
||||
ActiveDirectoryUtils.AddObjectToGroup(userPath, userGroupsPath);
|
||||
Log.WriteWarning(string.Format("{0} added", samName));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1349,6 +1349,11 @@ namespace WebsitePanel.Providers.Web
|
|||
//
|
||||
UpdateCgiBinFolder(site);
|
||||
//
|
||||
if (site.CreateCFVirtualDirectoriesPol)
|
||||
{
|
||||
//Create CFVirtDirs if enabled in hosting plan, this allows for CF to be enbled via Web Policy
|
||||
CreateCFVirtualDirectories(site.SiteId);
|
||||
}
|
||||
try
|
||||
{
|
||||
webObjectsSvc.ChangeSiteState(site.SiteId, ServerState.Started);
|
||||
|
@ -1448,6 +1453,7 @@ namespace WebsitePanel.Providers.Web
|
|||
{
|
||||
DeleteCFVirtualDirectories(site.SiteId);
|
||||
site.CreateCFVirtualDirectories = false;
|
||||
site.CreateCFVirtualDirectoriesPol = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1457,6 +1463,7 @@ namespace WebsitePanel.Providers.Web
|
|||
{
|
||||
DeleteCFVirtualDirectories(site.SiteId);
|
||||
site.CreateCFVirtualDirectories = false;
|
||||
site.CreateCFVirtualDirectoriesPol = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1465,6 +1472,7 @@ namespace WebsitePanel.Providers.Web
|
|||
{
|
||||
CreateCFVirtualDirectories(site.SiteId);
|
||||
site.CreateCFVirtualDirectories = true;
|
||||
site.CreateCFVirtualDirectoriesPol = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -94,6 +94,7 @@ textarea {font-family:inherit; font-size:inherit; color:inherit; background:#fff
|
|||
/* checkbox */
|
||||
input[type=checkbox], input[type=radio] {margin:8px 4px 8px; vertical-align:-1px;}
|
||||
.HeaderCheckbox {margin-left:5px;}
|
||||
.GridCheckbox input[type=checkbox] {margin-top:0px;}
|
||||
input[type=image] {margin-right:4px;}
|
||||
.LoginLabel {display:block; line-height:34px; width:auto !important; padding-right:8px;}
|
||||
.LoginContainer .SubHead {padding-right:8px; color:#333;}
|
||||
|
@ -178,7 +179,7 @@ h2.ProductTitle.Huge {margin:0;}
|
|||
.FormButtonsBar .Left {float: left;}
|
||||
.FormButtonsBar .Right {float:right;}
|
||||
.FormButtonsBar Button2.Right {text-align: right; margin-bottom: 3px;}
|
||||
.FormButtonsBarClean {clear: both; padding-bottom: 4px;}
|
||||
.FormButtonsBarClean {clear: both; padding-bottom: 4px; height: 26px;}
|
||||
.FormButtonsBarCleanLeft {float: left;}
|
||||
.FormButtonsBarCleanRight {text-align: right;}
|
||||
.FormButtonsBarCleanMiddle {float: right;}
|
||||
|
|
|
@ -118,7 +118,7 @@
|
|||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="btnCreateMailbox.Text" xml:space="preserve">
|
||||
<value>Create New Mailbox</value>
|
||||
<value>New Mailbox</value>
|
||||
</data>
|
||||
<data name="cmdDelete.OnClientClick" xml:space="preserve">
|
||||
<value>if(!confirm('Are you sure you want to delete this mailbox?')) return false; else ShowProgressDialog('Deleting mailbox...');</value>
|
||||
|
|
|
@ -30,22 +30,22 @@
|
|||
<div class="FormButtonsBarClean">
|
||||
<div class="FormButtonsBarCleanLeft">
|
||||
<asp:Button ID="btnCreateMailbox" runat="server" meta:resourcekey="btnCreateMailbox"
|
||||
Text="Create New Mailbox" CssClass="Button1" OnClick="btnCreateMailbox_Click" />
|
||||
Text="New Mailbox" CssClass="Button1" OnClick="btnCreateMailbox_Click" />
|
||||
</div>
|
||||
<div class="FormButtonsBarCleanMiddle">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<wsp:UserActions ID="userActions" runat="server" OnExecutingUserAction="userActions_OnExecutingUserAction" />
|
||||
<wsp:UserActions ID="userActions" runat="server" OnExecutingUserAction="userActions_OnExecutingUserAction" ShowSetMailboxPlan="true" />
|
||||
</td>
|
||||
<td class="FormButtonsBarCleanSeparatorSmall"></td>
|
||||
<td>
|
||||
<asp:Panel ID="SearchPanel" runat="server" DefaultButton="cmdSearch">
|
||||
<asp:CheckBox ID="chkMailboxes" runat="server" meta:resourcekey="chkMailboxes" Text="Mailboxes" AutoPostBack="true" OnCheckedChanged="chkMailboxes_CheckedChanged" />
|
||||
<asp:CheckBox ID="chkResourceMailboxes" runat="server" meta:resourcekey="chkResourceMailboxes" Text="Resource Mailboxes" AutoPostBack="true" OnCheckedChanged="chkMailboxes_CheckedChanged" />
|
||||
<asp:CheckBox ID="chkSharedMailboxes" runat="server" meta:resourcekey="chkSharedMailboxes" Text="Shared Mailboxes" AutoPostBack="true" OnCheckedChanged="chkMailboxes_CheckedChanged" />
|
||||
<asp:CheckBox ID="chkMailboxes" runat="server" meta:resourcekey="chkMailboxes" Text="Mailboxes" AutoPostBack="true" OnCheckedChanged="chkMailboxes_CheckedChanged" CssClass="Small" />
|
||||
<asp:CheckBox ID="chkResourceMailboxes" runat="server" meta:resourcekey="chkResourceMailboxes" Text="Resource Mailboxes" AutoPostBack="true" OnCheckedChanged="chkMailboxes_CheckedChanged" CssClass="Small" />
|
||||
<asp:CheckBox ID="chkSharedMailboxes" runat="server" meta:resourcekey="chkSharedMailboxes" Text="Shared Mailboxes" AutoPostBack="true" OnCheckedChanged="chkMailboxes_CheckedChanged" CssClass="Small" />
|
||||
<asp:DropDownList ID="ddlPageSize" runat="server" AutoPostBack="True"
|
||||
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
|
||||
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged" Width="50">
|
||||
<asp:ListItem>10</asp:ListItem>
|
||||
<asp:ListItem Selected="True">20</asp:ListItem>
|
||||
<asp:ListItem>50</asp:ListItem>
|
||||
|
@ -60,8 +60,9 @@
|
|||
<asp:ListItem Value="AccountName" meta:resourcekey="ddlSearchColumnAccountName">AccountName</asp:ListItem>
|
||||
<asp:ListItem Value="SubscriberNumber" meta:resourcekey="ddlSearchColumnSubscriberNumber">Account Number</asp:ListItem>
|
||||
<asp:ListItem Value="UserPrincipalName" meta:resourcekey="ddlSearchColumnUserPrincipalName">Login</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: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>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -74,17 +75,17 @@
|
|||
OnRowCommand="gvMailboxes_RowCommand" AllowPaging="True" AllowSorting="True"
|
||||
DataSourceID="odsAccountsPaged" PageSize="20">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Image ID="img2" runat="server" Width="16px" Height="16px" ImageUrl='<%# GetStateImage((bool)Eval("Locked"),(bool)Eval("Disabled")) %>' ImageAlign="AbsMiddle" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
<asp:CheckBox ID="selectAll" Runat="server" onclick="javascript:SelectAllCheckboxes(this);" CssClass="HeaderCheckbox"></asp:CheckBox>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox runat="server" ID="chkSelectedUsersIds"></asp:CheckBox>
|
||||
<asp:CheckBox runat="server" ID="chkSelectedUsersIds" CssClass="GridCheckbox"></asp:CheckBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Image ID="img2" runat="server" Width="16px" Height="16px" ImageUrl='<%# GetStateImage((bool)Eval("Locked"),(bool)Eval("Disabled")) %>' ImageAlign="AbsMiddle" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="gvMailboxesDisplayName" SortExpression="DisplayName">
|
||||
|
|
|
@ -73,11 +73,11 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
{
|
||||
if (cntx.Quotas[Quotas.EXCHANGE2007_ISCONSUMER].QuotaAllocatedValue != 1)
|
||||
{
|
||||
gvMailboxes.Columns[4].Visible = false;
|
||||
gvMailboxes.Columns[6].Visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
gvMailboxes.Columns[3].Visible = cntx.Groups.ContainsKey(ResourceGroups.ServiceLevels);
|
||||
gvMailboxes.Columns[4].Visible = cntx.Groups.ContainsKey(ResourceGroups.ServiceLevels);
|
||||
}
|
||||
|
||||
private void BindServiceLevels()
|
||||
|
|
|
@ -1,31 +1,3 @@
|
|||
// Copyright (c) 2015, 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.
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
|
|
|
@ -73,17 +73,17 @@
|
|||
OnRowCommand="gvUsers_RowCommand" AllowPaging="True" AllowSorting="True"
|
||||
DataSourceID="odsAccountsPaged" PageSize="20">
|
||||
<Columns>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Image ID="img2" runat="server" Width="16px" Height="16px" ImageUrl='<%# GetStateImage((bool)Eval("Locked"),(bool)Eval("Disabled")) %>' ImageAlign="AbsMiddle" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<HeaderTemplate>
|
||||
<asp:CheckBox ID="selectAll" Runat="server" onclick="javascript:SelectAllCheckboxes(this);" CssClass="HeaderCheckbox"></asp:CheckBox>
|
||||
</HeaderTemplate>
|
||||
<ItemTemplate>
|
||||
<asp:CheckBox runat="server" ID="chkSelectedUsersIds"></asp:CheckBox>
|
||||
<asp:CheckBox runat="server" ID="chkSelectedUsersIds" CssClass="GridCheckbox"></asp:CheckBox>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:Image ID="img2" runat="server" Width="16px" Height="16px" ImageUrl='<%# GetStateImage((bool)Eval("Locked"),(bool)Eval("Disabled")) %>' ImageAlign="AbsMiddle" />
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="gvUsersDisplayName" SortExpression="DisplayName">
|
||||
|
|
|
@ -56,10 +56,10 @@ namespace WebsitePanel.Portal.HostedSolution
|
|||
{
|
||||
if (cntx.Quotas[Quotas.EXCHANGE2007_ISCONSUMER].QuotaAllocatedValue != 1)
|
||||
{
|
||||
gvUsers.Columns[5].Visible = false;
|
||||
gvUsers.Columns[6].Visible = false;
|
||||
}
|
||||
}
|
||||
gvUsers.Columns[3].Visible = cntx.Groups.ContainsKey(ResourceGroups.ServiceLevels);
|
||||
gvUsers.Columns[4].Visible = cntx.Groups.ContainsKey(ResourceGroups.ServiceLevels);
|
||||
}
|
||||
|
||||
private void BindServiceLevels()
|
||||
|
|
|
@ -50,6 +50,7 @@ namespace WebsitePanel.Portal.RDS
|
|||
|
||||
litCollectionName.Text = collection.Name;
|
||||
txtApplicationName.Text = remoteApp.DisplayName;
|
||||
//var remoteAppUsers = organizationUsers.Where(x => applicationUsers.Contains(x.AccountName));
|
||||
var remoteAppUsers = organizationUsers.Where(x => applicationUsers.Select(a => a.Split('\\').Last().ToLower()).Contains(x.SamAccountName.Split('\\').Last().ToLower()));
|
||||
|
||||
users.SetUsers(remoteAppUsers.ToArray());
|
||||
|
@ -64,6 +65,7 @@ namespace WebsitePanel.Portal.RDS
|
|||
var applications = ES.Services.RDS.GetCollectionRemoteApplications(PanelRequest.ItemID, collection.Name);
|
||||
var remoteApp = applications.Where(x => x.Alias.Equals(PanelRequest.ApplicationID, StringComparison.CurrentCultureIgnoreCase)).FirstOrDefault();
|
||||
remoteApp.DisplayName = txtApplicationName.Text;
|
||||
//ES.Services.RDS.SetApplicationUsers(PanelRequest.ItemID, PanelRequest.CollectionID, remoteApp, users.GetUsers().Select(x => x.AccountName).ToArray());
|
||||
ES.Services.RDS.SetApplicationUsers(PanelRequest.ItemID, PanelRequest.CollectionID, remoteApp, users.GetUsers().Select(x => x.SamAccountName.Split('\\').Last()).ToArray());
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
|
|
@ -181,6 +181,23 @@
|
|||
<td class="Normal">
|
||||
<asp:CheckBox ID="chkCgiBin" runat="server" Text="Installed" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="SubHead">
|
||||
<asp:Label ID="lblCfExt" runat="server" meta:resourcekey="lblCfExt" Text="ColdFusion:"></asp:Label>
|
||||
</td>
|
||||
<td class="Normal">
|
||||
<asp:CheckBox ID="chkCfExt" runat="server" Text="Enabled" /></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="SubHead">
|
||||
<asp:Label ID="lblVirtDir" runat="server" meta:resourcekey="lblVirtDir" Text="CFVirtualDirectories:"></asp:Label>
|
||||
</td>
|
||||
<td class="Normal">
|
||||
<asp:CheckBox ID="chkVirtDir" runat="server" Text="Enabled" /></td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</asp:Panel>
|
||||
|
||||
|
|
|
@ -76,6 +76,8 @@ namespace WebsitePanel.Portal
|
|||
chkPerl.Checked = Utils.ParseBool(settings["PerlInstalled"], false);
|
||||
chkPython.Checked = Utils.ParseBool(settings["PythonInstalled"], false);
|
||||
chkCgiBin.Checked = Utils.ParseBool(settings["CgiBinInstalled"], false);
|
||||
chkCfExt.Checked = Utils.ParseBool(settings["ColdFusionInstalled"], false);
|
||||
chkVirtDir.Checked = Utils.ParseBool(settings["CreateCFVirtualDirectoriesPol"], false);
|
||||
|
||||
// anonymous account policy
|
||||
anonymousUsername.Value = settings["AnonymousAccountPolicy"];
|
||||
|
@ -130,6 +132,8 @@ namespace WebsitePanel.Portal
|
|||
settings["PerlInstalled"] = chkPerl.Checked.ToString();
|
||||
settings["PythonInstalled"] = chkPython.Checked.ToString();
|
||||
settings["CgiBinInstalled"] = chkCgiBin.Checked.ToString();
|
||||
settings["ColdFusionInstalled"] = chkCfExt.Checked.ToString();
|
||||
settings["CreateCFVirtualDirectoriesPol"] = chkVirtDir.Checked.ToString();
|
||||
|
||||
// anonymous account policy
|
||||
settings["AnonymousAccountPolicy"] = anonymousUsername.Value;
|
||||
|
|
|
@ -463,6 +463,42 @@ namespace WebsitePanel.Portal {
|
|||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.CheckBox chkCgiBin;
|
||||
|
||||
/// <summary>
|
||||
/// lblCfExt 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.Label lblCfExt;
|
||||
|
||||
/// <summary>
|
||||
/// chkCfExt 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.CheckBox chkCfExt;
|
||||
|
||||
/// <summary>
|
||||
/// lblVirtDir 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.Label lblVirtDir;
|
||||
|
||||
/// <summary>
|
||||
/// chkVirtDir 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.CheckBox chkVirtDir;
|
||||
|
||||
/// <summary>
|
||||
/// secAnonymousAccount control.
|
||||
/// </summary>
|
||||
|
|
|
@ -117,16 +117,13 @@
|
|||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="btnDisableCancel.Text" xml:space="preserve">
|
||||
<data name="btnApply.Text" xml:space="preserve">
|
||||
<value>Apply</value>
|
||||
</data>
|
||||
<data name="btnMailboxPlanCancel.Text" xml:space="preserve">
|
||||
<value>Cancel</value>
|
||||
</data>
|
||||
<data name="btnDisableOk.Text" xml:space="preserve">
|
||||
<value>Ok</value>
|
||||
</data>
|
||||
<data name="btnEnableCancel.Text" xml:space="preserve">
|
||||
<value>Cancel</value>
|
||||
</data>
|
||||
<data name="btnEnableOk.Text" xml:space="preserve">
|
||||
<data name="btnMailboxPlanOk.Text" xml:space="preserve">
|
||||
<value>Ok</value>
|
||||
</data>
|
||||
<data name="btnServiceLevelCancel.Text" xml:space="preserve">
|
||||
|
@ -135,12 +132,6 @@
|
|||
<data name="btnServiceLevelOk.Text" xml:space="preserve">
|
||||
<value>Ok</value>
|
||||
</data>
|
||||
<data name="btnVIPCancel.Text" xml:space="preserve">
|
||||
<value>Cancel</value>
|
||||
</data>
|
||||
<data name="btnVIPOk.Text" xml:space="preserve">
|
||||
<value>Ok</value>
|
||||
</data>
|
||||
<data name="cmdApply.AlternateText" xml:space="preserve">
|
||||
<value>Apply</value>
|
||||
</data>
|
||||
|
@ -153,35 +144,26 @@
|
|||
<data name="ddlUserActionsItem.Enable" xml:space="preserve">
|
||||
<value>Enable</value>
|
||||
</data>
|
||||
<data name="ddlUserActionsItem.SetMailboxPlan" xml:space="preserve">
|
||||
<value>Set Mailbox Plan</value>
|
||||
</data>
|
||||
<data name="ddlUserActionsItem.SetServiceLevel" xml:space="preserve">
|
||||
<value>Set Service Level</value>
|
||||
</data>
|
||||
<data name="ddlUserActionsItem.SetVIP" xml:space="preserve">
|
||||
<value>Set VIP</value>
|
||||
</data>
|
||||
<data name="ddlVIPItem.SetVIP" xml:space="preserve">
|
||||
<value>Set VIP</value>
|
||||
</data>
|
||||
<data name="ddlVIPItem.UnsetVIP" xml:space="preserve">
|
||||
<data name="ddlUserActionsItem.UnsetVIP" xml:space="preserve">
|
||||
<value>Unset VIP</value>
|
||||
</data>
|
||||
<data name="headerDisable.Text" xml:space="preserve">
|
||||
<value>Disable users</value>
|
||||
</data>
|
||||
<data name="headerEnable.Text" xml:space="preserve">
|
||||
<value>Enable users</value>
|
||||
<data name="headerMailboxPlanLabel.Text" xml:space="preserve">
|
||||
<value>Mailbox Plan</value>
|
||||
</data>
|
||||
<data name="headerServiceLevel.Text" xml:space="preserve">
|
||||
<value>Service Level</value>
|
||||
</data>
|
||||
<data name="headerVIP.Text" xml:space="preserve">
|
||||
<value>Set VIP</value>
|
||||
</data>
|
||||
<data name="litDisable.Text" xml:space="preserve">
|
||||
<value>Do you wish to disable all selected users?</value>
|
||||
</data>
|
||||
<data name="litEnable.Text" xml:space="preserve">
|
||||
<value>Do you wish to enable all selected users?</value>
|
||||
<data name="litMailboxPlan.text" xml:space="preserve">
|
||||
<value>Please select a Mailbox Plan for the all checked mailboxes</value>
|
||||
</data>
|
||||
<data name="litServiceLevel.text" xml:space="preserve">
|
||||
<value>Please select a Service Level for the all checked users</value>
|
||||
|
|
|
@ -1,73 +1,46 @@
|
|||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UserActions.ascx.cs" Inherits="WebsitePanel.Portal.UserActions" %>
|
||||
<%@ Register Src="../ExchangeServer/UserControls/MailboxPlanSelector.ascx" TagName="MailboxPlanSelector" TagPrefix="wsp" %>
|
||||
|
||||
<script language="javascript">
|
||||
function CloseAndShowProgressDialog(text) {
|
||||
$(".Popup").hide();
|
||||
return ShowProgressDialog(text);
|
||||
}
|
||||
|
||||
function ShowProrgess(btn) {
|
||||
var action = $(btn).prev().val();
|
||||
|
||||
if (action == 1) {
|
||||
ShowProgressDialog('Disabling users...');
|
||||
} else if (action == 2) {
|
||||
ShowProgressDialog('Enabling users...');
|
||||
} else if (action == 4) {
|
||||
ShowProgressDialog('Setting VIP...');
|
||||
} else if (action == 5) {
|
||||
ShowProgressDialog('Unsetting VIP...');
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<asp:UpdatePanel ID="tblActions" runat="server" CssClass="NormalBold" UpdateMode="Conditional" ChildrenAsTriggers="true" >
|
||||
<ContentTemplate>
|
||||
|
||||
<asp:DropDownList ID="ddlUserActions" runat="server" CssClass="NormalTextBox" resourcekey="ddlUserActions" style="margin-right: 0px" >
|
||||
<%--<asp:ListItem Value="0">Actions</asp:ListItem>--%>
|
||||
<asp:DropDownList ID="ddlUserActions" runat="server" CssClass="NormalTextBox" resourcekey="ddlUserActions"
|
||||
AutoPostBack="True">
|
||||
<asp:ListItem Value="0">Actions</asp:ListItem>
|
||||
<asp:ListItem Value="1">Disable</asp:ListItem>
|
||||
<asp:ListItem Value="2">Enable</asp:ListItem>
|
||||
<asp:ListItem Value="3">SetServiceLevel</asp:ListItem>
|
||||
<asp:ListItem Value="4">SetVIP</asp:ListItem>
|
||||
<asp:ListItem Value="5">UnsetVIP</asp:ListItem>
|
||||
<asp:ListItem Value="6">SetMailboxPlan</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
|
||||
<asp:ImageButton ID="cmdApply" Runat="server" meta:resourcekey="cmdApply" SkinID="ApplySmall" CausesValidation="false" OnClick="cmdApply_OnClick"/>
|
||||
<asp:Button ID="btnApply" runat="server" meta:resourcekey="btnApply"
|
||||
Text="Apply" CssClass="Button1" OnClick="btnApply_Click" OnClientClick="return ShowProrgess(this);" />
|
||||
|
||||
|
||||
<ajaxToolkit:ModalPopupExtender ID="Modal" runat="server" EnableViewState="true" TargetControlID="FakeModalPopupTarget"
|
||||
PopupControlID="EnablePanel" BackgroundCssClass="modalBackground" DropShadow="false" />
|
||||
|
||||
<%-- Enable --%>
|
||||
<asp:Panel ID="EnablePanel" runat="server" CssClass="Popup" Style="display: none">
|
||||
<table class="Popup-Header">
|
||||
<tr>
|
||||
<td class="Popup-HeaderLeft"></td>
|
||||
<td class="Popup-HeaderTitle"><asp:Localize ID="headerEnable" runat="server" meta:resourcekey="headerEnable"></asp:Localize></td>
|
||||
<td class="Popup-HeaderRight"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="Popup-Content">
|
||||
<div class="Popup-Body">
|
||||
<br/>
|
||||
<asp:Literal ID="litEnable" runat="server" meta:resourcekey="litEnable"></asp:Literal>
|
||||
<br/>
|
||||
</div>
|
||||
<div class="FormFooterMiddle">
|
||||
<asp:Button ID="btnEnableOk" runat="server" CssClass="Button1" meta:resourcekey="btnEnableOk" Text="Ok"
|
||||
OnClientClick="return CloseAndShowProgressDialog('Enabling users...')" OnClick="btnModalOk_Click" />
|
||||
<asp:Button ID="btnEnableCancel" runat="server" CssClass="Button1" meta:resourcekey="btnEnableCancel" Text="Cancel"
|
||||
CausesValidation="false" />
|
||||
</div>
|
||||
</div>
|
||||
</asp:Panel>
|
||||
|
||||
<%-- Disable --%>
|
||||
<asp:Panel ID="DisablePanel" runat="server" CssClass="Popup" Style="display: none">
|
||||
<table class="Popup-Header">
|
||||
<tr>
|
||||
<td class="Popup-HeaderLeft"></td>
|
||||
<td class="Popup-HeaderTitle"><asp:Localize ID="headerDisable" runat="server" meta:resourcekey="headerDisable"></asp:Localize></td>
|
||||
<td class="Popup-HeaderRight"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="Popup-Content">
|
||||
<div class="Popup-Body">
|
||||
<br/>
|
||||
<asp:Literal ID="litDisable" runat="server" meta:resourcekey="litDisable"></asp:Literal>
|
||||
<br/>
|
||||
</div>
|
||||
<div class="FormFooterMiddle">
|
||||
<asp:Button ID="btnDisableOk" runat="server" CssClass="Button1" meta:resourcekey="btnDisableOk" Text="Ok"
|
||||
OnClientClick="return CloseAndShowProgressDialog('Disabling users...')" OnClick="btnModalOk_Click" />
|
||||
<asp:Button ID="btnDisableCancel" runat="server" CssClass="Button1" meta:resourcekey="btnDisableCancel" Text="Cancel"
|
||||
CausesValidation="false" />
|
||||
</div>
|
||||
</div>
|
||||
</asp:Panel>
|
||||
PopupControlID="FakeModalPopupTarget" BackgroundCssClass="modalBackground" DropShadow="false" />
|
||||
|
||||
<%--Set Service Level--%>
|
||||
<asp:Panel ID="ServiceLevelPanel" runat="server" CssClass="Popup" Style="display: none">
|
||||
|
@ -90,47 +63,44 @@
|
|||
<asp:Button ID="btnServiceLevelOk" runat="server" CssClass="Button1" meta:resourcekey="btnServiceLevelOk" Text="Ok"
|
||||
OnClientClick="return CloseAndShowProgressDialog('Setting Service Level...')" OnClick="btnModalOk_Click" />
|
||||
<asp:Button ID="btnServiceLevelCancel" runat="server" CssClass="Button1" meta:resourcekey="btnServiceLevelCancel" Text="Cancel"
|
||||
CausesValidation="false" />
|
||||
OnClick="btnModalCancel_OnClick" CausesValidation="false" />
|
||||
</div>
|
||||
</div>
|
||||
</asp:Panel>
|
||||
|
||||
<%-- VIP --%>
|
||||
<asp:Panel ID="VIPPanel" runat="server" CssClass="Popup" Style="display: none">
|
||||
<%--Set MailboxPlan--%>
|
||||
<asp:Panel ID="MailboxPlanPanel" runat="server" CssClass="Popup" Style="display: none">
|
||||
<table class="Popup-Header">
|
||||
<tr>
|
||||
<td class="Popup-HeaderLeft"></td>
|
||||
<td class="Popup-HeaderTitle"><asp:Localize ID="headerVIP" runat="server" meta:resourcekey="headerVIP"></asp:Localize></td>
|
||||
<td class="Popup-HeaderTitle"><asp:Localize ID="headerMailboxPlanLabel" runat="server" meta:resourcekey="headerMailboxPlanLabel"></asp:Localize></td>
|
||||
<td class="Popup-HeaderRight"></td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="Popup-Content">
|
||||
<div class="Popup-Body">
|
||||
<br/>
|
||||
<asp:Literal ID="litVIP" runat="server" meta:resourcekey="litVIP"></asp:Literal>
|
||||
<asp:Literal ID="litMailboxPlan" runat="server" meta:resourcekey="litMailboxPlan"></asp:Literal>
|
||||
<br/>
|
||||
<asp:DropDownList ID="ddlVIP" runat="server" CssClass="NormalTextBox" resourcekey="ddlVIP">
|
||||
<asp:ListItem Value="0">SetVIP</asp:ListItem>
|
||||
<asp:ListItem Value="1">UnsetVIP</asp:ListItem>
|
||||
</asp:DropDownList>
|
||||
<wsp:MailboxPlanSelector ID="mailboxPlanSelector" runat="server" />
|
||||
<br/>
|
||||
</div>
|
||||
<div class="FormFooterMiddle">
|
||||
<asp:Button ID="btnVIPOk" runat="server" CssClass="Button1" meta:resourcekey="btnVIPOk" Text="Ok"
|
||||
OnClientClick="return CloseAndShowProgressDialog('Setting VIP...')" OnClick="btnModalOk_Click" />
|
||||
<asp:Button ID="btnVIPCancel" runat="server" CssClass="Button1" meta:resourcekey="btnVIPCancel" Text="Cancel"
|
||||
CausesValidation="false" />
|
||||
<asp:Button ID="btnMailboxPlanOk" runat="server" CssClass="Button1" meta:resourcekey="btnMailboxPlanOk" Text="Ok"
|
||||
OnClientClick="return CloseAndShowProgressDialog('Setting Mailbox Plan ...')" OnClick="btnModalOk_Click" />
|
||||
<asp:Button ID="btnMailboxPlanCancel" runat="server" CssClass="Button1" meta:resourcekey="btnMailboxPlanCancel" Text="Cancel"
|
||||
OnClick="btnModalCancel_OnClick" CausesValidation="false" />
|
||||
</div>
|
||||
</div>
|
||||
</asp:Panel>
|
||||
|
||||
|
||||
<asp:Button ID="FakeModalPopupTarget" runat="server" Style="display: none;" />
|
||||
</ContentTemplate>
|
||||
|
||||
<Triggers>
|
||||
<asp:PostBackTrigger ControlID="btnDisableOk" />
|
||||
<asp:PostBackTrigger ControlID="btnEnableOk" />
|
||||
<asp:PostBackTrigger ControlID="btnServiceLevelOk" />
|
||||
<asp:PostBackTrigger ControlID="btnVIPOk" />
|
||||
<asp:PostBackTrigger ControlID="btnMailboxPlanOk" />
|
||||
<asp:PostBackTrigger ControlID="btnApply" />
|
||||
</Triggers>
|
||||
</asp:UpdatePanel>
|
||||
|
|
|
@ -53,20 +53,33 @@ namespace WebsitePanel.Portal
|
|||
Enable = 2,
|
||||
SetServiceLevel = 3,
|
||||
SetVIP = 4,
|
||||
UnsetVIP = 5,
|
||||
SetMailboxPlan = 6
|
||||
}
|
||||
|
||||
public partial class UserActions : WebsitePanelControlBase
|
||||
{
|
||||
public event EventHandler ExecutingUserAction;
|
||||
|
||||
private bool showSetMailboxPlan = false;
|
||||
public bool ShowSetMailboxPlan
|
||||
{
|
||||
get { return showSetMailboxPlan; }
|
||||
set { showSetMailboxPlan = value; }
|
||||
}
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
// Remove Service Level item and VIP item from Action List if current Hosting plan does not allow Service Levels
|
||||
if (!PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId).Groups.ContainsKey(ResourceGroups.ServiceLevels))
|
||||
{
|
||||
ddlUserActions.Items.Remove(ddlUserActions.Items.FindByValue(UserActionTypes.SetServiceLevel.ToString()));
|
||||
ddlUserActions.Items.Remove(ddlUserActions.Items.FindByValue(UserActionTypes.SetVIP.ToString()));
|
||||
ddlUserActions.Items.Remove(ddlUserActions.Items.FindByValue(((int)UserActionTypes.SetServiceLevel).ToString()));
|
||||
ddlUserActions.Items.Remove(ddlUserActions.Items.FindByValue(((int)UserActionTypes.SetVIP).ToString()));
|
||||
ddlUserActions.Items.Remove(ddlUserActions.Items.FindByValue(((int)UserActionTypes.UnsetVIP).ToString()));
|
||||
}
|
||||
|
||||
if (!ShowSetMailboxPlan)
|
||||
ddlUserActions.Items.Remove(ddlUserActions.Items.FindByValue(((int)UserActionTypes.SetMailboxPlan).ToString()));
|
||||
}
|
||||
|
||||
public UserActionTypes SelectedAction
|
||||
|
@ -77,30 +90,6 @@ namespace WebsitePanel.Portal
|
|||
}
|
||||
}
|
||||
|
||||
protected void cmdApply_OnClick(object sender, ImageClickEventArgs e)
|
||||
{
|
||||
switch (SelectedAction)
|
||||
{
|
||||
case UserActionTypes.Disable:
|
||||
Modal.PopupControlID = DisablePanel.ID;
|
||||
break;
|
||||
case UserActionTypes.Enable:
|
||||
Modal.PopupControlID = EnablePanel.ID;
|
||||
break;
|
||||
case UserActionTypes.SetServiceLevel:
|
||||
FillServiceLevelsList();
|
||||
Modal.PopupControlID = ServiceLevelPanel.ID;
|
||||
break;
|
||||
case UserActionTypes.SetVIP:
|
||||
Modal.PopupControlID = VIPPanel.ID;
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
Modal.Show();
|
||||
}
|
||||
|
||||
public int DoUserActions(List<int> userIds)
|
||||
{
|
||||
switch (SelectedAction)
|
||||
|
@ -112,18 +101,37 @@ namespace WebsitePanel.Portal
|
|||
case UserActionTypes.SetServiceLevel:
|
||||
return ChangeUsersSettings(userIds, null, SelectedServiceId, null);
|
||||
case UserActionTypes.SetVIP:
|
||||
return ChangeUsersSettings(userIds, null, null, SelectedVIP);
|
||||
return ChangeUsersSettings(userIds, null, null, true);
|
||||
case UserActionTypes.UnsetVIP:
|
||||
return ChangeUsersSettings(userIds, null, null, false);
|
||||
case UserActionTypes.SetMailboxPlan:
|
||||
return SetMailboxPlan(userIds);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected void btnModalOk_Click(object sender, EventArgs e)
|
||||
protected void DoExecutingUserAction()
|
||||
{
|
||||
if (ExecutingUserAction != null)
|
||||
ExecutingUserAction(this, new EventArgs());
|
||||
}
|
||||
|
||||
protected void btnModalOk_Click(object sender, EventArgs e)
|
||||
{
|
||||
DoExecutingUserAction();
|
||||
}
|
||||
|
||||
protected void btnModalCancel_OnClick(object sender, EventArgs e)
|
||||
{
|
||||
ResetSelection();
|
||||
}
|
||||
|
||||
public void ResetSelection()
|
||||
{
|
||||
ddlUserActions.ClearSelection();
|
||||
}
|
||||
|
||||
protected int ChangeUsersSettings(List<int> userIds, bool? disable, int? serviceLevelId, bool? isVIP)
|
||||
{
|
||||
foreach (var userId in userIds)
|
||||
|
@ -166,13 +174,12 @@ namespace WebsitePanel.Portal
|
|||
user.ExternalEmail,
|
||||
user.SubscriberNumber,
|
||||
serviceLevelId ?? user.LevelId,
|
||||
isVIP ?? user.IsVIP, false);
|
||||
isVIP ?? user.IsVIP,
|
||||
user.UserMustChangePassword);
|
||||
|
||||
if (result < 0)
|
||||
{
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -180,6 +187,29 @@ namespace WebsitePanel.Portal
|
|||
|
||||
#region ServiceLevel
|
||||
|
||||
protected int SetMailboxPlan(List<int> userIds)
|
||||
{
|
||||
int planId;
|
||||
|
||||
if (!int.TryParse(mailboxPlanSelector.MailboxPlanId, out planId))
|
||||
return 0;
|
||||
|
||||
if (planId < 0) return 0;
|
||||
|
||||
foreach (int userId in userIds)
|
||||
{
|
||||
ExchangeAccount account = ES.Services.ExchangeServer.GetAccount(PanelRequest.ItemID, userId);
|
||||
|
||||
int result = ES.Services.ExchangeServer.SetExchangeMailboxPlan(PanelRequest.ItemID, userId, planId,
|
||||
account.ArchivingMailboxPlanId, account.EnableArchiving);
|
||||
|
||||
if (result < 0)
|
||||
return result;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected int? SelectedServiceId
|
||||
{
|
||||
get
|
||||
|
@ -232,15 +262,29 @@ namespace WebsitePanel.Portal
|
|||
|
||||
#endregion
|
||||
|
||||
|
||||
#region VIP
|
||||
|
||||
protected bool? SelectedVIP
|
||||
protected void btnApply_Click(object sender, EventArgs e)
|
||||
{
|
||||
get { return ddlVIP.SelectedValue == "0"; }
|
||||
switch (SelectedAction)
|
||||
{
|
||||
case UserActionTypes.Disable:
|
||||
case UserActionTypes.Enable:
|
||||
case UserActionTypes.SetVIP:
|
||||
case UserActionTypes.UnsetVIP:
|
||||
DoExecutingUserAction();
|
||||
break;
|
||||
case UserActionTypes.SetServiceLevel:
|
||||
FillServiceLevelsList();
|
||||
Modal.PopupControlID = ServiceLevelPanel.ID;
|
||||
Modal.Show();
|
||||
break;
|
||||
case UserActionTypes.SetMailboxPlan:
|
||||
Modal.PopupControlID = MailboxPlanPanel.ID;
|
||||
Modal.Show();
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,31 +1,3 @@
|
|||
// Copyright (c) 2015, 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.
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
|
@ -59,13 +31,13 @@ namespace WebsitePanel.Portal {
|
|||
protected global::System.Web.UI.WebControls.DropDownList ddlUserActions;
|
||||
|
||||
/// <summary>
|
||||
/// cmdApply control.
|
||||
/// btnApply 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.ImageButton cmdApply;
|
||||
protected global::System.Web.UI.WebControls.Button btnApply;
|
||||
|
||||
/// <summary>
|
||||
/// Modal control.
|
||||
|
@ -76,96 +48,6 @@ namespace WebsitePanel.Portal {
|
|||
/// </remarks>
|
||||
protected global::AjaxControlToolkit.ModalPopupExtender Modal;
|
||||
|
||||
/// <summary>
|
||||
/// EnablePanel 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 EnablePanel;
|
||||
|
||||
/// <summary>
|
||||
/// headerEnable 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.Localize headerEnable;
|
||||
|
||||
/// <summary>
|
||||
/// litEnable 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.Literal litEnable;
|
||||
|
||||
/// <summary>
|
||||
/// btnEnableOk 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.Button btnEnableOk;
|
||||
|
||||
/// <summary>
|
||||
/// btnEnableCancel 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.Button btnEnableCancel;
|
||||
|
||||
/// <summary>
|
||||
/// DisablePanel 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 DisablePanel;
|
||||
|
||||
/// <summary>
|
||||
/// headerDisable 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.Localize headerDisable;
|
||||
|
||||
/// <summary>
|
||||
/// litDisable 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.Literal litDisable;
|
||||
|
||||
/// <summary>
|
||||
/// btnDisableOk 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.Button btnDisableOk;
|
||||
|
||||
/// <summary>
|
||||
/// btnDisableCancel 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.Button btnDisableCancel;
|
||||
|
||||
/// <summary>
|
||||
/// ServiceLevelPanel control.
|
||||
/// </summary>
|
||||
|
@ -221,58 +103,58 @@ namespace WebsitePanel.Portal {
|
|||
protected global::System.Web.UI.WebControls.Button btnServiceLevelCancel;
|
||||
|
||||
/// <summary>
|
||||
/// VIPPanel control.
|
||||
/// MailboxPlanPanel 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 VIPPanel;
|
||||
protected global::System.Web.UI.WebControls.Panel MailboxPlanPanel;
|
||||
|
||||
/// <summary>
|
||||
/// headerVIP control.
|
||||
/// headerMailboxPlanLabel 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.Localize headerVIP;
|
||||
protected global::System.Web.UI.WebControls.Localize headerMailboxPlanLabel;
|
||||
|
||||
/// <summary>
|
||||
/// litVIP control.
|
||||
/// litMailboxPlan 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.Literal litVIP;
|
||||
protected global::System.Web.UI.WebControls.Literal litMailboxPlan;
|
||||
|
||||
/// <summary>
|
||||
/// ddlVIP control.
|
||||
/// mailboxPlanSelector 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.DropDownList ddlVIP;
|
||||
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.MailboxPlanSelector mailboxPlanSelector;
|
||||
|
||||
/// <summary>
|
||||
/// btnVIPOk control.
|
||||
/// btnMailboxPlanOk 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.Button btnVIPOk;
|
||||
protected global::System.Web.UI.WebControls.Button btnMailboxPlanOk;
|
||||
|
||||
/// <summary>
|
||||
/// btnVIPCancel control.
|
||||
/// btnMailboxPlanCancel 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.Button btnVIPCancel;
|
||||
protected global::System.Web.UI.WebControls.Button btnMailboxPlanCancel;
|
||||
|
||||
/// <summary>
|
||||
/// FakeModalPopupTarget control.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue