Added: WebHosting: Moved hostname support enablement to hosting plan to enable

closer compatibility with legacy approach.

Default hostname set within webpolicy settings
This commit is contained in:
robvde 2012-10-13 10:54:24 +04:00
parent 71875ca55f
commit b4a760f6ec
24 changed files with 235 additions and 42 deletions

View file

@ -5904,4 +5904,13 @@ HAVING (COUNT(DomainName) = 1))
DROP TABLE #TempDomains
COMMIT TRAN
GO
GO
IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Web.EnableHostNameSupport')
BEGIN
INSERT [dbo].[Quotas] ([QuotaID], [GroupID], [QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (334, 2, 23, N'Web.EnableHostNameSupport', N'Enable Hostname Support', 1, 0, NULL)
END
GO

View file

@ -79,7 +79,8 @@ order by rg.groupOrder
public const string WEB_CFVIRTUALDIRS = "Web.CFVirtualDirectories"; //ColdFusion Virtual Directories
public const string WEB_REMOTEMANAGEMENT = "Web.RemoteManagement"; //IIS 7 Remote Management
public const string WEB_SSL = "Web.SSL"; //SSL
public const string WEB_ALLOWIPADDRESSMODESWITCH = "Web.AllowIPAddressModeSwitch"; //SSL
public const string WEB_ALLOWIPADDRESSMODESWITCH = "Web.AllowIPAddressModeSwitch"; //Allow to switch IP Address Mode
public const string WEB_ENABLEHOSTNAMESUPPORT = "Web.EnableHostNameSupport"; //Enable to specify hostnames upon site creation
public const string FTP_ACCOUNTS = "FTP.Accounts"; // FTP Accounts
public const string MAIL_ACCOUNTS = "Mail.Accounts"; // Mail Accounts
public const string MAIL_FORWARDINGS = "Mail.Forwardings"; // Mail Forwardings

View file

@ -9,14 +9,14 @@
<add name="EnterpriseServer" connectionString="server=HSTPROV01;database=WebsitePanelMerge;uid=WebsitePanel;pwd=aj7ep6fyhmw3b5qeth7c;" />
<add name="EnterpriseServer" connectionString="server=HSTWSP01;database=WebsitePanelMerge;uid=WebsitePanel;pwd=pserxfbnlc6hwmdedbp0;" providerName="System.Data.SqlClient" />
-->
<add name="EnterpriseServer" connectionString="server=HSTWSP01;database=WebsitePanelMerge;uid=WebsitePanel;pwd=pserxfbnlc6hwmdedbp0;" providerName="System.Data.SqlClient" />
<add name="EnterpriseServer" connectionString="server=HSTPROV01;database=WebsitePanelMerge;uid=WebsitePanel;pwd=aj7ep6fyhmw3b5qeth7c;" />
</connectionStrings>
<appSettings>
<!--
<add key="WebsitePanel.CryptoKey" value="3x7eqt7zabc5n5afs6dg" />
<add key="WebsitePanel.CryptoKey" value="fr2ym4wn2gmbrj7dz336" />
-->
<add key="WebsitePanel.CryptoKey" value="fr2ym4wn2gmbrj7dz336" />
<add key="WebsitePanel.CryptoKey" value="3x7eqt7zabc5n5afs6dg" />
<add key="WebsitePanel.EncryptionEnabled" value="true" />
<!-- Web Applications -->
<add key="WebsitePanel.EnterpriseServer.WebApplicationsPath" value="~/WebApplications" />

View file

@ -4861,6 +4861,9 @@
<data name="Quota.Web.AllowIPAddressModeSwitch" xml:space="preserve">
<value>Allow IP Address Mode Switch</value>
</data>
<data name="Quota.Web.EnableHostNameSupport" xml:space="preserve">
<value>Enable Hostname Support</value>
</data>
<data name="ServiceItemType.ExchangeOrganization" xml:space="preserve">
<value>Exchange Organization</value>
</data>

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="AllowSubDomains.Text" xml:space="preserve">
<value>Allow customer sub-domains</value>
@ -180,4 +180,7 @@
<data name="SubDomainRequiredValidator.Text" xml:space="preserve">
<value>*</value>
</data>
<data name="lblHostName.Text" xml:space="preserve">
<value>Hostname:</value>
</data>
</root>

View file

@ -219,6 +219,9 @@
<data name="lblGroupName.Text" xml:space="preserve">
<value>Group Name:</value>
</data>
<data name="lblHostName.Text" xml:space="preserve">
<value>Default Hostname: (Only when hostnames are enabled)</value>
</data>
<data name="lblParkingPageContent.Text" xml:space="preserve">
<value>Page Content:</value>
</data>
@ -273,6 +276,9 @@
<data name="secGeneralSettings.Text" xml:space="preserve">
<value>General Settings</value>
</data>
<data name="secHostNamePanel.Text" xml:space="preserve">
<value>Default Hostname</value>
</data>
<data name="secParkingPage.Text" xml:space="preserve">
<value>Parking Page</value>
</data>

View file

@ -126,4 +126,7 @@
<data name="lblDomainName.Text" xml:space="preserve">
<value>Web Site Pointer:</value>
</data>
<data name="lblTheDotInTheMiddle.Text" xml:space="preserve">
<value> . </value>
</data>
</root>

View file

@ -144,6 +144,9 @@
<data name="lblIPHelp2.Text" xml:space="preserve">
<value>Note: A Zone Template is often defined by your host and contains additional Web Site Pointers to create when creating a new Web Site. Static record definitions such as 'www' conflicts when creating an additional Web Site in the same Domain.</value>
</data>
<data name="lblTheDotInTheMiddle.Text" xml:space="preserve">
<value> . </value>
</data>
<data name="rbDedicatedIP.Text" xml:space="preserve">
<value>Dedicated</value>
</data>

View file

@ -295,5 +295,13 @@ namespace WebsitePanel.Portal
(cntx.Quotas[key].QuotaTypeId != 1 && (cntx.Quotas[key].QuotaAllocatedValue > 0 || cntx.Quotas[key].QuotaAllocatedValue == -1)));
}
public static bool CheckQouta(string key, HostingPlanContext cntx)
{
return cntx.Quotas.ContainsKey(key) &&
((cntx.Quotas[key].QuotaAllocatedValue == 1 && cntx.Quotas[key].QuotaTypeId == 1) ||
(cntx.Quotas[key].QuotaTypeId != 1 && (cntx.Quotas[key].QuotaAllocatedValue > 0 || cntx.Quotas[key].QuotaAllocatedValue == -1)));
}
}
}

View file

@ -1,5 +1,6 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="DomainsAddDomain.ascx.cs" Inherits="WebsitePanel.Portal.DomainsAddDomain" %>
<%@ Register Src="UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %>
<%@ Register Src="DomainsSelectDomainControl.ascx" TagName="DomainsSelectDomainControl" TagPrefix="uc1" %>
<%@ Register Src="UserControls/CollapsiblePanel.ascx" TagPrefix="wsp" TagName="CollapsiblePanel" %>
<wsp:EnableAsyncTasksSupport id="asyncTasks" runat="server" />
@ -35,10 +36,23 @@
<br />
<asp:Panel id="CreateWebSitePanel" runat="server" style="padding-bottom: 15px;">
<asp:CheckBox ID="CreateWebSite" runat="server" meta:resourcekey="CreateWebSite" Text="Create Web Site" CssClass="Checkbox Bold" Checked="true" /><br />
<div style="padding-left: 20px;">
<asp:Localize ID="DescribeCreateWebSite" runat="server" meta:resourcekey="DescribeCreateWebSite">Description...</asp:Localize>
</div>
<table>
<tr>
<td class="Normal" width="40" nowrap rowspan="2"></td>
<td>
<asp:CheckBox ID="CreateWebSite" runat="server" meta:resourcekey="CreateWebSite" Text="Create Web Site" CssClass="Checkbox Bold" Checked="true" /><br />
<div style="padding-left: 20px;">
<asp:Localize ID="DescribeCreateWebSite" runat="server" meta:resourcekey="DescribeCreateWebSite">Description...</asp:Localize>
</div>
</td>
</tr>
<tr>
<td class="SubHead">
<asp:Label ID="lblHostName" runat="server" meta:resourcekey="lblHostName" Text="Host name:"></asp:Label>
<asp:TextBox ID="txtHostName" runat="server" CssClass="TextBox100" MaxLength="64" Text="www"></asp:TextBox>
</td>
</tr>
</table>
</asp:Panel>
<asp:Panel id="PointMailDomainPanel" runat="server" style="padding-bottom: 15px;">

View file

@ -41,6 +41,20 @@ namespace WebsitePanel.Portal
{
// bind controls
BindControls();
PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId);
if (Utils.CheckQouta(Quotas.WEB_ENABLEHOSTNAMESUPPORT, cntx))
{
lblHostName.Visible = txtHostName.Visible = true;
UserSettings settings = ES.Services.Users.GetUserSettings(PanelSecurity.LoggedUserId, UserSettings.WEB_POLICY);
txtHostName.Text = String.IsNullOrEmpty(settings["HostName"]) ? "" : settings["HostName"];
}
else
lblHostName.Visible= txtHostName.Visible = false;
}
catch (Exception ex)
{
@ -179,7 +193,7 @@ namespace WebsitePanel.Portal
{
domainId = ES.Services.Servers.AddDomainWithProvisioning(PanelSecurity.PackageId,
domainName.ToLower(), type, CreateWebSite.Checked, pointWebSiteId, pointMailDomainId,
EnableDns.Checked, CreateInstantAlias.Checked, AllowSubDomains.Checked, "");
EnableDns.Checked, CreateInstantAlias.Checked, AllowSubDomains.Checked, txtHostName.Text);
if (domainId < 0)
{

View file

@ -1,31 +1,3 @@
// Copyright (c) 2012, 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.
@ -184,6 +156,24 @@ namespace WebsitePanel.Portal {
/// </remarks>
protected global::System.Web.UI.WebControls.Localize DescribeCreateWebSite;
/// <summary>
/// lblHostName 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 lblHostName;
/// <summary>
/// txtHostName 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 txtHostName;
/// <summary>
/// PointMailDomainPanel control.
/// </summary>

View file

@ -28,6 +28,19 @@
</table>
</asp:Panel>
<wsp:CollapsiblePanel id="secHostNamePanel" runat="server"
TargetControlID="HostNamePanel" meta:resourcekey="secHostNamePanel" Text="Parking Page"/>
<asp:Panel ID="HostNamePanel" runat="server" Height="0" style="overflow:hidden;">
<table width="100%">
<tr>
<td class="SubHead" style="width:150px;"><asp:Label ID="lblHostName" runat="server" meta:resourcekey="lblHostName" Text="Page Name:"></asp:Label></td>
<td class="Normal">
<asp:TextBox ID="txtHostName" runat="server" Width="200" CssClass="NormalTextBox"></asp:TextBox></td>
</tr>
</table>
</asp:Panel>
<wsp:CollapsiblePanel runat="server" ID="WebPublishingProfile"
meta:resourcekey="WebPublishingProfile" Text="Web Publishing Profile" TargetControlID="WebPublishingProfilePanel" />
<asp:Panel runat="server" ID="WebPublishingProfilePanel" Height="0" style="overflow:hidden;">

View file

@ -52,6 +52,9 @@ namespace WebsitePanel.Portal
PublishingProfileTextBox.Text = settings["PublishingProfile"];
chkEnableParkingPageTokens.Checked = Utils.ParseBool(settings["EnableParkingPageTokens"], false);
// HostName
txtHostName.Text = settings["HostName"];
// default documents
if (!String.IsNullOrEmpty(settings["DefaultDocuments"]))
txtDefaultDocs.Text = String.Join("\n", settings["DefaultDocuments"].Split(',', ';'));
@ -105,6 +108,8 @@ namespace WebsitePanel.Portal
settings["PublishingProfile"] = PublishingProfileTextBox.Text;
settings["EnableParkingPageTokens"] = chkEnableParkingPageTokens.Checked.ToString();
settings["HostName"] = txtHostName.Text.Trim();
// default documents
settings["DefaultDocuments"] = String.Join(",", Utils.ParseDelimitedString(txtDefaultDocs.Text, '\n', '\r', ';', ',')); ;

View file

@ -84,6 +84,42 @@ namespace WebsitePanel.Portal {
/// </remarks>
protected global::System.Web.UI.WebControls.CheckBox chkEnableParkingPageTokens;
/// <summary>
/// secHostNamePanel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.CollapsiblePanel secHostNamePanel;
/// <summary>
/// HostNamePanel 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 HostNamePanel;
/// <summary>
/// lblHostName 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 lblHostName;
/// <summary>
/// txtHostName 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 txtHostName;
/// <summary>
/// WebPublishingProfile control.
/// </summary>

View file

@ -1,6 +1,7 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UserCreateSpace.ascx.cs" Inherits="WebsitePanel.Portal.UserCreateSpace" %>
<%@ Register TagPrefix="wsp" TagName="CollapsiblePanel" Src="UserControls/CollapsiblePanel.ascx" %>
<%@ Register Src="UserControls/UsernameControl.ascx" TagName="UsernameControl" TagPrefix="uc4" %>
<%@ Register Src="DomainsSelectDomainControl.ascx" TagName="DomainsSelectDomainControl" TagPrefix="uc1" %>
<%@ Register Src="UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %>
<wsp:EnableAsyncTasksSupport id="asyncTasks" runat="server"/>
@ -97,6 +98,12 @@
Text="Create Web Site" Checked="True" />
</td>
</tr>
<tr>
<td class="SubHead">
<asp:Label ID="lblHostName" runat="server" meta:resourcekey="lblHostName" Text="Host name:"></asp:Label>
<asp:TextBox ID="txtHostName" runat="server" CssClass="TextBox100" MaxLength="64" ></asp:TextBox>
</td>
</tr>
</table>
</fieldset>

View file

@ -44,6 +44,9 @@ namespace WebsitePanel.Portal
ftpAccountName.SetUserPolicy(PanelSecurity.SelectedUserId, UserSettings.FTP_POLICY, "UserNamePolicy");
BindHostingPlans(PanelSecurity.SelectedUserId);
BindHostingPlan();
}
}
catch (Exception ex)
@ -92,6 +95,17 @@ namespace WebsitePanel.Portal
{
systemEnabled = cntx.Groups.ContainsKey(ResourceGroups.Os);
webEnabled = cntx.Groups.ContainsKey(ResourceGroups.Web);
if (Utils.CheckQouta(Quotas.WEB_ENABLEHOSTNAMESUPPORT, cntx))
{
lblHostName.Visible = txtHostName.Visible = true;
UserSettings settings = ES.Services.Users.GetUserSettings(PanelSecurity.LoggedUserId, UserSettings.WEB_POLICY);
txtHostName.Text = String.IsNullOrEmpty(settings["HostName"]) ? "" : settings["HostName"];
}
else
lblHostName.Visible = txtHostName.Visible = false;
ftpEnabled = cntx.Groups.ContainsKey(ResourceGroups.Ftp);
mailEnabled = cntx.Groups.ContainsKey(ResourceGroups.Mail);
}
@ -102,6 +116,7 @@ namespace WebsitePanel.Portal
fsWeb.Visible = webEnabled;
chkCreateWebSite.Checked &= webEnabled;
fsFtp.Visible = ftpEnabled;
chkCreateFtpAccount.Checked &= ftpEnabled;
@ -134,7 +149,7 @@ namespace WebsitePanel.Portal
Utils.ParseInt(ddlStatus.SelectedValue, 0),
chkPackageLetter.Checked,
chkCreateResources.Checked, domainName, false, chkCreateWebSite.Checked,
chkCreateFtpAccount.Checked, ftpAccount, chkCreateMailAccount.Checked, "");
chkCreateFtpAccount.Checked, ftpAccount, chkCreateMailAccount.Checked, txtHostName.Text);
if (result.Result < 0)
{

View file

@ -210,6 +210,24 @@ namespace WebsitePanel.Portal {
/// </remarks>
protected global::System.Web.UI.WebControls.CheckBox chkCreateWebSite;
/// <summary>
/// lblHostName 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 lblHostName;
/// <summary>
/// txtHostName 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 txtHostName;
/// <summary>
/// fsFtp control.
/// </summary>

View file

@ -7,7 +7,7 @@
<asp:Label ID="lblDomainName" runat="server" meta:resourcekey="lblDomainName" Text="Domain name:"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtHostName" runat="server" CssClass="TextBox100" MaxLength="64" Text="www"></asp:TextBox>.<uc1:DomainsSelectDomainControl ID="domainsSelectDomainControl" runat="server" HideWebSites="false" HideDomainPointers="true" HideInstantAlias="true"/>
<asp:TextBox ID="txtHostName" runat="server" CssClass="TextBox100" MaxLength="64" Text="www"></asp:TextBox><asp:Label ID="lblTheDotInTheMiddle" runat="server" meta:resourcekey="lblTheDotInTheMiddle" Text=" . "></asp:Label><uc1:DomainsSelectDomainControl ID="domainsSelectDomainControl" runat="server" HideWebSites="false" HideDomainPointers="true" HideInstantAlias="true"/>
<asp:RequiredFieldValidator ID="valRequireHostName" runat="server" meta:resourcekey="valRequireHostName" ControlToValidate="txtHostName"
ErrorMessage="Enter hostname" ValidationGroup="CreateSite" Display="Dynamic" Text="*" SetFocusOnError="True"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="valRequireCorrectHostName" runat="server"

View file

@ -37,6 +37,8 @@ using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using WebsitePanel.EnterpriseServer;
namespace WebsitePanel.Portal
{
public partial class WebSitesAddPointer : WebsitePanelModuleBase
@ -44,6 +46,19 @@ namespace WebsitePanel.Portal
protected void Page_Load(object sender, EventArgs e)
{
domainsSelectDomainControl.PackageId = PanelSecurity.PackageId;
PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId);
if (Utils.CheckQouta(Quotas.WEB_ENABLEHOSTNAMESUPPORT, cntx))
{
txtHostName.Visible = lblTheDotInTheMiddle.Visible = true;
UserSettings settings = ES.Services.Users.GetUserSettings(PanelSecurity.LoggedUserId, UserSettings.WEB_POLICY);
txtHostName.Text = String.IsNullOrEmpty(settings["HostName"]) ? "" : settings["HostName"];
}
else
txtHostName.Visible = lblTheDotInTheMiddle.Visible = false;
}
private void AddPointer()

View file

@ -30,6 +30,15 @@ namespace WebsitePanel.Portal {
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtHostName;
/// <summary>
/// lblTheDotInTheMiddle 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 lblTheDotInTheMiddle;
/// <summary>
/// domainsSelectDomainControl control.
/// </summary>

View file

@ -11,7 +11,7 @@
<asp:Label ID="lblDomainName" runat="server" meta:resourcekey="lblDomainName" Text="Domain name:"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtHostName" runat="server" CssClass="TextBox100" MaxLength="64" Text="www"></asp:TextBox> . <uc1:DomainsSelectDomainControl ID="domainsSelectDomainControl" runat="server" HideWebSites="false" HideDomainPointers="true" HideInstantAlias="true"/>
<asp:TextBox ID="txtHostName" runat="server" CssClass="TextBox100" MaxLength="64" Text="www"></asp:TextBox><asp:Label ID="lblTheDotInTheMiddle" runat="server" meta:resourcekey="lblTheDotInTheMiddle" Text=" . "></asp:Label><uc1:DomainsSelectDomainControl ID="domainsSelectDomainControl" runat="server" HideWebSites="false" HideDomainPointers="true" HideInstantAlias="true"/>
<asp:RequiredFieldValidator ID="valRequireHostName" runat="server" meta:resourcekey="valRequireHostName" ControlToValidate="txtHostName"
ErrorMessage="Enter hostname" ValidationGroup="CreateSite" Display="Dynamic" Text="*" SetFocusOnError="True"></asp:RequiredFieldValidator>
<asp:RegularExpressionValidator ID="valRequireCorrectHostName" runat="server"

View file

@ -63,6 +63,18 @@ namespace WebsitePanel.Portal
private void ToggleControls()
{
rowDedicatedIP.Visible = rbDedicatedIP.Checked;
PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId);
if (Utils.CheckQouta(Quotas.WEB_ENABLEHOSTNAMESUPPORT, cntx))
{
txtHostName.Visible = chkIgnoreGlobalDNSRecords.Visible = lblIgnoreGlobalDNSRecords.Visible = lblTheDotInTheMiddle.Visible = true;
UserSettings settings = ES.Services.Users.GetUserSettings(PanelSecurity.LoggedUserId, UserSettings.WEB_POLICY);
txtHostName.Text = String.IsNullOrEmpty(settings["HostName"]) ? "" : settings["HostName"];
}
else
txtHostName.Visible = chkIgnoreGlobalDNSRecords.Visible = lblIgnoreGlobalDNSRecords.Visible = lblTheDotInTheMiddle.Visible = false;
}
private void BindIgnoreZoneTemplate()

View file

@ -39,6 +39,15 @@ namespace WebsitePanel.Portal {
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtHostName;
/// <summary>
/// lblTheDotInTheMiddle 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 lblTheDotInTheMiddle;
/// <summary>
/// domainsSelectDomainControl control.
/// </summary>