Merge
This commit is contained in:
commit
e9648c5758
11 changed files with 320 additions and 59 deletions
|
@ -422,7 +422,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
|
|
||||||
private static RdsServersPaged GetOrganizationRdsServersPagedInternal(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows)
|
private static RdsServersPaged GetOrganizationRdsServersPagedInternal(int itemId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows)
|
||||||
{
|
{
|
||||||
DataSet ds = DataProvider.GetRDSServersPaged(itemId, null, filterColumn, filterValue, sortColumn, startRow, maximumRows);
|
DataSet ds = DataProvider.GetRDSServersPaged(itemId, null, filterColumn, filterValue, sortColumn, startRow, maximumRows, ignoreRdsCollectionId: true);
|
||||||
|
|
||||||
RdsServersPaged result = new RdsServersPaged();
|
RdsServersPaged result = new RdsServersPaged();
|
||||||
result.RecordsCount = (int)ds.Tables[0].Rows[0][0];
|
result.RecordsCount = (int)ds.Tables[0].Rows[0][0];
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
|
{
|
||||||
|
public enum RdsPolicyTypes
|
||||||
|
{
|
||||||
|
RdCap,
|
||||||
|
RdRap
|
||||||
|
}
|
||||||
|
}
|
|
@ -125,6 +125,7 @@
|
||||||
<Compile Include="RemoteDesktopServices\IRemoteDesktopServices.cs" />
|
<Compile Include="RemoteDesktopServices\IRemoteDesktopServices.cs" />
|
||||||
<Compile Include="RemoteDesktopServices\RdsCollection.cs" />
|
<Compile Include="RemoteDesktopServices\RdsCollection.cs" />
|
||||||
<Compile Include="RemoteDesktopServices\RdsCollectionPaged.cs" />
|
<Compile Include="RemoteDesktopServices\RdsCollectionPaged.cs" />
|
||||||
|
<Compile Include="RemoteDesktopServices\RdsPolicyTypes.cs" />
|
||||||
<Compile Include="RemoteDesktopServices\RdsServer.cs" />
|
<Compile Include="RemoteDesktopServices\RdsServer.cs" />
|
||||||
<Compile Include="RemoteDesktopServices\RdsServersPaged.cs" />
|
<Compile Include="RemoteDesktopServices\RdsServersPaged.cs" />
|
||||||
<Compile Include="RemoteDesktopServices\RemoteApplication.cs" />
|
<Compile Include="RemoteDesktopServices\RemoteApplication.cs" />
|
||||||
|
|
|
@ -62,7 +62,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
private const string Users = "users";
|
private const string Users = "users";
|
||||||
private const string RdsGroupFormat = "rds-{0}-{1}";
|
private const string RdsGroupFormat = "rds-{0}-{1}";
|
||||||
private const string RdsModuleName = "RemoteDesktopServices";
|
private const string RdsModuleName = "RemoteDesktopServices";
|
||||||
private const string AddNpsString = "netsh nps add np name=\"\"{0}\"\" policysource=\"1\" processingorder=\"{1}\" conditionid=\"0x3d\" conditiondata=\"^5$\" conditionid=\"0x1fb5\" conditiondata=\"{2}\" conditionid=\"0x1fb4\" conditiondata=\"{3}\" conditionid=\"0x1e\" conditiondata=\"UserAuthType:(PW|CA)\" profileid=\"0x1005\" profiledata=\"TRUE\" profileid=\"0x100f\" profiledata=\"TRUE\" profileid=\"0x1009\" profiledata=\"0x7\" profileid=\"0x1fe6\" profiledata=\"0x40000000\"";
|
private const string AddNpsString = "netsh nps add np name=\"\"{0}\"\" policysource=\"1\" processingorder=\"{1}\" conditionid=\"0x3d\" conditiondata=\"^5$\" conditionid=\"0x1fb5\" conditiondata=\"{2}\" conditionid=\"0x1e\" conditiondata=\"UserAuthType:(PW|CA)\" profileid=\"0x1005\" profiledata=\"TRUE\" profileid=\"0x100f\" profiledata=\"TRUE\" profileid=\"0x1009\" profiledata=\"0x7\" profileid=\"0x1fe6\" profiledata=\"0x40000000\"";
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Properties
|
#region Properties
|
||||||
|
@ -194,21 +194,22 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
ActiveDirectoryUtils.CreateGroup(orgPath, GetUsersGroupName(collection.Name));
|
ActiveDirectoryUtils.CreateGroup(orgPath, GetUsersGroupName(collection.Name));
|
||||||
}
|
}
|
||||||
|
|
||||||
var policyName = GetPolicyName(organizationId, collection.Name);
|
var capPolicyName = GetPolicyName(organizationId, collection.Name, RdsPolicyTypes.RdCap);
|
||||||
|
var rapPolicyName = GetPolicyName(organizationId, collection.Name, RdsPolicyTypes.RdRap);
|
||||||
|
|
||||||
foreach (var gateway in Gateways)
|
foreach (var gateway in Gateways)
|
||||||
{
|
{
|
||||||
if (!CentralNps)
|
if (!CentralNps)
|
||||||
{
|
{
|
||||||
CreateRdCapForce(runSpace, gateway, policyName, collection.Name, new List<string> { GetUsersGroupName(collection.Name) });
|
CreateRdCapForce(runSpace, gateway, capPolicyName, collection.Name, new List<string> { GetUsersGroupName(collection.Name) });
|
||||||
}
|
}
|
||||||
|
|
||||||
CreateRdRapForce(runSpace, gateway, policyName, collection.Name, new List<string> { GetUsersGroupName(collection.Name) });
|
CreateRdRapForce(runSpace, gateway, rapPolicyName, collection.Name, new List<string> { GetUsersGroupName(collection.Name) });
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CentralNps)
|
if (CentralNps)
|
||||||
{
|
{
|
||||||
CreateCentralNpsPolicy(runSpace, CentralNpsHost, policyName, collection.Name, organizationId);
|
CreateCentralNpsPolicy(runSpace, CentralNpsHost, capPolicyName, collection.Name, organizationId);
|
||||||
}
|
}
|
||||||
|
|
||||||
//add user group to collection
|
//add user group to collection
|
||||||
|
@ -280,21 +281,22 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
|
|
||||||
ExecuteShellCommand(runSpace, cmd, false);
|
ExecuteShellCommand(runSpace, cmd, false);
|
||||||
|
|
||||||
var policyName = GetPolicyName(organizationId, collectionName);
|
var capPolicyName = GetPolicyName(organizationId, collectionName, RdsPolicyTypes.RdCap);
|
||||||
|
var rapPolicyName = GetPolicyName(organizationId, collectionName, RdsPolicyTypes.RdRap);
|
||||||
|
|
||||||
foreach (var gateway in Gateways)
|
foreach (var gateway in Gateways)
|
||||||
{
|
{
|
||||||
if (!CentralNps)
|
if (!CentralNps)
|
||||||
{
|
{
|
||||||
RemoveRdCap(runSpace, gateway, policyName);
|
RemoveRdCap(runSpace, gateway, capPolicyName);
|
||||||
}
|
}
|
||||||
|
|
||||||
RemoveRdRap(runSpace, gateway, policyName);
|
RemoveRdRap(runSpace, gateway, rapPolicyName);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CentralNps)
|
if (CentralNps)
|
||||||
{
|
{
|
||||||
RemoveNpsPolicy(runSpace, CentralNpsHost, policyName);
|
RemoveNpsPolicy(runSpace, CentralNpsHost, capPolicyName);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Remove security group
|
//Remove security group
|
||||||
|
@ -553,11 +555,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
|
|
||||||
var userGroupSid = (byte[])ActiveDirectoryUtils.GetADObjectProperty(userGroupAd, "objectSid");
|
var userGroupSid = (byte[])ActiveDirectoryUtils.GetADObjectProperty(userGroupAd, "objectSid");
|
||||||
|
|
||||||
var computerGroupAd = ActiveDirectoryUtils.GetADObject(GetComputerGroupPath(organizationId, collectionName));
|
var addCmdString = string.Format(AddNpsString, policyName.Replace(" ", "_"), count, ConvertByteToStringSid(userGroupSid));
|
||||||
|
|
||||||
var computerGroupSid = (byte[])ActiveDirectoryUtils.GetADObjectProperty(computerGroupAd, "objectSid");
|
|
||||||
|
|
||||||
var addCmdString = string.Format(AddNpsString, policyName.Replace(" ", "_"), count, ConvertByteToStringSid(userGroupSid), ConvertByteToStringSid(computerGroupSid));
|
|
||||||
|
|
||||||
Command addCmd = new Command(addCmdString);
|
Command addCmd = new Command(addCmdString);
|
||||||
|
|
||||||
|
@ -582,13 +580,11 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
}
|
}
|
||||||
|
|
||||||
var userGroupParametr = string.Format("@({0})",string.Join(",", groups.Select(x => string.Format("\"{0}@{1}\"", x, RootDomain)).ToArray()));
|
var userGroupParametr = string.Format("@({0})",string.Join(",", groups.Select(x => string.Format("\"{0}@{1}\"", x, RootDomain)).ToArray()));
|
||||||
var computerGroupParameter = string.Format("\"{0}@{1}\"", GetComputersGroupName(collectionName), RootDomain);
|
|
||||||
|
|
||||||
Command rdCapCommand = new Command("New-Item");
|
Command rdCapCommand = new Command("New-Item");
|
||||||
rdCapCommand.Parameters.Add("Path", string.Format("\"{0}\"", CapPath));
|
rdCapCommand.Parameters.Add("Path", string.Format("\"{0}\"", CapPath));
|
||||||
rdCapCommand.Parameters.Add("Name", string.Format("\"{0}\"", policyName));
|
rdCapCommand.Parameters.Add("Name", string.Format("\"{0}\"", policyName));
|
||||||
rdCapCommand.Parameters.Add("UserGroups", userGroupParametr);
|
rdCapCommand.Parameters.Add("UserGroups", userGroupParametr);
|
||||||
rdCapCommand.Parameters.Add("ComputerGroups", computerGroupParameter);
|
|
||||||
rdCapCommand.Parameters.Add("AuthMethod", 1);
|
rdCapCommand.Parameters.Add("AuthMethod", 1);
|
||||||
|
|
||||||
ExecuteRemoteShellCommand(runSpace, gatewayHost, rdCapCommand, RdsModuleName);
|
ExecuteRemoteShellCommand(runSpace, gatewayHost, rdCapCommand, RdsModuleName);
|
||||||
|
@ -936,9 +932,25 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
ExecuteRemoteShellCommand(runSpace, hostname, rdRapCommand, imports);
|
ExecuteRemoteShellCommand(runSpace, hostname, rdRapCommand, imports);
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetPolicyName(string organizationId, string collectionName)
|
private string GetPolicyName(string organizationId, string collectionName, RdsPolicyTypes policyType)
|
||||||
{
|
{
|
||||||
return string.Format("rds-{0}-{1}", organizationId, collectionName);
|
string policyName = string.Format("{0}-{1}-", organizationId, collectionName);
|
||||||
|
|
||||||
|
switch (policyType)
|
||||||
|
{
|
||||||
|
case RdsPolicyTypes.RdCap:
|
||||||
|
{
|
||||||
|
policyName += "RDCAP";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case RdsPolicyTypes.RdRap:
|
||||||
|
{
|
||||||
|
policyName += "RDRAP";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return policyName;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetComputersGroupName(string collectionName)
|
private string GetComputersGroupName(string collectionName)
|
||||||
|
|
|
@ -0,0 +1,129 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<data name="btnAdd.Text" xml:space="preserve">
|
||||||
|
<value>Add</value>
|
||||||
|
</data>
|
||||||
|
<data name="gvGWServers.EmptyDataText" xml:space="preserve">
|
||||||
|
<value>No gateway serves have been added yet.</value>
|
||||||
|
</data>
|
||||||
|
<data name="ServerNameColumn.HeaderText" xml:space="preserve">
|
||||||
|
<value>Server Name</value>
|
||||||
|
</data>
|
||||||
|
</root>
|
|
@ -9,15 +9,6 @@
|
||||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtConnectionBroker" Display="Dynamic" ErrorMessage="*" />
|
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="txtConnectionBroker" Display="Dynamic" ErrorMessage="*" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<td class="SubHead" width="200" nowrap>
|
|
||||||
<asp:Label runat="server" ID="lblGateway" meta:resourcekey="lblGateway" Text="Gateway Servers:"/>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<asp:TextBox runat="server" ID="txtGateway" MaxLength="1000" Width="200px" />
|
|
||||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="txtGateway" Display="Dynamic" ErrorMessage="*" />
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
<tr>
|
||||||
<td class="SubHead" width="200" nowrap>
|
<td class="SubHead" width="200" nowrap>
|
||||||
<asp:Label runat="server" ID="lblRootOU" meta:resourcekey="lblRootOU" Text="Root OU:"/>
|
<asp:Label runat="server" ID="lblRootOU" meta:resourcekey="lblRootOU" Text="Root OU:"/>
|
||||||
|
@ -52,4 +43,33 @@
|
||||||
<asp:TextBox runat="server" ID="txtCentralNPS" Width="200px"/>
|
<asp:TextBox runat="server" ID="txtCentralNPS" Width="200px"/>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="SubHead" width="200" nowrap valign="top">
|
||||||
|
<asp:Localize ID="locGWServers" runat="server" meta:resourcekey="locGWServers"
|
||||||
|
Text="Gateway Servers:"></asp:Localize>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<asp:TextBox runat="server" ID="txtAddGWServer" MaxLength="1000" Width="200px" />
|
||||||
|
<asp:Button runat="server" ID="btnAddGWServer" OnClick="btnAddGWServer_Click" meta:resourcekey="btnAdd"
|
||||||
|
CssClass="Button1" /><br />
|
||||||
|
<asp:GridView ID="gvGWServers" runat="server" AutoGenerateColumns="False" EmptyDataText="gvRecords"
|
||||||
|
CssSelectorClass="NormalGridView" OnRowCommand="gvGWServers_RowCommand" meta:resourcekey="gvGWServers">
|
||||||
|
<Columns>
|
||||||
|
<asp:TemplateField meta:resourcekey="ServerNameColumn" ItemStyle-Width="100%" >
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:Label runat="server" ID="lblServerName" Text='<%#Eval("ServerName")%>' />
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
|
||||||
|
<asp:TemplateField>
|
||||||
|
<ItemTemplate>
|
||||||
|
<asp:ImageButton ID="cmdDelete" runat="server" SkinID="DeleteSmall" CommandName="RemoveServer"
|
||||||
|
CommandArgument='<%#Eval("ServerName") %>' meta:resourcekey="cmdDelete" AlternateText="Delete"
|
||||||
|
OnClientClick="return confirm('Delete?');"></asp:ImageButton>
|
||||||
|
</ItemTemplate>
|
||||||
|
</asp:TemplateField>
|
||||||
|
</Columns>
|
||||||
|
</asp:GridView>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
|
@ -27,6 +27,8 @@
|
||||||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Web.UI.WebControls;
|
||||||
using WebsitePanel.EnterpriseServer;
|
using WebsitePanel.EnterpriseServer;
|
||||||
using WebsitePanel.Providers.Common;
|
using WebsitePanel.Providers.Common;
|
||||||
|
|
||||||
|
@ -39,10 +41,26 @@ namespace WebsitePanel.Portal.ProviderControls
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string GWServers
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return ViewState["GWServers"] != null ? ViewState["GWServers"].ToString() : string.Empty;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
ViewState["GWServers"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void BindSettings(System.Collections.Specialized.StringDictionary settings)
|
public void BindSettings(System.Collections.Specialized.StringDictionary settings)
|
||||||
{
|
{
|
||||||
txtConnectionBroker.Text = settings["ConnectionBroker"];
|
txtConnectionBroker.Text = settings["ConnectionBroker"];
|
||||||
txtGateway.Text = settings["GWServrsList"];
|
|
||||||
|
GWServers = settings["GWServrsList"];
|
||||||
|
|
||||||
|
UpdateLyncServersGrid();
|
||||||
|
|
||||||
txtRootOU.Text = settings["RootOU"];
|
txtRootOU.Text = settings["RootOU"];
|
||||||
txtPrimaryDomainController.Text = settings["PrimaryDomainController"];
|
txtPrimaryDomainController.Text = settings["PrimaryDomainController"];
|
||||||
|
|
||||||
|
@ -63,11 +81,12 @@ namespace WebsitePanel.Portal.ProviderControls
|
||||||
public void SaveSettings(System.Collections.Specialized.StringDictionary settings)
|
public void SaveSettings(System.Collections.Specialized.StringDictionary settings)
|
||||||
{
|
{
|
||||||
settings["ConnectionBroker"] = txtConnectionBroker.Text;
|
settings["ConnectionBroker"] = txtConnectionBroker.Text;
|
||||||
settings["GWServrsList"] = txtGateway.Text;
|
|
||||||
settings["RootOU"] = txtRootOU.Text;
|
settings["RootOU"] = txtRootOU.Text;
|
||||||
settings["PrimaryDomainController"] = txtPrimaryDomainController.Text;
|
settings["PrimaryDomainController"] = txtPrimaryDomainController.Text;
|
||||||
settings["UseCentralNPS"] = chkUseCentralNPS.Checked.ToString();
|
settings["UseCentralNPS"] = chkUseCentralNPS.Checked.ToString();
|
||||||
settings["CentralNPS"] = chkUseCentralNPS.Checked ? txtCentralNPS.Text : string.Empty;
|
settings["CentralNPS"] = chkUseCentralNPS.Checked ? txtCentralNPS.Text : string.Empty;
|
||||||
|
|
||||||
|
settings["GWServrsList"] = GWServers;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void chkUseCentralNPS_CheckedChanged(object sender, EventArgs e)
|
protected void chkUseCentralNPS_CheckedChanged(object sender, EventArgs e)
|
||||||
|
@ -75,6 +94,61 @@ namespace WebsitePanel.Portal.ProviderControls
|
||||||
txtCentralNPS.Enabled = chkUseCentralNPS.Checked;
|
txtCentralNPS.Enabled = chkUseCentralNPS.Checked;
|
||||||
txtCentralNPS.Text = chkUseCentralNPS.Checked ? txtCentralNPS.Text : string.Empty;
|
txtCentralNPS.Text = chkUseCentralNPS.Checked ? txtCentralNPS.Text : string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void btnAddGWServer_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(GWServers))
|
||||||
|
GWServers += ";";
|
||||||
|
|
||||||
|
GWServers += txtAddGWServer.Text;
|
||||||
|
|
||||||
|
txtAddGWServer.Text = string.Empty;
|
||||||
|
|
||||||
|
UpdateLyncServersGrid();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<GWServer> GetServices(string data)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(data))
|
||||||
|
return null;
|
||||||
|
List<GWServer> list = new List<GWServer>();
|
||||||
|
string[] serversNames = data.Split(';');
|
||||||
|
foreach (string current in serversNames)
|
||||||
|
{
|
||||||
|
list.Add(new GWServer { ServerName = current });
|
||||||
|
}
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateLyncServersGrid()
|
||||||
|
{
|
||||||
|
gvGWServers.DataSource = GetServices(GWServers);
|
||||||
|
gvGWServers.DataBind();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void gvGWServers_RowCommand(object sender, GridViewCommandEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.CommandName == "RemoveServer")
|
||||||
|
{
|
||||||
|
string str = string.Empty;
|
||||||
|
List<GWServer> servers = GetServices(GWServers);
|
||||||
|
foreach (GWServer current in servers)
|
||||||
|
{
|
||||||
|
if (current.ServerName == e.CommandArgument.ToString())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
str += current.ServerName + ";";
|
||||||
|
}
|
||||||
|
|
||||||
|
GWServers = str.TrimEnd(';');
|
||||||
|
UpdateLyncServersGrid();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class GWServer
|
||||||
|
{
|
||||||
|
public string ServerName { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -39,33 +39,6 @@ namespace WebsitePanel.Portal.ProviderControls {
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator2;
|
protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator2;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// lblGateway 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 lblGateway;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// txtGateway 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 txtGateway;
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// RequiredFieldValidator3 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 RequiredFieldValidator3;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// lblRootOU control.
|
/// lblRootOU control.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -155,5 +128,41 @@ namespace WebsitePanel.Portal.ProviderControls {
|
||||||
/// 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::System.Web.UI.WebControls.TextBox txtCentralNPS;
|
protected global::System.Web.UI.WebControls.TextBox txtCentralNPS;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// locGWServers 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.Localize locGWServers;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// txtAddGWServer 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 txtAddGWServer;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// btnAddGWServer 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.Button btnAddGWServer;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gvGWServers 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.GridView gvGWServers;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,9 +55,10 @@
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
<asp:TemplateField>
|
<asp:TemplateField>
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:LinkButton ID="imgRemove1" runat="server" Text="Remove"
|
<asp:LinkButton ID="imgRemove1" runat="server" Text="Remove" Visible='<%# Eval("RdsCollectionId") == null %>'
|
||||||
CommandName="DeleteItem" CommandArgument='<%# Eval("Id") %>'
|
CommandName="DeleteItem" CommandArgument='<%# Eval("Id") %>'
|
||||||
meta:resourcekey="cmdDelete" OnClientClick="return confirm('Are you sure you want to remove selected server?')"></asp:LinkButton>
|
meta:resourcekey="cmdDelete" OnClientClick="return confirm('Are you sure you want to remove selected server?')"></asp:LinkButton>
|
||||||
|
<asp:Label ID="lbRemove" Text="Remove" runat="server" Visible='<%# Eval("RdsCollectionId") != null %>'></asp:Label>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
</Columns>
|
</Columns>
|
||||||
|
|
|
@ -131,6 +131,7 @@ namespace WebsitePanel.Portal.RDS.UserControls
|
||||||
servers.AddRange(GetGridViewServers(SelectedState.All));
|
servers.AddRange(GetGridViewServers(SelectedState.All));
|
||||||
|
|
||||||
// add new servers
|
// add new servers
|
||||||
|
|
||||||
if (newServers != null)
|
if (newServers != null)
|
||||||
{
|
{
|
||||||
foreach (RdsServer newServer in newServers)
|
foreach (RdsServer newServer in newServers)
|
||||||
|
|
|
@ -5535,6 +5535,7 @@
|
||||||
<Content Include="RDS\UserControls\App_LocalResources\RDSCollectionUsers.ascx.resx" />
|
<Content Include="RDS\UserControls\App_LocalResources\RDSCollectionUsers.ascx.resx" />
|
||||||
<Content Include="RDS\UserControls\App_LocalResources\RDSCollectionServers.ascx.resx" />
|
<Content Include="RDS\UserControls\App_LocalResources\RDSCollectionServers.ascx.resx" />
|
||||||
<Content Include="RDS\UserControls\App_LocalResources\RDSCollectionApps.ascx.resx" />
|
<Content Include="RDS\UserControls\App_LocalResources\RDSCollectionApps.ascx.resx" />
|
||||||
|
<Content Include="ProviderControls\App_LocalResources\RDS_Settings.ascx.resx" />
|
||||||
<EmbeddedResource Include="UserControls\App_LocalResources\EditDomainsList.ascx.resx">
|
<EmbeddedResource Include="UserControls\App_LocalResources\EditDomainsList.ascx.resx">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue