This commit is contained in:
vfedosevich 2015-03-11 05:37:55 -07:00
commit 92ba95648f
38 changed files with 828 additions and 401 deletions

View file

@ -5508,6 +5508,29 @@ CREATE TABLE [dbo].[RDSCollectionSettings](
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')
CREATE TABLE [dbo].[RDSCertificates](
[ID] [int] IDENTITY(1,1) NOT NULL,

View file

@ -122,6 +122,8 @@ namespace WebsitePanel.EnterpriseServer {
private System.Threading.SendOrPostCallback GetRdsCertificateByServiceIdOperationCompleted;
private System.Threading.SendOrPostCallback GetRdsCertificateByItemIdOperationCompleted;
private System.Threading.SendOrPostCallback AddRdsCertificateOperationCompleted;
/// <remarks/>
@ -267,6 +269,9 @@ namespace WebsitePanel.EnterpriseServer {
/// <remarks/>
public event GetRdsCertificateByServiceIdCompletedEventHandler GetRdsCertificateByServiceIdCompleted;
/// <remarks/>
public event GetRdsCertificateByItemIdCompletedEventHandler GetRdsCertificateByItemIdCompleted;
/// <remarks/>
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/>
[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) {
@ -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/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void AddRdsCertificateCompletedEventHandler(object sender, AddRdsCertificateCompletedEventArgs e);

View file

@ -288,6 +288,11 @@ namespace WebsitePanel.EnterpriseServer
return GetRdsCertificateByServiceIdInternal(serviceId);
}
public static RdsCertificate GetRdsCertificateByItemId(int itemId)
{
return GetRdsCertificateByItemIdInternal(itemId);
}
public static ResultObject AddRdsCertificate(RdsCertificate certificate)
{
return AddRdsCertificateInternal(certificate);
@ -346,6 +351,21 @@ namespace WebsitePanel.EnterpriseServer
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)
{
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 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)
@ -479,19 +499,22 @@ namespace WebsitePanel.EnterpriseServer
var collection = ObjectUtils.FillObjectFromDataReader<RdsCollection>(DataProvider.GetRDSCollectionById(collectionId));
var settings = ObjectUtils.FillObjectFromDataReader<RdsCollectionSettings>(DataProvider.GetRdsCollectionSettingsByCollectionId(collectionId));
if (settings.SecurityLayer == null)
if (settings != null)
{
settings.SecurityLayer = SecurityLayerValues.Negotiate.ToString();
}
if (settings.SecurityLayer == null)
{
settings.SecurityLayer = SecurityLayerValues.Negotiate.ToString();
}
if (settings.EncryptionLevel == null)
{
settings.EncryptionLevel = EncryptionLevel.ClientCompatible.ToString();
}
if (settings.EncryptionLevel == null)
{
settings.EncryptionLevel = EncryptionLevel.ClientCompatible.ToString();
}
if (settings.AuthenticateUsingNLA == null)
{
settings.AuthenticateUsingNLA = true;
if (settings.AuthenticateUsingNLA == null)
{
settings.AuthenticateUsingNLA = true;
}
}
return settings;
@ -512,9 +535,23 @@ namespace WebsitePanel.EnterpriseServer
private static int AddRdsCollectionInternal(int itemId, RdsCollection collection)
{
var result = TaskManager.StartResultTask<ResultObject>("REMOTE_DESKTOP_SERVICES", "ADD_RDS_COLLECTION");
var domainName = IPGlobalProperties.GetIPGlobalProperties().DomainName;
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
Organization org = OrganizationController.GetOrganization(itemId);
if (org == null)
@ -802,7 +839,7 @@ namespace WebsitePanel.EnterpriseServer
FillRdsServerData(tmpServer);
}
result.Servers = tmpServers.ToArray();
result.Servers = tmpServers.ToArray();
return result;
}
@ -996,25 +1033,22 @@ namespace WebsitePanel.EnterpriseServer
{
if (CheckRDSServerAvaliable(rdsServer.FqdName))
{
rdsServer.Id = DataProvider.AddRDSServer(rdsServer.Name, rdsServer.FqdName, rdsServer.Description);
var domainName = IPGlobalProperties.GetIPGlobalProperties().DomainName;
if (rdsServer.FqdName.EndsWith(domainName, StringComparison.CurrentCultureIgnoreCase))
{
rdsServer.Id = DataProvider.AddRDSServer(rdsServer.Name, rdsServer.FqdName, rdsServer.Description);
}
else
{
throw TaskManager.WriteError(new Exception("Fully Qualified Domain Name not valid."));
}
}
else
{
result.AddError("REMOTE_DESKTOP_SERVICES_ADD_RDS_SERVER", new Exception("The server that you are adding, is not available"));
return result;
throw TaskManager.WriteError(new Exception(string.Format("Unable to connect to {0} server. Please double check Server Full Name setting and retry.", rdsServer.FqdName)));
}
}
catch (Exception ex)
{
if (ex.InnerException != null)
{
result.AddError("Unable to add RDS Server", ex.InnerException);
}
else
{
result.AddError("Unable to add RDS Server", ex);
}
}
}
finally
{
if (!result.IsSuccess)
@ -1733,7 +1767,7 @@ namespace WebsitePanel.EnterpriseServer
{
bool result = false;
var ping = new Ping();
var reply = ping.Send(hostname, 1000);
var reply = ping.Send(hostname, 1000);
if (reply.Status == IPStatus.Success)
{
@ -1741,8 +1775,7 @@ namespace WebsitePanel.EnterpriseServer
}
return result;
}
}
private static ResultObject DeleteRemoteDesktopServiceInternal(int itemId)
{
@ -1791,7 +1824,7 @@ namespace WebsitePanel.EnterpriseServer
private static RemoteDesktopServices GetRemoteDesktopServices(int serviceId)
{
var rds = new RemoteDesktopServices();
ServiceProviderProxy.Init(rds, serviceId);
ServiceProviderProxy.Init(rds, serviceId);
return rds;
}

View file

@ -338,6 +338,12 @@ namespace WebsitePanel.EnterpriseServer
return RemoteDesktopServicesController.GetRdsCertificateByServiceId(serviceId);
}
[WebMethod]
public RdsCertificate GetRdsCertificateByItemId(int itemId)
{
return RemoteDesktopServicesController.GetRdsCertificateByItemId(itemId);
}
[WebMethod]
public ResultObject AddRdsCertificate(RdsCertificate certificate)
{

View file

@ -48,5 +48,6 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
public int? RdsCollectionId { get; set; }
public bool ConnectionEnabled { get; set; }
public string Status { get; set; }
public bool SslAvailable { get; set; }
}
}

View file

@ -26,11 +26,12 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
namespace WebsitePanel.Providers.RemoteDesktopServices
{
public class RdsServersPaged
{
public int RecordsCount { get; set; }
public RdsServer[] Servers { get; set; }
public RdsServer[] Servers { get; set; }
}
}

View file

@ -342,7 +342,7 @@ namespace WebsitePanel.Providers.EnterpriseStorage
}
}
file.Summary = reader[6] as string;
file.Summary = SanitizeXmlString(reader[6] as string);
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
public override string[] Install()

View file

@ -68,12 +68,15 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
private const string RdsGroupFormat = "rds-{0}-{1}";
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 WspAdministratorsGroupName = "WSP-Org-Administrators";
private const string WspAdministratorsGroupDescription = "WSP Org Administrators";
private const string RdsServersOU = "RDSServers";
private const string RDSHelpDeskComputerGroup = "Websitepanel-RDSHelpDesk-Computer";
private const string WspAdministratorsGroupDescription = "WSP RDS Collection Adminstrators";
private const string RdsCollectionUsersGroupDescription = "WSP RDS Collection Users";
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 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
@ -95,6 +98,14 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
}
}
private string ComputersRootOU
{
get
{
return ProviderSettings["ComputersRootOU"];
}
}
private string CentralNpsHost
{
get
@ -301,24 +312,13 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
EditRdsCollectionSettingsInternal(collection, runSpace);
var orgPath = GetOrganizationPath(organizationId);
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));
}
CheckOrCreateAdGroup(GetComputerGroupPath(organizationId, collection.Name), orgPath, GetComputersGroupName(collection.Name), RdsCollectionComputersGroupDescription);
CheckOrCreateHelpDeskComputerGroup();
string helpDeskGroupSamAccountName = CheckOrCreateAdGroup(GetHelpDeskGroupPath(RDSHelpDeskGroup), GetRootOUPath(), RDSHelpDeskGroup, RDSHelpDeskGroupDescription);
if (!ActiveDirectoryUtils.AdObjectExists(GetUsersGroupPath(organizationId, collection.Name)))
{
//Create user group
ActiveDirectoryUtils.CreateGroup(orgPath, GetUsersGroupName(collection.Name));
}
string groupName = GetLocalAdminsGroupName(collection.Name);
string groupPath = GetGroupPath(organizationId, collection.Name, groupName);
string localAdminsGroupSamAccountName = CheckOrCreateAdGroup(groupPath, GetOrganizationPath(organizationId), groupName, WspAdministratorsGroupDescription);
CheckOrCreateAdGroup(GetUsersGroupPath(organizationId, collection.Name), orgPath, GetUsersGroupName(collection.Name), RdsCollectionUsersGroupDescription);
var capPolicyName = GetPolicyName(organizationId, collection.Name, RdsPolicyTypes.RdCap);
var rapPolicyName = GetPolicyName(organizationId, collection.Name, RdsPolicyTypes.RdRap);
@ -339,17 +339,14 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
}
//add user group to collection
AddUserGroupsToCollection(runSpace, collection.Name, new List<string> { GetUsersGroupName(collection.Name) });
AddUserGroupsToCollection(runSpace, collection.Name, new List<string> { GetUsersGroupName(collection.Name) });
//add session servers to group
foreach (var rdsServer in collection.Servers)
{
if (!CheckLocalAdminsGroupExists(rdsServer.FqdName, runSpace))
{
CreateLocalAdministratorsGroup(rdsServer.FqdName, runSpace);
}
{
MoveRdsServerToTenantOU(rdsServer.Name, organizationId);
AddAdGroupToLocalAdmins(runSpace, rdsServer.FqdName, helpDeskGroupSamAccountName);
AddAdGroupToLocalAdmins(runSpace, rdsServer.FqdName, localAdminsGroupSamAccountName);
AddComputerToCollectionAdComputerGroup(organizationId, collection.Name, rdsServer);
}
}
@ -576,19 +573,14 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
CheckOrCreateHelpDeskComputerGroup();
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))
{
CreateLocalAdministratorsGroup(server.FqdName, runSpace);
}
AddAdGroupToLocalAdmins(runSpace, server.FqdName, LocalAdministratorsGroupName);
AddAdGroupToLocalAdmins(runSpace, server.FqdName, helpDeskGroupSamAccountName);
AddComputerToCollectionAdComputerGroup(organizationId, collectionName, server);
}
catch (Exception e)
{
}
}
finally
{
CloseRunspace(runSpace);
@ -1001,18 +993,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
}
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, localAdminsGroupSamAccountName);
@ -1029,60 +1010,13 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
{
string groupName = GetLocalAdminsGroupName(collectionName);
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)
{
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, groupName)
};
@ -1149,7 +1083,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
{
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)
};
@ -1348,28 +1282,22 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
}
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))
{
computerPath = GetComputerPath(server.Name, true);
}
if (ActiveDirectoryUtils.AdObjectExists(computerPath))
{
var computerObject = ActiveDirectoryUtils.GetADObject(computerPath);
if (computerObject != null)
{
var samName = (string)ActiveDirectoryUtils.GetADObjectProperty(computerObject, "sAMAccountName");
if (!ActiveDirectoryUtils.IsComputerInGroup(samName, computerGroupName))
{
ActiveDirectoryUtils.AddObjectToGroup(computerPath, GetComputerGroupPath(organizationId, collectionName));
ActiveDirectoryUtils.AddObjectToGroup(computerObject.Path, GetComputerGroupPath(organizationId, collectionName));
}
if (!ActiveDirectoryUtils.IsComputerInGroup(samName, RDSHelpDeskComputerGroup))
{
ActiveDirectoryUtils.AddObjectToGroup(computerPath, GetHelpDeskGroupPath(RDSHelpDeskComputerGroup));
ActiveDirectoryUtils.AddObjectToGroup(computerObject.Path, GetHelpDeskGroupPath(RDSHelpDeskComputerGroup));
}
}
@ -1377,30 +1305,24 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
}
private void RemoveComputerFromCollectionAdComputerGroup(string organizationId, string collectionName, RdsServer server)
{
var computerPath = GetComputerPath(server.Name, false);
{
var computerGroupName = GetComputersGroupName(collectionName);
var computerObject = GetComputerObject(server.Name);
if (!ActiveDirectoryUtils.AdObjectExists(computerPath))
{
computerPath = GetComputerPath(server.Name, true);
}
if (ActiveDirectoryUtils.AdObjectExists(computerPath))
{
var computerObject = ActiveDirectoryUtils.GetADObject(computerPath);
if (computerObject != null)
{
var samName = (string)ActiveDirectoryUtils.GetADObjectProperty(computerObject, "sAMAccountName");
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.IsComputerInGroup(samName, RDSHelpDeskComputerGroup))
{
ActiveDirectoryUtils.RemoveObjectFromGroup(computerPath, GetHelpDeskGroupPath(RDSHelpDeskComputerGroup));
ActiveDirectoryUtils.RemoveObjectFromGroup(computerObject.Path, GetHelpDeskGroupPath(RDSHelpDeskComputerGroup));
}
}
}
@ -1415,7 +1337,17 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
{
runSpace = OpenRunspace();
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
{
@ -1425,59 +1357,72 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
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)
{
var tenantComputerGroupPath = GetTenantComputerGroupPath(organizationId);
if (!ActiveDirectoryUtils.AdObjectExists(tenantComputerGroupPath))
{
ActiveDirectoryUtils.CreateGroup(GetOrganizationPath(organizationId), RdsServersOU);
ActiveDirectoryUtils.CreateOrganizationalUnit(RdsServersOU, GetOrganizationPath(organizationId));
}
hostName = hostName.ToLower().Replace(string.Format(".{0}", ServerSettings.ADRootDomain.ToLower()), "");
var computerPath = GetComputerPath(hostName, true);
hostName = hostName.ToLower().Replace(string.Format(".{0}", ServerSettings.ADRootDomain.ToLower()), "");
var rootComputerPath = GetRdsServerPath(hostName);
var tenantComputerPath = GetTenantComputerPath(hostName, organizationId);
if(!ActiveDirectoryUtils.AdObjectExists(computerPath))
{
computerPath = GetComputerPath(hostName, false);
}
if (!string.IsNullOrEmpty(ComputersRootOU))
{
CheckOrCreateComputersRoot(GetComputersRootPath());
}
var computerObject = GetComputerObject(hostName);
if (ActiveDirectoryUtils.AdObjectExists(computerPath))
if (computerObject != null)
{
var computerObject = ActiveDirectoryUtils.GetADObject(computerPath);
var samName = (string)ActiveDirectoryUtils.GetADObjectProperty(computerObject, "sAMAccountName");
if (!ActiveDirectoryUtils.IsComputerInGroup(samName, RdsServersOU))
{
{
DirectoryEntry group = new DirectoryEntry(tenantComputerGroupPath);
group.Invoke("Add", computerObject.Path);
group.CommitChanges();
computerObject.MoveTo(group);
}
}
}
}
public void RemoveRdsServerFromTenantOU(string hostName, string organizationId)
{
var tenantComputerGroupPath = GetTenantComputerGroupPath(organizationId);
hostName = hostName.ToLower().Replace(string.Format(".{0}", ServerSettings.ADRootDomain.ToLower()), "");
var tenantComputerPath = GetTenantComputerPath(hostName, organizationId);
hostName = hostName.ToLower().Replace(string.Format(".{0}", ServerSettings.ADRootDomain.ToLower()), "");
var computerPath = GetComputerPath(hostName, true);
if (!ActiveDirectoryUtils.AdObjectExists(computerPath))
if (!string.IsNullOrEmpty(ComputersRootOU))
{
computerPath = GetComputerPath(hostName, false);
CheckOrCreateComputersRoot(GetComputersRootPath());
}
if (!ActiveDirectoryUtils.AdObjectExists(tenantComputerGroupPath))
{
ActiveDirectoryUtils.CreateOrganizationalUnit(RdsServersOU, GetOrganizationPath(organizationId));
}
if (ActiveDirectoryUtils.AdObjectExists(computerPath))
var computerObject = GetComputerObject(hostName);
if (computerObject != null)
{
var computerObject = ActiveDirectoryUtils.GetADObject(computerPath);
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;
}
else
{
remoteApp.Users = null;
}
return remoteApp;
}
@ -1760,26 +1709,17 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
return sb.ToString();
}
private string GetComputerPath(string objName, bool domainController)
private DirectoryEntry GetComputerObject(string computerName)
{
StringBuilder sb = new StringBuilder();
// append provider
AppendProtocol(sb);
AppendDomainController(sb);
AppendCNPath(sb, objName);
if (domainController)
DirectorySearcher deSearch = new DirectorySearcher
{
AppendOUPath(sb, AdDcComputers);
}
else
{
AppendCNPath(sb, Computers);
}
AppendDomainPath(sb, RootDomain);
return sb.ToString();
}
Filter = string.Format("(&(objectCategory=computer)(name={0}))", computerName)
};
SearchResult results = deSearch.FindOne();
return results.GetDirectoryEntry();
}
private string GetTenantComputerPath(string objName, string organizationId)
{
@ -1788,7 +1728,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
AppendProtocol(sb);
AppendDomainController(sb);
AppendCNPath(sb, objName);
AppendCNPath(sb, RdsServersOU);
AppendOUPath(sb, RdsServersOU);
AppendOUPath(sb, organizationId);
AppendOUPath(sb, RootOU);
AppendDomainPath(sb, RootDomain);
@ -1796,13 +1736,63 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
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)
{
StringBuilder sb = new StringBuilder();
AppendProtocol(sb);
AppendDomainController(sb);
AppendCNPath(sb, RdsServersOU);
AppendOUPath(sb, RdsServersOU);
AppendOUPath(sb, organizationId);
AppendOUPath(sb, RootOU);
AppendDomainPath(sb, RootDomain);

View file

@ -84,7 +84,7 @@ namespace WebsitePanel.Providers.Web.Iis
X509CertificateCollection existCerts2 = storeMy.Certificates.Find(X509FindType.FindBySerialNumber, servercert.SerialNumber, false);
var certData = existCerts2[0].Export(X509ContentType.Pfx);
storeMy.Close();
var x509Cert = new X509Certificate2(certData);
var x509Cert = new X509Certificate2(certData, string.Empty, X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.Exportable | X509KeyStorageFlags.PersistKeySet);
if (UseCCS)
{
@ -176,10 +176,10 @@ namespace WebsitePanel.Providers.Web.Iis
if (UseCCS)
{
// 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 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
try
@ -205,7 +205,7 @@ namespace WebsitePanel.Providers.Web.Iis
}
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
// 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
var certData = new byte[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();
@ -311,7 +311,7 @@ namespace WebsitePanel.Providers.Web.Iis
{
hostNames.AddRange(certificate.Extensions.Cast<X509Extension>()
.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);
@ -320,7 +320,20 @@ namespace WebsitePanel.Providers.Web.Iis
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)
{
var bindingInformation = string.Format("{0}:443:{1}", website.SiteIPAddress ?? "*", dedicatedIp ? "" : hostName);

View file

@ -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('/'))));
}
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);
}
}
}

View file

@ -260,7 +260,7 @@ namespace WebsitePanel.WebDav.Core
{
get
{
string displayName = _href.AbsoluteUri.Trim('/').Replace(_baseUri.AbsoluteUri.Trim('/'), "");
string displayName = _href.ToString().Trim('/').Replace(_baseUri.ToString().Trim('/'), "");
displayName = Regex.Replace(displayName, "\\/$", "");
Match displayNameMatch = Regex.Match(displayName, "([\\/]+)$");
if (displayNameMatch.Success)
@ -483,7 +483,7 @@ namespace WebsitePanel.WebDav.Core
{
_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);
}

View file

@ -52,7 +52,7 @@ namespace WebsitePanel.WebDav.Core.Managers
Href = new Uri(x.Url),
ItemType = ItemType.Folder,
ContentLength = x.Size * 1024 * 1024,
AllocatedSpace = x.FRSMQuotaMB * 1024 * 1024,
AllocatedSpace = (long)x.FRSMQuotaMB * 1024 * 1024,
IsRootItem = true
}).ToArray();
}

View file

@ -383,7 +383,8 @@ namespace WebsitePanel.WebDavPortal.Controllers
foreach (var item in items)
{
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)
{

View file

@ -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]);
}
}
}

View file

@ -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>
/// Looks up a localized string similar to Cancel.
/// </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>
/// Looks up a localized string similar to Delete.
/// </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>
/// Looks up a localized string similar to Error.
/// </summary>
@ -169,11 +169,11 @@ namespace WebsitePanel.WebDavPortal.Resources {
}
/// <summary>
/// Looks up a localized string similar to Excel workbook.
/// Looks up a localized string similar to EB.
/// </summary>
public static string ExcelWorkbook {
public static string ExabyteShort {
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>
/// Looks up a localized string similar to File Upload.
/// </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>
/// Looks up a localized string similar to {0} items was removed..
/// </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>
/// Looks up a localized string similar to Modified.
/// </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>
/// Looks up a localized string similar to Please wait....
/// </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>
/// Looks up a localized string similar to Processing.
/// </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>
/// Looks up a localized string similar to Type.
/// </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>
/// Looks up a localized string similar to Yes.
/// </summary>

View file

@ -120,6 +120,12 @@
<data name="Actions" xml:space="preserve">
<value>Actions</value>
</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">
<value>Cancel</value>
</data>
@ -132,9 +138,6 @@
<data name="Confirm" xml:space="preserve">
<value>Confirm</value>
</data>
<data name="Create" xml:space="preserve">
<value>Create</value>
</data>
<data name="Delete" xml:space="preserve">
<value>Delete</value>
</data>
@ -147,24 +150,15 @@
<data name="DialogsContentConfrimFileDeletion" xml:space="preserve">
<value>Are you sure you want to delete {0} item(s)?</value>
</data>
<data name="EnterFileName" xml:space="preserve">
<value>Enter file name</value>
</data>
<data name="Error" xml:space="preserve">
<value>Error</value>
</data>
<data name="ExcelWorkbook" xml:space="preserve">
<value>Excel workbook</value>
<data name="ExabyteShort" xml:space="preserve">
<value>EB</value>
</data>
<data name="File" xml:space="preserve">
<value>File</value>
</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">
<value>File Upload</value>
</data>
@ -174,12 +168,15 @@
<data name="Info" xml:space="preserve">
<value>Info</value>
</data>
<data name="ItemExist" xml:space="preserve">
<value>File already exist</value>
</data>
<data name="ItemsWasRemovedFormat" xml:space="preserve">
<value>{0} items was removed.</value>
</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">
<value>Modified</value>
</data>
@ -195,12 +192,12 @@
<data name="OrDragAndDropFilesHere" xml:space="preserve">
<value>or drag and drop files here.</value>
</data>
<data name="PetabyteShort" xml:space="preserve">
<value>PB</value>
</data>
<data name="PleaseWaitWithDots" xml:space="preserve">
<value>Please wait...</value>
</data>
<data name="PowerPointPresentation" xml:space="preserve">
<value>Powerpoint presentation</value>
</data>
<data name="Processing" xml:space="preserve">
<value>Processing</value>
</data>
@ -225,15 +222,15 @@
<data name="Table" xml:space="preserve">
<value>Table</value>
</data>
<data name="TerabyteShort" xml:space="preserve">
<value>TB</value>
</data>
<data name="Type" xml:space="preserve">
<value>Type</value>
</data>
<data name="Upload" xml:space="preserve">
<value>Upload</value>
</data>
<data name="WordDocument" xml:space="preserve">
<value>Word document</value>
</data>
<data name="Yes" xml:space="preserve">
<value>Yes</value>
</data>

View file

@ -4,6 +4,7 @@
@using WebsitePanel.WebDav.Core.Config
@using WebsitePanel.WebDavPortal.FileOperations
@using Ninject;
@using WebsitePanel.WebDavPortal.Helpers
@using WebsitePanel.WebDavPortal.Resources
@using WebsitePanel.WebDavPortal.UI
@using WebsitePanel.WebDavPortal.UI.Routes
@ -63,7 +64,7 @@
<p class="progress-text">@percent%</p>
</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">

View file

@ -183,6 +183,7 @@
<DependentUpon>Global.asax</DependentUpon>
</Compile>
<Compile Include="Helpers\DataTableHelper.cs" />
<Compile Include="Helpers\ViewDataHelper.cs" />
<Compile Include="HttpHandlers\AccessTokenHandler.cs" />
<Compile Include="HttpHandlers\FileTransferRequestHandler.cs" />
<Compile Include="Mapping\AutoMapperPortalConfiguration.cs" />

View file

@ -5656,6 +5656,9 @@
<data name="ERROR.RDSSESSIONHOST_CERTIFICATE_NOT_INSTALLED" xml:space="preserve">
<value>Session host certificate not installed</value>
</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">
<value>Session host certificate has been installed</value>
</data>

View file

@ -57,6 +57,7 @@ namespace WebsitePanel.Portal
if (rdsServer.ItemId.HasValue)
{
rdsServer.Status = ES.Services.RDS.GetRdsServerStatus(rdsServer.ItemId.Value, rdsServer.FqdName);
rdsServer.SslAvailable = ES.Services.RDS.GetRdsCertificateByItemId(rdsServer.ItemId.Value) != null;
}
}

View file

@ -129,4 +129,22 @@
<data name="lblPFXInstallPassword.Text" xml:space="preserve">
<value>Certificate Password:</value>
</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>

View file

@ -1,17 +1,63 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="RDS_Settings.ascx.cs" Inherits="WebsitePanel.Portal.ProviderControls.RDS_Settings" %>
<table>
<tr>
<td colspan ="2" style="padding: 10px 0 10px 0;"><asp:FileUpload ID="upPFX" runat="server"/></td>
</tr>
<tr><td></td></tr>
<tr>
<td class="SubHead" style="width:200px" nowrap>
<asp:Localize runat="server" meta:resourcekey="lblPFXInstallPassword" />
</td>
<td>
<asp:TextBox ID="txtPFXInstallPassword" runat="server" TextMode="Password" Width="200px" />
</td>
</tr>
<%@ 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>&nbsp;
</legend>
<table>
<tr>
<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><td></td></tr>
<tr>
<td class="SubHead" style="width:200px" nowrap>
<asp:Localize runat="server" meta:resourcekey="lblPFXInstallPassword" />
</td>
<td>
<asp:TextBox ID="txtPFXInstallPassword" runat="server" TextMode="Password" Width="200px" />
</td>
</tr>
</table>
</fieldset>
<fieldset>
<legend>
<asp:Label ID="currentCertificate" runat="server" meta:resourcekey="currentCertificate" Text="Current Certificate" CssClass="NormalBold"></asp:Label>&nbsp;
</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>
<td class="SubHead" width="200" nowrap>
<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" />
</td>
</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>
<td class="SubHead" width="200" nowrap>
<asp:Label runat="server" ID="lblPrimaryDomainController" meta:resourcekey="lblPrimaryDomainController" Text="Primary Domain Controller:"/>
@ -84,4 +139,6 @@
</asp:GridView>
</td>
</tr>
</table>
</table>
</fieldset>
<br />

View file

@ -26,8 +26,10 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using AjaxControlToolkit;
using System;
using System.Collections.Generic;
using System.Security.Cryptography.X509Certificates;
using System.Web.UI.WebControls;
using WebsitePanel.EnterpriseServer;
using WebsitePanel.Providers.Common;
@ -39,7 +41,7 @@ namespace WebsitePanel.Portal.ProviderControls
{
protected void Page_Load(object sender, EventArgs e)
{
FillCertificateInfo();
}
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)
{
txtConnectionBroker.Text = settings["ConnectionBroker"];
@ -62,6 +83,7 @@ namespace WebsitePanel.Portal.ProviderControls
UpdateLyncServersGrid();
txtRootOU.Text = settings["RootOU"];
txtComputersRootOu.Text = settings["ComputersRootOU"];
txtPrimaryDomainController.Text = settings["PrimaryDomainController"];
if (!string.IsNullOrEmpty(settings["UseCentralNPS"]) && bool.TrueString == settings["UseCentralNPS"])
@ -82,6 +104,7 @@ namespace WebsitePanel.Portal.ProviderControls
{
settings["ConnectionBroker"] = txtConnectionBroker.Text;
settings["RootOU"] = txtRootOU.Text;
settings["ComputersRootOU"] = txtComputersRootOu.Text;
settings["PrimaryDomainController"] = txtPrimaryDomainController.Text;
settings["UseCentralNPS"] = chkUseCentralNPS.Checked.ToString();
settings["CentralNPS"] = chkUseCentralNPS.Checked ? txtCentralNPS.Text : string.Empty;
@ -163,7 +186,7 @@ namespace WebsitePanel.Portal.ProviderControls
GWServers = str.TrimEnd(';');
UpdateLyncServersGrid();
}
}
}
}
public class GWServer

View file

@ -12,6 +12,15 @@ namespace WebsitePanel.Portal.ProviderControls {
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>
/// upPFX control.
/// </summary>
@ -30,6 +39,51 @@ namespace WebsitePanel.Portal.ProviderControls {
/// </remarks>
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>
/// lblConnectionBroker control.
/// </summary>
@ -84,6 +138,33 @@ namespace WebsitePanel.Portal.ProviderControls {
/// </remarks>
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>
/// lblPrimaryDomainController control.
/// </summary>

View file

@ -69,7 +69,7 @@ namespace WebsitePanel.Portal.RDS
}
catch (Exception ex)
{
messageBox.ShowErrorMessage("RDSCOLLECTION_NOT_CREATED", ex);
ShowErrorMessage("RDSCOLLECTION_NOT_CREATED", ex);
}
}
}

View file

@ -52,6 +52,19 @@ namespace WebsitePanel.Portal.RDS
txtApplicationName.Text = remoteApp.DisplayName;
//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 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());
}

View file

@ -27,6 +27,7 @@
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Linq;
using System.Web.UI.WebControls;
using WebsitePanel.EnterpriseServer;
using WebsitePanel.Providers.Common;
@ -45,6 +46,19 @@ namespace WebsitePanel.Portal.RDS
BindQuota();
var collectionUsers = ES.Services.RDS.GetRdsCollectionUsers(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;
users.SetUsers(collectionUsers);
@ -63,6 +77,12 @@ namespace WebsitePanel.Portal.RDS
{
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()

View file

@ -4,6 +4,8 @@ using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebsitePanel.Providers.HostedSolution;
using WebsitePanel.Providers.RemoteDesktopServices;
namespace WebsitePanel.Portal.RDS
{
@ -17,6 +19,12 @@ namespace WebsitePanel.Portal.RDS
var collection = ES.Services.RDS.GetRdsCollection(PanelRequest.CollectionID);
litCollectionName.Text = collection.DisplayName;
foreach(var user in collectionLocalAdmins)
{
user.IsVIP = false;
}
users.SetUsers(collectionLocalAdmins);
}
}

View file

@ -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:HiddenField ID="hfFilePath" runat="server" Value='<%# Eval("FilePath") %>'/>
<asp:HiddenField ID="hfRequiredCommandLine" runat="server" Value='<%# Eval("RequiredCommandLine") %>'/>
<asp:HiddenField ID="hfUsers" runat="server" Value='<%# Eval("Users") != null ? "New" : null %>'/>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>

View file

@ -136,7 +136,7 @@ namespace WebsitePanel.Portal.RDS.UserControls
var fullRemote = new StartMenuApp
{
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())
};
@ -213,6 +213,13 @@ namespace WebsitePanel.Portal.RDS.UserControls
app.DisplayName = ((LinkButton)row.FindControl("lnkDisplayName")).Text;
app.FilePath = ((HiddenField)row.FindControl("hfFilePath")).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 ||
(state == SelectedState.Selected && chkSelect.Checked) ||

View file

@ -23,8 +23,9 @@
<asp:TemplateField meta:resourcekey="gvUsersAccount" HeaderText="gvUsersAccount">
<ItemStyle Width="96%" Wrap="false" HorizontalAlign="Left">
</ItemStyle>
<ItemTemplate>
<ItemTemplate>
<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") %>' />
</ItemTemplate>
</asp:TemplateField>
@ -81,6 +82,7 @@
<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:HiddenField ID="hdnSamName" runat="server" Value='<%# Eval("SamAccountName") %>' />
<asp:HiddenField ID="hdnLocalAdmin" runat="server" Value='<%# Eval("IsVIP").ToString() %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField meta:resourcekey="gvAccountsEmail">

View file

@ -42,6 +42,18 @@ namespace WebsitePanel.Portal.RDS.UserControls
{
public const string DirectionString = "DirectionString";
public bool ButtonAddEnabled
{
get
{
return btnAdd.Enabled;
}
set
{
btnAdd.Enabled = value;
}
}
protected enum SelectedState
{
All,
@ -74,14 +86,7 @@ namespace WebsitePanel.Portal.RDS.UserControls
}";
Page.ClientScript.RegisterClientScriptBlock(typeof(RDSCollectionUsers), "SelectAllCheckboxes",
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)
@ -132,6 +137,19 @@ namespace WebsitePanel.Portal.RDS.UserControls
protected void BindPopupAccounts()
{
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();
Array.Sort(accounts, CompareAccount);
@ -221,7 +239,8 @@ namespace WebsitePanel.Portal.RDS.UserControls
{
AccountName = (string)gvPopupAccounts.DataKeys[i][0],
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)
});
}
}

View file

@ -15,10 +15,8 @@
<wsp:SimpleMessageBox id="messageBox" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel runat="server" ID="updatePanelUsers">
<ContentTemplate>
<div class="FormButtonsBar">
<div class="FormButtonsBar">
<div class="Left">
<asp:Button ID="btnAddRDSServer" runat="server"
meta:resourcekey="btnAddRDSServer" Text="Add RDS Server" CssClass="Button3"
@ -35,11 +33,20 @@
<asp:ListItem>100</asp:ListItem>
</asp:DropDownList>
<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:TextBox ID="txtSearchValue" runat="server" CssClass="NormalTextBox" Width="100"/>
<asp:ImageButton ID="cmdSearch" Runat="server" meta:resourcekey="cmdSearch" SkinID="SearchButton" CausesValidation="false"/>
</asp:Panel>
</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"
AllowPaging="True" AllowSorting="True"
@ -84,7 +91,7 @@
</asp:TemplateField>
<asp:TemplateField>
<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"
OnClientClick="if(confirm('Are you sure you want to install certificate?')) ShowProgressDialog('Installing certificate...'); else return false;"></asp:LinkButton>
</ItemTemplate>
@ -97,13 +104,7 @@
</ItemTemplate>
</asp:TemplateField>
</Columns>
</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:GridView>
<asp:Panel ID="ServerInfoPanel" runat="server" CssClass="Popup" style="display:none">
<table class="Popup-Header" cellpadding="0" cellspacing="0">

View file

@ -39,15 +39,6 @@ namespace WebsitePanel.Portal {
/// </remarks>
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>
/// btnAddRDSServer control.
/// </summary>
@ -102,15 +93,6 @@ namespace WebsitePanel.Portal {
/// </remarks>
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>
/// odsRDSServersPaged control.
/// </summary>
@ -120,6 +102,24 @@ namespace WebsitePanel.Portal {
/// </remarks>
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>
/// ServerInfoPanel control.
/// </summary>

View file

@ -11,16 +11,16 @@
<div class="FormContentRDSConf">
<table>
<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>
<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>
</td>
</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>
<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>
</tr>
</table>

View file

@ -62,8 +62,8 @@ namespace WebsitePanel.Portal
ResultObject result = ES.Services.RDS.AddRdsServer(rdsServer);
if (!result.IsSuccess && result.ErrorCodes.Count > 0)
{
messageBox.ShowMessage(result, "", "");
{
messageBox.ShowMessage(result, "RDSSERVER_NOT_ADDED", "");
return;
}
@ -71,7 +71,7 @@ namespace WebsitePanel.Portal
}
catch (Exception ex)
{
messageBox.ShowErrorMessage("", ex);
ShowErrorMessage("RDSSERVER_NOT_ADDED", ex);
}
}

View file

@ -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>
// This code was generated by a tool.

View file

@ -5901,7 +5901,9 @@
</Content>
<Content Include="RDS\UserControls\App_LocalResources\RDSCollectionUsers.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="UserControls\App_LocalResources\DomainControl.ascx.resx">
<SubType>Designer</SubType>