Fixed display sql server external and internal name
This commit is contained in:
parent
6187d6f1ce
commit
3bee86e791
6 changed files with 56 additions and 66 deletions
|
@ -96,6 +96,12 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
database.ServiceId = item.ServiceId;
|
database.ServiceId = item.ServiceId;
|
||||||
database.GroupName = item.GroupName;
|
database.GroupName = item.GroupName;
|
||||||
|
|
||||||
|
StringDictionary settings = ServerController.GetServiceSettings(item.ServiceId);
|
||||||
|
|
||||||
|
|
||||||
|
if (settings["InternalAddress"] != null) database.InternalServerName = settings["InternalAddress"];
|
||||||
|
if (settings["ExternalAddress"] != null) database.ExternalServerName = settings["ExternalAddress"];
|
||||||
|
|
||||||
return database;
|
return database;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,8 @@ namespace WebsitePanel.Providers.Database
|
||||||
private int logSize;
|
private int logSize;
|
||||||
private string[] users;
|
private string[] users;
|
||||||
private string location;
|
private string location;
|
||||||
|
private string internalServerName;
|
||||||
|
private string externalServerName;
|
||||||
|
|
||||||
public SqlDatabase()
|
public SqlDatabase()
|
||||||
{
|
{
|
||||||
|
@ -92,5 +94,19 @@ namespace WebsitePanel.Providers.Database
|
||||||
get { return this.location; }
|
get { return this.location; }
|
||||||
set { this.location = value; }
|
set { this.location = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string InternalServerName
|
||||||
|
{
|
||||||
|
get { return this.internalServerName; }
|
||||||
|
set { this.internalServerName = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public string ExternalServerName
|
||||||
|
{
|
||||||
|
get { return this.externalServerName; }
|
||||||
|
set { this.externalServerName = value; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,10 +112,10 @@
|
||||||
<value>2.0</value>
|
<value>2.0</value>
|
||||||
</resheader>
|
</resheader>
|
||||||
<resheader name="reader">
|
<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>
|
||||||
<resheader name="writer">
|
<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>
|
</resheader>
|
||||||
<data name="btnCancel.Text" xml:space="preserve">
|
<data name="btnCancel.Text" xml:space="preserve">
|
||||||
<value>Cancel</value>
|
<value>Cancel</value>
|
||||||
|
@ -132,13 +132,13 @@
|
||||||
<data name="lblDatabaseName.Text" xml:space="preserve">
|
<data name="lblDatabaseName.Text" xml:space="preserve">
|
||||||
<value>Database name:</value>
|
<value>Database name:</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="lblDBInternalServer.Text" xml:space="preserve">
|
<data name="secUsers.Text" xml:space="preserve">
|
||||||
|
<value>Users</value>
|
||||||
|
</data>
|
||||||
|
<data name="lblDBInternalServer.Text" xml:space="preserve">
|
||||||
<value>Internal DB Server:</value>
|
<value>Internal DB Server:</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="lblDBExternalServer.Text" xml:space="preserve">
|
<data name="lblDBExternalServer.Text" xml:space="preserve">
|
||||||
<value>External DB Server:</value>
|
<value>External DB Server:</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="secUsers.Text" xml:space="preserve">
|
|
||||||
<value>Users</value>
|
|
||||||
</data>
|
|
||||||
</root>
|
</root>
|
|
@ -23,17 +23,15 @@ function confirmation()
|
||||||
<td class="NormalBold">
|
<td class="NormalBold">
|
||||||
<uc2:UsernameControl ID="usernameControl" runat="server" />
|
<uc2:UsernameControl ID="usernameControl" runat="server" />
|
||||||
</td>
|
</td>
|
||||||
</tr> <tr>
|
|
||||||
<td class="SubHead" style="width: 150px;"><asp:Label ID="lblDBInternalServer" runat="server" meta:resourcekey="lblDBInternalServer" Text="Internal Server:"></asp:Label></td>
|
|
||||||
<td class="NormalBold">
|
|
||||||
<uc2:UsernameControl ID="usernameControl2" runat="server" />
|
|
||||||
</td>
|
|
||||||
</tr></tr> <tr>
|
|
||||||
<td class="SubHead" style="width: 150px;"><asp:Label ID="lblDBExternalServer" runat="server" meta:resourcekey="lblDBExternalServer" Text="External Server:"></asp:Label></td>
|
|
||||||
<td class="NormalBold">
|
|
||||||
<uc2:UsernameControl ID="usernameControl3" runat="server" />
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="SubHead" style="width: 150px;"><asp:Label ID="lblDBInternalServer" runat="server" meta:resourcekey="lblDBInternalServer" Text="Internal Server:"></asp:Label></td>
|
||||||
|
<td class="Normal"><asp:Literal ID="litDBInternalServer" runat="server"></asp:Literal></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="SubHead" style="width: 150px;"><asp:Label ID="lblDBExternalServer" runat="server" meta:resourcekey="lblDBExternalServer" Text="External Server:"></asp:Label></td>
|
||||||
|
<td class="Normal"><asp:Literal ID="litDBExternalServer" runat="server"></asp:Literal></td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
|
|
|
@ -125,6 +125,19 @@ namespace WebsitePanel.Portal
|
||||||
|
|
||||||
if (item != null)
|
if (item != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(item.ExternalServerName))
|
||||||
|
{
|
||||||
|
lblDBExternalServer.Visible =litDBExternalServer.Visible = true;
|
||||||
|
litDBExternalServer.Text = item.ExternalServerName;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(item.InternalServerName))
|
||||||
|
{
|
||||||
|
lblDBInternalServer.Visible = litDBInternalServer.Visible = true;
|
||||||
|
litDBInternalServer.Text = item.InternalServerName;
|
||||||
|
}
|
||||||
|
|
||||||
// save package info
|
// save package info
|
||||||
ViewState["PackageId"] = item.PackageId;
|
ViewState["PackageId"] = item.PackageId;
|
||||||
usernameControl.SetPackagePolicy(item.PackageId, policyName, "DatabaseNamePolicy");
|
usernameControl.SetPackagePolicy(item.PackageId, policyName, "DatabaseNamePolicy");
|
||||||
|
@ -135,6 +148,9 @@ namespace WebsitePanel.Portal
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
lblDBExternalServer.Visible = lblDBInternalServer.Visible = false;
|
||||||
|
litDBExternalServer.Visible = litDBInternalServer.Visible = false;
|
||||||
|
|
||||||
// new item
|
// new item
|
||||||
ViewState["PackageId"] = PanelSecurity.PackageId;
|
ViewState["PackageId"] = PanelSecurity.PackageId;
|
||||||
usernameControl.SetPackagePolicy(PanelSecurity.PackageId, policyName, "DatabaseNamePolicy");
|
usernameControl.SetPackagePolicy(PanelSecurity.PackageId, policyName, "DatabaseNamePolicy");
|
||||||
|
@ -149,29 +165,11 @@ namespace WebsitePanel.Portal
|
||||||
if (!IsPostBack)
|
if (!IsPostBack)
|
||||||
{
|
{
|
||||||
// bind item to controls
|
// bind item to controls
|
||||||
string myintserveraddress = "";
|
|
||||||
string myextserveraddress = "";
|
|
||||||
if (item != null)
|
if (item != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
string[] mysettings = ES.Services.Servers.GetServiceSettings(item.ServiceId);
|
|
||||||
foreach (string setting in mysettings)
|
|
||||||
{
|
|
||||||
string[] pair = setting.Split('=');
|
|
||||||
if(String.Equals(pair[0], "ExternalAddress", StringComparison.InvariantCultureIgnoreCase))
|
|
||||||
myextserveraddress = pair[1];
|
|
||||||
if (String.Equals(pair[0], "InternalAddress", StringComparison.InvariantCultureIgnoreCase))
|
|
||||||
myintserveraddress = pair[1];
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// bind item to controls
|
// bind item to controls
|
||||||
usernameControl.Text = item.Name;
|
usernameControl.Text = item.Name;
|
||||||
usernameControl.EditMode = true;
|
usernameControl.EditMode = true;
|
||||||
usernameControl3.Text = myextserveraddress;
|
|
||||||
usernameControl3.EditMode = true;
|
|
||||||
usernameControl2.Text = myintserveraddress;
|
|
||||||
usernameControl2.EditMode = true;
|
|
||||||
foreach (string user in item.Users)
|
foreach (string user in item.Users)
|
||||||
{
|
{
|
||||||
ListItem li = dlUsers.Items.FindByValue(user);
|
ListItem li = dlUsers.Items.FindByValue(user);
|
||||||
|
|
|
@ -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>
|
// <auto-generated>
|
||||||
// This code was generated by a tool.
|
// This code was generated by a tool.
|
||||||
|
@ -77,13 +49,13 @@ namespace WebsitePanel.Portal {
|
||||||
protected global::System.Web.UI.WebControls.Label lblDBInternalServer;
|
protected global::System.Web.UI.WebControls.Label lblDBInternalServer;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// usernameControl2 control.
|
/// litDBInternalServer control.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Auto-generated field.
|
/// Auto-generated field.
|
||||||
/// To modify move field declaration from designer file to code-behind file.
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::WebsitePanel.Portal.UsernameControl usernameControl2;
|
protected global::System.Web.UI.WebControls.Literal litDBInternalServer;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// lblDBExternalServer control.
|
/// lblDBExternalServer control.
|
||||||
|
@ -95,13 +67,13 @@ namespace WebsitePanel.Portal {
|
||||||
protected global::System.Web.UI.WebControls.Label lblDBExternalServer;
|
protected global::System.Web.UI.WebControls.Label lblDBExternalServer;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// usernameControl3 control.
|
/// litDBExternalServer control.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Auto-generated field.
|
/// Auto-generated field.
|
||||||
/// To modify move field declaration from designer file to code-behind file.
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::WebsitePanel.Portal.UsernameControl usernameControl3;
|
protected global::System.Web.UI.WebControls.Literal litDBExternalServer;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// secUsers control.
|
/// secUsers control.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue