Merge
This commit is contained in:
commit
95ed5b88db
9 changed files with 204 additions and 183 deletions
|
@ -31,6 +31,7 @@ using System.Collections;
|
|||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Net.Mail;
|
||||
using System.Threading;
|
||||
using WebsitePanel.EnterpriseServer.Code.HostedSolution;
|
||||
|
@ -2919,23 +2920,18 @@ namespace WebsitePanel.EnterpriseServer
|
|||
try
|
||||
{
|
||||
List<ExchangeMailboxPlan> mailboxPlans = new List<ExchangeMailboxPlan>();
|
||||
int? defaultPlanId = null;
|
||||
|
||||
UserInfo user = ObjectUtils.FillObjectFromDataReader<UserInfo>(DataProvider.GetUserByExchangeOrganizationIdInternally(itemId));
|
||||
|
||||
if (user.Role == UserRole.User)
|
||||
ExchangeServerController.GetExchangeMailboxPlansByUser(itemId, user, ref mailboxPlans, archiving);
|
||||
GetExchangeMailboxPlansByUser(itemId, user, ref mailboxPlans, ref defaultPlanId, archiving);
|
||||
else
|
||||
ExchangeServerController.GetExchangeMailboxPlansByUser(0, user, ref mailboxPlans, archiving);
|
||||
GetExchangeMailboxPlansByUser(0, user, ref mailboxPlans, ref defaultPlanId, archiving);
|
||||
|
||||
|
||||
ExchangeOrganization ExchangeOrg = ObjectUtils.FillObjectFromDataReader<ExchangeOrganization>(DataProvider.GetExchangeOrganization(itemId));
|
||||
|
||||
if (ExchangeOrg != null)
|
||||
if (defaultPlanId.HasValue)
|
||||
{
|
||||
foreach (ExchangeMailboxPlan p in mailboxPlans)
|
||||
{
|
||||
p.IsDefault = (p.MailboxPlanId == ExchangeOrg.ExchangeMailboxPlanID);
|
||||
}
|
||||
mailboxPlans.ForEach(p => p.IsDefault = (p.MailboxPlanId == defaultPlanId.Value));
|
||||
}
|
||||
|
||||
return mailboxPlans;
|
||||
|
@ -2950,7 +2946,7 @@ namespace WebsitePanel.EnterpriseServer
|
|||
}
|
||||
}
|
||||
|
||||
private static void GetExchangeMailboxPlansByUser(int itemId, UserInfo user, ref List<ExchangeMailboxPlan> mailboxPlans, bool archiving)
|
||||
private static void GetExchangeMailboxPlansByUser(int itemId, UserInfo user, ref List<ExchangeMailboxPlan> mailboxPlans, ref int? defaultPlanId, bool archiving)
|
||||
{
|
||||
if ((user != null))
|
||||
{
|
||||
|
@ -2983,11 +2979,20 @@ namespace WebsitePanel.EnterpriseServer
|
|||
{
|
||||
mailboxPlans.Add(p);
|
||||
}
|
||||
|
||||
// Set default plan
|
||||
ExchangeOrganization exchangeOrg = ObjectUtils.FillObjectFromDataReader<ExchangeOrganization>(DataProvider.GetExchangeOrganization(OrgId));
|
||||
|
||||
// If the default plan has not been set by the setting of higher priority
|
||||
if (!defaultPlanId.HasValue && exchangeOrg != null && exchangeOrg.ExchangeMailboxPlanID > 0)
|
||||
{
|
||||
defaultPlanId = exchangeOrg.ExchangeMailboxPlanID;
|
||||
}
|
||||
}
|
||||
|
||||
UserInfo owner = UserController.GetUserInternally(user.OwnerId);
|
||||
|
||||
GetExchangeMailboxPlansByUser(0, owner, ref mailboxPlans, archiving);
|
||||
GetExchangeMailboxPlansByUser(0, owner, ref mailboxPlans, ref defaultPlanId, archiving);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -3633,6 +3633,17 @@ namespace WebsitePanel.EnterpriseServer
|
|||
WebServer server = GetWebServer(item.ServiceId);
|
||||
//
|
||||
server.RevokeWebManagementAccess(item.SiteId, accountName);
|
||||
|
||||
// Cleanup web site properties if the web management and web deploy user are the same
|
||||
if (GetNonQualifiedAccountName(accountName) == item.WebDeployPublishingAccount)
|
||||
{
|
||||
item.WebDeployPublishingAccount = String.Empty;
|
||||
item.WebDeploySitePublishingEnabled = false;
|
||||
item.WebDeploySitePublishingProfile = String.Empty;
|
||||
item.WebDeployPublishingPassword = String.Empty;
|
||||
// Put changes into effect
|
||||
PackageController.UpdatePackageItem(item);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
@ -3644,6 +3655,12 @@ namespace WebsitePanel.EnterpriseServer
|
|||
}
|
||||
}
|
||||
|
||||
protected static string GetNonQualifiedAccountName(string accountName)
|
||||
{
|
||||
int idx = accountName.LastIndexOf("\\");
|
||||
return (idx != -1) ? accountName.Substring(idx + 1) : accountName;
|
||||
}
|
||||
|
||||
public static ResultObject ChangeWebManagementAccessPassword(int siteItemId, string accountPassword)
|
||||
{
|
||||
ResultObject result = new ResultObject { IsSuccess = true };
|
||||
|
|
|
@ -4133,6 +4133,9 @@ namespace WebsitePanel.Providers.Web
|
|||
// Restore setting back
|
||||
ServerSettings.ADEnabled = adEnabled;
|
||||
}
|
||||
|
||||
//
|
||||
RemoveDelegationRulesRestrictions(siteName, accountName);
|
||||
}
|
||||
|
||||
private void ReadWebDeployPublishingAccessDetails(WebVirtualDirectory iisObject)
|
||||
|
|
|
@ -5335,6 +5335,9 @@
|
|||
<data name="Success.EXCHANGE_UPDATEPLANS" xml:space="preserve">
|
||||
<value>Mailbox plan updated</value>
|
||||
</data>
|
||||
<data name="Success.EXCHANGE_SET_DEFAULT_MAILBOXPLAN" xml:space="preserve">
|
||||
<value>Succesfully set default mailbox plan.</value>
|
||||
</data>
|
||||
<data name="Error.LYNC_UPDATEPLANS" xml:space="preserve">
|
||||
<value>Lync plan update failed</value>
|
||||
</data>
|
||||
|
|
|
@ -249,4 +249,7 @@
|
|||
<data name="secRetentionPolicy.Text" xml:space="preserve">
|
||||
<value>Retention policy</value>
|
||||
</data>
|
||||
<data name="lblDefaultMailboxPlan.Text" xml:space="preserve">
|
||||
<value>Default</value>
|
||||
</data>
|
||||
</root>
|
|
@ -28,6 +28,15 @@
|
|||
<asp:Label id="lnkDisplayMailboxPlan" runat="server" EnableViewState="true" ><%# PortalAntiXSS.Encode((string)Eval("MailboxPlan"))%></asp:Label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField >
|
||||
<ItemStyle Width="15%"></ItemStyle>
|
||||
<ItemTemplate>
|
||||
<label>
|
||||
<input type="radio" name="DefaultMailboxPlan" value='<%# Eval("MailboxPlanId") %>' <%# IsChecked((bool) Eval("IsDefault")) %>/>
|
||||
<asp:Label runat="server" meta:resourcekey="lblDefaultMailboxPlan" Text="Default"></asp:Label>
|
||||
</label>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField>
|
||||
<ItemTemplate>
|
||||
<asp:ImageButton id="imgDelMailboxPlan" runat="server" Text="Delete" SkinID="ExchangeDelete"
|
||||
|
@ -53,6 +62,10 @@
|
|||
</Columns>
|
||||
</asp:GridView>
|
||||
<br />
|
||||
<div style="text-align: center">
|
||||
<asp:Button ID="btnSetDefaultMailboxPlan" runat="server" meta:resourcekey="btnSetDefaultMailboxPlan"
|
||||
Text="Set Default Mailboxplan" CssClass="Button1" OnClick="btnSetDefaultMailboxPlan_Click" />
|
||||
</div>
|
||||
<wsp:CollapsiblePanel id="secMailboxPlan" runat="server"
|
||||
TargetControlID="MailboxPlan" meta:resourcekey="secMailboxPlan" Text="Mailboxplan">
|
||||
</wsp:CollapsiblePanel>
|
||||
|
|
|
@ -36,7 +36,7 @@ using System.Xml.Serialization;
|
|||
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
|
@ -99,21 +99,7 @@ namespace WebsitePanel.Portal
|
|||
|
||||
private void BindMailboxPlans()
|
||||
{
|
||||
Providers.HostedSolution.Organization[] orgs = null;
|
||||
|
||||
if (PanelSecurity.SelectedUserId != 1)
|
||||
{
|
||||
PackageInfo[] Packages = ES.Services.Packages.GetPackages(PanelSecurity.SelectedUserId);
|
||||
|
||||
if ((Packages != null) & (Packages.GetLength(0) > 0))
|
||||
{
|
||||
orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(Packages[0].PackageId, false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(1, false);
|
||||
}
|
||||
Providers.HostedSolution.Organization[] orgs = GetOrganizations();
|
||||
|
||||
if ((orgs != null) & (orgs.GetLength(0) > 0))
|
||||
{
|
||||
|
@ -123,6 +109,12 @@ namespace WebsitePanel.Portal
|
|||
gvMailboxPlans.DataBind();
|
||||
}
|
||||
|
||||
//check if organization has only one default domain or less
|
||||
if (gvMailboxPlans.Rows.Count <= 1)
|
||||
{
|
||||
btnSetDefaultMailboxPlan.Enabled = false;
|
||||
}
|
||||
|
||||
btnUpdateMailboxPlan.Enabled = (string.IsNullOrEmpty(txtMailboxPlan.Text)) ? false : true;
|
||||
}
|
||||
|
||||
|
@ -185,21 +177,7 @@ namespace WebsitePanel.Portal
|
|||
if (PanelSecurity.SelectedUser.Role == UserRole.Reseller)
|
||||
plan.MailboxPlanType = (int)ExchangeMailboxPlanType.Reseller;
|
||||
|
||||
Providers.HostedSolution.Organization[] orgs = null;
|
||||
|
||||
if (PanelSecurity.SelectedUserId != 1)
|
||||
{
|
||||
PackageInfo[] Packages = ES.Services.Packages.GetPackages(PanelSecurity.SelectedUserId);
|
||||
|
||||
if ((Packages != null) & (Packages.GetLength(0) > 0))
|
||||
{
|
||||
orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(Packages[0].PackageId, false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(1, false);
|
||||
}
|
||||
Providers.HostedSolution.Organization[] orgs = GetOrganizations();
|
||||
|
||||
|
||||
if ((orgs != null) & (orgs.GetLength(0) > 0))
|
||||
|
@ -231,20 +209,7 @@ namespace WebsitePanel.Portal
|
|||
case "DeleteItem":
|
||||
try
|
||||
{
|
||||
|
||||
if (PanelSecurity.SelectedUserId != 1)
|
||||
{
|
||||
PackageInfo[] Packages = ES.Services.Packages.GetPackages(PanelSecurity.SelectedUserId);
|
||||
|
||||
if ((Packages != null) & (Packages.GetLength(0) > 0))
|
||||
{
|
||||
orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(Packages[0].PackageId, false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(1, false);
|
||||
}
|
||||
orgs = GetOrganizations();
|
||||
|
||||
plan = ES.Services.ExchangeServer.GetExchangeMailboxPlan(orgs[0].Id, mailboxPlanId);
|
||||
|
||||
|
@ -308,20 +273,7 @@ namespace WebsitePanel.Portal
|
|||
case "EditItem":
|
||||
ViewState["MailboxPlanID"] = mailboxPlanId;
|
||||
|
||||
if (PanelSecurity.SelectedUserId != 1)
|
||||
{
|
||||
PackageInfo[] Packages = ES.Services.Packages.GetPackages(PanelSecurity.SelectedUserId);
|
||||
|
||||
if ((Packages != null) & (Packages.GetLength(0) > 0))
|
||||
{
|
||||
orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(Packages[0].PackageId, false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(1, false);
|
||||
}
|
||||
|
||||
orgs = GetOrganizations();
|
||||
|
||||
plan = ES.Services.ExchangeServer.GetExchangeMailboxPlan(orgs[0].Id, mailboxPlanId);
|
||||
txtMailboxPlan.Text = plan.MailboxPlan;
|
||||
|
@ -421,24 +373,9 @@ namespace WebsitePanel.Portal
|
|||
return;
|
||||
|
||||
int mailboxPlanId = (int)ViewState["MailboxPlanID"];
|
||||
Providers.HostedSolution.Organization[] orgs = null;
|
||||
Providers.HostedSolution.Organization[] orgs = GetOrganizations();
|
||||
Providers.HostedSolution.ExchangeMailboxPlan plan;
|
||||
|
||||
|
||||
if (PanelSecurity.SelectedUserId != 1)
|
||||
{
|
||||
PackageInfo[] Packages = ES.Services.Packages.GetPackages(PanelSecurity.SelectedUserId);
|
||||
|
||||
if ((Packages != null) & (Packages.GetLength(0) > 0))
|
||||
{
|
||||
orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(Packages[0].PackageId, false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(1, false);
|
||||
}
|
||||
|
||||
plan = ES.Services.ExchangeServer.GetExchangeMailboxPlan(orgs[0].Id, mailboxPlanId);
|
||||
|
||||
if (plan.ItemId != orgs[0].Id)
|
||||
|
@ -668,23 +605,9 @@ namespace WebsitePanel.Portal
|
|||
{
|
||||
ddTags.Items.Clear();
|
||||
|
||||
Providers.HostedSolution.Organization[] orgs = null;
|
||||
Organization[] orgs = GetOrganizations();
|
||||
|
||||
if (PanelSecurity.SelectedUserId != 1)
|
||||
{
|
||||
PackageInfo[] Packages = ES.Services.Packages.GetPackages(PanelSecurity.SelectedUserId);
|
||||
|
||||
if ((Packages != null) & (Packages.GetLength(0) > 0))
|
||||
{
|
||||
orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(Packages[0].PackageId, false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(1, false);
|
||||
}
|
||||
|
||||
if ((orgs != null) & (orgs.GetLength(0) > 0))
|
||||
if ((orgs != null) && (orgs.GetLength(0) > 0))
|
||||
{
|
||||
Providers.HostedSolution.ExchangeRetentionPolicyTag[] allTags = ES.Services.ExchangeServer.GetExchangeRetentionPolicyTags(orgs[0].Id);
|
||||
List<ExchangeMailboxPlanRetentionPolicyTag> selectedTags = ViewState["Tags"] as List<ExchangeMailboxPlanRetentionPolicyTag>;
|
||||
|
@ -737,5 +660,55 @@ namespace WebsitePanel.Portal
|
|||
|
||||
}
|
||||
|
||||
protected Organization[] GetOrganizations()
|
||||
{
|
||||
Organization[] orgs = null;
|
||||
|
||||
if (PanelSecurity.SelectedUserId != 1)
|
||||
{
|
||||
PackageInfo[] Packages = ES.Services.Packages.GetPackages(PanelSecurity.SelectedUserId);
|
||||
|
||||
if ((Packages != null) & (Packages.GetLength(0) > 0))
|
||||
{
|
||||
orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(Packages[0].PackageId, false);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(1, false);
|
||||
}
|
||||
|
||||
return orgs;
|
||||
}
|
||||
|
||||
protected void btnSetDefaultMailboxPlan_Click(object sender, EventArgs e)
|
||||
{
|
||||
// get domain
|
||||
int mailboxPlanId = Utils.ParseInt(Request.Form["DefaultMailboxPlan"], 0);
|
||||
|
||||
try
|
||||
{
|
||||
var orgs = GetOrganizations();
|
||||
|
||||
if ((orgs != null) && (orgs.GetLength(0) > 0))
|
||||
{
|
||||
ES.Services.ExchangeServer.SetOrganizationDefaultExchangeMailboxPlan(orgs[0].Id, mailboxPlanId);
|
||||
|
||||
messageBox.ShowSuccessMessage("EXCHANGE_SET_DEFAULT_MAILBOXPLAN");
|
||||
|
||||
// rebind domains
|
||||
BindMailboxPlans();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
messageBox.ShowErrorMessage("EXCHANGE_SET_DEFAULT_MAILBOXPLAN", ex);
|
||||
}
|
||||
}
|
||||
|
||||
protected string IsChecked(bool val)
|
||||
{
|
||||
return val ? "checked" : "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,10 +35,12 @@
|
|||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace WebsitePanel.Portal {
|
||||
namespace WebsitePanel.Portal
|
||||
{
|
||||
|
||||
|
||||
public partial class SettingsExchangeMailboxPlansPolicy {
|
||||
public partial class SettingsExchangeMailboxPlansPolicy
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// asyncTasks control.
|
||||
|
@ -624,5 +626,7 @@ namespace WebsitePanel.Portal {
|
|||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.TextBox txtStatus;
|
||||
|
||||
protected global::System.Web.UI.WebControls.Button btnSetDefaultMailboxPlan;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -546,7 +546,7 @@ namespace WebsitePanel.Portal
|
|||
WDeployPublishingConfirmPasswordTextBox,
|
||||
WDeployPublishingAccountRequiredFieldValidator);
|
||||
|
||||
WDeployPublishingAccountTextBox.Text = AutoSuggestWmSvcAccontName(item, "_deploy");
|
||||
WDeployPublishingAccountTextBox.Text = AutoSuggestWmSvcAccontName(item, "_dploy");
|
||||
//
|
||||
WDeployPublishingAccountRequiredFieldValidator.Enabled = true;
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue