Merge
This commit is contained in:
commit
b60e9238c0
13 changed files with 133 additions and 48 deletions
|
@ -141,6 +141,8 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
|
||||
private System.Threading.SendOrPostCallback ImportCollectionOperationCompleted;
|
||||
|
||||
private System.Threading.SendOrPostCallback GetRemoteDesktopServiceIdOperationCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
public esRemoteDesktopServices() {
|
||||
this.Url = "http://localhost:9002/esRemoteDesktopServices.asmx";
|
||||
|
@ -311,6 +313,9 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
/// <remarks/>
|
||||
public event ImportCollectionCompletedEventHandler ImportCollectionCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
public event GetRemoteDesktopServiceIdCompletedEventHandler GetRemoteDesktopServiceIdCompleted;
|
||||
|
||||
/// <remarks/>
|
||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetRdsCollection", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
||||
public RdsCollection GetRdsCollection(int collectionId) {
|
||||
|
@ -2772,6 +2777,47 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetRemoteDesktopServiceId", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
||||
public int GetRemoteDesktopServiceId(int itemId) {
|
||||
object[] results = this.Invoke("GetRemoteDesktopServiceId", new object[] {
|
||||
itemId});
|
||||
return ((int)(results[0]));
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public System.IAsyncResult BeginGetRemoteDesktopServiceId(int itemId, System.AsyncCallback callback, object asyncState) {
|
||||
return this.BeginInvoke("GetRemoteDesktopServiceId", new object[] {
|
||||
itemId}, callback, asyncState);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public int EndGetRemoteDesktopServiceId(System.IAsyncResult asyncResult) {
|
||||
object[] results = this.EndInvoke(asyncResult);
|
||||
return ((int)(results[0]));
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void GetRemoteDesktopServiceIdAsync(int itemId) {
|
||||
this.GetRemoteDesktopServiceIdAsync(itemId, null);
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public void GetRemoteDesktopServiceIdAsync(int itemId, object userState) {
|
||||
if ((this.GetRemoteDesktopServiceIdOperationCompleted == null)) {
|
||||
this.GetRemoteDesktopServiceIdOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRemoteDesktopServiceIdOperationCompleted);
|
||||
}
|
||||
this.InvokeAsync("GetRemoteDesktopServiceId", new object[] {
|
||||
itemId}, this.GetRemoteDesktopServiceIdOperationCompleted, userState);
|
||||
}
|
||||
|
||||
private void OnGetRemoteDesktopServiceIdOperationCompleted(object arg) {
|
||||
if ((this.GetRemoteDesktopServiceIdCompleted != null)) {
|
||||
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
|
||||
this.GetRemoteDesktopServiceIdCompleted(this, new GetRemoteDesktopServiceIdCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public new void CancelAsync(object userState) {
|
||||
base.CancelAsync(userState);
|
||||
|
@ -4207,4 +4253,30 @@ namespace WebsitePanel.EnterpriseServer {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||
public delegate void GetRemoteDesktopServiceIdCompletedEventHandler(object sender, GetRemoteDesktopServiceIdCompletedEventArgs e);
|
||||
|
||||
/// <remarks/>
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||
[System.Diagnostics.DebuggerStepThroughAttribute()]
|
||||
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||
public partial class GetRemoteDesktopServiceIdCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
|
||||
|
||||
private object[] results;
|
||||
|
||||
internal GetRemoteDesktopServiceIdCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
|
||||
base(exception, cancelled, userState) {
|
||||
this.results = results;
|
||||
}
|
||||
|
||||
/// <remarks/>
|
||||
public int Result {
|
||||
get {
|
||||
this.RaiseExceptionIfNecessary();
|
||||
return ((int)(this.results[0]));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,6 +56,11 @@ namespace WebsitePanel.EnterpriseServer
|
|||
|
||||
}
|
||||
|
||||
public static int GetRemoteDesktopServiceId(int itemId)
|
||||
{
|
||||
return GetRdsServiceId(itemId);
|
||||
}
|
||||
|
||||
public static RdsCollection GetRdsCollection(int collectionId)
|
||||
{
|
||||
return GetRdsCollectionInternal(collectionId);
|
||||
|
|
|
@ -392,5 +392,11 @@ namespace WebsitePanel.EnterpriseServer
|
|||
{
|
||||
return RemoteDesktopServicesController.ImportCollection(itemId, collectionName);
|
||||
}
|
||||
|
||||
[WebMethod]
|
||||
public int GetRemoteDesktopServiceId(int itemId)
|
||||
{
|
||||
return RemoteDesktopServicesController.GetRemoteDesktopServiceId(itemId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ namespace WebsitePanel.EnterpriseServer.Base.RDS
|
|||
public const string DISABLE_CMD = "DisableCMD";
|
||||
public const string DISABLE_CMD_ADMINISTRATORS = "DisableCMDAdministrators";
|
||||
public const string DISABLE_CMD_USERS = "DisableCMDUsers";
|
||||
public const string ALLOWCONNECTIONSIMPORT = "AllowConnectionsImport";
|
||||
public const string ALLOWCOLLECTIONSIMPORT = "AllowCollectionsImport";
|
||||
|
||||
public string SettingsName { get; set; }
|
||||
public int ServerId { get; set; }
|
||||
|
|
|
@ -147,4 +147,7 @@
|
|||
<data name="lblComputersRootOU.Text" xml:space="preserve">
|
||||
<value>Computers Root OU:</value>
|
||||
</data>
|
||||
<data name="cbCollectionsImport.Text" xml:space="preserve">
|
||||
<value>Allow Collections Import</value>
|
||||
</data>
|
||||
</root>
|
|
@ -57,7 +57,12 @@
|
|||
</asp:Panel>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<table>
|
||||
<table>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<asp:CheckBox runat="server" Text="Allow Collections Import" ID="cbCollectionsImport" meta:resourcekey="cbCollectionsImport" Checked="false" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="SubHead" width="200" nowrap>
|
||||
<asp:Label runat="server" ID="lblConnectionBroker" meta:resourcekey="lblConnectionBroker" Text="Connection Broker:"/>
|
||||
|
|
|
@ -32,13 +32,14 @@ using System.Collections.Generic;
|
|||
using System.Security.Cryptography.X509Certificates;
|
||||
using System.Web.UI.WebControls;
|
||||
using WebsitePanel.EnterpriseServer;
|
||||
using WebsitePanel.EnterpriseServer.Base.RDS;
|
||||
using WebsitePanel.Providers.Common;
|
||||
using WebsitePanel.Providers.RemoteDesktopServices;
|
||||
|
||||
namespace WebsitePanel.Portal.ProviderControls
|
||||
{
|
||||
public partial class RDS_Settings : WebsitePanelControlBase, IHostingServiceProviderSettings
|
||||
{
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
FillCertificateInfo();
|
||||
|
@ -98,6 +99,11 @@ namespace WebsitePanel.Portal.ProviderControls
|
|||
txtCentralNPS.Enabled = false;
|
||||
txtCentralNPS.Text = string.Empty;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(settings[RdsServerSettings.ALLOWCOLLECTIONSIMPORT]))
|
||||
{
|
||||
cbCollectionsImport.Checked = Convert.ToBoolean(settings[RdsServerSettings.ALLOWCOLLECTIONSIMPORT]);
|
||||
}
|
||||
}
|
||||
|
||||
public void SaveSettings(System.Collections.Specialized.StringDictionary settings)
|
||||
|
@ -108,6 +114,7 @@ namespace WebsitePanel.Portal.ProviderControls
|
|||
settings["PrimaryDomainController"] = txtPrimaryDomainController.Text;
|
||||
settings["UseCentralNPS"] = chkUseCentralNPS.Checked.ToString();
|
||||
settings["CentralNPS"] = chkUseCentralNPS.Checked ? txtCentralNPS.Text : string.Empty;
|
||||
settings[RdsServerSettings.ALLOWCOLLECTIONSIMPORT] = cbCollectionsImport.Checked.ToString();
|
||||
|
||||
settings["GWServrsList"] = GWServers;
|
||||
|
||||
|
|
|
@ -84,6 +84,15 @@ namespace WebsitePanel.Portal.ProviderControls {
|
|||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblExpiryDate;
|
||||
|
||||
/// <summary>
|
||||
/// cbCollectionsImport 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 cbCollectionsImport;
|
||||
|
||||
/// <summary>
|
||||
/// lblConnectionBroker control.
|
||||
/// </summary>
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
using System;
|
||||
using System.Collections.Specialized;
|
||||
using System.Linq;
|
||||
using System.Web.UI.WebControls;
|
||||
using WebsitePanel.EnterpriseServer;
|
||||
|
@ -55,8 +56,10 @@ namespace WebsitePanel.Portal.RDS
|
|||
btnAddCollection.Enabled = (!(cntx.Quotas[Quotas.RDS_COLLECTIONS].QuotaAllocatedValue <= gvRDSCollections.Rows.Count) || (cntx.Quotas[Quotas.RDS_COLLECTIONS].QuotaAllocatedValue == -1));
|
||||
}
|
||||
|
||||
var defaultSettings = ES.Services.Users.GetUserSettings(PanelSecurity.EffectiveUserId, UserSettings.RDS_POLICY);
|
||||
var allowImport = Convert.ToBoolean(defaultSettings[RdsServerSettings.ALLOWCONNECTIONSIMPORT]);
|
||||
var serviceId = ES.Services.RDS.GetRemoteDesktopServiceId(PanelRequest.ItemID);
|
||||
var settings = ConvertArrayToDictionary(ES.Services.Servers.GetServiceSettings(serviceId));
|
||||
|
||||
var allowImport = Convert.ToBoolean(settings[RdsServerSettings.ALLOWCOLLECTIONSIMPORT]);
|
||||
|
||||
if (!allowImport)
|
||||
{
|
||||
|
@ -64,6 +67,8 @@ namespace WebsitePanel.Portal.RDS
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void BindQuota(PackageContext cntx)
|
||||
{
|
||||
OrganizationStatistics stats = ES.Services.Organizations.GetOrganizationStatisticsByOrganization(PanelRequest.ItemID);
|
||||
|
@ -142,5 +147,16 @@ namespace WebsitePanel.Portal.RDS
|
|||
{
|
||||
return EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "rds_edit_collection", "CollectionId=" + collectionId, "ItemID=" + PanelRequest.ItemID);
|
||||
}
|
||||
|
||||
private StringDictionary ConvertArrayToDictionary(string[] settings)
|
||||
{
|
||||
StringDictionary r = new StringDictionary();
|
||||
foreach (string setting in settings)
|
||||
{
|
||||
int idx = setting.IndexOf('=');
|
||||
r.Add(setting.Substring(0, idx), setting.Substring(idx + 1));
|
||||
}
|
||||
return r;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -181,14 +181,3 @@
|
|||
</table>
|
||||
<br />
|
||||
</asp:Panel>
|
||||
<wsp:CollapsiblePanel id="secAllowImport" runat="server" TargetControlID="allowImportPanel" meta:resourcekey="secAllowImport" Text="Connections Import"/>
|
||||
<asp:Panel ID="allowImportPanel" runat="server" Height="0" style="overflow:hidden;">
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<asp:CheckBox runat="server" Text="Users" ID="cbAllowImport" meta:resourcekey="cbAllowImport" Checked="false" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br />
|
||||
</asp:Panel>
|
||||
|
|
|
@ -52,8 +52,7 @@ namespace WebsitePanel.Portal
|
|||
cbDisableCmdAdministrators.Checked = Convert.ToBoolean(settings[RdsServerSettings.DISABLE_CMD_ADMINISTRATORS]);
|
||||
cbDisableCmdUsers.Checked = Convert.ToBoolean(settings[RdsServerSettings.DISABLE_CMD_USERS]);
|
||||
|
||||
ddTreshold.SelectedValue = settings[RdsServerSettings.DRIVE_SPACE_THRESHOLD_VALUE];
|
||||
cbAllowImport.Checked = Convert.ToBoolean(settings[RdsServerSettings.ALLOWCONNECTIONSIMPORT]);
|
||||
ddTreshold.SelectedValue = settings[RdsServerSettings.DRIVE_SPACE_THRESHOLD_VALUE];
|
||||
}
|
||||
|
||||
public void SaveSettings(UserSettings settings)
|
||||
|
@ -81,8 +80,7 @@ namespace WebsitePanel.Portal
|
|||
settings[RdsServerSettings.RDS_CONTROL_WITHOUT_PERMISSION_ADMINISTRATORS] = cbControlSessionAdministrators.Checked.ToString();
|
||||
settings[RdsServerSettings.RDS_CONTROL_WITHOUT_PERMISSION_Users] = cbControlSessionUsers.Checked.ToString();
|
||||
settings[RdsServerSettings.DISABLE_CMD_ADMINISTRATORS] = cbDisableCmdAdministrators.Checked.ToString();
|
||||
settings[RdsServerSettings.DISABLE_CMD_USERS] = cbDisableCmdUsers.Checked.ToString();
|
||||
settings[RdsServerSettings.ALLOWCONNECTIONSIMPORT] = cbAllowImport.Checked.ToString();
|
||||
settings[RdsServerSettings.DISABLE_CMD_USERS] = cbDisableCmdUsers.Checked.ToString();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -443,32 +443,5 @@ namespace WebsitePanel.Portal {
|
|||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.CheckBox cbDisableCmdAdministrators;
|
||||
|
||||
/// <summary>
|
||||
/// secAllowImport control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::WebsitePanel.Portal.CollapsiblePanel secAllowImport;
|
||||
|
||||
/// <summary>
|
||||
/// allowImportPanel 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 allowImportPanel;
|
||||
|
||||
/// <summary>
|
||||
/// cbAllowImport 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 cbAllowImport;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6538,7 +6538,9 @@
|
|||
<Content Include="RDS\UserControls\App_LocalResources\RDSCollectionApps.ascx.resx">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
<Content Include="ProviderControls\App_LocalResources\RDS_Settings.ascx.resx" />
|
||||
<Content Include="ProviderControls\App_LocalResources\RDS_Settings.ascx.resx">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
<Content Include="UserControls\App_LocalResources\DomainControl.ascx.resx">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue