This commit is contained in:
me 2015-03-13 16:21:43 +04:00
commit b15d7966da
122 changed files with 5707 additions and 1069 deletions

View file

@ -5508,6 +5508,46 @@ CREATE TABLE [dbo].[RDSCollectionSettings](
GO GO
IF NOT EXISTS(SELECT * FROM sys.columns
WHERE [name] = N'SecurityLayer' AND [object_id] = OBJECT_ID(N'RDSCollectionSettings'))
BEGIN
ALTER TABLE [dbo].[RDSCollectionSettings] ADD SecurityLayer NVARCHAR(20) null;
END
GO
IF NOT EXISTS(SELECT * FROM sys.columns
WHERE [name] = N'EncryptionLevel' AND [object_id] = OBJECT_ID(N'RDSCollectionSettings'))
BEGIN
ALTER TABLE [dbo].[RDSCollectionSettings] ADD EncryptionLevel NVARCHAR(20) null;
END
GO
IF NOT EXISTS(SELECT * FROM sys.columns
WHERE [name] = N'AuthenticateUsingNLA' AND [object_id] = OBJECT_ID(N'RDSCollectionSettings'))
BEGIN
ALTER TABLE [dbo].[RDSCollectionSettings] ADD AuthenticateUsingNLA BIT null;
END
GO
IF NOT EXISTS(SELECT * FROM SYS.TABLES WHERE name = 'RDSCertificates')
CREATE TABLE [dbo].[RDSCertificates](
[ID] [int] IDENTITY(1,1) NOT NULL,
[ServiceId] [int] NOT NULL,
[Content] [ntext] NOT NULL,
[Hash] [nvarchar](255) NOT NULL,
[FileName] [nvarchar](255) NOT NULL,
[ValidFrom] [datetime] NULL,
[ExpiryDate] [datetime] NULL
CONSTRAINT [PK_RDSCertificates] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[RDSCollectionUsers] ALTER TABLE [dbo].[RDSCollectionUsers]
DROP CONSTRAINT [FK_RDSCollectionUsers_RDSCollectionId] DROP CONSTRAINT [FK_RDSCollectionUsers_RDSCollectionId]
@ -5548,6 +5588,66 @@ GO
/*Remote Desktop Services Procedures*/ /*Remote Desktop Services Procedures*/
IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'AddRDSCertificate')
DROP PROCEDURE AddRDSCertificate
GO
CREATE PROCEDURE [dbo].[AddRDSCertificate]
(
@RDSCertificateId INT OUTPUT,
@ServiceId INT,
@Content NTEXT,
@Hash NVARCHAR(255),
@FileName NVARCHAR(255),
@ValidFrom DATETIME,
@ExpiryDate DATETIME
)
AS
INSERT INTO RDSCertificates
(
ServiceId,
Content,
Hash,
FileName,
ValidFrom,
ExpiryDate
)
VALUES
(
@ServiceId,
@Content,
@Hash,
@FileName,
@ValidFrom,
@ExpiryDate
)
SET @RDSCertificateId = SCOPE_IDENTITY()
RETURN
GO
IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetRDSCertificateByServiceId')
DROP PROCEDURE GetRDSCertificateByServiceId
GO
CREATE PROCEDURE [dbo].[GetRDSCertificateByServiceId]
(
@ServiceId INT
)
AS
SELECT TOP 1
Id,
ServiceId,
Content,
Hash,
FileName,
ValidFrom,
ExpiryDate
FROM RDSCertificates
WHERE ServiceId = @ServiceId
ORDER BY Id DESC
GO
IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'AddRDSServer') IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'AddRDSServer')
DROP PROCEDURE AddRDSServer DROP PROCEDURE AddRDSServer
GO GO
@ -8751,4 +8851,147 @@ IF NOT EXISTS (SELECT * FROM [dbo].[Providers] WHERE [ProviderName] = 'HyperV201
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 (350, 30, N'HyperV2012R2', N'Microsoft Hyper-V 2012 R2', N'WebsitePanel.Providers.Virtualization.HyperV2012R2, WebsitePanel.Providers.Virtualization.HyperV2012R2', N'HyperV', 1)
END END
GO
--ES OWA Editing
IF NOT EXISTS (SELECT * FROM SYS.TABLES WHERE name = 'EnterpriseFoldersOwaPermissions')
CREATE TABLE EnterpriseFoldersOwaPermissions
(
ID INT IDENTITY(1,1) NOT NULL PRIMARY KEY,
ItemID INT NOT NULL,
FolderID INT NOT NULL,
AccountID INT NOT NULL
)
GO
IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS WHERE CONSTRAINT_NAME ='FK_EnterpriseFoldersOwaPermissions_AccountId')
ALTER TABLE [dbo].[EnterpriseFoldersOwaPermissions]
DROP CONSTRAINT [FK_EnterpriseFoldersOwaPermissions_AccountId]
GO
ALTER TABLE [dbo].[EnterpriseFoldersOwaPermissions] WITH CHECK ADD CONSTRAINT [FK_EnterpriseFoldersOwaPermissions_AccountId] FOREIGN KEY([AccountID])
REFERENCES [dbo].[ExchangeAccounts] ([AccountID])
ON DELETE CASCADE
GO
IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS WHERE CONSTRAINT_NAME ='FK_EnterpriseFoldersOwaPermissions_FolderId')
ALTER TABLE [dbo].[EnterpriseFoldersOwaPermissions]
DROP CONSTRAINT [FK_EnterpriseFoldersOwaPermissions_FolderId]
GO
ALTER TABLE [dbo].[EnterpriseFoldersOwaPermissions] WITH CHECK ADD CONSTRAINT [FK_EnterpriseFoldersOwaPermissions_FolderId] FOREIGN KEY([FolderID])
REFERENCES [dbo].[EnterpriseFolders] ([EnterpriseFolderID])
ON DELETE CASCADE
GO
IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'DeleteAllEnterpriseFolderOwaUsers')
DROP PROCEDURE DeleteAllEnterpriseFolderOwaUsers
GO
CREATE PROCEDURE [dbo].[DeleteAllEnterpriseFolderOwaUsers]
(
@ItemID int,
@FolderID int
)
AS
DELETE FROM EnterpriseFoldersOwaPermissions
WHERE ItemId = @ItemID AND FolderID = @FolderID
GO
IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'AddEnterpriseFolderOwaUser')
DROP PROCEDURE AddEnterpriseFolderOwaUser
GO
CREATE PROCEDURE [dbo].[AddEnterpriseFolderOwaUser]
(
@ESOwsaUserId INT OUTPUT,
@ItemID INT,
@FolderID INT,
@AccountID INT
)
AS
INSERT INTO EnterpriseFoldersOwaPermissions
(
ItemID ,
FolderID,
AccountID
)
VALUES
(
@ItemID,
@FolderID,
@AccountID
)
SET @ESOwsaUserId = SCOPE_IDENTITY()
RETURN
GO
IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetEnterpriseFolderOwaUsers')
DROP PROCEDURE GetEnterpriseFolderOwaUsers
GO
CREATE PROCEDURE [dbo].[GetEnterpriseFolderOwaUsers]
(
@ItemID INT,
@FolderID INT
)
AS
SELECT
EA.AccountID,
EA.ItemID,
EA.AccountType,
EA.AccountName,
EA.DisplayName,
EA.PrimaryEmailAddress,
EA.MailEnabledPublicFolder,
EA.MailboxPlanId,
EA.SubscriberNumber,
EA.UserPrincipalName
FROM EnterpriseFoldersOwaPermissions AS EFOP
LEFT JOIN ExchangeAccounts AS EA ON EA.AccountID = EFOP.AccountID
WHERE EFOP.ItemID = @ItemID AND EFOP.FolderID = @FolderID
GO
IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetEnterpriseFolderId')
DROP PROCEDURE GetEnterpriseFolderId
GO
CREATE PROCEDURE [dbo].[GetEnterpriseFolderId]
(
@ItemID INT,
@FolderName varchar(max)
)
AS
SELECT TOP 1
EnterpriseFolderID
FROM EnterpriseFolders
WHERE ItemId = @ItemID AND FolderName = @FolderName
GO
IF EXISTS (SELECT * FROM SYS.OBJECTS WHERE type = 'P' AND name = 'GetUserEnterpriseFolderWithOwaEditPermission')
DROP PROCEDURE GetUserEnterpriseFolderWithOwaEditPermission
GO
CREATE PROCEDURE [dbo].[GetUserEnterpriseFolderWithOwaEditPermission]
(
@ItemID INT,
@AccountID INT
)
AS
SELECT
EF.FolderName
FROM EnterpriseFoldersOwaPermissions AS EFOP
LEFT JOIN [dbo].[EnterpriseFolders] AS EF ON EF.EnterpriseFolderID = EFOP.FolderID
WHERE EFOP.ItemID = @ItemID AND EFOP.AccountID = @AccountID
GO GO

View file

@ -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";

View file

@ -81,6 +81,16 @@ namespace WebsitePanel.EnterpriseServer {
private System.Threading.SendOrPostCallback SetEnterpriseFolderSettingsOperationCompleted; private System.Threading.SendOrPostCallback SetEnterpriseFolderSettingsOperationCompleted;
private System.Threading.SendOrPostCallback SetEnterpriseFolderGeneralSettingsOperationCompleted;
private System.Threading.SendOrPostCallback SetEnterpriseFolderPermissionSettingsOperationCompleted;
private System.Threading.SendOrPostCallback GetFolderOwaAccountsOperationCompleted;
private System.Threading.SendOrPostCallback SetFolderOwaAccountsOperationCompleted;
private System.Threading.SendOrPostCallback GetUserEnterpriseFolderWithOwaEditPermissionOperationCompleted;
private System.Threading.SendOrPostCallback GetStatisticsOperationCompleted; private System.Threading.SendOrPostCallback GetStatisticsOperationCompleted;
private System.Threading.SendOrPostCallback GetStatisticsByOrganizationOperationCompleted; private System.Threading.SendOrPostCallback GetStatisticsByOrganizationOperationCompleted;
@ -169,6 +179,21 @@ namespace WebsitePanel.EnterpriseServer {
/// <remarks/> /// <remarks/>
public event SetEnterpriseFolderSettingsCompletedEventHandler SetEnterpriseFolderSettingsCompleted; public event SetEnterpriseFolderSettingsCompletedEventHandler SetEnterpriseFolderSettingsCompleted;
/// <remarks/>
public event SetEnterpriseFolderGeneralSettingsCompletedEventHandler SetEnterpriseFolderGeneralSettingsCompleted;
/// <remarks/>
public event SetEnterpriseFolderPermissionSettingsCompletedEventHandler SetEnterpriseFolderPermissionSettingsCompleted;
/// <remarks/>
public event GetFolderOwaAccountsCompletedEventHandler GetFolderOwaAccountsCompleted;
/// <remarks/>
public event SetFolderOwaAccountsCompletedEventHandler SetFolderOwaAccountsCompleted;
/// <remarks/>
public event GetUserEnterpriseFolderWithOwaEditPermissionCompletedEventHandler GetUserEnterpriseFolderWithOwaEditPermissionCompleted;
/// <remarks/> /// <remarks/>
public event GetStatisticsCompletedEventHandler GetStatisticsCompleted; public event GetStatisticsCompletedEventHandler GetStatisticsCompleted;
@ -1223,6 +1248,237 @@ namespace WebsitePanel.EnterpriseServer {
} }
} }
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SetEnterpriseFolderGeneralSettings", 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 void SetEnterpriseFolderGeneralSettings(int itemId, SystemFile folder, bool directoyBrowsingEnabled, int quota, QuotaType quotaType) {
this.Invoke("SetEnterpriseFolderGeneralSettings", new object[] {
itemId,
folder,
directoyBrowsingEnabled,
quota,
quotaType});
}
/// <remarks/>
public System.IAsyncResult BeginSetEnterpriseFolderGeneralSettings(int itemId, SystemFile folder, bool directoyBrowsingEnabled, int quota, QuotaType quotaType, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("SetEnterpriseFolderGeneralSettings", new object[] {
itemId,
folder,
directoyBrowsingEnabled,
quota,
quotaType}, callback, asyncState);
}
/// <remarks/>
public void EndSetEnterpriseFolderGeneralSettings(System.IAsyncResult asyncResult) {
this.EndInvoke(asyncResult);
}
/// <remarks/>
public void SetEnterpriseFolderGeneralSettingsAsync(int itemId, SystemFile folder, bool directoyBrowsingEnabled, int quota, QuotaType quotaType) {
this.SetEnterpriseFolderGeneralSettingsAsync(itemId, folder, directoyBrowsingEnabled, quota, quotaType, null);
}
/// <remarks/>
public void SetEnterpriseFolderGeneralSettingsAsync(int itemId, SystemFile folder, bool directoyBrowsingEnabled, int quota, QuotaType quotaType, object userState) {
if ((this.SetEnterpriseFolderGeneralSettingsOperationCompleted == null)) {
this.SetEnterpriseFolderGeneralSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetEnterpriseFolderGeneralSettingsOperationCompleted);
}
this.InvokeAsync("SetEnterpriseFolderGeneralSettings", new object[] {
itemId,
folder,
directoyBrowsingEnabled,
quota,
quotaType}, this.SetEnterpriseFolderGeneralSettingsOperationCompleted, userState);
}
private void OnSetEnterpriseFolderGeneralSettingsOperationCompleted(object arg) {
if ((this.SetEnterpriseFolderGeneralSettingsCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.SetEnterpriseFolderGeneralSettingsCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SetEnterpriseFolderPermissionSetting" +
"s", 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 void SetEnterpriseFolderPermissionSettings(int itemId, SystemFile folder, ESPermission[] permissions) {
this.Invoke("SetEnterpriseFolderPermissionSettings", new object[] {
itemId,
folder,
permissions});
}
/// <remarks/>
public System.IAsyncResult BeginSetEnterpriseFolderPermissionSettings(int itemId, SystemFile folder, ESPermission[] permissions, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("SetEnterpriseFolderPermissionSettings", new object[] {
itemId,
folder,
permissions}, callback, asyncState);
}
/// <remarks/>
public void EndSetEnterpriseFolderPermissionSettings(System.IAsyncResult asyncResult) {
this.EndInvoke(asyncResult);
}
/// <remarks/>
public void SetEnterpriseFolderPermissionSettingsAsync(int itemId, SystemFile folder, ESPermission[] permissions) {
this.SetEnterpriseFolderPermissionSettingsAsync(itemId, folder, permissions, null);
}
/// <remarks/>
public void SetEnterpriseFolderPermissionSettingsAsync(int itemId, SystemFile folder, ESPermission[] permissions, object userState) {
if ((this.SetEnterpriseFolderPermissionSettingsOperationCompleted == null)) {
this.SetEnterpriseFolderPermissionSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetEnterpriseFolderPermissionSettingsOperationCompleted);
}
this.InvokeAsync("SetEnterpriseFolderPermissionSettings", new object[] {
itemId,
folder,
permissions}, this.SetEnterpriseFolderPermissionSettingsOperationCompleted, userState);
}
private void OnSetEnterpriseFolderPermissionSettingsOperationCompleted(object arg) {
if ((this.SetEnterpriseFolderPermissionSettingsCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.SetEnterpriseFolderPermissionSettingsCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetFolderOwaAccounts", 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 OrganizationUser[] GetFolderOwaAccounts(int itemId, SystemFile folder) {
object[] results = this.Invoke("GetFolderOwaAccounts", new object[] {
itemId,
folder});
return ((OrganizationUser[])(results[0]));
}
/// <remarks/>
public System.IAsyncResult BeginGetFolderOwaAccounts(int itemId, SystemFile folder, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("GetFolderOwaAccounts", new object[] {
itemId,
folder}, callback, asyncState);
}
/// <remarks/>
public OrganizationUser[] EndGetFolderOwaAccounts(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((OrganizationUser[])(results[0]));
}
/// <remarks/>
public void GetFolderOwaAccountsAsync(int itemId, SystemFile folder) {
this.GetFolderOwaAccountsAsync(itemId, folder, null);
}
/// <remarks/>
public void GetFolderOwaAccountsAsync(int itemId, SystemFile folder, object userState) {
if ((this.GetFolderOwaAccountsOperationCompleted == null)) {
this.GetFolderOwaAccountsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetFolderOwaAccountsOperationCompleted);
}
this.InvokeAsync("GetFolderOwaAccounts", new object[] {
itemId,
folder}, this.GetFolderOwaAccountsOperationCompleted, userState);
}
private void OnGetFolderOwaAccountsOperationCompleted(object arg) {
if ((this.GetFolderOwaAccountsCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.GetFolderOwaAccountsCompleted(this, new GetFolderOwaAccountsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SetFolderOwaAccounts", 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 void SetFolderOwaAccounts(int itemId, SystemFile folder, OrganizationUser[] users) {
this.Invoke("SetFolderOwaAccounts", new object[] {
itemId,
folder,
users});
}
/// <remarks/>
public System.IAsyncResult BeginSetFolderOwaAccounts(int itemId, SystemFile folder, OrganizationUser[] users, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("SetFolderOwaAccounts", new object[] {
itemId,
folder,
users}, callback, asyncState);
}
/// <remarks/>
public void EndSetFolderOwaAccounts(System.IAsyncResult asyncResult) {
this.EndInvoke(asyncResult);
}
/// <remarks/>
public void SetFolderOwaAccountsAsync(int itemId, SystemFile folder, OrganizationUser[] users) {
this.SetFolderOwaAccountsAsync(itemId, folder, users, null);
}
/// <remarks/>
public void SetFolderOwaAccountsAsync(int itemId, SystemFile folder, OrganizationUser[] users, object userState) {
if ((this.SetFolderOwaAccountsOperationCompleted == null)) {
this.SetFolderOwaAccountsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetFolderOwaAccountsOperationCompleted);
}
this.InvokeAsync("SetFolderOwaAccounts", new object[] {
itemId,
folder,
users}, this.SetFolderOwaAccountsOperationCompleted, userState);
}
private void OnSetFolderOwaAccountsOperationCompleted(object arg) {
if ((this.SetFolderOwaAccountsCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.SetFolderOwaAccountsCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetUserEnterpriseFolderWithOwaEditPe" +
"rmission", 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[] GetUserEnterpriseFolderWithOwaEditPermission(int itemId, int[] accountIds) {
object[] results = this.Invoke("GetUserEnterpriseFolderWithOwaEditPermission", new object[] {
itemId,
accountIds});
return ((string[])(results[0]));
}
/// <remarks/>
public System.IAsyncResult BeginGetUserEnterpriseFolderWithOwaEditPermission(int itemId, int[] accountIds, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("GetUserEnterpriseFolderWithOwaEditPermission", new object[] {
itemId,
accountIds}, callback, asyncState);
}
/// <remarks/>
public string[] EndGetUserEnterpriseFolderWithOwaEditPermission(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((string[])(results[0]));
}
/// <remarks/>
public void GetUserEnterpriseFolderWithOwaEditPermissionAsync(int itemId, int[] accountIds) {
this.GetUserEnterpriseFolderWithOwaEditPermissionAsync(itemId, accountIds, null);
}
/// <remarks/>
public void GetUserEnterpriseFolderWithOwaEditPermissionAsync(int itemId, int[] accountIds, object userState) {
if ((this.GetUserEnterpriseFolderWithOwaEditPermissionOperationCompleted == null)) {
this.GetUserEnterpriseFolderWithOwaEditPermissionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetUserEnterpriseFolderWithOwaEditPermissionOperationCompleted);
}
this.InvokeAsync("GetUserEnterpriseFolderWithOwaEditPermission", new object[] {
itemId,
accountIds}, this.GetUserEnterpriseFolderWithOwaEditPermissionOperationCompleted, userState);
}
private void OnGetUserEnterpriseFolderWithOwaEditPermissionOperationCompleted(object arg) {
if ((this.GetUserEnterpriseFolderWithOwaEditPermissionCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.GetUserEnterpriseFolderWithOwaEditPermissionCompleted(this, new GetUserEnterpriseFolderWithOwaEditPermissionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/> /// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetStatistics", 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/GetStatistics", 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 OrganizationStatistics GetStatistics(int itemId) { public OrganizationStatistics GetStatistics(int itemId) {
@ -2053,6 +2309,70 @@ namespace WebsitePanel.EnterpriseServer {
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void SetEnterpriseFolderSettingsCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); public delegate void SetEnterpriseFolderSettingsCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void SetEnterpriseFolderGeneralSettingsCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void SetEnterpriseFolderPermissionSettingsCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void GetFolderOwaAccountsCompletedEventHandler(object sender, GetFolderOwaAccountsCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class GetFolderOwaAccountsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal GetFolderOwaAccountsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public OrganizationUser[] Result {
get {
this.RaiseExceptionIfNecessary();
return ((OrganizationUser[])(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void SetFolderOwaAccountsCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void GetUserEnterpriseFolderWithOwaEditPermissionCompletedEventHandler(object sender, GetUserEnterpriseFolderWithOwaEditPermissionCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class GetUserEnterpriseFolderWithOwaEditPermissionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal GetUserEnterpriseFolderWithOwaEditPermissionCompletedEventArgs(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/> /// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void GetStatisticsCompletedEventHandler(object sender, GetStatisticsCompletedEventArgs e); public delegate void GetStatisticsCompletedEventHandler(object sender, GetStatisticsCompletedEventArgs e);

View file

@ -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/>
@ -120,6 +120,14 @@ namespace WebsitePanel.EnterpriseServer {
private System.Threading.SendOrPostCallback InstallSessionHostsCertificateOperationCompleted; private System.Threading.SendOrPostCallback InstallSessionHostsCertificateOperationCompleted;
private System.Threading.SendOrPostCallback GetRdsCertificateByServiceIdOperationCompleted;
private System.Threading.SendOrPostCallback GetRdsCertificateByItemIdOperationCompleted;
private System.Threading.SendOrPostCallback AddRdsCertificateOperationCompleted;
private System.Threading.SendOrPostCallback GetRdsServicesOperationCompleted;
/// <remarks/> /// <remarks/>
public esRemoteDesktopServices() { public esRemoteDesktopServices() {
this.Url = "http://localhost:9002/esRemoteDesktopServices.asmx"; this.Url = "http://localhost:9002/esRemoteDesktopServices.asmx";
@ -260,6 +268,18 @@ namespace WebsitePanel.EnterpriseServer {
/// <remarks/> /// <remarks/>
public event InstallSessionHostsCertificateCompletedEventHandler InstallSessionHostsCertificateCompleted; public event InstallSessionHostsCertificateCompletedEventHandler InstallSessionHostsCertificateCompleted;
/// <remarks/>
public event GetRdsCertificateByServiceIdCompletedEventHandler GetRdsCertificateByServiceIdCompleted;
/// <remarks/>
public event GetRdsCertificateByItemIdCompletedEventHandler GetRdsCertificateByItemIdCompleted;
/// <remarks/>
public event AddRdsCertificateCompletedEventHandler AddRdsCertificateCompleted;
/// <remarks/>
public event GetRdsServicesCompletedEventHandler GetRdsServicesCompleted;
/// <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) {
@ -1984,7 +2004,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});
@ -1992,7 +2012,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);
@ -2005,12 +2025,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);
} }
@ -2028,7 +2048,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});
@ -2036,7 +2056,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);
@ -2049,12 +2069,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);
} }
@ -2072,7 +2092,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});
@ -2080,7 +2100,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);
@ -2093,12 +2113,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);
} }
@ -2116,7 +2136,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});
@ -2124,7 +2144,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);
@ -2137,12 +2157,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);
} }
@ -2245,20 +2265,16 @@ namespace WebsitePanel.EnterpriseServer {
/// <remarks/> /// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/InstallSessionHostsCertificate", 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/InstallSessionHostsCertificate", 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 InstallSessionHostsCertificate(int collectionId, [System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary")] byte[] certificate, string password) { public ResultObject InstallSessionHostsCertificate(RdsServer rdsServer) {
object[] results = this.Invoke("InstallSessionHostsCertificate", new object[] { object[] results = this.Invoke("InstallSessionHostsCertificate", new object[] {
collectionId, rdsServer});
certificate,
password});
return ((ResultObject)(results[0])); return ((ResultObject)(results[0]));
} }
/// <remarks/> /// <remarks/>
public System.IAsyncResult BeginInstallSessionHostsCertificate(int collectionId, byte[] certificate, string password, System.AsyncCallback callback, object asyncState) { public System.IAsyncResult BeginInstallSessionHostsCertificate(RdsServer rdsServer, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("InstallSessionHostsCertificate", new object[] { return this.BeginInvoke("InstallSessionHostsCertificate", new object[] {
collectionId, rdsServer}, callback, asyncState);
certificate,
password}, callback, asyncState);
} }
/// <remarks/> /// <remarks/>
@ -2268,19 +2284,17 @@ namespace WebsitePanel.EnterpriseServer {
} }
/// <remarks/> /// <remarks/>
public void InstallSessionHostsCertificateAsync(int collectionId, byte[] certificate, string password) { public void InstallSessionHostsCertificateAsync(RdsServer rdsServer) {
this.InstallSessionHostsCertificateAsync(collectionId, certificate, password, null); this.InstallSessionHostsCertificateAsync(rdsServer, null);
} }
/// <remarks/> /// <remarks/>
public void InstallSessionHostsCertificateAsync(int collectionId, byte[] certificate, string password, object userState) { public void InstallSessionHostsCertificateAsync(RdsServer rdsServer, object userState) {
if ((this.InstallSessionHostsCertificateOperationCompleted == null)) { if ((this.InstallSessionHostsCertificateOperationCompleted == null)) {
this.InstallSessionHostsCertificateOperationCompleted = new System.Threading.SendOrPostCallback(this.OnInstallSessionHostsCertificateOperationCompleted); this.InstallSessionHostsCertificateOperationCompleted = new System.Threading.SendOrPostCallback(this.OnInstallSessionHostsCertificateOperationCompleted);
} }
this.InvokeAsync("InstallSessionHostsCertificate", new object[] { this.InvokeAsync("InstallSessionHostsCertificate", new object[] {
collectionId, rdsServer}, this.InstallSessionHostsCertificateOperationCompleted, userState);
certificate,
password}, this.InstallSessionHostsCertificateOperationCompleted, userState);
} }
private void OnInstallSessionHostsCertificateOperationCompleted(object arg) { private void OnInstallSessionHostsCertificateOperationCompleted(object arg) {
@ -2290,6 +2304,167 @@ namespace WebsitePanel.EnterpriseServer {
} }
} }
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetRdsCertificateByServiceId", 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 GetRdsCertificateByServiceId(int serviceId) {
object[] results = this.Invoke("GetRdsCertificateByServiceId", new object[] {
serviceId});
return ((RdsCertificate)(results[0]));
}
/// <remarks/>
public System.IAsyncResult BeginGetRdsCertificateByServiceId(int serviceId, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("GetRdsCertificateByServiceId", new object[] {
serviceId}, callback, asyncState);
}
/// <remarks/>
public RdsCertificate EndGetRdsCertificateByServiceId(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((RdsCertificate)(results[0]));
}
/// <remarks/>
public void GetRdsCertificateByServiceIdAsync(int serviceId) {
this.GetRdsCertificateByServiceIdAsync(serviceId, null);
}
/// <remarks/>
public void GetRdsCertificateByServiceIdAsync(int serviceId, object userState) {
if ((this.GetRdsCertificateByServiceIdOperationCompleted == null)) {
this.GetRdsCertificateByServiceIdOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRdsCertificateByServiceIdOperationCompleted);
}
this.InvokeAsync("GetRdsCertificateByServiceId", new object[] {
serviceId}, this.GetRdsCertificateByServiceIdOperationCompleted, userState);
}
private void OnGetRdsCertificateByServiceIdOperationCompleted(object arg) {
if ((this.GetRdsCertificateByServiceIdCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.GetRdsCertificateByServiceIdCompleted(this, new GetRdsCertificateByServiceIdCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetRdsCertificateByItemId", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public RdsCertificate GetRdsCertificateByItemId([System.Xml.Serialization.XmlElementAttribute(IsNullable=true)] System.Nullable<int> itemId) {
object[] results = this.Invoke("GetRdsCertificateByItemId", new object[] {
itemId});
return ((RdsCertificate)(results[0]));
}
/// <remarks/>
public System.IAsyncResult BeginGetRdsCertificateByItemId(System.Nullable<int> itemId, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("GetRdsCertificateByItemId", new object[] {
itemId}, callback, asyncState);
}
/// <remarks/>
public RdsCertificate EndGetRdsCertificateByItemId(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((RdsCertificate)(results[0]));
}
/// <remarks/>
public void GetRdsCertificateByItemIdAsync(System.Nullable<int> itemId) {
this.GetRdsCertificateByItemIdAsync(itemId, null);
}
/// <remarks/>
public void GetRdsCertificateByItemIdAsync(System.Nullable<int> itemId, object userState) {
if ((this.GetRdsCertificateByItemIdOperationCompleted == null)) {
this.GetRdsCertificateByItemIdOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRdsCertificateByItemIdOperationCompleted);
}
this.InvokeAsync("GetRdsCertificateByItemId", new object[] {
itemId}, this.GetRdsCertificateByItemIdOperationCompleted, userState);
}
private void OnGetRdsCertificateByItemIdOperationCompleted(object arg) {
if ((this.GetRdsCertificateByItemIdCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.GetRdsCertificateByItemIdCompleted(this, new GetRdsCertificateByItemIdCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/AddRdsCertificate", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public ResultObject AddRdsCertificate(RdsCertificate certificate) {
object[] results = this.Invoke("AddRdsCertificate", new object[] {
certificate});
return ((ResultObject)(results[0]));
}
/// <remarks/>
public System.IAsyncResult BeginAddRdsCertificate(RdsCertificate certificate, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("AddRdsCertificate", new object[] {
certificate}, callback, asyncState);
}
/// <remarks/>
public ResultObject EndAddRdsCertificate(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((ResultObject)(results[0]));
}
/// <remarks/>
public void AddRdsCertificateAsync(RdsCertificate certificate) {
this.AddRdsCertificateAsync(certificate, null);
}
/// <remarks/>
public void AddRdsCertificateAsync(RdsCertificate certificate, object userState) {
if ((this.AddRdsCertificateOperationCompleted == null)) {
this.AddRdsCertificateOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddRdsCertificateOperationCompleted);
}
this.InvokeAsync("AddRdsCertificate", new object[] {
certificate}, this.AddRdsCertificateOperationCompleted, userState);
}
private void OnAddRdsCertificateOperationCompleted(object arg) {
if ((this.AddRdsCertificateCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.AddRdsCertificateCompleted(this, new AddRdsCertificateCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <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/> /// <remarks/>
public new void CancelAsync(object userState) { public new void CancelAsync(object userState) {
base.CancelAsync(userState); base.CancelAsync(userState);
@ -3465,4 +3640,108 @@ namespace WebsitePanel.EnterpriseServer {
} }
} }
} }
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void GetRdsCertificateByServiceIdCompletedEventHandler(object sender, GetRdsCertificateByServiceIdCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class GetRdsCertificateByServiceIdCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal GetRdsCertificateByServiceIdCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public RdsCertificate Result {
get {
this.RaiseExceptionIfNecessary();
return ((RdsCertificate)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void GetRdsCertificateByItemIdCompletedEventHandler(object sender, GetRdsCertificateByItemIdCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class GetRdsCertificateByItemIdCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal GetRdsCertificateByItemIdCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public RdsCertificate Result {
get {
this.RaiseExceptionIfNecessary();
return ((RdsCertificate)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void AddRdsCertificateCompletedEventHandler(object sender, AddRdsCertificateCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class AddRdsCertificateCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal AddRdsCertificateCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public ResultObject Result {
get {
this.RaiseExceptionIfNecessary();
return ((ResultObject)(this.results[0]));
}
}
}
/// <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]));
}
}
}
} }

View file

@ -4543,6 +4543,69 @@ namespace WebsitePanel.EnterpriseServer
); );
} }
public static void DeleteAllEnterpriseFolderOwaUsers(int itemId, int folderId)
{
SqlHelper.ExecuteNonQuery(
ConnectionString,
CommandType.StoredProcedure,
"DeleteAllEnterpriseFolderOwaUsers",
new SqlParameter("@ItemID", itemId),
new SqlParameter("@FolderID", folderId)
);
}
public static int AddEnterpriseFolderOwaUser(int itemId, int folderId, int accountId)
{
SqlParameter id = new SqlParameter("@ESOwsaUserId", SqlDbType.Int);
id.Direction = ParameterDirection.Output;
SqlHelper.ExecuteNonQuery(
ConnectionString,
CommandType.StoredProcedure,
"AddEnterpriseFolderOwaUser",
id,
new SqlParameter("@ItemID", itemId),
new SqlParameter("@FolderID", folderId),
new SqlParameter("@AccountId", accountId)
);
// read identity
return Convert.ToInt32(id.Value);
}
public static IDataReader GetEnterpriseFolderOwaUsers(int itemId, int folderId)
{
return SqlHelper.ExecuteReader(
ConnectionString,
CommandType.StoredProcedure,
"GetEnterpriseFolderOwaUsers",
new SqlParameter("@ItemID", itemId),
new SqlParameter("@FolderID", folderId)
);
}
public static IDataReader GetEnterpriseFolderId(int itemId, string folderName)
{
return SqlHelper.ExecuteReader(
ConnectionString,
CommandType.StoredProcedure,
"GetEnterpriseFolderId",
new SqlParameter("@ItemID", itemId),
new SqlParameter("@FolderName", folderName)
);
}
public static IDataReader GetUserEnterpriseFolderWithOwaEditPermission(int itemId, int accountId)
{
return SqlHelper.ExecuteReader(
ConnectionString,
CommandType.StoredProcedure,
"GetUserEnterpriseFolderWithOwaEditPermission",
new SqlParameter("@ItemID", itemId),
new SqlParameter("@AccountID", accountId)
);
}
#endregion #endregion
#region Support Service Levels #region Support Service Levels
@ -4613,6 +4676,37 @@ namespace WebsitePanel.EnterpriseServer
#region RDS #region RDS
public static int AddRdsCertificate(int serviceId, string content, byte[] hash, string fileName, DateTime? validFrom, DateTime? expiryDate)
{
SqlParameter rdsCertificateId = new SqlParameter("@RDSCertificateID", SqlDbType.Int);
rdsCertificateId.Direction = ParameterDirection.Output;
SqlHelper.ExecuteNonQuery(
ConnectionString,
CommandType.StoredProcedure,
"AddRDSCertificate",
rdsCertificateId,
new SqlParameter("@ServiceId", serviceId),
new SqlParameter("@Content", content),
new SqlParameter("@Hash", Convert.ToBase64String(hash)),
new SqlParameter("@FileName", fileName),
new SqlParameter("@ValidFrom", validFrom),
new SqlParameter("@ExpiryDate", expiryDate)
);
return Convert.ToInt32(rdsCertificateId.Value);
}
public static IDataReader GetRdsCertificateByServiceId(int serviceId)
{
return SqlHelper.ExecuteReader(
ConnectionString,
CommandType.StoredProcedure,
"GetRDSCertificateByServiceId",
new SqlParameter("@ServiceId", serviceId)
);
}
public static IDataReader GetRdsCollectionSettingsByCollectionId(int collectionId) public static IDataReader GetRdsCollectionSettingsByCollectionId(int collectionId)
{ {
return SqlHelper.ExecuteReader( return SqlHelper.ExecuteReader(

View file

@ -32,6 +32,7 @@ using System.Collections.Specialized;
using System.Globalization; using System.Globalization;
using System.Linq; using System.Linq;
using System.Xml; using System.Xml;
using System.Text;
using System.Xml.Serialization; using System.Xml.Serialization;
using WebsitePanel.Providers; using WebsitePanel.Providers;
using WebsitePanel.Providers.DNS; using WebsitePanel.Providers.DNS;
@ -385,7 +386,9 @@ namespace WebsitePanel.EnterpriseServer
var idn = new IdnMapping(); var idn = new IdnMapping();
if (itemType == typeof(DnsZone)) if (itemType == typeof(DnsZone))
items.AddRange(dns.GetZones().Select(z => idn.GetUnicode(z))); items.AddRange(dns.GetZones().Select(z =>
Encoding.UTF8.GetByteCount(z) == z.Length ? // IsASCII
idn.GetUnicode(z) : z ));
return items; return items;
} }

View file

@ -152,6 +152,16 @@ namespace WebsitePanel.EnterpriseServer
StartESBackgroundTaskInternal("SET_ENTERPRISE_FOLDER_SETTINGS", itemId, folder, permissions, directoyBrowsingEnabled, quota, quotaType); StartESBackgroundTaskInternal("SET_ENTERPRISE_FOLDER_SETTINGS", itemId, folder, permissions, directoyBrowsingEnabled, quota, quotaType);
} }
public static void SetESGeneralSettings(int itemId, SystemFile folder, bool directoyBrowsingEnabled, int quota, QuotaType quotaType)
{
SetESGeneralSettingsInternal("SET_ENTERPRISE_FOLDER_GENERAL_SETTINGS", itemId, folder, directoyBrowsingEnabled, quota, quotaType);
}
public static void SetESFolderPermissionSettings(int itemId, SystemFile folder, ESPermission[] permissions)
{
SetESFolderPermissionSettingsInternal("SET_ENTERPRISE_FOLDER_GENERAL_SETTINGS", itemId, folder, permissions);
}
public static int AddWebDavAccessToken(WebDavAccessToken accessToken) public static int AddWebDavAccessToken(WebDavAccessToken accessToken)
{ {
return DataProvider.AddWebDavAccessToken(accessToken); return DataProvider.AddWebDavAccessToken(accessToken);
@ -257,6 +267,69 @@ namespace WebsitePanel.EnterpriseServer
return rootFolders; return rootFolders;
} }
protected static void SetESGeneralSettingsInternal(string taskName, int itemId, SystemFile folder, bool directoyBrowsingEnabled, int quota, QuotaType quotaType)
{
// load organization
var org = OrganizationController.GetOrganization(itemId);
try
{
TaskManager.StartTask("ENTERPRISE_STORAGE", taskName, org.PackageId);
EnterpriseStorageController.SetFRSMQuotaOnFolder(itemId, folder.Name, quota, quotaType);
EnterpriseStorageController.SetDirectoryBrowseEnabled(itemId, folder.Url, directoyBrowsingEnabled);
}
catch (Exception ex)
{
// log error
TaskManager.WriteError(ex, "Error executing enterprise storage background task");
}
finally
{
// complete task
try
{
TaskManager.CompleteTask();
}
catch (Exception)
{
}
}
}
protected static void SetESFolderPermissionSettingsInternal(string taskName, int itemId, SystemFile folder, ESPermission[] permissions)
{
// load organization
var org = OrganizationController.GetOrganization(itemId);
new Thread(() =>
{
try
{
TaskManager.StartTask("ENTERPRISE_STORAGE", taskName, org.PackageId);
EnterpriseStorageController.SetFolderPermission(itemId, folder.Name, permissions);
}
catch (Exception ex)
{
// log error
TaskManager.WriteError(ex, "Error executing enterprise storage background task");
}
finally
{
// complete task
try
{
TaskManager.CompleteTask();
}
catch (Exception)
{
}
}
}).Start();
}
protected static void StartESBackgroundTaskInternal(string taskName, int itemId, SystemFile folder, ESPermission[] permissions, bool directoyBrowsingEnabled, int quota, QuotaType quotaType) protected static void StartESBackgroundTaskInternal(string taskName, int itemId, SystemFile folder, ESPermission[] permissions, bool directoyBrowsingEnabled, int quota, QuotaType quotaType)
{ {
// load organization // load organization
@ -1265,6 +1338,87 @@ namespace WebsitePanel.EnterpriseServer
return null; return null;
} }
public static OrganizationUser[] GetFolderOwaAccounts(int itemId, string folderName)
{
try
{
var folderId = GetFolderId(itemId, folderName);
var users = ObjectUtils.CreateListFromDataReader<OrganizationUser>(DataProvider.GetEnterpriseFolderOwaUsers(itemId, folderId));
return users.ToArray();
}
catch (Exception ex)
{
throw ex;
}
}
public static void SetFolderOwaAccounts(int itemId, string folderName, OrganizationUser[] users)
{
try
{
var folderId = GetFolderId(itemId, folderName);
DataProvider.DeleteAllEnterpriseFolderOwaUsers(itemId, folderId);
foreach (var user in users)
{
DataProvider.AddEnterpriseFolderOwaUser(itemId, folderId, user.AccountId);
}
}
catch (Exception ex)
{
throw ex;
}
}
protected static int GetFolderId(int itemId, string folderName)
{
try
{
GetFolder(itemId, folderName);
var dataReader = DataProvider.GetEnterpriseFolderId(itemId, folderName);
while (dataReader.Read())
{
return (int)dataReader[0];
}
return -1;
}
catch (Exception ex)
{
throw ex;
}
}
public static List<string> GetUserEnterpriseFolderWithOwaEditPermission(int itemId, List<int> accountIds)
{
try
{
var result = new List<string>();
foreach (var accountId in accountIds)
{
var reader = DataProvider.GetUserEnterpriseFolderWithOwaEditPermission(itemId, accountId);
while (reader.Read())
{
result.Add(Convert.ToString(reader["FolderName"]));
}
}
return result.Distinct().ToList();
}
catch (Exception ex)
{
throw ex;
}
}
#region WebDav portal #region WebDav portal
public static string GetWebDavPortalUserSettingsByAccountId(int accountId) public static string GetWebDavPortalUserSettingsByAccountId(int accountId)

View file

@ -248,22 +248,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);
} }
@ -278,31 +278,53 @@ namespace WebsitePanel.EnterpriseServer
return SaveRdsCollectionLocalAdminsInternal(users, collectionId); return SaveRdsCollectionLocalAdminsInternal(users, collectionId);
} }
public static ResultObject InstallSessionHostsCertificate(int collectionId, byte[] certificate, string password) public static ResultObject InstallSessionHostsCertificate(RdsServer rdsServer)
{ {
return InstallSessionHostsCertificateInternal(collectionId, certificate, password); return InstallSessionHostsCertificateInternal(rdsServer);
} }
private static ResultObject InstallSessionHostsCertificateInternal(int collectionId, byte[] certificate, string password) public static RdsCertificate GetRdsCertificateByServiceId(int serviceId)
{
return GetRdsCertificateByServiceIdInternal(serviceId);
}
public static RdsCertificate GetRdsCertificateByItemId(int? itemId)
{
return GetRdsCertificateByItemIdInternal(itemId);
}
public static ResultObject AddRdsCertificate(RdsCertificate 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));
}
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
{ {
var collection = ObjectUtils.FillObjectFromDataReader<RdsCollection>(DataProvider.GetRDSCollectionById(collectionId)); int serviceId = GetRdsServiceId(rdsServer.ItemId);
Organization org = OrganizationController.GetOrganization(collection.ItemId); var rds = GetRemoteDesktopServices(serviceId);
var certificate = GetRdsCertificateByServiceIdInternal(serviceId);
var array = Convert.FromBase64String(certificate.Hash);
char[] chars = new char[array.Length / sizeof(char)];
System.Buffer.BlockCopy(array, 0, chars, 0, array.Length);
string password = new string(chars);
byte[] content = Convert.FromBase64String(certificate.Content);
if (org == null) rds.InstallCertificate(content, password, new string[] {rdsServer.FqdName});
{
result.IsSuccess = false;
result.AddError("", new NullReferenceException("Organization not found"));
return result;
}
var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
var servers = ObjectUtils.CreateListFromDataReader<RdsServer>(DataProvider.GetRDSServersByCollectionId(collection.Id)).ToList();
rds.InstallCertificate(certificate, password, servers.Select(s => s.FqdName).ToArray());
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -323,6 +345,57 @@ namespace WebsitePanel.EnterpriseServer
return result; return result;
} }
private static RdsCertificate GetRdsCertificateByServiceIdInternal(int serviceId)
{
var result = ObjectUtils.FillObjectFromDataReader<RdsCertificate>(DataProvider.GetRdsCertificateByServiceId(serviceId));
return result;
}
private static RdsCertificate GetRdsCertificateByItemIdInternal(int? itemId)
{
int serviceId = GetRdsServiceId(itemId);
var result = ObjectUtils.FillObjectFromDataReader<RdsCertificate>(DataProvider.GetRdsCertificateByServiceId(serviceId));
return result;
}
private static ResultObject AddRdsCertificateInternal(RdsCertificate certificate)
{
var result = TaskManager.StartResultTask<ResultObject>("REMOTE_DESKTOP_SERVICES", "ADD_RDS_SERVER");
try
{
byte[] hash = new byte[certificate.Hash.Length * sizeof(char)];
System.Buffer.BlockCopy(certificate.Hash.ToCharArray(), 0, hash, 0, hash.Length);
certificate.Id = DataProvider.AddRdsCertificate(certificate.ServiceId, certificate.Content, hash, certificate.FileName, certificate.ValidFrom, certificate.ExpiryDate);
}
catch (Exception ex)
{
if (ex.InnerException != null)
{
result.AddError("Unable to add RDS Certificate", ex.InnerException);
}
else
{
result.AddError("Unable to add RDS Certificate", ex);
}
}
finally
{
if (!result.IsSuccess)
{
TaskManager.CompleteResultTask(result);
}
else
{
TaskManager.CompleteResultTask();
}
}
return result;
}
private static RdsCollection GetRdsCollectionInternal(int collectionId) private static RdsCollection GetRdsCollectionInternal(int collectionId)
{ {
var collection = ObjectUtils.FillObjectFromDataReader<RdsCollection>(DataProvider.GetRDSCollectionById(collectionId)); var collection = ObjectUtils.FillObjectFromDataReader<RdsCollection>(DataProvider.GetRDSCollectionById(collectionId));
@ -370,9 +443,9 @@ namespace WebsitePanel.EnterpriseServer
var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId)); var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
var organizationUsers = OrganizationController.GetOrganizationUsersPaged(collection.ItemId, null, null, null, 0, Int32.MaxValue).PageUsers; var organizationUsers = OrganizationController.GetOrganizationUsersPaged(collection.ItemId, null, null, null, 0, Int32.MaxValue).PageUsers;
var organizationAdmins = rds.GetRdsCollectionLocalAdmins(servers.First().FqdName); var organizationAdmins = rds.GetRdsCollectionLocalAdmins(org.OrganizationId, collection.Name);
return organizationUsers.Where(o => organizationAdmins.Select(a => a.ToLower()).Contains(o.DomainUserName.ToLower())).ToList(); return organizationUsers.Where(o => organizationAdmins.Select(a => a.ToLower()).Contains(o.SamAccountName.ToLower())).ToList();
} }
private static ResultObject SaveRdsCollectionLocalAdminsInternal(OrganizationUser[] users, int collectionId) private static ResultObject SaveRdsCollectionLocalAdminsInternal(OrganizationUser[] users, int collectionId)
@ -394,7 +467,7 @@ namespace WebsitePanel.EnterpriseServer
var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId)); var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
var servers = ObjectUtils.CreateListFromDataReader<RdsServer>(DataProvider.GetRDSServersByCollectionId(collection.Id)).ToList(); var servers = ObjectUtils.CreateListFromDataReader<RdsServer>(DataProvider.GetRDSServersByCollectionId(collection.Id)).ToList();
rds.SaveRdsCollectionLocalAdmins(users, servers.Select(s => s.FqdName).ToArray()); rds.SaveRdsCollectionLocalAdmins(users.Select(u => u.AccountName).ToArray(), servers.Select(s => s.FqdName).ToArray(), org.OrganizationId, collection.Name);
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -420,19 +493,22 @@ namespace WebsitePanel.EnterpriseServer
var collection = ObjectUtils.FillObjectFromDataReader<RdsCollection>(DataProvider.GetRDSCollectionById(collectionId)); var collection = ObjectUtils.FillObjectFromDataReader<RdsCollection>(DataProvider.GetRDSCollectionById(collectionId));
var settings = ObjectUtils.FillObjectFromDataReader<RdsCollectionSettings>(DataProvider.GetRdsCollectionSettingsByCollectionId(collectionId)); var settings = ObjectUtils.FillObjectFromDataReader<RdsCollectionSettings>(DataProvider.GetRdsCollectionSettingsByCollectionId(collectionId));
if (settings.SecurityLayer == null) if (settings != null)
{ {
settings.SecurityLayer = SecurityLayerValues.Negotiate.ToString(); if (settings.SecurityLayer == null)
} {
settings.SecurityLayer = SecurityLayerValues.Negotiate.ToString();
}
if (settings.EncryptionLevel == null) if (settings.EncryptionLevel == null)
{ {
settings.EncryptionLevel = EncryptionLevel.ClientCompatible.ToString(); settings.EncryptionLevel = EncryptionLevel.ClientCompatible.ToString();
} }
if (settings.AuthenticateUsingNLA == null) if (settings.AuthenticateUsingNLA == null)
{ {
settings.AuthenticateUsingNLA = true; settings.AuthenticateUsingNLA = true;
}
} }
return settings; return settings;
@ -453,17 +529,31 @@ namespace WebsitePanel.EnterpriseServer
private static int AddRdsCollectionInternal(int itemId, RdsCollection collection) private static int AddRdsCollectionInternal(int itemId, RdsCollection collection)
{ {
var result = TaskManager.StartResultTask<ResultObject>("REMOTE_DESKTOP_SERVICES", "ADD_RDS_COLLECTION"); var result = TaskManager.StartResultTask<ResultObject>("REMOTE_DESKTOP_SERVICES", "ADD_RDS_COLLECTION");
var domainName = IPGlobalProperties.GetIPGlobalProperties().DomainName;
try try
{ {
// load organization
Organization org = OrganizationController.GetOrganization(itemId); Organization org = OrganizationController.GetOrganization(itemId);
if (org == null) if (org == null)
{ {
return -1; return -1;
} }
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
@ -743,7 +833,7 @@ namespace WebsitePanel.EnterpriseServer
FillRdsServerData(tmpServer); FillRdsServerData(tmpServer);
} }
result.Servers = tmpServers.ToArray(); result.Servers = tmpServers.ToArray();
return result; return result;
} }
@ -935,27 +1025,29 @@ namespace WebsitePanel.EnterpriseServer
try try
{ {
if (CheckRDSServerAvaliable(rdsServer.FqdName)) int serviceId = GetRdsMainServiceId();
var rds = GetRemoteDesktopServices(serviceId);
if (rds.CheckRDSServerAvaliable(rdsServer.FqdName))
{ {
rdsServer.Id = DataProvider.AddRDSServer(rdsServer.Name, rdsServer.FqdName, rdsServer.Description); var domainName = IPGlobalProperties.GetIPGlobalProperties().DomainName;
if (rdsServer.FqdName.EndsWith(domainName, StringComparison.CurrentCultureIgnoreCase))
{
rds.AddSessionHostFeatureToServer(rdsServer.FqdName);
rds.MoveSessionHostToRdsOU(rdsServer.Name);
rdsServer.Id = DataProvider.AddRDSServer(rdsServer.Name, rdsServer.FqdName, rdsServer.Description);
}
else
{
throw TaskManager.WriteError(new Exception("Fully Qualified Domain Name not valid."));
}
} }
else else
{ {
result.AddError("REMOTE_DESKTOP_SERVICES_ADD_RDS_SERVER", new Exception("The server that you are adding, is not available")); throw TaskManager.WriteError(new Exception(string.Format("Unable to connect to {0} server. Please double check Server Full Name setting and retry.", rdsServer.FqdName)));
return result;
} }
} }
catch (Exception ex)
{
if (ex.InnerException != null)
{
result.AddError("Unable to add RDS Server", ex.InnerException);
}
else
{
result.AddError("Unable to add RDS Server", ex);
}
}
finally finally
{ {
if (!result.IsSuccess) if (!result.IsSuccess)
@ -1101,12 +1193,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);
} }
@ -1415,36 +1501,32 @@ 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
{ {
result = rds.GetRdsServerStatus(fqdnName); if (serviceId != -1)
{
var rds = GetRemoteDesktopServices(serviceId);
result = rds.GetRdsServerStatus(fqdnName);
}
} }
catch catch
{ {
@ -1453,23 +1535,19 @@ 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")); rds.ShutDownRdsServer(fqdnName);
return result;
} }
var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
rds.ShutDownRdsServer(fqdnName);
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -1490,23 +1568,19 @@ 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")); rds.RestartRdsServer(fqdnName);
return result;
} }
var rds = GetRemoteDesktopServices(GetRemoteDesktopServiceID(org.PackageId));
rds.RestartRdsServer(fqdnName);
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -1668,22 +1742,7 @@ namespace WebsitePanel.EnterpriseServer
var address = Dns.GetHostAddresses(hostname); var address = Dns.GetHostAddresses(hostname);
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)
{ {
@ -1727,16 +1786,58 @@ namespace WebsitePanel.EnterpriseServer
private static int GetRemoteDesktopServiceID(int packageId) private static int GetRemoteDesktopServiceID(int packageId)
{ {
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();
ServiceProviderProxy.Init(rds, serviceId); ServiceProviderProxy.Init(rds, serviceId);
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(" ", "_"));

View file

@ -196,6 +196,36 @@ namespace WebsitePanel.EnterpriseServer
EnterpriseStorageController.StartSetEnterpriseFolderSettingsBackgroundTask(itemId, folder, permissions, directoyBrowsingEnabled, quota, quotaType); EnterpriseStorageController.StartSetEnterpriseFolderSettingsBackgroundTask(itemId, folder, permissions, directoyBrowsingEnabled, quota, quotaType);
} }
[WebMethod]
public void SetEnterpriseFolderGeneralSettings(int itemId, SystemFile folder, bool directoyBrowsingEnabled, int quota, QuotaType quotaType)
{
EnterpriseStorageController.SetESGeneralSettings(itemId, folder, directoyBrowsingEnabled, quota, quotaType);
}
[WebMethod]
public void SetEnterpriseFolderPermissionSettings(int itemId, SystemFile folder, ESPermission[] permissions)
{
EnterpriseStorageController.SetESFolderPermissionSettings(itemId, folder, permissions);
}
[WebMethod]
public OrganizationUser[] GetFolderOwaAccounts(int itemId, SystemFile folder)
{
return EnterpriseStorageController.GetFolderOwaAccounts(itemId, folder.Name);
}
[WebMethod]
public void SetFolderOwaAccounts(int itemId, SystemFile folder, OrganizationUser[] users)
{
EnterpriseStorageController.SetFolderOwaAccounts(itemId, folder.Name, users);
}
[WebMethod]
public List<string> GetUserEnterpriseFolderWithOwaEditPermission(int itemId, List<int> accountIds)
{
return EnterpriseStorageController.GetUserEnterpriseFolderWithOwaEditPermission(itemId, accountIds);
}
#endregion #endregion
#region Statistics #region Statistics

View file

@ -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);
} }
@ -327,9 +327,33 @@ namespace WebsitePanel.EnterpriseServer
} }
[WebMethod] [WebMethod]
public ResultObject InstallSessionHostsCertificate(int collectionId, byte[] certificate, string password) public ResultObject InstallSessionHostsCertificate(RdsServer rdsServer)
{ {
return RemoteDesktopServicesController.InstallSessionHostsCertificate(collectionId, certificate, password); return RemoteDesktopServicesController.InstallSessionHostsCertificate(rdsServer);
}
[WebMethod]
public RdsCertificate GetRdsCertificateByServiceId(int serviceId)
{
return RemoteDesktopServicesController.GetRdsCertificateByServiceId(serviceId);
}
[WebMethod]
public RdsCertificate GetRdsCertificateByItemId(int? itemId)
{
return RemoteDesktopServicesController.GetRdsCertificateByItemId(itemId);
}
[WebMethod]
public ResultObject AddRdsCertificate(RdsCertificate certificate)
{
return RemoteDesktopServicesController.AddRdsCertificate(certificate);
}
[WebMethod]
public List<ServiceInfo> GetRdsServices()
{
return RemoteDesktopServicesController.GetRdsServices();
} }
} }
} }

