Merge
This commit is contained in:
commit
92ba95648f
38 changed files with 828 additions and 401 deletions
|
@ -5508,6 +5508,29 @@ CREATE TABLE [dbo].[RDSCollectionSettings](
|
||||||
|
|
||||||
GO
|
GO
|
||||||
|
|
||||||
|
IF NOT EXISTS(SELECT * FROM sys.columns
|
||||||
|
WHERE [name] = N'SecurityLayer' AND [object_id] = OBJECT_ID(N'RDSCollectionSettings'))
|
||||||
|
BEGIN
|
||||||
|
ALTER TABLE [dbo].[RDSCollectionSettings] ADD SecurityLayer NVARCHAR(20) null;
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
IF NOT EXISTS(SELECT * FROM sys.columns
|
||||||
|
WHERE [name] = N'EncryptionLevel' AND [object_id] = OBJECT_ID(N'RDSCollectionSettings'))
|
||||||
|
BEGIN
|
||||||
|
ALTER TABLE [dbo].[RDSCollectionSettings] ADD EncryptionLevel NVARCHAR(20) null;
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
IF NOT EXISTS(SELECT * FROM sys.columns
|
||||||
|
WHERE [name] = N'AuthenticateUsingNLA' AND [object_id] = OBJECT_ID(N'RDSCollectionSettings'))
|
||||||
|
BEGIN
|
||||||
|
ALTER TABLE [dbo].[RDSCollectionSettings] ADD AuthenticateUsingNLA BIT null;
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
IF NOT EXISTS(SELECT * FROM SYS.TABLES WHERE name = 'RDSCertificates')
|
IF NOT EXISTS(SELECT * FROM SYS.TABLES WHERE name = 'RDSCertificates')
|
||||||
CREATE TABLE [dbo].[RDSCertificates](
|
CREATE TABLE [dbo].[RDSCertificates](
|
||||||
[ID] [int] IDENTITY(1,1) NOT NULL,
|
[ID] [int] IDENTITY(1,1) NOT NULL,
|
||||||
|
|
|
@ -122,6 +122,8 @@ namespace WebsitePanel.EnterpriseServer {
|
||||||
|
|
||||||
private System.Threading.SendOrPostCallback GetRdsCertificateByServiceIdOperationCompleted;
|
private System.Threading.SendOrPostCallback GetRdsCertificateByServiceIdOperationCompleted;
|
||||||
|
|
||||||
|
private System.Threading.SendOrPostCallback GetRdsCertificateByItemIdOperationCompleted;
|
||||||
|
|
||||||
private System.Threading.SendOrPostCallback AddRdsCertificateOperationCompleted;
|
private System.Threading.SendOrPostCallback AddRdsCertificateOperationCompleted;
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
|
@ -267,6 +269,9 @@ namespace WebsitePanel.EnterpriseServer {
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public event GetRdsCertificateByServiceIdCompletedEventHandler GetRdsCertificateByServiceIdCompleted;
|
public event GetRdsCertificateByServiceIdCompletedEventHandler GetRdsCertificateByServiceIdCompleted;
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public event GetRdsCertificateByItemIdCompletedEventHandler GetRdsCertificateByItemIdCompleted;
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public event AddRdsCertificateCompletedEventHandler AddRdsCertificateCompleted;
|
public event AddRdsCertificateCompletedEventHandler AddRdsCertificateCompleted;
|
||||||
|
|
||||||
|
@ -2335,6 +2340,47 @@ namespace WebsitePanel.EnterpriseServer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetRdsCertificateByItemId", 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 RdsCertificate GetRdsCertificateByItemId(int itemId) {
|
||||||
|
object[] results = this.Invoke("GetRdsCertificateByItemId", new object[] {
|
||||||
|
itemId});
|
||||||
|
return ((RdsCertificate)(results[0]));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public System.IAsyncResult BeginGetRdsCertificateByItemId(int itemId, System.AsyncCallback callback, object asyncState) {
|
||||||
|
return this.BeginInvoke("GetRdsCertificateByItemId", new object[] {
|
||||||
|
itemId}, callback, asyncState);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public RdsCertificate EndGetRdsCertificateByItemId(System.IAsyncResult asyncResult) {
|
||||||
|
object[] results = this.EndInvoke(asyncResult);
|
||||||
|
return ((RdsCertificate)(results[0]));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public void GetRdsCertificateByItemIdAsync(int itemId) {
|
||||||
|
this.GetRdsCertificateByItemIdAsync(itemId, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public void GetRdsCertificateByItemIdAsync(int itemId, object userState) {
|
||||||
|
if ((this.GetRdsCertificateByItemIdOperationCompleted == null)) {
|
||||||
|
this.GetRdsCertificateByItemIdOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRdsCertificateByItemIdOperationCompleted);
|
||||||
|
}
|
||||||
|
this.InvokeAsync("GetRdsCertificateByItemId", new object[] {
|
||||||
|
itemId}, this.GetRdsCertificateByItemIdOperationCompleted, userState);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnGetRdsCertificateByItemIdOperationCompleted(object arg) {
|
||||||
|
if ((this.GetRdsCertificateByItemIdCompleted != null)) {
|
||||||
|
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
|
||||||
|
this.GetRdsCertificateByItemIdCompleted(this, new GetRdsCertificateByItemIdCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/AddRdsCertificate", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/AddRdsCertificate", 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 ResultObject AddRdsCertificate(RdsCertificate certificate) {
|
public ResultObject AddRdsCertificate(RdsCertificate certificate) {
|
||||||
|
@ -3578,6 +3624,32 @@ namespace WebsitePanel.EnterpriseServer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||||
|
public delegate void GetRdsCertificateByItemIdCompletedEventHandler(object sender, GetRdsCertificateByItemIdCompletedEventArgs e);
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||||
|
[System.Diagnostics.DebuggerStepThroughAttribute()]
|
||||||
|
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||||
|
public partial class GetRdsCertificateByItemIdCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
|
||||||
|
|
||||||
|
private object[] results;
|
||||||
|
|
||||||
|
internal GetRdsCertificateByItemIdCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
|
||||||
|
base(exception, cancelled, userState) {
|
||||||
|
this.results = results;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public RdsCertificate Result {
|
||||||
|
get {
|
||||||
|
this.RaiseExceptionIfNecessary();
|
||||||
|
return ((RdsCertificate)(this.results[0]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||||
public delegate void AddRdsCertificateCompletedEventHandler(object sender, AddRdsCertificateCompletedEventArgs e);
|
public delegate void AddRdsCertificateCompletedEventHandler(object sender, AddRdsCertificateCompletedEventArgs e);
|
||||||
|
|
|
@ -288,6 +288,11 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
return GetRdsCertificateByServiceIdInternal(serviceId);
|
return GetRdsCertificateByServiceIdInternal(serviceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static RdsCertificate GetRdsCertificateByItemId(int itemId)
|
||||||
|
{
|
||||||
|
return GetRdsCertificateByItemIdInternal(itemId);
|
||||||
|
}
|
||||||
|
|
||||||
public static ResultObject AddRdsCertificate(RdsCertificate certificate)
|
public static ResultObject AddRdsCertificate(RdsCertificate certificate)
|
||||||
{
|
{
|
||||||
return AddRdsCertificateInternal(certificate);
|
return AddRdsCertificateInternal(certificate);
|
||||||
|
@ -346,6 +351,21 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static RdsCertificate GetRdsCertificateByItemIdInternal(int itemId)
|
||||||
|
{
|
||||||
|
Organization org = OrganizationController.GetOrganization(itemId);
|
||||||
|
|
||||||
|
if (org == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
int serviceId = GetRemoteDesktopServiceID(org.PackageId);
|
||||||
|
var result = ObjectUtils.FillObjectFromDataReader<RdsCertificate>(DataProvider.GetRdsCertificateByServiceId(serviceId));
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
private static ResultObject AddRdsCertificateInternal(RdsCertificate certificate)
|
private static ResultObject AddRdsCertificateInternal(RdsCertificate certificate)
|
||||||
{
|
{
|
||||||
var result = TaskManager.StartResultTask<ResultObject>("REMOTE_DESKTOP_SERVICES", "ADD_RDS_SERVER");
|
var result = TaskManager.StartResultTask<ResultObject>("REMOTE_DESKTOP_SERVICES", "ADD_RDS_SERVER");
|
||||||
|
@ -431,7 +451,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
var organizationUsers = OrganizationController.GetOrganizationUsersPaged(collection.ItemId, null, null, null, 0, Int32.MaxValue).PageUsers;
|
var organizationUsers = OrganizationController.GetOrganizationUsersPaged(collection.ItemId, null, null, null, 0, Int32.MaxValue).PageUsers;
|
||||||
var organizationAdmins = rds.GetRdsCollectionLocalAdmins(org.OrganizationId, collection.Name);
|
var organizationAdmins = rds.GetRdsCollectionLocalAdmins(org.OrganizationId, collection.Name);
|
||||||
|
|
||||||
return organizationUsers.Where(o => organizationAdmins.Select(a => a.ToLower()).Contains(o.DomainUserName.ToLower())).ToList();
|
return organizationUsers.Where(o => organizationAdmins.Select(a => a.ToLower()).Contains(o.SamAccountName.ToLower())).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ResultObject SaveRdsCollectionLocalAdminsInternal(OrganizationUser[] users, int collectionId)
|
private static ResultObject SaveRdsCollectionLocalAdminsInternal(OrganizationUser[] users, int collectionId)
|
||||||
|
@ -479,6 +499,8 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
var collection = ObjectUtils.FillObjectFromDataReader<RdsCollection>(DataProvider.GetRDSCollectionById(collectionId));
|
var collection = ObjectUtils.FillObjectFromDataReader<RdsCollection>(DataProvider.GetRDSCollectionById(collectionId));
|
||||||
var settings = ObjectUtils.FillObjectFromDataReader<RdsCollectionSettings>(DataProvider.GetRdsCollectionSettingsByCollectionId(collectionId));
|
var settings = ObjectUtils.FillObjectFromDataReader<RdsCollectionSettings>(DataProvider.GetRdsCollectionSettingsByCollectionId(collectionId));
|
||||||
|
|
||||||
|
if (settings != null)
|
||||||
|
{
|
||||||
if (settings.SecurityLayer == null)
|
if (settings.SecurityLayer == null)
|
||||||
{
|
{
|
||||||
settings.SecurityLayer = SecurityLayerValues.Negotiate.ToString();
|
settings.SecurityLayer = SecurityLayerValues.Negotiate.ToString();
|
||||||
|
@ -493,6 +515,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
{
|
{
|
||||||
settings.AuthenticateUsingNLA = true;
|
settings.AuthenticateUsingNLA = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return settings;
|
return settings;
|
||||||
}
|
}
|
||||||
|
@ -512,9 +535,23 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
private static int AddRdsCollectionInternal(int itemId, RdsCollection collection)
|
private static int AddRdsCollectionInternal(int itemId, RdsCollection collection)
|
||||||
{
|
{
|
||||||
var result = TaskManager.StartResultTask<ResultObject>("REMOTE_DESKTOP_SERVICES", "ADD_RDS_COLLECTION");
|
var result = TaskManager.StartResultTask<ResultObject>("REMOTE_DESKTOP_SERVICES", "ADD_RDS_COLLECTION");
|
||||||
|
var domainName = IPGlobalProperties.GetIPGlobalProperties().DomainName;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
foreach(var server in collection.Servers)
|
||||||
|
{
|
||||||
|
if (!server.FqdName.EndsWith(domainName, StringComparison.CurrentCultureIgnoreCase))
|
||||||
|
{
|
||||||
|
throw TaskManager.WriteError(new Exception("Fully Qualified Domain Name not valid."));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!CheckRDSServerAvaliable(server.FqdName))
|
||||||
|
{
|
||||||
|
throw TaskManager.WriteError(new Exception(string.Format("Unable to connect to {0} server.", server.FqdName)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// load organization
|
// load organization
|
||||||
Organization org = OrganizationController.GetOrganization(itemId);
|
Organization org = OrganizationController.GetOrganization(itemId);
|
||||||
if (org == null)
|
if (org == null)
|
||||||
|
@ -995,24 +1032,21 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (CheckRDSServerAvaliable(rdsServer.FqdName))
|
if (CheckRDSServerAvaliable(rdsServer.FqdName))
|
||||||
|
{
|
||||||
|
var domainName = IPGlobalProperties.GetIPGlobalProperties().DomainName;
|
||||||
|
|
||||||
|
if (rdsServer.FqdName.EndsWith(domainName, StringComparison.CurrentCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
rdsServer.Id = DataProvider.AddRDSServer(rdsServer.Name, rdsServer.FqdName, rdsServer.Description);
|
rdsServer.Id = DataProvider.AddRDSServer(rdsServer.Name, rdsServer.FqdName, rdsServer.Description);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
result.AddError("REMOTE_DESKTOP_SERVICES_ADD_RDS_SERVER", new Exception("The server that you are adding, is not available"));
|
throw TaskManager.WriteError(new Exception("Fully Qualified Domain Name not valid."));
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
|
||||||
{
|
|
||||||
if (ex.InnerException != null)
|
|
||||||
{
|
|
||||||
result.AddError("Unable to add RDS Server", ex.InnerException);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
result.AddError("Unable to add RDS Server", ex);
|
throw TaskManager.WriteError(new Exception(string.Format("Unable to connect to {0} server. Please double check Server Full Name setting and retry.", rdsServer.FqdName)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
@ -1743,7 +1777,6 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private static ResultObject DeleteRemoteDesktopServiceInternal(int itemId)
|
private static ResultObject DeleteRemoteDesktopServiceInternal(int itemId)
|
||||||
{
|
{
|
||||||
var result = TaskManager.StartResultTask<ResultObject>("REMOTE_DESKTOP_SERVICES", "CLEANUP");
|
var result = TaskManager.StartResultTask<ResultObject>("REMOTE_DESKTOP_SERVICES", "CLEANUP");
|
||||||
|
|
|
@ -338,6 +338,12 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
return RemoteDesktopServicesController.GetRdsCertificateByServiceId(serviceId);
|
return RemoteDesktopServicesController.GetRdsCertificateByServiceId(serviceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[WebMethod]
|
||||||
|
public RdsCertificate GetRdsCertificateByItemId(int itemId)
|
||||||
|
{
|
||||||
|
return RemoteDesktopServicesController.GetRdsCertificateByItemId(itemId);
|
||||||
|
}
|
||||||
|
|
||||||
[WebMethod]
|
[WebMethod]
|
||||||
public ResultObject AddRdsCertificate(RdsCertificate certificate)
|
public ResultObject AddRdsCertificate(RdsCertificate certificate)
|
||||||
{
|
{
|
||||||
|
|
|
@ -48,5 +48,6 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
public int? RdsCollectionId { get; set; }
|
public int? RdsCollectionId { get; set; }
|
||||||
public bool ConnectionEnabled { get; set; }
|
public bool ConnectionEnabled { get; set; }
|
||||||
public string Status { get; set; }
|
public string Status { get; set; }
|
||||||
|
public bool SslAvailable { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
|
||||||
namespace WebsitePanel.Providers.RemoteDesktopServices
|
namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
{
|
{
|
||||||
public class RdsServersPaged
|
public class RdsServersPaged
|
||||||
|
|
|
@ -342,7 +342,7 @@ namespace WebsitePanel.Providers.EnterpriseStorage
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
file.Summary = reader[6] as string;
|
file.Summary = SanitizeXmlString(reader[6] as string);
|
||||||
|
|
||||||
result.Add(file);
|
result.Add(file);
|
||||||
}
|
}
|
||||||
|
@ -354,6 +354,36 @@ namespace WebsitePanel.Providers.EnterpriseStorage
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public string SanitizeXmlString(string xml)
|
||||||
|
{
|
||||||
|
if (xml == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
var buffer = new StringBuilder(xml.Length);
|
||||||
|
|
||||||
|
foreach (char c in xml.Where(c => IsLegalXmlChar(c)))
|
||||||
|
{
|
||||||
|
buffer.Append(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
return buffer.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsLegalXmlChar(int character)
|
||||||
|
{
|
||||||
|
return
|
||||||
|
(
|
||||||
|
character == 0x9 /* == '\t' == 9 */ ||
|
||||||
|
character == 0xA /* == '\n' == 10 */ ||
|
||||||
|
character == 0xD /* == '\r' == 13 */ ||
|
||||||
|
(character >= 0x20 && character <= 0xD7FF) ||
|
||||||
|
(character >= 0xE000 && character <= 0xFFFD) ||
|
||||||
|
(character >= 0x10000 && character <= 0x10FFFF)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
#region HostingServiceProvider methods
|
#region HostingServiceProvider methods
|
||||||
|
|
||||||
public override string[] Install()
|
public override string[] Install()
|
||||||
|
|
|
@ -68,12 +68,15 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
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=\"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\"";
|
||||||
private const string WspAdministratorsGroupName = "WSP-Org-Administrators";
|
private const string WspAdministratorsGroupDescription = "WSP RDS Collection Adminstrators";
|
||||||
private const string WspAdministratorsGroupDescription = "WSP Org Administrators";
|
private const string RdsCollectionUsersGroupDescription = "WSP RDS Collection Users";
|
||||||
private const string RdsServersOU = "RDSServers";
|
private const string RdsCollectionComputersGroupDescription = "WSP RDS Collection Computers";
|
||||||
|
private const string RdsServersOU = "RDSServersOU";
|
||||||
|
private const string RdsServersRootOU = "RDSRootServersOU";
|
||||||
private const string RDSHelpDeskComputerGroup = "Websitepanel-RDSHelpDesk-Computer";
|
private const string RDSHelpDeskComputerGroup = "Websitepanel-RDSHelpDesk-Computer";
|
||||||
private const string RDSHelpDeskGroup = "WSP-HelpDeskAdministrators";
|
private const string RDSHelpDeskGroup = "WSP-HelpDeskAdministrators";
|
||||||
private const string RDSHelpDeskGroupDescription = "WSP Help Desk Administrators";
|
private const string RDSHelpDeskGroupDescription = "WSP Help Desk Administrators";
|
||||||
|
private const string LocalAdministratorsGroupName = "Administrators";
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -95,6 +98,14 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string ComputersRootOU
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return ProviderSettings["ComputersRootOU"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private string CentralNpsHost
|
private string CentralNpsHost
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
@ -301,24 +312,13 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
|
|
||||||
EditRdsCollectionSettingsInternal(collection, runSpace);
|
EditRdsCollectionSettingsInternal(collection, runSpace);
|
||||||
var orgPath = GetOrganizationPath(organizationId);
|
var orgPath = GetOrganizationPath(organizationId);
|
||||||
|
CheckOrCreateAdGroup(GetComputerGroupPath(organizationId, collection.Name), orgPath, GetComputersGroupName(collection.Name), RdsCollectionComputersGroupDescription);
|
||||||
if (!ActiveDirectoryUtils.AdObjectExists(GetComputerGroupPath(organizationId, collection.Name)))
|
|
||||||
{
|
|
||||||
//Create computer group
|
|
||||||
ActiveDirectoryUtils.CreateGroup(orgPath, GetComputersGroupName(collection.Name));
|
|
||||||
|
|
||||||
//todo Connection broker server must be added by default ???
|
|
||||||
//ActiveDirectoryUtils.AddObjectToGroup(GetComputerPath(ConnectionBroker), GetComputerGroupPath(organizationId, collection.Name));
|
|
||||||
}
|
|
||||||
|
|
||||||
CheckOrCreateHelpDeskComputerGroup();
|
CheckOrCreateHelpDeskComputerGroup();
|
||||||
string helpDeskGroupSamAccountName = CheckOrCreateAdGroup(GetHelpDeskGroupPath(RDSHelpDeskGroup), GetRootOUPath(), RDSHelpDeskGroup, RDSHelpDeskGroupDescription);
|
string helpDeskGroupSamAccountName = CheckOrCreateAdGroup(GetHelpDeskGroupPath(RDSHelpDeskGroup), GetRootOUPath(), RDSHelpDeskGroup, RDSHelpDeskGroupDescription);
|
||||||
|
string groupName = GetLocalAdminsGroupName(collection.Name);
|
||||||
if (!ActiveDirectoryUtils.AdObjectExists(GetUsersGroupPath(organizationId, collection.Name)))
|
string groupPath = GetGroupPath(organizationId, collection.Name, groupName);
|
||||||
{
|
string localAdminsGroupSamAccountName = CheckOrCreateAdGroup(groupPath, GetOrganizationPath(organizationId), groupName, WspAdministratorsGroupDescription);
|
||||||
//Create user group
|
CheckOrCreateAdGroup(GetUsersGroupPath(organizationId, collection.Name), orgPath, GetUsersGroupName(collection.Name), RdsCollectionUsersGroupDescription);
|
||||||
ActiveDirectoryUtils.CreateGroup(orgPath, GetUsersGroupName(collection.Name));
|
|
||||||
}
|
|
||||||
|
|
||||||
var capPolicyName = GetPolicyName(organizationId, collection.Name, RdsPolicyTypes.RdCap);
|
var capPolicyName = GetPolicyName(organizationId, collection.Name, RdsPolicyTypes.RdCap);
|
||||||
var rapPolicyName = GetPolicyName(organizationId, collection.Name, RdsPolicyTypes.RdRap);
|
var rapPolicyName = GetPolicyName(organizationId, collection.Name, RdsPolicyTypes.RdRap);
|
||||||
|
@ -344,12 +344,9 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
//add session servers to group
|
//add session servers to group
|
||||||
foreach (var rdsServer in collection.Servers)
|
foreach (var rdsServer in collection.Servers)
|
||||||
{
|
{
|
||||||
if (!CheckLocalAdminsGroupExists(rdsServer.FqdName, runSpace))
|
MoveRdsServerToTenantOU(rdsServer.Name, organizationId);
|
||||||
{
|
|
||||||
CreateLocalAdministratorsGroup(rdsServer.FqdName, runSpace);
|
|
||||||
}
|
|
||||||
|
|
||||||
AddAdGroupToLocalAdmins(runSpace, rdsServer.FqdName, helpDeskGroupSamAccountName);
|
AddAdGroupToLocalAdmins(runSpace, rdsServer.FqdName, helpDeskGroupSamAccountName);
|
||||||
|
AddAdGroupToLocalAdmins(runSpace, rdsServer.FqdName, localAdminsGroupSamAccountName);
|
||||||
AddComputerToCollectionAdComputerGroup(organizationId, collection.Name, rdsServer);
|
AddComputerToCollectionAdComputerGroup(organizationId, collection.Name, rdsServer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -576,18 +573,13 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
|
|
||||||
CheckOrCreateHelpDeskComputerGroup();
|
CheckOrCreateHelpDeskComputerGroup();
|
||||||
string helpDeskGroupSamAccountName = CheckOrCreateAdGroup(GetHelpDeskGroupPath(RDSHelpDeskGroup), GetRootOUPath(), RDSHelpDeskGroup, RDSHelpDeskGroupDescription);
|
string helpDeskGroupSamAccountName = CheckOrCreateAdGroup(GetHelpDeskGroupPath(RDSHelpDeskGroup), GetRootOUPath(), RDSHelpDeskGroup, RDSHelpDeskGroupDescription);
|
||||||
|
string groupName = GetLocalAdminsGroupName(collectionName);
|
||||||
|
string groupPath = GetGroupPath(organizationId, collectionName, groupName);
|
||||||
|
string localAdminsGroupSamAccountName = CheckOrCreateAdGroup(groupPath, GetOrganizationPath(organizationId), groupName, WspAdministratorsGroupDescription);
|
||||||
|
|
||||||
if (!CheckLocalAdminsGroupExists(server.FqdName, runSpace))
|
AddAdGroupToLocalAdmins(runSpace, server.FqdName, LocalAdministratorsGroupName);
|
||||||
{
|
|
||||||
CreateLocalAdministratorsGroup(server.FqdName, runSpace);
|
|
||||||
}
|
|
||||||
|
|
||||||
AddAdGroupToLocalAdmins(runSpace, server.FqdName, helpDeskGroupSamAccountName);
|
AddAdGroupToLocalAdmins(runSpace, server.FqdName, helpDeskGroupSamAccountName);
|
||||||
AddComputerToCollectionAdComputerGroup(organizationId, collectionName, server);
|
AddComputerToCollectionAdComputerGroup(organizationId, collectionName, server);
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
@ -1002,17 +994,6 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
|
|
||||||
foreach (var hostName in hosts)
|
foreach (var hostName in hosts)
|
||||||
{
|
{
|
||||||
if (!CheckLocalAdminsGroupExists(hostName, runspace))
|
|
||||||
{
|
|
||||||
var errors = CreateLocalAdministratorsGroup(hostName, runspace);
|
|
||||||
|
|
||||||
if (errors.Any())
|
|
||||||
{
|
|
||||||
Log.WriteWarning(string.Join("\r\n", errors.Select(e => e.ToString()).ToArray()));
|
|
||||||
throw new Exception(string.Join("\r\n", errors.Select(e => e.ToString()).ToArray()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
AddAdGroupToLocalAdmins(runspace, hostName, helpDeskGroupSamAccountName);
|
AddAdGroupToLocalAdmins(runspace, hostName, helpDeskGroupSamAccountName);
|
||||||
AddAdGroupToLocalAdmins(runspace, hostName, localAdminsGroupSamAccountName);
|
AddAdGroupToLocalAdmins(runspace, hostName, localAdminsGroupSamAccountName);
|
||||||
|
|
||||||
|
@ -1031,58 +1012,11 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
return GetUsersToCollectionAdGroup(collectionName, groupName, organizationId);
|
return GetUsersToCollectionAdGroup(collectionName, groupName, organizationId);
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool CheckLocalAdminsGroupExists(string hostName, Runspace runspace)
|
|
||||||
{
|
|
||||||
var scripts = new List<string>
|
|
||||||
{
|
|
||||||
string.Format("net localgroup {0}", WspAdministratorsGroupName)
|
|
||||||
};
|
|
||||||
|
|
||||||
object[] errors = null;
|
|
||||||
var result = ExecuteRemoteShellCommand(runspace, hostName, scripts, out errors);
|
|
||||||
|
|
||||||
if (!errors.Any())
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private object[] CreateLocalAdministratorsGroup(string hostName, Runspace runspace)
|
|
||||||
{
|
|
||||||
var scripts = new List<string>
|
|
||||||
{
|
|
||||||
string.Format("$cn = [ADSI]\"WinNT://{0}\"", hostName),
|
|
||||||
string.Format("$group = $cn.Create(\"Group\", \"{0}\")", WspAdministratorsGroupName),
|
|
||||||
"$group.setinfo()",
|
|
||||||
string.Format("$group.description = \"{0}\"", WspAdministratorsGroupDescription),
|
|
||||||
"$group.setinfo()"
|
|
||||||
};
|
|
||||||
|
|
||||||
object[] errors = null;
|
|
||||||
ExecuteRemoteShellCommand(runspace, hostName, scripts, out errors);
|
|
||||||
|
|
||||||
if (!errors.Any())
|
|
||||||
{
|
|
||||||
scripts = new List<string>
|
|
||||||
{
|
|
||||||
string.Format("$GroupObj = [ADSI]\"WinNT://{0}/Administrators\"", hostName),
|
|
||||||
string.Format("$GroupObj.Add(\"WinNT://{0}/{1}\")", hostName.ToLower().Replace(string.Format(".{0}", ServerSettings.ADRootDomain.ToLower()), ""), WspAdministratorsGroupName)
|
|
||||||
};
|
|
||||||
|
|
||||||
errors = null;
|
|
||||||
ExecuteRemoteShellCommand(runspace, hostName, scripts, out errors);
|
|
||||||
}
|
|
||||||
|
|
||||||
return errors;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void RemoveGroupFromLocalAdmin(string fqdnName, string hostName, string groupName, Runspace runspace)
|
private void RemoveGroupFromLocalAdmin(string fqdnName, string hostName, string groupName, Runspace runspace)
|
||||||
{
|
{
|
||||||
var scripts = new List<string>
|
var scripts = new List<string>
|
||||||
{
|
{
|
||||||
string.Format("$GroupObj = [ADSI]\"WinNT://{0}/{1}\"", hostName, WspAdministratorsGroupName),
|
string.Format("$GroupObj = [ADSI]\"WinNT://{0}/{1}\"", hostName, LocalAdministratorsGroupName),
|
||||||
string.Format("$GroupObj.Remove(\"WinNT://{0}/{1}\")", ServerSettings.ADRootDomain, RDSHelpDeskGroup),
|
string.Format("$GroupObj.Remove(\"WinNT://{0}/{1}\")", ServerSettings.ADRootDomain, RDSHelpDeskGroup),
|
||||||
string.Format("$GroupObj.Remove(\"WinNT://{0}/{1}\")", ServerSettings.ADRootDomain, groupName)
|
string.Format("$GroupObj.Remove(\"WinNT://{0}/{1}\")", ServerSettings.ADRootDomain, groupName)
|
||||||
};
|
};
|
||||||
|
@ -1149,7 +1083,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
{
|
{
|
||||||
var scripts = new List<string>
|
var scripts = new List<string>
|
||||||
{
|
{
|
||||||
string.Format("$GroupObj = [ADSI]\"WinNT://{0}/{1}\"", hostName, WspAdministratorsGroupName),
|
string.Format("$GroupObj = [ADSI]\"WinNT://{0}/{1}\"", hostName, LocalAdministratorsGroupName),
|
||||||
string.Format("$GroupObj.Add(\"WinNT://{0}/{1}\")", ServerSettings.ADRootDomain, samAccountName)
|
string.Format("$GroupObj.Add(\"WinNT://{0}/{1}\")", ServerSettings.ADRootDomain, samAccountName)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1349,27 +1283,21 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
|
|
||||||
private void AddComputerToCollectionAdComputerGroup(string organizationId, string collectionName, RdsServer server)
|
private void AddComputerToCollectionAdComputerGroup(string organizationId, string collectionName, RdsServer server)
|
||||||
{
|
{
|
||||||
var computerPath = GetComputerPath(server.Name, false);
|
|
||||||
var computerGroupName = GetComputersGroupName( collectionName);
|
var computerGroupName = GetComputersGroupName( collectionName);
|
||||||
|
var computerObject = GetComputerObject(server.Name);
|
||||||
|
|
||||||
if (!ActiveDirectoryUtils.AdObjectExists(computerPath))
|
if (computerObject != null)
|
||||||
{
|
{
|
||||||
computerPath = GetComputerPath(server.Name, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ActiveDirectoryUtils.AdObjectExists(computerPath))
|
|
||||||
{
|
|
||||||
var computerObject = ActiveDirectoryUtils.GetADObject(computerPath);
|
|
||||||
var samName = (string)ActiveDirectoryUtils.GetADObjectProperty(computerObject, "sAMAccountName");
|
var samName = (string)ActiveDirectoryUtils.GetADObjectProperty(computerObject, "sAMAccountName");
|
||||||
|
|
||||||
if (!ActiveDirectoryUtils.IsComputerInGroup(samName, computerGroupName))
|
if (!ActiveDirectoryUtils.IsComputerInGroup(samName, computerGroupName))
|
||||||
{
|
{
|
||||||
ActiveDirectoryUtils.AddObjectToGroup(computerPath, GetComputerGroupPath(organizationId, collectionName));
|
ActiveDirectoryUtils.AddObjectToGroup(computerObject.Path, GetComputerGroupPath(organizationId, collectionName));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ActiveDirectoryUtils.IsComputerInGroup(samName, RDSHelpDeskComputerGroup))
|
if (!ActiveDirectoryUtils.IsComputerInGroup(samName, RDSHelpDeskComputerGroup))
|
||||||
{
|
{
|
||||||
ActiveDirectoryUtils.AddObjectToGroup(computerPath, GetHelpDeskGroupPath(RDSHelpDeskComputerGroup));
|
ActiveDirectoryUtils.AddObjectToGroup(computerObject.Path, GetHelpDeskGroupPath(RDSHelpDeskComputerGroup));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1378,29 +1306,23 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
|
|
||||||
private void RemoveComputerFromCollectionAdComputerGroup(string organizationId, string collectionName, RdsServer server)
|
private void RemoveComputerFromCollectionAdComputerGroup(string organizationId, string collectionName, RdsServer server)
|
||||||
{
|
{
|
||||||
var computerPath = GetComputerPath(server.Name, false);
|
|
||||||
var computerGroupName = GetComputersGroupName(collectionName);
|
var computerGroupName = GetComputersGroupName(collectionName);
|
||||||
|
var computerObject = GetComputerObject(server.Name);
|
||||||
|
|
||||||
if (!ActiveDirectoryUtils.AdObjectExists(computerPath))
|
if (computerObject != null)
|
||||||
{
|
{
|
||||||
computerPath = GetComputerPath(server.Name, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ActiveDirectoryUtils.AdObjectExists(computerPath))
|
|
||||||
{
|
|
||||||
var computerObject = ActiveDirectoryUtils.GetADObject(computerPath);
|
|
||||||
var samName = (string)ActiveDirectoryUtils.GetADObjectProperty(computerObject, "sAMAccountName");
|
var samName = (string)ActiveDirectoryUtils.GetADObjectProperty(computerObject, "sAMAccountName");
|
||||||
|
|
||||||
if (ActiveDirectoryUtils.IsComputerInGroup(samName, computerGroupName))
|
if (ActiveDirectoryUtils.IsComputerInGroup(samName, computerGroupName))
|
||||||
{
|
{
|
||||||
ActiveDirectoryUtils.RemoveObjectFromGroup(computerPath, GetComputerGroupPath(organizationId, collectionName));
|
ActiveDirectoryUtils.RemoveObjectFromGroup(computerObject.Path, GetComputerGroupPath(organizationId, collectionName));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ActiveDirectoryUtils.AdObjectExists(GetHelpDeskGroupPath(RDSHelpDeskComputerGroup)))
|
if (ActiveDirectoryUtils.AdObjectExists(GetHelpDeskGroupPath(RDSHelpDeskComputerGroup)))
|
||||||
{
|
{
|
||||||
if (ActiveDirectoryUtils.IsComputerInGroup(samName, RDSHelpDeskComputerGroup))
|
if (ActiveDirectoryUtils.IsComputerInGroup(samName, RDSHelpDeskComputerGroup))
|
||||||
{
|
{
|
||||||
ActiveDirectoryUtils.RemoveObjectFromGroup(computerPath, GetHelpDeskGroupPath(RDSHelpDeskComputerGroup));
|
ActiveDirectoryUtils.RemoveObjectFromGroup(computerObject.Path, GetHelpDeskGroupPath(RDSHelpDeskComputerGroup));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1416,6 +1338,16 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
runSpace = OpenRunspace();
|
runSpace = OpenRunspace();
|
||||||
var feature = AddFeature(runSpace, hostName, "RDS-RD-Server", true, true);
|
var feature = AddFeature(runSpace, hostName, "RDS-RD-Server", true, true);
|
||||||
installationResult = (bool)GetPSObjectProperty(feature, "Success");
|
installationResult = (bool)GetPSObjectProperty(feature, "Success");
|
||||||
|
|
||||||
|
if (!IsFeatureInstalled(hostName, "Desktop-Experience", runSpace))
|
||||||
|
{
|
||||||
|
feature = AddFeature(runSpace, hostName, "Desktop-Experience", true, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!IsFeatureInstalled(hostName, "NET-Framework-Core", runSpace))
|
||||||
|
{
|
||||||
|
feature = AddFeature(runSpace, hostName, "NET-Framework-Core", true, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
@ -1425,34 +1357,43 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
return installationResult;
|
return installationResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void CheckOrCreateComputersRoot(string computersRootPath)
|
||||||
|
{
|
||||||
|
if (ActiveDirectoryUtils.AdObjectExists(computersRootPath) && !ActiveDirectoryUtils.AdObjectExists(GetRdsServersGroupPath()))
|
||||||
|
{
|
||||||
|
//ActiveDirectoryUtils.CreateGroup(computersRootPath, RdsServersRootOU);
|
||||||
|
ActiveDirectoryUtils.CreateOrganizationalUnit(RdsServersRootOU, computersRootPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void MoveRdsServerToTenantOU(string hostName, string organizationId)
|
public void MoveRdsServerToTenantOU(string hostName, string organizationId)
|
||||||
{
|
{
|
||||||
var tenantComputerGroupPath = GetTenantComputerGroupPath(organizationId);
|
var tenantComputerGroupPath = GetTenantComputerGroupPath(organizationId);
|
||||||
|
|
||||||
if (!ActiveDirectoryUtils.AdObjectExists(tenantComputerGroupPath))
|
if (!ActiveDirectoryUtils.AdObjectExists(tenantComputerGroupPath))
|
||||||
{
|
{
|
||||||
ActiveDirectoryUtils.CreateGroup(GetOrganizationPath(organizationId), RdsServersOU);
|
ActiveDirectoryUtils.CreateOrganizationalUnit(RdsServersOU, GetOrganizationPath(organizationId));
|
||||||
}
|
}
|
||||||
|
|
||||||
hostName = hostName.ToLower().Replace(string.Format(".{0}", ServerSettings.ADRootDomain.ToLower()), "");
|
hostName = hostName.ToLower().Replace(string.Format(".{0}", ServerSettings.ADRootDomain.ToLower()), "");
|
||||||
var computerPath = GetComputerPath(hostName, true);
|
var rootComputerPath = GetRdsServerPath(hostName);
|
||||||
|
var tenantComputerPath = GetTenantComputerPath(hostName, organizationId);
|
||||||
|
|
||||||
if(!ActiveDirectoryUtils.AdObjectExists(computerPath))
|
if (!string.IsNullOrEmpty(ComputersRootOU))
|
||||||
{
|
{
|
||||||
computerPath = GetComputerPath(hostName, false);
|
CheckOrCreateComputersRoot(GetComputersRootPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ActiveDirectoryUtils.AdObjectExists(computerPath))
|
var computerObject = GetComputerObject(hostName);
|
||||||
|
|
||||||
|
if (computerObject != null)
|
||||||
{
|
{
|
||||||
var computerObject = ActiveDirectoryUtils.GetADObject(computerPath);
|
|
||||||
var samName = (string)ActiveDirectoryUtils.GetADObjectProperty(computerObject, "sAMAccountName");
|
var samName = (string)ActiveDirectoryUtils.GetADObjectProperty(computerObject, "sAMAccountName");
|
||||||
|
|
||||||
if (!ActiveDirectoryUtils.IsComputerInGroup(samName, RdsServersOU))
|
if (!ActiveDirectoryUtils.IsComputerInGroup(samName, RdsServersOU))
|
||||||
{
|
{
|
||||||
DirectoryEntry group = new DirectoryEntry(tenantComputerGroupPath);
|
DirectoryEntry group = new DirectoryEntry(tenantComputerGroupPath);
|
||||||
group.Invoke("Add", computerObject.Path);
|
computerObject.MoveTo(group);
|
||||||
|
|
||||||
group.CommitChanges();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1461,23 +1402,27 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
{
|
{
|
||||||
var tenantComputerGroupPath = GetTenantComputerGroupPath(organizationId);
|
var tenantComputerGroupPath = GetTenantComputerGroupPath(organizationId);
|
||||||
hostName = hostName.ToLower().Replace(string.Format(".{0}", ServerSettings.ADRootDomain.ToLower()), "");
|
hostName = hostName.ToLower().Replace(string.Format(".{0}", ServerSettings.ADRootDomain.ToLower()), "");
|
||||||
var tenantComputerPath = GetTenantComputerPath(hostName, organizationId);
|
|
||||||
|
|
||||||
var computerPath = GetComputerPath(hostName, true);
|
if (!string.IsNullOrEmpty(ComputersRootOU))
|
||||||
|
|
||||||
if (!ActiveDirectoryUtils.AdObjectExists(computerPath))
|
|
||||||
{
|
{
|
||||||
computerPath = GetComputerPath(hostName, false);
|
CheckOrCreateComputersRoot(GetComputersRootPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ActiveDirectoryUtils.AdObjectExists(computerPath))
|
if (!ActiveDirectoryUtils.AdObjectExists(tenantComputerGroupPath))
|
||||||
|
{
|
||||||
|
ActiveDirectoryUtils.CreateOrganizationalUnit(RdsServersOU, GetOrganizationPath(organizationId));
|
||||||
|
}
|
||||||
|
|
||||||
|
var computerObject = GetComputerObject(hostName);
|
||||||
|
|
||||||
|
if (computerObject != null)
|
||||||
{
|
{
|
||||||
var computerObject = ActiveDirectoryUtils.GetADObject(computerPath);
|
|
||||||
var samName = (string)ActiveDirectoryUtils.GetADObjectProperty(computerObject, "sAMAccountName");
|
var samName = (string)ActiveDirectoryUtils.GetADObjectProperty(computerObject, "sAMAccountName");
|
||||||
|
|
||||||
if (ActiveDirectoryUtils.IsComputerInGroup(samName, RdsServersOU))
|
if (ActiveDirectoryUtils.AdObjectExists(GetComputersRootPath()) && !string.IsNullOrEmpty(ComputersRootOU) && !ActiveDirectoryUtils.IsComputerInGroup(samName, RdsServersRootOU))
|
||||||
{
|
{
|
||||||
ActiveDirectoryUtils.RemoveObjectFromGroup(computerPath, tenantComputerGroupPath);
|
DirectoryEntry group = new DirectoryEntry(GetRdsServersGroupPath());
|
||||||
|
computerObject.MoveTo(group);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1605,6 +1550,10 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
{
|
{
|
||||||
remoteApp.Users = users;
|
remoteApp.Users = users;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
remoteApp.Users = null;
|
||||||
|
}
|
||||||
|
|
||||||
return remoteApp;
|
return remoteApp;
|
||||||
}
|
}
|
||||||
|
@ -1760,25 +1709,16 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetComputerPath(string objName, bool domainController)
|
private DirectoryEntry GetComputerObject(string computerName)
|
||||||
{
|
{
|
||||||
StringBuilder sb = new StringBuilder();
|
DirectorySearcher deSearch = new DirectorySearcher
|
||||||
// append provider
|
|
||||||
AppendProtocol(sb);
|
|
||||||
AppendDomainController(sb);
|
|
||||||
AppendCNPath(sb, objName);
|
|
||||||
if (domainController)
|
|
||||||
{
|
{
|
||||||
AppendOUPath(sb, AdDcComputers);
|
Filter = string.Format("(&(objectCategory=computer)(name={0}))", computerName)
|
||||||
}
|
};
|
||||||
else
|
|
||||||
{
|
|
||||||
AppendCNPath(sb, Computers);
|
|
||||||
|
|
||||||
}
|
SearchResult results = deSearch.FindOne();
|
||||||
AppendDomainPath(sb, RootDomain);
|
|
||||||
|
|
||||||
return sb.ToString();
|
return results.GetDirectoryEntry();
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetTenantComputerPath(string objName, string organizationId)
|
private string GetTenantComputerPath(string objName, string organizationId)
|
||||||
|
@ -1788,7 +1728,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
AppendProtocol(sb);
|
AppendProtocol(sb);
|
||||||
AppendDomainController(sb);
|
AppendDomainController(sb);
|
||||||
AppendCNPath(sb, objName);
|
AppendCNPath(sb, objName);
|
||||||
AppendCNPath(sb, RdsServersOU);
|
AppendOUPath(sb, RdsServersOU);
|
||||||
AppendOUPath(sb, organizationId);
|
AppendOUPath(sb, organizationId);
|
||||||
AppendOUPath(sb, RootOU);
|
AppendOUPath(sb, RootOU);
|
||||||
AppendDomainPath(sb, RootDomain);
|
AppendDomainPath(sb, RootDomain);
|
||||||
|
@ -1796,13 +1736,63 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string GetComputersRootPath()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
|
AppendProtocol(sb);
|
||||||
|
AppendDomainController(sb);
|
||||||
|
AppendOUPath(sb, ComputersRootOU);
|
||||||
|
AppendDomainPath(sb, RootDomain);
|
||||||
|
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private string GetRdsServersGroupPath()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
|
AppendProtocol(sb);
|
||||||
|
AppendDomainController(sb);
|
||||||
|
AppendOUPath(sb, RdsServersRootOU);
|
||||||
|
AppendOUPath(sb, ComputersRootOU);
|
||||||
|
AppendDomainPath(sb, RootDomain);
|
||||||
|
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private string GetRdsServerPath(string name)
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
|
AppendProtocol(sb);
|
||||||
|
AppendDomainController(sb);
|
||||||
|
AppendCNPath(sb, name);
|
||||||
|
AppendOUPath(sb, RdsServersRootOU);
|
||||||
|
AppendOUPath(sb, ComputersRootOU);
|
||||||
|
AppendDomainPath(sb, RootDomain);
|
||||||
|
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
private string GetRootPath()
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
|
AppendProtocol(sb);
|
||||||
|
AppendDomainController(sb);
|
||||||
|
AppendDomainPath(sb, RootDomain);
|
||||||
|
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
internal string GetTenantComputerGroupPath(string organizationId)
|
internal string GetTenantComputerGroupPath(string organizationId)
|
||||||
{
|
{
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
AppendProtocol(sb);
|
AppendProtocol(sb);
|
||||||
AppendDomainController(sb);
|
AppendDomainController(sb);
|
||||||
AppendCNPath(sb, RdsServersOU);
|
AppendOUPath(sb, RdsServersOU);
|
||||||
AppendOUPath(sb, organizationId);
|
AppendOUPath(sb, organizationId);
|
||||||
AppendOUPath(sb, RootOU);
|
AppendOUPath(sb, RootOU);
|
||||||
AppendDomainPath(sb, RootDomain);
|
AppendDomainPath(sb, RootDomain);
|
||||||
|
|
|
@ -84,7 +84,7 @@ namespace WebsitePanel.Providers.Web.Iis
|
||||||
X509CertificateCollection existCerts2 = storeMy.Certificates.Find(X509FindType.FindBySerialNumber, servercert.SerialNumber, false);
|
X509CertificateCollection existCerts2 = storeMy.Certificates.Find(X509FindType.FindBySerialNumber, servercert.SerialNumber, false);
|
||||||
var certData = existCerts2[0].Export(X509ContentType.Pfx);
|
var certData = existCerts2[0].Export(X509ContentType.Pfx);
|
||||||
storeMy.Close();
|
storeMy.Close();
|
||||||
var x509Cert = new X509Certificate2(certData);
|
var x509Cert = new X509Certificate2(certData, string.Empty, X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.Exportable | X509KeyStorageFlags.PersistKeySet);
|
||||||
|
|
||||||
if (UseCCS)
|
if (UseCCS)
|
||||||
{
|
{
|
||||||
|
@ -176,10 +176,10 @@ namespace WebsitePanel.Providers.Web.Iis
|
||||||
if (UseCCS)
|
if (UseCCS)
|
||||||
{
|
{
|
||||||
// We need to use this constructor or we won't be able to export this certificate
|
// We need to use this constructor or we won't be able to export this certificate
|
||||||
x509Cert = new X509Certificate2(certificate, password, X509KeyStorageFlags.Exportable);
|
x509Cert = new X509Certificate2(certificate, password, X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.Exportable | X509KeyStorageFlags.PersistKeySet);
|
||||||
|
|
||||||
var certData = x509Cert.Export(X509ContentType.Pfx);
|
var certData = x509Cert.Export(X509ContentType.Pfx);
|
||||||
var convertedCert = new X509Certificate2(certData, string.Empty, X509KeyStorageFlags.Exportable);
|
var convertedCert = new X509Certificate2(certData, string.Empty, X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.Exportable | X509KeyStorageFlags.PersistKeySet);
|
||||||
|
|
||||||
// Attempts to move certificate to CCS UNC path
|
// Attempts to move certificate to CCS UNC path
|
||||||
try
|
try
|
||||||
|
@ -205,7 +205,7 @@ namespace WebsitePanel.Providers.Web.Iis
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
x509Cert = new X509Certificate2(certificate, password);
|
x509Cert = new X509Certificate2(certificate, password, X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.Exportable | X509KeyStorageFlags.PersistKeySet);
|
||||||
|
|
||||||
// Step 1: Register X.509 certificate in the store
|
// Step 1: Register X.509 certificate in the store
|
||||||
// Trying to keep X.509 store open as less as possible
|
// Trying to keep X.509 store open as less as possible
|
||||||
|
@ -278,7 +278,7 @@ namespace WebsitePanel.Providers.Web.Iis
|
||||||
// Read certificate data from file
|
// Read certificate data from file
|
||||||
var certData = new byte[fileStream.Length];
|
var certData = new byte[fileStream.Length];
|
||||||
fileStream.Read(certData, 0, (int) fileStream.Length);
|
fileStream.Read(certData, 0, (int) fileStream.Length);
|
||||||
var convertedCert = new X509Certificate2(certData, CCSCommonPassword, X509KeyStorageFlags.Exportable);
|
var convertedCert = new X509Certificate2(certData, CCSCommonPassword, X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.Exportable | X509KeyStorageFlags.PersistKeySet);
|
||||||
|
|
||||||
fileStream.Close();
|
fileStream.Close();
|
||||||
|
|
||||||
|
@ -311,7 +311,7 @@ namespace WebsitePanel.Providers.Web.Iis
|
||||||
{
|
{
|
||||||
hostNames.AddRange(certificate.Extensions.Cast<X509Extension>()
|
hostNames.AddRange(certificate.Extensions.Cast<X509Extension>()
|
||||||
.Where(e => e.Oid.Value == "2.5.29.17") // Subject Alternative Names
|
.Where(e => e.Oid.Value == "2.5.29.17") // Subject Alternative Names
|
||||||
.SelectMany(e => e.Format(true).Split(new[] {"\r\n", "\n", "\n"}, StringSplitOptions.RemoveEmptyEntries).Select(s => s.Split('=')[1])));
|
.SelectMany(e => e.Format(true).Split(new[] {"\r\n", "\n", "\n"}, StringSplitOptions.RemoveEmptyEntries).Where(s => s.Contains("=")).Select(s => s.Split('=')[1])).Where(s => !s.Contains(" ")));
|
||||||
}
|
}
|
||||||
|
|
||||||
var simpleName = certificate.GetNameInfo(X509NameType.SimpleName, false);
|
var simpleName = certificate.GetNameInfo(X509NameType.SimpleName, false);
|
||||||
|
@ -320,7 +320,20 @@ namespace WebsitePanel.Providers.Web.Iis
|
||||||
hostNames.Add(simpleName);
|
hostNames.Add(simpleName);
|
||||||
}
|
}
|
||||||
|
|
||||||
// For every hostname (only one if using old school dedicated IP binding)
|
var wildcardHostName = hostNames.SingleOrDefault(h => h.StartsWith("*."));
|
||||||
|
|
||||||
|
// If a wildcard certificate is used
|
||||||
|
if (wildcardHostName != null)
|
||||||
|
{
|
||||||
|
if (!dedicatedIp)
|
||||||
|
{
|
||||||
|
// If using a wildcard ssl and not a dedicated IP, we take all the matching bindings on the site and use it to bind to SSL also.
|
||||||
|
hostNames.Remove(wildcardHostName);
|
||||||
|
hostNames.AddRange(website.Bindings.Where(b => !string.IsNullOrEmpty(b.Host) && b.Host.EndsWith(wildcardHostName.Substring(2))).Select(b => b.Host));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// For every hostname
|
||||||
foreach (var hostName in hostNames)
|
foreach (var hostName in hostNames)
|
||||||
{
|
{
|
||||||
var bindingInformation = string.Format("{0}:443:{1}", website.SiteIPAddress ?? "*", dedicatedIp ? "" : hostName);
|
var bindingInformation = string.Format("{0}:443:{1}", website.SiteIPAddress ?? "*", dedicatedIp ? "" : hostName);
|
||||||
|
|
|
@ -9,5 +9,13 @@ namespace WebsitePanel.WebDav.Core.Extensions
|
||||||
{
|
{
|
||||||
return new Uri(paths.Aggregate(uri.AbsoluteUri, (current, path) => string.Format("{0}/{1}", current.TrimEnd('/'), path.TrimStart('/'))));
|
return new Uri(paths.Aggregate(uri.AbsoluteUri, (current, path) => string.Format("{0}/{1}", current.TrimEnd('/'), path.TrimStart('/'))));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string ToStringPath(this Uri uri)
|
||||||
|
{
|
||||||
|
var hostStart = uri.ToString().IndexOf(uri.Host, System.StringComparison.Ordinal);
|
||||||
|
var hostLength = uri.Host.Length;
|
||||||
|
|
||||||
|
return uri.ToString().Substring(hostStart + hostLength, uri.ToString().Length - hostStart - hostLength);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -260,7 +260,7 @@ namespace WebsitePanel.WebDav.Core
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
string displayName = _href.AbsoluteUri.Trim('/').Replace(_baseUri.AbsoluteUri.Trim('/'), "");
|
string displayName = _href.ToString().Trim('/').Replace(_baseUri.ToString().Trim('/'), "");
|
||||||
displayName = Regex.Replace(displayName, "\\/$", "");
|
displayName = Regex.Replace(displayName, "\\/$", "");
|
||||||
Match displayNameMatch = Regex.Match(displayName, "([\\/]+)$");
|
Match displayNameMatch = Regex.Match(displayName, "([\\/]+)$");
|
||||||
if (displayNameMatch.Success)
|
if (displayNameMatch.Success)
|
||||||
|
@ -483,7 +483,7 @@ namespace WebsitePanel.WebDav.Core
|
||||||
{
|
{
|
||||||
_href = href;
|
_href = href;
|
||||||
|
|
||||||
var baseUrl = href.AbsoluteUri.Remove(href.AbsoluteUri.Length - href.Segments.Last().Length);
|
var baseUrl = href.ToString().Remove(href.ToString().Length - href.ToString().Trim('/').Split('/').Last().Length);
|
||||||
|
|
||||||
_baseUri = new Uri(baseUrl);
|
_baseUri = new Uri(baseUrl);
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,7 @@ namespace WebsitePanel.WebDav.Core.Managers
|
||||||
Href = new Uri(x.Url),
|
Href = new Uri(x.Url),
|
||||||
ItemType = ItemType.Folder,
|
ItemType = ItemType.Folder,
|
||||||
ContentLength = x.Size * 1024 * 1024,
|
ContentLength = x.Size * 1024 * 1024,
|
||||||
AllocatedSpace = x.FRSMQuotaMB * 1024 * 1024,
|
AllocatedSpace = (long)x.FRSMQuotaMB * 1024 * 1024,
|
||||||
IsRootItem = true
|
IsRootItem = true
|
||||||
}).ToArray();
|
}).ToArray();
|
||||||
}
|
}
|
||||||
|
|
|
@ -383,7 +383,8 @@ namespace WebsitePanel.WebDavPortal.Controllers
|
||||||
foreach (var item in items)
|
foreach (var item in items)
|
||||||
{
|
{
|
||||||
var opener = _openerManager[Path.GetExtension(item.DisplayName)];
|
var opener = _openerManager[Path.GetExtension(item.DisplayName)];
|
||||||
var pathPart = item.Href.AbsolutePath.Replace("/" + WspContext.User.OrganizationId, "").TrimStart('/');
|
//var pathPart = item.Href.ToString().Replace("/" + WspContext.User.OrganizationId, "").TrimStart('/');
|
||||||
|
var pathPart = item.Href.ToStringPath().Replace("/" + WspContext.User.OrganizationId, "").TrimStart('/');
|
||||||
|
|
||||||
switch (opener)
|
switch (opener)
|
||||||
{
|
{
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace WebsitePanel.WebDavPortal.Helpers
|
||||||
|
{
|
||||||
|
public class ViewDataHelper
|
||||||
|
{
|
||||||
|
public static string BytesToSize(long bytes)
|
||||||
|
{
|
||||||
|
if (bytes == 0)
|
||||||
|
{
|
||||||
|
return string.Format("0 {0}", Resources.UI.Byte);
|
||||||
|
}
|
||||||
|
|
||||||
|
var k = 1024;
|
||||||
|
|
||||||
|
var sizes = new[]
|
||||||
|
{
|
||||||
|
Resources.UI.Bytes,
|
||||||
|
Resources.UI.KilobyteShort,
|
||||||
|
Resources.UI.MegabyteShort,
|
||||||
|
Resources.UI.GigabyteShort,
|
||||||
|
Resources.UI.TerabyteShort,
|
||||||
|
Resources.UI.PetabyteShort,
|
||||||
|
Resources.UI.ExabyteShort
|
||||||
|
};
|
||||||
|
|
||||||
|
var i = (int) Math.Floor(Math.Log(bytes)/Math.Log(k));
|
||||||
|
return string.Format("{0} {1}", Math.Round(bytes/Math.Pow(k, i), 3), sizes[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -69,6 +69,24 @@ namespace WebsitePanel.WebDavPortal.Resources {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Byte.
|
||||||
|
/// </summary>
|
||||||
|
public static string Byte {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Byte", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Bytes.
|
||||||
|
/// </summary>
|
||||||
|
public static string Bytes {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("Bytes", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Cancel.
|
/// Looks up a localized string similar to Cancel.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -105,15 +123,6 @@ namespace WebsitePanel.WebDavPortal.Resources {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Create.
|
|
||||||
/// </summary>
|
|
||||||
public static string Create {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("Create", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Delete.
|
/// Looks up a localized string similar to Delete.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -150,15 +159,6 @@ namespace WebsitePanel.WebDavPortal.Resources {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Enter file name.
|
|
||||||
/// </summary>
|
|
||||||
public static string EnterFileName {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("EnterFileName", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Error.
|
/// Looks up a localized string similar to Error.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -169,11 +169,11 @@ namespace WebsitePanel.WebDavPortal.Resources {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Excel workbook.
|
/// Looks up a localized string similar to EB.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string ExcelWorkbook {
|
public static string ExabyteShort {
|
||||||
get {
|
get {
|
||||||
return ResourceManager.GetString("ExcelWorkbook", resourceCulture);
|
return ResourceManager.GetString("ExabyteShort", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -186,24 +186,6 @@ namespace WebsitePanel.WebDavPortal.Resources {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to File name.
|
|
||||||
/// </summary>
|
|
||||||
public static string FileName {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("FileName", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to File extension will be added automatically.
|
|
||||||
/// </summary>
|
|
||||||
public static string FileNameExtensionHint {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("FileNameExtensionHint", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to File Upload.
|
/// Looks up a localized string similar to File Upload.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -231,15 +213,6 @@ namespace WebsitePanel.WebDavPortal.Resources {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to File already exist.
|
|
||||||
/// </summary>
|
|
||||||
public static string ItemExist {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("ItemExist", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to {0} items was removed..
|
/// Looks up a localized string similar to {0} items was removed..
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -249,6 +222,24 @@ namespace WebsitePanel.WebDavPortal.Resources {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to KB.
|
||||||
|
/// </summary>
|
||||||
|
public static string KilobyteShort {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("KilobyteShort", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to MB.
|
||||||
|
/// </summary>
|
||||||
|
public static string MegabyteShort {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("MegabyteShort", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Modified.
|
/// Looks up a localized string similar to Modified.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -294,6 +285,15 @@ namespace WebsitePanel.WebDavPortal.Resources {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to PB.
|
||||||
|
/// </summary>
|
||||||
|
public static string PetabyteShort {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("PetabyteShort", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Please wait....
|
/// Looks up a localized string similar to Please wait....
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -303,15 +303,6 @@ namespace WebsitePanel.WebDavPortal.Resources {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Powerpoint presentation.
|
|
||||||
/// </summary>
|
|
||||||
public static string PowerPointPresentation {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("PowerPointPresentation", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Processing.
|
/// Looks up a localized string similar to Processing.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -384,6 +375,15 @@ namespace WebsitePanel.WebDavPortal.Resources {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to TB.
|
||||||
|
/// </summary>
|
||||||
|
public static string TerabyteShort {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("TerabyteShort", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Type.
|
/// Looks up a localized string similar to Type.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -402,15 +402,6 @@ namespace WebsitePanel.WebDavPortal.Resources {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Looks up a localized string similar to Word document.
|
|
||||||
/// </summary>
|
|
||||||
public static string WordDocument {
|
|
||||||
get {
|
|
||||||
return ResourceManager.GetString("WordDocument", resourceCulture);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to Yes.
|
/// Looks up a localized string similar to Yes.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -120,6 +120,12 @@
|
||||||
<data name="Actions" xml:space="preserve">
|
<data name="Actions" xml:space="preserve">
|
||||||
<value>Actions</value>
|
<value>Actions</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Byte" xml:space="preserve">
|
||||||
|
<value>Byte</value>
|
||||||
|
</data>
|
||||||
|
<data name="Bytes" xml:space="preserve">
|
||||||
|
<value>Bytes</value>
|
||||||
|
</data>
|
||||||
<data name="Cancel" xml:space="preserve">
|
<data name="Cancel" xml:space="preserve">
|
||||||
<value>Cancel</value>
|
<value>Cancel</value>
|
||||||
</data>
|
</data>
|
||||||
|
@ -132,9 +138,6 @@
|
||||||
<data name="Confirm" xml:space="preserve">
|
<data name="Confirm" xml:space="preserve">
|
||||||
<value>Confirm</value>
|
<value>Confirm</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Create" xml:space="preserve">
|
|
||||||
<value>Create</value>
|
|
||||||
</data>
|
|
||||||
<data name="Delete" xml:space="preserve">
|
<data name="Delete" xml:space="preserve">
|
||||||
<value>Delete</value>
|
<value>Delete</value>
|
||||||
</data>
|
</data>
|
||||||
|
@ -147,24 +150,15 @@
|
||||||
<data name="DialogsContentConfrimFileDeletion" xml:space="preserve">
|
<data name="DialogsContentConfrimFileDeletion" xml:space="preserve">
|
||||||
<value>Are you sure you want to delete {0} item(s)?</value>
|
<value>Are you sure you want to delete {0} item(s)?</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="EnterFileName" xml:space="preserve">
|
|
||||||
<value>Enter file name</value>
|
|
||||||
</data>
|
|
||||||
<data name="Error" xml:space="preserve">
|
<data name="Error" xml:space="preserve">
|
||||||
<value>Error</value>
|
<value>Error</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ExcelWorkbook" xml:space="preserve">
|
<data name="ExabyteShort" xml:space="preserve">
|
||||||
<value>Excel workbook</value>
|
<value>EB</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="File" xml:space="preserve">
|
<data name="File" xml:space="preserve">
|
||||||
<value>File</value>
|
<value>File</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="FileName" xml:space="preserve">
|
|
||||||
<value>File name</value>
|
|
||||||
</data>
|
|
||||||
<data name="FileNameExtensionHint" xml:space="preserve">
|
|
||||||
<value>File extension will be added automatically</value>
|
|
||||||
</data>
|
|
||||||
<data name="FileUpload" xml:space="preserve">
|
<data name="FileUpload" xml:space="preserve">
|
||||||
<value>File Upload</value>
|
<value>File Upload</value>
|
||||||
</data>
|
</data>
|
||||||
|
@ -174,12 +168,15 @@
|
||||||
<data name="Info" xml:space="preserve">
|
<data name="Info" xml:space="preserve">
|
||||||
<value>Info</value>
|
<value>Info</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ItemExist" xml:space="preserve">
|
|
||||||
<value>File already exist</value>
|
|
||||||
</data>
|
|
||||||
<data name="ItemsWasRemovedFormat" xml:space="preserve">
|
<data name="ItemsWasRemovedFormat" xml:space="preserve">
|
||||||
<value>{0} items was removed.</value>
|
<value>{0} items was removed.</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="KilobyteShort" xml:space="preserve">
|
||||||
|
<value>KB</value>
|
||||||
|
</data>
|
||||||
|
<data name="MegabyteShort" xml:space="preserve">
|
||||||
|
<value>MB</value>
|
||||||
|
</data>
|
||||||
<data name="Modified" xml:space="preserve">
|
<data name="Modified" xml:space="preserve">
|
||||||
<value>Modified</value>
|
<value>Modified</value>
|
||||||
</data>
|
</data>
|
||||||
|
@ -195,12 +192,12 @@
|
||||||
<data name="OrDragAndDropFilesHere" xml:space="preserve">
|
<data name="OrDragAndDropFilesHere" xml:space="preserve">
|
||||||
<value>or drag and drop files here.</value>
|
<value>or drag and drop files here.</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="PetabyteShort" xml:space="preserve">
|
||||||
|
<value>PB</value>
|
||||||
|
</data>
|
||||||
<data name="PleaseWaitWithDots" xml:space="preserve">
|
<data name="PleaseWaitWithDots" xml:space="preserve">
|
||||||
<value>Please wait...</value>
|
<value>Please wait...</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="PowerPointPresentation" xml:space="preserve">
|
|
||||||
<value>Powerpoint presentation</value>
|
|
||||||
</data>
|
|
||||||
<data name="Processing" xml:space="preserve">
|
<data name="Processing" xml:space="preserve">
|
||||||
<value>Processing</value>
|
<value>Processing</value>
|
||||||
</data>
|
</data>
|
||||||
|
@ -225,15 +222,15 @@
|
||||||
<data name="Table" xml:space="preserve">
|
<data name="Table" xml:space="preserve">
|
||||||
<value>Table</value>
|
<value>Table</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="TerabyteShort" xml:space="preserve">
|
||||||
|
<value>TB</value>
|
||||||
|
</data>
|
||||||
<data name="Type" xml:space="preserve">
|
<data name="Type" xml:space="preserve">
|
||||||
<value>Type</value>
|
<value>Type</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Upload" xml:space="preserve">
|
<data name="Upload" xml:space="preserve">
|
||||||
<value>Upload</value>
|
<value>Upload</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="WordDocument" xml:space="preserve">
|
|
||||||
<value>Word document</value>
|
|
||||||
</data>
|
|
||||||
<data name="Yes" xml:space="preserve">
|
<data name="Yes" xml:space="preserve">
|
||||||
<value>Yes</value>
|
<value>Yes</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
@using WebsitePanel.WebDav.Core.Config
|
@using WebsitePanel.WebDav.Core.Config
|
||||||
@using WebsitePanel.WebDavPortal.FileOperations
|
@using WebsitePanel.WebDavPortal.FileOperations
|
||||||
@using Ninject;
|
@using Ninject;
|
||||||
|
@using WebsitePanel.WebDavPortal.Helpers
|
||||||
@using WebsitePanel.WebDavPortal.Resources
|
@using WebsitePanel.WebDavPortal.Resources
|
||||||
@using WebsitePanel.WebDavPortal.UI
|
@using WebsitePanel.WebDavPortal.UI
|
||||||
@using WebsitePanel.WebDavPortal.UI.Routes
|
@using WebsitePanel.WebDavPortal.UI.Routes
|
||||||
|
@ -63,7 +64,7 @@
|
||||||
<p class="progress-text">@percent%</p>
|
<p class="progress-text">@percent%</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p>@Math.Round(Convert.ToDecimal(resource.ContentLength) / 1024, 2) / @Math.Round(Convert.ToDecimal(resource.AllocatedSpace) / 1024, 2) @UI.GigabyteShort</p>
|
<p>@ViewDataHelper.BytesToSize(resource.ContentLength) / @ViewDataHelper.BytesToSize(resource.AllocatedSpace)</p>
|
||||||
}
|
}
|
||||||
|
|
||||||
<div class="selected-element-overlay">
|
<div class="selected-element-overlay">
|
||||||
|
|
|
@ -183,6 +183,7 @@
|
||||||
<DependentUpon>Global.asax</DependentUpon>
|
<DependentUpon>Global.asax</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="Helpers\DataTableHelper.cs" />
|
<Compile Include="Helpers\DataTableHelper.cs" />
|
||||||
|
<Compile Include="Helpers\ViewDataHelper.cs" />
|
||||||
<Compile Include="HttpHandlers\AccessTokenHandler.cs" />
|
<Compile Include="HttpHandlers\AccessTokenHandler.cs" />
|
||||||
<Compile Include="HttpHandlers\FileTransferRequestHandler.cs" />
|
<Compile Include="HttpHandlers\FileTransferRequestHandler.cs" />
|
||||||
<Compile Include="Mapping\AutoMapperPortalConfiguration.cs" />
|
<Compile Include="Mapping\AutoMapperPortalConfiguration.cs" />
|
||||||
|
|
|
@ -5656,6 +5656,9 @@
|
||||||
<data name="ERROR.RDSSESSIONHOST_CERTIFICATE_NOT_INSTALLED" xml:space="preserve">
|
<data name="ERROR.RDSSESSIONHOST_CERTIFICATE_NOT_INSTALLED" xml:space="preserve">
|
||||||
<value>Session host certificate not installed</value>
|
<value>Session host certificate not installed</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="ERROR.RDSSERVER_NOT_ADDED" xml:space="preserve">
|
||||||
|
<value>RDS Server not added</value>
|
||||||
|
</data>
|
||||||
<data name="Success.RDSSESSIONHOST_CERTIFICATE_INSTALLED" xml:space="preserve">
|
<data name="Success.RDSSESSIONHOST_CERTIFICATE_INSTALLED" xml:space="preserve">
|
||||||
<value>Session host certificate has been installed</value>
|
<value>Session host certificate has been installed</value>
|
||||||
</data>
|
</data>
|
||||||
|
|
|
@ -57,6 +57,7 @@ namespace WebsitePanel.Portal
|
||||||
if (rdsServer.ItemId.HasValue)
|
if (rdsServer.ItemId.HasValue)
|
||||||
{
|
{
|
||||||
rdsServer.Status = ES.Services.RDS.GetRdsServerStatus(rdsServer.ItemId.Value, rdsServer.FqdName);
|
rdsServer.Status = ES.Services.RDS.GetRdsServerStatus(rdsServer.ItemId.Value, rdsServer.FqdName);
|
||||||
|
rdsServer.SslAvailable = ES.Services.RDS.GetRdsCertificateByItemId(rdsServer.ItemId.Value) != null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -129,4 +129,22 @@
|
||||||
<data name="lblPFXInstallPassword.Text" xml:space="preserve">
|
<data name="lblPFXInstallPassword.Text" xml:space="preserve">
|
||||||
<value>Certificate Password:</value>
|
<value>Certificate Password:</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="secCertificateSettings.Text" xml:space="preserve">
|
||||||
|
<value>SSL Certificate</value>
|
||||||
|
</data>
|
||||||
|
<data name="lblSelectFile.Text" xml:space="preserve">
|
||||||
|
<value>Select Certificate:</value>
|
||||||
|
</data>
|
||||||
|
<data name="lblExpiryDate.Text" xml:space="preserve">
|
||||||
|
<value>Expiry Date:</value>
|
||||||
|
</data>
|
||||||
|
<data name="lblIssuedBy.Text" xml:space="preserve">
|
||||||
|
<value>Issued By:</value>
|
||||||
|
</data>
|
||||||
|
<data name="lblSanName.Text" xml:space="preserve">
|
||||||
|
<value>SAN Name:</value>
|
||||||
|
</data>
|
||||||
|
<data name="lblComputersRootOU.Text" xml:space="preserve">
|
||||||
|
<value>Computers Root OU:</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
|
@ -1,7 +1,16 @@
|
||||||
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="RDS_Settings.ascx.cs" Inherits="WebsitePanel.Portal.ProviderControls.RDS_Settings" %>
|
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="RDS_Settings.ascx.cs" Inherits="WebsitePanel.Portal.ProviderControls.RDS_Settings" %>
|
||||||
|
<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %>
|
||||||
|
|
||||||
|
<fieldset>
|
||||||
|
<legend>
|
||||||
|
<asp:Label ID="secCertificateSettings" runat="server" meta:resourcekey="secServiceSettings" Text="SSL Certificate" CssClass="NormalBold"></asp:Label>
|
||||||
|
</legend>
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan ="2" style="padding: 10px 0 10px 0;"><asp:FileUpload ID="upPFX" runat="server"/></td>
|
<td class="SubHead" style="width:200px" nowrap>
|
||||||
|
<asp:Localize runat="server" meta:resourcekey="lblSelectFile" />
|
||||||
|
</td>
|
||||||
|
<td style="padding: 10px 0 10px 0;"><asp:FileUpload ID="upPFX" runat="server"/></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr><td></td></tr>
|
<tr><td></td></tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -12,6 +21,43 @@
|
||||||
<asp:TextBox ID="txtPFXInstallPassword" runat="server" TextMode="Password" Width="200px" />
|
<asp:TextBox ID="txtPFXInstallPassword" runat="server" TextMode="Password" Width="200px" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
</table>
|
||||||
|
</fieldset>
|
||||||
|
<fieldset>
|
||||||
|
<legend>
|
||||||
|
<asp:Label ID="currentCertificate" runat="server" meta:resourcekey="currentCertificate" Text="Current Certificate" CssClass="NormalBold"></asp:Label>
|
||||||
|
</legend>
|
||||||
|
<asp:Panel ID="plCertificateInfo" Visible="false" runat="server">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td class="SubHead" style="width:200px" nowrap>
|
||||||
|
<asp:Localize runat="server" meta:resourcekey="lblIssuedBy" />
|
||||||
|
</td>
|
||||||
|
<td class="SubHead">
|
||||||
|
<asp:Label ID="lblIssuedBy" runat="server"/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="SubHead" style="width:200px" nowrap>
|
||||||
|
<asp:Localize runat="server" meta:resourcekey="lblSanName" />
|
||||||
|
</td>
|
||||||
|
<td class="SubHead">
|
||||||
|
<asp:Label ID="lblSanName" runat="server"/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="SubHead" style="width:200px" nowrap>
|
||||||
|
<asp:Localize runat="server" meta:resourcekey="lblExpiryDate" />
|
||||||
|
</td>
|
||||||
|
<td class="SubHead">
|
||||||
|
<asp:Label ID="lblExpiryDate" runat="server"/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</asp:Panel>
|
||||||
|
</fieldset>
|
||||||
|
<fieldset>
|
||||||
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="SubHead" width="200" nowrap>
|
<td class="SubHead" width="200" nowrap>
|
||||||
<asp:Label runat="server" ID="lblConnectionBroker" meta:resourcekey="lblConnectionBroker" Text="Connection Broker:"/>
|
<asp:Label runat="server" ID="lblConnectionBroker" meta:resourcekey="lblConnectionBroker" Text="Connection Broker:"/>
|
||||||
|
@ -30,6 +76,15 @@
|
||||||
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtRootOU" ErrorMessage="*" Display="Dynamic" />
|
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtRootOU" ErrorMessage="*" Display="Dynamic" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="SubHead" width="200" nowrap>
|
||||||
|
<asp:Label runat="server" ID="lblComputersRootOU" meta:resourcekey="lblComputersRootOU" Text="Computers Root OU:"/>
|
||||||
|
</td>
|
||||||
|
<td class="Normal">
|
||||||
|
<asp:TextBox runat="server" ID="txtComputersRootOu" MaxLength="1000" Width="200px" />
|
||||||
|
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtComputersRootOu" ErrorMessage="*" Display="Dynamic" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="SubHead" width="200" nowrap>
|
<td class="SubHead" width="200" nowrap>
|
||||||
<asp:Label runat="server" ID="lblPrimaryDomainController" meta:resourcekey="lblPrimaryDomainController" Text="Primary Domain Controller:"/>
|
<asp:Label runat="server" ID="lblPrimaryDomainController" meta:resourcekey="lblPrimaryDomainController" Text="Primary Domain Controller:"/>
|
||||||
|
@ -85,3 +140,5 @@
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
</fieldset>
|
||||||
|
<br />
|
|
@ -26,8 +26,10 @@
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
using AjaxControlToolkit;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Security.Cryptography.X509Certificates;
|
||||||
using System.Web.UI.WebControls;
|
using System.Web.UI.WebControls;
|
||||||
using WebsitePanel.EnterpriseServer;
|
using WebsitePanel.EnterpriseServer;
|
||||||
using WebsitePanel.Providers.Common;
|
using WebsitePanel.Providers.Common;
|
||||||
|
@ -39,7 +41,7 @@ namespace WebsitePanel.Portal.ProviderControls
|
||||||
{
|
{
|
||||||
protected void Page_Load(object sender, EventArgs e)
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
|
FillCertificateInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GWServers
|
public string GWServers
|
||||||
|
@ -54,6 +56,25 @@ namespace WebsitePanel.Portal.ProviderControls
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void FillCertificateInfo()
|
||||||
|
{
|
||||||
|
var certificate = ES.Services.RDS.GetRdsCertificateByServiceId(PanelRequest.ServiceId);
|
||||||
|
|
||||||
|
if (certificate != null)
|
||||||
|
{
|
||||||
|
var array = Convert.FromBase64String(certificate.Hash);
|
||||||
|
char[] chars = new char[array.Length / sizeof(char)];
|
||||||
|
System.Buffer.BlockCopy(array, 0, chars, 0, array.Length);
|
||||||
|
string password = new string(chars);
|
||||||
|
plCertificateInfo.Visible = true;
|
||||||
|
byte[] content = Convert.FromBase64String(certificate.Content);
|
||||||
|
var x509 = new X509Certificate2(content, password);
|
||||||
|
lblIssuedBy.Text = x509.Issuer.Replace("CN=", "").Replace("OU=", "").Replace("O=", "").Replace("L=", "").Replace("S=", "").Replace("C=", "");
|
||||||
|
lblExpiryDate.Text = x509.NotAfter.ToLongDateString();
|
||||||
|
lblSanName.Text = x509.SubjectName.Name.Replace("CN=", "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void BindSettings(System.Collections.Specialized.StringDictionary settings)
|
public void BindSettings(System.Collections.Specialized.StringDictionary settings)
|
||||||
{
|
{
|
||||||
txtConnectionBroker.Text = settings["ConnectionBroker"];
|
txtConnectionBroker.Text = settings["ConnectionBroker"];
|
||||||
|
@ -62,6 +83,7 @@ namespace WebsitePanel.Portal.ProviderControls
|
||||||
UpdateLyncServersGrid();
|
UpdateLyncServersGrid();
|
||||||
|
|
||||||
txtRootOU.Text = settings["RootOU"];
|
txtRootOU.Text = settings["RootOU"];
|
||||||
|
txtComputersRootOu.Text = settings["ComputersRootOU"];
|
||||||
txtPrimaryDomainController.Text = settings["PrimaryDomainController"];
|
txtPrimaryDomainController.Text = settings["PrimaryDomainController"];
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(settings["UseCentralNPS"]) && bool.TrueString == settings["UseCentralNPS"])
|
if (!string.IsNullOrEmpty(settings["UseCentralNPS"]) && bool.TrueString == settings["UseCentralNPS"])
|
||||||
|
@ -82,6 +104,7 @@ namespace WebsitePanel.Portal.ProviderControls
|
||||||
{
|
{
|
||||||
settings["ConnectionBroker"] = txtConnectionBroker.Text;
|
settings["ConnectionBroker"] = txtConnectionBroker.Text;
|
||||||
settings["RootOU"] = txtRootOU.Text;
|
settings["RootOU"] = txtRootOU.Text;
|
||||||
|
settings["ComputersRootOU"] = txtComputersRootOu.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;
|
||||||
|
|
|
@ -12,6 +12,15 @@ namespace WebsitePanel.Portal.ProviderControls {
|
||||||
|
|
||||||
public partial class RDS_Settings {
|
public partial class RDS_Settings {
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// secCertificateSettings 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 secCertificateSettings;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// upPFX control.
|
/// upPFX control.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -30,6 +39,51 @@ namespace WebsitePanel.Portal.ProviderControls {
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::System.Web.UI.WebControls.TextBox txtPFXInstallPassword;
|
protected global::System.Web.UI.WebControls.TextBox txtPFXInstallPassword;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// currentCertificate 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 currentCertificate;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// plCertificateInfo 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 plCertificateInfo;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// lblIssuedBy 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 lblIssuedBy;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// lblSanName 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 lblSanName;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// lblExpiryDate 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 lblExpiryDate;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// lblConnectionBroker control.
|
/// lblConnectionBroker control.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -84,6 +138,33 @@ namespace WebsitePanel.Portal.ProviderControls {
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator4;
|
protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator4;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// lblComputersRootOU 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 lblComputersRootOU;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// txtComputersRootOu 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 txtComputersRootOu;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// RequiredFieldValidator1 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 RequiredFieldValidator1;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// lblPrimaryDomainController control.
|
/// lblPrimaryDomainController control.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -69,7 +69,7 @@ namespace WebsitePanel.Portal.RDS
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
messageBox.ShowErrorMessage("RDSCOLLECTION_NOT_CREATED", ex);
|
ShowErrorMessage("RDSCOLLECTION_NOT_CREATED", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,6 +52,19 @@ namespace WebsitePanel.Portal.RDS
|
||||||
txtApplicationName.Text = remoteApp.DisplayName;
|
txtApplicationName.Text = remoteApp.DisplayName;
|
||||||
//var remoteAppUsers = organizationUsers.Where(x => applicationUsers.Contains(x.AccountName));
|
//var remoteAppUsers = organizationUsers.Where(x => applicationUsers.Contains(x.AccountName));
|
||||||
var remoteAppUsers = organizationUsers.Where(x => applicationUsers.Select(a => a.Split('\\').Last().ToLower()).Contains(x.SamAccountName.Split('\\').Last().ToLower()));
|
var remoteAppUsers = organizationUsers.Where(x => applicationUsers.Select(a => a.Split('\\').Last().ToLower()).Contains(x.SamAccountName.Split('\\').Last().ToLower()));
|
||||||
|
var localAdmins = ES.Services.RDS.GetRdsCollectionLocalAdmins(PanelRequest.CollectionID);
|
||||||
|
|
||||||
|
foreach(var user in remoteAppUsers)
|
||||||
|
{
|
||||||
|
if (localAdmins.Select(l => l.AccountName).Contains(user.AccountName))
|
||||||
|
{
|
||||||
|
user.IsVIP = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
user.IsVIP = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
users.SetUsers(remoteAppUsers.ToArray());
|
users.SetUsers(remoteAppUsers.ToArray());
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
// 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.Linq;
|
||||||
using System.Web.UI.WebControls;
|
using System.Web.UI.WebControls;
|
||||||
using WebsitePanel.EnterpriseServer;
|
using WebsitePanel.EnterpriseServer;
|
||||||
using WebsitePanel.Providers.Common;
|
using WebsitePanel.Providers.Common;
|
||||||
|
@ -45,6 +46,19 @@ namespace WebsitePanel.Portal.RDS
|
||||||
BindQuota();
|
BindQuota();
|
||||||
var collectionUsers = ES.Services.RDS.GetRdsCollectionUsers(PanelRequest.CollectionID);
|
var collectionUsers = ES.Services.RDS.GetRdsCollectionUsers(PanelRequest.CollectionID);
|
||||||
var collection = ES.Services.RDS.GetRdsCollection(PanelRequest.CollectionID);
|
var collection = ES.Services.RDS.GetRdsCollection(PanelRequest.CollectionID);
|
||||||
|
var localAdmins = ES.Services.RDS.GetRdsCollectionLocalAdmins(PanelRequest.CollectionID);
|
||||||
|
|
||||||
|
foreach (var user in collectionUsers)
|
||||||
|
{
|
||||||
|
if (localAdmins.Select(l => l.AccountName).Contains(user.AccountName))
|
||||||
|
{
|
||||||
|
user.IsVIP = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
user.IsVIP = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
litCollectionName.Text = collection.DisplayName;
|
litCollectionName.Text = collection.DisplayName;
|
||||||
users.SetUsers(collectionUsers);
|
users.SetUsers(collectionUsers);
|
||||||
|
@ -63,6 +77,12 @@ namespace WebsitePanel.Portal.RDS
|
||||||
{
|
{
|
||||||
usersQuota.QuotaAvailable = tenantStats.AllocatedRdsUsers - tenantStats.CreatedRdsUsers;
|
usersQuota.QuotaAvailable = tenantStats.AllocatedRdsUsers - tenantStats.CreatedRdsUsers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cntx.Quotas.ContainsKey(Quotas.RDS_USERS))
|
||||||
|
{
|
||||||
|
int rdsUsersCount = ES.Services.RDS.GetOrganizationRdsUsersCount(PanelRequest.ItemID);
|
||||||
|
users.ButtonAddEnabled = (!(cntx.Quotas[Quotas.RDS_USERS].QuotaAllocatedValue <= rdsUsersCount) || (cntx.Quotas[Quotas.RDS_USERS].QuotaAllocatedValue == -1));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool SaveRdsUsers()
|
private bool SaveRdsUsers()
|
||||||
|
|
|
@ -4,6 +4,8 @@ using System.Linq;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
using System.Web.UI;
|
using System.Web.UI;
|
||||||
using System.Web.UI.WebControls;
|
using System.Web.UI.WebControls;
|
||||||
|
using WebsitePanel.Providers.HostedSolution;
|
||||||
|
using WebsitePanel.Providers.RemoteDesktopServices;
|
||||||
|
|
||||||
namespace WebsitePanel.Portal.RDS
|
namespace WebsitePanel.Portal.RDS
|
||||||
{
|
{
|
||||||
|
@ -17,6 +19,12 @@ namespace WebsitePanel.Portal.RDS
|
||||||
var collection = ES.Services.RDS.GetRdsCollection(PanelRequest.CollectionID);
|
var collection = ES.Services.RDS.GetRdsCollection(PanelRequest.CollectionID);
|
||||||
|
|
||||||
litCollectionName.Text = collection.DisplayName;
|
litCollectionName.Text = collection.DisplayName;
|
||||||
|
|
||||||
|
foreach(var user in collectionLocalAdmins)
|
||||||
|
{
|
||||||
|
user.IsVIP = false;
|
||||||
|
}
|
||||||
|
|
||||||
users.SetUsers(collectionLocalAdmins);
|
users.SetUsers(collectionLocalAdmins);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
<asp:LinkButton id="lnkDisplayName" meta:resourcekey="lnkDisplayName" runat="server" Text='<%# Eval("DisplayName")%>' CommandName="EditApplication" CommandArgument='<%# Eval("Alias") %>' OnClientClick="ShowProgressDialog('Loading ...');return true;"/>
|
<asp:LinkButton id="lnkDisplayName" meta:resourcekey="lnkDisplayName" runat="server" Text='<%# Eval("DisplayName")%>' CommandName="EditApplication" CommandArgument='<%# Eval("Alias") %>' OnClientClick="ShowProgressDialog('Loading ...');return true;"/>
|
||||||
<asp:HiddenField ID="hfFilePath" runat="server" Value='<%# Eval("FilePath") %>'/>
|
<asp:HiddenField ID="hfFilePath" runat="server" Value='<%# Eval("FilePath") %>'/>
|
||||||
<asp:HiddenField ID="hfRequiredCommandLine" runat="server" Value='<%# Eval("RequiredCommandLine") %>'/>
|
<asp:HiddenField ID="hfRequiredCommandLine" runat="server" Value='<%# Eval("RequiredCommandLine") %>'/>
|
||||||
|
<asp:HiddenField ID="hfUsers" runat="server" Value='<%# Eval("Users") != null ? "New" : null %>'/>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
<asp:TemplateField>
|
<asp:TemplateField>
|
||||||
|
|
|
@ -136,7 +136,7 @@ namespace WebsitePanel.Portal.RDS.UserControls
|
||||||
var fullRemote = new StartMenuApp
|
var fullRemote = new StartMenuApp
|
||||||
{
|
{
|
||||||
DisplayName = string.Format("Full Desktop - {0}", host.ToLower()),
|
DisplayName = string.Format("Full Desktop - {0}", host.ToLower()),
|
||||||
FilePath = "%SystemRoot%\\system32\\mstsc.exe",
|
FilePath = "c:\\windows\\system32\\mstsc.exe",
|
||||||
RequiredCommandLine = string.Format("/v:{0}", host.ToLower())
|
RequiredCommandLine = string.Format("/v:{0}", host.ToLower())
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -213,6 +213,13 @@ namespace WebsitePanel.Portal.RDS.UserControls
|
||||||
app.DisplayName = ((LinkButton)row.FindControl("lnkDisplayName")).Text;
|
app.DisplayName = ((LinkButton)row.FindControl("lnkDisplayName")).Text;
|
||||||
app.FilePath = ((HiddenField)row.FindControl("hfFilePath")).Value;
|
app.FilePath = ((HiddenField)row.FindControl("hfFilePath")).Value;
|
||||||
app.RequiredCommandLine = ((HiddenField)row.FindControl("hfRequiredCommandLine")).Value;
|
app.RequiredCommandLine = ((HiddenField)row.FindControl("hfRequiredCommandLine")).Value;
|
||||||
|
var users = ((HiddenField)row.FindControl("hfUsers")).Value;
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(users))
|
||||||
|
{
|
||||||
|
app.Users = new string[]{"New"};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (state == SelectedState.All ||
|
if (state == SelectedState.All ||
|
||||||
(state == SelectedState.Selected && chkSelect.Checked) ||
|
(state == SelectedState.Selected && chkSelect.Checked) ||
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
</ItemStyle>
|
</ItemStyle>
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:Literal ID="litAccount" runat="server" Text='<%# Eval("DisplayName") %>'></asp:Literal>
|
<asp:Literal ID="litAccount" runat="server" Text='<%# Eval("DisplayName") %>'></asp:Literal>
|
||||||
|
<asp:Image ID="Image1" runat="server" ImageUrl='<%# GetThemedImage("Exchange/admin_16.png") %>' Visible='<%# Convert.ToBoolean(Eval("IsVIP")) %>' ImageAlign="AbsMiddle" />
|
||||||
<asp:HiddenField ID="hdnSamAccountName" runat="server" Value='<%# Eval("SamAccountName") %>' />
|
<asp:HiddenField ID="hdnSamAccountName" runat="server" Value='<%# Eval("SamAccountName") %>' />
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
|
@ -81,6 +82,7 @@
|
||||||
<asp:Image ID="imgAccount" runat="server" ImageUrl='<%# GetAccountImage((int)Eval("AccountType")) %>' ImageAlign="AbsMiddle" />
|
<asp:Image ID="imgAccount" runat="server" ImageUrl='<%# GetAccountImage((int)Eval("AccountType")) %>' ImageAlign="AbsMiddle" />
|
||||||
<asp:Literal ID="litDisplayName" runat="server" Text='<%# Eval("DisplayName") %>'></asp:Literal>
|
<asp:Literal ID="litDisplayName" runat="server" Text='<%# Eval("DisplayName") %>'></asp:Literal>
|
||||||
<asp:HiddenField ID="hdnSamName" runat="server" Value='<%# Eval("SamAccountName") %>' />
|
<asp:HiddenField ID="hdnSamName" runat="server" Value='<%# Eval("SamAccountName") %>' />
|
||||||
|
<asp:HiddenField ID="hdnLocalAdmin" runat="server" Value='<%# Eval("IsVIP").ToString() %>' />
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
<asp:TemplateField meta:resourcekey="gvAccountsEmail">
|
<asp:TemplateField meta:resourcekey="gvAccountsEmail">
|
||||||
|
|
|
@ -42,6 +42,18 @@ namespace WebsitePanel.Portal.RDS.UserControls
|
||||||
{
|
{
|
||||||
public const string DirectionString = "DirectionString";
|
public const string DirectionString = "DirectionString";
|
||||||
|
|
||||||
|
public bool ButtonAddEnabled
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return btnAdd.Enabled;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
btnAdd.Enabled = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected enum SelectedState
|
protected enum SelectedState
|
||||||
{
|
{
|
||||||
All,
|
All,
|
||||||
|
@ -75,13 +87,6 @@ namespace WebsitePanel.Portal.RDS.UserControls
|
||||||
Page.ClientScript.RegisterClientScriptBlock(typeof(RDSCollectionUsers), "SelectAllCheckboxes",
|
Page.ClientScript.RegisterClientScriptBlock(typeof(RDSCollectionUsers), "SelectAllCheckboxes",
|
||||||
script, true);
|
script, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId);
|
|
||||||
if (cntx.Quotas.ContainsKey(Quotas.RDS_USERS))
|
|
||||||
{
|
|
||||||
int rdsUsersCount = ES.Services.RDS.GetOrganizationRdsUsersCount(PanelRequest.ItemID);
|
|
||||||
btnAdd.Enabled = (!(cntx.Quotas[Quotas.RDS_USERS].QuotaAllocatedValue <= rdsUsersCount) || (cntx.Quotas[Quotas.RDS_USERS].QuotaAllocatedValue == -1));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void btnAdd_Click(object sender, EventArgs e)
|
protected void btnAdd_Click(object sender, EventArgs e)
|
||||||
|
@ -132,6 +137,19 @@ namespace WebsitePanel.Portal.RDS.UserControls
|
||||||
protected void BindPopupAccounts()
|
protected void BindPopupAccounts()
|
||||||
{
|
{
|
||||||
OrganizationUser[] accounts = ES.Services.Organizations.GetOrganizationUsersPaged(PanelRequest.ItemID, null, null, null, 0, Int32.MaxValue).PageUsers;
|
OrganizationUser[] accounts = ES.Services.Organizations.GetOrganizationUsersPaged(PanelRequest.ItemID, null, null, null, 0, Int32.MaxValue).PageUsers;
|
||||||
|
var localAdmins = ES.Services.RDS.GetRdsCollectionLocalAdmins(PanelRequest.CollectionID);
|
||||||
|
|
||||||
|
foreach (var user in accounts)
|
||||||
|
{
|
||||||
|
if (localAdmins.Select(l => l.AccountName).Contains(user.AccountName))
|
||||||
|
{
|
||||||
|
user.IsVIP = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
user.IsVIP = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
accounts = accounts.Where(x => !GetUsers().Select(p => p.AccountName).Contains(x.AccountName)).ToArray();
|
accounts = accounts.Where(x => !GetUsers().Select(p => p.AccountName).Contains(x.AccountName)).ToArray();
|
||||||
Array.Sort(accounts, CompareAccount);
|
Array.Sort(accounts, CompareAccount);
|
||||||
|
@ -221,7 +239,8 @@ namespace WebsitePanel.Portal.RDS.UserControls
|
||||||
{
|
{
|
||||||
AccountName = (string)gvPopupAccounts.DataKeys[i][0],
|
AccountName = (string)gvPopupAccounts.DataKeys[i][0],
|
||||||
DisplayName = ((Literal)row.FindControl("litDisplayName")).Text,
|
DisplayName = ((Literal)row.FindControl("litDisplayName")).Text,
|
||||||
SamAccountName = ((HiddenField)row.FindControl("hdnSamName")).Value
|
SamAccountName = ((HiddenField)row.FindControl("hdnSamName")).Value,
|
||||||
|
IsVIP = Convert.ToBoolean(((HiddenField)row.FindControl("hdnLocalAdmin")).Value)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,8 +15,6 @@
|
||||||
<wsp:SimpleMessageBox id="messageBox" runat="server" />
|
<wsp:SimpleMessageBox id="messageBox" runat="server" />
|
||||||
</ContentTemplate>
|
</ContentTemplate>
|
||||||
</asp:UpdatePanel>
|
</asp:UpdatePanel>
|
||||||
<asp:UpdatePanel runat="server" ID="updatePanelUsers">
|
|
||||||
<ContentTemplate>
|
|
||||||
|
|
||||||
<div class="FormButtonsBar">
|
<div class="FormButtonsBar">
|
||||||
<div class="Left">
|
<div class="Left">
|
||||||
|
@ -35,11 +33,20 @@
|
||||||
<asp:ListItem>100</asp:ListItem>
|
<asp:ListItem>100</asp:ListItem>
|
||||||
</asp:DropDownList>
|
</asp:DropDownList>
|
||||||
|
|
||||||
<asp:TextBox ID="txtSearchValue" runat="server" CssClass="NormalTextBox" Width="100">
|
<asp:TextBox ID="txtSearchValue" runat="server" CssClass="NormalTextBox" Width="100"/>
|
||||||
</asp:TextBox><asp:ImageButton ID="cmdSearch" Runat="server" meta:resourcekey="cmdSearch" SkinID="SearchButton" CausesValidation="false"/>
|
<asp:ImageButton ID="cmdSearch" Runat="server" meta:resourcekey="cmdSearch" SkinID="SearchButton" CausesValidation="false"/>
|
||||||
</asp:Panel>
|
</asp:Panel>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<asp:ObjectDataSource ID="odsRDSServersPaged" runat="server" EnablePaging="True" SelectCountMethod="GetRDSServersPagedCount"
|
||||||
|
SelectMethod="GetRDSServersPaged" SortParameterName="sortColumn" TypeName="WebsitePanel.Portal.RDSHelper" OnSelected="odsRDSServersPaged_Selected">
|
||||||
|
<SelectParameters>
|
||||||
|
<asp:ControlParameter Name="filterValue" ControlID="txtSearchValue" PropertyName="Text" />
|
||||||
|
</SelectParameters>
|
||||||
|
</asp:ObjectDataSource>
|
||||||
|
|
||||||
|
<asp:UpdatePanel runat="server" ID="updatePanelUsers" UpdateMode="Conditional">
|
||||||
|
<ContentTemplate>
|
||||||
|
|
||||||
<asp:GridView id="gvRDSServers" runat="server" AutoGenerateColumns="False"
|
<asp:GridView id="gvRDSServers" runat="server" AutoGenerateColumns="False"
|
||||||
AllowPaging="True" AllowSorting="True"
|
AllowPaging="True" AllowSorting="True"
|
||||||
|
@ -84,7 +91,7 @@
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
<asp:TemplateField>
|
<asp:TemplateField>
|
||||||
<ItemTemplate>
|
<ItemTemplate>
|
||||||
<asp:LinkButton ID="lnkInstallCertificate" runat="server" Text="Certificate" Visible='<%# Eval("ItemId") != null && Eval("Status") != null && Eval("Status").ToString().StartsWith("Online") %>'
|
<asp:LinkButton ID="lnkInstallCertificate" runat="server" Text="Certificate" Visible='<%# Convert.ToBoolean(Eval("SslAvailable")) && Eval("ItemId") != null && Eval("Status") != null && Eval("Status").ToString().StartsWith("Online") %>'
|
||||||
CommandName="InstallCertificate" CommandArgument='<%# Eval("Id") %>' ToolTip="Repair Certificate"
|
CommandName="InstallCertificate" CommandArgument='<%# Eval("Id") %>' ToolTip="Repair Certificate"
|
||||||
OnClientClick="if(confirm('Are you sure you want to install certificate?')) ShowProgressDialog('Installing certificate...'); else return false;"></asp:LinkButton>
|
OnClientClick="if(confirm('Are you sure you want to install certificate?')) ShowProgressDialog('Installing certificate...'); else return false;"></asp:LinkButton>
|
||||||
</ItemTemplate>
|
</ItemTemplate>
|
||||||
|
@ -98,12 +105,6 @@
|
||||||
</asp:TemplateField>
|
</asp:TemplateField>
|
||||||
</Columns>
|
</Columns>
|
||||||
</asp:GridView>
|
</asp:GridView>
|
||||||
<asp:ObjectDataSource ID="odsRDSServersPaged" runat="server" EnablePaging="True" SelectCountMethod="GetRDSServersPagedCount"
|
|
||||||
SelectMethod="GetRDSServersPaged" SortParameterName="sortColumn" TypeName="WebsitePanel.Portal.RDSHelper" OnSelected="odsRDSServersPaged_Selected">
|
|
||||||
<SelectParameters>
|
|
||||||
<asp:ControlParameter Name="filterValue" ControlID="txtSearchValue" PropertyName="Text" />
|
|
||||||
</SelectParameters>
|
|
||||||
</asp:ObjectDataSource>
|
|
||||||
|
|
||||||
<asp:Panel ID="ServerInfoPanel" runat="server" CssClass="Popup" style="display:none">
|
<asp:Panel ID="ServerInfoPanel" runat="server" CssClass="Popup" style="display:none">
|
||||||
<table class="Popup-Header" cellpadding="0" cellspacing="0">
|
<table class="Popup-Header" cellpadding="0" cellspacing="0">
|
||||||
|
|
|
@ -39,15 +39,6 @@ namespace WebsitePanel.Portal {
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox;
|
protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// updatePanelUsers control.
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>
|
|
||||||
/// Auto-generated field.
|
|
||||||
/// To modify move field declaration from designer file to code-behind file.
|
|
||||||
/// </remarks>
|
|
||||||
protected global::System.Web.UI.UpdatePanel updatePanelUsers;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// btnAddRDSServer control.
|
/// btnAddRDSServer control.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -102,15 +93,6 @@ namespace WebsitePanel.Portal {
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::System.Web.UI.WebControls.ImageButton cmdSearch;
|
protected global::System.Web.UI.WebControls.ImageButton cmdSearch;
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// gvRDSServers 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 gvRDSServers;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// odsRDSServersPaged control.
|
/// odsRDSServersPaged control.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -120,6 +102,24 @@ namespace WebsitePanel.Portal {
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
protected global::System.Web.UI.WebControls.ObjectDataSource odsRDSServersPaged;
|
protected global::System.Web.UI.WebControls.ObjectDataSource odsRDSServersPaged;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// updatePanelUsers control.
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// Auto-generated field.
|
||||||
|
/// To modify move field declaration from designer file to code-behind file.
|
||||||
|
/// </remarks>
|
||||||
|
protected global::System.Web.UI.UpdatePanel updatePanelUsers;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// gvRDSServers 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 gvRDSServers;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// ServerInfoPanel control.
|
/// ServerInfoPanel control.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -11,16 +11,16 @@
|
||||||
<div class="FormContentRDSConf">
|
<div class="FormContentRDSConf">
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="FormLabel150"><asp:Localize ID="locServerName" runat="server" meta:resourcekey="locServerName" Text="Server Full Name:"></asp:Localize></td>
|
<td class="FormLabel260"><asp:Localize ID="locServerName" runat="server" meta:resourcekey="locServerName" Text="Server Fully Qualified Domain Name:"></asp:Localize></td>
|
||||||
<td>
|
<td>
|
||||||
<asp:TextBox ID="txtServerName" runat="server" CssClass="NormalTextBox" Width="145px"></asp:TextBox>
|
<asp:TextBox ID="txtServerName" runat="server" CssClass="NormalTextBox" Width="300px"></asp:TextBox>
|
||||||
<asp:RequiredFieldValidator ID="valServerName" runat="server" ErrorMessage="*" ControlToValidate="txtServerName"></asp:RequiredFieldValidator>
|
<asp:RequiredFieldValidator ID="valServerName" runat="server" ErrorMessage="*" ControlToValidate="txtServerName"></asp:RequiredFieldValidator>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="FormLabel150"><asp:Localize ID="locServerComments" runat="server" meta:resourcekey="locServerComments" Text="Server Comments:"></asp:Localize></td>
|
<td class="FormLabel260"><asp:Localize ID="locServerComments" runat="server" meta:resourcekey="locServerComments" Text="Server Comments:"></asp:Localize></td>
|
||||||
<td>
|
<td>
|
||||||
<asp:TextBox ID="txtServerComments" runat="server" CssClass="NormalTextBox" Width="145px"></asp:TextBox>
|
<asp:TextBox ID="txtServerComments" runat="server" CssClass="NormalTextBox" Width="300px"></asp:TextBox>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -63,7 +63,7 @@ namespace WebsitePanel.Portal
|
||||||
|
|
||||||
if (!result.IsSuccess && result.ErrorCodes.Count > 0)
|
if (!result.IsSuccess && result.ErrorCodes.Count > 0)
|
||||||
{
|
{
|
||||||
messageBox.ShowMessage(result, "", "");
|
messageBox.ShowMessage(result, "RDSSERVER_NOT_ADDED", "");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ namespace WebsitePanel.Portal
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
messageBox.ShowErrorMessage("", ex);
|
ShowErrorMessage("RDSSERVER_NOT_ADDED", ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,31 +1,3 @@
|
||||||
// Copyright (c) 2015, 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.
|
||||||
|
|
|
@ -5901,7 +5901,9 @@
|
||||||
</Content>
|
</Content>
|
||||||
<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">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Content>
|
||||||
<Content Include="ProviderControls\App_LocalResources\RDS_Settings.ascx.resx" />
|
<Content Include="ProviderControls\App_LocalResources\RDS_Settings.ascx.resx" />
|
||||||
<Content Include="UserControls\App_LocalResources\DomainControl.ascx.resx">
|
<Content Include="UserControls\App_LocalResources\DomainControl.ascx.resx">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue