Honor Web Policy for ColdFusion

This commit is contained in:
akovach 2015-02-11 14:38:37 -06:00
parent 3d6f6fc7a2
commit ed94701e7c
7 changed files with 83 additions and 3 deletions

View file

@ -381,7 +381,10 @@ namespace WebsitePanel.EnterpriseServer
site.PerlInstalled = Utils.ParseBool(webPolicy["PerlInstalled"], false); site.PerlInstalled = Utils.ParseBool(webPolicy["PerlInstalled"], false);
site.PythonInstalled = Utils.ParseBool(webPolicy["PythonInstalled"], false); site.PythonInstalled = Utils.ParseBool(webPolicy["PythonInstalled"], false);
site.CgiBinInstalled = Utils.ParseBool(webPolicy["CgiBinInstalled"], 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 else
@ -404,6 +407,7 @@ namespace WebsitePanel.EnterpriseServer
site.PythonInstalled = false; site.PythonInstalled = false;
site.CgiBinInstalled = false; site.CgiBinInstalled = false;
site.ColdFusionInstalled = false; site.ColdFusionInstalled = false;
site.CreateCFVirtualDirectoriesPol = false;
} }
site.HttpRedirect = ""; site.HttpRedirect = "";

View file

@ -380,7 +380,10 @@ namespace WebsitePanel.EnterpriseServer
site.PerlInstalled = Utils.ParseBool(webPolicy["PerlInstalled"], false); site.PerlInstalled = Utils.ParseBool(webPolicy["PerlInstalled"], false);
site.PythonInstalled = Utils.ParseBool(webPolicy["PythonInstalled"], false); site.PythonInstalled = Utils.ParseBool(webPolicy["PythonInstalled"], false);
site.CgiBinInstalled = Utils.ParseBool(webPolicy["CgiBinInstalled"], 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 else
@ -403,6 +406,7 @@ namespace WebsitePanel.EnterpriseServer
site.PythonInstalled = false; site.PythonInstalled = false;
site.CgiBinInstalled = false; site.CgiBinInstalled = false;
site.ColdFusionInstalled = false; site.ColdFusionInstalled = false;
site.CreateCFVirtualDirectoriesPol = false;
} }
site.HttpRedirect = ""; site.HttpRedirect = "";

View file

@ -55,6 +55,7 @@ namespace WebsitePanel.Providers.Web
private bool frontPageInstalled; private bool frontPageInstalled;
private bool coldFusionAvailable; private bool coldFusionAvailable;
private bool createCFVirtualDirectories; private bool createCFVirtualDirectories;
private bool createCFVirtualDirectoriesPol;
private string frontPageAccount; private string frontPageAccount;
private string frontPagePassword; private string frontPagePassword;
private string coldFusionVersion; private string coldFusionVersion;
@ -158,6 +159,12 @@ namespace WebsitePanel.Providers.Web
set { this.createCFVirtualDirectories = value; } set { this.createCFVirtualDirectories = value; }
} }
public bool CreateCFVirtualDirectoriesPol
{
get { return this.createCFVirtualDirectoriesPol; }
set { this.createCFVirtualDirectoriesPol = value; }
}
public ServerState SiteState public ServerState SiteState
{ {
get { return this.siteState; } get { return this.siteState; }

View file

@ -1349,6 +1349,11 @@ namespace WebsitePanel.Providers.Web
// //
UpdateCgiBinFolder(site); 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 try
{ {
webObjectsSvc.ChangeSiteState(site.SiteId, ServerState.Started); webObjectsSvc.ChangeSiteState(site.SiteId, ServerState.Started);
@ -1448,6 +1453,7 @@ namespace WebsitePanel.Providers.Web
{ {
DeleteCFVirtualDirectories(site.SiteId); DeleteCFVirtualDirectories(site.SiteId);
site.CreateCFVirtualDirectories = false; site.CreateCFVirtualDirectories = false;
site.CreateCFVirtualDirectoriesPol = false;
} }
else else
{ {
@ -1457,6 +1463,7 @@ namespace WebsitePanel.Providers.Web
{ {
DeleteCFVirtualDirectories(site.SiteId); DeleteCFVirtualDirectories(site.SiteId);
site.CreateCFVirtualDirectories = false; site.CreateCFVirtualDirectories = false;
site.CreateCFVirtualDirectoriesPol = false;
} }
} }
else else
@ -1465,6 +1472,7 @@ namespace WebsitePanel.Providers.Web
{ {
CreateCFVirtualDirectories(site.SiteId); CreateCFVirtualDirectories(site.SiteId);
site.CreateCFVirtualDirectories = true; site.CreateCFVirtualDirectories = true;
site.CreateCFVirtualDirectoriesPol = true;
} }
} }
} }

View file

@ -181,6 +181,23 @@
<td class="Normal"> <td class="Normal">
<asp:CheckBox ID="chkCgiBin" runat="server" Text="Installed" /></td> <asp:CheckBox ID="chkCgiBin" runat="server" Text="Installed" /></td>
</tr> </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> </table>
</asp:Panel> </asp:Panel>

View file

@ -76,6 +76,8 @@ namespace WebsitePanel.Portal
chkPerl.Checked = Utils.ParseBool(settings["PerlInstalled"], false); chkPerl.Checked = Utils.ParseBool(settings["PerlInstalled"], false);
chkPython.Checked = Utils.ParseBool(settings["PythonInstalled"], false); chkPython.Checked = Utils.ParseBool(settings["PythonInstalled"], false);
chkCgiBin.Checked = Utils.ParseBool(settings["CgiBinInstalled"], 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 // anonymous account policy
anonymousUsername.Value = settings["AnonymousAccountPolicy"]; anonymousUsername.Value = settings["AnonymousAccountPolicy"];
@ -130,6 +132,8 @@ namespace WebsitePanel.Portal
settings["PerlInstalled"] = chkPerl.Checked.ToString(); settings["PerlInstalled"] = chkPerl.Checked.ToString();
settings["PythonInstalled"] = chkPython.Checked.ToString(); settings["PythonInstalled"] = chkPython.Checked.ToString();
settings["CgiBinInstalled"] = chkCgiBin.Checked.ToString(); settings["CgiBinInstalled"] = chkCgiBin.Checked.ToString();
settings["ColdFusionInstalled"] = chkCfExt.Checked.ToString();
settings["CreateCFVirtualDirectoriesPol"] = chkVirtDir.Checked.ToString();
// anonymous account policy // anonymous account policy
settings["AnonymousAccountPolicy"] = anonymousUsername.Value; settings["AnonymousAccountPolicy"] = anonymousUsername.Value;

View file

@ -463,6 +463,42 @@ namespace WebsitePanel.Portal {
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.CheckBox chkCgiBin; 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> /// <summary>
/// secAnonymousAccount control. /// secAnonymousAccount control.
/// </summary> /// </summary>