View file

@ -145,6 +145,7 @@ namespace WebsitePanel.Providers.OS
} }
public string RelativeUrl { get; set; } public string RelativeUrl { get; set; }
public string Summary { get; set; }
public string DriveLetter public string DriveLetter
{ {

View file

@ -74,10 +74,11 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
string GetRdsServerStatus(string serverName); string GetRdsServerStatus(string serverName);
void ShutDownRdsServer(string serverName); void ShutDownRdsServer(string serverName);
void RestartRdsServer(string serverName); void RestartRdsServer(string serverName);
void SaveRdsCollectionLocalAdmins(List<OrganizationUser> users, List<string> hosts); void SaveRdsCollectionLocalAdmins(List<string> users, List<string> hosts, string collectionName, string organizationId);
List<string> GetRdsCollectionLocalAdmins(string hostName); List<string> GetRdsCollectionLocalAdmins(string organizationId, string collectionName);
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);
} }
} }

View file

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace WebsitePanel.Providers.RemoteDesktopServices
{
public class RdsCertificate
{
public int Id { get; set; }
public int ServiceId { get; set; }
public string FileName { get; set; }
public string Content { get; set; }
public string Hash { get; set; }
public DateTime? ValidFrom { get; set; }
public DateTime? ExpiryDate { get; set; }
}
}

View file

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

View file

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

View file

@ -129,6 +129,7 @@
<Compile Include="OS\QuotaType.cs" /> <Compile Include="OS\QuotaType.cs" />
<Compile Include="OS\SystemFilesPaged.cs" /> <Compile Include="OS\SystemFilesPaged.cs" />
<Compile Include="RemoteDesktopServices\IRemoteDesktopServices.cs" /> <Compile Include="RemoteDesktopServices\IRemoteDesktopServices.cs" />
<Compile Include="RemoteDesktopServices\RdsCertificate.cs" />
<Compile Include="RemoteDesktopServices\RdsCollection.cs" /> <Compile Include="RemoteDesktopServices\RdsCollection.cs" />
<Compile Include="RemoteDesktopServices\RdsCollectionPaged.cs" /> <Compile Include="RemoteDesktopServices\RdsCollectionPaged.cs" />
<Compile Include="RemoteDesktopServices\RdsCollectionSettings.cs" /> <Compile Include="RemoteDesktopServices\RdsCollectionSettings.cs" />

View file

@ -304,7 +304,7 @@ namespace WebsitePanel.Providers.EnterpriseStorage
var rootFolder = Path.Combine(settings.LocationDrive + ":\\", settings.HomeFolder); var rootFolder = Path.Combine(settings.LocationDrive + ":\\", settings.HomeFolder);
rootFolder = Path.Combine(rootFolder, organizationId); rootFolder = Path.Combine(rootFolder, organizationId);
var wsSql = string.Format(@"SELECT System.FileName, System.DateModified, System.Size, System.Kind, System.ItemPathDisplay, System.ItemType FROM SYSTEMINDEX WHERE System.FileName LIKE '%{0}%' AND ({1})", var wsSql = string.Format(@"SELECT System.FileName, System.DateModified, System.Size, System.Kind, System.ItemPathDisplay, System.ItemType, System.Search.AutoSummary FROM SYSTEMINDEX WHERE System.FileName LIKE '%{0}%' AND ({1})",
searchText, string.Join(" OR ", searchPaths.Select(x => string.Format("{0} = '{1}'", recursive ? "SCOPE" : "DIRECTORY", Path.Combine(rootFolder, x))).ToArray())); searchText, string.Join(" OR ", searchPaths.Select(x => string.Format("{0} = '{1}'", recursive ? "SCOPE" : "DIRECTORY", Path.Combine(rootFolder, x))).ToArray()));
conn.Open(); conn.Open();
@ -318,7 +318,7 @@ namespace WebsitePanel.Providers.EnterpriseStorage
var file = new SystemFile {Name = reader[0] as string}; var file = new SystemFile {Name = reader[0] as string};
file.Changed = file.CreatedDate = reader[1] is DateTime ? (DateTime)reader[1] : new DateTime(); file.Changed = file.CreatedDate = reader[1] is DateTime ? (DateTime)reader[1] : new DateTime();
file.Size = reader[2] is long ? (long) reader[2] : 0; file.Size = reader[2] is Decimal ? Convert.ToInt64((Decimal) reader[2]) : 0;
var kind = reader[3] is IEnumerable ? ((IEnumerable)reader[3]).Cast<string>().ToList() : null; var kind = reader[3] is IEnumerable ? ((IEnumerable)reader[3]).Cast<string>().ToList() : null;
var itemType = reader[5] as string ?? string.Empty; var itemType = reader[5] as string ?? string.Empty;
@ -342,6 +342,8 @@ namespace WebsitePanel.Providers.EnterpriseStorage
} }
} }
file.Summary = SanitizeXmlString(reader[6] as string);
result.Add(file); result.Add(file);
} }
} }
@ -352,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()

View file

@ -64,15 +64,19 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
private const string Computers = "Computers"; private const string Computers = "Computers";
private const string AdDcComputers = "Domain Controllers"; private const string AdDcComputers = "Domain Controllers";
private const string Users = "users"; private const string Users = "users";
private const string Admins = "Admins";
private const string RdsGroupFormat = "rds-{0}-{1}"; private const string RdsGroupFormat = "rds-{0}-{1}";
private const string RdsModuleName = "RemoteDesktopServices"; private const string RdsModuleName = "RemoteDesktopServices";
private const string AddNpsString = "netsh nps add np name=\"\"{0}\"\" policysource=\"1\" processingorder=\"{1}\" conditionid=\"0x3d\" conditiondata=\"^5$\" conditionid=\"0x1fb5\" conditiondata=\"{2}\" conditionid=\"0x1e\" conditiondata=\"UserAuthType:(PW|CA)\" profileid=\"0x1005\" profiledata=\"TRUE\" profileid=\"0x100f\" profiledata=\"TRUE\" profileid=\"0x1009\" profiledata=\"0x7\" profileid=\"0x1fe6\" profiledata=\"0x40000000\""; private const string AddNpsString = "netsh nps add np name=\"\"{0}\"\" policysource=\"1\" processingorder=\"{1}\" conditionid=\"0x3d\" conditiondata=\"^5$\" conditionid=\"0x1fb5\" conditiondata=\"{2}\" conditionid=\"0x1e\" conditiondata=\"UserAuthType:(PW|CA)\" profileid=\"0x1005\" profiledata=\"TRUE\" profileid=\"0x100f\" profiledata=\"TRUE\" profileid=\"0x1009\" profiledata=\"0x7\" profileid=\"0x1fe6\" profiledata=\"0x40000000\"";
private const string WspAdministratorsGroupName = "WSP-Org-Administrators"; private const string WspAdministratorsGroupDescription = "WSP RDS Collection Adminstrators";
private const string WspAdministratorsGroupDescription = "WSP Org Administrators"; private const string RdsCollectionUsersGroupDescription = "WSP RDS Collection Users";
private const string RdsServersOU = "RDSServers"; private const string RdsCollectionComputersGroupDescription = "WSP RDS Collection Computers";
private const string RDSHelpDeskComputerGroup = "Websitepanel-RDSHelpDesk-Computer"; private const string RdsServersOU = "RDSServersOU";
private const string RdsServersRootOU = "RDSRootServersOU";
private const string RDSHelpDeskComputerGroup = "Websitepanel-RDSHelpDesk-Computer";
private const string RDSHelpDeskGroup = "WSP-HelpDeskAdministrators"; private const string RDSHelpDeskGroup = "WSP-HelpDeskAdministrators";
private const string RDSHelpDeskGroupDescription = "WSP Help Desk Administrators"; private const string RDSHelpDeskGroupDescription = "WSP Help Desk Administrators";
private const string LocalAdministratorsGroupName = "Administrators";
#endregion #endregion
@ -94,6 +98,14 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
} }
} }
private string ComputersRootOU
{
get
{
return ProviderSettings["ComputersRootOU"];
}
}
private string CentralNpsHost private string CentralNpsHost
{ {
get get
@ -300,23 +312,13 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
EditRdsCollectionSettingsInternal(collection, runSpace); EditRdsCollectionSettingsInternal(collection, runSpace);
var orgPath = GetOrganizationPath(organizationId); var orgPath = GetOrganizationPath(organizationId);
CheckOrCreateAdGroup(GetComputerGroupPath(organizationId, collection.Name), orgPath, GetComputersGroupName(collection.Name), RdsCollectionComputersGroupDescription);
if (!ActiveDirectoryUtils.AdObjectExists(GetComputerGroupPath(organizationId, collection.Name))) CheckOrCreateHelpDeskComputerGroup();
{ string helpDeskGroupSamAccountName = CheckOrCreateAdGroup(GetHelpDeskGroupPath(RDSHelpDeskGroup), GetRootOUPath(), RDSHelpDeskGroup, RDSHelpDeskGroupDescription);
//Create computer group string groupName = GetLocalAdminsGroupName(collection.Name);
ActiveDirectoryUtils.CreateGroup(orgPath, GetComputersGroupName(collection.Name)); string groupPath = GetGroupPath(organizationId, collection.Name, groupName);
string localAdminsGroupSamAccountName = CheckOrCreateAdGroup(groupPath, GetOrganizationPath(organizationId), groupName, WspAdministratorsGroupDescription);
//todo Connection broker server must be added by default ??? CheckOrCreateAdGroup(GetUsersGroupPath(organizationId, collection.Name), orgPath, GetUsersGroupName(collection.Name), RdsCollectionUsersGroupDescription);
//ActiveDirectoryUtils.AddObjectToGroup(GetComputerPath(ConnectionBroker), GetComputerGroupPath(organizationId, collection.Name));
}
CheckOrCreateHelpDeskComputerGroup();
if (!ActiveDirectoryUtils.AdObjectExists(GetUsersGroupPath(organizationId, collection.Name)))
{
//Create user group
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);
@ -337,17 +339,14 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
} }
//add user group to collection //add user group to collection
AddUserGroupsToCollection(runSpace, collection.Name, new List<string> { GetUsersGroupName(collection.Name) }); AddUserGroupsToCollection(runSpace, collection.Name, new List<string> { GetUsersGroupName(collection.Name) });
//add session servers to group //add session servers to group
foreach (var rdsServer in collection.Servers) foreach (var rdsServer in collection.Servers)
{ {
if (!CheckLocalAdminsGroupExists(rdsServer.FqdName, runSpace)) MoveRdsServerToTenantOU(rdsServer.Name, organizationId);
{ AddAdGroupToLocalAdmins(runSpace, rdsServer.FqdName, helpDeskGroupSamAccountName);
CreateLocalAdministratorsGroup(rdsServer.FqdName, runSpace); AddAdGroupToLocalAdmins(runSpace, rdsServer.FqdName, localAdminsGroupSamAccountName);
}
AddHelpDeskAdminsGroupToLocalAdmins(runSpace, rdsServer.FqdName);
AddComputerToCollectionAdComputerGroup(organizationId, collection.Name, rdsServer); AddComputerToCollectionAdComputerGroup(organizationId, collection.Name, rdsServer);
} }
} }
@ -513,11 +512,13 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
foreach(var server in servers) foreach(var server in servers)
{ {
RemoveGroupFromLocalAdmin(server.FqdName, server.Name, GetLocalAdminsGroupName(collectionName), runSpace);
RemoveComputerFromCollectionAdComputerGroup(organizationId, collectionName, server); RemoveComputerFromCollectionAdComputerGroup(organizationId, collectionName, server);
} }
ActiveDirectoryUtils.DeleteADObject(GetComputerGroupPath(organizationId, collectionName)); ActiveDirectoryUtils.DeleteADObject(GetComputerGroupPath(organizationId, collectionName));
ActiveDirectoryUtils.DeleteADObject(GetUsersGroupPath(organizationId, collectionName)); ActiveDirectoryUtils.DeleteADObject(GetUsersGroupPath(organizationId, collectionName));
ActiveDirectoryUtils.DeleteADObject(GetGroupPath(organizationId, collectionName, GetLocalAdminsGroupName(collectionName)));
} }
catch (Exception e) catch (Exception e)
{ {
@ -529,12 +530,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
} }
return result; return result;
} }
public List<string> GetCollectionUsers(string collectionName)
{
return GetUsersToCollectionAdGroup(collectionName);
}
public bool SetUsersInCollection(string organizationId, string collectionName, List<string> users) public bool SetUsersInCollection(string organizationId, string collectionName, List<string> users)
{ {
@ -542,7 +538,9 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
try try
{ {
SetUsersToCollectionAdGroup(collectionName, organizationId, users); var usersGroupName = GetUsersGroupName(collectionName);
var usersGroupPath = GetUsersGroupPath(organizationId, collectionName);
SetUsersToCollectionAdGroup(collectionName, organizationId, users, usersGroupName, usersGroupPath);
} }
catch (Exception e) catch (Exception e)
{ {
@ -573,20 +571,16 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
ExecuteShellCommand(runSpace, cmd, false); ExecuteShellCommand(runSpace, cmd, false);
CheckOrCreateHelpDeskComputerGroup(); CheckOrCreateHelpDeskComputerGroup();
string helpDeskGroupSamAccountName = CheckOrCreateAdGroup(GetHelpDeskGroupPath(RDSHelpDeskGroup), GetRootOUPath(), RDSHelpDeskGroup, RDSHelpDeskGroupDescription);
string groupName = GetLocalAdminsGroupName(collectionName);
string groupPath = GetGroupPath(organizationId, collectionName, groupName);
string localAdminsGroupSamAccountName = CheckOrCreateAdGroup(groupPath, GetOrganizationPath(organizationId), groupName, WspAdministratorsGroupDescription);
if (!CheckLocalAdminsGroupExists(server.FqdName, runSpace)) AddAdGroupToLocalAdmins(runSpace, server.FqdName, LocalAdministratorsGroupName);
{ AddAdGroupToLocalAdmins(runSpace, server.FqdName, helpDeskGroupSamAccountName);
CreateLocalAdministratorsGroup(server.FqdName, runSpace);
}
AddHelpDeskAdminsGroupToLocalAdmins(runSpace, server.FqdName);
AddComputerToCollectionAdComputerGroup(organizationId, collectionName, server); AddComputerToCollectionAdComputerGroup(organizationId, collectionName, server);
} }
catch (Exception e)
{
}
finally finally
{ {
CloseRunspace(runSpace); CloseRunspace(runSpace);
@ -616,6 +610,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
ExecuteShellCommand(runSpace, cmd, false); ExecuteShellCommand(runSpace, cmd, false);
RemoveGroupFromLocalAdmin(server.FqdName, server.Name, GetLocalAdminsGroupName(collectionName), runSpace);
RemoveComputerFromCollectionAdComputerGroup(organizationId, collectionName, server); RemoveComputerFromCollectionAdComputerGroup(organizationId, collectionName, server);
} }
finally finally
@ -978,7 +973,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
#region Local Admins #region Local Admins
public void SaveRdsCollectionLocalAdmins(List<OrganizationUser> users, List<string> hosts) public void SaveRdsCollectionLocalAdmins(List<string> users, List<string> hosts, string collectionName, string organizationId)
{ {
Runspace runspace = null; Runspace runspace = null;
@ -987,6 +982,10 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
runspace = OpenRunspace(); runspace = OpenRunspace();
var index = ServerSettings.ADRootDomain.LastIndexOf("."); var index = ServerSettings.ADRootDomain.LastIndexOf(".");
var domainName = ServerSettings.ADRootDomain; var domainName = ServerSettings.ADRootDomain;
string groupName = GetLocalAdminsGroupName(collectionName);
string groupPath = GetGroupPath(organizationId, collectionName, groupName);
string helpDeskGroupSamAccountName = CheckOrCreateAdGroup(GetHelpDeskGroupPath(RDSHelpDeskGroup), GetRootOUPath(), RDSHelpDeskGroup, RDSHelpDeskGroupDescription);
string localAdminsGroupSamAccountName = CheckOrCreateAdGroup(groupPath, GetOrganizationPath(organizationId), groupName, WspAdministratorsGroupDescription);
if (index > 0) if (index > 0)
{ {
@ -994,34 +993,11 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
} }
foreach (var hostName in hosts) foreach (var hostName in hosts)
{ {
if (!CheckLocalAdminsGroupExists(hostName, runspace)) AddAdGroupToLocalAdmins(runspace, hostName, helpDeskGroupSamAccountName);
{ AddAdGroupToLocalAdmins(runspace, hostName, localAdminsGroupSamAccountName);
var errors = CreateLocalAdministratorsGroup(hostName, runspace);
if (errors.Any())
{
Log.WriteWarning(string.Join("\r\n", errors.Select(e => e.ToString()).ToArray()));
throw new Exception(string.Join("\r\n", errors.Select(e => e.ToString()).ToArray()));
}
}
var existingAdmins = GetExistingLocalAdmins(hostName, runspace).Select(e => e.ToLower());
var formUsers = users.Select(u => string.Format("{0}\\{1}", domainName, u.SamAccountName).ToLower());
var newUsers = users.Where(u => !existingAdmins.Contains(string.Format("{0}\\{1}", domainName, u.SamAccountName).ToLower()));
var removedUsers = existingAdmins.Where(e => !formUsers.Contains(e));
foreach (var user in newUsers) SetUsersToCollectionAdGroup(collectionName, organizationId, users, GetLocalAdminsGroupName(collectionName), groupPath);
{
AddNewLocalAdmin(hostName, user.SamAccountName, runspace);
}
foreach (var user in removedUsers)
{
RemoveLocalAdmin(hostName, user, runspace);
}
AddHelpDeskAdminsGroupToLocalAdmins(runspace, hostName);
} }
} }
finally finally
@ -1030,126 +1006,23 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
} }
} }
public List<string> GetRdsCollectionLocalAdmins(string hostName) public List<string> GetRdsCollectionLocalAdmins(string organizationId, string collectionName)
{
string groupName = GetLocalAdminsGroupName(collectionName);
return GetUsersToCollectionAdGroup(collectionName, groupName, organizationId);
}
private void RemoveGroupFromLocalAdmin(string fqdnName, string hostName, string groupName, Runspace runspace)
{ {
Runspace runspace = null;
var result = new List<string>();
try
{
runspace = OpenRunspace();
if (CheckLocalAdminsGroupExists(hostName, runspace))
{
result = GetExistingLocalAdmins(hostName, runspace);
}
}
finally
{
CloseRunspace(runspace);
}
return result;
}
private bool CheckLocalAdminsGroupExists(string hostName, Runspace runspace)
{
var scripts = new List<string> var scripts = new List<string>
{ {
string.Format("net localgroup {0}", WspAdministratorsGroupName) string.Format("$GroupObj = [ADSI]\"WinNT://{0}/{1}\"", hostName, LocalAdministratorsGroupName),
string.Format("$GroupObj.Remove(\"WinNT://{0}/{1}\")", ServerSettings.ADRootDomain, RDSHelpDeskGroup),
string.Format("$GroupObj.Remove(\"WinNT://{0}/{1}\")", ServerSettings.ADRootDomain, groupName)
}; };
object[] errors = null; object[] errors = null;
var result = ExecuteRemoteShellCommand(runspace, hostName, scripts, out errors); ExecuteRemoteShellCommand(runspace, fqdnName, scripts, out errors);
if (!errors.Any())
{
return true;
}
return false;
}
private object[] CreateLocalAdministratorsGroup(string hostName, Runspace runspace)
{
var scripts = new List<string>
{
string.Format("$cn = [ADSI]\"WinNT://{0}\"", hostName),
string.Format("$group = $cn.Create(\"Group\", \"{0}\")", WspAdministratorsGroupName),
"$group.setinfo()",
string.Format("$group.description = \"{0}\"", WspAdministratorsGroupDescription),
"$group.setinfo()"
};
object[] errors = null;
ExecuteRemoteShellCommand(runspace, hostName, scripts, out errors);
if (!errors.Any())
{
scripts = new List<string>
{
string.Format("$GroupObj = [ADSI]\"WinNT://{0}/Administrators\"", hostName),
string.Format("$GroupObj.Add(\"WinNT://{0}/{1}\")", hostName.ToLower().Replace(string.Format(".{0}", ServerSettings.ADRootDomain.ToLower()), ""), WspAdministratorsGroupName)
};
errors = null;
ExecuteRemoteShellCommand(runspace, hostName, scripts, out errors);
}
return errors;
}
private List<string> GetExistingLocalAdmins(string hostName, Runspace runspace)
{
var result = new List<string>();
var scripts = new List<string>
{
string.Format("net localgroup {0} | select -skip 6", WspAdministratorsGroupName)
};
object[] errors = null;
var exitingAdmins = ExecuteRemoteShellCommand(runspace, hostName, scripts, out errors);
if (!errors.Any())
{
foreach(var user in exitingAdmins.Take(exitingAdmins.Count - 2))
{
result.Add(user.ToString());
}
}
return result;
}
private object[] AddNewLocalAdmin(string hostName, string samAccountName, Runspace runspace)
{
var scripts = new List<string>
{
string.Format("$GroupObj = [ADSI]\"WinNT://{0}/{1}\"", hostName, WspAdministratorsGroupName),
string.Format("$GroupObj.Add(\"WinNT://{0}/{1}\")", ServerSettings.ADRootDomain, samAccountName)
};
object[] errors = null;
ExecuteRemoteShellCommand(runspace, hostName, scripts, out errors);
return errors;
}
private object[] RemoveLocalAdmin(string hostName, string user, Runspace runspace)
{
var userObject = user.Split('\\');
var scripts = new List<string>
{
string.Format("$GroupObj = [ADSI]\"WinNT://{0}/{1}\"", hostName, WspAdministratorsGroupName),
string.Format("$GroupObj.Remove(\"WinNT://{0}/{1}\")", userObject[0], userObject[1])
};
object[] errors = null;
ExecuteRemoteShellCommand(runspace, hostName, scripts, out errors);
return errors;
} }
#endregion #endregion
@ -1177,23 +1050,22 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
} }
} }
private void AddHelpDeskAdminsGroupToLocalAdmins(Runspace runspace, string hostName) private string CheckOrCreateAdGroup(string groupPath, string rootPath, string groupName, string description)
{ {
var helpDeskAdminsGroupPath = GetHelpDeskGroupPath(RDSHelpDeskGroup);
DirectoryEntry groupEntry = null; DirectoryEntry groupEntry = null;
if (!ActiveDirectoryUtils.AdObjectExists(helpDeskAdminsGroupPath)) if (!ActiveDirectoryUtils.AdObjectExists(groupPath))
{ {
ActiveDirectoryUtils.CreateGroup(GetRootOUPath(), RDSHelpDeskGroup); ActiveDirectoryUtils.CreateGroup(rootPath, groupName);
groupEntry = ActiveDirectoryUtils.GetADObject(helpDeskAdminsGroupPath); groupEntry = ActiveDirectoryUtils.GetADObject(groupPath);
if (groupEntry.Properties.Contains("Description")) if (groupEntry.Properties.Contains("Description"))
{ {
groupEntry.Properties["Description"][0] = RDSHelpDeskGroupDescription; groupEntry.Properties["Description"][0] = description;
} }
else else
{ {
groupEntry.Properties["Description"].Add(RDSHelpDeskGroupDescription); groupEntry.Properties["Description"].Add(description);
} }
groupEntry.CommitChanges(); groupEntry.CommitChanges();
@ -1201,14 +1073,17 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
if (groupEntry == null) if (groupEntry == null)
{ {
groupEntry = ActiveDirectoryUtils.GetADObject(helpDeskAdminsGroupPath); groupEntry = ActiveDirectoryUtils.GetADObject(groupPath);
} }
var samAccountName = ActiveDirectoryUtils.GetADObjectProperty(groupEntry, "sAMAccountName"); return ActiveDirectoryUtils.GetADObjectProperty(groupEntry, "sAMAccountName").ToString();
}
private void AddAdGroupToLocalAdmins(Runspace runspace, string hostName, string samAccountName)
{
var scripts = new List<string> var scripts = new List<string>
{ {
string.Format("$GroupObj = [ADSI]\"WinNT://{0}/{1}\"", hostName, WspAdministratorsGroupName), string.Format("$GroupObj = [ADSI]\"WinNT://{0}/{1}\"", hostName, LocalAdministratorsGroupName),
string.Format("$GroupObj.Add(\"WinNT://{0}/{1}\")", ServerSettings.ADRootDomain, samAccountName) string.Format("$GroupObj.Add(\"WinNT://{0}/{1}\")", ServerSettings.ADRootDomain, samAccountName)
}; };
@ -1227,8 +1102,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
try try
{ {
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();
@ -1239,6 +1113,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);
} }
@ -1260,12 +1135,23 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
{ {
CloseRunspace(runspace); CloseRunspace(runspace);
} }
} }
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>
{ {
string.Format("$mypwd = ConvertTo-SecureString -String {0} -Force AsPlainText", password), string.Format("$mypwd = ConvertTo-SecureString -String {0} -Force AsPlainText", password),
string.Format("Import-PfxCertificate FilePath \"{0}\" cert:\\localMachine\\my -Password $mypwd", certificatePath), string.Format("Import-PfxCertificate FilePath \"{0}\" cert:\\localMachine\\my -Password $mypwd", certificatePath),
string.Format("$cert = Get-Item cert:\\LocalMachine\\My\\{0}", thumbprint), string.Format("$cert = Get-Item cert:\\LocalMachine\\My\\{0}", thumbprint),
@ -1355,21 +1241,17 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
return false; return false;
} }
private void SetUsersToCollectionAdGroup(string collectionName, string organizationId, IEnumerable<string> users) private void SetUsersToCollectionAdGroup(string collectionName, string organizationId, IEnumerable<string> users, string groupName, string groupPath)
{ {
var usersGroupName = GetUsersGroupName(collectionName);
var usersGroupPath = GetUsersGroupPath(organizationId, collectionName);
var orgPath = GetOrganizationPath(organizationId); var orgPath = GetOrganizationPath(organizationId);
var orgEntry = ActiveDirectoryUtils.GetADObject(orgPath); var orgEntry = ActiveDirectoryUtils.GetADObject(orgPath);
var groupUsers = ActiveDirectoryUtils.GetGroupObjects(usersGroupName, "user", orgEntry); var groupUsers = ActiveDirectoryUtils.GetGroupObjects(groupName, "user", orgEntry);
//remove all users from group
foreach (string userPath in groupUsers) foreach (string userPath in groupUsers)
{ {
ActiveDirectoryUtils.RemoveObjectFromGroup(userPath, usersGroupPath); ActiveDirectoryUtils.RemoveObjectFromGroup(userPath, groupPath);
} }
//adding users to group
foreach (var user in users) foreach (var user in users)
{ {
var userPath = GetUserPath(organizationId, user); var userPath = GetUserPath(organizationId, user);
@ -1377,20 +1259,19 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
if (ActiveDirectoryUtils.AdObjectExists(userPath)) if (ActiveDirectoryUtils.AdObjectExists(userPath))
{ {
var userObject = ActiveDirectoryUtils.GetADObject(userPath); var userObject = ActiveDirectoryUtils.GetADObject(userPath);
var samName = (string)ActiveDirectoryUtils.GetADObjectProperty(userObject, "sAMAccountName"); var samName = (string)ActiveDirectoryUtils.GetADObjectProperty(userObject, "sAMAccountName");
var userGroupsPath = GetUsersGroupPath(organizationId, collectionName); ActiveDirectoryUtils.AddObjectToGroup(userPath, groupPath);
ActiveDirectoryUtils.AddObjectToGroup(userPath, userGroupsPath);
} }
} }
} }
private List<string> GetUsersToCollectionAdGroup(string collectionName) private List<string> GetUsersToCollectionAdGroup(string collectionName, string groupName, string organizationId)
{ {
var users = new List<string>(); var users = new List<string>();
var orgPath = GetOrganizationPath(organizationId);
var orgEntry = ActiveDirectoryUtils.GetADObject(orgPath);
var usersGroupName = GetUsersGroupName(collectionName); foreach (string userPath in ActiveDirectoryUtils.GetGroupObjects(groupName, "user", orgEntry))
foreach (string userPath in ActiveDirectoryUtils.GetGroupObjects(usersGroupName, "user"))
{ {
var userObject = ActiveDirectoryUtils.GetADObject(userPath); var userObject = ActiveDirectoryUtils.GetADObject(userPath);
var samName = (string)ActiveDirectoryUtils.GetADObjectProperty(userObject, "sAMAccountName"); var samName = (string)ActiveDirectoryUtils.GetADObjectProperty(userObject, "sAMAccountName");
@ -1412,28 +1293,22 @@ 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));
} }
} }
@ -1441,30 +1316,24 @@ 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));
} }
} }
} }
@ -1479,7 +1348,17 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
{ {
runSpace = OpenRunspace(); runSpace = OpenRunspace();
var feature = AddFeature(runSpace, hostName, "RDS-RD-Server", true, true); var feature = AddFeature(runSpace, hostName, "RDS-RD-Server", true, true);
installationResult = (bool)GetPSObjectProperty(feature, "Success"); installationResult = (bool)GetPSObjectProperty(feature, "Success");
if (!IsFeatureInstalled(hostName, "Desktop-Experience", runSpace))
{
feature = AddFeature(runSpace, hostName, "Desktop-Experience", true, false);
}
if (!IsFeatureInstalled(hostName, "NET-Framework-Core", runSpace))
{
feature = AddFeature(runSpace, hostName, "NET-Framework-Core", true, false);
}
} }
finally finally
{ {
@ -1489,59 +1368,93 @@ 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());
} }
var computerObject = GetComputerObject(hostName);
if (ActiveDirectoryUtils.AdObjectExists(computerPath)) 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();
} }
} }
} }
public void RemoveRdsServerFromTenantOU(string hostName, string organizationId) public void RemoveRdsServerFromTenantOU(string hostName, string organizationId)
{ {
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(tenantComputerGroupPath))
{
ActiveDirectoryUtils.CreateOrganizationalUnit(RdsServersOU, GetOrganizationPath(organizationId));
} }
if (ActiveDirectoryUtils.AdObjectExists(computerPath)) var computerObject = GetComputerObject(hostName);
if (computerObject != null)
{ {
var computerObject = ActiveDirectoryUtils.GetADObject(computerPath);
var samName = (string)ActiveDirectoryUtils.GetADObjectProperty(computerObject, "sAMAccountName"); 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);
} }
} }
} }
@ -1669,6 +1582,10 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
{ {
remoteApp.Users = users; remoteApp.Users = users;
} }
else
{
remoteApp.Users = null;
}
return remoteApp; return remoteApp;
} }
@ -1738,6 +1655,11 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
return string.Format(RdsGroupFormat, collectionName, Users.ToLowerInvariant()); return string.Format(RdsGroupFormat, collectionName, Users.ToLowerInvariant());
} }
private string GetLocalAdminsGroupName(string collectionName)
{
return string.Format(RdsGroupFormat, collectionName, Admins.ToLowerInvariant());
}
internal string GetComputerGroupPath(string organizationId, string collection) internal string GetComputerGroupPath(string organizationId, string collection)
{ {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
@ -1766,6 +1688,20 @@ namespace WebsitePanel.Providers.RemoteDesktopServices
return sb.ToString(); return sb.ToString();
} }
private string GetGroupPath(string organizationId, string collectionName, string groupName)
{
StringBuilder sb = new StringBuilder();
AppendProtocol(sb);
AppendDomainController(sb);
AppendCNPath(sb, groupName);
AppendOUPath(sb, organizationId);
AppendOUPath(sb, RootOU);
AppendDomainPath(sb, RootDomain);
return sb.ToString();
}
private string GetUserPath(string organizationId, string loginName) private string GetUserPath(string organizationId, string loginName)
{ {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
@ -1805,26 +1741,17 @@ 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
{ SearchResult results = deSearch.FindOne();
AppendCNPath(sb, Computers);
return results.GetDirectoryEntry();
} }
AppendDomainPath(sb, RootDomain);
return sb.ToString();
}
private string GetTenantComputerPath(string objName, string organizationId) private string GetTenantComputerPath(string objName, string organizationId)
{ {
@ -1833,7 +1760,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);
@ -1841,13 +1768,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);

View file

@ -84,7 +84,7 @@ namespace WebsitePanel.Providers.Web.Iis
X509CertificateCollection existCerts2 = storeMy.Certificates.Find(X509FindType.FindBySerialNumber, servercert.SerialNumber, false); X509CertificateCollection existCerts2 = storeMy.Certificates.Find(X509FindType.FindBySerialNumber, servercert.SerialNumber, false);
var certData = existCerts2[0].Export(X509ContentType.Pfx); var certData = existCerts2[0].Export(X509ContentType.Pfx);
storeMy.Close(); storeMy.Close();
var x509Cert = new X509Certificate2(certData); var x509Cert = new X509Certificate2(certData, string.Empty, X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.Exportable | X509KeyStorageFlags.PersistKeySet);
if (UseCCS) if (UseCCS)
{ {
@ -176,10 +176,10 @@ namespace WebsitePanel.Providers.Web.Iis
if (UseCCS) if (UseCCS)
{ {
// We need to use this constructor or we won't be able to export this certificate // We need to use this constructor or we won't be able to export this certificate
x509Cert = new X509Certificate2(certificate, password, X509KeyStorageFlags.Exportable); x509Cert = new X509Certificate2(certificate, password, X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.Exportable | X509KeyStorageFlags.PersistKeySet);
var certData = x509Cert.Export(X509ContentType.Pfx); var certData = x509Cert.Export(X509ContentType.Pfx);
var convertedCert = new X509Certificate2(certData, string.Empty, X509KeyStorageFlags.Exportable); var convertedCert = new X509Certificate2(certData, string.Empty, X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.Exportable | X509KeyStorageFlags.PersistKeySet);
// Attempts to move certificate to CCS UNC path // Attempts to move certificate to CCS UNC path
try try
@ -205,7 +205,7 @@ namespace WebsitePanel.Providers.Web.Iis
} }
else else
{ {
x509Cert = new X509Certificate2(certificate, password); x509Cert = new X509Certificate2(certificate, password, X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.Exportable | X509KeyStorageFlags.PersistKeySet);
// Step 1: Register X.509 certificate in the store // Step 1: Register X.509 certificate in the store
// Trying to keep X.509 store open as less as possible // Trying to keep X.509 store open as less as possible
@ -278,7 +278,7 @@ namespace WebsitePanel.Providers.Web.Iis
// Read certificate data from file // Read certificate data from file
var certData = new byte[fileStream.Length]; var certData = new byte[fileStream.Length];
fileStream.Read(certData, 0, (int) fileStream.Length); fileStream.Read(certData, 0, (int) fileStream.Length);
var convertedCert = new X509Certificate2(certData, CCSCommonPassword, X509KeyStorageFlags.Exportable); var convertedCert = new X509Certificate2(certData, CCSCommonPassword, X509KeyStorageFlags.MachineKeySet | X509KeyStorageFlags.Exportable | X509KeyStorageFlags.PersistKeySet);
fileStream.Close(); fileStream.Close();
@ -311,7 +311,7 @@ namespace WebsitePanel.Providers.Web.Iis
{ {
hostNames.AddRange(certificate.Extensions.Cast<X509Extension>() hostNames.AddRange(certificate.Extensions.Cast<X509Extension>()
.Where(e => e.Oid.Value == "2.5.29.17") // Subject Alternative Names .Where(e => e.Oid.Value == "2.5.29.17") // Subject Alternative Names
.SelectMany(e => e.Format(true).Split(new[] {"\r\n", "\n", "\n"}, StringSplitOptions.RemoveEmptyEntries).Select(s => s.Split('=')[1]))); .SelectMany(e => e.Format(true).Split(new[] {"\r\n", "\n", "\n"}, StringSplitOptions.RemoveEmptyEntries).Where(s => s.Contains("=")).Select(s => s.Split('=')[1])).Where(s => !s.Contains(" ")));
} }
var simpleName = certificate.GetNameInfo(X509NameType.SimpleName, false); var simpleName = certificate.GetNameInfo(X509NameType.SimpleName, false);
@ -320,7 +320,20 @@ namespace WebsitePanel.Providers.Web.Iis
hostNames.Add(simpleName); hostNames.Add(simpleName);
} }
// For every hostname (only one if using old school dedicated IP binding) var wildcardHostName = hostNames.SingleOrDefault(h => h.StartsWith("*."));
// If a wildcard certificate is used
if (wildcardHostName != null)
{
if (!dedicatedIp)
{
// If using a wildcard ssl and not a dedicated IP, we take all the matching bindings on the site and use it to bind to SSL also.
hostNames.Remove(wildcardHostName);
hostNames.AddRange(website.Bindings.Where(b => !string.IsNullOrEmpty(b.Host) && b.Host.EndsWith(wildcardHostName.Substring(2))).Select(b => b.Host));
}
}
// For every hostname
foreach (var hostName in hostNames) foreach (var hostName in hostNames)
{ {
var bindingInformation = string.Format("{0}:443:{1}", website.SiteIPAddress ?? "*", dedicatedIp ? "" : hostName); var bindingInformation = string.Format("{0}:443:{1}", website.SiteIPAddress ?? "*", dedicatedIp ? "" : hostName);

View file

@ -18,7 +18,6 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
using System.Web.Services.Protocols; using System.Web.Services.Protocols;
using System; using System;
using System.Diagnostics; using System.Diagnostics;
using WebsitePanel.Providers.HostedSolution;
/// <remarks/> /// <remarks/>
@ -100,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";
@ -210,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)]
@ -1515,17 +1519,21 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
/// <remarks/> /// <remarks/>
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SaveRdsCollectionLocalAdmins", 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/SaveRdsCollectionLocalAdmins", 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 SaveRdsCollectionLocalAdmins(OrganizationUser[] users, string[] hosts) { public void SaveRdsCollectionLocalAdmins(string[] users, string[] hosts, string organizationId, string collectionName) {
this.Invoke("SaveRdsCollectionLocalAdmins", new object[] { this.Invoke("SaveRdsCollectionLocalAdmins", new object[] {
users, users,
hosts}); hosts,
organizationId,
collectionName});
} }
/// <remarks/> /// <remarks/>
public System.IAsyncResult BeginSaveRdsCollectionLocalAdmins(OrganizationUser[] users, string[] hosts, System.AsyncCallback callback, object asyncState) { public System.IAsyncResult BeginSaveRdsCollectionLocalAdmins(string[] users, string[] hosts, string organizationId, string collectionName, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("SaveRdsCollectionLocalAdmins", new object[] { return this.BeginInvoke("SaveRdsCollectionLocalAdmins", new object[] {
users, users,
hosts}, callback, asyncState); hosts,
organizationId,
collectionName}, callback, asyncState);
} }
/// <remarks/> /// <remarks/>
@ -1534,18 +1542,20 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
} }
/// <remarks/> /// <remarks/>
public void SaveRdsCollectionLocalAdminsAsync(OrganizationUser[] users, string[] hosts) { public void SaveRdsCollectionLocalAdminsAsync(string[] users, string[] hosts, string organizationId, string collectionName) {
this.SaveRdsCollectionLocalAdminsAsync(users, hosts, null); this.SaveRdsCollectionLocalAdminsAsync(users, hosts, organizationId, collectionName, null);
} }
/// <remarks/> /// <remarks/>
public void SaveRdsCollectionLocalAdminsAsync(OrganizationUser[] users, string[] hosts, object userState) { public void SaveRdsCollectionLocalAdminsAsync(string[] users, string[] hosts, string organizationId, string collectionName, object userState) {
if ((this.SaveRdsCollectionLocalAdminsOperationCompleted == null)) { if ((this.SaveRdsCollectionLocalAdminsOperationCompleted == null)) {
this.SaveRdsCollectionLocalAdminsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSaveRdsCollectionLocalAdminsOperationCompleted); this.SaveRdsCollectionLocalAdminsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSaveRdsCollectionLocalAdminsOperationCompleted);
} }
this.InvokeAsync("SaveRdsCollectionLocalAdmins", new object[] { this.InvokeAsync("SaveRdsCollectionLocalAdmins", new object[] {
users, users,
hosts}, this.SaveRdsCollectionLocalAdminsOperationCompleted, userState); hosts,
organizationId,
collectionName}, this.SaveRdsCollectionLocalAdminsOperationCompleted, userState);
} }
private void OnSaveRdsCollectionLocalAdminsOperationCompleted(object arg) { private void OnSaveRdsCollectionLocalAdminsOperationCompleted(object arg) {
@ -1558,16 +1568,18 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
/// <remarks/> /// <remarks/>
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetRdsCollectionLocalAdmins", 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/GetRdsCollectionLocalAdmins", 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 string[] GetRdsCollectionLocalAdmins(string hostName) { public string[] GetRdsCollectionLocalAdmins(string organizationId, string collectionName) {
object[] results = this.Invoke("GetRdsCollectionLocalAdmins", new object[] { object[] results = this.Invoke("GetRdsCollectionLocalAdmins", new object[] {
hostName}); organizationId,
collectionName});
return ((string[])(results[0])); return ((string[])(results[0]));
} }
/// <remarks/> /// <remarks/>
public System.IAsyncResult BeginGetRdsCollectionLocalAdmins(string hostName, System.AsyncCallback callback, object asyncState) { public System.IAsyncResult BeginGetRdsCollectionLocalAdmins(string organizationId, string collectionName, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("GetRdsCollectionLocalAdmins", new object[] { return this.BeginInvoke("GetRdsCollectionLocalAdmins", new object[] {
hostName}, callback, asyncState); organizationId,
collectionName}, callback, asyncState);
} }
/// <remarks/> /// <remarks/>
@ -1577,17 +1589,18 @@ namespace WebsitePanel.Providers.RemoteDesktopServices {
} }
/// <remarks/> /// <remarks/>
public void GetRdsCollectionLocalAdminsAsync(string hostName) { public void GetRdsCollectionLocalAdminsAsync(string organizationId, string collectionName) {
this.GetRdsCollectionLocalAdminsAsync(hostName, null); this.GetRdsCollectionLocalAdminsAsync(organizationId, collectionName, null);
} }
/// <remarks/> /// <remarks/>
public void GetRdsCollectionLocalAdminsAsync(string hostName, object userState) { public void GetRdsCollectionLocalAdminsAsync(string organizationId, string collectionName, object userState) {
if ((this.GetRdsCollectionLocalAdminsOperationCompleted == null)) { if ((this.GetRdsCollectionLocalAdminsOperationCompleted == null)) {
this.GetRdsCollectionLocalAdminsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRdsCollectionLocalAdminsOperationCompleted); this.GetRdsCollectionLocalAdminsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetRdsCollectionLocalAdminsOperationCompleted);
} }
this.InvokeAsync("GetRdsCollectionLocalAdmins", new object[] { this.InvokeAsync("GetRdsCollectionLocalAdmins", new object[] {
hostName}, this.GetRdsCollectionLocalAdminsOperationCompleted, userState); organizationId,
collectionName}, this.GetRdsCollectionLocalAdminsOperationCompleted, userState);
} }
private void OnGetRdsCollectionLocalAdminsOperationCompleted(object arg) { private void OnGetRdsCollectionLocalAdminsOperationCompleted(object arg) {
@ -1729,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);
@ -2358,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);
} }

View file

@ -566,12 +566,12 @@ namespace WebsitePanel.Server
} }
[WebMethod, SoapHeader("settings")] [WebMethod, SoapHeader("settings")]
public void SaveRdsCollectionLocalAdmins(List<OrganizationUser> users, List<string> hosts) public void SaveRdsCollectionLocalAdmins(List<string> users, List<string> hosts, string organizationId, string collectionName)
{ {
try try
{ {
Log.WriteStart("'{0}' SaveRdsCollectionLocalAdmins", ProviderSettings.ProviderName); Log.WriteStart("'{0}' SaveRdsCollectionLocalAdmins", ProviderSettings.ProviderName);
RDSProvider.SaveRdsCollectionLocalAdmins(users, hosts); RDSProvider.SaveRdsCollectionLocalAdmins(users, hosts, collectionName, organizationId);
Log.WriteEnd("'{0}' SaveRdsCollectionLocalAdmins", ProviderSettings.ProviderName); Log.WriteEnd("'{0}' SaveRdsCollectionLocalAdmins", ProviderSettings.ProviderName);
} }
catch (Exception ex) catch (Exception ex)
@ -582,12 +582,12 @@ namespace WebsitePanel.Server
} }
[WebMethod, SoapHeader("settings")] [WebMethod, SoapHeader("settings")]
public List<string> GetRdsCollectionLocalAdmins(string hostName) public List<string> GetRdsCollectionLocalAdmins(string organizationId, string collectionName)
{ {
try try
{ {
Log.WriteStart("'{0}' GetRdsCollectionLocalAdmins", ProviderSettings.ProviderName); Log.WriteStart("'{0}' GetRdsCollectionLocalAdmins", ProviderSettings.ProviderName);
var result = RDSProvider.GetRdsCollectionLocalAdmins(hostName); var result = RDSProvider.GetRdsCollectionLocalAdmins(organizationId, collectionName);
Log.WriteEnd("'{0}' GetRdsCollectionLocalAdmins", ProviderSettings.ProviderName); Log.WriteEnd("'{0}' GetRdsCollectionLocalAdmins", ProviderSettings.ProviderName);
return result; return result;
@ -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;
}
}
} }
} }

View file

@ -5,17 +5,6 @@
<section name="microsoft.web.services3" type="Microsoft.Web.Services3.Configuration.WebServicesConfiguration, Microsoft.Web.Services3"/> <section name="microsoft.web.services3" type="Microsoft.Web.Services3.Configuration.WebServicesConfiguration, Microsoft.Web.Services3"/>
<section name="websitepanel.server" type="WebsitePanel.Server.ServerConfiguration, WebsitePanel.Server"/> <section name="websitepanel.server" type="WebsitePanel.Server.ServerConfiguration, WebsitePanel.Server"/>
<section name="cachingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerSettings,Microsoft.Practices.EnterpriseLibrary.Caching"/> <section name="cachingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerSettings,Microsoft.Practices.EnterpriseLibrary.Caching"/>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
</sectionGroup>
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
</sectionGroup>
</sectionGroup>
</configSections> </configSections>
<appSettings> <appSettings>
<add key="WebsitePanel.HyperV.UseDiskPartClearReadOnlyFlag" value="false"/> <add key="WebsitePanel.HyperV.UseDiskPartClearReadOnlyFlag" value="false"/>

View file

@ -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()

View file

@ -45,6 +45,16 @@ namespace WebsitePanel.WebDav.Core.Config.Entities
} }
} }
public string OwaEditFoldersSessionKey
{
get
{
SessionKeysElement sessionKey =
_sessionKeys.FirstOrDefault(x => x.Key == SessionKeysElement.OwaEditFoldersSessionKey);
return sessionKey != null ? sessionKey.Value : null;
}
}
public string WebDavRootFoldersPermissions public string WebDavRootFoldersPermissions
{ {
get get

View file

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

View file

@ -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
{ {

View file

@ -14,6 +14,7 @@ namespace WebsitePanel.WebDav.Core.Config.WebConfigSections
public const string WebDavRootFolderPermissionsKey = "WebDavRootFolderPermissionsKey"; public const string WebDavRootFolderPermissionsKey = "WebDavRootFolderPermissionsKey";
public const string ResourseRenderCountKey = "ResourseRenderCountSessionKey"; public const string ResourseRenderCountKey = "ResourseRenderCountSessionKey";
public const string ItemIdSessionKey = "ItemId"; public const string ItemIdSessionKey = "ItemId";
public const string OwaEditFoldersSessionKey = "OwaEditFoldersSession";
[ConfigurationProperty(KeyKey, IsKey = true, IsRequired = true)] [ConfigurationProperty(KeyKey, IsKey = true, IsRequired = true)]
public string Key public string Key

View file

@ -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]

View file

@ -3,11 +3,19 @@ using System.Linq;
namespace WebsitePanel.WebDav.Core.Extensions namespace WebsitePanel.WebDav.Core.Extensions
{ {
static class UriExtensions public static class UriExtensions
{ {
public static Uri Append(this Uri uri, params string[] paths) public static Uri Append(this Uri uri, params string[] paths)
{ {
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);
}
} }
} }

View file

@ -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);
@ -295,11 +295,11 @@ namespace WebsitePanel.WebDav.Core
{ {
XmlResponseList = XmlDoc.GetElementsByTagName("d:response"); XmlResponseList = XmlDoc.GetElementsByTagName("d:response");
} }
var children = new WebDavHierarchyItem[XmlResponseList.Count]; var children = new WebDavResource[XmlResponseList.Count];
int counter = 0; int counter = 0;
foreach (XmlNode XmlCurrentResponse in XmlResponseList) foreach (XmlNode XmlCurrentResponse in XmlResponseList)
{ {
var item = new WebDavHierarchyItem(); var item = new WebDavResource();
item.SetCredentials(_credentials); item.SetCredentials(_credentials);
foreach (XmlNode XmlCurrentNode in XmlCurrentResponse.ChildNodes) foreach (XmlNode XmlCurrentNode in XmlCurrentResponse.ChildNodes)

View file

@ -9,6 +9,7 @@ namespace WebsitePanel.WebDav.Core
long ContentLength { get; } long ContentLength { get; }
long AllocatedSpace { get; set; } long AllocatedSpace { get; set; }
string ContentType { get; } string ContentType { get; }
string Summary { get; set; }
void Download(string filename); void Download(string filename);
byte[] Download(); byte[] Download();

View file

@ -50,6 +50,7 @@ namespace WebsitePanel.WebDav.Core
SendChunked = false; SendChunked = false;
AllowWriteStreamBuffering = false; AllowWriteStreamBuffering = false;
IsRootItem = item.IsRootItem;
SetCredentials(credentials); SetCredentials(credentials);
SetHierarchyItem(item); SetHierarchyItem(item);
} }
@ -88,6 +89,8 @@ namespace WebsitePanel.WebDav.Core
} }
} }
public string Summary { get; set; }
/// <summary> /// <summary>
/// Downloads content of the resource to a file specified by filename /// Downloads content of the resource to a file specified by filename
/// </summary> /// </summary>
@ -257,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)
@ -480,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);
} }

View file

@ -19,5 +19,6 @@ namespace WebsitePanel.WebDav.Core.Interfaces.Managers
string GetFileUrl(string path); string GetFileUrl(string path);
void DeleteResource(string path); void DeleteResource(string path);
void LockFile(string path); void LockFile(string path);
string GetFileFolderPath(string path);
} }
} }

View file

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

View file

@ -50,9 +50,9 @@ namespace WebsitePanel.WebDav.Core.Managers
children = ConnectToWebDavServer().Select(x => new WebDavResource children = ConnectToWebDavServer().Select(x => new WebDavResource
{ {
Href = new Uri(x.Url), Href = new Uri(x.Url),
ItemType = ItemType.Folder, ItemType = ItemType.Folder,
ContentLength = x.Size, ContentLength = x.Size * 1024 * 1024,
AllocatedSpace = x.FRSMQuotaMB, AllocatedSpace = (long)x.FRSMQuotaMB * 1024 * 1024,
IsRootItem = true IsRootItem = true
}).ToArray(); }).ToArray();
} }
@ -103,7 +103,7 @@ namespace WebsitePanel.WebDav.Core.Managers
public bool IsFile(string path) public bool IsFile(string path)
{ {
string folder = GetFileFolder(path); string folder = GetFileFolderPath(path);
if (string.IsNullOrWhiteSpace(folder)) if (string.IsNullOrWhiteSpace(folder))
{ {
@ -124,7 +124,7 @@ namespace WebsitePanel.WebDav.Core.Managers
{ {
try try
{ {
string folder = GetFileFolder(path); string folder = GetFileFolderPath(path);
var resourceName = GetResourceName(path); var resourceName = GetResourceName(path);
@ -212,7 +212,7 @@ namespace WebsitePanel.WebDav.Core.Managers
path = RemoveLeadingFromPath(path, "edit"); path = RemoveLeadingFromPath(path, "edit");
path = RemoveLeadingFromPath(path, WspContext.User.OrganizationId); path = RemoveLeadingFromPath(path, WspContext.User.OrganizationId);
string folderPath = GetFileFolder(path); string folderPath = GetFileFolderPath(path);
OpenFolder(folderPath); OpenFolder(folderPath);
@ -232,7 +232,7 @@ namespace WebsitePanel.WebDav.Core.Managers
{ {
try try
{ {
string folder = GetFileFolder(path); string folder = GetFileFolderPath(path);
var resourceName = GetResourceName(path); var resourceName = GetResourceName(path);
@ -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;
} }
} }
@ -250,7 +250,7 @@ namespace WebsitePanel.WebDav.Core.Managers
{ {
try try
{ {
string folder = GetFileFolder(path); string folder = GetFileFolderPath(path);
var resourceName = GetResourceName(path); var resourceName = GetResourceName(path);
@ -270,7 +270,7 @@ namespace WebsitePanel.WebDav.Core.Managers
{ {
try try
{ {
string folder = GetFileFolder(path); string folder = GetFileFolderPath(path);
var resourceName = GetResourceName(path); var resourceName = GetResourceName(path);
@ -345,6 +345,7 @@ namespace WebsitePanel.WebDav.Core.Managers
webDavitem.SetLastModified(file.Changed); webDavitem.SetLastModified(file.Changed);
webDavitem.ContentLength = file.Size; webDavitem.ContentLength = file.Size;
webDavitem.AllocatedSpace = file.FRSMQuotaMB; webDavitem.AllocatedSpace = file.FRSMQuotaMB;
webDavitem.Summary = file.Summary;
convertResult.Add(webDavitem); convertResult.Add(webDavitem);
} }
@ -372,7 +373,7 @@ namespace WebsitePanel.WebDav.Core.Managers
targetStream.Write(buffer, 0, n); targetStream.Write(buffer, 0, n);
} }
private string GetFileFolder(string path) public string GetFileFolderPath(string path)
{ {
path = path.TrimEnd('/'); path = path.TrimEnd('/');

View file

@ -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);
var fileBytes = _webDavManager.GetFileBytes(token.FilePath); Atom atom;
var atom = new AtomFromByteArray(fileBytes); if (_webDavManager.FileExist(token.FilePath))
{
var fileBytes = _webDavManager.GetFileBytes(token.FilePath);
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);

View file

@ -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,25 +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 readOnly = _webDavAuthorizationService.GetPermissions(WspContext.User, path).HasFlag(WebDavPermissions.Write) == false; var permissions = _webDavAuthorizationService.GetPermissions(WspContext.User, token.FilePath);
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,
@ -51,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();
} }
} }
} }

View file

@ -8,6 +8,8 @@ namespace WebsitePanel.WebDav.Core.Security.Authorization.Enums
Empty = 0, Empty = 0,
None = 1, None = 1,
Read = 2, Read = 2,
Write = 4 Write = 4,
OwaRead = 8,
OwaEdit = 16
} }
} }

View file

@ -2,6 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Web; using System.Web;
using Cobalt;
using WebsitePanel.EnterpriseServer.Base.HostedSolution; using WebsitePanel.EnterpriseServer.Base.HostedSolution;
using WebsitePanel.Providers.HostedSolution; using WebsitePanel.Providers.HostedSolution;
using WebsitePanel.WebDav.Core.Config; using WebsitePanel.WebDav.Core.Config;
@ -54,6 +55,17 @@ namespace WebsitePanel.WebDav.Core.Security.Authorization
} }
} }
var owaEditFolders = GetOwaFoldersWithEditPermission(principal);
if (owaEditFolders.Contains(rootFolder))
{
resultPermissions |= WebDavPermissions.OwaEdit;
}
else
{
resultPermissions |= WebDavPermissions.OwaRead;
}
return resultPermissions; return resultPermissions;
} }
@ -105,5 +117,41 @@ namespace WebsitePanel.WebDav.Core.Security.Authorization
return groups ?? new ExchangeAccount[0]; return groups ?? new ExchangeAccount[0];
} }
private IEnumerable<string> GetOwaFoldersWithEditPermission(WspPrincipal principal)
{
var folders = HttpContext.Current.Session != null ? HttpContext.Current.Session[WebDavAppConfigManager.Instance.SessionKeys.OwaEditFoldersSessionKey] as IEnumerable<string> : null;
if (folders != null)
{
return folders;
}
var accountsIds = new List<int>();
accountsIds.Add(principal.AccountId);
var groups = GetUserSecurityGroups(principal);
accountsIds.AddRange(groups.Select(x=>x.AccountId));
try
{
folders = WspContext.Services.EnterpriseStorage.GetUserEnterpriseFolderWithOwaEditPermission(principal.ItemId, accountsIds.ToArray());
}
catch (Exception)
{
//TODO remove try catch when es &portal will be updated
return new List<string>();
}
if (HttpContext.Current.Session != null)
{
HttpContext.Current.Session[WebDavAppConfigManager.Instance.SessionKeys.OwaEditFoldersSessionKey] = folders;
}
return folders;
}
} }
} }

View file

@ -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"
)); ));

View file

@ -46,6 +46,32 @@ 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(
name: FileSystemRouteNames.SearchFiles,
url: "storage/search/{org}/{*pathPart}",
defaults: new { controller = "FileSystem", action = "SearchFiles", pathPart = UrlParameter.Optional }
);
routes.MapRoute(
name: FileSystemRouteNames.SearchFilesContent,
url: "storage/ajax/search/{org}/{*pathPart}",
defaults: new { controller = "FileSystem", action = "SearchFilesContent", pathPart = UrlParameter.Optional }
);
routes.MapRoute( routes.MapRoute(
name: FileSystemRouteNames.ChangeWebDavViewType, name: FileSystemRouteNames.ChangeWebDavViewType,
url: "storage/change-view-type/{viewType}", url: "storage/change-view-type/{viewType}",

View file

@ -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";
@ -21,5 +24,8 @@ namespace WebsitePanel.WebDavPortal.UI.Routes
public const string DeleteFiles = "DeleteFilesRoute"; public const string DeleteFiles = "DeleteFilesRoute";
public const string DownloadFile = "DownloadFileRoute"; public const string DownloadFile = "DownloadFileRoute";
public const string SearchFiles = "SearchFilesRoute";
public const string SearchFilesContent = "SearchFilesPostRoute";
} }
} }

View file

@ -0,0 +1,7 @@
namespace WebsitePanel.WebDavPortal.Constants
{
public class Formtas
{
public const string DateFormatWithTime = "MM/dd/yyyy hh:mm tt";
}
}

View file

@ -60,6 +60,17 @@ tr.selected-file {
.table-icon { .table-icon {
height: 30px; height: 30px;
vertical-align: top;
}
.column-name .file-info {
display: inline-block;
padding-left: 5px;
width: 90%;
}
.table-icon.search {
height: 45px;
} }
.noselect { .noselect {
@ -77,6 +88,8 @@ tr.selected-file {
#webdav-items-table .file-link { #webdav-items-table .file-link {
padding-left: 5px; padding-left: 5px;
padding-top: 5px;
display: inline-block;
vertical-align: middle !important; vertical-align: middle !important;
} }
@ -86,6 +99,12 @@ tr.selected-file {
height: 32px; height: 32px;
} }
#summary.summary {
font-size: 11px;
color: rgb(152, 152, 152);
word-wrap: break-word;
}
.drag-and-drop-area input { .drag-and-drop-area input {
/* IE 8 */ /* IE 8 */
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
@ -233,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;
} }
@ -252,16 +276,41 @@ tr.selected-file {
width: 200px; width: 200px;
} }
.search-block { .dataTables_processing {
float: right; 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;
} }
.search-block input, .search-block label { .breadcrumb-wsp {
display: inline-block;
padding-top: 5px;
}
.search-block {
float: right;
margin-right: 10px !important;
width: 36%;
}
.search-block input{
display: inline-block;
font-weight: normal;
}
.search-block label {
display: inline-block; display: inline-block;
width: initial; width: initial;
font-weight: normal; font-weight: normal;
} }
.elements-container { .elements-container {
padding-top: 10px; padding-top: 10px;
} }
@ -295,6 +344,25 @@ tr.selected-file {
display: block; display: block;
} }
.column-name {
position: relative;
}
.column-name #quota {
position: absolute;
right: 0px;
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;}
@ -361,4 +429,10 @@ div#breadcrumb_wrapper a:last-child {
.header-portal-title { .header-portal-title {
float: none; float: none;
display: inline-block; display: inline-block;
}
@media (min-width: 768px) {
.navbar-right {
margin-right: 0;
}
} }

View file

@ -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);
var urlPart = Url.Route(FileSystemRouteNames.ShowContentPath, new { org = WspContext.User.OrganizationId, pathPart = token.FilePath }); if (fileInfo.Size <= 1)
{
return fileInfo;
}
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);

View file

@ -35,6 +35,7 @@ using WebsitePanel.WebDavPortal.Models.Common.Enums;
using WebsitePanel.WebDavPortal.Models.FileSystem; using WebsitePanel.WebDavPortal.Models.FileSystem;
using WebsitePanel.WebDavPortal.UI; using WebsitePanel.WebDavPortal.UI;
using WebsitePanel.WebDavPortal.UI.Routes; using WebsitePanel.WebDavPortal.UI.Routes;
using WebsitePanel.WebDav.Core.Extensions;
namespace WebsitePanel.WebDavPortal.Controllers namespace WebsitePanel.WebDavPortal.Controllers
@ -143,7 +144,6 @@ namespace WebsitePanel.WebDavPortal.Controllers
} }
} }
[HttpGet] [HttpGet]
public ActionResult GetContentDetails(string org, string pathPart, [ModelBinder(typeof (JqueryDataTableModelBinder))] JqueryDataTableRequest dtRequest) public ActionResult GetContentDetails(string org, string pathPart, [ModelBinder(typeof (JqueryDataTableModelBinder))] JqueryDataTableRequest dtRequest)
{ {
@ -151,16 +151,16 @@ namespace WebsitePanel.WebDavPortal.Controllers
if (string.IsNullOrEmpty(dtRequest.Search.Value) == false) if (string.IsNullOrEmpty(dtRequest.Search.Value) == false)
{ {
folderItems = _webdavManager.SearchFiles(WspContext.User.ItemId, pathPart, dtRequest.Search.Value, WspContext.User.Login, true).Select(x => new WebDavResource(null, x)); folderItems = _webdavManager.SearchFiles(WspContext.User.ItemId, pathPart, dtRequest.Search.Value, WspContext.User.Login, true).Cast<WebDavResource>();
} }
else else
{ {
folderItems = _webdavManager.OpenFolder(pathPart).Select(x=>new WebDavResource(null, x)); folderItems = _webdavManager.OpenFolder(pathPart).Cast<WebDavResource>();
} }
var tableItems = Mapper.Map<IEnumerable<WebDavResource>, IEnumerable<ResourceTableItemModel>>(folderItems).ToList(); var tableItems = Mapper.Map<IEnumerable<WebDavResource>, IEnumerable<ResourceTableItemModel>>(folderItems).ToList();
FillContentModel(tableItems); FillContentModel(tableItems, org);
var orders = dtRequest.Orders.ToList(); var orders = dtRequest.Orders.ToList();
orders.Insert(0, new JqueryDataTableOrder{Column = 3, Ascending = false}); orders.Insert(0, new JqueryDataTableOrder{Column = 3, Ascending = false});
@ -184,6 +184,24 @@ namespace WebsitePanel.WebDavPortal.Controllers
return PartialView("_ResourseCollectionPartial", result); return PartialView("_ResourseCollectionPartial", result);
} }
public ActionResult SearchFiles(string org, string pathPart, string searchValue)
{
if (string.IsNullOrEmpty(searchValue))
{
return RedirectToRoute(FileSystemRouteNames.ShowContentPath);
}
var model = new ModelForWebDav
{
UrlSuffix = pathPart,
Permissions = _webDavAuthorizationService.GetPermissions(WspContext.User, pathPart),
UserSettings = _userSettingsManager.GetUserSettings(WspContext.User.AccountId),
SearchValue = searchValue
};
return View("ShowContentSearchResultTable", model);
}
[HttpGet] [HttpGet]
public ActionResult DownloadFile(string org, string pathPart) public ActionResult DownloadFile(string org, string pathPart)
{ {
@ -285,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)
@ -318,7 +366,7 @@ namespace WebsitePanel.WebDavPortal.Controllers
{ {
var permissions = _webDavAuthorizationService.GetPermissions(WspContext.User, pathPart); var permissions = _webDavAuthorizationService.GetPermissions(WspContext.User, pathPart);
if (permissions.HasFlag(WebDavPermissions.Write) == false || Request.Browser.IsMobileDevice) if (permissions.HasFlag(WebDavPermissions.Write) == false || permissions.HasFlag(WebDavPermissions.OwaEdit) == false || Request.Browser.IsMobileDevice)
{ {
return new RedirectToRouteResult(FileSystemRouteNames.ViewOfficeOnline, null); return new RedirectToRouteResult(FileSystemRouteNames.ViewOfficeOnline, null);
} }
@ -327,19 +375,21 @@ namespace WebsitePanel.WebDavPortal.Controllers
return ShowOfficeDocument(org, pathPart, owaOpener.OwaEditor); return ShowOfficeDocument(org, pathPart, owaOpener.OwaEditor);
} }
#endregion #endregion
private void FillContentModel(IEnumerable<ResourceTableItemModel> items) private void FillContentModel(IEnumerable<ResourceTableItemModel> items, string organizationId)
{ {
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.ToString().Replace("/" + WspContext.User.OrganizationId, "").TrimStart('/');
var pathPart = item.Href.ToStringPath().Replace("/" + WspContext.User.OrganizationId, "").TrimStart('/');
switch (opener) switch (opener)
{ {
case FileOpenerType.OfficeOnline: case FileOpenerType.OfficeOnline:
{ {
var pathPart = item.Href.AbsolutePath.Replace("/" + WspContext.User.OrganizationId, "").TrimStart('/');
item.Url = string.Concat(Url.RouteUrl(FileSystemRouteNames.EditOfficeOnline, new {org = WspContext.User.OrganizationId, pathPart = ""}), pathPart); item.Url = string.Concat(Url.RouteUrl(FileSystemRouteNames.EditOfficeOnline, new {org = WspContext.User.OrganizationId, pathPart = ""}), pathPart);
break; break;
} }
@ -350,6 +400,11 @@ namespace WebsitePanel.WebDavPortal.Controllers
} }
} }
var folderPath = Server.UrlDecode(_webdavManager.GetFileFolderPath(pathPart));
item.FolderUrlAbsoluteString = Server.UrlDecode(Url.RouteUrl(FileSystemRouteNames.ShowContentPath, new {org = organizationId, pathPart = folderPath}, Request.Url.Scheme));
item.FolderUrlLocalString = Url.RouteUrl(FileSystemRouteNames.ShowContentPath, new { org = organizationId, pathPart = folderPath });
if (Request.Browser.IsMobileDevice) if (Request.Browser.IsMobileDevice)
{ {
item.IsTargetBlank = false; item.IsTargetBlank = false;

View file

@ -0,0 +1,31 @@
using System;
namespace WebsitePanel.WebDavPortal.Helpers
{
public class ViewDataHelper
{
public static string BytesToSize(long bytes)
{
if (bytes == 0)
{
return string.Format("0 {0}", Resources.UI.Byte);
}
var k = 1024;
var sizes = new[]
{
Resources.UI.Bytes,
Resources.UI.KilobyteShort,
Resources.UI.MegabyteShort,
Resources.UI.GigabyteShort,
Resources.UI.TerabyteShort,
Resources.UI.PetabyteShort,
Resources.UI.ExabyteShort
};
var i = (int) Math.Floor(Math.Log(bytes)/Math.Log(k));
return string.Format("{0} {1}", Math.Round(bytes/Math.Pow(k, i), 3), sizes[i]);
}
}
}

View file

@ -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,9 +44,12 @@ 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.IsRoot, x => x.MapFrom(hi => hi.IsRootItem))
.ForMember(ti => ti.Size, x => x.MapFrom(hi => hi.ContentLength)) .ForMember(ti => ti.Size, x => x.MapFrom(hi => hi.ContentLength))
.ForMember(ti => ti.Quota, x => x.MapFrom(hi => hi.AllocatedSpace))
.ForMember(ti => ti.IsFolder, x => x.MapFrom(hi => hi.ItemType == ItemType.Folder)); .ForMember(ti => ti.IsFolder, x => x.MapFrom(hi => hi.ItemType == ItemType.Folder));
} }
} }

View file

@ -12,10 +12,16 @@ namespace WebsitePanel.WebDavPortal.Models.FileSystem
public bool IsTargetBlank { get; set; } public bool IsTargetBlank { get; set; }
public bool IsFolder { get; set; } public bool IsFolder { get; set; }
public long Size { get; set; } public long Size { get; set; }
public bool IsRoot { get; set; }
public long Quota { get; set; }
public string Type { get; set; } public string Type { get; set; }
public DateTime LastModified { get; set; } public DateTime LastModified { get; set; }
public string LastModifiedFormated { get; set; } public string LastModifiedFormated { get; set; }
public string IconHref { get; set; } public string IconHref { get; set; }
public string FolderUrlAbsoluteString { get; set; }
public string FolderUrlLocalString { get; set; }
public string FolderName { get; set; }
public string Summary { get; set; }
public override dynamic this[int index] public override dynamic this[int index]
{ {

View file

@ -69,6 +69,24 @@ namespace WebsitePanel.WebDavPortal.Resources {
} }
} }
/// <summary>
/// Looks up a localized string similar to Byte.
/// </summary>
public static string Byte {
get {
return ResourceManager.GetString("Byte", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Bytes.
/// </summary>
public static string Bytes {
get {
return ResourceManager.GetString("Bytes", resourceCulture);
}
}
/// <summary> /// <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,42 @@ 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>
/// Looks up a localized string similar to File.
/// </summary>
public static string File {
get {
return ResourceManager.GetString("File", resourceCulture);
}
}
/// <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>
@ -168,6 +240,24 @@ namespace WebsitePanel.WebDavPortal.Resources {
} }
} }
/// <summary>
/// Looks up a localized string similar to Info.
/// </summary>
public static string Info {
get {
return ResourceManager.GetString("Info", resourceCulture);
}
}
/// <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>
@ -177,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>
@ -222,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>
@ -231,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>
@ -258,6 +384,24 @@ namespace WebsitePanel.WebDavPortal.Resources {
} }
} }
/// <summary>
/// Looks up a localized string similar to Search Documents.
/// </summary>
public static string SearchDocuments {
get {
return ResourceManager.GetString("SearchDocuments", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Search Results.
/// </summary>
public static string SearchResults {
get {
return ResourceManager.GetString("SearchResults", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to Select files to upload. /// Looks up a localized string similar to Select files to upload.
/// </summary> /// </summary>
@ -285,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>
@ -303,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>

View file

@ -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,18 +153,45 @@
<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">
<value>File</value>
</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>
<data name="GigabyteShort" xml:space="preserve"> <data name="GigabyteShort" xml:space="preserve">
<value>Gb</value> <value>Gb</value>
</data> </data>
<data name="Info" xml:space="preserve">
<value>Info</value>
</data>
<data name="ItemExist" xml:space="preserve">
<value>File already exist</value>
</data>
<data name="ItemsWasRemovedFormat" xml:space="preserve"> <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>
@ -171,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>
@ -183,6 +225,12 @@
<data name="Search" xml:space="preserve"> <data name="Search" xml:space="preserve">
<value>Search</value> <value>Search</value>
</data> </data>
<data name="SearchDocuments" xml:space="preserve">
<value>Search Documents</value>
</data>
<data name="SearchResults" xml:space="preserve">
<value>Search Results</value>
</data>
<data name="SelectFilesToUpload" xml:space="preserve"> <data name="SelectFilesToUpload" xml:space="preserve">
<value>Select files to upload</value> <value>Select files to upload</value>
</data> </data>
@ -192,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>

View file

@ -1,18 +1,19 @@
function CheckAuthenticationExpiration(authcookieName, logoutUrl) { function CheckAuthenticationExpiration(authTimeOutCookieName, authCookieName, logoutUrl) {
var c = $.cookie(authcookieName); var c = $.cookie(authTimeOutCookieName);
if (c != null && c != "" && !isNaN(c)) { if (c != null && c != "" && !isNaN(c)) {
var now = new Date(); var now = new Date();
var ms = parseInt(c, 10); var ms = parseInt(c, 10);
var expiration = new Date().setTime(ms); var expiration = new Date().setTime(ms);
if (now > expiration) { if (now > expiration) {
$.removeCookie(authTimeOutCookieName, { path: '/' });
window.location.replace(logoutUrl); window.location.replace(logoutUrl);
} }
} }
} }
function StartAuthExpirationCheckTimer(authcookieName, logoutUrl) { function StartAuthExpirationCheckTimer(authTimeOutCookieName, authCookieName, logoutUrl) {
setInterval(function() { setInterval(function() {
CheckAuthenticationExpiration(authcookieName, logoutUrl); CheckAuthenticationExpiration(authTimeOutCookieName, authCookieName, logoutUrl);
}, 20000); }, 20000);
} }

View file

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

View file

@ -1,6 +1,21 @@
function WspFileBrowser() { function WspFileBrowser() {
this.settings = { deletionBlockSelector: ".file-actions-menu .file-deletion", deletionUrl: "storage/files-group-action/delete" }; this.settings = {
this.table = null; deletionBlockSelector: ".file-actions-menu .file-deletion",
deletionUrl: "storage/files-group-action/delete",
fileExistUrl: "storage/fileExist",
textDateModified: "Date modified",
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.searchTable = null;
} }
WspFileBrowser.prototype = { WspFileBrowser.prototype = {
@ -34,7 +49,8 @@ WspFileBrowser.prototype = {
}).get(); }).get();
}, },
deleteSelectedItems: function(e) { deleteSelectedItems: function (e) {
$.ajax({ $.ajax({
type: 'POST', type: 'POST',
url: wsp.fileBrowser.settings.deletionUrl, url: wsp.fileBrowser.settings.deletionUrl,
@ -45,7 +61,7 @@ WspFileBrowser.prototype = {
wsp.fileBrowser.clearDeletedItems(model.DeletedFiles); wsp.fileBrowser.clearDeletedItems(model.DeletedFiles);
wsp.fileBrowser.refreshDeletionBlock(); wsp.fileBrowser.refreshDeletionBlock();
wsp.fileBrowser.refreshDataTable(); wsp.fileBrowser.refreshDataTable(wsp.fileBrowser.itemsTable);
wsp.dialogs.hideProcessDialog(); wsp.dialogs.hideProcessDialog();
}, },
@ -53,7 +69,7 @@ WspFileBrowser.prototype = {
wsp.messages.addErrorMessage(errorThrown); wsp.messages.addErrorMessage(errorThrown);
wsp.fileBrowser.refreshDeletionBlock(); wsp.fileBrowser.refreshDeletionBlock();
wsp.fileBrowser.refreshDataTable(); wsp.fileBrowser.refreshDataTable(wsp.fileBrowser.itemsTable);
wsp.dialogs.hideProcessDialog(); wsp.dialogs.hideProcessDialog();
} }
@ -79,17 +95,19 @@ WspFileBrowser.prototype = {
}, },
initDataTable: function (tableId, ajaxUrl) { initDataTable: function (tableId, ajaxUrl) {
this.table = $(tableId).dataTable({ this.itemsTable = $(tableId).dataTable({
"ajax": ajaxUrl, "ajax": ajaxUrl,
"processing": false, "processing": true,
"serverSide": true, "serverSide": true,
"dom": 'rtlp',
"columnDefs": [ "columnDefs": [
{ {
"render": function(data, type, row) { "render": function(data, type, row) {
return '<img class="table-icon" src="' + row.IconHref + '"/>' + return '<div class="column-name"><img class="table-icon" src="' + row.IconHref + '"/>' +
'<a href="' + row.Url + '" ' + (row.IsTargetBlank ? 'target="_blank"' : '') + ' class="file-link ' + (row.IsFolder ? 'processing-dialog':'') + '" title="' + row.DisplayName + '">' + '<a href="' + row.Url + '" ' + (row.IsTargetBlank ? 'target="_blank"' : '') + ' class="file-link" title="' + row.DisplayName + '">' +
row.DisplayName + row.DisplayName +
'</a>'; '</a>' + (row.IsRoot ? '<span id="quota">' + wsp.fileBrowser.bytesToSize(row.Size) + ' / ' + wsp.fileBrowser.bytesToSize(row.Quota) + '</span>' : '')
+'</div>';
}, },
"targets": 0 "targets": 0
}, },
@ -114,31 +132,88 @@ 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();
} }
}); });
$(tableId).removeClass('dataTable'); $(tableId).removeClass('dataTable');
var oTable = this.table; //var oTable = this.table;
$(tableId+'_filter input').unbind();
$(tableId+'_filter input').bind('keyup', function (e) { //$(searchInputId).bind('keyup', function (e) {
if (e.keyCode == 13) { // if (e.keyCode == 13) {
oTable.fnFilter(this.value); // oTable.fnFilter(this.value);
} // }
}); //});
//$(searchInputId).keydown(function (event) {
// if (event.keyCode == 13) {
// event.preventDefault();
// return false;
// }
// return true;
//});
}, },
refreshDataTable: function () { initSearchDataTable: function (tableId, ajaxUrl, initSearch) {
if (this.table != null) {
this.table.fnDraw(false); var settings = this.settings;
var classThis = this;
this.searchTable = $(tableId).dataTable({
"ajax": ajaxUrl,
"processing": true,
"serverSide": true,
"oSearch": { "sSearch": initSearch },
"dom": 'rtlp',
"columnDefs": [
{
"render": function (data, type, row) {
return '<div class="column-name">' +
'<img class="table-icon search" src="' + row.IconHref + '"/>' +
'<div class="file-info">' +
'<a href="' + row.Url + '" ' + (row.IsTargetBlank ? 'target="_blank"' : '') + ' class="file-link" title="' + row.DisplayName + '">' +
row.DisplayName +
'</a>' +
'<div id="summary" class="summary">' + (row.Summary ? (row.Summary + '').substring(0, 500) + '...' : '') + '</div>' +
'<div>' +
'<a href="' + row.FolderUrlLocalString + '" ' + 'target="_blank" class="file-link" >' +
row.FolderUrlAbsoluteString +
'</a>' +
'</div>' +
'</div>' +
'</div>';
},
"targets": 0
},
{
"render": function (data, type, row) {
return '<div>' +settings.textDateModified+': '+ row.LastModifiedFormated+ '</div>' +
'<div>' + settings.textSize + ': ' + classThis.bytesToSize(row.Size) + '</div>';
},
"orderable": false,
"width": "25%",
"targets": 1
}
],
"createdRow": function (row, data, index) {
$(row).addClass('element-container');
},
"oLanguage": {
"sProcessing": this.settings.processingDialogDom
}
});
$(tableId).removeClass('dataTable');
},
refreshDataTable: function (table) {
if (table != null) {
table.fnDraw(false);
} }
}, },
@ -186,6 +261,48 @@ WspFileBrowser.prototype = {
} }
}); });
}; };
},
bytesToSize: function(bytes) {
if (bytes == 0) return '0 Byte';
var k = 1024;
var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
var i = Math.floor(Math.log(bytes) / Math.log(k));
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);
}
};
} }
}; };

View file

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

View file

@ -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) {
} else { $(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 {
error.insertAfter(element);
}
}
});
wsp.fileBrowser.clearAllSelectedItems(); $.validator.addMethod("synchronousRemote", function(value, element, param) {
if (this.optional(element)) {
return "dependency-mismatch";
}
wsp.fileBrowser.selectItem(this); 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;
wsp.fileBrowser.refreshDeletionBlock(); param = typeof param === "string" && { url: param } || param;
});
$(document).on('touchstart', '.element-container', function(e) { if (previous.old === value) {
var now = new Date().getTime(); return previous.valid;
var lastTouch = $(this).data('lastTouch') || now + 1; }
var delta = now - lastTouch;
if (delta < 300 && delta > 0) { previous.old = value;
wsp.fileBrowser.openItem(this); var validator = this;
$(this).data('lastTouch', 0); this.startRequest(element);
} var data = {};
data[element.name] = value;
$(this).data('lastTouch', now); var valid = "pending";
}); $.ajax($.extend(true, {
url: param,
//Double click file open async: false,
$(document).on('dblclick', '.element-container', function (e) { mode: "abort",
wsp.fileBrowser.openItem(this); port: "validate" + element.name,
dataType: "json",
var links = $(this).find('.file-link'); data: data,
success: function(response) {
if (links.length != 0 && $(links[0]).hasClass('processing-dialog')) { validator.settings.messages[element.name].remote = previous.originalMessage;
wsp.dialogs.showProcessDialog(); 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.");
}); });
//Delete button click $.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'); };
$(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();
});
function isMobileDevice() { function isMobileDevice() {

View file

@ -25,9 +25,15 @@ 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)
{ {
@ -47,15 +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 @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;">
@Html.Partial("_ProcessDialog", null) <div class="modal-dialog">
@Html.Partial("_ConfirmDialog") <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>
} }

View file

@ -0,0 +1,29 @@
@using WebsitePanel.WebDavPortal.Resources
@using WebsitePanel.WebDavPortal.UI.Routes
@model WebsitePanel.WebDavPortal.Models.ModelForWebDav
@Html.Partial("_ShowContentTopMenu", Model)
<div class="prevent-deselect container">
<table id="search-items-table" class="display table table-striped table-bordered noselect" cellspacing="0" width="100%">
<thead>
<tr>
<th>@UI.File</th>
<th>@UI.Details</th>
</tr>
</thead>
</table>
</div>
@section scripts
{
<script>
$(document).ready(function() {
wsp.fileBrowser.setSettings({ deletionUrl: "@Url.RouteUrl(FileSystemRouteNames.DeleteFiles)" });
wsp.fileBrowser.initSearchDataTable('#search-items-table', '@Url.RouteUrl(FileSystemRouteNames.ShowContentDetails)', '@Model.SearchValue');
});
</script>
@Scripts.Render("~/bundles/appScripts-webdav")
}

View file

@ -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">

View file

@ -3,21 +3,6 @@
@using WebsitePanel.WebDavPortal.UI.Routes @using WebsitePanel.WebDavPortal.UI.Routes
@model WebsitePanel.WebDavPortal.Models.ModelForWebDav @model WebsitePanel.WebDavPortal.Models.ModelForWebDav
<div class="container">
<div class="search-block navbar-right">
<div>
@using (Html.BeginRouteForm(FileSystemRouteNames.ShowContentPath))
{
<label>
@UI.Search:
</label>
@Html.TextBoxFor(x => x.SearchValue, new { @class = "form-control input-sm"})
}
</div>
</div>
</div>
<div class="container"> <div class="container">

View file

@ -15,8 +15,3 @@
</table> </table>
</div> </div>
@section popups
{
@Html.Partial("_ProcessDialog", null)
@Html.Partial("_ConfirmDialog")
}

View file

@ -10,42 +10,82 @@
@if (Model != null) @if (Model != null)
{ {
string header = WspContext.User.OrganizationId; string header = WspContext.User.OrganizationId;
<a href="/@header/" class="processing-dialog">@header</a> string[] elements = string.IsNullOrEmpty(Model.UrlSuffix)? new string[0]: Model.UrlSuffix.Split(new[] { "/" }, StringSplitOptions.RemoveEmptyEntries);
string[] elements = Model.UrlSuffix.Split(new[] { "/" }, StringSplitOptions.RemoveEmptyEntries);
for (int i = 0; i < elements.Length; i++) <div class="breadcrumb-wsp">
{ @if (String.IsNullOrEmpty(Model.SearchValue))
<span style="top: 2px;"> / </span> {
<a href="@string.Concat("/" + header + "/", string.Join("/", elements.Take(i + 1)))" class="processing-dialog">@elements[i]</a> <a href="/@header/" class="processing-dialog">@header</a>
}
} for (int i = 0; i < elements.Length; i++)
</div> {
<div class="container file-actions-menu prevent-deselect"> <span style="top: 2px;"> / </span>
@if (Model.Permissions.HasFlag(WebDavPermissions.Write)) <a href="@string.Concat("/" + header + "/", string.Join("/", elements.Take(i + 1)))" class="processing-dialog">@elements[i]</a>
{ }
<div class="file-deletion navbar-left"> }
<a id="delete-button" class="btn btn-danger btn-sm active" role="button" else
data-target="#confirm-dialog" {
data-target-positive-button-text="@UI.Delete" <a href="@Url.RouteUrl(FileSystemRouteNames.ShowContentPath)" class="processing-dialog">@(elements.Any() ?elements.Last():WspContext.User.OrganizationId)</a>
data-target-title-text="@UI.DeleteFileQuestion" <span style="top: 2px;"> / </span>
data-target-content="@UI.DialogsContentConfrimFileDeletion">@UI.Delete</a> <span>@UI.SearchResults</span>
}
</div>
<div class="search-block navbar-right">
<div>
@using (Html.BeginRouteForm(FileSystemRouteNames.SearchFiles, FormMethod.Post))
{
<div>
<label>
@UI.SearchDocuments:
</label>
@Html.TextBox("searchValue", Model.SearchValue, new { @class = "form-control input-sm" })
</div>
}
</div>
</div> </div>
} }
</div>
<div class="file-upload navbar-right"> @if (string.IsNullOrEmpty(Model.SearchValue))
@if (Request.Browser.IsMobileDevice == false) {
<div class="container file-actions-menu prevent-deselect">
@if (Model.Permissions.HasFlag(WebDavPermissions.Write))
{ {
<div class="btn-toolbar change-view-block" role="toolbar"> <div class="file-deletion navbar-left">
<div class="btn-group"> <a id="delete-button" class="btn btn-danger btn-sm active" role="button"
<a class="btn btn-default" title="@UI.Details" href="@Url.RouteUrl(FileSystemRouteNames.ChangeWebDavViewType, new { viewType = FolderViewTypes.BigIcons, org = WspContext.User.OrganizationId, pathPart = Model.UrlSuffix })"><span class="glyphicon glyphicon-th-large" aria-hidden="true"></span></a> data-target="#confirm-dialog"
<a class="btn btn-default" title="@UI.Table" href="@Url.RouteUrl(FileSystemRouteNames.ChangeWebDavViewType, new { viewType = FolderViewTypes.Table, org = WspContext.User.OrganizationId, pathPart = Model.UrlSuffix })"><span class="glyphicon glyphicon-th-list" aria-hidden="true"></span></a> data-target-positive-button-text="@UI.Delete"
</div> data-target-title-text="@UI.DeleteFileQuestion"
data-target-content="@UI.DialogsContentConfrimFileDeletion">@UI.Delete</a>
</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>
} }
@if (Model.Permissions.HasFlag(WebDavPermissions.Write)) <div class="file-upload navbar-right">
{ @if (Request.Browser.IsMobileDevice == false)
<a id="upload-button" class="btn btn-success btn-sm active" href="@Url.RouteUrl(FileSystemRouteNames.UploadFile)" role="button">@UI.FileUpload</a> {
} <div class="btn-toolbar change-view-block" role="toolbar">
<div class="btn-group">
<a class="btn btn-default" title="@UI.Details" href="@Url.RouteUrl(FileSystemRouteNames.ChangeWebDavViewType, new {viewType = FolderViewTypes.BigIcons, org = WspContext.User.OrganizationId, pathPart = Model.UrlSuffix})"><span class="glyphicon glyphicon-th-large" aria-hidden="true"></span></a>
<a class="btn btn-default" title="@UI.Table" href="@Url.RouteUrl(FileSystemRouteNames.ChangeWebDavViewType, new {viewType = FolderViewTypes.Table, org = WspContext.User.OrganizationId, pathPart = Model.UrlSuffix})"><span class="glyphicon glyphicon-th-list" aria-hidden="true"></span></a>
</div>
</div>
}
@if (Model.Permissions.HasFlag(WebDavPermissions.Write))
{
<a id="upload-button" class="btn btn-success btn-sm active" href="@Url.RouteUrl(FileSystemRouteNames.UploadFile)" role="button">@UI.FileUpload</a>
}
</div>
</div> </div>
}
</div>

View file

@ -47,6 +47,9 @@
</div> </div>
<div class="prevent-deselect"> <div class="prevent-deselect">
@Html.Partial("_ProcessDialog", null)
@Html.Partial("_ConfirmDialog")
@RenderSection("popups", required: false) @RenderSection("popups", required: false)
</div> </div>
@ -62,9 +65,9 @@
@Scripts.Render("~/bundles/authScripts") @Scripts.Render("~/bundles/authScripts")
<script> <script>
$(document).ready(function() { $(document).ready(function () {
StartAuthExpirationCheckTimer("@WebDavAppConfigManager.Instance.AuthTimeoutCookieName", "@Url.RouteUrl(AccountRouteNames.Logout)"); StartAuthExpirationCheckTimer("@WebDavAppConfigManager.Instance.AuthTimeoutCookieName", "@FormsAuthentication.FormsCookieName", "@Url.RouteUrl(AccountRouteNames.Logout)");
}); });
</script> </script>
} }

View file

@ -52,6 +52,7 @@
<add key="ResourseRenderCountSessionKey" value="ResourseRenderCount" /> <add key="ResourseRenderCountSessionKey" value="ResourseRenderCount" />
<add key="ItemIdSessionKey" value="ItemId" /> <add key="ItemIdSessionKey" value="ItemId" />
<add key="UserGroupsKey" value="UserGroups" /> <add key="UserGroupsKey" value="UserGroups" />
<add key="OwaEditFoldersSession" value="OwaEditFolders"/>
</sessionKeys> </sessionKeys>
<fileIcons defaultPath="~/Content/Images/other-icon.png" folderPath="~/Content/Images/folder_100x100.png"> <fileIcons defaultPath="~/Content/Images/other-icon.png" folderPath="~/Content/Images/folder_100x100.png">
<add extension=".txt" path="~/Content/Images/txt-icon.png" /> <add extension=".txt" path="~/Content/Images/txt-icon.png" />
@ -84,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&amp;"/> <add extension=".doc" OwaView="wv/wordviewerframe.aspx?" OwaEditor="wv/wordviewerframe.aspx?" OwaMobileView="wv/mWord.aspx?wdMobileHost=3&amp;" OwaNewFileView="we/wordeditorframe.aspx?new=1&amp;"/>
<add extension=".docx" OwaView="wv/wordviewerframe.aspx?" OwaEditor="we/wordeditorframe.aspx?" OwaMobileView="wv/mWord.aspx?wdMobileHost=3&amp;"/> <add extension=".docx" OwaView="wv/wordviewerframe.aspx?" OwaEditor="we/wordeditorframe.aspx?" OwaMobileView="wv/mWord.aspx?wdMobileHost=3&amp;" OwaNewFileView="we/wordeditorframe.aspx?new=1&amp;"/>
<add extension=".xls" OwaView="x/_layouts/xlviewerinternal.aspx?" OwaEditor="x/_layouts/xlviewerinternal.aspx?edit=1&amp;" OwaMobileView="x/_layouts/mobile/mXL.aspx?wdMobileHost=3&amp;"/> <add extension=".xls" OwaView="x/_layouts/xlviewerinternal.aspx?" OwaEditor="x/_layouts/xlviewerinternal.aspx?edit=1&amp;" OwaMobileView="x/_layouts/mobile/mXL.aspx?wdMobileHost=3&amp;" OwaNewFileView="x/_layouts/xlviewerinternal.aspx?new=1&amp;"/>
<add extension=".xlsx" OwaView="x/_layouts/xlviewerinternal.aspx?" OwaEditor="x/_layouts/xlviewerinternal.aspx?edit=1&amp;" OwaMobileView="x/_layouts/mobile/mXL.aspx?wdMobileHost=3&amp;" /> <add extension=".xlsx" OwaView="x/_layouts/xlviewerinternal.aspx?" OwaEditor="x/_layouts/xlviewerinternal.aspx?edit=1&amp;" OwaMobileView="x/_layouts/mobile/mXL.aspx?wdMobileHost=3&amp;" OwaNewFileView="x/_layouts/xlviewerinternal.aspx?edit=1&amp;"/>
<add extension=".ppt" OwaView="p/PowerPointFrame.aspx?" OwaEditor="p/PowerPointFrame.aspx?" OwaMobileView="p/mPPT.aspx?wdMobileHost=3&amp;"/> <add extension=".ppt" OwaView="p/PowerPointFrame.aspx?" OwaEditor="p/PowerPointFrame.aspx?" OwaMobileView="p/mPPT.aspx?wdMobileHost=3&amp;" OwaNewFileView="p/PowerPointFrame.aspx?PowerPointView=EditView&amp;New=1&amp;"/>
<add extension=".pptx" OwaView="p/PowerPointFrame.aspx?" OwaEditor="p/PowerPointFrame.aspx?PowerPointView=EditView&amp;" OwaMobileView="p/mPPT.aspx?wdMobileHost=3&amp;"/> <add extension=".pptx" OwaView="p/PowerPointFrame.aspx?" OwaEditor="p/PowerPointFrame.aspx?PowerPointView=EditView&amp;" OwaMobileView="p/mPPT.aspx?wdMobileHost=3&amp;" OwaNewFileView="p/PowerPointFrame.aspx?PowerPointView=EditView&amp;New=1&amp;"/>
</officeOnline> </officeOnline>
<typeOpener> <typeOpener>
<add extension=".jpg" mimeType="image/jpeg" isTargetBlank="true" /> <add extension=".jpg" mimeType="image/jpeg" isTargetBlank="true" />

View file

@ -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" />
@ -459,6 +464,7 @@
<Content Include="Views\FileSystem\_ShowContentTopMenu.cshtml" /> <Content Include="Views\FileSystem\_ShowContentTopMenu.cshtml" />
<Content Include="Views\FileSystem\_ShowContentBigIcons.cshtml" /> <Content Include="Views\FileSystem\_ShowContentBigIcons.cshtml" />
<Content Include="Views\FileSystem\UploadFiles.cshtml" /> <Content Include="Views\FileSystem\UploadFiles.cshtml" />
<Content Include="Views\FileSystem\ShowContentSearchResultTable.cshtml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="Models\FileSystem\Enums\" /> <Folder Include="Models\FileSystem\Enums\" />

View file

@ -135,6 +135,7 @@
<Control key="enterprisestorage_folders" /> <Control key="enterprisestorage_folders" />
<Control key="create_enterprisestorage_folder" general_key="enterprisestorage_folders" /> <Control key="create_enterprisestorage_folder" general_key="enterprisestorage_folders" />
<Control key="enterprisestorage_folder_settings" general_key="enterprisestorage_folders" /> <Control key="enterprisestorage_folder_settings" general_key="enterprisestorage_folders" />
<Control key="enterprisestorage_folder_settings_general" general_key="enterprisestorage_folders" />
<Control key="enterprisestorage_drive_maps" /> <Control key="enterprisestorage_drive_maps" />
<Control key="create_enterprisestorage_drive_map" general_key="enterprisestorage_drive_maps" /> <Control key="create_enterprisestorage_drive_map" general_key="enterprisestorage_drive_maps" />

View file

@ -563,6 +563,9 @@
<Control key="enterprisestorage_folders" src="WebsitePanel/ExchangeServer/EnterpriseStorageFolders.ascx" title="Enterprise Storage Folders" type="View" /> <Control key="enterprisestorage_folders" src="WebsitePanel/ExchangeServer/EnterpriseStorageFolders.ascx" title="Enterprise Storage Folders" type="View" />
<Control key="create_enterprisestorage_folder" src="WebsitePanel/ExchangeServer/EnterpriseStorageCreateFolder.ascx" title="Create New ES Folder" type="View" /> <Control key="create_enterprisestorage_folder" src="WebsitePanel/ExchangeServer/EnterpriseStorageCreateFolder.ascx" title="Create New ES Folder" type="View" />
<Control key="enterprisestorage_folder_settings" src="WebsitePanel/ExchangeServer/EnterpriseStorageFolderGeneralSettings.ascx" title="Edit ES Folder" type="View" /> <Control key="enterprisestorage_folder_settings" src="WebsitePanel/ExchangeServer/EnterpriseStorageFolderGeneralSettings.ascx" title="Edit ES Folder" type="View" />
<Control key="enterprisestorage_folder_settings_folder_permissions" src="WebsitePanel/ExchangeServer/EnterpriseStorageFolderSettingsFolderPermissions.ascx" title="Edit ES Folder" type="View" />
<Control key="enterprisestorage_folder_settings_owa_editing" src="WebsitePanel/ExchangeServer/EnterpriseStorageFolderSettingsOwaEditing.ascx" title="Edit ES Folder" type="View" />
<Control key="enterprisestorage_drive_maps" src="WebsitePanel/ExchangeServer/EnterpriseStorageDriveMaps.ascx" title="Enterprise Storage Drive Maps" type="View" /> <Control key="enterprisestorage_drive_maps" src="WebsitePanel/ExchangeServer/EnterpriseStorageDriveMaps.ascx" title="Enterprise Storage Drive Maps" type="View" />
<Control key="create_enterprisestorage_drive_map" src="WebsitePanel/ExchangeServer/EnterpriseStorageCreateDriveMap.ascx" title="Create New ES Drive Map" type="View" /> <Control key="create_enterprisestorage_drive_map" src="WebsitePanel/ExchangeServer/EnterpriseStorageCreateDriveMap.ascx" title="Create New ES Drive Map" type="View" />

View file

@ -5656,6 +5656,12 @@
<data name="ERROR.RDSSESSIONHOST_CERTIFICATE_NOT_INSTALLED" xml:space="preserve"> <data name="ERROR.RDSSESSIONHOST_CERTIFICATE_NOT_INSTALLED" xml:space="preserve">
<value>Session host certificate not installed</value> <value>Session host certificate not installed</value>
</data> </data>
<data name="ERROR.RDSSERVER_NOT_ADDED" xml:space="preserve">
<value>RDS Server not added</value>
</data>
<data name="Success.RDSSESSIONHOST_CERTIFICATE_INSTALLED" xml:space="preserve">
<value>Session host certificate has been installed</value>
</data>
<data name="ERROR.RDSCOLLECTIONSETTINGS_NOT_UPDATES" xml:space="preserve"> <data name="ERROR.RDSCOLLECTIONSETTINGS_NOT_UPDATES" xml:space="preserve">
<value>RDS Collection settings not updated</value> <value>RDS Collection settings not updated</value>
</data> </data>

View file

@ -120,6 +120,9 @@
<data name="btnAddRDSServer.Text" xml:space="preserve"> <data name="btnAddRDSServer.Text" xml:space="preserve">
<value>Add RDS Server</value> <value>Add RDS Server</value>
</data> </data>
<data name="gvPopupStatus.HeaderText" xml:space="preserve">
<value>Status</value>
</data>
<data name="gvRDSServers.Empty" xml:space="preserve"> <data name="gvRDSServers.Empty" xml:space="preserve">
<value>The list of RDS Servers is empty.&lt;br&gt;&lt;br&gt;To add a new Server click "Add RDS Sever" button.</value> <value>The list of RDS Servers is empty.&lt;br&gt;&lt;br&gt;To add a new Server click "Add RDS Sever" button.</value>
</data> </data>

View file

@ -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>

View file

@ -52,11 +52,13 @@ namespace WebsitePanel.Portal
{ {
rdsServers = ES.Services.RDS.GetRdsServersPaged("", filterValue, sortColumn, startRowIndex, maximumRows); rdsServers = ES.Services.RDS.GetRdsServersPaged("", filterValue, sortColumn, startRowIndex, maximumRows);
return rdsServers.Servers; foreach (var rdsServer in rdsServers.Servers)
//return new RdsServer[] { new RdsServer { Name = "rds.1.server", FqdName = "", Address = "127.0.0.1" }, {
// new RdsServer { Name = "rds.2.server", FqdName = "", Address = "127.0.0.2" }, rdsServer.Status = ES.Services.RDS.GetRdsServerStatus(null, rdsServer.FqdName);
// new RdsServer { Name = "rds.3.server", FqdName = "", Address = "127.0.0.3" }, rdsServer.SslAvailable = ES.Services.RDS.GetRdsCertificateByItemId(rdsServer.ItemId) != null;
// new RdsServer { Name = "rds.4.server", FqdName = "", Address = "127.0.0.4" }}; }
return rdsServers.Servers;
} }
public int GetOrganizationRdsServersPagedCount(int itemId, string filterValue) public int GetOrganizationRdsServersPagedCount(int itemId, string filterValue)

View file

@ -168,4 +168,7 @@
<data name="rbtnQuotaSoft" xml:space="preserve"> <data name="rbtnQuotaSoft" xml:space="preserve">
<value>Soft</value> <value>Soft</value>
</data> </data>
<data name="colFolderGeneralSettings.Text" xml:space="preserve">
<value>General Settings</value>
</data>
</root> </root>

View file

@ -0,0 +1,135 @@
<?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="btnSave.OnClientClick" xml:space="preserve">
<value>ShowProgressDialog('Updating folder settings...');</value>
</data>
<data name="btnSave.Text" xml:space="preserve">
<value>Save Changes</value>
</data>
<data name="colFolderPermissions.Text" xml:space="preserve">
<value>Folder Permissions</value>
</data>
<data name="locPermissionsSection.Text" xml:space="preserve">
<value>Permissions</value>
</data>
<data name="locTitle.Text" xml:space="preserve">
<value>Edit Folder</value>
</data>
</root>

View file

@ -0,0 +1,135 @@
<?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="btnSave.OnClientClick" xml:space="preserve">
<value>ShowProgressDialog('Updating folder settings...');</value>
</data>
<data name="btnSave.Text" xml:space="preserve">
<value>Save Changes</value>
</data>
<data name="colOwaEditing.Text" xml:space="preserve">
<value>Office Web App Editing</value>
</data>
<data name="locOwaEditingSection.Text" xml:space="preserve">
<value>Users And Groups</value>
</data>
<data name="locTitle.Text" xml:space="preserve">
<value>Edit Folder</value>
</data>
</root>

View file

@ -1,8 +1,11 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EnterpriseStorageFolderGeneralSettings.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.EnterpriseStorageFolderGeneralSettings" %> <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EnterpriseStorageFolderGeneralSettings.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.EnterpriseStorageFolderGeneralSettings" %>
<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> <%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %>
<%@ Register Src="UserControls/EnterpriseStoragePermissions.ascx" TagName="ESPermissions" TagPrefix="wsp"%> <%@ Register Src="UserControls/EnterpriseStoragePermissions.ascx" TagName="ESPermissions" TagPrefix="wsp"%>
<%@ Register TagPrefix="wsp" TagName="CollapsiblePanel" Src="../UserControls/CollapsiblePanel.ascx" %> <%@ Register TagPrefix="wsp" TagName="CollapsiblePanel" Src="../UserControls/CollapsiblePanel.ascx" %>
<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> <%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %>
<%@ Register TagPrefix="wsp" Namespace="WebsitePanel.Portal.ExchangeServer.UserControls" Assembly="WebsitePanel.Portal.Modules" %>
<%@ Register Src="UserControls/EnterpriseStorageEditFolderTabs.ascx" TagName="CollectionTabs" TagPrefix="wsp" %>
<wsp:EnableAsyncTasksSupport id="asyncTasks" runat="server"/> <wsp:EnableAsyncTasksSupport id="asyncTasks" runat="server"/>
@ -16,62 +19,62 @@
<asp:Image ID="Image1" SkinID="ExchangeList48" runat="server" /> <asp:Image ID="Image1" SkinID="ExchangeList48" runat="server" />
<asp:Localize ID="locTitle" runat="server" meta:resourcekey="locTitle" Text="Edit Folder"></asp:Localize> <asp:Localize ID="locTitle" runat="server" meta:resourcekey="locTitle" Text="Edit Folder"></asp:Localize>
<asp:Literal ID="litFolderName" runat="server" Text="Folder" /> <asp:Literal ID="litFolderName" runat="server" Text="Folder 32" />
</div> </div>
<div class="FormBody"> <div class="FormBody">
<wsp:CollectionTabs id="tabs" runat="server" SelectedTab="enterprisestorage_folder_settings" />
<wsp:SimpleMessageBox id="messageBox" runat="server" /> <wsp:SimpleMessageBox id="messageBox" runat="server" />
<table>
<tr> <wsp:CollapsiblePanel id="colFolderGeneralSettings" runat="server"
<td class="FormLabel150"><asp:Localize ID="locFolderName" runat="server" meta:resourcekey="locFolderName" Text="Folder Name:"></asp:Localize></td> TargetControlID="panelFolderGeneralSettings" meta:resourcekey="colFolderGeneralSettings" Text="">
<td> </wsp:CollapsiblePanel>
<asp:TextBox ID="txtFolderName" runat="server" CssClass="HugeTextBox200" ></asp:TextBox>
<asp:RequiredFieldValidator ID="valRequireFolderName" runat="server" meta:resourcekey="valRequireFolderName" ControlToValidate="txtFolderName" <asp:Panel runat="server" ID="panelFolderGeneralSettings">
ErrorMessage="Enter Folder Name" ValidationGroup="EditFolder" Display="Dynamic" Text="*" SetFocusOnError="True"></asp:RequiredFieldValidator> <table>
</td> <tr>
</tr> <td class="FormLabel150"><asp:Localize ID="locFolderName" runat="server" meta:resourcekey="locFolderName" Text="Folder Name:"></asp:Localize></td>
<tr> <td>
<td class="FormLabel150"><asp:Localize ID="locFolderSize" runat="server" meta:resourcekey="locFolderSize" Text="Folder Limit Size (Gb):"></asp:Localize></td> <asp:TextBox ID="txtFolderName" runat="server" CssClass="HugeTextBox200" ></asp:TextBox>
<td> <asp:RequiredFieldValidator ID="valRequireFolderName" runat="server" meta:resourcekey="valRequireFolderName" ControlToValidate="txtFolderName"
<asp:TextBox ID="txtFolderSize" runat="server" CssClass="HugeTextBox200"></asp:TextBox> ErrorMessage="Enter Folder Name" ValidationGroup="EditFolder" Display="Dynamic" Text="*" SetFocusOnError="True"></asp:RequiredFieldValidator>
<asp:RequiredFieldValidator ID="valRequireFolderSize" runat="server" meta:resourcekey="valRequireFolderSize" ControlToValidate="txtFolderSize" </td>
ErrorMessage="Enter Folder Size" ValidationGroup="EditFolder" Display="Dynamic" Text="*" SetFocusOnError="True"></asp:RequiredFieldValidator> </tr>
<asp:RangeValidator ID="rangeFolderSize" runat="server" ControlToValidate="txtFolderSize" MaximumValue="99999999" MinimumValue="0.01" Type="Double" <tr>
ValidationGroup="EditFolder" Display="Dynamic" Text="*" SetFocusOnError="True" <td class="FormLabel150"><asp:Localize ID="locFolderSize" runat="server" meta:resourcekey="locFolderSize" Text="Folder Limit Size (Gb):"></asp:Localize></td>
ErrorMessage="The quota youve entered exceeds the available quota for tenant" /> <td>
</td> <asp:TextBox ID="txtFolderSize" runat="server" CssClass="HugeTextBox200"></asp:TextBox>
</tr> <asp:RequiredFieldValidator ID="valRequireFolderSize" runat="server" meta:resourcekey="valRequireFolderSize" ControlToValidate="txtFolderSize"
<tr> ErrorMessage="Enter Folder Size" ValidationGroup="EditFolder" Display="Dynamic" Text="*" SetFocusOnError="True"></asp:RequiredFieldValidator>
<td class="FormLabel150"><asp:Localize ID="locQuotaType" runat="server" meta:resourcekey="locQuotaType" Text="Quota Type:"></asp:Localize></td> <asp:RangeValidator ID="rangeFolderSize" runat="server" ControlToValidate="txtFolderSize" MaximumValue="99999999" MinimumValue="0.01" Type="Double"
<td class="FormRBtnL"> ValidationGroup="EditFolder" Display="Dynamic" Text="*" SetFocusOnError="True"
<asp:RadioButton ID="rbtnQuotaSoft" runat="server" meta:resourcekey="rbtnQuotaSoft" Text="Soft" GroupName="QuotaType" Checked="true" /> ErrorMessage="The quota youve entered exceeds the available quota for tenant" />
<asp:RadioButton ID="rbtnQuotaHard" runat="server" meta:resourcekey="rbtnQuotaHard" Text="Hard" GroupName="QuotaType" /> </td>
<br /> </tr>
<br /> <tr>
</td> <td class="FormLabel150"><asp:Localize ID="locQuotaType" runat="server" meta:resourcekey="locQuotaType" Text="Quota Type:"></asp:Localize></td>
</tr> <td class="FormRBtnL">
<tr> <asp:RadioButton ID="rbtnQuotaSoft" runat="server" meta:resourcekey="rbtnQuotaSoft" Text="Soft" GroupName="QuotaType" Checked="true" />
<td class="FormLabel150"><asp:Localize ID="locFolderUrl" runat="server" meta:resourcekey="locFolderUrl" Text="Folder Url:"></asp:Localize></td> <asp:RadioButton ID="rbtnQuotaHard" runat="server" meta:resourcekey="rbtnQuotaHard" Text="Hard" GroupName="QuotaType" />
<td><asp:Label runat="server" ID="lblFolderUrl" /></td> <br />
</tr> <br />
<tr><td>&nbsp;</td></tr> </td>
<tr> </tr>
<td class="FormLabel150"><asp:Localize ID="locDirectoryBrowsing" runat="server" meta:resourcekey="locDirectoryBrowsing" Text="Enable Directory Browsing:"></asp:Localize></td> <tr>
<td> <td class="FormLabel150"><asp:Localize ID="locFolderUrl" runat="server" meta:resourcekey="locFolderUrl" Text="Folder Url:"></asp:Localize></td>
<asp:CheckBox id="chkDirectoryBrowsing" runat="server"></asp:CheckBox> <td><asp:Label runat="server" ID="lblFolderUrl" /></td>
</td> </tr>
</tr> <tr><td>&nbsp;</td></tr>
<tr><td>&nbsp;</td></tr> <tr>
<tr> <td class="FormLabel150"><asp:Localize ID="locDirectoryBrowsing" runat="server" meta:resourcekey="locDirectoryBrowsing" Text="Enable Directory Browsing:"></asp:Localize></td>
<td colspan="2"> <td>
<fieldset id="PermissionsPanel" runat="server"> <asp:CheckBox id="chkDirectoryBrowsing" runat="server"></asp:CheckBox>
<legend><asp:Localize ID="PermissionsSection" runat="server" meta:resourcekey="locPermissionsSection" Text="Permissions"></asp:Localize></legend> </td>
<wsp:ESPermissions id="permissions" runat="server" /> </tr>
</fieldset> <tr><td>&nbsp;</td></tr>
</tr>
<tr><td>&nbsp;</td></tr> </table>
</asp:Panel>
</table>
<div class="FormFooterClean"> <div class="FormFooterClean">
<asp:Button id="btnSave" runat="server" Text="Save Changes" CssClass="Button1" meta:resourcekey="btnSave" ValidationGroup="EditFolder" OnClick="btnSave_Click"></asp:Button> <asp:Button id="btnSave" runat="server" Text="Save Changes" CssClass="Button1" meta:resourcekey="btnSave" ValidationGroup="EditFolder" OnClick="btnSave_Click"></asp:Button>
<asp:ValidationSummary ID="valSummary" runat="server" ShowMessageBox="True" ShowSummary="False" ValidationGroup="EditFolder" /> <asp:ValidationSummary ID="valSummary" runat="server" ShowMessageBox="True" ShowSummary="False" ValidationGroup="EditFolder" />

View file

@ -107,11 +107,7 @@ namespace WebsitePanel.Portal.ExchangeServer
break; break;
} }
var esPermissions = ES.Services.EnterpriseStorage.GetEnterpriseFolderPermissions(PanelRequest.ItemID,folder.Name);
chkDirectoryBrowsing.Checked = ES.Services.EnterpriseStorage.GetDirectoryBrowseEnabled(PanelRequest.ItemID, folder.Url); chkDirectoryBrowsing.Checked = ES.Services.EnterpriseStorage.GetDirectoryBrowseEnabled(PanelRequest.ItemID, folder.Url);
permissions.SetPermissions(esPermissions);
} }
catch (Exception ex) catch (Exception ex)
{ {
@ -159,10 +155,9 @@ namespace WebsitePanel.Portal.ExchangeServer
} }
} }
ES.Services.EnterpriseStorage.SetEnterpriseFolderSettings( ES.Services.EnterpriseStorage.SetEnterpriseFolderGeneralSettings(
PanelRequest.ItemID, PanelRequest.ItemID,
folder, folder,
permissions.GetPemissions(),
chkDirectoryBrowsing.Checked, chkDirectoryBrowsing.Checked,
(int)(decimal.Parse(txtFolderSize.Text) * OneGb), (int)(decimal.Parse(txtFolderSize.Text) * OneGb),
rbtnQuotaSoft.Checked ? QuotaType.Soft : QuotaType.Hard); rbtnQuotaSoft.Checked ? QuotaType.Soft : QuotaType.Hard);

View file

@ -1,31 +1,3 @@
// Copyright (c) 2015, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.
@ -76,6 +48,15 @@ namespace WebsitePanel.Portal.ExchangeServer {
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.Literal litFolderName; protected global::System.Web.UI.WebControls.Literal litFolderName;
/// <summary>
/// tabs control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.EnterpriseStorageEditFolderTabs tabs;
/// <summary> /// <summary>
/// messageBox control. /// messageBox control.
/// </summary> /// </summary>
@ -85,6 +66,24 @@ namespace WebsitePanel.Portal.ExchangeServer {
/// </remarks> /// </remarks>
protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox;
/// <summary>
/// colFolderGeneralSettings control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.CollapsiblePanel colFolderGeneralSettings;
/// <summary>
/// panelFolderGeneralSettings control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Panel panelFolderGeneralSettings;
/// <summary> /// <summary>
/// locFolderName control. /// locFolderName control.
/// </summary> /// </summary>
@ -211,33 +210,6 @@ namespace WebsitePanel.Portal.ExchangeServer {
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.CheckBox chkDirectoryBrowsing; protected global::System.Web.UI.WebControls.CheckBox chkDirectoryBrowsing;
/// <summary>
/// PermissionsPanel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl PermissionsPanel;
/// <summary>
/// PermissionsSection control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize PermissionsSection;
/// <summary>
/// permissions control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.EnterpriseStoragePermissions permissions;
/// <summary> /// <summary>
/// btnSave control. /// btnSave control.
/// </summary> /// </summary>

View file

@ -0,0 +1,55 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EnterpriseStorageFolderSettingsFolderPermissions.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.EnterpriseStorageFolderSettingsFolderPermissions" %>
<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %>
<%@ Register Src="UserControls/EnterpriseStoragePermissions.ascx" TagName="ESPermissions" TagPrefix="wsp"%>
<%@ Register TagPrefix="wsp" TagName="CollapsiblePanel" Src="../UserControls/CollapsiblePanel.ascx" %>
<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %>
<%@ Register TagPrefix="wsp" Namespace="WebsitePanel.Portal.ExchangeServer.UserControls" Assembly="WebsitePanel.Portal.Modules" %>
<%@ Register Src="UserControls/EnterpriseStorageEditFolderTabs.ascx" TagName="CollectionTabs" TagPrefix="wsp" %>
<wsp:EnableAsyncTasksSupport id="asyncTasks" runat="server"/>
<div id="ExchangeContainer">
<div class="Module">
<div class="Left">
</div>
<div class="Content">
<div class="Center">
<div class="Title">
<asp:Image ID="Image1" SkinID="ExchangeList48" runat="server" />
<asp:Localize ID="locTitle" runat="server" meta:resourcekey="locTitle" Text="Edit Folder"></asp:Localize>
<asp:Literal ID="litFolderName" runat="server" Text="Folder" />
</div>
<div class="FormBody">
<wsp:CollectionTabs id="tabs" runat="server" SelectedTab="enterprisestorage_folder_settings_folder_permissions" />
<wsp:SimpleMessageBox id="messageBox" runat="server" />
<wsp:CollapsiblePanel id="colFolderPermissions" runat="server"
TargetControlID="panelFolderPermissions" meta:resourcekey="colFolderPermissions" Text="">
</wsp:CollapsiblePanel>
<asp:Panel runat="server" ID="panelFolderPermissions">
<table>
<tr>
<td colspan="2">
<fieldset id="PermissionsPanel" runat="server">
<legend><asp:Localize ID="PermissionsSection" runat="server" meta:resourcekey="locPermissionsSection" Text="Permissions"></asp:Localize></legend>
<wsp:ESPermissions id="permissions" runat="server" />
</fieldset>
</tr>
<tr><td>&nbsp;</td></tr>
</table>
</asp:Panel>
<div class="FormFooterClean">
<asp:Button id="btnSave" runat="server" Text="Save Changes" CssClass="Button1" meta:resourcekey="btnSave" ValidationGroup="EditFolder" OnClick="btnSave_Click"></asp:Button>
<asp:ValidationSummary ID="valSummary" runat="server" ShowMessageBox="True" ShowSummary="False" ValidationGroup="EditFolder" />
</div>
</div>
</div>
</div>
</div>
</div>

View file

@ -0,0 +1,86 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebsitePanel.Providers.HostedSolution;
using WebsitePanel.Providers.OS;
namespace WebsitePanel.Portal.ExchangeServer
{
public partial class EnterpriseStorageFolderSettingsFolderPermissions : WebsitePanelModuleBase
{
#region Constants
private const int OneGb = 1024;
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (!ES.Services.EnterpriseStorage.CheckUsersDomainExists(PanelRequest.ItemID))
{
Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "enterprisestorage_folders",
"ItemID=" + PanelRequest.ItemID));
}
BindSettings();
}
}
private void BindSettings()
{
try
{
// get settings
Organization org = ES.Services.Organizations.GetOrganization(PanelRequest.ItemID);
SystemFile folder = ES.Services.EnterpriseStorage.GetEnterpriseFolder(
PanelRequest.ItemID, PanelRequest.FolderID);
litFolderName.Text = string.Format("{0}", folder.Name);
// bind form
var esPermissions = ES.Services.EnterpriseStorage.GetEnterpriseFolderPermissions(PanelRequest.ItemID,folder.Name);
permissions.SetPermissions(esPermissions);
}
catch (Exception ex)
{
messageBox.ShowErrorMessage("ENETERPRISE_STORAGE_GET_FOLDER_SETTINGS", ex);
}
}
protected void btnSave_Click(object sender, EventArgs e)
{
if (!Page.IsValid)
return;
try
{
SystemFile folder = new SystemFile { Name = PanelRequest.FolderID };
if (!ES.Services.EnterpriseStorage.CheckEnterpriseStorageInitialization(PanelSecurity.PackageId, PanelRequest.ItemID))
{
ES.Services.EnterpriseStorage.CreateEnterpriseStorage(PanelSecurity.PackageId, PanelRequest.ItemID);
}
ES.Services.EnterpriseStorage.SetEnterpriseFolderPermissionSettings(
PanelRequest.ItemID,
folder,
permissions.GetPemissions());
Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "enterprisestorage_folders",
"ItemID=" + PanelRequest.ItemID));
}
catch (Exception ex)
{
messageBox.ShowErrorMessage("ENTERPRISE_STORAGE_UPDATE_FOLDER_SETTINGS", ex);
}
}
}
}

View file

@ -0,0 +1,132 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WebsitePanel.Portal.ExchangeServer {
public partial class EnterpriseStorageFolderSettingsFolderPermissions {
/// <summary>
/// asyncTasks control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks;
/// <summary>
/// Image1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Image Image1;
/// <summary>
/// locTitle control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locTitle;
/// <summary>
/// litFolderName control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal litFolderName;
/// <summary>
/// tabs control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.EnterpriseStorageEditFolderTabs tabs;
/// <summary>
/// messageBox control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox;
/// <summary>
/// colFolderPermissions control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.CollapsiblePanel colFolderPermissions;
/// <summary>
/// panelFolderPermissions control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Panel panelFolderPermissions;
/// <summary>
/// PermissionsPanel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl PermissionsPanel;
/// <summary>
/// PermissionsSection control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize PermissionsSection;
/// <summary>
/// permissions control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.EnterpriseStoragePermissions permissions;
/// <summary>
/// btnSave control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnSave;
/// <summary>
/// valSummary control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.ValidationSummary valSummary;
}
}

View file

@ -0,0 +1,54 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EnterpriseStorageFolderSettingsOwaEditing.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.EnterpriseStorageFolderSettingsOwaEditing" %>
<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %>
<%@ Register Src="UserControls/EnterpriseStorageOwaUsersList.ascx" TagName="OwaUsers" TagPrefix="wsp"%>
<%@ Register TagPrefix="wsp" TagName="CollapsiblePanel" Src="../UserControls/CollapsiblePanel.ascx" %>
<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %>
<%@ Register Src="UserControls/EnterpriseStorageEditFolderTabs.ascx" TagName="CollectionTabs" TagPrefix="wsp" %>
<wsp:EnableAsyncTasksSupport id="asyncTasks" runat="server"/>
<div id="ExchangeContainer">
<div class="Module">
<div class="Left">
</div>
<div class="Content">
<div class="Center">
<div class="Title">
<asp:Image ID="Image1" SkinID="ExchangeList48" runat="server" />
<asp:Localize ID="locTitle" runat="server" meta:resourcekey="locTitle" Text="Edit Folder"></asp:Localize>
<asp:Literal ID="litFolderName" runat="server" Text="Folder" />
</div>
<div class="FormBody">
<wsp:CollectionTabs id="tabs" runat="server" SelectedTab="enterprisestorage_folder_settings_owa_editing" />
<wsp:SimpleMessageBox id="messageBox" runat="server" />
<wsp:CollapsiblePanel id="colOwaEditing" runat="server"
TargetControlID="panelFolderPermissions" meta:resourcekey="colOwaEditing" Text="">
</wsp:CollapsiblePanel>
<asp:Panel runat="server" ID="panelFolderPermissions">
<table>
<tr>
<td colspan="2">
<fieldset id="OwaUsersPanel" runat="server">
<legend><asp:Localize ID="locOwaEditingSection" runat="server" meta:resourcekey="locOwaEditingSection" Text="Users And Groups"></asp:Localize></legend>
<wsp:OwaUsers id="owaUsers" runat="server" />
</fieldset>
</tr>
<tr><td>&nbsp;</td></tr>
</table>
</asp:Panel>
<div class="FormFooterClean">
<asp:Button id="btnSave" runat="server" Text="Save Changes" CssClass="Button1" meta:resourcekey="btnSave" ValidationGroup="EditFolder" OnClick="btnSave_Click"></asp:Button>
<asp:ValidationSummary ID="valSummary" runat="server" ShowMessageBox="True" ShowSummary="False" ValidationGroup="EditFolder" />
</div>
</div>
</div>
</div>
</div>
</div>

View file

@ -0,0 +1,80 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebsitePanel.Providers.HostedSolution;
using WebsitePanel.Providers.OS;
namespace WebsitePanel.Portal.ExchangeServer
{
public partial class EnterpriseStorageFolderSettingsOwaEditing : WebsitePanelModuleBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
if (!ES.Services.EnterpriseStorage.CheckUsersDomainExists(PanelRequest.ItemID))
{
Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "enterprisestorage_folders",
"ItemID=" + PanelRequest.ItemID));
}
BindSettings();
}
}
private void BindSettings()
{
try
{
// get settings
Organization org = ES.Services.Organizations.GetOrganization(PanelRequest.ItemID);
SystemFile folder = ES.Services.EnterpriseStorage.GetEnterpriseFolder(
PanelRequest.ItemID, PanelRequest.FolderID);
litFolderName.Text = string.Format("{0}", folder.Name);
// bind form
var esPermissions = ES.Services.EnterpriseStorage.GetFolderOwaAccounts(PanelRequest.ItemID, folder);
owaUsers.SetUsers(esPermissions);
}
catch (Exception ex)
{
messageBox.ShowErrorMessage("ENETERPRISE_STORAGE_GET_FOLDER_SETTINGS", ex);
}
}
protected void btnSave_Click(object sender, EventArgs e)
{
if (!Page.IsValid)
return;
try
{
SystemFile folder = new SystemFile { Name = PanelRequest.FolderID };
if (!ES.Services.EnterpriseStorage.CheckEnterpriseStorageInitialization(PanelSecurity.PackageId, PanelRequest.ItemID))
{
ES.Services.EnterpriseStorage.CreateEnterpriseStorage(PanelSecurity.PackageId, PanelRequest.ItemID);
}
ES.Services.EnterpriseStorage.SetFolderOwaAccounts(
PanelRequest.ItemID,
folder,
owaUsers.GetUsers());
Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "enterprisestorage_folders",
"ItemID=" + PanelRequest.ItemID));
}
catch (Exception ex)
{
messageBox.ShowErrorMessage("ENTERPRISE_STORAGE_UPDATE_FOLDER_SETTINGS", ex);
}
}
}
}

View file

@ -0,0 +1,132 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WebsitePanel.Portal.ExchangeServer {
public partial class EnterpriseStorageFolderSettingsOwaEditing {
/// <summary>
/// asyncTasks control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks;
/// <summary>
/// Image1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Image Image1;
/// <summary>
/// locTitle control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locTitle;
/// <summary>
/// litFolderName control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal litFolderName;
/// <summary>
/// tabs control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.EnterpriseStorageEditFolderTabs tabs;
/// <summary>
/// messageBox control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox;
/// <summary>
/// colOwaEditing control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.CollapsiblePanel colOwaEditing;
/// <summary>
/// panelFolderPermissions control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Panel panelFolderPermissions;
/// <summary>
/// OwaUsersPanel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl OwaUsersPanel;
/// <summary>
/// locOwaEditingSection control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locOwaEditingSection;
/// <summary>
/// owaUsers control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.EnterpriseStorageOwaUsersList owaUsers;
/// <summary>
/// btnSave control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnSave;
/// <summary>
/// valSummary control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.ValidationSummary valSummary;
}
}

View file

@ -0,0 +1,129 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="Tab.FolderPermissions" xml:space="preserve">
<value>Folder Permissions</value>
</data>
<data name="Tab.GeneralSettings" xml:space="preserve">
<value>General Settings</value>
</data>
<data name="Tab.OwaEditPermissions" xml:space="preserve">
<value>Office Web App Editing</value>
</data>
</root>

View file

@ -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="btnAdd.Text" xml:space="preserve">
<value>Add...</value>
</data>
<data name="btnAddSelected.Text" xml:space="preserve">
<value>Add Accounts</value>
</data>
<data name="btnCancel.Text" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="btnDelete.Text" xml:space="preserve">
<value>Delete</value>
</data>
<data name="ddlSearchColumnDisplayName.Text" xml:space="preserve">
<value>Display Name</value>
</data>
<data name="ddlSearchColumnEmail.Text" xml:space="preserve">
<value>E-mail Address</value>
</data>
<data name="gvAccountsDisplayName.HeaderText" xml:space="preserve">
<value>Display Name</value>
</data>
<data name="gvAccountsEmail.HeaderText" xml:space="preserve">
<value>Email</value>
</data>
<data name="gvPopupAccounts.EmptyDataText" xml:space="preserve">
<value>No accounts found.</value>
</data>
<data name="gvUsers.EmptyDataText" xml:space="preserve">
<value>The list of users is empty. Click "Add..." button.</value>
</data>
<data name="gvUsersAccount.HeaderText" xml:space="preserve">
<value>Users</value>
</data>
<data name="headerAddAccounts.Text" xml:space="preserve">
<value>Enabled Users</value>
</data>
</root>

View file

@ -0,0 +1,31 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EnterpriseStorageEditFolderTabs.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.UserControls.EnterpriseStorageEditFolderTabs" %>
<table width="100%" cellpadding="0" cellspacing="1">
<tr>
<td class="Tabs">
<asp:DataList ID="esTabs" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow" EnableViewState="false">
<ItemStyle Wrap="False" />
<ItemTemplate >
<asp:HyperLink ID="lnkTab" runat="server" CssClass="Tab" NavigateUrl='<%# Eval("Url") %>' OnClick="return tabClicked();">
<%# Eval("Name") %>
</asp:HyperLink>
</ItemTemplate>
<SelectedItemStyle Wrap="False" />
<SelectedItemTemplate>
<asp:HyperLink ID="lnkSelTab" runat="server" CssClass="ActiveTab" NavigateUrl='<%# Eval("Url") %>' OnClick="return tabClicked;">
<%# Eval("Name") %>
</asp:HyperLink>
</SelectedItemTemplate>
</asp:DataList>
</td>
</tr>
</table>
<br />
<script type="text/javascript">
function tabClicked() {
ShowProgressDialog('Loading');
ShowProgressDialogInternal();
return true;
}
</script>

View file

@ -0,0 +1,52 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebsitePanel.Portal.Code.UserControls;
namespace WebsitePanel.Portal.ExchangeServer.UserControls
{
public partial class EnterpriseStorageEditFolderTabs : WebsitePanelControlBase
{
public string SelectedTab { get; set; }
protected void Page_Load(object sender, EventArgs e)
{
BindTabs();
}
private void BindTabs()
{
List<Tab> tabsList = new List<Tab>();
tabsList.Add(CreateTab("enterprisestorage_folder_settings", "Tab.GeneralSettings"));
tabsList.Add(CreateTab("enterprisestorage_folder_settings_folder_permissions", "Tab.FolderPermissions"));
tabsList.Add(CreateTab("enterprisestorage_folder_settings_owa_editing", "Tab.OwaEditPermissions"));
int idx = 0;
foreach (Tab tab in tabsList)
{
if (String.Compare(tab.Id, SelectedTab, true) == 0)
{
break;
}
idx++;
}
esTabs.SelectedIndex = idx;
esTabs.DataSource = tabsList;
esTabs.DataBind();
}
private Tab CreateTab(string id, string text)
{
return new Tab(id,GetLocalizedString(text),
HostModule.EditUrl("AccountID", PanelRequest.AccountID.ToString(), id,
"SpaceID=" + PanelSecurity.PackageId.ToString(),
"ItemID=" + PanelRequest.ItemID.ToString(), "FolderID=" + PanelRequest.FolderID));
}
}
}

View file

@ -0,0 +1,24 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WebsitePanel.Portal.ExchangeServer.UserControls {
public partial class EnterpriseStorageEditFolderTabs {
/// <summary>
/// esTabs control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.DataList esTabs;
}
}

View file

@ -0,0 +1,114 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EnterpriseStorageOwaUsersList.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.UserControls.EnterpriseStorageOwaUsersList" %>
<asp:UpdatePanel ID="UsersUpdatePanel" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
<ContentTemplate>
<div class="FormButtonsBarClean">
<asp:Button ID="btnAdd" runat="server" Text="Add..." CssClass="Button1" OnClick="btnAdd_Click" meta:resourcekey="btnAdd" />
<asp:Button ID="btnDelete" runat="server" Text="Delete" CssClass="Button1" OnClick="btnDelete_Click" meta:resourcekey="btnDelete"/>
</div>
<asp:GridView ID="gvUsers" runat="server" meta:resourcekey="gvUsers" AutoGenerateColumns="False"
Width="600px" CssSelectorClass="NormalGridView"
DataKeyNames="AccountName">
<Columns>
<asp:TemplateField>
<HeaderTemplate>
<asp:CheckBox ID="chkSelectAll" runat="server" onclick="javascript:SelectAllCheckboxes(this);" />
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="chkSelect" runat="server" />
</ItemTemplate>
<ItemStyle Width="10px" />
</asp:TemplateField>
<asp:TemplateField meta:resourcekey="gvUsersAccount" HeaderText="gvUsersAccount">
<ItemStyle Width="96%" Wrap="false" HorizontalAlign="Left">
</ItemStyle>
<ItemTemplate>
<asp:Literal ID="litAccount" runat="server" Text='<%# Eval("DisplayName") %>'></asp:Literal>
<asp:HiddenField ID="hdnAccountId" runat="server" Value='<%# Eval("AccountId") %>' />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<br />
<asp:Panel ID="AddAccountsPanel" runat="server" CssClass="Popup" style="display:none">
<table class="Popup-Header" cellpadding="0" cellspacing="0">
<tr>
<td class="Popup-HeaderLeft"></td>
<td class="Popup-HeaderTitle">
<asp:Localize ID="headerAddAccounts" runat="server" meta:resourcekey="headerAddAccounts"></asp:Localize>
</td>
<td class="Popup-HeaderRight"></td>
</tr>
</table>
<div class="Popup-Content">
<div class="Popup-Body">
<br />
<asp:UpdatePanel ID="AddAccountsUpdatePanel" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
<ContentTemplate>
<div class="FormButtonsBarClean">
<div class="FormButtonsBarCleanRight">
<asp:Panel ID="SearchPanel" runat="server" DefaultButton="cmdSearch">
<asp:DropDownList ID="ddlSearchColumn" runat="server" CssClass="NormalTextBox">
<asp:ListItem Value="DisplayName" meta:resourcekey="ddlSearchColumnDisplayName">DisplayName</asp:ListItem>
<asp:ListItem Value="PrimaryEmailAddress" meta:resourcekey="ddlSearchColumnEmail">Email</asp:ListItem>
</asp:DropDownList><asp:TextBox ID="txtSearchValue" runat="server" CssClass="NormalTextBox" Width="100"></asp:TextBox><asp:ImageButton ID="cmdSearch" Runat="server" meta:resourcekey="cmdSearch" SkinID="SearchButton"
CausesValidation="false" OnClick="cmdSearch_Click"/>
</asp:Panel>
</div>
</div>
<div class="Popup-Scroll">
<asp:GridView ID="gvPopupAccounts" runat="server" meta:resourcekey="gvPopupAccounts" AutoGenerateColumns="False"
Width="100%" CssSelectorClass="NormalGridView"
DataKeyNames="AccountName">
<Columns>
<asp:TemplateField>
<HeaderTemplate>
<asp:CheckBox ID="chkSelectAll" runat="server" onclick="javascript:SelectAllCheckboxes(this);" />
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="chkSelect" runat="server" />
<asp:Literal ID="litAccountType" runat="server" Visible="false" Text='<%# Eval("AccountType") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="10px" />
</asp:TemplateField>
<asp:TemplateField meta:resourcekey="gvAccountsDisplayName">
<ItemStyle Width="50%" HorizontalAlign="Left"></ItemStyle>
<ItemTemplate>
<asp:Image ID="imgAccount" runat="server" ImageUrl='<%# GetAccountImage((int)Eval("AccountType")) %>' ImageAlign="AbsMiddle" />
<asp:Literal ID="litDisplayName" runat="server" Text='<%# Eval("DisplayName") %>'></asp:Literal>
<asp:HiddenField ID="hdnAccountId" runat="server" Value='<%# Eval("AccountId") %>' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField meta:resourcekey="gvAccountsEmail">
<ItemStyle Width="50%" HorizontalAlign="Left"></ItemStyle>
<ItemTemplate>
<asp:Literal ID="litPrimaryEmailAddress" runat="server" Text='<%# Eval("PrimaryEmailAddress") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
</div>
<div class="FormFooter">
<asp:Button ID="btnAddSelected" runat="server" CssClass="Button1" meta:resourcekey="btnAddSelected" Text="Add Accounts" OnClick="btnAddSelected_Click" />
<asp:Button ID="btnCancelAdd" runat="server" CssClass="Button1" meta:resourcekey="btnCancel" Text="Cancel" CausesValidation="false" />
</div>
</div>
</asp:Panel>
<asp:Button ID="btnAddAccountsFake" runat="server" style="display:none;" />
<ajaxToolkit:ModalPopupExtender ID="AddAccountsModal" runat="server"
TargetControlID="btnAddAccountsFake" PopupControlID="AddAccountsPanel"
BackgroundCssClass="modalBackground" DropShadow="false" CancelControlID="btnCancelAdd" />
</ContentTemplate>
</asp:UpdatePanel>

View file

@ -0,0 +1,215 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebsitePanel.Providers.HostedSolution;
namespace WebsitePanel.Portal.ExchangeServer.UserControls
{
public partial class EnterpriseStorageOwaUsersList : WebsitePanelControlBase
{
public const string DirectionString = "DirectionString";
protected enum SelectedState
{
All,
Selected,
Unselected
}
public void SetUsers(OrganizationUser[] users)
{
BindAccounts(users, false);
}
public OrganizationUser[] GetUsers()
{
return GetGridViewUsers(EnterpriseStorageOwaUsersList.SelectedState.All).ToArray();
}
protected void Page_Load(object sender, EventArgs e)
{
// register javascript
if (!Page.ClientScript.IsClientScriptBlockRegistered("SelectAllCheckboxes"))
{
string script = @" function SelectAllCheckboxes(box)
{
var state = box.checked;
var elm = box.parentElement.parentElement.parentElement.parentElement.getElementsByTagName(""INPUT"");
for(i = 0; i < elm.length; i++)
if(elm[i].type == ""checkbox"" && elm[i].id != box.id && elm[i].checked != state && !elm[i].disabled)
elm[i].checked = state;
}";
Page.ClientScript.RegisterClientScriptBlock(typeof(EnterpriseStorageOwaUsersList), "SelectAllCheckboxes",
script, true);
}
}
protected void btnAdd_Click(object sender, EventArgs e)
{
// bind all accounts
BindPopupAccounts();
// show modal
AddAccountsModal.Show();
}
protected void btnDelete_Click(object sender, EventArgs e)
{
List<OrganizationUser> selectedAccounts = GetGridViewUsers(EnterpriseStorageOwaUsersList.SelectedState.Unselected);
BindAccounts(selectedAccounts.ToArray(), false);
}
protected void btnAddSelected_Click(object sender, EventArgs e)
{
List<OrganizationUser> selectedAccounts = GetGridViewAccounts();
BindAccounts(selectedAccounts.ToArray(), true);
}
public string GetAccountImage(int accountTypeId)
{
string imgName = string.Empty;
ExchangeAccountType accountType = (ExchangeAccountType)accountTypeId;
switch (accountType)
{
case ExchangeAccountType.Room:
imgName = "room_16.gif";
break;
case ExchangeAccountType.Equipment:
imgName = "equipment_16.gif";
break;
default:
imgName = "admin_16.png";
break;
}
return GetThemedImage("Exchange/" + imgName);
}
protected void BindPopupAccounts()
{
ExchangeAccount[] accounts = ES.Services.EnterpriseStorage.SearchESAccounts(PanelRequest.ItemID,
ddlSearchColumn.SelectedValue, txtSearchValue.Text + "%", "");
accounts = accounts.Where(x => !GetUsers().Select(p => p.AccountName).Contains(x.AccountName)).ToArray();
Array.Sort(accounts, CompareAccount);
if (Direction == SortDirection.Ascending)
{
Array.Reverse(accounts);
Direction = SortDirection.Descending;
}
else
Direction = SortDirection.Ascending;
gvPopupAccounts.DataSource = accounts;
gvPopupAccounts.DataBind();
}
protected void BindAccounts(OrganizationUser[] newUsers, bool preserveExisting)
{
// get binded addresses
List<OrganizationUser> users = new List<OrganizationUser>();
if (preserveExisting)
users.AddRange(GetGridViewUsers(EnterpriseStorageOwaUsersList.SelectedState.All));
// add new accounts
if (newUsers != null)
{
foreach (OrganizationUser newUser in newUsers)
{
// check if exists
bool exists = false;
foreach (OrganizationUser user in users)
{
if (String.Compare(user.AccountName, newUser.AccountName, true) == 0)
{
exists = true;
break;
}
}
if (exists)
continue;
users.Add(newUser);
}
}
gvUsers.DataSource = users;
gvUsers.DataBind();
}
protected List<OrganizationUser> GetGridViewUsers(EnterpriseStorageOwaUsersList.SelectedState state)
{
List<OrganizationUser> users = new List<OrganizationUser>();
for (int i = 0; i < gvUsers.Rows.Count; i++)
{
GridViewRow row = gvUsers.Rows[i];
CheckBox chkSelect = (CheckBox)row.FindControl("chkSelect");
if (chkSelect == null)
continue;
OrganizationUser user = new OrganizationUser();
user.AccountName = (string)gvUsers.DataKeys[i][0];
user.DisplayName = ((Literal)row.FindControl("litAccount")).Text;
user.AccountId = Convert.ToInt32(((HiddenField)row.FindControl("hdnAccountId")).Value);
if (state == EnterpriseStorageOwaUsersList.SelectedState.All ||
(state == EnterpriseStorageOwaUsersList.SelectedState.Selected && chkSelect.Checked) ||
(state == EnterpriseStorageOwaUsersList.SelectedState.Unselected && !chkSelect.Checked))
users.Add(user);
}
return users;
}
protected List<OrganizationUser> GetGridViewAccounts()
{
List<OrganizationUser> accounts = new List<OrganizationUser>();
for (int i = 0; i < gvPopupAccounts.Rows.Count; i++)
{
GridViewRow row = gvPopupAccounts.Rows[i];
CheckBox chkSelect = (CheckBox)row.FindControl("chkSelect");
if (chkSelect == null)
continue;
if (chkSelect.Checked)
{
accounts.Add(new OrganizationUser
{
AccountName = (string)gvPopupAccounts.DataKeys[i][0],
DisplayName = ((Literal)row.FindControl("litDisplayName")).Text,
AccountId = Convert.ToInt32(((HiddenField)row.FindControl("hdnAccountId")).Value)
});
}
}
return accounts;
}
protected void cmdSearch_Click(object sender, ImageClickEventArgs e)
{
BindPopupAccounts();
}
protected SortDirection Direction
{
get { return ViewState[DirectionString] == null ? SortDirection.Descending : (SortDirection)ViewState[DirectionString]; }
set { ViewState[DirectionString] = value; }
}
protected static int CompareAccount(ExchangeAccount user1, ExchangeAccount user2)
{
return string.Compare(user1.DisplayName, user2.DisplayName);
}
}
}

View file

@ -0,0 +1,159 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WebsitePanel.Portal.ExchangeServer.UserControls {
public partial class EnterpriseStorageOwaUsersList {
/// <summary>
/// UsersUpdatePanel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.UpdatePanel UsersUpdatePanel;
/// <summary>
/// btnAdd control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnAdd;
/// <summary>
/// btnDelete control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnDelete;
/// <summary>
/// gvUsers control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.GridView gvUsers;
/// <summary>
/// AddAccountsPanel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Panel AddAccountsPanel;
/// <summary>
/// headerAddAccounts control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize headerAddAccounts;
/// <summary>
/// AddAccountsUpdatePanel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.UpdatePanel AddAccountsUpdatePanel;
/// <summary>
/// SearchPanel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Panel SearchPanel;
/// <summary>
/// ddlSearchColumn control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.DropDownList ddlSearchColumn;
/// <summary>
/// txtSearchValue control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtSearchValue;
/// <summary>
/// cmdSearch control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.ImageButton cmdSearch;
/// <summary>
/// gvPopupAccounts control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.GridView gvPopupAccounts;
/// <summary>
/// btnAddSelected control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnAddSelected;
/// <summary>
/// btnCancelAdd control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnCancelAdd;
/// <summary>
/// btnAddAccountsFake control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnAddAccountsFake;
/// <summary>
/// AddAccountsModal control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::AjaxControlToolkit.ModalPopupExtender AddAccountsModal;
}
}

View file

@ -126,4 +126,25 @@
<data name="ServerNameColumn.HeaderText" xml:space="preserve"> <data name="ServerNameColumn.HeaderText" xml:space="preserve">
<value>Server Name</value> <value>Server Name</value>
</data> </data>
<data name="lblPFXInstallPassword.Text" xml:space="preserve">
<value>Certificate Password:</value>
</data>
<data name="secCertificateSettings.Text" xml:space="preserve">
<value>SSL Certificate</value>
</data>
<data name="lblSelectFile.Text" xml:space="preserve">
<value>Select Certificate:</value>
</data>
<data name="lblExpiryDate.Text" xml:space="preserve">
<value>Expiry Date:</value>
</data>
<data name="lblIssuedBy.Text" xml:space="preserve">
<value>Issued By:</value>
</data>
<data name="lblSanName.Text" xml:space="preserve">
<value>SAN Name:</value>
</data>
<data name="lblComputersRootOU.Text" xml:space="preserve">
<value>Computers Root OU:</value>
</data>
</root> </root>

View file

@ -1,5 +1,63 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="RDS_Settings.ascx.cs" Inherits="WebsitePanel.Portal.ProviderControls.RDS_Settings" %> <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="RDS_Settings.ascx.cs" Inherits="WebsitePanel.Portal.ProviderControls.RDS_Settings" %>
<table> <%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %>
<fieldset>
<legend>
<asp:Label ID="secCertificateSettings" runat="server" meta:resourcekey="secServiceSettings" Text="SSL Certificate" CssClass="NormalBold"></asp:Label>&nbsp;
</legend>
<table>
<tr>
<td class="SubHead" style="width:200px" nowrap>
<asp:Localize runat="server" meta:resourcekey="lblSelectFile" />
</td>
<td style="padding: 10px 0 10px 0;"><asp:FileUpload ID="upPFX" runat="server"/></td>
</tr>
<tr><td></td></tr>
<tr>
<td class="SubHead" style="width:200px" nowrap>
<asp:Localize runat="server" meta:resourcekey="lblPFXInstallPassword" />
</td>
<td>
<asp:TextBox ID="txtPFXInstallPassword" runat="server" TextMode="Password" Width="200px" />
</td>
</tr>
</table>
</fieldset>
<fieldset>
<legend>
<asp:Label ID="currentCertificate" runat="server" meta:resourcekey="currentCertificate" Text="Current Certificate" CssClass="NormalBold"></asp:Label>&nbsp;
</legend>
<asp:Panel ID="plCertificateInfo" Visible="false" runat="server">
<table>
<tr>
<td class="SubHead" style="width:200px" nowrap>
<asp:Localize runat="server" meta:resourcekey="lblIssuedBy" />
</td>
<td class="SubHead">
<asp:Label ID="lblIssuedBy" runat="server"/>
</td>
</tr>
<tr>
<td class="SubHead" style="width:200px" nowrap>
<asp:Localize runat="server" meta:resourcekey="lblSanName" />
</td>
<td class="SubHead">
<asp:Label ID="lblSanName" runat="server"/>
</td>
</tr>
<tr>
<td class="SubHead" style="width:200px" nowrap>
<asp:Localize runat="server" meta:resourcekey="lblExpiryDate" />
</td>
<td class="SubHead">
<asp:Label ID="lblExpiryDate" runat="server"/>
</td>
</tr>
</table>
</asp:Panel>
</fieldset>
<fieldset>
<table>
<tr> <tr>
<td class="SubHead" width="200" nowrap> <td class="SubHead" width="200" nowrap>
<asp:Label runat="server" ID="lblConnectionBroker" meta:resourcekey="lblConnectionBroker" Text="Connection Broker:"/> <asp:Label runat="server" ID="lblConnectionBroker" meta:resourcekey="lblConnectionBroker" Text="Connection Broker:"/>
@ -18,6 +76,15 @@
<asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtRootOU" ErrorMessage="*" Display="Dynamic" /> <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="txtRootOU" ErrorMessage="*" Display="Dynamic" />
</td> </td>
</tr> </tr>
<tr>
<td class="SubHead" width="200" nowrap>
<asp:Label runat="server" ID="lblComputersRootOU" meta:resourcekey="lblComputersRootOU" Text="Computers Root OU:"/>
</td>
<td class="Normal">
<asp:TextBox runat="server" ID="txtComputersRootOu" MaxLength="1000" Width="200px" />
<asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtComputersRootOu" ErrorMessage="*" Display="Dynamic" />
</td>
</tr>
<tr> <tr>
<td class="SubHead" width="200" nowrap> <td class="SubHead" width="200" nowrap>
<asp:Label runat="server" ID="lblPrimaryDomainController" meta:resourcekey="lblPrimaryDomainController" Text="Primary Domain Controller:"/> <asp:Label runat="server" ID="lblPrimaryDomainController" meta:resourcekey="lblPrimaryDomainController" Text="Primary Domain Controller:"/>
@ -72,4 +139,6 @@
</asp:GridView> </asp:GridView>
</td> </td>
</tr> </tr>
</table> </table>
</fieldset>
<br />

View file

@ -26,11 +26,14 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using AjaxControlToolkit;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Security.Cryptography.X509Certificates;
using System.Web.UI.WebControls; using System.Web.UI.WebControls;
using WebsitePanel.EnterpriseServer; using WebsitePanel.EnterpriseServer;
using WebsitePanel.Providers.Common; using WebsitePanel.Providers.Common;
using WebsitePanel.Providers.RemoteDesktopServices;
namespace WebsitePanel.Portal.ProviderControls namespace WebsitePanel.Portal.ProviderControls
{ {
@ -38,7 +41,7 @@ namespace WebsitePanel.Portal.ProviderControls
{ {
protected void Page_Load(object sender, EventArgs e) protected void Page_Load(object sender, EventArgs e)
{ {
FillCertificateInfo();
} }
public string GWServers public string GWServers
@ -53,15 +56,34 @@ namespace WebsitePanel.Portal.ProviderControls
} }
} }
public void BindSettings(System.Collections.Specialized.StringDictionary settings) private void FillCertificateInfo()
{ {
var certificate = ES.Services.RDS.GetRdsCertificateByServiceId(PanelRequest.ServiceId);
if (certificate != null)
{
var array = Convert.FromBase64String(certificate.Hash);
char[] chars = new char[array.Length / sizeof(char)];
System.Buffer.BlockCopy(array, 0, chars, 0, array.Length);
string password = new string(chars);
plCertificateInfo.Visible = true;
byte[] content = Convert.FromBase64String(certificate.Content);
var x509 = new X509Certificate2(content, password);
lblIssuedBy.Text = x509.Issuer.Replace("CN=", "").Replace("OU=", "").Replace("O=", "").Replace("L=", "").Replace("S=", "").Replace("C=", "");
lblExpiryDate.Text = x509.NotAfter.ToLongDateString();
lblSanName.Text = x509.SubjectName.Name.Replace("CN=", "");
}
}
public void BindSettings(System.Collections.Specialized.StringDictionary settings)
{
txtConnectionBroker.Text = settings["ConnectionBroker"]; txtConnectionBroker.Text = settings["ConnectionBroker"];
GWServers = settings["GWServrsList"]; GWServers = settings["GWServrsList"];
UpdateLyncServersGrid(); UpdateLyncServersGrid();
txtRootOU.Text = settings["RootOU"]; txtRootOU.Text = settings["RootOU"];
txtComputersRootOu.Text = settings["ComputersRootOU"];
txtPrimaryDomainController.Text = settings["PrimaryDomainController"]; txtPrimaryDomainController.Text = settings["PrimaryDomainController"];
if (!string.IsNullOrEmpty(settings["UseCentralNPS"]) && bool.TrueString == settings["UseCentralNPS"]) if (!string.IsNullOrEmpty(settings["UseCentralNPS"]) && bool.TrueString == settings["UseCentralNPS"])
@ -82,11 +104,31 @@ namespace WebsitePanel.Portal.ProviderControls
{ {
settings["ConnectionBroker"] = txtConnectionBroker.Text; settings["ConnectionBroker"] = txtConnectionBroker.Text;
settings["RootOU"] = txtRootOU.Text; settings["RootOU"] = txtRootOU.Text;
settings["ComputersRootOU"] = txtComputersRootOu.Text;
settings["PrimaryDomainController"] = txtPrimaryDomainController.Text; settings["PrimaryDomainController"] = txtPrimaryDomainController.Text;
settings["UseCentralNPS"] = chkUseCentralNPS.Checked.ToString(); settings["UseCentralNPS"] = chkUseCentralNPS.Checked.ToString();
settings["CentralNPS"] = chkUseCentralNPS.Checked ? txtCentralNPS.Text : string.Empty; settings["CentralNPS"] = chkUseCentralNPS.Checked ? txtCentralNPS.Text : string.Empty;
settings["GWServrsList"] = GWServers; settings["GWServrsList"] = GWServers;
try
{
if (upPFX.HasFile.Equals(true))
{
var certificate = new RdsCertificate
{
ServiceId = PanelRequest.ServiceId,
Content = Convert.ToBase64String(upPFX.FileBytes),
FileName = upPFX.FileName,
Hash = txtPFXInstallPassword.Text
};
ES.Services.RDS.AddRdsCertificate(certificate);
}
}
catch (Exception)
{
}
} }
protected void chkUseCentralNPS_CheckedChanged(object sender, EventArgs e) protected void chkUseCentralNPS_CheckedChanged(object sender, EventArgs e)
@ -144,7 +186,7 @@ namespace WebsitePanel.Portal.ProviderControls
GWServers = str.TrimEnd(';'); GWServers = str.TrimEnd(';');
UpdateLyncServersGrid(); UpdateLyncServersGrid();
} }
} }
} }
public class GWServer public class GWServer

View file

@ -1,31 +1,3 @@
// Copyright (c) 2015, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.
@ -40,6 +12,78 @@ namespace WebsitePanel.Portal.ProviderControls {
public partial class RDS_Settings { public partial class RDS_Settings {
/// <summary>
/// secCertificateSettings control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label secCertificateSettings;
/// <summary>
/// upPFX control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.FileUpload upPFX;
/// <summary>
/// txtPFXInstallPassword control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtPFXInstallPassword;
/// <summary>
/// currentCertificate control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label currentCertificate;
/// <summary>
/// plCertificateInfo control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Panel plCertificateInfo;
/// <summary>
/// lblIssuedBy control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblIssuedBy;
/// <summary>
/// lblSanName control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblSanName;
/// <summary>
/// lblExpiryDate control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblExpiryDate;
/// <summary> /// <summary>
/// lblConnectionBroker control. /// lblConnectionBroker control.
/// </summary> /// </summary>
@ -94,6 +138,33 @@ namespace WebsitePanel.Portal.ProviderControls {
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator4; protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator4;
/// <summary>
/// lblComputersRootOU control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblComputersRootOU;
/// <summary>
/// txtComputersRootOu control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtComputersRootOu;
/// <summary>
/// RequiredFieldValidator1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator RequiredFieldValidator1;
/// <summary> /// <summary>
/// lblPrimaryDomainController control. /// lblPrimaryDomainController control.
/// </summary> /// </summary>

View file

@ -153,4 +153,10 @@
<data name="locLblApplicationName" xml:space="preserve"> <data name="locLblApplicationName" xml:space="preserve">
<value>Application Name</value> <value>Application Name</value>
</data> </data>
<data name="btnExit.Text" xml:space="preserve">
<value>Back to Applications List</value>
</data>
<data name="btnSaveExit.Text" xml:space="preserve">
<value>Save Changes and Exit</value>
</data>
</root> </root>

View file

@ -28,27 +28,7 @@
<asp:RequiredFieldValidator ID="valCollectionName" runat="server" ErrorMessage="*" ControlToValidate="txtCollectionName" ValidationGroup="SaveRDSCollection"></asp:RequiredFieldValidator> <asp:RequiredFieldValidator ID="valCollectionName" runat="server" ErrorMessage="*" ControlToValidate="txtCollectionName" ValidationGroup="SaveRDSCollection"></asp:RequiredFieldValidator>
</td> </td>
</tr> </tr>
</table> </table>
<wsp:CollapsiblePanel id="secSelectSertificate" runat="server"
TargetControlID="panelSelectSertificate" meta:resourcekey="secSelectSertificate" Text="">
</wsp:CollapsiblePanel>
<asp:Panel runat="server" ID="panelSelectSertificate">
<div style="padding: 10px;">
<div class="FormBody">
<div class="FormField">
<asp:FileUpload ID="upPFX" runat="server"/>
</div>
<div class="FormFieldDescription">
<asp:Localize runat="server" meta:resourcekey="lblPFXInstallPassword" />
</div>
<div class="FormField">
<asp:TextBox ID="txtPFXInstallPassword" runat="server" TextMode="Password" CssClass="NormalTextBox" />
</div>
</div>
</div>
</asp:Panel>
<fieldset id="RDSServersPanel" runat="server"> <fieldset id="RDSServersPanel" runat="server">
<legend><asp:Localize ID="locRDSServersSection" runat="server" meta:resourcekey="locRDSServersSection" Text="RDS Servers"></asp:Localize></legend> <legend><asp:Localize ID="locRDSServersSection" runat="server" meta:resourcekey="locRDSServersSection" Text="RDS Servers"></asp:Localize></legend>

Some files were not shown because too many files have changed in this diff Show more