Added ability to specify log directory for Gene6FTP

This commit is contained in:
Daniel Grotjan 2012-05-24 12:06:36 -04:00
parent 99e93e99da
commit 131fdca1b0
6 changed files with 35 additions and 5 deletions

View file

@ -24160,6 +24160,8 @@ INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [Property
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (12, N'InstallFolder', N'%PROGRAMFILES%\Gene6 FTP Server')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (12, N'LogsFolder', N'%PROGRAMFILES%\Gene6 FTP Server\Log')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (14, N'AdminPassword', N'')
GO
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (14, N'AdminUsername', N'admin')

View file

@ -827,3 +827,9 @@ BEGIN
END
GO
IF NOT EXISTS (SELECT * FROM [dbo].[ServiceDefaultProperties] WHERE [ProviderID] = 12 AND [PropertyName] = 'LogsFolder')
BEGIN
INSERT [dbo].[ServiceDefaultProperties] ([ProviderID], [PropertyName], [PropertyValue]) VALUES (12, N'LogsFolder', N'%PROGRAMFILES%\Gene6 FTP Server\Log')
END
GO

View file

@ -52,6 +52,11 @@ namespace WebsitePanel.Providers.FTP
{
get { return FileUtils.EvaluateSystemVariables(ProviderSettings["InstallFolder"]); }
}
protected string LogsFolder
{
get { return FileUtils.EvaluateSystemVariables(ProviderSettings["LogsFolder"]); }
}
#endregion
#region Sites
@ -589,7 +594,13 @@ TransferLimitType=never");
private string GetLogsPath()
{
if (String.IsNullOrEmpty(LogsFolder))
return GetInstallFolder() + "Log";
else
{
string folder = LogsFolder.Replace("/", "\\");
return folder.TrimEnd('\\');
}
}
private void WriteTextFile(string path, string content)

View file

@ -1,14 +1,21 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Gene6FTP_Settings.ascx.cs" Inherits="WebsitePanel.Portal.ProviderControls.Gene6FTP_Settings" %>
<table cellpadding="4" cellspacing="0" width="100%">
<tr>
<td class="SubHead" valign="top">
<td class="SubHead" nowrap="nowrap">
<asp:Label ID="lblInstallFolder" runat="server" meta:resourcekey="lblInstallFolder" Text="Installation Folder:"></asp:Label>
</td>
<td class="Normal" valign="top">
<asp:TextBox ID="txtInstallFolder" runat="server" CssClass="NormalTextBox" Width="300px"></asp:TextBox></td>
</tr>
<tr>
<td class="SubHead" width="200" nowrap>
<td class="SubHead" nowrap="nowrap">
<asp:Label ID="lblLogsFolder" runat="server" meta:resourcekey="lblLogsFolder" Text="Logs Folder:"></asp:Label>
</td>
<td class="Normal" valign="top">
<asp:TextBox ID="txtLogsFolder" runat="server" CssClass="NormalTextBox" Width="300px"></asp:TextBox></td>
</tr>
<tr>
<td class="SubHead" nowrap="nowrap">
<asp:Label ID="lblSite" runat="server" meta:resourcekey="lblSite" Text="FTP Accounts Site:"></asp:Label>
</td>
<td width="100%">

View file

@ -64,6 +64,7 @@ namespace WebsitePanel.Portal.ProviderControls
Utils.SelectListItem(ddlFtpSite, settings["SiteId"]);
txtInstallFolder.Text = settings["InstallFolder"];
txtLogsFolder.Text = settings["LogsFolder"];
chkBuildUncFilesPath.Checked = Utils.ParseBool(settings["BuildUncFilesPath"], false);
}
@ -71,6 +72,7 @@ namespace WebsitePanel.Portal.ProviderControls
{
settings["SiteId"] = ddlFtpSite.SelectedValue;
settings["InstallFolder"] = txtInstallFolder.Text.Trim();
settings["LogsFolder"] = txtLogsFolder.Text.Trim();
settings["BuildUncFilesPath"] = chkBuildUncFilesPath.Checked.ToString();
}
}

View file

@ -13,6 +13,8 @@ namespace WebsitePanel.Portal.ProviderControls {
public partial class Gene6FTP_Settings {
protected System.Web.UI.WebControls.Label lblInstallFolder;
protected System.Web.UI.WebControls.TextBox txtInstallFolder;
protected System.Web.UI.WebControls.Label lblLogsFolder;
protected System.Web.UI.WebControls.TextBox txtLogsFolder;
protected System.Web.UI.WebControls.Label lblSite;
protected System.Web.UI.WebControls.DropDownList ddlFtpSite;
protected System.Web.UI.WebControls.Label lblBuildUncFilesPath;