Merge Commit
This commit is contained in:
commit
f968209010
145 changed files with 220103 additions and 1156 deletions
|
@ -5548,18 +5548,32 @@ CREATE TABLE [dbo].[RDSCertificates](
|
||||||
|
|
||||||
GO
|
GO
|
||||||
|
|
||||||
|
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'F' AND name = 'FK_RDSCollectionUsers_RDSCollectionId')
|
||||||
|
BEGIN
|
||||||
ALTER TABLE [dbo].[RDSCollectionUsers]
|
ALTER TABLE [dbo].[RDSCollectionUsers]
|
||||||
DROP CONSTRAINT [FK_RDSCollectionUsers_RDSCollectionId]
|
DROP CONSTRAINT [FK_RDSCollectionUsers_RDSCollectionId]
|
||||||
|
END
|
||||||
|
ELSE
|
||||||
|
PRINT 'FK_RDSCollectionUsers_RDSCollectionId not EXISTS'
|
||||||
GO
|
GO
|
||||||
|
|
||||||
|
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'F' AND name = 'FK_RDSCollectionUsers_UserId')
|
||||||
|
BEGIN
|
||||||
ALTER TABLE [dbo].[RDSCollectionUsers]
|
ALTER TABLE [dbo].[RDSCollectionUsers]
|
||||||
DROP CONSTRAINT [FK_RDSCollectionUsers_UserId]
|
DROP CONSTRAINT [FK_RDSCollectionUsers_UserId]
|
||||||
|
END
|
||||||
|
ELSE
|
||||||
|
PRINT 'FK_RDSCollectionUsers_UserId not EXISTS'
|
||||||
GO
|
GO
|
||||||
|
|
||||||
|
|
||||||
|
IF EXISTS (SELECT * FROM sys.objects WHERE type = 'F' AND name = 'FK_RDSServers_RDSCollectionId')
|
||||||
|
BEGIN
|
||||||
ALTER TABLE [dbo].[RDSServers]
|
ALTER TABLE [dbo].[RDSServers]
|
||||||
DROP CONSTRAINT [FK_RDSServers_RDSCollectionId]
|
DROP CONSTRAINT [FK_RDSServers_RDSCollectionId]
|
||||||
|
END
|
||||||
|
ELSE
|
||||||
|
PRINT 'FK_RDSServers_RDSCollectionId not EXISTS'
|
||||||
GO
|
GO
|
||||||
|
|
||||||
ALTER TABLE [dbo].[RDSCollectionUsers] WITH CHECK ADD CONSTRAINT [FK_RDSCollectionUsers_RDSCollectionId] FOREIGN KEY([RDSCollectionId])
|
ALTER TABLE [dbo].[RDSCollectionUsers] WITH CHECK ADD CONSTRAINT [FK_RDSCollectionUsers_RDSCollectionId] FOREIGN KEY([RDSCollectionId])
|
||||||
|
@ -8846,6 +8860,12 @@ AND ((@GroupName IS NULL) OR (@GroupName IS NOT NULL AND RG.GroupName = @GroupNa
|
||||||
RETURN
|
RETURN
|
||||||
GO
|
GO
|
||||||
|
|
||||||
|
-- Hyper-V 2012 R2
|
||||||
|
IF NOT EXISTS (SELECT * FROM [dbo].[Providers] WHERE [ProviderName] = 'HyperV2012R2')
|
||||||
|
BEGIN
|
||||||
|
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (350, 30, N'HyperV2012R2', N'Microsoft Hyper-V 2012 R2', N'WebsitePanel.Providers.Virtualization.HyperV2012R2, WebsitePanel.Providers.Virtualization.HyperV2012R2', N'HyperV', 1)
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
--ES OWA Editing
|
--ES OWA Editing
|
||||||
IF NOT EXISTS (SELECT * FROM SYS.TABLES WHERE name = 'EnterpriseFoldersOwaPermissions')
|
IF NOT EXISTS (SELECT * FROM SYS.TABLES WHERE name = 'EnterpriseFoldersOwaPermissions')
|
||||||
|
@ -8990,10 +9010,122 @@ SELECT
|
||||||
WHERE EFOP.ItemID = @ItemID AND EFOP.AccountID = @AccountID
|
WHERE EFOP.ItemID = @ItemID AND EFOP.AccountID = @AccountID
|
||||||
GO
|
GO
|
||||||
|
|
||||||
-- Hyper-V 2012 R2
|
|
||||||
IF NOT EXISTS (SELECT * FROM [dbo].[Providers] WHERE [ProviderName] = 'HyperV2012R2')
|
-- CRM2015 Provider
|
||||||
|
|
||||||
|
IF NOT EXISTS (SELECT * FROM [dbo].[Providers] WHERE [DisplayName] = 'Hosted MS CRM 2015')
|
||||||
BEGIN
|
BEGIN
|
||||||
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (350, 30, N'HyperV2012R2', N'Microsoft Hyper-V 2012 R2', N'WebsitePanel.Providers.Virtualization.HyperV2012R2, WebsitePanel.Providers.Virtualization.HyperV2012R2', N'HyperV', 1)
|
INSERT [dbo].[Providers] ([ProviderId], [GroupId], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery])
|
||||||
|
VALUES(1205, 24, N'CRM', N'Hosted MS CRM 2015', N'WebsitePanel.Providers.HostedSolution.CRMProvider2015, WebsitePanel.Providers.HostedSolution.Crm2015', N'CRM2011', NULL)
|
||||||
END
|
END
|
||||||
GO
|
GO
|
||||||
|
|
||||||
|
-- RDS Setup Instructions
|
||||||
|
|
||||||
|
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'RDSSetupLetter' AND [PropertyName]= N'CC' )
|
||||||
|
BEGIN
|
||||||
|
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'RDSSetupLetter', N'CC', N'support@HostingCompany.com')
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'RDSSetupLetter' AND [PropertyName]= N'From' )
|
||||||
|
BEGIN
|
||||||
|
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'RDSSetupLetter', N'From', N'support@HostingCompany.com')
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
DECLARE @RDSSetupLetterHtmlBody nvarchar(2500)
|
||||||
|
|
||||||
|
Set @RDSSetupLetterHtmlBody = N'<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head>
|
||||||
|
<title>RDS Setup Information</title>
|
||||||
|
<style type="text/css">
|
||||||
|
.Summary { background-color: ##ffffff; padding: 5px; }
|
||||||
|
.Summary .Header { padding: 10px 0px 10px 10px; font-size: 16pt; background-color: ##E5F2FF; color: ##1F4978; border-bottom: solid 2px ##86B9F7; }
|
||||||
|
.Summary A { color: ##0153A4; }
|
||||||
|
.Summary { font-family: Tahoma; font-size: 9pt; }
|
||||||
|
.Summary H1 { font-size: 1.7em; color: ##1F4978; border-bottom: dotted 3px ##efefef; }
|
||||||
|
.Summary H2 { font-size: 1.3em; color: ##1F4978; }
|
||||||
|
.Summary TABLE { border: solid 1px ##e5e5e5; }
|
||||||
|
.Summary TH,
|
||||||
|
.Summary TD.Label { padding: 5px; font-size: 8pt; font-weight: bold; background-color: ##f5f5f5; }
|
||||||
|
.Summary TD { padding: 8px; font-size: 9pt; }
|
||||||
|
.Summary UL LI { font-size: 1.1em; font-weight: bold; }
|
||||||
|
.Summary UL UL LI { font-size: 0.9em; font-weight: normal; }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="Summary">
|
||||||
|
|
||||||
|
<a name="top"></a>
|
||||||
|
<div class="Header">
|
||||||
|
RDS Setup Information
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>';
|
||||||
|
|
||||||
|
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'RDSSetupLetter' AND [PropertyName]= N'HtmlBody' )
|
||||||
|
BEGIN
|
||||||
|
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'RDSSetupLetter', N'HtmlBody', @RDSSetupLetterHtmlBody)
|
||||||
|
END
|
||||||
|
ELSE
|
||||||
|
UPDATE [dbo].[UserSettings] SET [PropertyValue] = @RDSSetupLetterHtmlBody WHERE [UserID] = 1 AND [SettingsName]= N'RDSSetupLetter' AND [PropertyName]= N'HtmlBody'
|
||||||
|
GO
|
||||||
|
|
||||||
|
|
||||||
|
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'RDSSetupLetter' AND [PropertyName]= N'Priority' )
|
||||||
|
BEGIN
|
||||||
|
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'RDSSetupLetter', N'Priority', N'Normal')
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'RDSSetupLetter' AND [PropertyName]= N'Subject' )
|
||||||
|
BEGIN
|
||||||
|
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'RDSSetupLetter', N'Subject', N'RDS setup')
|
||||||
|
END
|
||||||
|
GO
|
||||||
|
|
||||||
|
DECLARE @RDSSetupLetterTextBody nvarchar(2500)
|
||||||
|
|
||||||
|
Set @RDSSetupLetterTextBody = N'=================================
|
||||||
|
RDS Setup Information
|
||||||
|
=================================
|
||||||
|
<ad:if test="#user#">
|
||||||
|
Hello #user.FirstName#,
|
||||||
|
</ad:if>
|
||||||
|
|
||||||
|
Please, find below RDS setup instructions.
|
||||||
|
|
||||||
|
If you have any questions, feel free to contact our support department at any time.
|
||||||
|
|
||||||
|
Best regards'
|
||||||
|
|
||||||
|
IF NOT EXISTS (SELECT * FROM [dbo].[UserSettings] WHERE [UserID] = 1 AND [SettingsName]= N'RDSSetupLetter' AND [PropertyName]= N'TextBody' )
|
||||||
|
BEGIN
|
||||||
|
INSERT [dbo].[UserSettings] ([UserID], [SettingsName], [PropertyName], [PropertyValue]) VALUES (1, N'RDSSetupLetter', N'TextBody', @RDSSetupLetterTextBody)
|
||||||
|
END
|
||||||
|
ELSE
|
||||||
|
UPDATE [dbo].[UserSettings] SET [PropertyValue] = @RDSSetupLetterTextBody WHERE [UserID] = 1 AND [SettingsName]= N'RDSSetupLetter' AND [PropertyName]= N'TextBody'
|
||||||
|
GO
|
||||||
|
|
||||||
|
IF NOT EXISTS (SELECT * FROM [dbo].[ResourceGroups] WHERE GroupName = 'Sharepoint Foundation Server')
|
||||||
|
BEGIN
|
||||||
|
DECLARE @group_order AS INT
|
||||||
|
DECLARE @group_controller AS NVARCHAR(1000)
|
||||||
|
DECLARE @group_id AS INT
|
||||||
|
DECLARE @provider_id AS INT
|
||||||
|
|
||||||
|
UPDATE [dbo].[ResourceGroups] SET GroupName = 'Sharepoint Foundation Server' WHERE GroupName = 'Hosted Sharepoint'
|
||||||
|
SELECT @group_order = GroupOrder, @group_controller = GroupController FROM [dbo].[ResourceGroups] WHERE GroupName = 'Sharepoint Foundation Server'
|
||||||
|
SELECT TOP 1 @group_id = GroupId + 1 From [dbo].[ResourceGroups] ORDER BY GroupID DESC
|
||||||
|
SELECT TOP 1 @provider_id = ProviderId + 1 From [dbo].[Providers] ORDER BY ProviderID DESC
|
||||||
|
UPDATE [dbo].[ResourceGroups] SET GroupOrder = GroupOrder + 1 WHERE GroupOrder > @group_order
|
||||||
|
INSERT INTO [dbo].[ResourceGroups] (GroupID, GroupName, GroupOrder, GroupController, ShowGroup) VALUES (@group_id, 'Sharepoint Server', @group_order + 1, @group_controller, 1)
|
||||||
|
INSERT INTO [dbo].[Providers] (ProviderID, GroupID, ProviderName, DisplayName, ProviderType, EditorControl, DisableAutoDiscovery)
|
||||||
|
(SELECT @provider_id, @group_id, ProviderName, DisplayName, ProviderType, EditorControl, DisableAutoDiscovery FROM [dbo].[Providers] WHERE ProviderName = 'HostedSharePoint2013')
|
||||||
|
|
||||||
|
INSERT INTO [dbo].[Quotas] (QuotaID, GroupID, QuotaOrder, QuotaName, QuotaDescription, QuotaTypeID, ServiceQuota)
|
||||||
|
VALUES (550, @group_id, 1, 'HostedSharePointServer.Sites', 'SharePoint Site Collections', 2, 0)
|
||||||
|
INSERT INTO [dbo].[Quotas] (QuotaID, GroupID, QuotaOrder, QuotaName, QuotaDescription, QuotaTypeID, ServiceQuota)
|
||||||
|
VALUES (551, @group_id, 2, 'HostedSharePointServer.MaxStorage', 'Max site storage, MB', 3, 0)
|
||||||
|
INSERT INTO [dbo].[Quotas] (QuotaID, GroupID, QuotaOrder, QuotaName, QuotaDescription, QuotaTypeID, ServiceQuota)
|
||||||
|
VALUES (552, @group_id, 3, 'HostedSharePointServer.UseSharedSSL', 'Use shared SSL Root', 1, 0)
|
||||||
|
END
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -41,7 +41,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
public const int LIMITED = 2;
|
public const int LIMITED = 2;
|
||||||
public const int ESS = 22;
|
public const int ESS = 22;
|
||||||
|
|
||||||
// CRM 2013
|
// CRM 2013/2015
|
||||||
public const int PROFESSIONAL = 0;
|
public const int PROFESSIONAL = 0;
|
||||||
public const int BASIC = 2;
|
public const int BASIC = 2;
|
||||||
public const int ESSENTIAL = 5;
|
public const int ESSENTIAL = 5;
|
||||||
|
|
|
@ -44,11 +44,12 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
public const string Dns = "DNS";
|
public const string Dns = "DNS";
|
||||||
public const string Statistics = "Statistics";
|
public const string Statistics = "Statistics";
|
||||||
public const string SharePoint = "SharePoint";
|
public const string SharePoint = "SharePoint";
|
||||||
public const string HostedSharePoint = "Hosted SharePoint";
|
public const string SharepointFoundationServer = "Sharepoint Foundation Server";
|
||||||
|
public const string SharepointServer = "Sharepoint Server";
|
||||||
public const string Exchange = "Exchange";
|
public const string Exchange = "Exchange";
|
||||||
public const string HostedOrganizations = "Hosted Organizations";
|
public const string HostedOrganizations = "Hosted Organizations";
|
||||||
public const string HostedCRM = "Hosted CRM";
|
public const string HostedCRM = "Hosted CRM";
|
||||||
public const string HostedCRM2013 = "Hosted CRM2013";
|
public const string HostedCRM2013 = "Hosted CRM2013"; // CRM 2013/2015
|
||||||
public const string VPS = "VPS";
|
public const string VPS = "VPS";
|
||||||
public const string BlackBerry = "BlackBerry";
|
public const string BlackBerry = "BlackBerry";
|
||||||
public const string OCS = "OCS";
|
public const string OCS = "OCS";
|
||||||
|
|
|
@ -44,6 +44,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
public const string WPI_SETTINGS = "WpiSettings";
|
public const string WPI_SETTINGS = "WpiSettings";
|
||||||
public const string FILEMANAGER_SETTINGS = "FileManagerSettings";
|
public const string FILEMANAGER_SETTINGS = "FileManagerSettings";
|
||||||
public const string PACKAGE_DISPLAY_SETTINGS = "PackageDisplaySettings";
|
public const string PACKAGE_DISPLAY_SETTINGS = "PackageDisplaySettings";
|
||||||
|
public const string RDS_SETTINGS = "RdsSettings";
|
||||||
|
|
||||||
// key to access to wpi main & custom feed in wpi settings
|
// key to access to wpi main & custom feed in wpi settings
|
||||||
public const string WPI_MAIN_FEED_KEY = "WpiMainFeedUrl";
|
public const string WPI_MAIN_FEED_KEY = "WpiMainFeedUrl";
|
||||||
|
|
|
@ -63,6 +63,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
|
|
||||||
public const string DEFAULT_MAILBOXPLANS = "DefaultMailboxPlans";
|
public const string DEFAULT_MAILBOXPLANS = "DefaultMailboxPlans";
|
||||||
public const string DEFAULT_LYNCUSERPLANS = "DefaultLyncUserPlans";
|
public const string DEFAULT_LYNCUSERPLANS = "DefaultLyncUserPlans";
|
||||||
|
public const string RDS_SETUP_LETTER = "RDSSetupLetter";
|
||||||
|
|
||||||
public int UserId;
|
public int UserId;
|
||||||
public string SettingsName;
|
public string SettingsName;
|
||||||
|
|
|
@ -18,9 +18,9 @@ namespace WebsitePanel.EnterpriseServer {
|
||||||
using System.Web.Services.Protocols;
|
using System.Web.Services.Protocols;
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
|
using WebsitePanel.Providers.HostedSolution;
|
||||||
using WebsitePanel.Providers.RemoteDesktopServices;
|
using WebsitePanel.Providers.RemoteDesktopServices;
|
||||||
using WebsitePanel.Providers.Common;
|
using WebsitePanel.Providers.Common;
|
||||||
using WebsitePanel.Providers.HostedSolution;
|
|
||||||
|
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
|
@ -126,6 +126,12 @@ namespace WebsitePanel.EnterpriseServer {
|
||||||
|
|
||||||
private System.Threading.SendOrPostCallback AddRdsCertificateOperationCompleted;
|
private System.Threading.SendOrPostCallback AddRdsCertificateOperationCompleted;
|
||||||
|
|
||||||
|
private System.Threading.SendOrPostCallback GetRdsServicesOperationCompleted;
|
||||||
|
|
||||||
|
private System.Threading.SendOrPostCallback GetRdsSetupLetterOperationCompleted;
|
||||||
|
|
||||||
|
private System.Threading.SendOrPostCallback SendRdsSetupLetterOperationCompleted;
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public esRemoteDesktopServices() {
|
public esRemoteDesktopServices() {
|
||||||
this.Url = "http://localhost:9002/esRemoteDesktopServices.asmx";
|
this.Url = "http://localhost:9002/esRemoteDesktopServices.asmx";
|
||||||
|
@ -275,6 +281,15 @@ namespace WebsitePanel.EnterpriseServer {
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public event AddRdsCertificateCompletedEventHandler AddRdsCertificateCompleted;
|
public event AddRdsCertificateCompletedEventHandler AddRdsCertificateCompleted;
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public event GetRdsServicesCompletedEventHandler GetRdsServicesCompleted;
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public event GetRdsSetupLetterCompletedEventHandler GetRdsSetupLetterCompleted;
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public event SendRdsSetupLetterCompletedEventHandler SendRdsSetupLetterCompleted;
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetRdsCollection", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetRdsCollection", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
||||||
public RdsCollection GetRdsCollection(int collectionId) {
|
public RdsCollection GetRdsCollection(int collectionId) {
|
||||||
|
@ -1999,7 +2014,7 @@ namespace WebsitePanel.EnterpriseServer {
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetRdsServerInfo", 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/GetRdsServerInfo", 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 RdsServerInfo GetRdsServerInfo(int itemId, string fqdnName) {
|
public RdsServerInfo GetRdsServerInfo([System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] System.Nullable<int> itemId, string fqdnName) {
|
||||||
object[] results = this.Invoke("GetRdsServerInfo", new object[] {
|
object[] results = this.Invoke("GetRdsServerInfo", new object[] {
|
||||||
itemId,
|
itemId,
|
||||||
fqdnName});
|
fqdnName});
|
||||||
|
@ -2007,7 +2022,7 @@ namespace WebsitePanel.EnterpriseServer {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public System.IAsyncResult BeginGetRdsServerInfo(int itemId, string fqdnName, System.AsyncCallback callback, object asyncState) {
|
public System.IAsyncResult BeginGetRdsServerInfo(System.Nullable<int> itemId, string fqdnName, System.AsyncCallback callback, object asyncState) {
|
||||||
return this.BeginInvoke("GetRdsServerInfo", new object[] {
|
return this.BeginInvoke("GetRdsServerInfo", new object[] {
|
||||||
itemId,
|
itemId,
|
||||||
fqdnName}, callback, asyncState);
|
fqdnName}, callback, asyncState);
|
||||||
|
@ -2020,12 +2035,12 @@ namespace WebsitePanel.EnterpriseServer {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public void GetRdsServerInfoAsync(int itemId, string fqdnName) {
|
public void GetRdsServerInfoAsync(System.Nullable<int> itemId, string fqdnName) {
|
||||||
this.GetRdsServerInfoAsync(itemId, fqdnName, null);
|
this.GetRdsServerInfoAsync(itemId, fqdnName, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public void GetRdsServerInfoAsync(int itemId, string fqdnName, object userState) {
|
public void GetRdsServerInfoAsync(System.Nullable<int> itemId, string fqdnName, object userState) {
|
||||||
if ((this.GetRdsServerInfoOperationCompleted == null)) {
|
if ((this.GetRdsServerInfoOperationCompleted == null)) {
|
||||||
this.GetRdsServerInfoOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRdsServerInfoOperationCompleted);
|
this.GetRdsServerInfoOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRdsServerInfoOperationCompleted);
|
||||||
}
|
}
|
||||||
|
@ -2043,7 +2058,7 @@ namespace WebsitePanel.EnterpriseServer {
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetRdsServerStatus", 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/GetRdsServerStatus", 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 string GetRdsServerStatus(int itemId, string fqdnName) {
|
public string GetRdsServerStatus([System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] System.Nullable<int> itemId, string fqdnName) {
|
||||||
object[] results = this.Invoke("GetRdsServerStatus", new object[] {
|
object[] results = this.Invoke("GetRdsServerStatus", new object[] {
|
||||||
itemId,
|
itemId,
|
||||||
fqdnName});
|
fqdnName});
|
||||||
|
@ -2051,7 +2066,7 @@ namespace WebsitePanel.EnterpriseServer {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public System.IAsyncResult BeginGetRdsServerStatus(int itemId, string fqdnName, System.AsyncCallback callback, object asyncState) {
|
public System.IAsyncResult BeginGetRdsServerStatus(System.Nullable<int> itemId, string fqdnName, System.AsyncCallback callback, object asyncState) {
|
||||||
return this.BeginInvoke("GetRdsServerStatus", new object[] {
|
return this.BeginInvoke("GetRdsServerStatus", new object[] {
|
||||||
itemId,
|
itemId,
|
||||||
fqdnName}, callback, asyncState);
|
fqdnName}, callback, asyncState);
|
||||||
|
@ -2064,12 +2079,12 @@ namespace WebsitePanel.EnterpriseServer {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public void GetRdsServerStatusAsync(int itemId, string fqdnName) {
|
public void GetRdsServerStatusAsync(System.Nullable<int> itemId, string fqdnName) {
|
||||||
this.GetRdsServerStatusAsync(itemId, fqdnName, null);
|
this.GetRdsServerStatusAsync(itemId, fqdnName, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public void GetRdsServerStatusAsync(int itemId, string fqdnName, object userState) {
|
public void GetRdsServerStatusAsync(System.Nullable<int> itemId, string fqdnName, object userState) {
|
||||||
if ((this.GetRdsServerStatusOperationCompleted == null)) {
|
if ((this.GetRdsServerStatusOperationCompleted == null)) {
|
||||||
this.GetRdsServerStatusOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRdsServerStatusOperationCompleted);
|
this.GetRdsServerStatusOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRdsServerStatusOperationCompleted);
|
||||||
}
|
}
|
||||||
|
@ -2087,7 +2102,7 @@ namespace WebsitePanel.EnterpriseServer {
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/ShutDownRdsServer", 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/ShutDownRdsServer", 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 ShutDownRdsServer(int itemId, string fqdnName) {
|
public ResultObject ShutDownRdsServer([System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] System.Nullable<int> itemId, string fqdnName) {
|
||||||
object[] results = this.Invoke("ShutDownRdsServer", new object[] {
|
object[] results = this.Invoke("ShutDownRdsServer", new object[] {
|
||||||
itemId,
|
itemId,
|
||||||
fqdnName});
|
fqdnName});
|
||||||
|
@ -2095,7 +2110,7 @@ namespace WebsitePanel.EnterpriseServer {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public System.IAsyncResult BeginShutDownRdsServer(int itemId, string fqdnName, System.AsyncCallback callback, object asyncState) {
|
public System.IAsyncResult BeginShutDownRdsServer(System.Nullable<int> itemId, string fqdnName, System.AsyncCallback callback, object asyncState) {
|
||||||
return this.BeginInvoke("ShutDownRdsServer", new object[] {
|
return this.BeginInvoke("ShutDownRdsServer", new object[] {
|
||||||
itemId,
|
itemId,
|
||||||
fqdnName}, callback, asyncState);
|
fqdnName}, callback, asyncState);
|
||||||
|
@ -2108,12 +2123,12 @@ namespace WebsitePanel.EnterpriseServer {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public void ShutDownRdsServerAsync(int itemId, string fqdnName) {
|
public void ShutDownRdsServerAsync(System.Nullable<int> itemId, string fqdnName) {
|
||||||
this.ShutDownRdsServerAsync(itemId, fqdnName, null);
|
this.ShutDownRdsServerAsync(itemId, fqdnName, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public void ShutDownRdsServerAsync(int itemId, string fqdnName, object userState) {
|
public void ShutDownRdsServerAsync(System.Nullable<int> itemId, string fqdnName, object userState) {
|
||||||
if ((this.ShutDownRdsServerOperationCompleted == null)) {
|
if ((this.ShutDownRdsServerOperationCompleted == null)) {
|
||||||
this.ShutDownRdsServerOperationCompleted = new System.Threading.SendOrPostCallback(this.OnShutDownRdsServerOperationCompleted);
|
this.ShutDownRdsServerOperationCompleted = new System.Threading.SendOrPostCallback(this.OnShutDownRdsServerOperationCompleted);
|
||||||
}
|
}
|
||||||
|
@ -2131,7 +2146,7 @@ namespace WebsitePanel.EnterpriseServer {
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/RestartRdsServer", 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/RestartRdsServer", 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 RestartRdsServer(int itemId, string fqdnName) {
|
public ResultObject RestartRdsServer([System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] System.Nullable<int> itemId, string fqdnName) {
|
||||||
object[] results = this.Invoke("RestartRdsServer", new object[] {
|
object[] results = this.Invoke("RestartRdsServer", new object[] {
|
||||||
itemId,
|
itemId,
|
||||||
fqdnName});
|
fqdnName});
|
||||||
|
@ -2139,7 +2154,7 @@ namespace WebsitePanel.EnterpriseServer {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public System.IAsyncResult BeginRestartRdsServer(int itemId, string fqdnName, System.AsyncCallback callback, object asyncState) {
|
public System.IAsyncResult BeginRestartRdsServer(System.Nullable<int> itemId, string fqdnName, System.AsyncCallback callback, object asyncState) {
|
||||||
return this.BeginInvoke("RestartRdsServer", new object[] {
|
return this.BeginInvoke("RestartRdsServer", new object[] {
|
||||||
itemId,
|
itemId,
|
||||||
fqdnName}, callback, asyncState);
|
fqdnName}, callback, asyncState);
|
||||||
|
@ -2152,12 +2167,12 @@ namespace WebsitePanel.EnterpriseServer {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public void RestartRdsServerAsync(int itemId, string fqdnName) {
|
public void RestartRdsServerAsync(System.Nullable<int> itemId, string fqdnName) {
|
||||||
this.RestartRdsServerAsync(itemId, fqdnName, null);
|
this.RestartRdsServerAsync(itemId, fqdnName, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public void RestartRdsServerAsync(int itemId, string fqdnName, object userState) {
|
public void RestartRdsServerAsync(System.Nullable<int> itemId, string fqdnName, object userState) {
|
||||||
if ((this.RestartRdsServerOperationCompleted == null)) {
|
if ((this.RestartRdsServerOperationCompleted == null)) {
|
||||||
this.RestartRdsServerOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRestartRdsServerOperationCompleted);
|
this.RestartRdsServerOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRestartRdsServerOperationCompleted);
|
||||||
}
|
}
|
||||||
|
@ -2342,14 +2357,14 @@ namespace WebsitePanel.EnterpriseServer {
|
||||||
|
|
||||||
/// <remarks/>
|
/// <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)]
|
[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) {
|
public RdsCertificate GetRdsCertificateByItemId([System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] System.Nullable<int> itemId) {
|
||||||
object[] results = this.Invoke("GetRdsCertificateByItemId", new object[] {
|
object[] results = this.Invoke("GetRdsCertificateByItemId", new object[] {
|
||||||
itemId});
|
itemId});
|
||||||
return ((RdsCertificate)(results[0]));
|
return ((RdsCertificate)(results[0]));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public System.IAsyncResult BeginGetRdsCertificateByItemId(int itemId, System.AsyncCallback callback, object asyncState) {
|
public System.IAsyncResult BeginGetRdsCertificateByItemId(System.Nullable<int> itemId, System.AsyncCallback callback, object asyncState) {
|
||||||
return this.BeginInvoke("GetRdsCertificateByItemId", new object[] {
|
return this.BeginInvoke("GetRdsCertificateByItemId", new object[] {
|
||||||
itemId}, callback, asyncState);
|
itemId}, callback, asyncState);
|
||||||
}
|
}
|
||||||
|
@ -2361,12 +2376,12 @@ namespace WebsitePanel.EnterpriseServer {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public void GetRdsCertificateByItemIdAsync(int itemId) {
|
public void GetRdsCertificateByItemIdAsync(System.Nullable<int> itemId) {
|
||||||
this.GetRdsCertificateByItemIdAsync(itemId, null);
|
this.GetRdsCertificateByItemIdAsync(itemId, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public void GetRdsCertificateByItemIdAsync(int itemId, object userState) {
|
public void GetRdsCertificateByItemIdAsync(System.Nullable<int> itemId, object userState) {
|
||||||
if ((this.GetRdsCertificateByItemIdOperationCompleted == null)) {
|
if ((this.GetRdsCertificateByItemIdOperationCompleted == null)) {
|
||||||
this.GetRdsCertificateByItemIdOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRdsCertificateByItemIdOperationCompleted);
|
this.GetRdsCertificateByItemIdOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRdsCertificateByItemIdOperationCompleted);
|
||||||
}
|
}
|
||||||
|
@ -2422,6 +2437,138 @@ namespace WebsitePanel.EnterpriseServer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetRdsServices", 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 ServiceInfo[] GetRdsServices() {
|
||||||
|
object[] results = this.Invoke("GetRdsServices", new object[0]);
|
||||||
|
return ((ServiceInfo[])(results[0]));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public System.IAsyncResult BeginGetRdsServices(System.AsyncCallback callback, object asyncState) {
|
||||||
|
return this.BeginInvoke("GetRdsServices", new object[0], callback, asyncState);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public ServiceInfo[] EndGetRdsServices(System.IAsyncResult asyncResult) {
|
||||||
|
object[] results = this.EndInvoke(asyncResult);
|
||||||
|
return ((ServiceInfo[])(results[0]));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public void GetRdsServicesAsync() {
|
||||||
|
this.GetRdsServicesAsync(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public void GetRdsServicesAsync(object userState) {
|
||||||
|
if ((this.GetRdsServicesOperationCompleted == null)) {
|
||||||
|
this.GetRdsServicesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRdsServicesOperationCompleted);
|
||||||
|
}
|
||||||
|
this.InvokeAsync("GetRdsServices", new object[0], this.GetRdsServicesOperationCompleted, userState);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnGetRdsServicesOperationCompleted(object arg) {
|
||||||
|
if ((this.GetRdsServicesCompleted != null)) {
|
||||||
|
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
|
||||||
|
this.GetRdsServicesCompleted(this, new GetRdsServicesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetRdsSetupLetter", 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 string GetRdsSetupLetter(int itemId, [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] System.Nullable<int> accountId) {
|
||||||
|
object[] results = this.Invoke("GetRdsSetupLetter", new object[] {
|
||||||
|
itemId,
|
||||||
|
accountId});
|
||||||
|
return ((string)(results[0]));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public System.IAsyncResult BeginGetRdsSetupLetter(int itemId, System.Nullable<int> accountId, System.AsyncCallback callback, object asyncState) {
|
||||||
|
return this.BeginInvoke("GetRdsSetupLetter", new object[] {
|
||||||
|
itemId,
|
||||||
|
accountId}, callback, asyncState);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public string EndGetRdsSetupLetter(System.IAsyncResult asyncResult) {
|
||||||
|
object[] results = this.EndInvoke(asyncResult);
|
||||||
|
return ((string)(results[0]));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public void GetRdsSetupLetterAsync(int itemId, System.Nullable<int> accountId) {
|
||||||
|
this.GetRdsSetupLetterAsync(itemId, accountId, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public void GetRdsSetupLetterAsync(int itemId, System.Nullable<int> accountId, object userState) {
|
||||||
|
if ((this.GetRdsSetupLetterOperationCompleted == null)) {
|
||||||
|
this.GetRdsSetupLetterOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRdsSetupLetterOperationCompleted);
|
||||||
|
}
|
||||||
|
this.InvokeAsync("GetRdsSetupLetter", new object[] {
|
||||||
|
itemId,
|
||||||
|
accountId}, this.GetRdsSetupLetterOperationCompleted, userState);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnGetRdsSetupLetterOperationCompleted(object arg) {
|
||||||
|
if ((this.GetRdsSetupLetterCompleted != null)) {
|
||||||
|
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
|
||||||
|
this.GetRdsSetupLetterCompleted(this, new GetRdsSetupLetterCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SendRdsSetupLetter", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
||||||
|
public int SendRdsSetupLetter(int itemId, [System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] System.Nullable<int> accountId, string to, string cc) {
|
||||||
|
object[] results = this.Invoke("SendRdsSetupLetter", new object[] {
|
||||||
|
itemId,
|
||||||
|
accountId,
|
||||||
|
to,
|
||||||
|
cc});
|
||||||
|
return ((int)(results[0]));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public System.IAsyncResult BeginSendRdsSetupLetter(int itemId, System.Nullable<int> accountId, string to, string cc, System.AsyncCallback callback, object asyncState) {
|
||||||
|
return this.BeginInvoke("SendRdsSetupLetter", new object[] {
|
||||||
|
itemId,
|
||||||
|
accountId,
|
||||||
|
to,
|
||||||
|
cc}, callback, asyncState);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public int EndSendRdsSetupLetter(System.IAsyncResult asyncResult) {
|
||||||
|
object[] results = this.EndInvoke(asyncResult);
|
||||||
|
return ((int)(results[0]));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public void SendRdsSetupLetterAsync(int itemId, System.Nullable<int> accountId, string to, string cc) {
|
||||||
|
this.SendRdsSetupLetterAsync(itemId, accountId, to, cc, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public void SendRdsSetupLetterAsync(int itemId, System.Nullable<int> accountId, string to, string cc, object userState) {
|
||||||
|
if ((this.SendRdsSetupLetterOperationCompleted == null)) {
|
||||||
|
this.SendRdsSetupLetterOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSendRdsSetupLetterOperationCompleted);
|
||||||
|
}
|
||||||
|
this.InvokeAsync("SendRdsSetupLetter", new object[] {
|
||||||
|
itemId,
|
||||||
|
accountId,
|
||||||
|
to,
|
||||||
|
cc}, this.SendRdsSetupLetterOperationCompleted, userState);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnSendRdsSetupLetterOperationCompleted(object arg) {
|
||||||
|
if ((this.SendRdsSetupLetterCompleted != null)) {
|
||||||
|
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
|
||||||
|
this.SendRdsSetupLetterCompleted(this, new SendRdsSetupLetterCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public new void CancelAsync(object userState) {
|
public new void CancelAsync(object userState) {
|
||||||
base.CancelAsync(userState);
|
base.CancelAsync(userState);
|
||||||
|
@ -3675,4 +3822,82 @@ namespace WebsitePanel.EnterpriseServer {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||||
|
public delegate void GetRdsServicesCompletedEventHandler(object sender, GetRdsServicesCompletedEventArgs e);
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||||
|
[System.Diagnostics.DebuggerStepThroughAttribute()]
|
||||||
|
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||||
|
public partial class GetRdsServicesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
|
||||||
|
|
||||||
|
private object[] results;
|
||||||
|
|
||||||
|
internal GetRdsServicesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
|
||||||
|
base(exception, cancelled, userState) {
|
||||||
|
this.results = results;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public ServiceInfo[] Result {
|
||||||
|
get {
|
||||||
|
this.RaiseExceptionIfNecessary();
|
||||||
|
return ((ServiceInfo[])(this.results[0]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||||
|
public delegate void GetRdsSetupLetterCompletedEventHandler(object sender, GetRdsSetupLetterCompletedEventArgs e);
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||||
|
[System.Diagnostics.DebuggerStepThroughAttribute()]
|
||||||
|
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||||
|
public partial class GetRdsSetupLetterCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
|
||||||
|
|
||||||
|
private object[] results;
|
||||||
|
|
||||||
|
internal GetRdsSetupLetterCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
|
||||||
|
base(exception, cancelled, userState) {
|
||||||
|
this.results = results;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public string Result {
|
||||||
|
get {
|
||||||
|
this.RaiseExceptionIfNecessary();
|
||||||
|
return ((string)(this.results[0]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||||
|
public delegate void SendRdsSetupLetterCompletedEventHandler(object sender, SendRdsSetupLetterCompletedEventArgs e);
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||||
|
[System.Diagnostics.DebuggerStepThroughAttribute()]
|
||||||
|
[System.ComponentModel.DesignerCategoryAttribute("code")]
|
||||||
|
public partial class SendRdsSetupLetterCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
|
||||||
|
|
||||||
|
private object[] results;
|
||||||
|
|
||||||
|
internal SendRdsSetupLetterCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
|
||||||
|
base(exception, cancelled, userState) {
|
||||||
|
this.results = results;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public int Result {
|
||||||
|
get {
|
||||||
|
this.RaiseExceptionIfNecessary();
|
||||||
|
return ((int)(this.results[0]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -963,7 +963,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
|
|
||||||
PackageContext cntxTmp = PackageController.GetPackageContext(org.PackageId);
|
PackageContext cntxTmp = PackageController.GetPackageContext(org.PackageId);
|
||||||
|
|
||||||
if (cntxTmp.Groups.ContainsKey(ResourceGroups.HostedSharePoint))
|
if (cntxTmp.Groups.ContainsKey(ResourceGroups.SharepointFoundationServer))
|
||||||
{
|
{
|
||||||
SharePointSiteCollectionListPaged sharePointStats = HostedSharePointServerController.GetSiteCollectionsPaged(org.PackageId, org.Id, string.Empty, string.Empty, string.Empty, 0, 0);
|
SharePointSiteCollectionListPaged sharePointStats = HostedSharePointServerController.GetSiteCollectionsPaged(org.PackageId, org.Id, string.Empty, string.Empty, string.Empty, 0, 0);
|
||||||
stats.CreatedSharePointSiteCollections = sharePointStats.TotalRowCount;
|
stats.CreatedSharePointSiteCollections = sharePointStats.TotalRowCount;
|
||||||
|
@ -1044,7 +1044,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
|
|
||||||
PackageContext cntxTmp = PackageController.GetPackageContext(org.PackageId);
|
PackageContext cntxTmp = PackageController.GetPackageContext(org.PackageId);
|
||||||
|
|
||||||
if (cntxTmp.Groups.ContainsKey(ResourceGroups.HostedSharePoint))
|
if (cntxTmp.Groups.ContainsKey(ResourceGroups.SharepointFoundationServer))
|
||||||
{
|
{
|
||||||
SharePointSiteCollectionListPaged sharePointStats = HostedSharePointServerController.GetSiteCollectionsPaged(org.PackageId, o.Id, string.Empty, string.Empty, string.Empty, 0, 0);
|
SharePointSiteCollectionListPaged sharePointStats = HostedSharePointServerController.GetSiteCollectionsPaged(org.PackageId, o.Id, string.Empty, string.Empty, string.Empty, 0, 0);
|
||||||
stats.CreatedSharePointSiteCollections += sharePointStats.TotalRowCount;
|
stats.CreatedSharePointSiteCollections += sharePointStats.TotalRowCount;
|
||||||
|
@ -1112,7 +1112,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
stats.AllocatedDomains = cntx.Quotas[Quotas.ORGANIZATION_DOMAINS].QuotaAllocatedValue;
|
stats.AllocatedDomains = cntx.Quotas[Quotas.ORGANIZATION_DOMAINS].QuotaAllocatedValue;
|
||||||
stats.AllocatedGroups = cntx.Quotas[Quotas.ORGANIZATION_SECURITYGROUPS].QuotaAllocatedValue;
|
stats.AllocatedGroups = cntx.Quotas[Quotas.ORGANIZATION_SECURITYGROUPS].QuotaAllocatedValue;
|
||||||
|
|
||||||
if (cntx.Groups.ContainsKey(ResourceGroups.HostedSharePoint))
|
if (cntx.Groups.ContainsKey(ResourceGroups.SharepointFoundationServer))
|
||||||
{
|
{
|
||||||
stats.AllocatedSharePointSiteCollections = cntx.Quotas[Quotas.HOSTED_SHAREPOINT_SITES].QuotaAllocatedValue;
|
stats.AllocatedSharePointSiteCollections = cntx.Quotas[Quotas.HOSTED_SHAREPOINT_SITES].QuotaAllocatedValue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -155,7 +155,7 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution
|
||||||
|
|
||||||
private static int GetHostedSharePointServiceId(int packageId)
|
private static int GetHostedSharePointServiceId(int packageId)
|
||||||
{
|
{
|
||||||
return PackageController.GetPackageServiceId(packageId, ResourceGroups.HostedSharePoint);
|
return PackageController.GetPackageServiceId(packageId, ResourceGroups.SharepointFoundationServer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,8 @@ using WebsitePanel.Providers.HostedSolution;
|
||||||
using WebsitePanel.Providers.OS;
|
using WebsitePanel.Providers.OS;
|
||||||
using WebsitePanel.Providers.RemoteDesktopServices;
|
using WebsitePanel.Providers.RemoteDesktopServices;
|
||||||
using WebsitePanel.Providers.Web;
|
using WebsitePanel.Providers.Web;
|
||||||
|
using System.Net.Mail;
|
||||||
|
using System.Collections;
|
||||||
|
|
||||||
namespace WebsitePanel.EnterpriseServer
|
namespace WebsitePanel.EnterpriseServer
|
||||||
{
|
{
|
||||||
|
@ -248,22 +250,22 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
return GetRdsCollectionSessionHostsInternal(collectionId);
|
return GetRdsCollectionSessionHostsInternal(collectionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static RdsServerInfo GetRdsServerInfo(int itemId, string fqdnName)
|
public static RdsServerInfo GetRdsServerInfo(int? itemId, string fqdnName)
|
||||||
{
|
{
|
||||||
return GetRdsServerInfoInternal(itemId, fqdnName);
|
return GetRdsServerInfoInternal(itemId, fqdnName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetRdsServerStatus(int itemId, string fqdnName)
|
public static string GetRdsServerStatus(int? itemId, string fqdnName)
|
||||||
{
|
{
|
||||||
return GetRdsServerStatusInternal(itemId, fqdnName);
|
return GetRdsServerStatusInternal(itemId, fqdnName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ResultObject ShutDownRdsServer(int itemId, string fqdnName)
|
public static ResultObject ShutDownRdsServer(int? itemId, string fqdnName)
|
||||||
{
|
{
|
||||||
return ShutDownRdsServerInternal(itemId, fqdnName);
|
return ShutDownRdsServerInternal(itemId, fqdnName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ResultObject RestartRdsServer(int itemId, string fqdnName)
|
public static ResultObject RestartRdsServer(int? itemId, string fqdnName)
|
||||||
{
|
{
|
||||||
return RestartRdsServerInternal(itemId, fqdnName);
|
return RestartRdsServerInternal(itemId, fqdnName);
|
||||||
}
|
}
|
||||||
|
@ -288,7 +290,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
return GetRdsCertificateByServiceIdInternal(serviceId);
|
return GetRdsCertificateByServiceIdInternal(serviceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static RdsCertificate GetRdsCertificateByItemId(int itemId)
|
public static RdsCertificate GetRdsCertificateByItemId(int? itemId)
|
||||||
{
|
{
|
||||||
return GetRdsCertificateByItemIdInternal(itemId);
|
return GetRdsCertificateByItemIdInternal(itemId);
|
||||||
}
|
}
|
||||||
|
@ -298,22 +300,108 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
return AddRdsCertificateInternal(certificate);
|
return AddRdsCertificateInternal(certificate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static List<ServiceInfo> GetRdsServices()
|
||||||
|
{
|
||||||
|
return GetRdsServicesInternal();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static List<ServiceInfo> GetRdsServicesInternal()
|
||||||
|
{
|
||||||
|
return ObjectUtils.CreateListFromDataSet<ServiceInfo>(DataProvider.GetServicesByGroupName(SecurityContext.User.UserId, ResourceGroups.RDS));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string GetRdsSetupLetter(int itemId, int? accountId)
|
||||||
|
{
|
||||||
|
return GetRdsSetupLetterInternal(itemId, accountId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int SendRdsSetupLetter(int itemId, int? accountId, string to, string cc)
|
||||||
|
{
|
||||||
|
return SendRdsSetupLetterInternal(itemId, accountId, to, cc);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string GetRdsSetupLetterInternal(int itemId, int? accountId)
|
||||||
|
{
|
||||||
|
Organization org = OrganizationController.GetOrganization(itemId);
|
||||||
|
|
||||||
|
if (org == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
UserInfo user = PackageController.GetPackageOwner(org.PackageId);
|
||||||
|
UserSettings settings = UserController.GetUserSettings(user.UserId, UserSettings.RDS_SETUP_LETTER);
|
||||||
|
string settingName = user.HtmlMail ? "HtmlBody" : "TextBody";
|
||||||
|
string body = settings[settingName];
|
||||||
|
|
||||||
|
if (String.IsNullOrEmpty(body))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
string result = EvaluateMailboxTemplate(body, org, accountId, itemId);
|
||||||
|
|
||||||
|
return user.HtmlMail ? result : result.Replace("\n", "<br/>");
|
||||||
|
}
|
||||||
|
|
||||||
|
private static int SendRdsSetupLetterInternal(int itemId, int? accountId, string to, string cc)
|
||||||
|
{
|
||||||
|
int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo);
|
||||||
|
|
||||||
|
if (accountCheck < 0)
|
||||||
|
{
|
||||||
|
return accountCheck;
|
||||||
|
}
|
||||||
|
|
||||||
|
Organization org = OrganizationController.GetOrganization(itemId);
|
||||||
|
|
||||||
|
if (org == null)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
UserInfo user = PackageController.GetPackageOwner(org.PackageId);
|
||||||
|
UserSettings settings = UserController.GetUserSettings(user.UserId, UserSettings.RDS_SETUP_LETTER);
|
||||||
|
string from = settings["From"];
|
||||||
|
|
||||||
|
if (cc == null)
|
||||||
|
{
|
||||||
|
cc = settings["CC"];
|
||||||
|
}
|
||||||
|
|
||||||
|
string subject = settings["Subject"];
|
||||||
|
string body = user.HtmlMail ? settings["HtmlBody"] : settings["TextBody"];
|
||||||
|
bool isHtml = user.HtmlMail;
|
||||||
|
MailPriority priority = MailPriority.Normal;
|
||||||
|
|
||||||
|
if (!String.IsNullOrEmpty(settings["Priority"]))
|
||||||
|
{
|
||||||
|
priority = (MailPriority)Enum.Parse(typeof(MailPriority), settings["Priority"], true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (String.IsNullOrEmpty(body))
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (to == null)
|
||||||
|
{
|
||||||
|
to = user.Email;
|
||||||
|
}
|
||||||
|
|
||||||
|
subject = EvaluateMailboxTemplate(subject, org, accountId, itemId);
|
||||||
|
body = EvaluateMailboxTemplate(body, org, accountId, itemId);
|
||||||
|
|
||||||
|
return MailHelper.SendMessage(from, to, cc, subject, body, priority, isHtml);
|
||||||
|
}
|
||||||
|
|
||||||
private static ResultObject InstallSessionHostsCertificateInternal(RdsServer rdsServer)
|
private static ResultObject InstallSessionHostsCertificateInternal(RdsServer rdsServer)
|
||||||
{
|
{
|
||||||
var result = TaskManager.StartResultTask<ResultObject>("REMOTE_DESKTOP_SERVICES", "INSTALL_CERTIFICATE");
|
var result = TaskManager.StartResultTask<ResultObject>("REMOTE_DESKTOP_SERVICES", "INSTALL_CERTIFICATE");
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Organization org = OrganizationController.GetOrganization(rdsServer.ItemId.Value);
|
int serviceId = GetRdsServiceId(rdsServer.ItemId);
|
||||||
|
|
||||||
if (org == null)
|
|
||||||
{
|
|
||||||
result.IsSuccess = false;
|
|
||||||
result.AddError("", new NullReferenceException("Organization not found"));
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
int serviceId = GetRemoteDesktopServiceID(org.PackageId);
|
|
||||||
var rds = GetRemoteDesktopServices(serviceId);
|
var rds = GetRemoteDesktopServices(serviceId);
|
||||||
var certificate = GetRdsCertificateByServiceIdInternal(serviceId);
|
var certificate = GetRdsCertificateByServiceIdInternal(serviceId);
|
||||||
|
|
||||||
|
@ -351,16 +439,9 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static RdsCertificate GetRdsCertificateByItemIdInternal(int itemId)
|
private static RdsCertificate GetRdsCertificateByItemIdInternal(int? itemId)
|
||||||
{
|
{
|
||||||
Organization org = OrganizationController.GetOrganization(itemId);
|
int serviceId = GetRdsServiceId(itemId);
|
||||||
|
|
||||||
if (org == null)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
int serviceId = GetRemoteDesktopServiceID(org.PackageId);
|
|
||||||
var result = ObjectUtils.FillObjectFromDataReader<RdsCertificate>(DataProvider.GetRdsCertificateByServiceId(serviceId));
|
var result = ObjectUtils.FillObjectFromDataReader<RdsCertificate>(DataProvider.GetRdsCertificateByServiceId(serviceId));
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
@ -539,20 +620,6 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
|
|
||||||
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
|
|
||||||
Organization org = OrganizationController.GetOrganization(itemId);
|
Organization org = OrganizationController.GetOrganization(itemId);
|
||||||
if (org == null)
|
if (org == null)
|
||||||
{
|
{
|
||||||
|
@ -560,6 +627,20 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
}
|
}
|
||||||
|
|
||||||
var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
|
var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
|
||||||
|
|
||||||
|
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 (!rds.CheckRDSServerAvaliable(server.FqdName))
|
||||||
|
{
|
||||||
|
throw TaskManager.WriteError(new Exception(string.Format("Unable to connect to {0} server.", server.FqdName)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
collection.Name = GetFormattedCollectionName(collection.DisplayName, org.OrganizationId);
|
collection.Name = GetFormattedCollectionName(collection.DisplayName, org.OrganizationId);
|
||||||
|
|
||||||
collection.Settings = new RdsCollectionSettings
|
collection.Settings = new RdsCollectionSettings
|
||||||
|
@ -1031,12 +1112,17 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (CheckRDSServerAvaliable(rdsServer.FqdName))
|
int serviceId = GetRdsMainServiceId();
|
||||||
|
var rds = GetRemoteDesktopServices(serviceId);
|
||||||
|
|
||||||
|
if (rds.CheckRDSServerAvaliable(rdsServer.FqdName))
|
||||||
{
|
{
|
||||||
var domainName = IPGlobalProperties.GetIPGlobalProperties().DomainName;
|
var domainName = IPGlobalProperties.GetIPGlobalProperties().DomainName;
|
||||||
|
|
||||||
if (rdsServer.FqdName.EndsWith(domainName, StringComparison.CurrentCultureIgnoreCase))
|
if (rdsServer.FqdName.EndsWith(domainName, StringComparison.CurrentCultureIgnoreCase))
|
||||||
{
|
{
|
||||||
|
rds.AddSessionHostFeatureToServer(rdsServer.FqdName);
|
||||||
|
rds.MoveSessionHostToRdsOU(rdsServer.Name);
|
||||||
rdsServer.Id = DataProvider.AddRDSServer(rdsServer.Name, rdsServer.FqdName, rdsServer.Description);
|
rdsServer.Id = DataProvider.AddRDSServer(rdsServer.Name, rdsServer.FqdName, rdsServer.Description);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1194,12 +1280,6 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
|
var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
|
||||||
|
|
||||||
RdsServer rdsServer = GetRdsServer(serverId);
|
RdsServer rdsServer = GetRdsServer(serverId);
|
||||||
|
|
||||||
//if (!rds.CheckSessionHostFeatureInstallation(rdsServer.FqdName))
|
|
||||||
{
|
|
||||||
rds.AddSessionHostFeatureToServer(rdsServer.FqdName);
|
|
||||||
}
|
|
||||||
|
|
||||||
rds.MoveRdsServerToTenantOU(rdsServer.FqdName, org.OrganizationId);
|
rds.MoveRdsServerToTenantOU(rdsServer.FqdName, org.OrganizationId);
|
||||||
DataProvider.AddRDSServerToOrganization(itemId, serverId);
|
DataProvider.AddRDSServerToOrganization(itemId, serverId);
|
||||||
}
|
}
|
||||||
|
@ -1508,37 +1588,33 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static RdsServerInfo GetRdsServerInfoInternal(int itemId, string fqdnName)
|
private static RdsServerInfo GetRdsServerInfoInternal(int? itemId, string fqdnName)
|
||||||
{
|
{
|
||||||
Organization org = OrganizationController.GetOrganization(itemId);
|
int serviceId = GetRdsServiceId(itemId);
|
||||||
|
var result = new RdsServerInfo();
|
||||||
|
|
||||||
if (org == null)
|
if (serviceId != -1)
|
||||||
{
|
{
|
||||||
return new RdsServerInfo();
|
var rds = GetRemoteDesktopServices(serviceId);
|
||||||
|
result = rds.GetRdsServerInfo(fqdnName);
|
||||||
}
|
}
|
||||||
|
|
||||||
var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
|
|
||||||
var result = rds.GetRdsServerInfo(fqdnName);
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string GetRdsServerStatusInternal(int itemId, string fqdnName)
|
private static string GetRdsServerStatusInternal(int? itemId, string fqdnName)
|
||||||
{
|
{
|
||||||
Organization org = OrganizationController.GetOrganization(itemId);
|
|
||||||
var result = "Unavailable";
|
var result = "Unavailable";
|
||||||
|
var serviceId = GetRdsServiceId(itemId);
|
||||||
if (org == null)
|
|
||||||
{
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
if (serviceId != -1)
|
||||||
|
{
|
||||||
|
var rds = GetRemoteDesktopServices(serviceId);
|
||||||
result = rds.GetRdsServerStatus(fqdnName);
|
result = rds.GetRdsServerStatus(fqdnName);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -1546,24 +1622,20 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ResultObject ShutDownRdsServerInternal(int itemId, string fqdnName)
|
private static ResultObject ShutDownRdsServerInternal(int? itemId, string fqdnName)
|
||||||
{
|
{
|
||||||
var result = TaskManager.StartResultTask<ResultObject>("REMOTE_DESKTOP_SERVICES", "SHUTDOWN_RDS_SERVER");
|
var result = TaskManager.StartResultTask<ResultObject>("REMOTE_DESKTOP_SERVICES", "SHUTDOWN_RDS_SERVER");
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Organization org = OrganizationController.GetOrganization(itemId);
|
int serviceId = GetRdsServiceId(itemId);
|
||||||
|
|
||||||
if (org == null)
|
if (serviceId != -1)
|
||||||
{
|
{
|
||||||
result.IsSuccess = false;
|
var rds = GetRemoteDesktopServices(serviceId);
|
||||||
result.AddError("", new NullReferenceException("Organization not found"));
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
|
|
||||||
rds.ShutDownRdsServer(fqdnName);
|
rds.ShutDownRdsServer(fqdnName);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
result.AddError("REMOTE_DESKTOP_SERVICES_SHUTDOWN_RDS_SERVER", ex);
|
result.AddError("REMOTE_DESKTOP_SERVICES_SHUTDOWN_RDS_SERVER", ex);
|
||||||
|
@ -1583,24 +1655,20 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static ResultObject RestartRdsServerInternal(int itemId, string fqdnName)
|
private static ResultObject RestartRdsServerInternal(int? itemId, string fqdnName)
|
||||||
{
|
{
|
||||||
var result = TaskManager.StartResultTask<ResultObject>("REMOTE_DESKTOP_SERVICES", "RESTART_RDS_SERVER");
|
var result = TaskManager.StartResultTask<ResultObject>("REMOTE_DESKTOP_SERVICES", "RESTART_RDS_SERVER");
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Organization org = OrganizationController.GetOrganization(itemId);
|
int serviceId = GetRdsServiceId(itemId);
|
||||||
|
|
||||||
if (org == null)
|
if (serviceId != -1)
|
||||||
{
|
{
|
||||||
result.IsSuccess = false;
|
var rds = GetRemoteDesktopServices(serviceId);
|
||||||
result.AddError("", new NullReferenceException("Organization not found"));
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
|
|
||||||
rds.RestartRdsServer(fqdnName);
|
rds.RestartRdsServer(fqdnName);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
result.AddError("REMOTE_DESKTOP_SERVICES_RESTART_RDS_SERVER", ex);
|
result.AddError("REMOTE_DESKTOP_SERVICES_RESTART_RDS_SERVER", ex);
|
||||||
|
@ -1763,20 +1831,6 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
return address;
|
return address;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool CheckRDSServerAvaliable(string hostname)
|
|
||||||
{
|
|
||||||
bool result = false;
|
|
||||||
var ping = new Ping();
|
|
||||||
var reply = ping.Send(hostname, 1000);
|
|
||||||
|
|
||||||
if (reply.Status == IPStatus.Success)
|
|
||||||
{
|
|
||||||
result = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
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");
|
||||||
|
@ -1821,6 +1875,29 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
return PackageController.GetPackageServiceId(packageId, ResourceGroups.RDS);
|
return PackageController.GetPackageServiceId(packageId, ResourceGroups.RDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static int GetRdsServiceId(int? itemId)
|
||||||
|
{
|
||||||
|
int serviceId = -1;
|
||||||
|
|
||||||
|
if (itemId.HasValue)
|
||||||
|
{
|
||||||
|
Organization org = OrganizationController.GetOrganization(itemId.Value);
|
||||||
|
|
||||||
|
if (org == null)
|
||||||
|
{
|
||||||
|
return serviceId;
|
||||||
|
}
|
||||||
|
|
||||||
|
serviceId = GetRemoteDesktopServiceID(org.PackageId);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
serviceId = GetRdsMainServiceId();
|
||||||
|
}
|
||||||
|
|
||||||
|
return serviceId;
|
||||||
|
}
|
||||||
|
|
||||||
private static RemoteDesktopServices GetRemoteDesktopServices(int serviceId)
|
private static RemoteDesktopServices GetRemoteDesktopServices(int serviceId)
|
||||||
{
|
{
|
||||||
var rds = new RemoteDesktopServices();
|
var rds = new RemoteDesktopServices();
|
||||||
|
@ -1829,9 +1906,48 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
return rds;
|
return rds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static int GetRdsMainServiceId()
|
||||||
|
{
|
||||||
|
var settings = SystemController.GetSystemSettings(WebsitePanel.EnterpriseServer.SystemSettings.RDS_SETTINGS);
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(settings["RdsMainController"]))
|
||||||
|
{
|
||||||
|
return Convert.ToInt32(settings["RdsMainController"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
var rdsServices = GetRdsServicesInternal();
|
||||||
|
|
||||||
|
if (rdsServices.Any())
|
||||||
|
{
|
||||||
|
return rdsServices.First().ServiceId;
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
private static string GetFormattedCollectionName(string displayName, string organizationId)
|
private static string GetFormattedCollectionName(string displayName, string organizationId)
|
||||||
{
|
{
|
||||||
return string.Format("{0}-{1}", organizationId, displayName.Replace(" ", "_"));
|
return string.Format("{0}-{1}", organizationId, displayName.Replace(" ", "_"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static string EvaluateMailboxTemplate(string template, Organization org, int? accountId, int itemId)
|
||||||
|
{
|
||||||
|
OrganizationUser user = null;
|
||||||
|
|
||||||
|
if (accountId.HasValue)
|
||||||
|
{
|
||||||
|
user = OrganizationController.GetAccount(itemId, accountId.Value);
|
||||||
|
}
|
||||||
|
|
||||||
|
Hashtable items = new Hashtable();
|
||||||
|
items["Organization"] = org;
|
||||||
|
|
||||||
|
if (user != null)
|
||||||
|
{
|
||||||
|
items["account"] = user;
|
||||||
|
}
|
||||||
|
|
||||||
|
return PackageController.EvaluateTemplate(template, items);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -167,7 +167,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
|
|
||||||
PackageContext cntx = PackageController.GetPackageContext(org.PackageId);
|
PackageContext cntx = PackageController.GetPackageContext(org.PackageId);
|
||||||
|
|
||||||
if (cntx.Groups.ContainsKey(ResourceGroups.HostedSharePoint))
|
if (cntx.Groups.ContainsKey(ResourceGroups.SharepointFoundationServer))
|
||||||
{
|
{
|
||||||
SharePointSiteDiskSpace[] sharePointSiteDiskSpaces =
|
SharePointSiteDiskSpace[] sharePointSiteDiskSpaces =
|
||||||
HostedSharePointServerController.CalculateSharePointSitesDiskSpace(org.Id, out res);
|
HostedSharePointServerController.CalculateSharePointSitesDiskSpace(org.Id, out res);
|
||||||
|
|
|
@ -122,7 +122,7 @@ namespace WebsitePanel.EnterpriseServer.Code.SharePoint
|
||||||
// Log operation.
|
// Log operation.
|
||||||
TaskManager.StartTask("HOSTEDSHAREPOINT", "GET_LANGUAGES");
|
TaskManager.StartTask("HOSTEDSHAREPOINT", "GET_LANGUAGES");
|
||||||
|
|
||||||
int serviceId = PackageController.GetPackageServiceId(packageId, ResourceGroups.HostedSharePoint);
|
int serviceId = PackageController.GetPackageServiceId(packageId, ResourceGroups.SharepointFoundationServer);
|
||||||
if (serviceId == 0)
|
if (serviceId == 0)
|
||||||
{
|
{
|
||||||
return new int[] { };
|
return new int[] { };
|
||||||
|
@ -236,7 +236,7 @@ namespace WebsitePanel.EnterpriseServer.Code.SharePoint
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if stats resource is available
|
// Check if stats resource is available
|
||||||
int serviceId = PackageController.GetPackageServiceId(item.PackageId, ResourceGroups.HostedSharePoint);
|
int serviceId = PackageController.GetPackageServiceId(item.PackageId, ResourceGroups.SharepointFoundationServer);
|
||||||
if (serviceId == 0)
|
if (serviceId == 0)
|
||||||
{
|
{
|
||||||
return BusinessErrorCodes.ERROR_SHAREPOINT_RESOURCE_UNAVAILABLE;
|
return BusinessErrorCodes.ERROR_SHAREPOINT_RESOURCE_UNAVAILABLE;
|
||||||
|
@ -790,7 +790,7 @@ namespace WebsitePanel.EnterpriseServer.Code.SharePoint
|
||||||
|
|
||||||
private static int GetHostedSharePointServiceId(int packageId)
|
private static int GetHostedSharePointServiceId(int packageId)
|
||||||
{
|
{
|
||||||
return PackageController.GetPackageServiceId(packageId, ResourceGroups.HostedSharePoint);
|
return PackageController.GetPackageServiceId(packageId, ResourceGroups.SharepointFoundationServer);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static List<SharePointSiteCollection> GetOrganizationSharePointSiteCollections(int orgId)
|
private static List<SharePointSiteCollection> GetOrganizationSharePointSiteCollections(int orgId)
|
||||||
|
|
|
@ -291,25 +291,25 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
}
|
}
|
||||||
|
|
||||||
[WebMethod]
|
[WebMethod]
|
||||||
public RdsServerInfo GetRdsServerInfo(int itemId, string fqdnName)
|
public RdsServerInfo GetRdsServerInfo(int? itemId, string fqdnName)
|
||||||
{
|
{
|
||||||
return RemoteDesktopServicesController.GetRdsServerInfo(itemId, fqdnName);
|
return RemoteDesktopServicesController.GetRdsServerInfo(itemId, fqdnName);
|
||||||
}
|
}
|
||||||
|
|
||||||
[WebMethod]
|
[WebMethod]
|
||||||
public string GetRdsServerStatus(int itemId, string fqdnName)
|
public string GetRdsServerStatus(int? itemId, string fqdnName)
|
||||||
{
|
{
|
||||||
return RemoteDesktopServicesController.GetRdsServerStatus(itemId, fqdnName);
|
return RemoteDesktopServicesController.GetRdsServerStatus(itemId, fqdnName);
|
||||||
}
|
}
|
||||||
|
|
||||||
[WebMethod]
|
[WebMethod]
|
||||||
public ResultObject ShutDownRdsServer(int itemId, string fqdnName)
|
public ResultObject ShutDownRdsServer(int? itemId, string fqdnName)
|
||||||
{
|
{
|
||||||
return RemoteDesktopServicesController.ShutDownRdsServer(itemId, fqdnName);
|
return RemoteDesktopServicesController.ShutDownRdsServer(itemId, fqdnName);
|
||||||
}
|
}
|
||||||
|
|
||||||
[WebMethod]
|
[WebMethod]
|
||||||
public ResultObject RestartRdsServer(int itemId, string fqdnName)
|
public ResultObject RestartRdsServer(int? itemId, string fqdnName)
|
||||||
{
|
{
|
||||||
return RemoteDesktopServicesController.RestartRdsServer(itemId, fqdnName);
|
return RemoteDesktopServicesController.RestartRdsServer(itemId, fqdnName);
|
||||||
}
|
}
|
||||||
|
@ -339,7 +339,7 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
}
|
}
|
||||||
|
|
||||||
[WebMethod]
|
[WebMethod]
|
||||||
public RdsCertificate GetRdsCertificateByItemId(int itemId)
|
public RdsCertificate GetRdsCertificateByItemId(int? itemId)
|
||||||
{
|
{
|
||||||
return RemoteDesktopServicesController.GetRdsCertificateByItemId(itemId);
|
return RemoteDesktopServicesController.GetRdsCertificateByItemId(itemId);
|
||||||
}
|
}
|
||||||
|
@ -349,5 +349,23 @@ namespace WebsitePanel.EnterpriseServer
|
||||||
{
|
{
|
||||||
return RemoteDesktopServicesController.AddRdsCertificate(certificate);
|
return RemoteDesktopServicesController.AddRdsCertificate(certificate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[WebMethod]
|
||||||
|
public List<ServiceInfo> GetRdsServices()
|
||||||
|
{
|
||||||
|
return RemoteDesktopServicesController.GetRdsServices();
|
||||||
|
}
|
||||||
|
|
||||||
|
[WebMethod]
|
||||||
|
public string GetRdsSetupLetter(int itemId, int? accountId)
|
||||||
|
{
|
||||||
|
return RemoteDesktopServicesController.GetRdsSetupLetter(itemId, accountId);
|
||||||
|
}
|
||||||
|
|
||||||
|
[WebMethod]
|
||||||
|
public int SendRdsSetupLetter(int itemId, int? accountId, string to, string cc)
|
||||||
|
{
|
||||||
|
return RemoteDesktopServicesController.SendRdsSetupLetter(itemId, accountId, to, cc);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,5 +79,6 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
void MoveRdsServerToTenantOU(string hostName, string organizationId);
|
void MoveRdsServerToTenantOU(string hostName, string organizationId);
|
||||||
void RemoveRdsServerFromTenantOU(string hostName, string organizationId);
|
void RemoveRdsServerFromTenantOU(string hostName, string organizationId);
|
||||||
void InstallCertificate(byte[] certificate, string password, List<string> hostNames);
|
void InstallCertificate(byte[] certificate, string password, List<string> hostNames);
|
||||||
|
void MoveSessionHostToRdsOU(string hostName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace WebsitePanel.Providers.Virtualization
|
||||||
|
{
|
||||||
|
public enum AutomaticStartAction
|
||||||
|
{
|
||||||
|
Undefined = 100,
|
||||||
|
Nothing = 0,
|
||||||
|
StartIfRunning = 1,
|
||||||
|
Start = 2,
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace WebsitePanel.Providers.Virtualization
|
||||||
|
{
|
||||||
|
public enum AutomaticStopAction
|
||||||
|
{
|
||||||
|
Undefined = 100,
|
||||||
|
TurnOff = 0,
|
||||||
|
Save = 1,
|
||||||
|
ShutDown = 2,
|
||||||
|
}
|
||||||
|
}
|
|
@ -36,5 +36,6 @@ namespace WebsitePanel.Providers.Virtualization
|
||||||
{
|
{
|
||||||
public bool NumLockEnabled { get; set; }
|
public bool NumLockEnabled { get; set; }
|
||||||
public string[] StartupOrder { get; set; }
|
public string[] StartupOrder { get; set; }
|
||||||
|
public bool BootFromCD { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -39,5 +39,6 @@ namespace WebsitePanel.Providers.Virtualization
|
||||||
public int ControllerLocation { get; set; }
|
public int ControllerLocation { get; set; }
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public string Id { get; set; }
|
public string Id { get; set; }
|
||||||
|
public string Path { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -34,7 +34,7 @@ namespace WebsitePanel.Providers.Virtualization
|
||||||
{
|
{
|
||||||
public enum VirtualHardDiskFormat
|
public enum VirtualHardDiskFormat
|
||||||
{
|
{
|
||||||
VHD = 1,
|
VHD = 0,
|
||||||
VHDX = 2
|
VHDX = 1
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,5 +136,11 @@ namespace WebsitePanel.Providers.Virtualization
|
||||||
[Persistent]
|
[Persistent]
|
||||||
public int Generation { get; set; }
|
public int Generation { get; set; }
|
||||||
|
|
||||||
|
[Persistent]
|
||||||
|
public int ProcessorCount { get; set; }
|
||||||
|
|
||||||
|
[Persistent]
|
||||||
|
public string ParentSnapshotId { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,6 +37,7 @@ namespace WebsitePanel.Providers.Virtualization
|
||||||
public string Id { get; set; }
|
public string Id { get; set; }
|
||||||
public string CheckPointId { get; set; }
|
public string CheckPointId { get; set; }
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
public string VMName { get; set; }
|
||||||
public string ParentId { get; set; }
|
public string ParentId { get; set; }
|
||||||
public DateTime Created { get; set; }
|
public DateTime Created { get; set; }
|
||||||
public bool IsCurrent { get; set; }
|
public bool IsCurrent { get; set; }
|
||||||
|
|
|
@ -49,18 +49,21 @@ namespace WebsitePanel.Providers.Virtualization
|
||||||
Deleted = 32775,
|
Deleted = 32775,
|
||||||
Pausing = 32776
|
Pausing = 32776
|
||||||
*/
|
*/
|
||||||
|
Snapshotting = 32771,
|
||||||
|
Migrating = 32772,
|
||||||
|
Deleted = 32775,
|
||||||
|
|
||||||
Unknown = 0,
|
Unknown = 0,
|
||||||
Other = 1,
|
Other = 1,
|
||||||
Running = 2,
|
Running = 2,
|
||||||
Off = 3,
|
Off = 3,
|
||||||
Stopping = 4,
|
Stopping = 32774, // new 4
|
||||||
Saved = 6,
|
Saved = 32769, // new 6
|
||||||
Paused = 9,
|
Paused = 32768, // new 9
|
||||||
Starting = 10,
|
Starting = 32770, // new 10
|
||||||
Reset = 11,
|
Reset = 10, // new 11
|
||||||
Saving = 32773,
|
Saving = 32773, // new 32773
|
||||||
Pausing = 32776,
|
Pausing = 32776, // new 32776
|
||||||
Resuming = 32777,
|
Resuming = 32777,
|
||||||
FastSaved = 32779,
|
FastSaved = 32779,
|
||||||
FastSaving = 32780,
|
FastSaving = 32780,
|
||||||
|
|
|
@ -288,6 +288,8 @@
|
||||||
<Compile Include="Statistics\StatsServer.cs" />
|
<Compile Include="Statistics\StatsServer.cs" />
|
||||||
<Compile Include="Statistics\StatsSite.cs" />
|
<Compile Include="Statistics\StatsSite.cs" />
|
||||||
<Compile Include="Statistics\StatsUser.cs" />
|
<Compile Include="Statistics\StatsUser.cs" />
|
||||||
|
<Compile Include="Virtualization\AutomaticStopAction.cs" />
|
||||||
|
<Compile Include="Virtualization\AutomaticStartAction.cs" />
|
||||||
<Compile Include="Virtualization\BiosInfo.cs" />
|
<Compile Include="Virtualization\BiosInfo.cs" />
|
||||||
<Compile Include="Virtualization\ChangeJobStateReturnCode.cs" />
|
<Compile Include="Virtualization\ChangeJobStateReturnCode.cs" />
|
||||||
<Compile Include="Virtualization\ConcreteJob.cs">
|
<Compile Include="Virtualization\ConcreteJob.cs">
|
||||||
|
|
|
@ -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()
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,46 @@
|
||||||
|
// 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.
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using WebsitePanel.Providers.HostedSolution;
|
||||||
|
|
||||||
|
|
||||||
|
namespace WebsitePanel.Providers.HostedSolution
|
||||||
|
{
|
||||||
|
public class CRMProvider2015 : CRMBase
|
||||||
|
{
|
||||||
|
|
||||||
|
public override bool IsInstalled()
|
||||||
|
{
|
||||||
|
|
||||||
|
return CRMServerVersion.StartsWith("7.");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,152 @@
|
||||||
|
// 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.
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using WebsitePanel.Providers.Common;
|
||||||
|
using WebsitePanel.Server.Utils;
|
||||||
|
using System.Text;
|
||||||
|
using System.Management.Automation.Runspaces;
|
||||||
|
|
||||||
|
namespace WebsitePanel.Providers.HostedSolution
|
||||||
|
{
|
||||||
|
public class HostedSolutionLog
|
||||||
|
{
|
||||||
|
public static string LogPrefix = "HostedSolution";
|
||||||
|
|
||||||
|
public static void LogStart(string message, params object[] args)
|
||||||
|
{
|
||||||
|
string text = String.Format(message, args);
|
||||||
|
Log.WriteStart("{0} {1}", LogPrefix, text);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void LogEnd(string message, params object[] args)
|
||||||
|
{
|
||||||
|
string text = String.Format(message, args);
|
||||||
|
Log.WriteEnd("{0} {1}", LogPrefix, text);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void LogInfo(string message)
|
||||||
|
{
|
||||||
|
Log.WriteInfo("{0} {1}", LogPrefix, message);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void LogInfo(string message, params object[] args)
|
||||||
|
{
|
||||||
|
string text = String.Format(message, args);
|
||||||
|
Log.WriteInfo("{0} {1}", LogPrefix, text);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void LogWarning(string message)
|
||||||
|
{
|
||||||
|
Log.WriteWarning("{0} {1}", LogPrefix, message);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void LogWarning(string message, params object[] args)
|
||||||
|
{
|
||||||
|
string text = String.Format(message, args);
|
||||||
|
Log.WriteWarning("{0} {1}", LogPrefix, text);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void LogError(Exception ex)
|
||||||
|
{
|
||||||
|
Log.WriteError(LogPrefix, ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void LogError(string message, Exception ex)
|
||||||
|
{
|
||||||
|
string text = String.Format("{0} {1}", LogPrefix, message);
|
||||||
|
Log.WriteError(text, ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void DebugInfo(string message, params object[] args)
|
||||||
|
{
|
||||||
|
string text = String.Format(message, args);
|
||||||
|
Log.WriteInfo("{0} {1}", LogPrefix, text);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void EndLog(string message, ResultObject res, string errorCode, Exception ex)
|
||||||
|
{
|
||||||
|
if (res != null)
|
||||||
|
{
|
||||||
|
res.IsSuccess = false;
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(errorCode))
|
||||||
|
res.ErrorCodes.Add(errorCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ex != null)
|
||||||
|
LogError(ex);
|
||||||
|
|
||||||
|
|
||||||
|
//LogRecord.
|
||||||
|
LogEnd(message);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void EndLog(string message, ResultObject res, string errorCode)
|
||||||
|
{
|
||||||
|
EndLog(message, res, errorCode, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void EndLog(string message, ResultObject res)
|
||||||
|
{
|
||||||
|
EndLog(message, res, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void EndLog(string message)
|
||||||
|
{
|
||||||
|
EndLog(message, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
internal static T StartLog<T>(string message) where T : ResultObject, new()
|
||||||
|
{
|
||||||
|
LogStart(message);
|
||||||
|
T res = new T();
|
||||||
|
res.IsSuccess = true;
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void DebugCommand(Command cmd)
|
||||||
|
{
|
||||||
|
StringBuilder sb = new StringBuilder(cmd.CommandText);
|
||||||
|
foreach (CommandParameter parameter in cmd.Parameters)
|
||||||
|
{
|
||||||
|
string formatString = " -{0} {1}";
|
||||||
|
if (parameter.Value is string)
|
||||||
|
formatString = " -{0} '{1}'";
|
||||||
|
else if (parameter.Value is bool)
|
||||||
|
formatString = " -{0} ${1}";
|
||||||
|
sb.AppendFormat(formatString, parameter.Name, parameter.Value);
|
||||||
|
}
|
||||||
|
Log.WriteInfo("{0} {1}", LogPrefix, sb.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,64 @@
|
||||||
|
// 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.
|
||||||
|
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
// General Information about an assembly is controlled through the following
|
||||||
|
// set of attributes. Change these attribute values to modify the information
|
||||||
|
// associated with an assembly.
|
||||||
|
[assembly: AssemblyTitle("WebsitePanel.Providers.HostedSolution.Crm2013")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("WebsitePanel.Providers.HostedSolution.Crm2013")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2013")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
// Setting ComVisible to false makes the types in this assembly not visible
|
||||||
|
// to COM components. If you need to access a type in this assembly from
|
||||||
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||||
|
[assembly: Guid("111E4961-46B0-4323-9EEB-8FE1DD1D48F6")]
|
||||||
|
|
||||||
|
// Version information for an assembly consists of the following four values:
|
||||||
|
//
|
||||||
|
// Major Version
|
||||||
|
// Minor Version
|
||||||
|
// Build Number
|
||||||
|
// Revision
|
||||||
|
//
|
||||||
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
|
// by using the '*' as shown below:
|
||||||
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
|
@ -0,0 +1,105 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProjectGuid>{96EC3A56-5598-4B2D-A1F2-2E0DB6BA2AB6}</ProjectGuid>
|
||||||
|
<OutputType>Library</OutputType>
|
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
|
<RootNamespace>WebsitePanel.Providers.HostedSolution.Crm2015</RootNamespace>
|
||||||
|
<AssemblyName>WebsitePanel.Providers.HostedSolution.Crm2015</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<TargetFrameworkProfile />
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>..\WebsitePanel.Server\bin\Crm2015\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>..\WebsitePanel.Server\bin\Crm2015\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
<Prefer32Bit>false</Prefer32Bit>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="Microsoft.Crm.Sdk.Proxy, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\Lib\References\Microsoft\CRM2015\Microsoft.Crm.Sdk.Proxy.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Xrm.Client">
|
||||||
|
<HintPath>..\..\Lib\References\Microsoft\CRM2015\Microsoft.Xrm.Client.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Xrm.Client.CodeGeneration">
|
||||||
|
<HintPath>..\..\Lib\References\Microsoft\CRM2015\Microsoft.Xrm.Client.CodeGeneration.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Xrm.Portal">
|
||||||
|
<HintPath>..\..\Lib\References\Microsoft\CRM2015\Microsoft.Xrm.Portal.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Xrm.Portal.Files">
|
||||||
|
<HintPath>..\..\Lib\References\Microsoft\CRM2015\Microsoft.Xrm.Portal.Files.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Xrm.Sdk, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\Lib\References\Microsoft\CRM2015\Microsoft.Xrm.Sdk.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Xrm.Sdk.Deployment, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\Lib\References\Microsoft\CRM2015\Microsoft.Xrm.Sdk.Deployment.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Xrm.Sdk.Workflow">
|
||||||
|
<HintPath>..\..\Lib\References\Microsoft\CRM2015\Microsoft.Xrm.Sdk.Workflow.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\..\Lib\System.Management.Automation.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Runtime.Serialization" />
|
||||||
|
<Reference Include="System.ServiceModel" />
|
||||||
|
<Reference Include="System.Xml.Linq" />
|
||||||
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
|
<Reference Include="Microsoft.CSharp" />
|
||||||
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="CRMBase.cs" />
|
||||||
|
<Compile Include="CRMProvider2015.cs" />
|
||||||
|
<Compile Include="HostedSolutionLog.cs" />
|
||||||
|
<Compile Include="MyOrganizationCrmSdkTypes.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\WebsitePanel.Providers.Base\WebsitePanel.Providers.Base.csproj">
|
||||||
|
<Project>{684C932A-6C75-46AC-A327-F3689D89EB42}</Project>
|
||||||
|
<Name>WebsitePanel.Providers.Base</Name>
|
||||||
|
<Private>False</Private>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\WebsitePanel.Server.Utils\WebsitePanel.Server.Utils.csproj">
|
||||||
|
<Project>{E91E52F3-9555-4D00-B577-2B1DBDD87CA7}</Project>
|
||||||
|
<Name>WebsitePanel.Server.Utils</Name>
|
||||||
|
<Private>False</Private>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
|
<Target Name="BeforeBuild">
|
||||||
|
</Target>
|
||||||
|
<Target Name="AfterBuild">
|
||||||
|
</Target>
|
||||||
|
-->
|
||||||
|
</Project>
|
|
@ -68,12 +68,17 @@ 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 WspAdministratorsGroupDescription = "WSP Org Administrators";
|
private const string WspAdministratorsGroupDescription = "WSP RDS Collection Adminstrators";
|
||||||
private const string RdsServersOU = "RDSServers";
|
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 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";
|
private const string LocalAdministratorsGroupName = "Administrators";
|
||||||
|
private const string RDSHelpDeskRdRapPolicyName = "RDS-HelpDesk-RDRAP";
|
||||||
|
private const string RDSHelpDeskRdCapPolicyName = "RDS-HelpDesk-RDCAP";
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -95,6 +100,14 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string ComputersRootOU
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return ProviderSettings["ComputersRootOU"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private string CentralNpsHost
|
private string CentralNpsHost
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
@ -301,30 +314,22 @@ 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);
|
||||||
|
|
||||||
foreach (var gateway in Gateways)
|
foreach (var gateway in Gateways)
|
||||||
{
|
{
|
||||||
|
CreateHelpDeskRdCapForce(runSpace, gateway);
|
||||||
|
CreateHelpDeskRdRapForce(runSpace, gateway);
|
||||||
|
|
||||||
if (!CentralNps)
|
if (!CentralNps)
|
||||||
{
|
{
|
||||||
CreateRdCapForce(runSpace, gateway, capPolicyName, collection.Name, new List<string> { GetUsersGroupName(collection.Name) });
|
CreateRdCapForce(runSpace, gateway, capPolicyName, collection.Name, new List<string> { GetUsersGroupName(collection.Name) });
|
||||||
|
@ -344,7 +349,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)
|
||||||
{
|
{
|
||||||
|
MoveRdsServerToTenantOU(rdsServer.Name, organizationId);
|
||||||
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -570,8 +577,19 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
ExecuteShellCommand(runSpace, cmd, false);
|
ExecuteShellCommand(runSpace, cmd, false);
|
||||||
|
|
||||||
CheckOrCreateHelpDeskComputerGroup();
|
CheckOrCreateHelpDeskComputerGroup();
|
||||||
string helpDeskGroupSamAccountName = CheckOrCreateAdGroup(GetHelpDeskGroupPath(RDSHelpDeskGroup), GetRootOUPath(), RDSHelpDeskGroup, RDSHelpDeskGroupDescription);
|
|
||||||
|
|
||||||
|
foreach(var gateway in Gateways)
|
||||||
|
{
|
||||||
|
CreateHelpDeskRdCapForce(runSpace, gateway);
|
||||||
|
CreateHelpDeskRdRapForce(runSpace, gateway);
|
||||||
|
}
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
|
AddAdGroupToLocalAdmins(runSpace, server.FqdName, LocalAdministratorsGroupName);
|
||||||
AddAdGroupToLocalAdmins(runSpace, server.FqdName, helpDeskGroupSamAccountName);
|
AddAdGroupToLocalAdmins(runSpace, server.FqdName, helpDeskGroupSamAccountName);
|
||||||
AddComputerToCollectionAdComputerGroup(organizationId, collectionName, server);
|
AddComputerToCollectionAdComputerGroup(organizationId, collectionName, server);
|
||||||
}
|
}
|
||||||
|
@ -914,6 +932,59 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
ExecuteRemoteShellCommand(runSpace, gatewayHost, rdCapCommand, RdsModuleName);
|
ExecuteRemoteShellCommand(runSpace, gatewayHost, rdCapCommand, RdsModuleName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void CreateHelpDeskRdCapForce(Runspace runSpace, string gatewayHost)
|
||||||
|
{
|
||||||
|
if (ItemExistsRemote(runSpace, gatewayHost, Path.Combine(CapPath, RDSHelpDeskRdCapPolicyName)))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var userGroupParameter = string.Format("@({0})", string.Format("\"{0}@{1}\"", RDSHelpDeskGroup, RootDomain));
|
||||||
|
|
||||||
|
Command rdCapCommand = new Command("New-Item");
|
||||||
|
rdCapCommand.Parameters.Add("Path", string.Format("\"{0}\"", CapPath));
|
||||||
|
rdCapCommand.Parameters.Add("Name", string.Format("\"{0}\"", RDSHelpDeskRdCapPolicyName));
|
||||||
|
rdCapCommand.Parameters.Add("UserGroups", userGroupParameter);
|
||||||
|
rdCapCommand.Parameters.Add("AuthMethod", 1);
|
||||||
|
|
||||||
|
ExecuteRemoteShellCommand(runSpace, gatewayHost, rdCapCommand, RdsModuleName);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void CreateHelpDeskRdRapForce(Runspace runSpace, string gatewayHost)
|
||||||
|
{
|
||||||
|
if (ItemExistsRemote(runSpace, gatewayHost, Path.Combine(RapPath, RDSHelpDeskRdRapPolicyName)))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var userGroupParameter = string.Format("@({0})", string.Format("\"{0}@{1}\"", RDSHelpDeskGroup, RootDomain));
|
||||||
|
var computerGroupParameter = string.Format("\"{0}@{1}\"", RDSHelpDeskComputerGroup, RootDomain);
|
||||||
|
|
||||||
|
Command rdRapCommand = new Command("New-Item");
|
||||||
|
rdRapCommand.Parameters.Add("Path", string.Format("\"{0}\"", RapPath));
|
||||||
|
rdRapCommand.Parameters.Add("Name", string.Format("\"{0}\"", RDSHelpDeskRdRapPolicyName));
|
||||||
|
rdRapCommand.Parameters.Add("UserGroups", userGroupParameter);
|
||||||
|
rdRapCommand.Parameters.Add("ComputerGroupType", 1);
|
||||||
|
rdRapCommand.Parameters.Add("ComputerGroup", computerGroupParameter);
|
||||||
|
|
||||||
|
object[] errors;
|
||||||
|
|
||||||
|
for (int i = 0; i < 3; i++)
|
||||||
|
{
|
||||||
|
ExecuteRemoteShellCommand(runSpace, gatewayHost, rdRapCommand, out errors, RdsModuleName);
|
||||||
|
|
||||||
|
if (errors == null || !errors.Any())
|
||||||
|
{
|
||||||
|
Log.WriteWarning("RD RAP Added Successfully");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Log.WriteWarning(string.Join("\r\n", errors.Select(e => e.ToString()).ToArray()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
internal void RemoveRdCap(Runspace runSpace, string gatewayHost, string name)
|
internal void RemoveRdCap(Runspace runSpace, string gatewayHost, string name)
|
||||||
{
|
{
|
||||||
RemoveItemRemote(runSpace, gatewayHost, string.Format(@"{0}\{1}", CapPath, name), RdsModuleName);
|
RemoveItemRemote(runSpace, gatewayHost, string.Format(@"{0}\{1}", CapPath, name), RdsModuleName);
|
||||||
|
@ -1097,7 +1168,6 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
{
|
{
|
||||||
var guid = Guid.NewGuid();
|
var guid = Guid.NewGuid();
|
||||||
var x509Cert = new X509Certificate2(certificate, password, X509KeyStorageFlags.Exportable);
|
var x509Cert = new X509Certificate2(certificate, password, X509KeyStorageFlags.Exportable);
|
||||||
//var content = x509Cert.Export(X509ContentType.Pfx);
|
|
||||||
var filePath = SaveCertificate(certificate, guid);
|
var filePath = SaveCertificate(certificate, guid);
|
||||||
runspace = OpenRunspace();
|
runspace = OpenRunspace();
|
||||||
|
|
||||||
|
@ -1108,6 +1178,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
|
|
||||||
if (!errors.Any())
|
if (!errors.Any())
|
||||||
{
|
{
|
||||||
|
RemoveCertificate(runspace, hostName, x509Cert.Thumbprint);
|
||||||
errors = ImportCertificate(runspace, hostName, password, string.Format("c:\\{0}.pfx", guid), x509Cert.Thumbprint);
|
errors = ImportCertificate(runspace, hostName, password, string.Format("c:\\{0}.pfx", guid), x509Cert.Thumbprint);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1131,6 +1202,17 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void RemoveCertificate(Runspace runspace, string hostName, string thumbprint)
|
||||||
|
{
|
||||||
|
var scripts = new List<string>
|
||||||
|
{
|
||||||
|
string.Format("Remove-Item -Path cert:\\LocalMachine\\My\\{0}", thumbprint)
|
||||||
|
};
|
||||||
|
|
||||||
|
object[] errors = null;
|
||||||
|
ExecuteRemoteShellCommand(runspace, hostName, scripts, out errors);
|
||||||
|
}
|
||||||
|
|
||||||
private object[] ImportCertificate(Runspace runspace, string hostName, string password, string certificatePath, string thumbprint)
|
private object[] ImportCertificate(Runspace runspace, string hostName, string password, string certificatePath, string thumbprint)
|
||||||
{
|
{
|
||||||
var scripts = new List<string>
|
var scripts = new List<string>
|
||||||
|
@ -1277,27 +1359,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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1306,29 +1382,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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1363,34 +1433,64 @@ 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 MoveSessionHostToRdsOU(string hostName)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(ComputersRootOU))
|
||||||
|
{
|
||||||
|
CheckOrCreateComputersRoot(GetComputersRootPath());
|
||||||
|
}
|
||||||
|
|
||||||
|
var computerObject = GetComputerObject(hostName);
|
||||||
|
|
||||||
|
if (computerObject != null)
|
||||||
|
{
|
||||||
|
var samName = (string)ActiveDirectoryUtils.GetADObjectProperty(computerObject, "sAMAccountName");
|
||||||
|
|
||||||
|
if (!ActiveDirectoryUtils.IsComputerInGroup(samName, RdsServersRootOU))
|
||||||
|
{
|
||||||
|
DirectoryEntry group = new DirectoryEntry(GetRdsServersGroupPath());
|
||||||
|
computerObject.MoveTo(group);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
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();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1399,23 +1499,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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1543,6 +1647,10 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
|
||||||
{
|
{
|
||||||
remoteApp.Users = users;
|
remoteApp.Users = users;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
remoteApp.Users = null;
|
||||||
|
}
|
||||||
|
|
||||||
return remoteApp;
|
return remoteApp;
|
||||||
}
|
}
|
||||||
|
@ -1698,25 +1806,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)
|
||||||
|
@ -1726,7 +1825,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);
|
||||||
|
@ -1734,13 +1833,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);
|
||||||
|
|
|
@ -0,0 +1,14 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace WebsitePanel.Providers.Virtualization
|
||||||
|
{
|
||||||
|
public static class Constants
|
||||||
|
{
|
||||||
|
public const Int64 Size1G = 0x40000000;
|
||||||
|
public const Int64 Size1M = 0x100000;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Management;
|
||||||
using System.Management.Automation;
|
using System.Management.Automation;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
@ -9,6 +10,8 @@ namespace WebsitePanel.Providers.Virtualization
|
||||||
{
|
{
|
||||||
static class PSObjectExtension
|
static class PSObjectExtension
|
||||||
{
|
{
|
||||||
|
#region Properties
|
||||||
|
|
||||||
public static object GetProperty(this PSObject obj, string name)
|
public static object GetProperty(this PSObject obj, string name)
|
||||||
{
|
{
|
||||||
return obj.Members[name].Value;
|
return obj.Members[name].Value;
|
||||||
|
@ -33,5 +36,27 @@ namespace WebsitePanel.Providers.Virtualization
|
||||||
{
|
{
|
||||||
return obj.Members[name].Value == null ? "" : obj.Members[name].Value.ToString();
|
return obj.Members[name].Value == null ? "" : obj.Members[name].Value.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
#region Methods
|
||||||
|
|
||||||
|
public static ManagementObject Invoke(this PSObject obj, string name, object argument)
|
||||||
|
{
|
||||||
|
return obj.Invoke(name, new[] {argument});
|
||||||
|
}
|
||||||
|
public static ManagementObject Invoke(this PSObject obj, string name, params object[] arguments)
|
||||||
|
{
|
||||||
|
var results = (ManagementObjectCollection)obj.Methods[name].Invoke(arguments);
|
||||||
|
|
||||||
|
foreach (var result in results)
|
||||||
|
{
|
||||||
|
return (ManagementObject) result;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,109 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Management.Automation;
|
||||||
|
using System.Management.Automation.Runspaces;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace WebsitePanel.Providers.Virtualization
|
||||||
|
{
|
||||||
|
public static class BiosHelper
|
||||||
|
{
|
||||||
|
public static BiosInfo Get(PowerShellManager powerShell, string name, int generation)
|
||||||
|
{
|
||||||
|
BiosInfo info = new BiosInfo();
|
||||||
|
|
||||||
|
// for Win2012R2+ and Win8.1+
|
||||||
|
if (generation == 2)
|
||||||
|
{
|
||||||
|
Command cmd = new Command("Get-VMFirmware");
|
||||||
|
|
||||||
|
cmd.Parameters.Add("VMName", name);
|
||||||
|
|
||||||
|
Collection<PSObject> result = powerShell.Execute(cmd, false);
|
||||||
|
if (result != null && result.Count > 0)
|
||||||
|
{
|
||||||
|
info.NumLockEnabled = true;
|
||||||
|
|
||||||
|
List<string> startupOrders = new List<string>();
|
||||||
|
info.BootFromCD = false;
|
||||||
|
|
||||||
|
foreach (dynamic item in (IEnumerable)result[0].GetProperty("BootOrder"))
|
||||||
|
{
|
||||||
|
string bootType = item.BootType.ToString();
|
||||||
|
|
||||||
|
// bootFromCD
|
||||||
|
if (!startupOrders.Any() && bootType == "Drive")
|
||||||
|
{
|
||||||
|
var device = item.Device;
|
||||||
|
info.BootFromCD = device.GetType().Name == "DvdDrive";
|
||||||
|
}
|
||||||
|
|
||||||
|
// startupOrders
|
||||||
|
startupOrders.Add(bootType);
|
||||||
|
}
|
||||||
|
|
||||||
|
info.StartupOrder = startupOrders.ToArray();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// for others win and linux
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Command cmd = new Command("Get-VMBios");
|
||||||
|
|
||||||
|
cmd.Parameters.Add("VMName", name);
|
||||||
|
|
||||||
|
Collection<PSObject> result = powerShell.Execute(cmd, false);
|
||||||
|
if (result != null && result.Count > 0)
|
||||||
|
{
|
||||||
|
info.NumLockEnabled = Convert.ToBoolean(result[0].GetProperty("NumLockEnabled"));
|
||||||
|
|
||||||
|
List<string> startupOrders = new List<string>();
|
||||||
|
|
||||||
|
foreach (var item in (IEnumerable)result[0].GetProperty("StartupOrder"))
|
||||||
|
startupOrders.Add(item.ToString());
|
||||||
|
|
||||||
|
info.StartupOrder = startupOrders.ToArray();
|
||||||
|
info.BootFromCD = false;
|
||||||
|
if (info.StartupOrder != null && info.StartupOrder.Length > 0)
|
||||||
|
info.BootFromCD = info.StartupOrder[0] == "CD";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Update(PowerShellManager powerShell, VirtualMachine vm, bool bootFromCD, bool numLockEnabled)
|
||||||
|
{
|
||||||
|
// for Win2012R2+ and Win8.1+
|
||||||
|
if (vm.Generation == 2)
|
||||||
|
{
|
||||||
|
Command cmd = new Command("Set-VMFirmware");
|
||||||
|
|
||||||
|
cmd.Parameters.Add("VMName", vm.Name);
|
||||||
|
if (bootFromCD)
|
||||||
|
cmd.Parameters.Add("FirstBootDevice", DvdDriveHelper.GetPS(powerShell, vm.Name));
|
||||||
|
else
|
||||||
|
cmd.Parameters.Add("FirstBootDevice", HardDriveHelper.GetPS(powerShell, vm.Name).FirstOrDefault());
|
||||||
|
|
||||||
|
powerShell.Execute(cmd, false);
|
||||||
|
}
|
||||||
|
// for others win and linux
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Command cmd = new Command("Set-VMBios");
|
||||||
|
|
||||||
|
cmd.Parameters.Add("VMName", vm.Name);
|
||||||
|
var bootOrder = bootFromCD
|
||||||
|
? new[] { "CD", "IDE", "LegacyNetworkAdapter", "Floppy" }
|
||||||
|
: new[] { "IDE", "CD", "LegacyNetworkAdapter", "Floppy" };
|
||||||
|
cmd.Parameters.Add("StartupOrder", bootOrder);
|
||||||
|
|
||||||
|
powerShell.Execute(cmd, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -13,8 +13,25 @@ namespace WebsitePanel.Providers.Virtualization
|
||||||
{
|
{
|
||||||
public static DvdDriveInfo Get(PowerShellManager powerShell, string vmName)
|
public static DvdDriveInfo Get(PowerShellManager powerShell, string vmName)
|
||||||
{
|
{
|
||||||
DvdDriveInfo info = new DvdDriveInfo();
|
DvdDriveInfo info = null;
|
||||||
|
|
||||||
|
PSObject result = GetPS(powerShell, vmName);
|
||||||
|
|
||||||
|
if (result != null)
|
||||||
|
{
|
||||||
|
info = new DvdDriveInfo();
|
||||||
|
info.Id = result.GetString("Id");
|
||||||
|
info.Name = result.GetString("Name");
|
||||||
|
info.ControllerType = result.GetEnum<ControllerType>("ControllerType");
|
||||||
|
info.ControllerNumber = result.GetInt("ControllerNumber");
|
||||||
|
info.ControllerLocation = result.GetInt("ControllerLocation");
|
||||||
|
info.Path = result.GetString("Path");
|
||||||
|
}
|
||||||
|
return info;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static PSObject GetPS(PowerShellManager powerShell, string vmName)
|
||||||
|
{
|
||||||
Command cmd = new Command("Get-VMDvdDrive");
|
Command cmd = new Command("Get-VMDvdDrive");
|
||||||
|
|
||||||
cmd.Parameters.Add("VMName", vmName);
|
cmd.Parameters.Add("VMName", vmName);
|
||||||
|
@ -23,13 +40,10 @@ namespace WebsitePanel.Providers.Virtualization
|
||||||
|
|
||||||
if (result != null && result.Count > 0)
|
if (result != null && result.Count > 0)
|
||||||
{
|
{
|
||||||
info.Id = result[0].GetString("Id");
|
return result[0];
|
||||||
info.Name = result[0].GetString("Name");
|
|
||||||
info.ControllerType = result[0].GetEnum<ControllerType>("ControllerType");
|
|
||||||
info.ControllerNumber = result[0].GetInt("ControllerNumber");
|
|
||||||
info.ControllerLocation = result[0].GetInt("ControllerLocation");
|
|
||||||
}
|
}
|
||||||
return info;
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Set(PowerShellManager powerShell, string vmName, string path)
|
public static void Set(PowerShellManager powerShell, string vmName, string path)
|
||||||
|
@ -56,13 +70,9 @@ namespace WebsitePanel.Providers.Virtualization
|
||||||
|
|
||||||
public static void Add(PowerShellManager powerShell, string vmName)
|
public static void Add(PowerShellManager powerShell, string vmName)
|
||||||
{
|
{
|
||||||
var dvd = Get(powerShell, vmName);
|
|
||||||
|
|
||||||
Command cmd = new Command("Add-VMDvdDrive");
|
Command cmd = new Command("Add-VMDvdDrive");
|
||||||
|
|
||||||
cmd.Parameters.Add("VMName", vmName);
|
cmd.Parameters.Add("VMName", vmName);
|
||||||
cmd.Parameters.Add("ControllerNumber", dvd.ControllerNumber);
|
|
||||||
cmd.Parameters.Add("ControllerLocation", dvd.ControllerLocation);
|
|
||||||
|
|
||||||
powerShell.Execute(cmd, false);
|
powerShell.Execute(cmd, false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,89 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Management.Automation;
|
||||||
|
using System.Management.Automation.Runspaces;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace WebsitePanel.Providers.Virtualization
|
||||||
|
{
|
||||||
|
public static class HardDriveHelper
|
||||||
|
{
|
||||||
|
public static VirtualHardDiskInfo[] Get(PowerShellManager powerShell, string vmname)
|
||||||
|
{
|
||||||
|
List<VirtualHardDiskInfo> disks = new List<VirtualHardDiskInfo>();
|
||||||
|
|
||||||
|
Collection<PSObject> result = GetPS(powerShell, vmname);
|
||||||
|
|
||||||
|
if (result != null && result.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (PSObject d in result)
|
||||||
|
{
|
||||||
|
VirtualHardDiskInfo disk = new VirtualHardDiskInfo();
|
||||||
|
|
||||||
|
disk.SupportPersistentReservations = Convert.ToBoolean(d.GetProperty("SupportPersistentReservations"));
|
||||||
|
disk.MaximumIOPS = Convert.ToUInt64(d.GetProperty("MaximumIOPS"));
|
||||||
|
disk.MinimumIOPS = Convert.ToUInt64(d.GetProperty("MinimumIOPS"));
|
||||||
|
disk.VHDControllerType = d.GetEnum<ControllerType>("ControllerType");
|
||||||
|
disk.ControllerNumber = Convert.ToInt32(d.GetProperty("ControllerNumber"));
|
||||||
|
disk.ControllerLocation = Convert.ToInt32(d.GetProperty("ControllerLocation"));
|
||||||
|
disk.Path = d.GetProperty("Path").ToString();
|
||||||
|
disk.Name = d.GetProperty("Name").ToString();
|
||||||
|
|
||||||
|
GetVirtualHardDiskDetail(powerShell, disk.Path, ref disk);
|
||||||
|
|
||||||
|
disks.Add(disk);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return disks.ToArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
//public static VirtualHardDiskInfo GetByPath(PowerShellManager powerShell, string vhdPath)
|
||||||
|
//{
|
||||||
|
// VirtualHardDiskInfo info = null;
|
||||||
|
// var vmNames = new List<string>();
|
||||||
|
|
||||||
|
// Command cmd = new Command("Get-VM");
|
||||||
|
|
||||||
|
// Collection<PSObject> result = powerShell.Execute(cmd, false);
|
||||||
|
|
||||||
|
// if (result == null || result.Count == 0)
|
||||||
|
// return null;
|
||||||
|
|
||||||
|
// vmNames = result.Select(r => r.GetString("Name")).ToList();
|
||||||
|
// var drives = vmNames.SelectMany(n => Get(powerShell, n));
|
||||||
|
|
||||||
|
// return drives.FirstOrDefault(d=>d.Path == vhdPath);
|
||||||
|
//}
|
||||||
|
|
||||||
|
public static Collection<PSObject> GetPS(PowerShellManager powerShell, string vmname)
|
||||||
|
{
|
||||||
|
Command cmd = new Command("Get-VMHardDiskDrive");
|
||||||
|
cmd.Parameters.Add("VMName", vmname);
|
||||||
|
|
||||||
|
return powerShell.Execute(cmd, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void GetVirtualHardDiskDetail(PowerShellManager powerShell, string path, ref VirtualHardDiskInfo disk)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(path))
|
||||||
|
{
|
||||||
|
Command cmd = new Command("Get-VHD");
|
||||||
|
cmd.Parameters.Add("Path", path);
|
||||||
|
Collection<PSObject> result = powerShell.Execute(cmd, false);
|
||||||
|
if (result != null && result.Count > 0)
|
||||||
|
{
|
||||||
|
disk.DiskFormat = result[0].GetEnum<VirtualHardDiskFormat>("VhdFormat");
|
||||||
|
disk.DiskType = result[0].GetEnum<VirtualHardDiskType>("VhdType");
|
||||||
|
disk.ParentPath = result[0].GetProperty<string>("ParentPath");
|
||||||
|
disk.MaxInternalSize = Convert.ToInt64(result[0].GetProperty("Size"));
|
||||||
|
disk.FileSize = Convert.ToInt64(result[0].GetProperty("FileSize"));
|
||||||
|
disk.Attached = disk.InUse = Convert.ToBoolean(result[0].GetProperty("Attached"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,74 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Collections.ObjectModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Management.Automation;
|
||||||
|
using System.Management.Automation.Runspaces;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace WebsitePanel.Providers.Virtualization
|
||||||
|
{
|
||||||
|
public static class JobHelper
|
||||||
|
{
|
||||||
|
public static JobResult CreateSuccessResult(ReturnCode returnCode = ReturnCode.OK)
|
||||||
|
{
|
||||||
|
return new JobResult
|
||||||
|
{
|
||||||
|
Job = new ConcreteJob {JobState = ConcreteJobState.Completed},
|
||||||
|
ReturnValue = returnCode
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JobResult CreateResultFromPSResults(Collection<PSObject> objJob)
|
||||||
|
{
|
||||||
|
if (objJob == null || objJob.Count == 0)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
JobResult result = new JobResult();
|
||||||
|
|
||||||
|
result.Job = CreateFromPSObject(objJob);
|
||||||
|
result.ReturnValue = ReturnCode.JobStarted;
|
||||||
|
|
||||||
|
switch (result.Job.JobState)
|
||||||
|
{
|
||||||
|
case ConcreteJobState.Failed:
|
||||||
|
result.ReturnValue = ReturnCode.Failed;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ConcreteJob CreateFromPSObject(Collection<PSObject> objJob)
|
||||||
|
{
|
||||||
|
if (objJob == null || objJob.Count == 0)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
ConcreteJob job = new ConcreteJob();
|
||||||
|
job.Id = objJob[0].GetProperty<int>("Id").ToString();
|
||||||
|
job.JobState = objJob[0].GetEnum<ConcreteJobState>("JobStateInfo");
|
||||||
|
job.Caption = objJob[0].GetProperty<string>("Name");
|
||||||
|
job.Description = objJob[0].GetProperty<string>("Command");
|
||||||
|
job.StartTime = objJob[0].GetProperty<DateTime>("PSBeginTime");
|
||||||
|
job.ElapsedTime = objJob[0].GetProperty<DateTime?>("PSEndTime") ?? DateTime.Now;
|
||||||
|
|
||||||
|
// PercentComplete
|
||||||
|
job.PercentComplete = 0;
|
||||||
|
var progress = (PSDataCollection<ProgressRecord>)objJob[0].GetProperty("Progress");
|
||||||
|
if (progress != null && progress.Count > 0)
|
||||||
|
job.PercentComplete = progress[0].PercentComplete;
|
||||||
|
|
||||||
|
// Errors
|
||||||
|
var errors = (PSDataCollection<ErrorRecord>)objJob[0].GetProperty("Error");
|
||||||
|
if (errors != null && errors.Count > 0)
|
||||||
|
{
|
||||||
|
job.ErrorDescription = errors[0].ErrorDetails.Message + ". " + errors[0].ErrorDetails.RecommendedAction;
|
||||||
|
job.ErrorCode = errors[0].Exception != null ? -1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return job;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -49,18 +49,17 @@ namespace WebsitePanel.Providers.Virtualization
|
||||||
return adapters.FirstOrDefault(a => a.MacAddress == macAddress);
|
return adapters.FirstOrDefault(a => a.MacAddress == macAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Update(PowerShellManager powerShell, VirtualMachine vm, string switchId, string portName, string macAddress, string adapterName, bool legacyAdapter)
|
public static void Update(PowerShellManager powerShell, VirtualMachine vm)
|
||||||
{
|
{
|
||||||
// External NIC
|
// External NIC
|
||||||
if (!vm.ExternalNetworkEnabled && !String.IsNullOrEmpty(vm.ExternalNicMacAddress))
|
if (!vm.ExternalNetworkEnabled && !String.IsNullOrEmpty(vm.ExternalNicMacAddress))
|
||||||
{
|
{
|
||||||
// delete adapter
|
|
||||||
Delete(powerShell, vm.Name, vm.ExternalNicMacAddress);
|
Delete(powerShell, vm.Name, vm.ExternalNicMacAddress);
|
||||||
vm.ExternalNicMacAddress = null; // reset MAC
|
vm.ExternalNicMacAddress = null; // reset MAC
|
||||||
}
|
}
|
||||||
else if (vm.ExternalNetworkEnabled && !String.IsNullOrEmpty(vm.ExternalNicMacAddress))
|
else if (vm.ExternalNetworkEnabled && !String.IsNullOrEmpty(vm.ExternalNicMacAddress)
|
||||||
|
&& Get(powerShell,vm.Name,vm.ExternalNicMacAddress) == null)
|
||||||
{
|
{
|
||||||
// add external adapter
|
|
||||||
Add(powerShell, vm.Name, vm.ExternalSwitchId, vm.ExternalNicMacAddress, EXTERNAL_NETWORK_ADAPTER_NAME, vm.LegacyNetworkAdapter);
|
Add(powerShell, vm.Name, vm.ExternalSwitchId, vm.ExternalNicMacAddress, EXTERNAL_NETWORK_ADAPTER_NAME, vm.LegacyNetworkAdapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,35 +69,41 @@ namespace WebsitePanel.Providers.Virtualization
|
||||||
Delete(powerShell, vm.Name, vm.PrivateNicMacAddress);
|
Delete(powerShell, vm.Name, vm.PrivateNicMacAddress);
|
||||||
vm.PrivateNicMacAddress = null; // reset MAC
|
vm.PrivateNicMacAddress = null; // reset MAC
|
||||||
}
|
}
|
||||||
else if (vm.PrivateNetworkEnabled && !String.IsNullOrEmpty(vm.PrivateNicMacAddress))
|
else if (vm.PrivateNetworkEnabled && !String.IsNullOrEmpty(vm.PrivateNicMacAddress)
|
||||||
|
&& Get(powerShell, vm.Name, vm.PrivateNicMacAddress) == null)
|
||||||
{
|
{
|
||||||
Add(powerShell, vm.Name, vm.ExternalSwitchId, vm.ExternalNicMacAddress, PRIVATE_NETWORK_ADAPTER_NAME, vm.LegacyNetworkAdapter);
|
Add(powerShell, vm.Name, vm.PrivateSwitchId, vm.PrivateNicMacAddress, PRIVATE_NETWORK_ADAPTER_NAME, vm.LegacyNetworkAdapter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Add(PowerShellManager powerShell, string vmName, string switchId, string macAddress, string adapterName, bool legacyAdapter)
|
public static void Add(PowerShellManager powerShell, string vmName, string switchId, string macAddress, string adapterName, bool legacyAdapter)
|
||||||
{
|
{
|
||||||
//var dvd = Get(powerShell, vmName);
|
Command cmd = new Command("Add-VMNetworkAdapter");
|
||||||
|
|
||||||
//Command cmd = new Command("Add-VMDvdDrive");
|
cmd.Parameters.Add("VMName", vmName);
|
||||||
|
cmd.Parameters.Add("Name", adapterName);
|
||||||
|
cmd.Parameters.Add("SwitchName", switchId);
|
||||||
|
|
||||||
//cmd.Parameters.Add("VMName", vmName);
|
if (String.IsNullOrEmpty(macAddress))
|
||||||
//cmd.Parameters.Add("ControllerNumber", dvd.ControllerNumber);
|
cmd.Parameters.Add("DynamicMacAddress");
|
||||||
//cmd.Parameters.Add("ControllerLocation", dvd.ControllerLocation);
|
else
|
||||||
|
cmd.Parameters.Add("StaticMacAddress", macAddress);
|
||||||
|
|
||||||
//powerShell.Execute(cmd, false);
|
powerShell.Execute(cmd, false);
|
||||||
}
|
}
|
||||||
public static void Delete(PowerShellManager powerShell, string vmName, string macAddress)
|
public static void Delete(PowerShellManager powerShell, string vmName, string macAddress)
|
||||||
{
|
{
|
||||||
//var dvd = Get(powerShell, vmName);
|
var networkAdapter = Get(powerShell, vmName, macAddress);
|
||||||
|
|
||||||
//Command cmd = new Command("Add-VMDvdDrive");
|
if (networkAdapter == null)
|
||||||
|
return;
|
||||||
|
|
||||||
//cmd.Parameters.Add("VMName", vmName);
|
Command cmd = new Command("Remove-VMNetworkAdapter");
|
||||||
//cmd.Parameters.Add("ControllerNumber", dvd.ControllerNumber);
|
|
||||||
//cmd.Parameters.Add("ControllerLocation", dvd.ControllerLocation);
|
|
||||||
|
|
||||||
//powerShell.Execute(cmd, false);
|
cmd.Parameters.Add("VMName", vmName);
|
||||||
|
cmd.Parameters.Add("Name", networkAdapter.Name);
|
||||||
|
|
||||||
|
powerShell.Execute(cmd, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,72 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Management;
|
||||||
|
using System.Management.Automation;
|
||||||
|
using System.Management.Automation.Runspaces;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace WebsitePanel.Providers.Virtualization
|
||||||
|
{
|
||||||
|
public static class SnapshotHelper
|
||||||
|
{
|
||||||
|
public static VirtualMachineSnapshot GetFromPS(PSObject psObject, string runningSnapshotId = null)
|
||||||
|
{
|
||||||
|
var snapshot = new VirtualMachineSnapshot
|
||||||
|
{
|
||||||
|
Id = psObject.GetString("Id"),
|
||||||
|
Name = psObject.GetString("Name"),
|
||||||
|
VMName = psObject.GetString("VMName"),
|
||||||
|
ParentId = psObject.GetString("ParentSnapshotId"),
|
||||||
|
Created = psObject.GetProperty<DateTime>("CreationTime")
|
||||||
|
};
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(snapshot.ParentId))
|
||||||
|
snapshot.ParentId = null; // for capability
|
||||||
|
|
||||||
|
if (!String.IsNullOrEmpty(runningSnapshotId))
|
||||||
|
snapshot.IsCurrent = snapshot.Id == runningSnapshotId;
|
||||||
|
|
||||||
|
return snapshot;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static VirtualMachineSnapshot GetFromWmi(ManagementBaseObject objSnapshot)
|
||||||
|
{
|
||||||
|
if (objSnapshot == null || objSnapshot.Properties.Count == 0)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
VirtualMachineSnapshot snapshot = new VirtualMachineSnapshot();
|
||||||
|
snapshot.Id = (string)objSnapshot["InstanceID"];
|
||||||
|
snapshot.Name = (string)objSnapshot["ElementName"];
|
||||||
|
|
||||||
|
string parentId = (string)objSnapshot["Parent"];
|
||||||
|
if (!String.IsNullOrEmpty(parentId))
|
||||||
|
{
|
||||||
|
int idx = parentId.IndexOf("Microsoft:");
|
||||||
|
snapshot.ParentId = parentId.Substring(idx, parentId.Length - idx - 1);
|
||||||
|
snapshot.ParentId = snapshot.ParentId.ToLower().Replace("microsoft:", "");
|
||||||
|
}
|
||||||
|
if (!String.IsNullOrEmpty(snapshot.Id))
|
||||||
|
{
|
||||||
|
snapshot.Id = snapshot.Id.ToLower().Replace("microsoft:", "");
|
||||||
|
}
|
||||||
|
snapshot.Created = Wmi.ToDateTime((string)objSnapshot["CreationTime"]);
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(snapshot.ParentId))
|
||||||
|
snapshot.ParentId = null; // for capability
|
||||||
|
|
||||||
|
return snapshot;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Delete(PowerShellManager powerShell, VirtualMachineSnapshot snapshot, bool includeChilds)
|
||||||
|
{
|
||||||
|
Command cmd = new Command("Remove-VMSnapshot");
|
||||||
|
cmd.Parameters.Add("VMName", snapshot.VMName);
|
||||||
|
cmd.Parameters.Add("Name", snapshot.Name);
|
||||||
|
if (includeChilds) cmd.Parameters.Add("IncludeAllChildSnapshots", true);
|
||||||
|
|
||||||
|
powerShell.Execute(cmd, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -12,16 +12,8 @@ namespace WebsitePanel.Providers.Virtualization
|
||||||
{
|
{
|
||||||
public static class VirtualMachineHelper
|
public static class VirtualMachineHelper
|
||||||
{
|
{
|
||||||
#region Constants
|
|
||||||
|
|
||||||
private const Int64 Size1G = 0x40000000;
|
|
||||||
private const Int64 Size1M = 0x100000;
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
public static OperationalStatus GetVMHeartBeatStatus(PowerShellManager powerShell, string name)
|
public static OperationalStatus GetVMHeartBeatStatus(PowerShellManager powerShell, string name)
|
||||||
{
|
{
|
||||||
|
|
||||||
OperationalStatus status = OperationalStatus.None;
|
OperationalStatus status = OperationalStatus.None;
|
||||||
|
|
||||||
Command cmd = new Command("Get-VMIntegrationService");
|
Command cmd = new Command("Get-VMIntegrationService");
|
||||||
|
@ -40,7 +32,6 @@ namespace WebsitePanel.Providers.Virtualization
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static int GetVMProcessors(PowerShellManager powerShell, string name)
|
public static int GetVMProcessors(PowerShellManager powerShell, string name)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -71,105 +62,15 @@ namespace WebsitePanel.Providers.Virtualization
|
||||||
if (result != null && result.Count > 0)
|
if (result != null && result.Count > 0)
|
||||||
{
|
{
|
||||||
info.DynamicMemoryEnabled = Convert.ToBoolean(result[0].GetProperty("DynamicMemoryEnabled"));
|
info.DynamicMemoryEnabled = Convert.ToBoolean(result[0].GetProperty("DynamicMemoryEnabled"));
|
||||||
info.Startup = Convert.ToInt64(result[0].GetProperty("Startup"));
|
info.Startup = Convert.ToInt64(result[0].GetProperty("Startup")) / Constants.Size1M;
|
||||||
info.Minimum = Convert.ToInt64(result[0].GetProperty("Minimum"));
|
info.Minimum = Convert.ToInt64(result[0].GetProperty("Minimum")) / Constants.Size1M;
|
||||||
info.Maximum = Convert.ToInt64(result[0].GetProperty("Maximum"));
|
info.Maximum = Convert.ToInt64(result[0].GetProperty("Maximum")) / Constants.Size1M;
|
||||||
info.Buffer = Convert.ToInt32(result[0].GetProperty("Buffer"));
|
info.Buffer = Convert.ToInt32(result[0].GetProperty("Buffer"));
|
||||||
info.Priority = Convert.ToInt32(result[0].GetProperty("Priority"));
|
info.Priority = Convert.ToInt32(result[0].GetProperty("Priority"));
|
||||||
}
|
}
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static BiosInfo GetVMBios(PowerShellManager powerShell, string name)
|
|
||||||
{
|
|
||||||
BiosInfo info = new BiosInfo();
|
|
||||||
|
|
||||||
Command cmd = new Command("Get-VMBios");
|
|
||||||
|
|
||||||
cmd.Parameters.Add("VMName", name);
|
|
||||||
|
|
||||||
Collection<PSObject> result = powerShell.Execute(cmd, false);
|
|
||||||
if (result != null && result.Count > 0)
|
|
||||||
{
|
|
||||||
info.NumLockEnabled = Convert.ToBoolean(result[0].GetProperty("NumLockEnabled"));
|
|
||||||
|
|
||||||
List<string> startupOrders = new List<string>();
|
|
||||||
|
|
||||||
foreach (var item in (IEnumerable)result[0].GetProperty("StartupOrder"))
|
|
||||||
startupOrders.Add(item.ToString());
|
|
||||||
|
|
||||||
info.StartupOrder = startupOrders.ToArray();
|
|
||||||
}
|
|
||||||
return info;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static VirtualHardDiskInfo[] GetVirtualHardDisks(PowerShellManager powerShell, string name)
|
|
||||||
{
|
|
||||||
|
|
||||||
List<VirtualHardDiskInfo> disks = new List<VirtualHardDiskInfo>();
|
|
||||||
|
|
||||||
Command cmd = new Command("Get-VMHardDiskDrive");
|
|
||||||
cmd.Parameters.Add("VMName", name);
|
|
||||||
|
|
||||||
Collection<PSObject> result = powerShell.Execute(cmd, false);
|
|
||||||
if (result != null && result.Count > 0)
|
|
||||||
{
|
|
||||||
foreach (PSObject d in result)
|
|
||||||
{
|
|
||||||
VirtualHardDiskInfo disk = new VirtualHardDiskInfo();
|
|
||||||
|
|
||||||
disk.SupportPersistentReservations = Convert.ToBoolean(d.GetProperty("SupportPersistentReservations"));
|
|
||||||
disk.MaximumIOPS = Convert.ToUInt64(d.GetProperty("MaximumIOPS"));
|
|
||||||
disk.MinimumIOPS = Convert.ToUInt64(d.GetProperty("MinimumIOPS"));
|
|
||||||
disk.VHDControllerType = d.GetEnum<ControllerType>("ControllerType");
|
|
||||||
disk.ControllerNumber = Convert.ToInt32(d.GetProperty("ControllerNumber"));
|
|
||||||
disk.ControllerLocation = Convert.ToInt32(d.GetProperty("ControllerLocation"));
|
|
||||||
disk.Path = d.GetProperty("Path").ToString();
|
|
||||||
disk.Name = d.GetProperty("Name").ToString();
|
|
||||||
|
|
||||||
GetVirtualHardDiskDetail(powerShell, disk.Path, ref disk);
|
|
||||||
|
|
||||||
disks.Add(disk);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return disks.ToArray();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void GetVirtualHardDiskDetail(PowerShellManager powerShell, string path, ref VirtualHardDiskInfo disk)
|
|
||||||
{
|
|
||||||
if (!string.IsNullOrEmpty(path))
|
|
||||||
{
|
|
||||||
Command cmd = new Command("Get-VHD");
|
|
||||||
cmd.Parameters.Add("Path", path);
|
|
||||||
Collection<PSObject> result = powerShell.Execute(cmd, false);
|
|
||||||
if (result != null && result.Count > 0)
|
|
||||||
{
|
|
||||||
disk.DiskFormat = result[0].GetEnum<VirtualHardDiskFormat>("VhdFormat");
|
|
||||||
disk.DiskType = result[0].GetEnum<VirtualHardDiskType>("VhdType");
|
|
||||||
disk.ParentPath = result[0].GetProperty<string>("ParentPath");
|
|
||||||
disk.MaxInternalSize = Convert.ToInt64(result[0].GetProperty("Size")) / Size1G;
|
|
||||||
disk.FileSize = Convert.ToInt64(result[0].GetProperty("FileSize")) / Size1G;
|
|
||||||
disk.Attached = Convert.ToBoolean(result[0].GetProperty("Attached"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static void UpdateBios(PowerShellManager powerShell, VirtualMachine vm, bool bootFromCD, bool numLockEnabled)
|
|
||||||
{
|
|
||||||
Command cmd = new Command("Set-VMBios");
|
|
||||||
|
|
||||||
cmd.Parameters.Add("VMName", vm.Name);
|
|
||||||
cmd.Parameters.Add(numLockEnabled ? "EnableNumLock" : "DisableNumLock");
|
|
||||||
var bootOrder = bootFromCD
|
|
||||||
? new[] { "CD", "IDE", "LegacyNetworkAdapter", "Floppy" }
|
|
||||||
: new[] { "IDE", "CD", "LegacyNetworkAdapter", "Floppy" };
|
|
||||||
cmd.Parameters.Add("StartupOrder", bootOrder);
|
|
||||||
|
|
||||||
powerShell.Execute(cmd, false);
|
|
||||||
}
|
|
||||||
public static void UpdateProcessors(PowerShellManager powerShell, VirtualMachine vm, int cpuCores, int cpuLimitSettings, int cpuReserveSettings, int cpuWeightSettings)
|
public static void UpdateProcessors(PowerShellManager powerShell, VirtualMachine vm, int cpuCores, int cpuLimitSettings, int cpuReserveSettings, int cpuWeightSettings)
|
||||||
{
|
{
|
||||||
Command cmd = new Command("Set-VMProcessor");
|
Command cmd = new Command("Set-VMProcessor");
|
||||||
|
@ -182,12 +83,13 @@ namespace WebsitePanel.Providers.Virtualization
|
||||||
|
|
||||||
powerShell.Execute(cmd, false);
|
powerShell.Execute(cmd, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void UpdateMemory(PowerShellManager powerShell, VirtualMachine vm, long ramMB)
|
public static void UpdateMemory(PowerShellManager powerShell, VirtualMachine vm, long ramMB)
|
||||||
{
|
{
|
||||||
Command cmd = new Command("Set-VMMemory");
|
Command cmd = new Command("Set-VMMemory");
|
||||||
|
|
||||||
cmd.Parameters.Add("VMName", vm.Name);
|
cmd.Parameters.Add("VMName", vm.Name);
|
||||||
cmd.Parameters.Add("StartupBytes", ramMB);
|
cmd.Parameters.Add("StartupBytes", ramMB * Constants.Size1M);
|
||||||
|
|
||||||
powerShell.Execute(cmd, false);
|
powerShell.Execute(cmd, false);
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -17,7 +17,7 @@
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
<DebugType>full</DebugType>
|
<DebugType>full</DebugType>
|
||||||
<Optimize>false</Optimize>
|
<Optimize>false</Optimize>
|
||||||
<OutputPath>..\WebsitePanel.Server\bin\</OutputPath>
|
<OutputPath>..\WebsitePanel.Server\bin\HyperV2012R2\</OutputPath>
|
||||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
|
@ -53,9 +53,14 @@
|
||||||
<Compile Include="..\VersionInfo.cs">
|
<Compile Include="..\VersionInfo.cs">
|
||||||
<Link>VersionInfo.cs</Link>
|
<Link>VersionInfo.cs</Link>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Constants.cs" />
|
||||||
<Compile Include="Extensions\PSObjectExtension.cs" />
|
<Compile Include="Extensions\PSObjectExtension.cs" />
|
||||||
|
<Compile Include="Helpers\BiosHelper.cs" />
|
||||||
|
<Compile Include="Helpers\HardDriveHelper.cs" />
|
||||||
<Compile Include="Helpers\NetworkAdapterHelper.cs" />
|
<Compile Include="Helpers\NetworkAdapterHelper.cs" />
|
||||||
<Compile Include="Helpers\DvdDriveHelper.cs" />
|
<Compile Include="Helpers\DvdDriveHelper.cs" />
|
||||||
|
<Compile Include="Helpers\JobHelper.cs" />
|
||||||
|
<Compile Include="Helpers\SnapshotHelper.cs" />
|
||||||
<Compile Include="PowerShellManager.cs" />
|
<Compile Include="PowerShellManager.cs" />
|
||||||
<Compile Include="HyperV2012R2.cs" />
|
<Compile Include="HyperV2012R2.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
|
|
@ -115,7 +115,7 @@ namespace WebsitePanel.Providers.Virtualization
|
||||||
}
|
}
|
||||||
|
|
||||||
// Converts a given datetime in DMTF format to System.DateTime object.
|
// Converts a given datetime in DMTF format to System.DateTime object.
|
||||||
internal System.DateTime ToDateTime(string dmtfDate)
|
internal static System.DateTime ToDateTime(string dmtfDate)
|
||||||
{
|
{
|
||||||
System.DateTime initializer = System.DateTime.MinValue;
|
System.DateTime initializer = System.DateTime.MinValue;
|
||||||
int year = initializer.Year;
|
int year = initializer.Year;
|
||||||
|
|
|
@ -99,6 +99,8 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
|
||||||
|
|
||||||
private System.Threading.SendOrPostCallback InstallCertificateOperationCompleted;
|
private System.Threading.SendOrPostCallback InstallCertificateOperationCompleted;
|
||||||
|
|
||||||
|
private System.Threading.SendOrPostCallback MoveSessionHostToRdsOUOperationCompleted;
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public RemoteDesktopServices() {
|
public RemoteDesktopServices() {
|
||||||
this.Url = "http://localhost:9003/RemoteDesktopServices.asmx";
|
this.Url = "http://localhost:9003/RemoteDesktopServices.asmx";
|
||||||
|
@ -209,6 +211,9 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public event InstallCertificateCompletedEventHandler InstallCertificateCompleted;
|
public event InstallCertificateCompletedEventHandler InstallCertificateCompleted;
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public event MoveSessionHostToRdsOUCompletedEventHandler MoveSessionHostToRdsOUCompleted;
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
|
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
|
||||||
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateCollection", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateCollection", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
||||||
|
@ -1737,6 +1742,46 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
|
||||||
|
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/MoveSessionHostToRdsOU", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
|
||||||
|
public void MoveSessionHostToRdsOU(string hostName) {
|
||||||
|
this.Invoke("MoveSessionHostToRdsOU", new object[] {
|
||||||
|
hostName});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public System.IAsyncResult BeginMoveSessionHostToRdsOU(string hostName, System.AsyncCallback callback, object asyncState) {
|
||||||
|
return this.BeginInvoke("MoveSessionHostToRdsOU", new object[] {
|
||||||
|
hostName}, callback, asyncState);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public void EndMoveSessionHostToRdsOU(System.IAsyncResult asyncResult) {
|
||||||
|
this.EndInvoke(asyncResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public void MoveSessionHostToRdsOUAsync(string hostName) {
|
||||||
|
this.MoveSessionHostToRdsOUAsync(hostName, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
public void MoveSessionHostToRdsOUAsync(string hostName, object userState) {
|
||||||
|
if ((this.MoveSessionHostToRdsOUOperationCompleted == null)) {
|
||||||
|
this.MoveSessionHostToRdsOUOperationCompleted = new System.Threading.SendOrPostCallback(this.OnMoveSessionHostToRdsOUOperationCompleted);
|
||||||
|
}
|
||||||
|
this.InvokeAsync("MoveSessionHostToRdsOU", new object[] {
|
||||||
|
hostName}, this.MoveSessionHostToRdsOUOperationCompleted, userState);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnMoveSessionHostToRdsOUOperationCompleted(object arg) {
|
||||||
|
if ((this.MoveSessionHostToRdsOUCompleted != null)) {
|
||||||
|
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
|
||||||
|
this.MoveSessionHostToRdsOUCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
public new void CancelAsync(object userState) {
|
public new void CancelAsync(object userState) {
|
||||||
base.CancelAsync(userState);
|
base.CancelAsync(userState);
|
||||||
|
@ -2366,4 +2411,8 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
|
||||||
/// <remarks/>
|
/// <remarks/>
|
||||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||||
public delegate void InstallCertificateCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
|
public delegate void InstallCertificateCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
|
||||||
|
|
||||||
|
/// <remarks/>
|
||||||
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
|
||||||
|
public delegate void MoveSessionHostToRdsOUCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -646,5 +646,21 @@ namespace WebsitePanel.Server
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[WebMethod, SoapHeader("settings")]
|
||||||
|
public void MoveSessionHostToRdsOU(string hostName)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Log.WriteStart("'{0}' MoveSessionHostToRdsOU", ProviderSettings.ProviderName);
|
||||||
|
RDSProvider.MoveSessionHostToRdsOU(hostName);
|
||||||
|
Log.WriteEnd("'{0}' MoveSessionHostToRdsOU", ProviderSettings.ProviderName);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
Log.WriteError(String.Format("'{0}' MoveSessionHostToRdsOU", ProviderSettings.ProviderName), ex);
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<!-- Custom configuration sections -->
|
<!-- Custom configuration sections -->
|
||||||
<configSections>
|
<configSections>
|
||||||
|
@ -162,7 +162,7 @@
|
||||||
</dependentAssembly>
|
</dependentAssembly>
|
||||||
</assemblyBinding>
|
</assemblyBinding>
|
||||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
<probing privatePath="bin/Crm2011;bin/Crm2013;bin/Exchange2013;bin/Sharepoint2013;bin/Lync2013;bin/Lync2013HP;bin/Dns2012;bin/IceWarp;bin/IIs80"/>
|
<probing privatePath="bin/Crm2011;bin/Crm2013;bin/Exchange2013;bin/Sharepoint2013;bin/Lync2013;bin/Lync2013HP;bin/Dns2012;bin/IceWarp;bin/IIs80;bin/HyperV2012R2" />
|
||||||
</assemblyBinding>
|
</assemblyBinding>
|
||||||
</runtime>
|
</runtime>
|
||||||
</configuration>
|
</configuration>
|
|
@ -13,12 +13,14 @@ namespace WebsitePanel.WebDav.Core.Config.Entities
|
||||||
{
|
{
|
||||||
IsEnabled = ConfigSection.OfficeOnline.IsEnabled;
|
IsEnabled = ConfigSection.OfficeOnline.IsEnabled;
|
||||||
Url = ConfigSection.OfficeOnline.Url;
|
Url = ConfigSection.OfficeOnline.Url;
|
||||||
|
NewFilePath = ConfigSection.OfficeOnline.CobaltNewFilePath;
|
||||||
CobaltFileTtl = ConfigSection.OfficeOnline.CobaltFileTtl;
|
CobaltFileTtl = ConfigSection.OfficeOnline.CobaltFileTtl;
|
||||||
_officeExtensions = ConfigSection.OfficeOnline.Cast<OfficeOnlineElement>().ToList();
|
_officeExtensions = ConfigSection.OfficeOnline.Cast<OfficeOnlineElement>().ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsEnabled { get; private set; }
|
public bool IsEnabled { get; private set; }
|
||||||
public string Url { get; private set; }
|
public string Url { get; private set; }
|
||||||
|
public string NewFilePath { get; private set; }
|
||||||
public int CobaltFileTtl { get; private set; }
|
public int CobaltFileTtl { get; private set; }
|
||||||
|
|
||||||
public IEnumerator<OfficeOnlineElement> GetEnumerator()
|
public IEnumerator<OfficeOnlineElement> GetEnumerator()
|
||||||
|
|
|
@ -8,6 +8,7 @@ namespace WebsitePanel.WebDavPortal.WebConfigSections
|
||||||
private const string OwaViewKey = "OwaView";
|
private const string OwaViewKey = "OwaView";
|
||||||
private const string OwaEditorKey = "OwaEditor";
|
private const string OwaEditorKey = "OwaEditor";
|
||||||
private const string OwaMobileViewKey = "OwaMobileView";
|
private const string OwaMobileViewKey = "OwaMobileView";
|
||||||
|
private const string OwaNewFileViewKey = "OwaNewFileView";
|
||||||
|
|
||||||
[ConfigurationProperty(ExtensionKey, IsKey = true, IsRequired = true)]
|
[ConfigurationProperty(ExtensionKey, IsKey = true, IsRequired = true)]
|
||||||
public string Extension
|
public string Extension
|
||||||
|
@ -37,5 +38,12 @@ namespace WebsitePanel.WebDavPortal.WebConfigSections
|
||||||
get { return this[OwaMobileViewKey].ToString(); }
|
get { return this[OwaMobileViewKey].ToString(); }
|
||||||
set { this[OwaMobileViewKey] = value; }
|
set { this[OwaMobileViewKey] = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[ConfigurationProperty(OwaNewFileViewKey, IsKey = true, IsRequired = true)]
|
||||||
|
public string OwaNewFileView
|
||||||
|
{
|
||||||
|
get { return this[OwaNewFileViewKey].ToString(); }
|
||||||
|
set { this[OwaNewFileViewKey] = value; }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -9,6 +9,7 @@ namespace WebsitePanel.WebDavPortal.WebConfigSections
|
||||||
private const string UrlKey = "url";
|
private const string UrlKey = "url";
|
||||||
private const string IsEnabledKey = "isEnabled";
|
private const string IsEnabledKey = "isEnabled";
|
||||||
private const string CobaltFileTtlKey = "cobaltFileTtl";
|
private const string CobaltFileTtlKey = "cobaltFileTtl";
|
||||||
|
private const string CobaltNewFilePathKey = "cobaltNewFilePath";
|
||||||
|
|
||||||
[ConfigurationProperty(UrlKey, IsKey = true, IsRequired = true)]
|
[ConfigurationProperty(UrlKey, IsKey = true, IsRequired = true)]
|
||||||
public string Url
|
public string Url
|
||||||
|
@ -24,6 +25,13 @@ namespace WebsitePanel.WebDavPortal.WebConfigSections
|
||||||
set { this[IsEnabledKey] = value; }
|
set { this[IsEnabledKey] = value; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[ConfigurationProperty(CobaltNewFilePathKey, IsKey = true, IsRequired = true)]
|
||||||
|
public string CobaltNewFilePath
|
||||||
|
{
|
||||||
|
get { return this[CobaltNewFilePathKey].ToString(); }
|
||||||
|
set { this[CobaltNewFilePathKey] = value; }
|
||||||
|
}
|
||||||
|
|
||||||
[ConfigurationProperty(CobaltFileTtlKey, IsKey = true, IsRequired = true)]
|
[ConfigurationProperty(CobaltFileTtlKey, IsKey = true, IsRequired = true)]
|
||||||
public int CobaltFileTtl
|
public int CobaltFileTtl
|
||||||
{
|
{
|
||||||
|
|
|
@ -37,6 +37,10 @@ namespace WebsitePanel.WebDav.Core.Entities.Owa
|
||||||
public bool RestrictedWebViewOnly { get; set; }
|
public bool RestrictedWebViewOnly { get; set; }
|
||||||
[DataMember]
|
[DataMember]
|
||||||
public string ClientUrl { get; set; }
|
public string ClientUrl { get; set; }
|
||||||
|
[DataMember]
|
||||||
|
public bool CloseButtonClosesWindow { get; set; }
|
||||||
|
//[DataMember]
|
||||||
|
//public string CloseUrl { get; set; }
|
||||||
//[DataMember]
|
//[DataMember]
|
||||||
//public bool UserCanNotWriteRelative { get; set; }
|
//public bool UserCanNotWriteRelative { get; set; }
|
||||||
|
|
||||||
|
@ -59,8 +63,7 @@ namespace WebsitePanel.WebDav.Core.Entities.Owa
|
||||||
//public string BreadcrumbFolderUrl { get; set; }
|
//public string BreadcrumbFolderUrl { get; set; }
|
||||||
//[DataMember]
|
//[DataMember]
|
||||||
//public string ClientUrl { get; set; }
|
//public string ClientUrl { get; set; }
|
||||||
//[DataMember]
|
|
||||||
//public bool CloseButtonClosesWindow { get; set; }
|
|
||||||
//[DataMember]
|
//[DataMember]
|
||||||
//public string CloseUrl { get; set; }
|
//public string CloseUrl { get; set; }
|
||||||
//[DataMember]
|
//[DataMember]
|
||||||
|
|
|
@ -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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -148,7 +148,7 @@ namespace WebsitePanel.WebDav.Core
|
||||||
public IResource GetResource(string name)
|
public IResource GetResource(string name)
|
||||||
{
|
{
|
||||||
IHierarchyItem item =
|
IHierarchyItem item =
|
||||||
_children.Single(i => i.DisplayName.Trim('/') == name.Trim('/'));
|
_children.Single(i => i.DisplayName.ToLowerInvariant().Trim('/') == name.ToLowerInvariant().Trim('/'));
|
||||||
var resource = new WebDavResource();
|
var resource = new WebDavResource();
|
||||||
resource.SetCredentials(_credentials);
|
resource.SetCredentials(_credentials);
|
||||||
resource.SetHierarchyItem(item);
|
resource.SetHierarchyItem(item);
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using System.Web.Mvc;
|
using WebsitePanel.EnterpriseServer.Base.HostedSolution;
|
||||||
using WebsitePanel.WebDav.Core.Client;
|
using WebsitePanel.WebDav.Core.Client;
|
||||||
using WebsitePanel.WebDav.Core.Entities.Owa;
|
using WebsitePanel.WebDav.Core.Entities.Owa;
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ namespace WebsitePanel.WebDav.Core.Interfaces.Owa
|
||||||
{
|
{
|
||||||
public interface IWopiServer
|
public interface IWopiServer
|
||||||
{
|
{
|
||||||
CheckFileInfo GetCheckFileInfo(string path);
|
CheckFileInfo GetCheckFileInfo(WebDavAccessToken token);
|
||||||
FileResult GetFile(string path);
|
byte[] GetFileBytes(int accessTokenId);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
@ -240,9 +240,9 @@ namespace WebsitePanel.WebDav.Core.Managers
|
||||||
|
|
||||||
return _currentFolder.GetResource(resourceName);
|
return _currentFolder.GetResource(resourceName);
|
||||||
}
|
}
|
||||||
catch (InvalidOperationException exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
throw new ResourceNotFoundException("Resource not found", exception);
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,10 @@
|
||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Runtime.Caching;
|
using System.Runtime.Caching;
|
||||||
|
using System.Web;
|
||||||
using Cobalt;
|
using Cobalt;
|
||||||
using WebsitePanel.WebDav.Core.Client;
|
using WebsitePanel.WebDav.Core.Client;
|
||||||
using WebsitePanel.WebDav.Core.Config;
|
using WebsitePanel.WebDav.Core.Config;
|
||||||
|
@ -72,9 +74,20 @@ namespace WebsitePanel.WebDav.Core.Owa
|
||||||
|
|
||||||
var token = _tokenManager.GetToken(accessTokenId);
|
var token = _tokenManager.GetToken(accessTokenId);
|
||||||
|
|
||||||
|
Atom atom;
|
||||||
|
|
||||||
|
if (_webDavManager.FileExist(token.FilePath))
|
||||||
|
{
|
||||||
var fileBytes = _webDavManager.GetFileBytes(token.FilePath);
|
var fileBytes = _webDavManager.GetFileBytes(token.FilePath);
|
||||||
|
|
||||||
var atom = new AtomFromByteArray(fileBytes);
|
atom = new AtomFromByteArray(fileBytes);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var filePath = HttpContext.Current.Server.MapPath(WebDavAppConfigManager.Instance.OfficeOnline.NewFilePath + Path.GetExtension(token.FilePath));
|
||||||
|
|
||||||
|
atom = new AtomFromByteArray(File.ReadAllBytes(filePath));
|
||||||
|
}
|
||||||
|
|
||||||
Cobalt.Metrics o1;
|
Cobalt.Metrics o1;
|
||||||
cobaltFile.GetCobaltFilePartition(FilePartitionId.Content).SetStream(RootId.Default.Value, atom, out o1);
|
cobaltFile.GetCobaltFilePartition(FilePartitionId.Content).SetStream(RootId.Default.Value, atom, out o1);
|
||||||
|
|
|
@ -6,6 +6,8 @@ using System.Runtime.Serialization.Json;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
|
using Cobalt;
|
||||||
|
using WebsitePanel.EnterpriseServer.Base.HostedSolution;
|
||||||
using WebsitePanel.WebDav.Core.Client;
|
using WebsitePanel.WebDav.Core.Client;
|
||||||
using WebsitePanel.WebDav.Core.Config;
|
using WebsitePanel.WebDav.Core.Config;
|
||||||
using WebsitePanel.WebDav.Core.Entities.Owa;
|
using WebsitePanel.WebDav.Core.Entities.Owa;
|
||||||
|
@ -22,27 +24,30 @@ namespace WebsitePanel.WebDav.Core.Owa
|
||||||
private readonly IWebDavManager _webDavManager;
|
private readonly IWebDavManager _webDavManager;
|
||||||
private readonly IAccessTokenManager _tokenManager;
|
private readonly IAccessTokenManager _tokenManager;
|
||||||
private readonly IWebDavAuthorizationService _webDavAuthorizationService;
|
private readonly IWebDavAuthorizationService _webDavAuthorizationService;
|
||||||
|
private readonly IWopiFileManager _fileManager;
|
||||||
|
|
||||||
public WopiServer(IWebDavManager webDavManager, IAccessTokenManager tokenManager, IWebDavAuthorizationService webDavAuthorizationService)
|
|
||||||
|
public WopiServer(IWebDavManager webDavManager, IAccessTokenManager tokenManager, IWebDavAuthorizationService webDavAuthorizationService, IWopiFileManager fileManager)
|
||||||
{
|
{
|
||||||
_webDavManager = webDavManager;
|
_webDavManager = webDavManager;
|
||||||
_tokenManager = tokenManager;
|
_tokenManager = tokenManager;
|
||||||
_webDavAuthorizationService = webDavAuthorizationService;
|
_webDavAuthorizationService = webDavAuthorizationService;
|
||||||
|
_fileManager = fileManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CheckFileInfo GetCheckFileInfo(string path)
|
public CheckFileInfo GetCheckFileInfo(WebDavAccessToken token)
|
||||||
{
|
{
|
||||||
var resource = _webDavManager.GetResource(path);
|
var resource = _webDavManager.GetResource(token.FilePath);
|
||||||
|
|
||||||
var permissions = _webDavAuthorizationService.GetPermissions(WspContext.User, path);
|
var permissions = _webDavAuthorizationService.GetPermissions(WspContext.User, token.FilePath);
|
||||||
|
|
||||||
var readOnly = permissions.HasFlag(WebDavPermissions.Write) == false || permissions.HasFlag(WebDavPermissions.OwaEdit) == false;
|
var readOnly = permissions.HasFlag(WebDavPermissions.Write) == false || permissions.HasFlag(WebDavPermissions.OwaEdit) == false;
|
||||||
|
|
||||||
var cFileInfo = new CheckFileInfo
|
var cFileInfo = new CheckFileInfo
|
||||||
{
|
{
|
||||||
BaseFileName = resource.DisplayName.Split(new []{'/'},StringSplitOptions.RemoveEmptyEntries).LastOrDefault(),
|
BaseFileName = resource == null ? token.FilePath.Split('/').Last() : resource.DisplayName.Split(new[] { '/' }, StringSplitOptions.RemoveEmptyEntries).LastOrDefault(),
|
||||||
OwnerId = WspContext.User.Login,
|
OwnerId = WspContext.User.Login,
|
||||||
Size = resource.ContentLength,
|
Size = resource == null ? 0 : resource.ContentLength,
|
||||||
Version = DateTime.Now.ToString("s"),
|
Version = DateTime.Now.ToString("s"),
|
||||||
SupportsCoauth = true,
|
SupportsCoauth = true,
|
||||||
SupportsCobalt = true,
|
SupportsCobalt = true,
|
||||||
|
@ -53,17 +58,34 @@ namespace WebsitePanel.WebDav.Core.Owa
|
||||||
SupportsUpdate = true,
|
SupportsUpdate = true,
|
||||||
UserCanWrite = !readOnly,
|
UserCanWrite = !readOnly,
|
||||||
ReadOnly = readOnly,
|
ReadOnly = readOnly,
|
||||||
RestrictedWebViewOnly = false
|
RestrictedWebViewOnly = false,
|
||||||
|
CloseButtonClosesWindow = true
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (resource != null)
|
||||||
|
{
|
||||||
|
cFileInfo.ClientUrl = _webDavManager.GetFileUrl(token.FilePath);
|
||||||
|
}
|
||||||
|
|
||||||
return cFileInfo;
|
return cFileInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public FileResult GetFile(string path)
|
public byte[] GetFileBytes(int accessTokenId)
|
||||||
{
|
{
|
||||||
var fileBytes = _webDavManager.GetFileBytes(path);
|
var token = _tokenManager.GetToken(accessTokenId);
|
||||||
|
|
||||||
return new FileContentResult(fileBytes, MediaTypeNames.Application.Octet);
|
if (_webDavManager.FileExist(token.FilePath))
|
||||||
|
{
|
||||||
|
return _webDavManager.GetFileBytes(token.FilePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
var cobaltFile = _fileManager.Get(token.FilePath) ?? _fileManager.Create(accessTokenId);
|
||||||
|
|
||||||
|
var stream = new MemoryStream();
|
||||||
|
|
||||||
|
new GenericFda(cobaltFile.CobaltEndpoint, null).GetContentStream().CopyTo(stream);
|
||||||
|
|
||||||
|
return stream.ToArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -35,6 +35,10 @@ namespace WebsitePanel.WebDavPortal
|
||||||
"~/Scripts/appScripts/wsp.js"
|
"~/Scripts/appScripts/wsp.js"
|
||||||
));
|
));
|
||||||
|
|
||||||
|
bundles.Add(new ScriptBundle("~/bundles/appScripts-webdav").Include(
|
||||||
|
"~/Scripts/appScripts/wsp-webdav.js"
|
||||||
|
));
|
||||||
|
|
||||||
bundles.Add(new ScriptBundle("~/bundles/bigIconsScripts").Include(
|
bundles.Add(new ScriptBundle("~/bundles/bigIconsScripts").Include(
|
||||||
"~/Scripts/appScripts/recalculateResourseHeight.js"
|
"~/Scripts/appScripts/recalculateResourseHeight.js"
|
||||||
));
|
));
|
||||||
|
|
|
@ -46,6 +46,20 @@ namespace WebsitePanel.WebDavPortal
|
||||||
|
|
||||||
#region Enterprise storage
|
#region Enterprise storage
|
||||||
|
|
||||||
|
routes.MapRoute(
|
||||||
|
name: FileSystemRouteNames.ItemExist,
|
||||||
|
url: "storage/item-exist/{org}/{*pathPart}",
|
||||||
|
defaults:
|
||||||
|
new { controller = "FileSystem", action = "ItemExist", pathPart = UrlParameter.Optional }
|
||||||
|
);
|
||||||
|
|
||||||
|
routes.MapRoute(
|
||||||
|
name: FileSystemRouteNames.NewWebDavItem,
|
||||||
|
url: "storage/new/{org}/{*pathPart}",
|
||||||
|
defaults:
|
||||||
|
new { controller = "FileSystem", action = "NewWebDavItem", pathPart = UrlParameter.Optional }
|
||||||
|
);
|
||||||
|
|
||||||
routes.MapRoute(
|
routes.MapRoute(
|
||||||
name: FileSystemRouteNames.SearchFiles,
|
name: FileSystemRouteNames.SearchFiles,
|
||||||
url: "storage/search/{org}/{*pathPart}",
|
url: "storage/search/{org}/{*pathPart}",
|
||||||
|
|
|
@ -12,6 +12,9 @@ namespace WebsitePanel.WebDavPortal.UI.Routes
|
||||||
public const string ShowContentDetails = "ShowContentDetailsRoute";
|
public const string ShowContentDetails = "ShowContentDetailsRoute";
|
||||||
public const string ShowOfficeOnlinePath_ = "ShowOfficeOnlineRoute";
|
public const string ShowOfficeOnlinePath_ = "ShowOfficeOnlineRoute";
|
||||||
public const string ViewOfficeOnline = "ViewOfficeOnlineRoute";
|
public const string ViewOfficeOnline = "ViewOfficeOnlineRoute";
|
||||||
|
public const string NewFileOfficeOnline = "NewFileOfficeOnlineRoute";
|
||||||
|
public const string NewWebDavItem = "NewWebDavItemRoute";
|
||||||
|
public const string ItemExist = "ItemExistRoute";
|
||||||
public const string EditOfficeOnline = "EditOfficeOnlineRoute";
|
public const string EditOfficeOnline = "EditOfficeOnlineRoute";
|
||||||
|
|
||||||
public const string ShowAdditionalContent = "ShowAdditionalContentRoute";
|
public const string ShowAdditionalContent = "ShowAdditionalContentRoute";
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
namespace WebsitePanel.WebDavPortal.Constants
|
||||||
|
{
|
||||||
|
public class Formtas
|
||||||
|
{
|
||||||
|
public const string DateFormatWithTime = "MM/dd/yyyy hh:mm tt";
|
||||||
|
}
|
||||||
|
}
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -102,6 +102,7 @@ tr.selected-file {
|
||||||
#summary.summary {
|
#summary.summary {
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
color: rgb(152, 152, 152);
|
color: rgb(152, 152, 152);
|
||||||
|
word-wrap: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
.drag-and-drop-area input {
|
.drag-and-drop-area input {
|
||||||
|
@ -251,17 +252,22 @@ tr.selected-file {
|
||||||
|
|
||||||
.file-actions-menu .file-deletion {
|
.file-actions-menu .file-deletion {
|
||||||
display: none;
|
display: none;
|
||||||
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.file-actions-menu .file-upload {
|
.file-actions-menu .file-upload {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.create-new-item {
|
||||||
|
margin-top: -2px;
|
||||||
|
}
|
||||||
|
|
||||||
#message-area {
|
#message-area {
|
||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#processDialog .dialog-text {
|
#processDialog .dialog-text, .container .dialog-text{
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
}
|
}
|
||||||
|
@ -270,6 +276,18 @@ tr.selected-file {
|
||||||
width: 200px;
|
width: 200px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.dataTables_processing {
|
||||||
|
width: 185px !important;
|
||||||
|
margin: 0 !important;
|
||||||
|
padding: 0 !important;
|
||||||
|
left: 43% !important;
|
||||||
|
background: initial !important;
|
||||||
|
background-color: #FFFFFF !important;
|
||||||
|
border: 1px solid #CDCDCD;
|
||||||
|
height: 44px !important;
|
||||||
|
z-index: 30;
|
||||||
|
}
|
||||||
|
|
||||||
.breadcrumb-wsp {
|
.breadcrumb-wsp {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
padding-top: 5px;
|
padding-top: 5px;
|
||||||
|
@ -336,6 +354,15 @@ tr.selected-file {
|
||||||
top: 20%;
|
top: 20%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.small-processing {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
#filenameForm input {
|
||||||
|
max-width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
/* Theme Mods */
|
/* Theme Mods */
|
||||||
|
|
||||||
input,div{border-radius:0px!important;}
|
input,div{border-radius:0px!important;}
|
||||||
|
|
|
@ -54,22 +54,24 @@ namespace WebsitePanel.WebDavPortal.Controllers.Api
|
||||||
{
|
{
|
||||||
var token = _tokenManager.GetToken(accessTokenId);
|
var token = _tokenManager.GetToken(accessTokenId);
|
||||||
|
|
||||||
var fileInfo = _wopiServer.GetCheckFileInfo(token.FilePath);
|
var fileInfo = _wopiServer.GetCheckFileInfo(token);
|
||||||
|
|
||||||
|
if (fileInfo.Size <= 1)
|
||||||
|
{
|
||||||
|
return fileInfo;
|
||||||
|
}
|
||||||
|
|
||||||
var urlPart = Url.Route(FileSystemRouteNames.ShowContentPath, new {org = WspContext.User.OrganizationId, pathPart = token.FilePath});
|
var urlPart = Url.Route(FileSystemRouteNames.ShowContentPath, new {org = WspContext.User.OrganizationId, pathPart = token.FilePath});
|
||||||
var url = new Uri(Request.RequestUri, urlPart).ToString();
|
var url = new Uri(Request.RequestUri, urlPart).ToString();
|
||||||
|
|
||||||
fileInfo.DownloadUrl = url;
|
fileInfo.DownloadUrl = url;
|
||||||
fileInfo.ClientUrl = _webDavManager.GetFileUrl(token.FilePath);
|
|
||||||
|
|
||||||
return fileInfo;
|
return fileInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
public HttpResponseMessage GetFile(int accessTokenId)
|
public HttpResponseMessage GetFile(int accessTokenId)
|
||||||
{
|
{
|
||||||
var token = _tokenManager.GetToken(accessTokenId);
|
var bytes = _wopiServer.GetFileBytes(accessTokenId);
|
||||||
|
|
||||||
var bytes = _webDavManager.GetFileBytes(token.FilePath);
|
|
||||||
|
|
||||||
var result = new HttpResponseMessage(HttpStatusCode.OK);
|
var result = new HttpResponseMessage(HttpStatusCode.OK);
|
||||||
|
|
||||||
|
|
|
@ -303,6 +303,36 @@ namespace WebsitePanel.WebDavPortal.Controllers
|
||||||
return Json(model);
|
return Json(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ActionResult NewWebDavItem(string org, string pathPart)
|
||||||
|
{
|
||||||
|
var permissions = _webDavAuthorizationService.GetPermissions(WspContext.User, pathPart);
|
||||||
|
|
||||||
|
var owaOpener = WebDavAppConfigManager.Instance.OfficeOnline.FirstOrDefault(x => x.Extension == Path.GetExtension(pathPart));
|
||||||
|
|
||||||
|
if (permissions.HasFlag(WebDavPermissions.Write) == false || (owaOpener != null && permissions.HasFlag(WebDavPermissions.OwaEdit) == false))
|
||||||
|
{
|
||||||
|
return new RedirectToRouteResult(FileSystemRouteNames.ShowContentPath, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (owaOpener != null)
|
||||||
|
{
|
||||||
|
return ShowOfficeDocument(org, pathPart, owaOpener.OwaNewFileView);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new RedirectToRouteResult(FileSystemRouteNames.ShowContentPath, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPost]
|
||||||
|
public JsonResult ItemExist(string org, string pathPart, string newItemName)
|
||||||
|
{
|
||||||
|
var exist = _webdavManager.FileExist(string.Format("{0}/{1}", pathPart.TrimEnd('/'), newItemName.Trim('/')));
|
||||||
|
|
||||||
|
return new JsonResult()
|
||||||
|
{
|
||||||
|
Data = !exist
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
#region Owa Actions
|
#region Owa Actions
|
||||||
|
|
||||||
public ActionResult ShowOfficeDocument(string org, string pathPart, string owaOpenerUri)
|
public ActionResult ShowOfficeDocument(string org, string pathPart, string owaOpenerUri)
|
||||||
|
@ -345,6 +375,7 @@ namespace WebsitePanel.WebDavPortal.Controllers
|
||||||
|
|
||||||
return ShowOfficeDocument(org, pathPart, owaOpener.OwaEditor);
|
return ShowOfficeDocument(org, pathPart, owaOpener.OwaEditor);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
private void FillContentModel(IEnumerable<ResourceTableItemModel> items, string organizationId)
|
private void FillContentModel(IEnumerable<ResourceTableItemModel> items, string organizationId)
|
||||||
|
@ -352,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]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -7,6 +7,7 @@ using AutoMapper;
|
||||||
using WebsitePanel.WebDav.Core.Client;
|
using WebsitePanel.WebDav.Core.Client;
|
||||||
using WebsitePanel.WebDav.Core.Config;
|
using WebsitePanel.WebDav.Core.Config;
|
||||||
using WebsitePanel.WebDav.Core.Extensions;
|
using WebsitePanel.WebDav.Core.Extensions;
|
||||||
|
using WebsitePanel.WebDavPortal.Constants;
|
||||||
using WebsitePanel.WebDavPortal.FileOperations;
|
using WebsitePanel.WebDavPortal.FileOperations;
|
||||||
using WebsitePanel.WebDavPortal.Models.FileSystem;
|
using WebsitePanel.WebDavPortal.Models.FileSystem;
|
||||||
|
|
||||||
|
@ -43,7 +44,7 @@ namespace WebsitePanel.WebDavPortal.Mapping.Profiles.Webdav
|
||||||
.ForMember(ti => ti.IconHref, x => x.MapFrom(hi => hi.ItemType == ItemType.Folder ? WebDavAppConfigManager.Instance.FileIcons.FolderPath.Trim('~') : WebDavAppConfigManager.Instance.FileIcons[Path.GetExtension(hi.DisplayName.Trim('/'))].Trim('~')))
|
.ForMember(ti => ti.IconHref, x => x.MapFrom(hi => hi.ItemType == ItemType.Folder ? WebDavAppConfigManager.Instance.FileIcons.FolderPath.Trim('~') : WebDavAppConfigManager.Instance.FileIcons[Path.GetExtension(hi.DisplayName.Trim('/'))].Trim('~')))
|
||||||
.ForMember(ti => ti.IsTargetBlank, x => x.MapFrom(hi => openerManager.GetIsTargetBlank(hi)))
|
.ForMember(ti => ti.IsTargetBlank, x => x.MapFrom(hi => openerManager.GetIsTargetBlank(hi)))
|
||||||
.ForMember(ti => ti.LastModified, x => x.MapFrom(hi => hi.LastModified))
|
.ForMember(ti => ti.LastModified, x => x.MapFrom(hi => hi.LastModified))
|
||||||
.ForMember(ti => ti.LastModifiedFormated, x => x.MapFrom(hi => hi.LastModified == DateTime.MinValue ? "--" : (new WebDavResource(null, hi)).LastModified.ToString("dd/MM/yyyy hh:mm tt")))
|
.ForMember(ti => ti.LastModifiedFormated, x => x.MapFrom(hi => hi.LastModified == DateTime.MinValue ? "--" : (new WebDavResource(null, hi)).LastModified.ToString(Formtas.DateFormatWithTime)))
|
||||||
|
|
||||||
.ForMember(ti => ti.Summary, x => x.MapFrom(hi => hi.Summary))
|
.ForMember(ti => ti.Summary, x => x.MapFrom(hi => hi.Summary))
|
||||||
.ForMember(ti => ti.IsRoot, x => x.MapFrom(hi => hi.IsRootItem))
|
.ForMember(ti => ti.IsRoot, x => x.MapFrom(hi => hi.IsRootItem))
|
||||||
|
|
|
@ -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,6 +123,15 @@ 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>
|
||||||
|
@ -141,6 +168,15 @@ namespace WebsitePanel.WebDavPortal.Resources {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Please 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>
|
||||||
|
@ -150,6 +186,24 @@ namespace WebsitePanel.WebDavPortal.Resources {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to EB.
|
||||||
|
/// </summary>
|
||||||
|
public static string ExabyteShort {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("ExabyteShort", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized string similar to Excel workbook.
|
||||||
|
/// </summary>
|
||||||
|
public static string ExcelWorkbook {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("ExcelWorkbook", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to File.
|
/// Looks up a localized string similar to File.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -159,6 +213,15 @@ 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>
|
/// <summary>
|
||||||
/// Looks up a localized string similar to File Upload.
|
/// Looks up a localized string similar to File Upload.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -186,6 +249,15 @@ 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>
|
||||||
|
@ -195,6 +267,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>
|
||||||
|
@ -240,6 +330,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>
|
||||||
|
@ -249,6 +348,15 @@ 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>
|
||||||
|
@ -321,6 +429,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>
|
||||||
|
@ -339,6 +456,15 @@ 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,6 +138,9 @@
|
||||||
<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>
|
||||||
|
@ -144,12 +153,24 @@
|
||||||
<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>Please 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="ExabyteShort" xml:space="preserve">
|
||||||
|
<value>EB</value>
|
||||||
|
</data>
|
||||||
|
<data name="ExcelWorkbook" xml:space="preserve">
|
||||||
|
<value>Excel workbook</value>
|
||||||
|
</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="FileUpload" xml:space="preserve">
|
<data name="FileUpload" xml:space="preserve">
|
||||||
<value>File Upload</value>
|
<value>File Upload</value>
|
||||||
</data>
|
</data>
|
||||||
|
@ -159,9 +180,18 @@
|
||||||
<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>
|
||||||
|
@ -177,9 +207,15 @@
|
||||||
<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>
|
||||||
|
@ -204,12 +240,18 @@
|
||||||
<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>
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
function WspDialogs() {
|
function WspDialogs() {
|
||||||
this.settings = { dialogId: "#confirm-dialog", processDialogId: "#processDialog" };
|
this.settings = {
|
||||||
|
dialogId: "#confirm-dialog",
|
||||||
|
processDialogId: "#processDialog",
|
||||||
|
inlineProcessDialog: '.glyphicon-refresh'
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
WspDialogs.prototype =
|
WspDialogs.prototype =
|
||||||
|
@ -36,6 +40,14 @@ WspDialogs.prototype =
|
||||||
|
|
||||||
hideProcessDialog: function() {
|
hideProcessDialog: function() {
|
||||||
$(this.settings.processDialogId).modal('hide');
|
$(this.settings.processDialogId).modal('hide');
|
||||||
|
},
|
||||||
|
|
||||||
|
showInlineProcessing: function(itemId) {
|
||||||
|
$(itemId).parent().find(this.settings.inlineProcessDialog).show();
|
||||||
|
},
|
||||||
|
|
||||||
|
hideInlineProcessing: function (itemId) {
|
||||||
|
$(itemId).parent().find(this.settings.inlineProcessDialog).hide();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,17 @@
|
||||||
this.settings = {
|
this.settings = {
|
||||||
deletionBlockSelector: ".file-actions-menu .file-deletion",
|
deletionBlockSelector: ".file-actions-menu .file-deletion",
|
||||||
deletionUrl: "storage/files-group-action/delete",
|
deletionUrl: "storage/files-group-action/delete",
|
||||||
|
fileExistUrl: "storage/fileExist",
|
||||||
textDateModified: "Date modified",
|
textDateModified: "Date modified",
|
||||||
textSize: "Size"
|
textSize: "Size",
|
||||||
|
textItemExist: "File already exists",
|
||||||
|
textItemExistFunc: function() {
|
||||||
|
return textItemExist;
|
||||||
|
} ,
|
||||||
|
createNewItemDialogId: "#createNewItemDialog",
|
||||||
|
createNewItemButtonId: "#create-button",
|
||||||
|
createNewItemTitleId: '#create-dalog-label',
|
||||||
|
processingDialogDom: '<div><img src="/Content/Images/indicator_medium.gif"><h4 class="dialog-text">Please wait...</h4></div>'
|
||||||
};
|
};
|
||||||
this.itemsTable = null;
|
this.itemsTable = null;
|
||||||
this.searchTable = null;
|
this.searchTable = null;
|
||||||
|
@ -88,7 +97,7 @@ WspFileBrowser.prototype = {
|
||||||
initDataTable: function (tableId, ajaxUrl) {
|
initDataTable: function (tableId, ajaxUrl) {
|
||||||
this.itemsTable = $(tableId).dataTable({
|
this.itemsTable = $(tableId).dataTable({
|
||||||
"ajax": ajaxUrl,
|
"ajax": ajaxUrl,
|
||||||
"processing": false,
|
"processing": true,
|
||||||
"serverSide": true,
|
"serverSide": true,
|
||||||
"dom": 'rtlp',
|
"dom": 'rtlp',
|
||||||
"columnDefs": [
|
"columnDefs": [
|
||||||
|
@ -123,14 +132,8 @@ WspFileBrowser.prototype = {
|
||||||
"createdRow": function(row, data, index) {
|
"createdRow": function(row, data, index) {
|
||||||
$(row).addClass('element-container');
|
$(row).addClass('element-container');
|
||||||
},
|
},
|
||||||
"fnPreDrawCallback": function () {
|
"oLanguage": {
|
||||||
// gather info to compose a message
|
"sProcessing": this.settings.processingDialogDom
|
||||||
wsp.dialogs.showProcessDialog();
|
|
||||||
return true;
|
|
||||||
},
|
|
||||||
"fnDrawCallback": function () {
|
|
||||||
// in case your overlay needs to be put away automatically you can put it here
|
|
||||||
wsp.dialogs.hideProcessDialog();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -162,7 +165,7 @@ WspFileBrowser.prototype = {
|
||||||
|
|
||||||
this.searchTable = $(tableId).dataTable({
|
this.searchTable = $(tableId).dataTable({
|
||||||
"ajax": ajaxUrl,
|
"ajax": ajaxUrl,
|
||||||
"processing": false,
|
"processing": true,
|
||||||
"serverSide": true,
|
"serverSide": true,
|
||||||
"oSearch": { "sSearch": initSearch },
|
"oSearch": { "sSearch": initSearch },
|
||||||
"dom": 'rtlp',
|
"dom": 'rtlp',
|
||||||
|
@ -199,14 +202,8 @@ WspFileBrowser.prototype = {
|
||||||
"createdRow": function (row, data, index) {
|
"createdRow": function (row, data, index) {
|
||||||
$(row).addClass('element-container');
|
$(row).addClass('element-container');
|
||||||
},
|
},
|
||||||
"fnPreDrawCallback": function () {
|
"oLanguage": {
|
||||||
// gather info to compose a message
|
"sProcessing": this.settings.processingDialogDom
|
||||||
wsp.dialogs.showProcessDialog();
|
|
||||||
return true;
|
|
||||||
},
|
|
||||||
"fnDrawCallback": function () {
|
|
||||||
// in case your overlay needs to be put away automatically you can put it here
|
|
||||||
wsp.dialogs.hideProcessDialog();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -272,6 +269,40 @@ WspFileBrowser.prototype = {
|
||||||
var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
||||||
var i = Math.floor(Math.log(bytes) / Math.log(k));
|
var i = Math.floor(Math.log(bytes) / Math.log(k));
|
||||||
return (bytes / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
|
return (bytes / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
|
||||||
|
},
|
||||||
|
|
||||||
|
showCreateNewItemDialog: function (extension, target, title) {
|
||||||
|
$(this.settings.createNewItemButtonId).data('extension', extension);
|
||||||
|
$(this.settings.createNewItemButtonId).data('target', target);
|
||||||
|
|
||||||
|
$(this.settings.createNewItemDialogId + " input").val("");
|
||||||
|
|
||||||
|
$(this.settings.createNewItemTitleId).text($(this.settings.createNewItemTitleId).data('title') + " " + title);
|
||||||
|
|
||||||
|
$(this.settings.createNewItemDialogId).modal();
|
||||||
|
},
|
||||||
|
|
||||||
|
hideCreateNewItemDialog: function () {
|
||||||
|
$(this.settings.createNewItemDialogId).modal('hide');
|
||||||
|
},
|
||||||
|
|
||||||
|
uniqueFileNameFieldRule: function(fieldId) {
|
||||||
|
|
||||||
|
return {
|
||||||
|
url: this.settings.fileExistUrl,
|
||||||
|
type: "post",
|
||||||
|
data: {
|
||||||
|
newItemName: function() {
|
||||||
|
return $(fieldId).val() + $(wsp.fileBrowser.settings.createNewItemButtonId).data('extension');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
beforeSend: function(response) {
|
||||||
|
wsp.dialogs.showInlineProcessing(fieldId);
|
||||||
|
},
|
||||||
|
complete: function() {
|
||||||
|
wsp.dialogs.hideInlineProcessing(fieldId);
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,124 @@
|
||||||
|
//Toggle file select + Ctrl multiselect
|
||||||
|
$(document).on('click', '.element-container', function (e) {
|
||||||
|
if (e.ctrlKey) {
|
||||||
|
$(this).toggleClass("selected-file");
|
||||||
|
} else {
|
||||||
|
|
||||||
|
wsp.fileBrowser.clearAllSelectedItems();
|
||||||
|
|
||||||
|
wsp.fileBrowser.selectItem(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
wsp.fileBrowser.refreshDeletionBlock();
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).on('touchstart', '.element-container', function (e) {
|
||||||
|
var now = new Date().getTime();
|
||||||
|
var lastTouch = $(this).data('lastTouch') || now + 1;
|
||||||
|
var delta = now - lastTouch;
|
||||||
|
|
||||||
|
if (delta < 300 && delta > 0) {
|
||||||
|
wsp.fileBrowser.openItem(this);
|
||||||
|
$(this).data('lastTouch', 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
$(this).data('lastTouch', now);
|
||||||
|
});
|
||||||
|
|
||||||
|
//Double click file open
|
||||||
|
$(document).on('dblclick', '.element-container', function (e) {
|
||||||
|
wsp.fileBrowser.openItem(this);
|
||||||
|
|
||||||
|
var links = $(this).find('.file-link');
|
||||||
|
|
||||||
|
if (links.length != 0 && $(links[0]).hasClass('processing-dialog')) {
|
||||||
|
wsp.dialogs.showProcessDialog();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
//Delete button click
|
||||||
|
$(document).on('click', '.file-deletion #delete-button', function (e) {
|
||||||
|
var dialogId = $(this).data('target');
|
||||||
|
var buttonText = $(this).data('target-positive-button-text');
|
||||||
|
var content = $(this).data('target-content');
|
||||||
|
var title = $(this).data('target-title-text');
|
||||||
|
|
||||||
|
content = jQuery.validator.format(content, wsp.fileBrowser.getSelectedItemsCount());
|
||||||
|
|
||||||
|
wsp.dialogs.showConfirmDialog(title, content, buttonText, wsp.fileBrowser.deleteSelectedItems, dialogId);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$(document).click(function (event) {
|
||||||
|
if (!$(event.target).closest('.element-container, .prevent-deselect').length) {
|
||||||
|
wsp.fileBrowser.clearAllSelectedItems();
|
||||||
|
wsp.fileBrowser.refreshDeletionBlock();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#drag-and-drop-area').click(function (e) {
|
||||||
|
$('#file-input').click();
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#drag-and-drop-area #file-input').click(function (e) {
|
||||||
|
e.stopPropagation();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$("#create-button").click(function (e) {
|
||||||
|
|
||||||
|
if ($('#filenameForm').valid()) {
|
||||||
|
|
||||||
|
var fileName = $('#createNewItemDialog #filename').val() + $(this).data('extension');
|
||||||
|
|
||||||
|
$(this).attr('href', $(this).data('href') + '/' + fileName);
|
||||||
|
|
||||||
|
$(this).attr('target', $(this).data('target'));
|
||||||
|
|
||||||
|
wsp.fileBrowser.hideCreateNewItemDialog();
|
||||||
|
//;
|
||||||
|
} else {
|
||||||
|
e.preventDefault();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$(document).ready(function () {
|
||||||
|
|
||||||
|
$('#filenameForm').validate({
|
||||||
|
onkeyup: false,
|
||||||
|
onclick: false,
|
||||||
|
async: false,
|
||||||
|
rules: {
|
||||||
|
filename: {
|
||||||
|
required: true,
|
||||||
|
synchronousRemote: wsp.fileBrowser.uniqueFileNameFieldRule("#filename")
|
||||||
|
}
|
||||||
|
},
|
||||||
|
messages: {
|
||||||
|
filename: {
|
||||||
|
synchronousRemote: wsp.fileBrowser.settings.textItemExist
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#filename').keydown(function (event) {
|
||||||
|
if (event.keyCode == 13) {
|
||||||
|
event.preventDefault();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$(".create-new-item li a").click(function () {
|
||||||
|
|
||||||
|
$("#filenameForm").clearValidation();
|
||||||
|
|
||||||
|
wsp.fileBrowser.showCreateNewItemDialog($(this).data('extension'), $(this).data('target'), $(this).text());
|
||||||
|
|
||||||
|
$("#filename").focus();
|
||||||
|
});
|
|
@ -10,72 +10,84 @@ $(document).on('click', '.processing-dialog', function (e) {
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
//Toggle file select + Ctrl multiselect
|
$(document).ready(function() {
|
||||||
$(document).on('click', '.element-container', function (e) {
|
//bootstrap jquery validate styles fix
|
||||||
if (e.ctrlKey) {
|
$.validator.setDefaults({
|
||||||
$(this).toggleClass("selected-file");
|
highlight: function(element) {
|
||||||
|
$(element).closest('.form-group').addClass('has-error');
|
||||||
|
},
|
||||||
|
unhighlight: function(element) {
|
||||||
|
$(element).closest('.form-group').removeClass('has-error');
|
||||||
|
},
|
||||||
|
errorElement: 'span',
|
||||||
|
errorClass: 'help-block',
|
||||||
|
errorPlacement: function(error, element) {
|
||||||
|
if (element.parent('.input-group').length) {
|
||||||
|
error.insertAfter(element.parent());
|
||||||
} else {
|
} else {
|
||||||
|
error.insertAfter(element);
|
||||||
wsp.fileBrowser.clearAllSelectedItems();
|
|
||||||
|
|
||||||
wsp.fileBrowser.selectItem(this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wsp.fileBrowser.refreshDeletionBlock();
|
|
||||||
});
|
|
||||||
|
|
||||||
$(document).on('touchstart', '.element-container', function(e) {
|
|
||||||
var now = new Date().getTime();
|
|
||||||
var lastTouch = $(this).data('lastTouch') || now + 1;
|
|
||||||
var delta = now - lastTouch;
|
|
||||||
|
|
||||||
if (delta < 300 && delta > 0) {
|
|
||||||
wsp.fileBrowser.openItem(this);
|
|
||||||
$(this).data('lastTouch', 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
$(this).data('lastTouch', now);
|
|
||||||
});
|
|
||||||
|
|
||||||
//Double click file open
|
|
||||||
$(document).on('dblclick', '.element-container', function (e) {
|
|
||||||
wsp.fileBrowser.openItem(this);
|
|
||||||
|
|
||||||
var links = $(this).find('.file-link');
|
|
||||||
|
|
||||||
if (links.length != 0 && $(links[0]).hasClass('processing-dialog')) {
|
|
||||||
wsp.dialogs.showProcessDialog();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$.validator.addMethod("synchronousRemote", function(value, element, param) {
|
||||||
//Delete button click
|
if (this.optional(element)) {
|
||||||
$(document).on('click', '.file-deletion #delete-button', function (e) {
|
return "dependency-mismatch";
|
||||||
var dialogId = $(this).data('target');
|
|
||||||
var buttonText = $(this).data('target-positive-button-text');
|
|
||||||
var content = $(this).data('target-content');
|
|
||||||
var title = $(this).data('target-title-text');
|
|
||||||
|
|
||||||
content = jQuery.validator.format(content, wsp.fileBrowser.getSelectedItemsCount());
|
|
||||||
|
|
||||||
wsp.dialogs.showConfirmDialog(title, content, buttonText, wsp.fileBrowser.deleteSelectedItems, dialogId);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
$(document).click(function(event) {
|
|
||||||
if (!$(event.target).closest('.element-container, .prevent-deselect').length) {
|
|
||||||
wsp.fileBrowser.clearAllSelectedItems();
|
|
||||||
wsp.fileBrowser.refreshDeletionBlock();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var previous = this.previousValue(element);
|
||||||
|
if (!this.settings.messages[element.name]) {
|
||||||
|
this.settings.messages[element.name] = {};
|
||||||
|
}
|
||||||
|
previous.originalMessage = this.settings.messages[element.name].remote;
|
||||||
|
this.settings.messages[element.name].remote = previous.message;
|
||||||
|
|
||||||
|
param = typeof param === "string" && { url: param } || param;
|
||||||
|
|
||||||
|
if (previous.old === value) {
|
||||||
|
return previous.valid;
|
||||||
|
}
|
||||||
|
|
||||||
|
previous.old = value;
|
||||||
|
var validator = this;
|
||||||
|
this.startRequest(element);
|
||||||
|
var data = {};
|
||||||
|
data[element.name] = value;
|
||||||
|
var valid = "pending";
|
||||||
|
$.ajax($.extend(true, {
|
||||||
|
url: param,
|
||||||
|
async: false,
|
||||||
|
mode: "abort",
|
||||||
|
port: "validate" + element.name,
|
||||||
|
dataType: "json",
|
||||||
|
data: data,
|
||||||
|
success: function(response) {
|
||||||
|
validator.settings.messages[element.name].remote = previous.originalMessage;
|
||||||
|
valid = response === true || response === "true";
|
||||||
|
if (valid) {
|
||||||
|
var submitted = validator.formSubmitted;
|
||||||
|
validator.prepareElement(element);
|
||||||
|
validator.formSubmitted = submitted;
|
||||||
|
validator.successList.push(element);
|
||||||
|
delete validator.invalid[element.name];
|
||||||
|
validator.showErrors();
|
||||||
|
} else {
|
||||||
|
var errors = {};
|
||||||
|
var message = response || validator.defaultMessage(element, "remote");
|
||||||
|
errors[element.name] = previous.message = $.isFunction(message) ? message(value) : message;
|
||||||
|
validator.invalid[element.name] = true;
|
||||||
|
validator.showErrors(errors);
|
||||||
|
}
|
||||||
|
previous.valid = valid;
|
||||||
|
validator.stopRequest(element, valid);
|
||||||
|
}
|
||||||
|
}, param));
|
||||||
|
return valid;
|
||||||
|
}, "Please fix this field.");
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#drag-and-drop-area').click(function (e) {
|
|
||||||
$('#file-input').click();
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#drag-and-drop-area #file-input').click(function (e) {
|
$.fn.clearValidation = function () { var v = $(this).validate(); $('[name]', this).each(function () { v.successList.push(this); v.showErrors(); }); v.resetForm(); v.reset(); $(this).find('.form-group').removeClass('has-error'); };
|
||||||
e.stopPropagation();
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
function isMobileDevice() {
|
function isMobileDevice() {
|
||||||
|
|
|
@ -25,10 +25,16 @@ else
|
||||||
|
|
||||||
|
|
||||||
@section scripts{
|
@section scripts{
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
wsp.fileBrowser.setSettings({ deletionUrl: "@Url.RouteUrl(FileSystemRouteNames.DeleteFiles)" });
|
wsp.fileBrowser.setSettings({
|
||||||
|
deletionUrl: "@Url.RouteUrl(FileSystemRouteNames.DeleteFiles)",
|
||||||
|
fileExistUrl: "@Url.RouteUrl(FileSystemRouteNames.ItemExist)",
|
||||||
|
textItemExist: "@UI.ItemExist." });
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@Scripts.Render("~/bundles/appScripts-webdav")
|
||||||
|
|
||||||
@if (Model.UserSettings.WebDavViewType == FolderViewTypes.BigIcons)
|
@if (Model.UserSettings.WebDavViewType == FolderViewTypes.BigIcons)
|
||||||
{
|
{
|
||||||
@Scripts.Render("~/bundles/bigIconsScripts")
|
@Scripts.Render("~/bundles/bigIconsScripts")
|
||||||
|
@ -47,9 +53,37 @@ else
|
||||||
{
|
{
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
wsp.fileBrowser.setSettings({ deletionUrl: "@Url.RouteUrl(FileSystemRouteNames.DeleteFiles)" });
|
|
||||||
wsp.fileBrowser.initDataTable('#webdav-items-table', '@Url.RouteUrl(FileSystemRouteNames.ShowContentDetails)');
|
wsp.fileBrowser.initDataTable('#webdav-items-table', '@Url.RouteUrl(FileSystemRouteNames.ShowContentDetails)');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@section popups{
|
||||||
|
<div id="createNewItemDialog" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="modal-process-dialog-title" data-backdrop="static" data-keyboard="false" aria-hidden="true" style="display: none;">
|
||||||
|
<div class="modal-dialog">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||||
|
<h4 class="modal-title" id="create-dalog-label" data-title="@UI.Create">@UI.Create</h4>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal-body">
|
||||||
|
<form id="filenameForm">
|
||||||
|
<div class="form-group has-feedback">
|
||||||
|
<label for="filename">@UI.FileName</label>
|
||||||
|
<input type="text" class="form-control" id="filename" name="filename" autofocus required placeholder="@UI.EnterFileName">
|
||||||
|
<span class="glyphicon glyphicon-refresh glyphicon-spin form-control-feedback small-processing" aria-hidden="true"></span>
|
||||||
|
<span id="inputProcessingStatus" class="sr-only">(processing)</span>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button type="button" class="btn btn-default" data-dismiss="modal">@UI.Cancel</button>
|
||||||
|
<a href="@Url.RouteUrl(FileSystemRouteNames.NewWebDavItem)" data-href="@Url.RouteUrl(FileSystemRouteNames.NewWebDavItem)" id="create-button" class="btn btn-success danger">@UI.Create</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
|
@ -24,5 +24,6 @@
|
||||||
wsp.fileBrowser.initSearchDataTable('#search-items-table', '@Url.RouteUrl(FileSystemRouteNames.ShowContentDetails)', '@Model.SearchValue');
|
wsp.fileBrowser.initSearchDataTable('#search-items-table', '@Url.RouteUrl(FileSystemRouteNames.ShowContentDetails)', '@Model.SearchValue');
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@Scripts.Render("~/bundles/appScripts-webdav")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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">
|
||||||
|
|
|
@ -25,7 +25,9 @@
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<a href="@Url.RouteUrl(FileSystemRouteNames.ShowContentPath)" class="processing-dialog">@UI.SearchResults</a>
|
<a href="@Url.RouteUrl(FileSystemRouteNames.ShowContentPath)" class="processing-dialog">@(elements.Any() ?elements.Last():WspContext.User.OrganizationId)</a>
|
||||||
|
<span style="top: 2px;"> / </span>
|
||||||
|
<span>@UI.SearchResults</span>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -56,6 +58,17 @@
|
||||||
data-target-title-text="@UI.DeleteFileQuestion"
|
data-target-title-text="@UI.DeleteFileQuestion"
|
||||||
data-target-content="@UI.DialogsContentConfrimFileDeletion">@UI.Delete</a>
|
data-target-content="@UI.DialogsContentConfrimFileDeletion">@UI.Delete</a>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="dropdown create-new-item navbar-left">
|
||||||
|
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-expanded="true">
|
||||||
|
@UI.Create
|
||||||
|
<span class="caret"></span>
|
||||||
|
</button>
|
||||||
|
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
|
||||||
|
<li role="presentation"><a role="menuitem" tabindex="-1" href="#" data-extension=".docx" data-target="_blank">@UI.WordDocument</a></li>
|
||||||
|
<li role="presentation"><a role="menuitem" tabindex="-1" href="#" data-extension=".xlsx" data-target="_blank">@UI.ExcelWorkbook</a></li>
|
||||||
|
<li role="presentation"><a role="menuitem" tabindex="-1" href="#" data-extension=".pptx" data-target="_blank">@UI.PowerPointPresentation</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
<div class="file-upload navbar-right">
|
<div class="file-upload navbar-right">
|
||||||
|
|
|
@ -85,13 +85,13 @@
|
||||||
<add browser="InternetExplorer;IE" version="8" />
|
<add browser="InternetExplorer;IE" version="8" />
|
||||||
<add browser="Safari" version="4" />
|
<add browser="Safari" version="4" />
|
||||||
</owaSupportedBrowsers>
|
</owaSupportedBrowsers>
|
||||||
<officeOnline isEnabled="True" url="https://vir-owa.virtuworks.net" cobaltFileTtl="1">
|
<officeOnline isEnabled="True" url="https://vir-owa.virtuworks.net" cobaltFileTtl="1" cobaltNewFilePath="~/Content/OwaFiles/New">
|
||||||
<add extension=".doc" OwaView="wv/wordviewerframe.aspx?" OwaEditor="wv/wordviewerframe.aspx?" OwaMobileView="wv/mWord.aspx?wdMobileHost=3&"/>
|
<add extension=".doc" OwaView="wv/wordviewerframe.aspx?" OwaEditor="wv/wordviewerframe.aspx?" OwaMobileView="wv/mWord.aspx?wdMobileHost=3&" OwaNewFileView="we/wordeditorframe.aspx?new=1&"/>
|
||||||
<add extension=".docx" OwaView="wv/wordviewerframe.aspx?" OwaEditor="we/wordeditorframe.aspx?" OwaMobileView="wv/mWord.aspx?wdMobileHost=3&"/>
|
<add extension=".docx" OwaView="wv/wordviewerframe.aspx?" OwaEditor="we/wordeditorframe.aspx?" OwaMobileView="wv/mWord.aspx?wdMobileHost=3&" OwaNewFileView="we/wordeditorframe.aspx?new=1&"/>
|
||||||
<add extension=".xls" OwaView="x/_layouts/xlviewerinternal.aspx?" OwaEditor="x/_layouts/xlviewerinternal.aspx?edit=1&" OwaMobileView="x/_layouts/mobile/mXL.aspx?wdMobileHost=3&"/>
|
<add extension=".xls" OwaView="x/_layouts/xlviewerinternal.aspx?" OwaEditor="x/_layouts/xlviewerinternal.aspx?edit=1&" OwaMobileView="x/_layouts/mobile/mXL.aspx?wdMobileHost=3&" OwaNewFileView="x/_layouts/xlviewerinternal.aspx?new=1&"/>
|
||||||
<add extension=".xlsx" OwaView="x/_layouts/xlviewerinternal.aspx?" OwaEditor="x/_layouts/xlviewerinternal.aspx?edit=1&" OwaMobileView="x/_layouts/mobile/mXL.aspx?wdMobileHost=3&" />
|
<add extension=".xlsx" OwaView="x/_layouts/xlviewerinternal.aspx?" OwaEditor="x/_layouts/xlviewerinternal.aspx?edit=1&" OwaMobileView="x/_layouts/mobile/mXL.aspx?wdMobileHost=3&" OwaNewFileView="x/_layouts/xlviewerinternal.aspx?edit=1&"/>
|
||||||
<add extension=".ppt" OwaView="p/PowerPointFrame.aspx?" OwaEditor="p/PowerPointFrame.aspx?" OwaMobileView="p/mPPT.aspx?wdMobileHost=3&"/>
|
<add extension=".ppt" OwaView="p/PowerPointFrame.aspx?" OwaEditor="p/PowerPointFrame.aspx?" OwaMobileView="p/mPPT.aspx?wdMobileHost=3&" OwaNewFileView="p/PowerPointFrame.aspx?PowerPointView=EditView&New=1&"/>
|
||||||
<add extension=".pptx" OwaView="p/PowerPointFrame.aspx?" OwaEditor="p/PowerPointFrame.aspx?PowerPointView=EditView&" OwaMobileView="p/mPPT.aspx?wdMobileHost=3&"/>
|
<add extension=".pptx" OwaView="p/PowerPointFrame.aspx?" OwaEditor="p/PowerPointFrame.aspx?PowerPointView=EditView&" OwaMobileView="p/mPPT.aspx?wdMobileHost=3&" OwaNewFileView="p/PowerPointFrame.aspx?PowerPointView=EditView&New=1&"/>
|
||||||
</officeOnline>
|
</officeOnline>
|
||||||
<typeOpener>
|
<typeOpener>
|
||||||
<add extension=".jpg" mimeType="image/jpeg" isTargetBlank="true" />
|
<add extension=".jpg" mimeType="image/jpeg" isTargetBlank="true" />
|
||||||
|
|
|
@ -165,6 +165,7 @@
|
||||||
<Compile Include="Configurations\ActionSelectors\OwaActionSelector.cs" />
|
<Compile Include="Configurations\ActionSelectors\OwaActionSelector.cs" />
|
||||||
<Compile Include="Configurations\Constraints\OrganizationRouteConstraint.cs" />
|
<Compile Include="Configurations\Constraints\OrganizationRouteConstraint.cs" />
|
||||||
<Compile Include="Configurations\ControllerConfigurations\OwaControllerConfiguration.cs" />
|
<Compile Include="Configurations\ControllerConfigurations\OwaControllerConfiguration.cs" />
|
||||||
|
<Compile Include="Constants\Formtas.cs" />
|
||||||
<Compile Include="Controllers\AccountController.cs" />
|
<Compile Include="Controllers\AccountController.cs" />
|
||||||
<Compile Include="Controllers\ErrorController.cs" />
|
<Compile Include="Controllers\ErrorController.cs" />
|
||||||
<Compile Include="Controllers\FileSystemController.cs" />
|
<Compile Include="Controllers\FileSystemController.cs" />
|
||||||
|
@ -183,6 +184,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" />
|
||||||
|
@ -369,6 +371,8 @@
|
||||||
<Content Include="Content\bootstrap.css.map" />
|
<Content Include="Content\bootstrap.css.map" />
|
||||||
<Content Include="Content\DataTables-1.10.4\css\dataTables.responsive.scss" />
|
<Content Include="Content\DataTables-1.10.4\css\dataTables.responsive.scss" />
|
||||||
<Content Include="Content\DataTables-1.10.4\css\dataTables.jqueryui.scss" />
|
<Content Include="Content\DataTables-1.10.4\css\dataTables.jqueryui.scss" />
|
||||||
|
<Content Include="Content\OwaFiles\Empty.docx" />
|
||||||
|
<Content Include="Content\OwaFiles\Empty.pptx" />
|
||||||
<None Include="Scripts\jquery-2.1.1.intellisense.js" />
|
<None Include="Scripts\jquery-2.1.1.intellisense.js" />
|
||||||
<Content Include="Scripts\appScripts\authentication.js" />
|
<Content Include="Scripts\appScripts\authentication.js" />
|
||||||
<Content Include="Scripts\appScripts\dialogs.js" />
|
<Content Include="Scripts\appScripts\dialogs.js" />
|
||||||
|
@ -376,6 +380,7 @@
|
||||||
<Content Include="Scripts\appScripts\messages.js" />
|
<Content Include="Scripts\appScripts\messages.js" />
|
||||||
<Content Include="Scripts\appScripts\recalculateResourseHeight.js" />
|
<Content Include="Scripts\appScripts\recalculateResourseHeight.js" />
|
||||||
<Content Include="Scripts\appScripts\uploadingData2.js" />
|
<Content Include="Scripts\appScripts\uploadingData2.js" />
|
||||||
|
<Content Include="Scripts\appScripts\wsp-webdav.js" />
|
||||||
<Content Include="Scripts\appScripts\wsp.js" />
|
<Content Include="Scripts\appScripts\wsp.js" />
|
||||||
<Content Include="Scripts\bootstrap.js" />
|
<Content Include="Scripts\bootstrap.js" />
|
||||||
<Content Include="Scripts\bootstrap.min.js" />
|
<Content Include="Scripts\bootstrap.min.js" />
|
||||||
|
|
|
@ -153,4 +153,5 @@
|
||||||
<Control key="rds_edit_collection_settings" general_key="rds_collections" />
|
<Control key="rds_edit_collection_settings" general_key="rds_collections" />
|
||||||
<Control key="rds_collection_user_sessions" general_key="rds_collections" />
|
<Control key="rds_collection_user_sessions" general_key="rds_collections" />
|
||||||
<Control key="rds_collection_local_admins" general_key="rds_collections" />
|
<Control key="rds_collection_local_admins" general_key="rds_collections" />
|
||||||
|
<Control key="rds_setup_letter" general_key="rds_collections" />
|
||||||
</Controls>
|
</Controls>
|
||||||
|
|
|
@ -173,6 +173,7 @@
|
||||||
<Controls>
|
<Controls>
|
||||||
<Control key="" src="WebsitePanel/RDSServers.ascx" title="RDSServers" type="View" />
|
<Control key="" src="WebsitePanel/RDSServers.ascx" title="RDSServers" type="View" />
|
||||||
<Control key="add_rdsserver" src="WebsitePanel/RDSServersAddserver.ascx" title="RDSServersAddserver" type="View" icon="computer_add_48.png" />
|
<Control key="add_rdsserver" src="WebsitePanel/RDSServersAddserver.ascx" title="RDSServersAddserver" type="View" icon="computer_add_48.png" />
|
||||||
|
<Control key="edit_rdsserver" src="WebsitePanel/RDSServersEditServer.ascx" title="RDSServersEditServer" type="View" icon="computer_48.png" />
|
||||||
</Controls>
|
</Controls>
|
||||||
</ModuleDefinition>
|
</ModuleDefinition>
|
||||||
|
|
||||||
|
@ -583,6 +584,7 @@
|
||||||
<Control key="deleted_user_memberof" src="WebsitePanel/ExchangeServer/OrganizationDeletedUserMemberOf.ascx" title="DeletedUserMemberOf" type="View" />
|
<Control key="deleted_user_memberof" src="WebsitePanel/ExchangeServer/OrganizationDeletedUserMemberOf.ascx" title="DeletedUserMemberOf" type="View" />
|
||||||
<Control key="rds_application_edit_users" src="WebsitePanel/RDS/RDSEditApplicationUsers.ascx" title="RDSEditApplicationUsers" type="View" />
|
<Control key="rds_application_edit_users" src="WebsitePanel/RDS/RDSEditApplicationUsers.ascx" title="RDSEditApplicationUsers" type="View" />
|
||||||
<Control key="rds_collection_local_admins" src="WebsitePanel/RDS/RDSLocalAdmins.ascx" title="RDSLocalAdmins" type="View" />
|
<Control key="rds_collection_local_admins" src="WebsitePanel/RDS/RDSLocalAdmins.ascx" title="RDSLocalAdmins" type="View" />
|
||||||
|
<Control key="rds_setup_letter" src="WebsitePanel/RDS/RDSSetupLetter.ascx" title="RDSSetupLetter" type="View" />
|
||||||
<Control key="rds_edit_collection" src="WebsitePanel/RDS/RDSEditCollection.ascx" title="RDSEditCollection" type="View" />
|
<Control key="rds_edit_collection" src="WebsitePanel/RDS/RDSEditCollection.ascx" title="RDSEditCollection" type="View" />
|
||||||
<Control key="rds_edit_collection_settings" src="WebsitePanel/RDS/RDSEditCollectionSettings.ascx" title="RDSEditCollectionSettings" type="View" />
|
<Control key="rds_edit_collection_settings" src="WebsitePanel/RDS/RDSEditCollectionSettings.ascx" title="RDSEditCollectionSettings" type="View" />
|
||||||
<Control key="rds_collection_user_sessions" src="WebsitePanel/RDS/RDSUserSessions.ascx" title="RDSUserSessions" type="View" />
|
<Control key="rds_collection_user_sessions" src="WebsitePanel/RDS/RDSUserSessions.ascx" title="RDSUserSessions" type="View" />
|
||||||
|
|
|
@ -795,4 +795,7 @@
|
||||||
<data name="ModuleTitle.RDSServersAddserver" xml:space="preserve">
|
<data name="ModuleTitle.RDSServersAddserver" xml:space="preserve">
|
||||||
<value>Add New RDS Server</value>
|
<value>Add New RDS Server</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="ModuleTitle.RDSServersEditServer" xml:space="preserve">
|
||||||
|
<value>Edit RDS Server</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
|
@ -3301,6 +3301,12 @@
|
||||||
<data name="Success.ORGANIZATION_LETTER_SEND" xml:space="preserve">
|
<data name="Success.ORGANIZATION_LETTER_SEND" xml:space="preserve">
|
||||||
<value>Organization user setup instructions have been sent</value>
|
<value>Organization user setup instructions have been sent</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Error.RDS_SETUP_LETTER_SEND" xml:space="preserve">
|
||||||
|
<value>Error sending setup instructions</value>
|
||||||
|
</data>
|
||||||
|
<data name="Success.RDS_SETUP_LETTER_SEND" xml:space="preserve">
|
||||||
|
<value>Setup instructions have been sent</value>
|
||||||
|
</data>
|
||||||
<data name="Quota.MsSQL2005.MaxLogSize" xml:space="preserve">
|
<data name="Quota.MsSQL2005.MaxLogSize" xml:space="preserve">
|
||||||
<value>Max Log Size, MB</value>
|
<value>Max Log Size, MB</value>
|
||||||
</data>
|
</data>
|
||||||
|
@ -3367,6 +3373,12 @@
|
||||||
<data name="ResourceGroup.Hosted SharePoint" xml:space="preserve">
|
<data name="ResourceGroup.Hosted SharePoint" xml:space="preserve">
|
||||||
<value>Hosted SharePoint</value>
|
<value>Hosted SharePoint</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="ResourceGroup.SharePoint Foundation Server" xml:space="preserve">
|
||||||
|
<value>SharePoint Foundation Server</value>
|
||||||
|
</data>
|
||||||
|
<data name="ResourceGroup.SharePoint Server" xml:space="preserve">
|
||||||
|
<value>SharePoint Server</value>
|
||||||
|
</data>
|
||||||
<data name="ResourceGroup.OCS" xml:space="preserve">
|
<data name="ResourceGroup.OCS" xml:space="preserve">
|
||||||
<value>Office Communications Server</value>
|
<value>Office Communications Server</value>
|
||||||
</data>
|
</data>
|
||||||
|
@ -3379,6 +3391,12 @@
|
||||||
<data name="Quota.HostedSharePoint.MaxStorage" xml:space="preserve">
|
<data name="Quota.HostedSharePoint.MaxStorage" xml:space="preserve">
|
||||||
<value>Max site storage, MB</value>
|
<value>Max site storage, MB</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Quota.HostedSharePointServer.Sites" xml:space="preserve">
|
||||||
|
<value>SharePoint Site Collections per Organization</value>
|
||||||
|
</data>
|
||||||
|
<data name="Quota.HostedSharePointServer.MaxStorage" xml:space="preserve">
|
||||||
|
<value>Max site storage, MB</value>
|
||||||
|
</data>
|
||||||
<data name="Quota.HostedCRM.Users" xml:space="preserve">
|
<data name="Quota.HostedCRM.Users" xml:space="preserve">
|
||||||
<value>Full licenses per organization</value>
|
<value>Full licenses per organization</value>
|
||||||
</data>
|
</data>
|
||||||
|
@ -5155,6 +5173,9 @@
|
||||||
<data name="Quota.HostedSharePoint.UseSharedSSL" xml:space="preserve">
|
<data name="Quota.HostedSharePoint.UseSharedSSL" xml:space="preserve">
|
||||||
<value>Use shared SSL Root</value>
|
<value>Use shared SSL Root</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="Quota.HostedSharePointServer.UseSharedSSL" xml:space="preserve">
|
||||||
|
<value>Use shared SSL Root</value>
|
||||||
|
</data>
|
||||||
<data name="Quota.Exchange2007.IsConsumer" xml:space="preserve">
|
<data name="Quota.Exchange2007.IsConsumer" xml:space="preserve">
|
||||||
<value>Consumer Organization Support</value>
|
<value>Consumer Organization Support</value>
|
||||||
</data>
|
</data>
|
||||||
|
@ -5444,7 +5465,7 @@
|
||||||
<value>ESS licenses per organization</value>
|
<value>ESS licenses per organization</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="ResourceGroup.Hosted CRM2013" xml:space="preserve">
|
<data name="ResourceGroup.Hosted CRM2013" xml:space="preserve">
|
||||||
<value>Hosted CRM 2013</value>
|
<value>Hosted CRM 2013/2015</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="HostedCRM.USER_QUOTA_HAS_BEEN_REACHED2013_0" xml:space="preserve">
|
<data name="HostedCRM.USER_QUOTA_HAS_BEEN_REACHED2013_0" xml:space="preserve">
|
||||||
<value>CRM users quota (Professional license) has been reached.</value>
|
<value>CRM users quota (Professional license) has been reached.</value>
|
||||||
|
@ -5659,6 +5680,9 @@
|
||||||
<data name="ERROR.RDSSERVER_NOT_ADDED" xml:space="preserve">
|
<data name="ERROR.RDSSERVER_NOT_ADDED" xml:space="preserve">
|
||||||
<value>RDS Server not added</value>
|
<value>RDS Server not added</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="ERROR.RDSSERVER_NOT_UPDATED" xml:space="preserve">
|
||||||
|
<value>RDS Server not updated</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>
|
||||||
|
|
|
@ -54,9 +54,9 @@ legend {font-weight:700; color:#428bca; padding:0 4px;}
|
||||||
legend span.NormalBold {display:inline;}
|
legend span.NormalBold {display:inline;}
|
||||||
.Tabs {width:100%;}
|
.Tabs {width:100%;}
|
||||||
.Separator {display:none;}
|
.Separator {display:none;}
|
||||||
.Tabs span {display:table; table-layout:fixed; width:100%; table-layout:fixed;}
|
.Tabs span {display:table; table-layout:fixed; min-width:100%; table-layout:fixed;}
|
||||||
.Tabs span span {display:table-cell; width:15%; text-align:center; padding:0;}
|
.Tabs span span {display:table-cell; width:15%; text-align:center; padding:0;}
|
||||||
.Tabs a {display:block; padding:10px 0; text-decoration:none; border-bottom:1px solid #ddd;}
|
.Tabs a {display:block; padding:10px 5px; text-decoration:none; border-bottom:1px solid #ddd;}
|
||||||
.Tabs a:Hover {background:#eee; text-decoration:none;}
|
.Tabs a:Hover {background:#eee; text-decoration:none;}
|
||||||
.Tabs a.ActiveTab {border:1px solid #ddd; border-bottom:none; color:#555; margin-bottom:-1px;}
|
.Tabs a.ActiveTab {border:1px solid #ddd; border-bottom:none; color:#555; margin-bottom:-1px;}
|
||||||
.Tabs a.ActiveTab:hover {background:none;}
|
.Tabs a.ActiveTab:hover {background:none;}
|
||||||
|
|
|
@ -201,8 +201,11 @@
|
||||||
<data name="Text.Setup" xml:space="preserve">
|
<data name="Text.Setup" xml:space="preserve">
|
||||||
<value>Setup</value>
|
<value>Setup</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Text.SharePointGroup" xml:space="preserve">
|
<data name="Text.SharePointFoundationServerGroup" xml:space="preserve">
|
||||||
<value>SharePoint</value>
|
<value>SharePoint Foundation Server</value>
|
||||||
|
</data>
|
||||||
|
<data name="Text.SharePointServerGroup" xml:space="preserve">
|
||||||
|
<value>SharePoint Server</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Text.SiteCollections" xml:space="preserve">
|
<data name="Text.SiteCollections" xml:space="preserve">
|
||||||
<value>Site Collections</value>
|
<value>Site Collections</value>
|
||||||
|
@ -220,7 +223,7 @@
|
||||||
<value>Organization Home</value>
|
<value>Organization Home</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Text.CRM2013Group" xml:space="preserve">
|
<data name="Text.CRM2013Group" xml:space="preserve">
|
||||||
<value>CRM 2013</value>
|
<value>CRM 2013/2015</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Text.RetentionPolicy" xml:space="preserve">
|
<data name="Text.RetentionPolicy" xml:space="preserve">
|
||||||
<value>Retention Policy</value>
|
<value>Retention Policy</value>
|
||||||
|
|
|
@ -0,0 +1,156 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<data name="btnUpdate.Text" xml:space="preserve">
|
||||||
|
<value>Update</value>
|
||||||
|
</data>
|
||||||
|
<data name="locFreeMemory.Text" xml:space="preserve">
|
||||||
|
<value>Free Memory:</value>
|
||||||
|
</data>
|
||||||
|
<data name="locFreeSpace.Text" xml:space="preserve">
|
||||||
|
<value>Free Space:</value>
|
||||||
|
</data>
|
||||||
|
<data name="locLoadPercentage.Text" xml:space="preserve">
|
||||||
|
<value>Load Percentage:</value>
|
||||||
|
</data>
|
||||||
|
<data name="locMemoryAllocated.Text" xml:space="preserve">
|
||||||
|
<value>Allocated Memory:</value>
|
||||||
|
</data>
|
||||||
|
<data name="locProcessor.Text" xml:space="preserve">
|
||||||
|
<value>Processor:</value>
|
||||||
|
</data>
|
||||||
|
<data name="locServerComments.Text" xml:space="preserve">
|
||||||
|
<value>Server Comments:</value>
|
||||||
|
</data>
|
||||||
|
<data name="locServerName.Text" xml:space="preserve">
|
||||||
|
<value>Server Fully Qualified Domain Name:</value>
|
||||||
|
</data>
|
||||||
|
<data name="locSize.Text" xml:space="preserve">
|
||||||
|
<value>Size:</value>
|
||||||
|
</data>
|
||||||
|
<data name="locStatus.Text" xml:space="preserve">
|
||||||
|
<value>Status:</value>
|
||||||
|
</data>
|
||||||
|
<data name="locVolumeName.Text" xml:space="preserve">
|
||||||
|
<value>Volume Name:</value>
|
||||||
|
</data>
|
||||||
|
<data name="secServerInfo.Text" xml:space="preserve">
|
||||||
|
<value>Server Info</value>
|
||||||
|
</data>
|
||||||
|
</root>
|
|
@ -0,0 +1,153 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<root>
|
||||||
|
<!--
|
||||||
|
Microsoft ResX Schema
|
||||||
|
|
||||||
|
Version 2.0
|
||||||
|
|
||||||
|
The primary goals of this format is to allow a simple XML format
|
||||||
|
that is mostly human readable. The generation and parsing of the
|
||||||
|
various data types are done through the TypeConverter classes
|
||||||
|
associated with the data types.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
... ado.net/XML headers & schema ...
|
||||||
|
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||||
|
<resheader name="version">2.0</resheader>
|
||||||
|
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||||
|
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||||
|
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||||
|
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||||
|
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||||
|
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||||
|
</data>
|
||||||
|
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||||
|
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||||
|
<comment>This is a comment</comment>
|
||||||
|
</data>
|
||||||
|
|
||||||
|
There are any number of "resheader" rows that contain simple
|
||||||
|
name/value pairs.
|
||||||
|
|
||||||
|
Each data row contains a name, and value. The row also contains a
|
||||||
|
type or mimetype. Type corresponds to a .NET class that support
|
||||||
|
text/value conversion through the TypeConverter architecture.
|
||||||
|
Classes that don't support this are serialized and stored with the
|
||||||
|
mimetype set.
|
||||||
|
|
||||||
|
The mimetype is used for serialized objects, and tells the
|
||||||
|
ResXResourceReader how to depersist the object. This is currently not
|
||||||
|
extensible. For a given mimetype the value must be set accordingly:
|
||||||
|
|
||||||
|
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||||
|
that the ResXResourceWriter will generate, however the reader can
|
||||||
|
read any of the formats listed below.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.binary.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.soap.base64
|
||||||
|
value : The object must be serialized with
|
||||||
|
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
|
||||||
|
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||||
|
value : The object must be serialized into a byte array
|
||||||
|
: using a System.ComponentModel.TypeConverter
|
||||||
|
: and then encoded with base64 encoding.
|
||||||
|
-->
|
||||||
|
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||||
|
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||||
|
<xsd:element name="root" msdata:IsDataSet="true">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:choice maxOccurs="unbounded">
|
||||||
|
<xsd:element name="metadata">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="assembly">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:attribute name="alias" type="xsd:string" />
|
||||||
|
<xsd:attribute name="name" type="xsd:string" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="data">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||||
|
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||||
|
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||||
|
<xsd:attribute ref="xml:space" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
<xsd:element name="resheader">
|
||||||
|
<xsd:complexType>
|
||||||
|
<xsd:sequence>
|
||||||
|
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||||
|
</xsd:sequence>
|
||||||
|
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:choice>
|
||||||
|
</xsd:complexType>
|
||||||
|
</xsd:element>
|
||||||
|
</xsd:schema>
|
||||||
|
<resheader name="resmimetype">
|
||||||
|
<value>text/microsoft-resx</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="version">
|
||||||
|
<value>2.0</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="reader">
|
||||||
|
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<resheader name="writer">
|
||||||
|
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</resheader>
|
||||||
|
<data name="ddlPriorityItem.High" xml:space="preserve">
|
||||||
|
<value>High</value>
|
||||||
|
</data>
|
||||||
|
<data name="ddlPriorityItem.Low" xml:space="preserve">
|
||||||
|
<value>Low</value>
|
||||||
|
</data>
|
||||||
|
<data name="ddlPriorityItem.Normal" xml:space="preserve">
|
||||||
|
<value>Normal</value>
|
||||||
|
</data>
|
||||||
|
<data name="lblCC.Text" xml:space="preserve">
|
||||||
|
<value>CC:</value>
|
||||||
|
</data>
|
||||||
|
<data name="lblFrom.Text" xml:space="preserve">
|
||||||
|
<value>From:</value>
|
||||||
|
</data>
|
||||||
|
<data name="lblHtmlBody.Text" xml:space="preserve">
|
||||||
|
<value>HTML Body:</value>
|
||||||
|
</data>
|
||||||
|
<data name="lblNoChangesHtmlBody" xml:space="preserve">
|
||||||
|
<value>No Changes HTML Body:</value>
|
||||||
|
</data>
|
||||||
|
<data name="lblNoChangesTextBody.Text" xml:space="preserve">
|
||||||
|
<value>No Changes Text Body:</value>
|
||||||
|
</data>
|
||||||
|
<data name="lblPriority.Text" xml:space="preserve">
|
||||||
|
<value>Priority:</value>
|
||||||
|
</data>
|
||||||
|
<data name="lblSubject.Text" xml:space="preserve">
|
||||||
|
<value>Subject:</value>
|
||||||
|
</data>
|
||||||
|
<data name="lblTextBody.Text" xml:space="preserve">
|
||||||
|
<value>Text Body:</value>
|
||||||
|
</data>
|
||||||
|
</root>
|
|
@ -162,4 +162,10 @@
|
||||||
<data name="litFileManagerEditableExtensions.Text" xml:space="preserve">
|
<data name="litFileManagerEditableExtensions.Text" xml:space="preserve">
|
||||||
<value>(One (1) extension per line)</value>
|
<value>(One (1) extension per line)</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="lblRdsController.Text" xml:space="preserve">
|
||||||
|
<value>Main RDS Controller:</value>
|
||||||
|
</data>
|
||||||
|
<data name="RdsSettings.Text" xml:space="preserve">
|
||||||
|
<value>RDS</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
|
@ -147,4 +147,7 @@
|
||||||
<data name="lnkDomainLookupLetter.Text" xml:space="preserve">
|
<data name="lnkDomainLookupLetter.Text" xml:space="preserve">
|
||||||
<value>Domain MX and NS Letter</value>
|
<value>Domain MX and NS Letter</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="lnkRdsSetupLetter.Text" xml:space="preserve">
|
||||||
|
<value>RDS Setup Letter</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
|
@ -151,7 +151,7 @@
|
||||||
<value>Contacts</value>
|
<value>Contacts</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Text.CRM2013Group" xml:space="preserve">
|
<data name="Text.CRM2013Group" xml:space="preserve">
|
||||||
<value>Hosted Organization - CRM 2013</value>
|
<value>Hosted Organization - CRM 2013/2015</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Text.CRMGroup" xml:space="preserve">
|
<data name="Text.CRMGroup" xml:space="preserve">
|
||||||
<value>Hosted Organization - CRM</value>
|
<value>Hosted Organization - CRM</value>
|
||||||
|
@ -234,8 +234,11 @@
|
||||||
<data name="Text.Setup" xml:space="preserve">
|
<data name="Text.Setup" xml:space="preserve">
|
||||||
<value>Setup</value>
|
<value>Setup</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Text.SharePointGroup" xml:space="preserve">
|
<data name="Text.SharePointFoundationServerGroup" xml:space="preserve">
|
||||||
<value>Hosted Organization - SharePoint</value>
|
<value>Hosted Organization - SharePoint Foundation Server</value>
|
||||||
|
</data>
|
||||||
|
<data name="Text.SharePointServerGroup" xml:space="preserve">
|
||||||
|
<value>Hosted Organization - SharePoint Server</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Text.SiteCollections" xml:space="preserve">
|
<data name="Text.SiteCollections" xml:space="preserve">
|
||||||
<value>Sharepoint Sites</value>
|
<value>Sharepoint Sites</value>
|
||||||
|
|
|
@ -20,8 +20,10 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="FormBody">
|
<div class="FormBody">
|
||||||
<wsp:SimpleMessageBox id="messageBox" runat="server" />
|
<wsp:SimpleMessageBox id="messageBox" runat="server" />
|
||||||
<div class="FormButtonsBarClean">
|
|
||||||
<div class="FormButtonsBarCleanLeft">
|
<div>
|
||||||
|
|
||||||
|
<div>
|
||||||
<table>
|
<table>
|
||||||
<tr height="23">
|
<tr height="23">
|
||||||
<td class="FormLabel150"><asp:Localize runat="server" ID="locDisplayName" meta:resourcekey="locDisplayName" /></td>
|
<td class="FormLabel150"><asp:Localize runat="server" ID="locDisplayName" meta:resourcekey="locDisplayName" /></td>
|
||||||
|
@ -55,8 +57,7 @@
|
||||||
<br />
|
<br />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="FormButtonsBarCleanRight">
|
<div>
|
||||||
|
|
||||||
<asp:GridView ID="gvRoles" runat="server" AutoGenerateColumns="False" EnableViewState="true"
|
<asp:GridView ID="gvRoles" runat="server" AutoGenerateColumns="False" EnableViewState="true"
|
||||||
Width="100%" CssSelectorClass="NormalGridView"
|
Width="100%" CssSelectorClass="NormalGridView"
|
||||||
AllowPaging="False" AllowSorting="False" DataKeyNames="RoleID" >
|
AllowPaging="False" AllowSorting="False" DataKeyNames="RoleID" >
|
||||||
|
@ -74,6 +75,7 @@
|
||||||
</asp:GridView>
|
</asp:GridView>
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
<asp:Button runat="server" ID="btnUpdate" Text="Save Changes" meta:resourcekey="btnUpdate" CssClass="Button1" onclick="btnUpdate_Click" />
|
<asp:Button runat="server" ID="btnUpdate" Text="Save Changes" meta:resourcekey="btnUpdate" CssClass="Button1" onclick="btnUpdate_Click" />
|
||||||
<asp:Button runat="server" ID="btnSaveExit" Text="Save Changes and Exit" CssClass="Button1"
|
<asp:Button runat="server" ID="btnSaveExit" Text="Save Changes and Exit" CssClass="Button1"
|
||||||
meta:resourcekey="btnSaveExit" OnClick="btnSaveExit_Click"></asp:Button>
|
meta:resourcekey="btnSaveExit" OnClick="btnSaveExit_Click"></asp:Button>
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue