This commit is contained in:
Virtuworks 2014-10-10 19:29:39 -04:00
commit 4e01a8c616
6 changed files with 383 additions and 137 deletions

View file

@ -112,10 +112,10 @@
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="chkBuildUncFilesPath.Text" xml:space="preserve">
<value>Yes</value>
@ -138,4 +138,7 @@
<data name="Text.SelectSite" xml:space="preserve">
<value>&lt;Select FTP Site&gt;</value>
</data>
<data name="lblAdFtpRoot.Text" xml:space="preserve">
<value>FTP RootDir:</value>
</data>
</root>

View file

@ -1,45 +1,61 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MSFTP70_Settings.ascx.cs" Inherits="WebsitePanel.Portal.ProviderControls.MSFTP70_Settings" %>
<%@ Register Src="Common_ActiveDirectoryIntegration.ascx" TagName="ActiveDirectoryIntegration" TagPrefix="uc1" %>
<%@ Register Src="../UserControls/SelectIPAddress.ascx" TagName="SelectIPAddress" TagPrefix="uc1" %>
<table cellpadding="4" cellspacing="0" width="100%">
<tr>
<td class="Normal" width="200" nowrap>
<asp:Label ID="lblSharedIP" runat="server" meta:resourcekey="lblSharedIP" Text="Web Sites Shared IP Address:"></asp:Label>
</td>
<td width="100%">
<table width="100%">
<tr>
<td class="SubHead" width="150">
<asp:Label ID="lblSharedIP" runat="server" meta:resourcekey="lblSharedIP" Text="Web Sites Shared IP Address:"></asp:Label>
</td>
<td class="Normal">
<uc1:SelectIPAddress ID="ipAddress" runat="server" ServerIdParam="ServerID" />
</td>
</tr>
<tr>
<td class="SubHead" width="200" nowrap>
<asp:Label ID="lblSite" runat="server" meta:resourcekey="lblSite" Text="FTP Accounts Site:"></asp:Label>
</td>
<td width="100%">
<asp:TextBox ID="txtSiteId" runat="server" CssClass="NormalTextBox" Width="200px"></asp:TextBox>
</td>
</tr>
<tr>
<td class="SubHead">
<asp:Label ID="lblGroupName" runat="server" meta:resourcekey="lblGroupName" Text="FTP Users Group Name:"></asp:Label>
</td>
<td class="Normal">
</tr>
</table>
<asp:UpdatePanel runat="server" UpdateMode="Conditional">
<ContentTemplate>
<table width="100%">
<tr>
<td class="SubHead" width="150">
<asp:Label ID="lblSite" runat="server" meta:resourcekey="lblSite" Text="FTP Accounts Site:"></asp:Label>
</td>
<td class="Normal">
<asp:DropDownList runat="server" ID="ddlSite" AutoPostBack="True" OnSelectedIndexChanged="ddlSite_SelectedIndexChanged" />
</td>
</tr>
<tr runat="server" id="FtpRootRow" visible="False">
<td class="SubHead">
<asp:Label ID="lblAdFtpRoot" runat="server" meta:resourcekey="lblAdFtpRoot" Text="FTP RootDir:"></asp:Label>
</td>
<td class="Normal">
<asp:TextBox ID="txtAdFtpRoot" runat="server" CssClass="NormalTextBox" Width="200px"></asp:TextBox>
<asp:RequiredFieldValidator runat="server" ID="txtAdFtpRootReqValidator" ControlToValidate="txtAdFtpRoot" Enabled="False" ErrorMessage="*"></asp:RequiredFieldValidator>
</td>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<table width="100%">
<tr>
<td class="SubHead" width="150">
<asp:Label ID="lblGroupName" runat="server" meta:resourcekey="lblGroupName" Text="FTP Users Group Name:"></asp:Label>
</td>
<td class="Normal">
<asp:TextBox ID="txtFtpGroupName" runat="server" CssClass="NormalTextBox" Width="200px"></asp:TextBox></td>
</tr>
<tr>
<td class="SubHead">
<asp:Label ID="lblBuildUncFilesPath" runat="server" meta:resourcekey="lblBuildUncFilesPath" Text="Build UNC Path to Space Files:"></asp:Label>
</td>
<td>
<asp:CheckBox ID="chkBuildUncFilesPath" runat="server" meta:resourcekey="chkBuildUncFilesPath" Text="Yes" />
</td>
</tr>
<tr>
<td class="SubHead">
<asp:Label ID="lblADIntegration" runat="server" meta:resourcekey="lblADIntegration" Text="Active Directory Integration:"></asp:Label>
</td>
<td class="Normal">
<uc1:ActiveDirectoryIntegration ID="ActiveDirectoryIntegration" runat="server" />
</tr>
<tr>
<td class="SubHead">
<asp:Label ID="lblBuildUncFilesPath" runat="server" meta:resourcekey="lblBuildUncFilesPath" Text="Build UNC Path to Space Files:"></asp:Label>
</td>
</tr>
</table>
<td>
<asp:CheckBox ID="chkBuildUncFilesPath" runat="server" meta:resourcekey="chkBuildUncFilesPath" Text="Yes" />
</td>
</tr>
<tr>
<td class="SubHead">
<asp:Label ID="lblADIntegration" runat="server" meta:resourcekey="lblADIntegration" Text="Active Directory Integration:"></asp:Label>
</td>
<td class="Normal">
<uc1:ActiveDirectoryIntegration ID="ActiveDirectoryIntegration" runat="server" />
</td>
</tr>
</table>

View file

@ -27,10 +27,12 @@
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Collections.Generic;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Specialized;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
@ -51,7 +53,8 @@ namespace WebsitePanel.Portal.ProviderControls
{
int selectedAddressid = this.FindAddressByText(settings["SharedIP"]);
ipAddress.AddressId = (selectedAddressid > 0) ? selectedAddressid : 0;
txtSiteId.Text = settings["SiteId"];
BindSiteId(settings);
txtAdFtpRoot.Text = settings["AdFtpRoot"];
txtFtpGroupName.Text = settings["FtpGroupName"];
chkBuildUncFilesPath.Checked = Utils.ParseBool(settings["BuildUncFilesPath"], false);
ActiveDirectoryIntegration.BindSettings(settings);
@ -75,7 +78,11 @@ namespace WebsitePanel.Portal.ProviderControls
{
settings["SharedIP"] = String.Empty;
}
settings["SiteId"] = txtSiteId.Text.Trim();
settings["SiteId"] = ddlSite.SelectedValue;
if (!string.IsNullOrWhiteSpace(txtAdFtpRoot.Text))
{
settings["AdFtpRoot"] = txtAdFtpRoot.Text.Trim();
}
settings["FtpGroupName"] = txtFtpGroupName.Text.Trim();
settings["BuildUncFilesPath"] = chkBuildUncFilesPath.Checked.ToString();
ActiveDirectoryIntegration.SaveSettings(settings);
@ -92,5 +99,31 @@ namespace WebsitePanel.Portal.ProviderControls
}
return 0;
}
private void BindSiteId(StringDictionary settings)
{
var sites = ES.Services.FtpServers.GetFtpSites(PanelRequest.ServiceId);
foreach (var site in sites)
{
var item = new ListItem(site.Name + " (User Isolation Mode: " + site["UserIsolationMode"] + ")", site.Name);
if (item.Value == settings["SiteId"])
{
item.Selected = true;
}
ddlSite.Items.Add(item);
}
ddlSite_SelectedIndexChanged(this, null);
}
protected void ddlSite_SelectedIndexChanged(object sender, EventArgs e)
{
var isActiveDirectoryUserIsolated = ddlSite.SelectedItem.Text.Contains("ActiveDirectory");
FtpRootRow.Visible = isActiveDirectoryUserIsolated;
txtAdFtpRootReqValidator.Enabled= isActiveDirectoryUserIsolated;
}
}
}

View file

@ -1,22 +1,15 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.1378
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WebsitePanel.Portal.ProviderControls {
/// <summary>
/// MSFTP70_Settings class.
/// </summary>
/// <remarks>
/// Auto-generated class.
/// </remarks>
public partial class MSFTP70_Settings {
/// <summary>
@ -47,13 +40,49 @@ namespace WebsitePanel.Portal.ProviderControls {
protected global::System.Web.UI.WebControls.Label lblSite;
/// <summary>
/// txtSiteId control.
/// ddlSite 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.TextBox txtSiteId;
protected global::System.Web.UI.WebControls.DropDownList ddlSite;
/// <summary>
/// FtpRootRow control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlTableRow FtpRootRow;
/// <summary>
/// lblAdFtpRoot 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 lblAdFtpRoot;
/// <summary>
/// txtAdFtpRoot 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.TextBox txtAdFtpRoot;
/// <summary>
/// txtAdFtpRootReqValidator 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.RequiredFieldValidator txtAdFtpRootReqValidator;
/// <summary>
/// lblGroupName control.