From 922009d402062d87a42dddf684d6430ce5615367 Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Mon, 4 Nov 2013 18:07:47 +0300 Subject: [PATCH] add functionallity enterprise storage --- .../HostedSolution/ESPermission.cs | 32 + .../Packages/Quotas.cs | 3 + .../WebsitePanel.EnterpriseServer.Base.csproj | 1 + .../EnterpriseStorageProxy.cs | 792 ++++++++++++------ .../EnterpriseStorageController.cs | 374 ++++++++- .../Files/FilesController.cs | 11 +- .../HostedSolution/OrganizationController.cs | 79 +- .../Packages/PackageController.cs | 2 +- .../Tasks/TaskManager.cs | 1 - .../WebServers/WebServerController.cs | 91 ++ .../esEnterpriseStorage.asmx.cs | 29 +- .../EnterpriseStorage/IEnterpriseStorage.cs | 6 +- .../OS/SystemFile.cs | 15 +- .../OS/SystemFilesPaged.cs | 20 + .../Web/IWebDav.cs | 17 + .../Web/WebDavFolderRule.cs | 60 ++ .../WebsitePanel.Providers.Base.csproj | 3 + ...iders.EnterpriseStorage.Windows2012.csproj | 16 + .../Windows2012.cs | 96 ++- .../Properties/AssemblyInfo.cs | 36 + .../WebDav.cs | 147 ++++ .../WebDavExtensions.cs | 91 ++ .../WebsitePanel.Providers.Web.WebDav.csproj | 63 ++ .../EnterpriseStorageProxy.cs | 570 ++++++++----- .../WebsitePanel.Server.Client.csproj | 3 + .../WebsitePanel.Server.Utils/FileUtils.cs | 7 +- .../EnterpriseStorage.asmx.cs | 29 +- .../App_Data/WebsitePanel_Modules.config | 4 +- .../Code/Framework/PanelRequest.cs | 4 + .../Code/Helpers/EnterpriseStorageHelper.cs | 29 + .../EnterpriseStorageCreateFolder.ascx.resx | 144 ++++ ...riseStorageFolderGeneralSettings.ascx.resx | 150 ++++ .../EnterpriseStorageFolders.ascx.resx | 156 ++++ .../EnterpriseStorageCreateFolder.ascx | 46 + .../EnterpriseStorageCreateFolder.ascx.cs | 72 ++ ...rpriseStorageCreateFolder.ascx.designer.cs | 123 +++ ...nterpriseStorageFolderGeneralSettings.ascx | 71 ++ ...rpriseStorageFolderGeneralSettings.ascx.cs | 106 +++ ...rageFolderGeneralSettings.ascx.designer.cs | 186 ++++ .../EnterpriseStorageFolders.ascx | 105 +++ .../EnterpriseStorageFolders.ascx.cs | 127 +++ .../EnterpriseStorageFolders.ascx.designer.cs | 168 ++++ .../EnterpriseStorageSpaces.ascx.designer.cs | 29 - .../EnterpriseStoragePermissions.ascx.resx | 168 ++++ .../App_LocalResources/Menu.ascx.resx | 4 +- .../EnterpriseStoragePermissions.ascx | 122 +++ .../EnterpriseStoragePermissions.ascx.cs | 287 +++++++ ...erpriseStoragePermissions.ascx.designer.cs | 177 ++++ .../ExchangeServer/UserControls/Menu.ascx.cs | 2 +- .../EnterpriseStorage_Settings.ascx.resx | 3 + .../EnterpriseStorage_Settings.ascx | 10 + .../EnterpriseStorage_Settings.ascx.cs | 2 + ...nterpriseStorage_Settings.ascx.designer.cs | 55 +- .../WebsitePanel.Portal.Modules.csproj | 46 +- 54 files changed, 4427 insertions(+), 563 deletions(-) create mode 100644 WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/HostedSolution/ESPermission.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.Base/OS/SystemFilesPaged.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.Base/Web/IWebDav.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.Base/Web/WebDavFolderRule.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.Web.WebDav/Properties/AssemblyInfo.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.Web.WebDav/WebDav.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.Web.WebDav/WebDavExtensions.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.Web.WebDav/WebsitePanel.Providers.Web.WebDav.csproj create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Helpers/EnterpriseStorageHelper.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/EnterpriseStorageCreateFolder.ascx.resx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/EnterpriseStorageFolderGeneralSettings.ascx.resx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/EnterpriseStorageFolders.ascx.resx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageCreateFolder.ascx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageCreateFolder.ascx.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageCreateFolder.ascx.designer.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageFolderGeneralSettings.ascx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageFolderGeneralSettings.ascx.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageFolderGeneralSettings.ascx.designer.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageFolders.ascx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageFolders.ascx.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageFolders.ascx.designer.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/EnterpriseStoragePermissions.ascx.resx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/EnterpriseStoragePermissions.ascx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/EnterpriseStoragePermissions.ascx.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/EnterpriseStoragePermissions.ascx.designer.cs diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/HostedSolution/ESPermission.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/HostedSolution/ESPermission.cs new file mode 100644 index 00000000..e723448e --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/HostedSolution/ESPermission.cs @@ -0,0 +1,32 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace WebsitePanel.EnterpriseServer.Base.HostedSolution +{ + public class ESPermission + { + string account; + string access; + bool isGroup; + + public string Account + { + get { return account; } + set { account = value; } + } + + public string Access + { + get { return access; } + set { access = value; } + } + + public bool IsGroup + { + get { return isGroup; } + set { isGroup = value; } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs index 6e6bad12..8e3abc8f 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs @@ -234,5 +234,8 @@ order by rg.groupOrder public const string HELICON_ZOO = "HeliconZoo.*"; + public const string ENTERPRISESTORAGE_DISKSTORAGESPACE = "EnterpriseStorage.DiskStorageSpace"; + public const string ENTERPRISESTORAGE_FOLDERS = "EnterpriseStorage.Folders"; + } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/WebsitePanel.EnterpriseServer.Base.csproj b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/WebsitePanel.EnterpriseServer.Base.csproj index e5ea3611..082f5542 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/WebsitePanel.EnterpriseServer.Base.csproj +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/WebsitePanel.EnterpriseServer.Base.csproj @@ -117,6 +117,7 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/EnterpriseStorageProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/EnterpriseStorageProxy.cs index 07f39bdf..ea61b5eb 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/EnterpriseStorageProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/EnterpriseStorageProxy.cs @@ -1,35 +1,7 @@ -// Copyright (c) 2012, 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. - //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.6407 +// Runtime Version:2.0.50727.4984 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -37,489 +9,839 @@ //------------------------------------------------------------------------------ // -// This source code was auto-generated by wsdl, Version=2.0.50727.3038. +// This source code was auto-generated by wsdl, Version=2.0.50727.42. // + +using WebsitePanel.EnterpriseServer.Base.HostedSolution; using WebsitePanel.Providers; using WebsitePanel.Providers.Common; -using WebsitePanel.Providers.ResultObjects; +using WebsitePanel.Providers.HostedSolution; using WebsitePanel.Providers.OS; - -namespace WebsitePanel.EnterpriseServer { +namespace WebsitePanel.EnterpriseServer +{ using System.Xml.Serialization; using System.Web.Services; using System.ComponentModel; using System.Web.Services.Protocols; using System; using System.Diagnostics; - - + + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Web.Services.WebServiceBindingAttribute(Name="esEnterpriseStorageSoap", Namespace="http://smbsaas/websitepanel/enterpriseserver")] + [System.Web.Services.WebServiceBindingAttribute(Name = "esEnterpriseStorageSoap", Namespace = "http://smbsaas/websitepanel/enterpriseserver")] [System.Xml.Serialization.XmlIncludeAttribute(typeof(ServiceProviderItem))] - public partial class esEnterpriseStorage : Microsoft.Web.Services3.WebServicesClientProtocol { - + public partial class esEnterpriseStorage : Microsoft.Web.Services3.WebServicesClientProtocol + { + private System.Threading.SendOrPostCallback CheckFileServicesInstallationOperationCompleted; - + private System.Threading.SendOrPostCallback GetEnterpriseFoldersOperationCompleted; - + private System.Threading.SendOrPostCallback GetEnterpriseFolderOperationCompleted; - + private System.Threading.SendOrPostCallback CreateEnterpriseFolderOperationCompleted; - + private System.Threading.SendOrPostCallback DeleteEnterpriseFolderOperationCompleted; - - private System.Threading.SendOrPostCallback SetEnterpriseFolderQuotaOperationCompleted; - + + private System.Threading.SendOrPostCallback GetEnterpriseFolderPermissionsOperationCompleted; + + private System.Threading.SendOrPostCallback SetEnterpriseFolderPermissionsOperationCompleted; + + private System.Threading.SendOrPostCallback SearchESAccountsOperationCompleted; + + private System.Threading.SendOrPostCallback GetEnterpriseFoldersPagedOperationCompleted; + /// - public esEnterpriseStorage() { + public esEnterpriseStorage() + { this.Url = "http://localhost:9002/esEnterpriseStorage.asmx"; } - + /// public event CheckFileServicesInstallationCompletedEventHandler CheckFileServicesInstallationCompleted; - + /// public event GetEnterpriseFoldersCompletedEventHandler GetEnterpriseFoldersCompleted; - + /// public event GetEnterpriseFolderCompletedEventHandler GetEnterpriseFolderCompleted; - + /// public event CreateEnterpriseFolderCompletedEventHandler CreateEnterpriseFolderCompleted; - + /// public event DeleteEnterpriseFolderCompletedEventHandler DeleteEnterpriseFolderCompleted; - + /// - public event SetEnterpriseFolderQuotaCompletedEventHandler SetEnterpriseFolderQuotaCompleted; - + public event GetEnterpriseFolderPermissionsCompletedEventHandler GetEnterpriseFolderPermissionsCompleted; + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/CheckFileServicesInstallation", 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 bool CheckFileServicesInstallation(int serviceId) { + public event SetEnterpriseFolderPermissionsCompletedEventHandler SetEnterpriseFolderPermissionsCompleted; + + /// + public event SearchESAccountsCompletedEventHandler SearchESAccountsCompleted; + + /// + public event GetEnterpriseFoldersPagedCompletedEventHandler GetEnterpriseFoldersPagedCompleted; + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/CheckFileServicesInstallation", 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 bool CheckFileServicesInstallation(int serviceId) + { object[] results = this.Invoke("CheckFileServicesInstallation", new object[] { serviceId}); return ((bool)(results[0])); } - + /// - public System.IAsyncResult BeginCheckFileServicesInstallation(int serviceId, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginCheckFileServicesInstallation(int serviceId, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("CheckFileServicesInstallation", new object[] { serviceId}, callback, asyncState); } - + /// - public bool EndCheckFileServicesInstallation(System.IAsyncResult asyncResult) { + public bool EndCheckFileServicesInstallation(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((bool)(results[0])); } - + /// - public void CheckFileServicesInstallationAsync(int serviceId) { + public void CheckFileServicesInstallationAsync(int serviceId) + { this.CheckFileServicesInstallationAsync(serviceId, null); } - + /// - public void CheckFileServicesInstallationAsync(int serviceId, object userState) { - if ((this.CheckFileServicesInstallationOperationCompleted == null)) { + public void CheckFileServicesInstallationAsync(int serviceId, object userState) + { + if ((this.CheckFileServicesInstallationOperationCompleted == null)) + { this.CheckFileServicesInstallationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCheckFileServicesInstallationOperationCompleted); } this.InvokeAsync("CheckFileServicesInstallation", new object[] { serviceId}, this.CheckFileServicesInstallationOperationCompleted, userState); } - - private void OnCheckFileServicesInstallationOperationCompleted(object arg) { - if ((this.CheckFileServicesInstallationCompleted != null)) { + + private void OnCheckFileServicesInstallationOperationCompleted(object arg) + { + if ((this.CheckFileServicesInstallationCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.CheckFileServicesInstallationCompleted(this, new CheckFileServicesInstallationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetEnterpriseFolders", 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 SystemFile[] GetEnterpriseFolders(int itemId) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetEnterpriseFolders", 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 SystemFile[] GetEnterpriseFolders(int itemId) + { object[] results = this.Invoke("GetEnterpriseFolders", new object[] { itemId}); return ((SystemFile[])(results[0])); } - + /// - public System.IAsyncResult BeginGetEnterpriseFolders(int itemId, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginGetEnterpriseFolders(int itemId, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("GetEnterpriseFolders", new object[] { itemId}, callback, asyncState); } - + /// - public SystemFile[] EndGetEnterpriseFolders(System.IAsyncResult asyncResult) { + public SystemFile[] EndGetEnterpriseFolders(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((SystemFile[])(results[0])); } - + /// - public void GetEnterpriseFoldersAsync(int itemId) { + public void GetEnterpriseFoldersAsync(int itemId) + { this.GetEnterpriseFoldersAsync(itemId, null); } - + /// - public void GetEnterpriseFoldersAsync(int itemId, object userState) { - if ((this.GetEnterpriseFoldersOperationCompleted == null)) { + public void GetEnterpriseFoldersAsync(int itemId, object userState) + { + if ((this.GetEnterpriseFoldersOperationCompleted == null)) + { this.GetEnterpriseFoldersOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetEnterpriseFoldersOperationCompleted); } this.InvokeAsync("GetEnterpriseFolders", new object[] { itemId}, this.GetEnterpriseFoldersOperationCompleted, userState); } - - private void OnGetEnterpriseFoldersOperationCompleted(object arg) { - if ((this.GetEnterpriseFoldersCompleted != null)) { + + private void OnGetEnterpriseFoldersOperationCompleted(object arg) + { + if ((this.GetEnterpriseFoldersCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetEnterpriseFoldersCompleted(this, new GetEnterpriseFoldersCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetEnterpriseFolder", 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 SystemFile GetEnterpriseFolder(int itemId, string folderName) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetEnterpriseFolder", 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 SystemFile GetEnterpriseFolder(int itemId, string folderName) + { object[] results = this.Invoke("GetEnterpriseFolder", new object[] { itemId, folderName}); return ((SystemFile)(results[0])); } - + /// - public System.IAsyncResult BeginGetEnterpriseFolder(int itemId, string folderName, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginGetEnterpriseFolder(int itemId, string folderName, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("GetEnterpriseFolder", new object[] { itemId, folderName}, callback, asyncState); } - + /// - public SystemFile EndGetEnterpriseFolder(System.IAsyncResult asyncResult) { + public SystemFile EndGetEnterpriseFolder(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((SystemFile)(results[0])); } - + /// - public void GetEnterpriseFolderAsync(int itemId, string folderName) { + public void GetEnterpriseFolderAsync(int itemId, string folderName) + { this.GetEnterpriseFolderAsync(itemId, folderName, null); } - + /// - public void GetEnterpriseFolderAsync(int itemId, string folderName, object userState) { - if ((this.GetEnterpriseFolderOperationCompleted == null)) { + public void GetEnterpriseFolderAsync(int itemId, string folderName, object userState) + { + if ((this.GetEnterpriseFolderOperationCompleted == null)) + { this.GetEnterpriseFolderOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetEnterpriseFolderOperationCompleted); } this.InvokeAsync("GetEnterpriseFolder", new object[] { itemId, folderName}, this.GetEnterpriseFolderOperationCompleted, userState); } - - private void OnGetEnterpriseFolderOperationCompleted(object arg) { - if ((this.GetEnterpriseFolderCompleted != null)) { + + private void OnGetEnterpriseFolderOperationCompleted(object arg) + { + if ((this.GetEnterpriseFolderCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetEnterpriseFolderCompleted(this, new GetEnterpriseFolderCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/CreateEnterpriseFolder", 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 CreateEnterpriseFolder(int itemId, string folderName, long quota) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/CreateEnterpriseFolder", 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 CreateEnterpriseFolder(int itemId, string folderName) + { object[] results = this.Invoke("CreateEnterpriseFolder", new object[] { itemId, - folderName, - quota}); + folderName}); return ((ResultObject)(results[0])); } - + /// - public System.IAsyncResult BeginCreateEnterpriseFolder(int itemId, string folderName, long quota, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginCreateEnterpriseFolder(int itemId, string folderName, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("CreateEnterpriseFolder", new object[] { itemId, - folderName, - quota}, callback, asyncState); + folderName}, callback, asyncState); } - + /// - public ResultObject EndCreateEnterpriseFolder(System.IAsyncResult asyncResult) { + public ResultObject EndCreateEnterpriseFolder(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((ResultObject)(results[0])); } - + /// - public void CreateEnterpriseFolderAsync(int itemId, string folderName, long quota) { - this.CreateEnterpriseFolderAsync(itemId, folderName, quota, null); + public void CreateEnterpriseFolderAsync(int itemId, string folderName) + { + this.CreateEnterpriseFolderAsync(itemId, folderName, null); } - + /// - public void CreateEnterpriseFolderAsync(int itemId, string folderName, long quota, object userState) { - if ((this.CreateEnterpriseFolderOperationCompleted == null)) { + public void CreateEnterpriseFolderAsync(int itemId, string folderName, object userState) + { + if ((this.CreateEnterpriseFolderOperationCompleted == null)) + { this.CreateEnterpriseFolderOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateEnterpriseFolderOperationCompleted); } this.InvokeAsync("CreateEnterpriseFolder", new object[] { itemId, - folderName, - quota}, this.CreateEnterpriseFolderOperationCompleted, userState); + folderName}, this.CreateEnterpriseFolderOperationCompleted, userState); } - - private void OnCreateEnterpriseFolderOperationCompleted(object arg) { - if ((this.CreateEnterpriseFolderCompleted != null)) { + + private void OnCreateEnterpriseFolderOperationCompleted(object arg) + { + if ((this.CreateEnterpriseFolderCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.CreateEnterpriseFolderCompleted(this, new CreateEnterpriseFolderCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/DeleteEnterpriseFolder", 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 DeleteEnterpriseFolder(int itemId, string folderName) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/DeleteEnterpriseFolder", 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 DeleteEnterpriseFolder(int itemId, string folderName) + { object[] results = this.Invoke("DeleteEnterpriseFolder", new object[] { itemId, folderName}); return ((ResultObject)(results[0])); } - + /// - public System.IAsyncResult BeginDeleteEnterpriseFolder(int itemId, string folderName, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginDeleteEnterpriseFolder(int itemId, string folderName, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("DeleteEnterpriseFolder", new object[] { itemId, folderName}, callback, asyncState); } - + /// - public ResultObject EndDeleteEnterpriseFolder(System.IAsyncResult asyncResult) { + public ResultObject EndDeleteEnterpriseFolder(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((ResultObject)(results[0])); } - + /// - public void DeleteEnterpriseFolderAsync(int itemId, string folderName) { + public void DeleteEnterpriseFolderAsync(int itemId, string folderName) + { this.DeleteEnterpriseFolderAsync(itemId, folderName, null); } - + /// - public void DeleteEnterpriseFolderAsync(int itemId, string folderName, object userState) { - if ((this.DeleteEnterpriseFolderOperationCompleted == null)) { + public void DeleteEnterpriseFolderAsync(int itemId, string folderName, object userState) + { + if ((this.DeleteEnterpriseFolderOperationCompleted == null)) + { this.DeleteEnterpriseFolderOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteEnterpriseFolderOperationCompleted); } this.InvokeAsync("DeleteEnterpriseFolder", new object[] { itemId, folderName}, this.DeleteEnterpriseFolderOperationCompleted, userState); } - - private void OnDeleteEnterpriseFolderOperationCompleted(object arg) { - if ((this.DeleteEnterpriseFolderCompleted != null)) { + + private void OnDeleteEnterpriseFolderOperationCompleted(object arg) + { + if ((this.DeleteEnterpriseFolderCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.DeleteEnterpriseFolderCompleted(this, new DeleteEnterpriseFolderCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SetEnterpriseFolderQuota", 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 SetEnterpriseFolderQuota(int itemId, string folderName, long quota) { - object[] results = this.Invoke("SetEnterpriseFolderQuota", new object[] { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetEnterpriseFolderPermissions", 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 ESPermission[] GetEnterpriseFolderPermissions(int itemId, string folderName) + { + object[] results = this.Invoke("GetEnterpriseFolderPermissions", new object[] { + itemId, + folderName}); + return ((ESPermission[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetEnterpriseFolderPermissions(int itemId, string folderName, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("GetEnterpriseFolderPermissions", new object[] { + itemId, + folderName}, callback, asyncState); + } + + /// + public ESPermission[] EndGetEnterpriseFolderPermissions(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((ESPermission[])(results[0])); + } + + /// + public void GetEnterpriseFolderPermissionsAsync(int itemId, string folderName) + { + this.GetEnterpriseFolderPermissionsAsync(itemId, folderName, null); + } + + /// + public void GetEnterpriseFolderPermissionsAsync(int itemId, string folderName, object userState) + { + if ((this.GetEnterpriseFolderPermissionsOperationCompleted == null)) + { + this.GetEnterpriseFolderPermissionsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetEnterpriseFolderPermissionsOperationCompleted); + } + this.InvokeAsync("GetEnterpriseFolderPermissions", new object[] { + itemId, + folderName}, this.GetEnterpriseFolderPermissionsOperationCompleted, userState); + } + + private void OnGetEnterpriseFolderPermissionsOperationCompleted(object arg) + { + if ((this.GetEnterpriseFolderPermissionsCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetEnterpriseFolderPermissionsCompleted(this, new GetEnterpriseFolderPermissionsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SetEnterpriseFolderPermissions", 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 SetEnterpriseFolderPermissions(int itemId, string folderName, ESPermission[] permission) + { + object[] results = this.Invoke("SetEnterpriseFolderPermissions", new object[] { itemId, folderName, - quota}); + permission}); return ((ResultObject)(results[0])); } - + /// - public System.IAsyncResult BeginSetEnterpriseFolderQuota(int itemId, string folderName, long quota, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("SetEnterpriseFolderQuota", new object[] { + public System.IAsyncResult BeginSetEnterpriseFolderPermissions(int itemId, string folderName, ESPermission[] permission, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("SetEnterpriseFolderPermissions", new object[] { itemId, folderName, - quota}, callback, asyncState); + permission}, callback, asyncState); } - + /// - public ResultObject EndSetEnterpriseFolderQuota(System.IAsyncResult asyncResult) { + public ResultObject EndSetEnterpriseFolderPermissions(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((ResultObject)(results[0])); } - + /// - public void SetEnterpriseFolderQuotaAsync(int itemId, string folderName, long quota) { - this.SetEnterpriseFolderQuotaAsync(itemId, folderName, quota, null); + public void SetEnterpriseFolderPermissionsAsync(int itemId, string folderName, ESPermission[] permission) + { + this.SetEnterpriseFolderPermissionsAsync(itemId, folderName, permission, null); } - + /// - public void SetEnterpriseFolderQuotaAsync(int itemId, string folderName, long quota, object userState) { - if ((this.SetEnterpriseFolderQuotaOperationCompleted == null)) { - this.SetEnterpriseFolderQuotaOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetEnterpriseFolderQuotaOperationCompleted); + public void SetEnterpriseFolderPermissionsAsync(int itemId, string folderName, ESPermission[] permission, object userState) + { + if ((this.SetEnterpriseFolderPermissionsOperationCompleted == null)) + { + this.SetEnterpriseFolderPermissionsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetEnterpriseFolderPermissionsOperationCompleted); } - this.InvokeAsync("SetEnterpriseFolderQuota", new object[] { + this.InvokeAsync("SetEnterpriseFolderPermissions", new object[] { itemId, folderName, - quota}, this.SetEnterpriseFolderQuotaOperationCompleted, userState); + permission}, this.SetEnterpriseFolderPermissionsOperationCompleted, userState); } - - private void OnSetEnterpriseFolderQuotaOperationCompleted(object arg) { - if ((this.SetEnterpriseFolderQuotaCompleted != null)) { + + private void OnSetEnterpriseFolderPermissionsOperationCompleted(object arg) + { + if ((this.SetEnterpriseFolderPermissionsCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.SetEnterpriseFolderQuotaCompleted(this, new SetEnterpriseFolderQuotaCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + this.SetEnterpriseFolderPermissionsCompleted(this, new SetEnterpriseFolderPermissionsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - public new void CancelAsync(object userState) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SearchESAccounts", 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 ExchangeAccount[] SearchESAccounts(int itemId, string filterColumn, string filterValue, string sortColumn) + { + object[] results = this.Invoke("SearchESAccounts", new object[] { + itemId, + filterColumn, + filterValue, + sortColumn}); + return ((ExchangeAccount[])(results[0])); + } + + /// + public System.IAsyncResult BeginSearchESAccounts(int itemId, string filterColumn, string filterValue, string sortColumn, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("SearchESAccounts", new object[] { + itemId, + filterColumn, + filterValue, + sortColumn}, callback, asyncState); + } + + /// + public ExchangeAccount[] EndSearchESAccounts(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((ExchangeAccount[])(results[0])); + } + + /// + public void SearchESAccountsAsync(int itemId, string filterColumn, string filterValue, string sortColumn) + { + this.SearchESAccountsAsync(itemId, filterColumn, filterValue, sortColumn, null); + } + + /// + public void SearchESAccountsAsync(int itemId, string filterColumn, string filterValue, string sortColumn, object userState) + { + if ((this.SearchESAccountsOperationCompleted == null)) + { + this.SearchESAccountsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSearchESAccountsOperationCompleted); + } + this.InvokeAsync("SearchESAccounts", new object[] { + itemId, + filterColumn, + filterValue, + sortColumn}, this.SearchESAccountsOperationCompleted, userState); + } + + private void OnSearchESAccountsOperationCompleted(object arg) + { + if ((this.SearchESAccountsCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.SearchESAccountsCompleted(this, new SearchESAccountsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetEnterpriseFoldersPaged", 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 SystemFilesPaged GetEnterpriseFoldersPaged(int itemId, string filterValue, string sortColumn, int startRow, int maximumRows) + { + object[] results = this.Invoke("GetEnterpriseFoldersPaged", new object[] { + itemId, + filterValue, + sortColumn, + startRow, + maximumRows}); + return ((SystemFilesPaged)(results[0])); + } + + /// + public System.IAsyncResult BeginGetEnterpriseFoldersPaged(int itemId, string filterValue, string sortColumn, int startRow, int maximumRows, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("GetEnterpriseFoldersPaged", new object[] { + itemId, + filterValue, + sortColumn, + startRow, + maximumRows}, callback, asyncState); + } + + /// + public SystemFilesPaged EndGetEnterpriseFoldersPaged(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((SystemFilesPaged)(results[0])); + } + + /// + public void GetEnterpriseFoldersPagedAsync(int itemId, string filterValue, string sortColumn, int startRow, int maximumRows) + { + this.GetEnterpriseFoldersPagedAsync(itemId, filterValue, sortColumn, startRow, maximumRows, null); + } + + /// + public void GetEnterpriseFoldersPagedAsync(int itemId, string filterValue, string sortColumn, int startRow, int maximumRows, object userState) + { + if ((this.GetEnterpriseFoldersPagedOperationCompleted == null)) + { + this.GetEnterpriseFoldersPagedOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetEnterpriseFoldersPagedOperationCompleted); + } + this.InvokeAsync("GetEnterpriseFoldersPaged", new object[] { + itemId, + filterValue, + sortColumn, + startRow, + maximumRows}, this.GetEnterpriseFoldersPagedOperationCompleted, userState); + } + + private void OnGetEnterpriseFoldersPagedOperationCompleted(object arg) + { + if ((this.GetEnterpriseFoldersPagedCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetEnterpriseFoldersPagedCompleted(this, new GetEnterpriseFoldersPagedCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + public new void CancelAsync(object userState) + { base.CancelAsync(userState); } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void CheckFileServicesInstallationCompletedEventHandler(object sender, CheckFileServicesInstallationCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class CheckFileServicesInstallationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class CheckFileServicesInstallationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal CheckFileServicesInstallationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal CheckFileServicesInstallationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public bool Result { - get { + public bool Result + { + get + { this.RaiseExceptionIfNecessary(); return ((bool)(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void GetEnterpriseFoldersCompletedEventHandler(object sender, GetEnterpriseFoldersCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetEnterpriseFoldersCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class GetEnterpriseFoldersCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal GetEnterpriseFoldersCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal GetEnterpriseFoldersCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public SystemFile[] Result { - get { + public SystemFile[] Result + { + get + { this.RaiseExceptionIfNecessary(); return ((SystemFile[])(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void GetEnterpriseFolderCompletedEventHandler(object sender, GetEnterpriseFolderCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetEnterpriseFolderCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class GetEnterpriseFolderCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal GetEnterpriseFolderCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal GetEnterpriseFolderCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public SystemFile Result { - get { + public SystemFile Result + { + get + { this.RaiseExceptionIfNecessary(); return ((SystemFile)(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void CreateEnterpriseFolderCompletedEventHandler(object sender, CreateEnterpriseFolderCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class CreateEnterpriseFolderCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class CreateEnterpriseFolderCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal CreateEnterpriseFolderCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal CreateEnterpriseFolderCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public ResultObject Result { - get { + public ResultObject Result + { + get + { this.RaiseExceptionIfNecessary(); return ((ResultObject)(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void DeleteEnterpriseFolderCompletedEventHandler(object sender, DeleteEnterpriseFolderCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class DeleteEnterpriseFolderCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class DeleteEnterpriseFolderCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal DeleteEnterpriseFolderCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal DeleteEnterpriseFolderCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public ResultObject Result { - get { + public ResultObject Result + { + get + { this.RaiseExceptionIfNecessary(); return ((ResultObject)(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] - public delegate void SetEnterpriseFolderQuotaCompletedEventHandler(object sender, SetEnterpriseFolderQuotaCompletedEventArgs e); - + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetEnterpriseFolderPermissionsCompletedEventHandler(object sender, GetEnterpriseFolderPermissionsCompletedEventArgs e); + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class SetEnterpriseFolderQuotaCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class GetEnterpriseFolderPermissionsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal SetEnterpriseFolderQuotaCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal GetEnterpriseFolderPermissionsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public ResultObject Result { - get { + public ESPermission[] Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((ESPermission[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void SetEnterpriseFolderPermissionsCompletedEventHandler(object sender, SetEnterpriseFolderPermissionsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class SetEnterpriseFolderPermissionsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal SetEnterpriseFolderPermissionsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public ResultObject Result + { + get + { this.RaiseExceptionIfNecessary(); return ((ResultObject)(this.results[0])); } } } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void SearchESAccountsCompletedEventHandler(object sender, SearchESAccountsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class SearchESAccountsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal SearchESAccountsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public ExchangeAccount[] Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((ExchangeAccount[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetEnterpriseFoldersPagedCompletedEventHandler(object sender, GetEnterpriseFoldersPagedCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetEnterpriseFoldersPagedCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal GetEnterpriseFoldersPagedCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public SystemFilesPaged Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((SystemFilesPaged)(this.results[0])); + } + } + } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/EnterpriseStorage/EnterpriseStorageController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/EnterpriseStorage/EnterpriseStorageController.cs index ba585e20..2c56e19b 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/EnterpriseStorage/EnterpriseStorageController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/EnterpriseStorage/EnterpriseStorageController.cs @@ -34,6 +34,7 @@ using System.Collections.Specialized; using System.Text; using System.Xml; using System.Xml.Serialization; +using System.Linq; using WebsitePanel.Server; using WebsitePanel.Providers; @@ -42,13 +43,16 @@ using WebsitePanel.Providers.EnterpriseStorage; using System.Collections; using WebsitePanel.Providers.Common; using WebsitePanel.Providers.ResultObjects; - +using WebsitePanel.Providers.Web; +using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.EnterpriseServer.Base.HostedSolution; namespace WebsitePanel.EnterpriseServer { public class EnterpriseStorageController { #region Public Methods + public static SystemFile[] GetFolders(int itemId) { return GetFoldersInternal(itemId); @@ -59,20 +63,52 @@ namespace WebsitePanel.EnterpriseServer return GetFolderInternal(itemId, folderName); } - public static ResultObject CreateFolder(int itemId, string folderName, long quota) + public static ResultObject CreateFolder(int itemId) { - return CreateFolderInternal(itemId, folderName, quota); + return CreateFolder(itemId, string.Empty); + } + + public static ResultObject CreateFolder(int itemId, string folderName) + { + return CreateFolderInternal(itemId, folderName); + } + + public static ResultObject DeleteFolder(int itemId) + { + return DeleteFolder(itemId, string.Empty); } public static ResultObject DeleteFolder(int itemId, string folderName) { return DeleteFolderInternal(itemId, folderName); + } + + public static List SearchESAccounts(int itemId, string filterColumn, string filterValue, string sortColumn) + { + return SearchESAccountsInternal(itemId, filterColumn, filterValue, sortColumn); } - public static ResultObject SetFolderQuota(int itemId, string folderName, long quota) + public static SystemFilesPaged GetEnterpriseFoldersPaged(int itemId, string filterValue, string sortColumn, int startRow, int maximumRows) { - return SetFolderQuotaInternal(itemId, folderName, quota); + return GetEnterpriseFoldersPagedInternal(itemId, filterValue, sortColumn, startRow, maximumRows); } + + public static ResultObject SetFolderPermission(int itemId, string folder, ESPermission[] permission) + { + return SetFolderWebDavRulesInternal(itemId, folder, permission); + } + + public static ESPermission[] GetFolderPermission(int itemId, string folder) + { + return ConvertToESPermission(GetFolderWebDavRulesInternal(itemId, folder)); + } + + public static bool CheckFileServicesInstallation(int serviceId) + { + EnterpriseStorage es = GetEnterpriseStorage(serviceId); + return es.CheckFileServicesInstallation(); + } + #endregion @@ -83,37 +119,335 @@ namespace WebsitePanel.EnterpriseServer return es; } - - private static SystemFile[] GetFoldersInternal(int itemId) + protected static SystemFile[] GetFoldersInternal(int itemId) { - return new SystemFile[1]; + try + { + // load organization + Organization org = OrganizationController.GetOrganization(itemId); + if (org == null) + { + return null; + } + + EnterpriseStorage es = GetEnterpriseStorage(GetEnterpriseStorageServiceID(org.PackageId)); + + return es.GetFolders(org.OrganizationId); + } + catch (Exception ex) + { + throw ex; + } } - private static SystemFile GetFolderInternal(int itemId, string folderName) + protected static SystemFile GetFolderInternal(int itemId, string folderName) { - return new SystemFile(); + try + { + // load organization + Organization org = OrganizationController.GetOrganization(itemId); + if (org == null) + { + return null; + } + + EnterpriseStorage es = GetEnterpriseStorage(GetEnterpriseStorageServiceID(org.PackageId)); + + return es.GetFolder(org.OrganizationId, folderName); + } + catch (Exception ex) + { + throw ex; + } } - private static ResultObject CreateFolderInternal(int itemId, string folderName, long quota) + protected static ResultObject CreateFolderInternal(int itemId, string folderName) { - return new ResultObject(); + ResultObject result = TaskManager.StartResultTask("ENTERPRISE_STORAGE", "CREATE_FOLDER"); + + try + { + // load organization + Organization org = OrganizationController.GetOrganization(itemId); + if (org == null) + { + return null; + } + + EnterpriseStorage es = GetEnterpriseStorage(GetEnterpriseStorageServiceID(org.PackageId)); + + es.CreateFolder(org.OrganizationId, folderName); + } + catch (Exception ex) + { + result.AddError("ENTERPRISE_STORAGE_CREATE_FOLDER", ex); + } + finally + { + if (!result.IsSuccess) + { + TaskManager.CompleteResultTask(result); + } + else + { + TaskManager.CompleteResultTask(); + } + } + + return result; } - private static ResultObject DeleteFolderInternal(int itemId, string folderName) + protected static ResultObject DeleteFolderInternal(int itemId, string folderName) { - return new ResultObject(); + ResultObject result = TaskManager.StartResultTask("ENTERPRISE_STORAGE", "DELETE_FOLDER"); + + try + { + // load organization + Organization org = OrganizationController.GetOrganization(itemId); + if (org == null) + { + return null; + } + + EnterpriseStorage es = GetEnterpriseStorage(GetEnterpriseStorageServiceID(org.PackageId)); + + es.DeleteFolder(org.OrganizationId, folderName); + } + catch (Exception ex) + { + result.AddError("ENTERPRISE_STORAGE_DELETE_FOLDER", ex); + } + finally + { + if (!result.IsSuccess) + { + TaskManager.CompleteResultTask(result); + } + else + { + TaskManager.CompleteResultTask(); + } + } + + return result; + } + + protected static List SearchESAccountsInternal(int itemId, string filterColumn, string filterValue, string sortColumn) + { + // load organization + Organization org = (Organization)PackageController.GetPackageItem(itemId); + if (org == null) + return null; + + string accountTypes = string.Format("{0}, {1}", ((int)ExchangeAccountType.SecurityGroup), ((int)ExchangeAccountType.User)); + + if (PackageController.GetPackageServiceId(org.PackageId, ResourceGroups.Exchange) != 0) + { + accountTypes = string.Format("{0}, {1}, {2}, {3}", accountTypes, ((int)ExchangeAccountType.Mailbox), + ((int)ExchangeAccountType.Room), ((int)ExchangeAccountType.Equipment)); + } + + List tmpAccounts = ObjectUtils.CreateListFromDataReader( + DataProvider.SearchExchangeAccountsByTypes(SecurityContext.User.UserId, itemId, + accountTypes, filterColumn, filterValue, sortColumn)); + + + List exAccounts = new List(); + + foreach (ExchangeAccount tmpAccount in tmpAccounts.ToArray()) + { + bool bSuccess = false; + + switch (tmpAccount.AccountType) + { + case ExchangeAccountType.SecurityGroup: + bSuccess = OrganizationController.GetSecurityGroupGeneralSettings(itemId, tmpAccount.AccountId) != null; + break; + default: + bSuccess = OrganizationController.GetUserGeneralSettings(itemId, tmpAccount.AccountId) != null; + break; + } + + if (bSuccess) + { + exAccounts.Add(tmpAccount); + } + } + + return exAccounts; } - private static ResultObject SetFolderQuotaInternal(int itemId, string folderName, long quota) + protected static SystemFilesPaged GetEnterpriseFoldersPagedInternal(int itemId, string filterValue, string sortColumn, + int startRow, int maximumRows) { - return new ResultObject(); + SystemFilesPaged result = new SystemFilesPaged(); + + try + { + // load organization + Organization org = OrganizationController.GetOrganization(itemId); + if (org == null) + { + return null; + } + + EnterpriseStorage es = GetEnterpriseStorage(GetEnterpriseStorageServiceID(org.PackageId)); + List folders = es.GetFolders(org.OrganizationId).Where(x => x.Name.Contains(filterValue)).ToList(); + + switch (sortColumn) + { + case "Size": + folders = folders.OrderBy(x => x.Size).ToList(); + break; + default: + folders = folders.OrderBy(x => x.Name).ToList(); + break; + } + + result.RecordsCount = folders.Count; + result.PageItems = folders.Skip(startRow).Take(maximumRows).ToArray(); + } + catch { /*skip exception*/} + + return result; } - - public static bool CheckFileServicesInstallation(int serviceId) + protected static ResultObject SetFolderWebDavRulesInternal(int itemId, string folder, ESPermission[] permission) { - EnterpriseStorage es = GetEnterpriseStorage(serviceId); - return es.CheckFileServicesInstallation(); + ResultObject result = TaskManager.StartResultTask("ENTERPRISE_STORAGE", "SET_WEBDAV_FOLDER_RULES"); + + try + { + // load organization + Organization org = OrganizationController.GetOrganization(itemId); + if (org == null) + { + return null; + } + + var rules = ConvertToWebDavRule(itemId,permission); + + EnterpriseStorage es = GetEnterpriseStorage(GetEnterpriseStorageServiceID(org.PackageId)); + + es.SetFolderWebDavRules(org.OrganizationId, folder, rules); + } + catch (Exception ex) + { + result.AddError("ENTERPRISE_STORAGE_SET_WEBDAV_FOLDER_RULES", ex); + } + finally + { + if (!result.IsSuccess) + { + TaskManager.CompleteResultTask(result); + } + else + { + TaskManager.CompleteResultTask(); + } + } + + return result; + } + + protected static WebDavFolderRule[] GetFolderWebDavRulesInternal(int itemId, string folder) + { + try + { + // load organization + Organization org = OrganizationController.GetOrganization(itemId); + if (org == null) + { + return null; + } + + EnterpriseStorage es = GetEnterpriseStorage(GetEnterpriseStorageServiceID(org.PackageId)); + + return es.GetFolderWebDavRules(org.OrganizationId, folder); + } + catch (Exception ex) + { + throw ex; + } + + } + + private static int GetEnterpriseStorageServiceID(int packageId) + { + return PackageController.GetPackageServiceId(packageId, ResourceGroups.EnterpriseStorage); + } + + private static EnterpriseStorage GetEnterpriseStorageByPackageId(int packageId) + { + var serviceId = PackageController.GetPackageServiceId(packageId, ResourceGroups.EnterpriseStorage); + + return GetEnterpriseStorage(serviceId); + } + + private static WebDavFolderRule[] ConvertToWebDavRule(int itemId, ESPermission[] permissions) + { + var rules = new List(); + + foreach (var permission in permissions) + { + var rule = new WebDavFolderRule(); + + var account = ObjectUtils.FillObjectFromDataReader(DataProvider.GetExchangeAccountByAccountName(itemId, permission.Account)); + + if (account.AccountType == ExchangeAccountType.SecurityGroup) + { + rule.Roles.Add(permission.Account); + } + else + { + rule.Users.Add(permission.Account); + } + + if (permission.Access.ToLower().Contains("read-only")) + { + rule.Read = true; + } + + if (permission.Access.ToLower().Contains("read-write")) + { + rule.Write = true; + rule.Read = true; + } + + rule.Pathes.Add("*"); + + rules.Add(rule); + } + + return rules.ToArray(); + } + + private static ESPermission[] ConvertToESPermission(WebDavFolderRule[] rules) + { + var permissions = new List(); + + foreach (var rule in rules) + { + var permission = new ESPermission(); + + permission.Account = rule.Users.Any() ? rule.Users[0] : rule.Roles[0]; + + permission.IsGroup = rule.Roles.Any(); + + if (rule.Read && !rule.Write) + { + permission.Access = "Read-Only"; + } + if (rule.Write) + { + permission.Access = "Read-Write"; + } + + permissions.Add(permission); + } + + return permissions.ToArray(); } } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Files/FilesController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Files/FilesController.cs index 913941f1..cffcc6db 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Files/FilesController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Files/FilesController.cs @@ -910,7 +910,7 @@ namespace WebsitePanel.EnterpriseServer return users.ToArray(); } - public static int SetFolderQuota(int packageId, string path, string driveName) + public static int SetFolderQuota(int packageId, string path, string driveName,string quotas) { // check account @@ -929,8 +929,8 @@ namespace WebsitePanel.EnterpriseServer // disk space quota // This gets all the disk space allocated for a specific customer - // It includes the package Add Ons * Quatity + Hosting Plan System disk space value. - QuotaValueInfo diskSpaceQuota = PackageController.GetPackageQuota(packageId, Quotas.OS_DISKSPACE); + // It includes the package Add Ons * Quatity + Hosting Plan System disk space value. //Quotas.OS_DISKSPACE + QuotaValueInfo diskSpaceQuota = PackageController.GetPackageQuota(packageId, quotas); #region figure Quota Unit @@ -965,7 +965,7 @@ namespace WebsitePanel.EnterpriseServer } - + public static int ApplyEnableHardQuotaFeature(int packageId) { if (SecurityContext.CheckAccount(DemandAccount.IsActive | DemandAccount.IsAdmin | DemandAccount.NotDemo) != 0) @@ -1014,7 +1014,7 @@ namespace WebsitePanel.EnterpriseServer continue; string homeFolder = FilesController.GetHomeFolder(childPackage.PackageId); - FilesController.SetFolderQuota(childPackage.PackageId, homeFolder, driveName); + FilesController.SetFolderQuota(childPackage.PackageId, homeFolder, driveName, Quotas.OS_DISKSPACE); } } catch (Exception ex) @@ -1027,7 +1027,6 @@ namespace WebsitePanel.EnterpriseServer } return 0; - } public static int DeleteDirectoryRecursive(int packageId, string rootPath) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs index 3fe17033..b805e19f 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs @@ -48,6 +48,7 @@ using System.IO; using System.Xml; using System.Xml.Serialization; using WebsitePanel.EnterpriseServer.Base.HostedSolution; +using WebsitePanel.Providers.OS; namespace WebsitePanel.EnterpriseServer { @@ -417,6 +418,36 @@ namespace WebsitePanel.EnterpriseServer }; PackageController.AddPackageItem(orgDomain); + + //Create Enterprise storage + + int esServiceId = PackageController.GetPackageServiceId(packageId, ResourceGroups.EnterpriseStorage); + + if (esServiceId != 0) + { + StringDictionary esSesstings = ServerController.GetServiceSettings(esServiceId); + + string usersHome = esSesstings["UsersHome"]; + string usersDomain = esSesstings["UsersDomain"]; + string locationDrive = esSesstings["LocationDrive"]; + + string homePath = string.Format("{0}:\\{1}",locationDrive, usersHome); + + EnterpriseStorageController.CreateFolder(itemId); + + WebServerController.AddWebDavDirectory(packageId, usersDomain, organizationId, homePath); + + int osId = PackageController.GetPackageServiceId(packageId, ResourceGroups.Os); + bool enableHardQuota = (esSesstings["enablehardquota"] != null) + ? bool.Parse(esSesstings["enablehardquota"]) + : false; + + if (enableHardQuota && osId != 0 && OperatingSystemController.CheckFileServicesInstallation(osId)) + { + FilesController.SetFolderQuota(packageId, Path.Combine(usersHome, organizationId), + locationDrive, Quotas.ENTERPRISESTORAGE_DISKSTORAGESPACE); + } + } } catch (Exception ex) { @@ -714,6 +745,26 @@ namespace WebsitePanel.EnterpriseServer TaskManager.WriteError(ex); } + //Cleanup Enterprise storage + int esId = PackageController.GetPackageServiceId(org.PackageId, ResourceGroups.EnterpriseStorage); + + if (esId != 0) + { + StringDictionary esSesstings = ServerController.GetServiceSettings(esId); + + string usersDomain = esSesstings["UsersDomain"]; + + try + { + WebServerController.DeleteWebDavDirectory(org.PackageId, usersDomain, org.OrganizationId); + EnterpriseStorageController.DeleteFolder(itemId); + } + catch (Exception ex) + { + successful = false; + TaskManager.WriteError(ex); + } + } //Cleanup Exchange try @@ -741,8 +792,6 @@ namespace WebsitePanel.EnterpriseServer TaskManager.WriteError(ex); } - - // delete organization domains List domains = GetOrganizationDomains(itemId); foreach (OrganizationDomainName domain in domains) @@ -764,7 +813,6 @@ namespace WebsitePanel.EnterpriseServer // delete meta-item PackageController.DeletePackageItem(itemId); - return successful ? 0 : BusinessErrorCodes.ERROR_ORGANIZATION_DELETE_SOME_PROBLEMS; } catch (Exception ex) @@ -946,7 +994,13 @@ namespace WebsitePanel.EnterpriseServer stats.CreatedLyncUsers = LyncController.GetLyncUsersCount(org.Id).Value; } + if (cntxTmp.Groups.ContainsKey(ResourceGroups.EnterpriseStorage)) + { + SystemFile[] folders = EnterpriseStorageController.GetFolders(itemId); + stats.CreatedEnterpriseStorageFolders = folders.Count(); + stats.UsedEnterpriseStorageSpace = (int)folders.Sum(x => x.Size); + } } else { @@ -998,6 +1052,14 @@ namespace WebsitePanel.EnterpriseServer { stats.CreatedLyncUsers += LyncController.GetLyncUsersCount(o.Id).Value; } + + if (cntxTmp.Groups.ContainsKey(ResourceGroups.EnterpriseStorage)) + { + SystemFile[] folders = EnterpriseStorageController.GetFolders(itemId); + + stats.CreatedEnterpriseStorageFolders = folders.Count(); + stats.UsedEnterpriseStorageSpace = (int)folders.Sum(x => x.Size); + } } } } @@ -1035,6 +1097,17 @@ namespace WebsitePanel.EnterpriseServer stats.AllocatedLyncUsers = cntx.Quotas[Quotas.LYNC_USERS].QuotaAllocatedValue; } + if (cntx.Groups.ContainsKey(ResourceGroups.EnterpriseStorage)) + { + stats.AllocatedEnterpriseStorageFolders = cntx.Quotas[Quotas.ENTERPRISESTORAGE_FOLDERS].QuotaAllocatedValue; + } + + + if (cntx.Groups.ContainsKey(ResourceGroups.EnterpriseStorage)) + { + stats.AllocatedEnterpriseStorageSpace = cntx.Quotas[Quotas.ENTERPRISESTORAGE_DISKSTORAGESPACE].QuotaAllocatedValue; + } + return stats; } catch (Exception ex) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Packages/PackageController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Packages/PackageController.cs index 522ab4e6..0e3e8efd 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Packages/PackageController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Packages/PackageController.cs @@ -1011,7 +1011,7 @@ namespace WebsitePanel.EnterpriseServer return; string homeFolder = FilesController.GetHomeFolder(packageId); - FilesController.SetFolderQuota(packageId, homeFolder, driveName); + FilesController.SetFolderQuota(packageId, homeFolder, driveName, Quotas.OS_DISKSPACE); } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Tasks/TaskManager.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Tasks/TaskManager.cs index 971ad59a..78abe2ac 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Tasks/TaskManager.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Tasks/TaskManager.cs @@ -741,7 +741,6 @@ namespace WebsitePanel.EnterpriseServer if (res != null) { res.IsSuccess = false; - if (!string.IsNullOrEmpty(errorCode)) res.ErrorCodes.Add(errorCode); } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/WebServers/WebServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/WebServers/WebServerController.cs index c46671c9..455e8af9 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/WebServers/WebServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/WebServers/WebServerController.cs @@ -1708,6 +1708,97 @@ namespace WebsitePanel.EnterpriseServer } } + public static int AddWebDavDirectory(int packageId, string site, string vdirName, string contentpath) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; + + // place log record + TaskManager.StartTask("ENTERPRISE_STORAGE", "ADD_VDIR", vdirName); + + TaskManager.WriteParameter("enterprise storage", site); + + try + { + // create virtual directory + WebVirtualDirectory dir = new WebVirtualDirectory(); + dir.Name = vdirName; + dir.ContentPath = Path.Combine(contentpath, vdirName); + + dir.EnableAnonymousAccess = false; + dir.EnableWindowsAuthentication = false; + dir.EnableBasicAuthentication = false; + + //dir.InstalledDotNetFramework = aspNet; + + dir.DefaultDocs = null; // inherit from service + dir.HttpRedirect = ""; + dir.HttpErrors = null; + dir.MimeMaps = null; + + int serviceId = PackageController.GetPackageServiceId(packageId, ResourceGroups.Web); + + if (serviceId == -1) + return serviceId; + + // create directory + WebServer web = new WebServer(); + ServiceProviderProxy.Init(web, serviceId); + if (web.VirtualDirectoryExists(site, vdirName)) + return BusinessErrorCodes.ERROR_VDIR_ALREADY_EXISTS; + + web.CreateVirtualDirectory(site, dir); + + return 0; + + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + public static int DeleteWebDavDirectory(int packageId, string site, string vdirName) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; + + // place log record + TaskManager.StartTask("ENTERPRISE_STORAGE", "DELETE_VDIR", vdirName); + + TaskManager.WriteParameter("enterprise storage", site); + + try + { + int serviceId = PackageController.GetPackageServiceId(packageId, ResourceGroups.Web); + + if (serviceId == -1) + return serviceId; + + // create directory + WebServer web = new WebServer(); + ServiceProviderProxy.Init(web, serviceId); + if (web.VirtualDirectoryExists(site, vdirName)) + web.DeleteVirtualDirectory(site, vdirName); + + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + public static int UpdateVirtualDirectory(int siteItemId, WebVirtualDirectory vdir) { // check account diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esEnterpriseStorage.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esEnterpriseStorage.asmx.cs index aa7f35d5..9f95cc40 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esEnterpriseStorage.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esEnterpriseStorage.asmx.cs @@ -42,6 +42,8 @@ using WebsitePanel.Providers.HostedSolution; using WebsitePanel.Providers.EnterpriseStorage; using WebsitePanel.Providers.ResultObjects; using WebsitePanel.Providers.OS; +using WebsitePanel.Providers.Web; +using WebsitePanel.EnterpriseServer.Base.HostedSolution; namespace WebsitePanel.EnterpriseServer { @@ -74,11 +76,10 @@ namespace WebsitePanel.EnterpriseServer } [WebMethod] - public ResultObject CreateEnterpriseFolder(int itemId, string folderName, long quota) + public ResultObject CreateEnterpriseFolder(int itemId, string folderName) { - return EnterpriseStorageController.CreateFolder(itemId, folderName, quota); + return EnterpriseStorageController.CreateFolder(itemId, folderName); } - [WebMethod] public ResultObject DeleteEnterpriseFolder(int itemId, string folderName) @@ -87,9 +88,27 @@ namespace WebsitePanel.EnterpriseServer } [WebMethod] - public ResultObject SetEnterpriseFolderQuota(int itemId, string folderName, long quota) + public ESPermission[] GetEnterpriseFolderPermissions(int itemId, string folderName) { - return EnterpriseStorageController.SetFolderQuota(itemId, folderName, quota); + return EnterpriseStorageController.GetFolderPermission(itemId, folderName); + } + + [WebMethod] + public ResultObject SetEnterpriseFolderPermissions(int itemId, string folderName, ESPermission[] permission) + { + return EnterpriseStorageController.SetFolderPermission(itemId, folderName, permission); + } + + [WebMethod] + public List SearchESAccounts(int itemId, string filterColumn, string filterValue, string sortColumn) + { + return EnterpriseStorageController.SearchESAccounts(itemId, filterColumn, filterValue, sortColumn); + } + + [WebMethod] + public SystemFilesPaged GetEnterpriseFoldersPaged(int itemId, string filterValue, string sortColumn, int startRow, int maximumRows) + { + return EnterpriseStorageController.GetEnterpriseFoldersPaged(itemId, filterValue, sortColumn, startRow, maximumRows); } } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/EnterpriseStorage/IEnterpriseStorage.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/EnterpriseStorage/IEnterpriseStorage.cs index 879d2021..00dea894 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/EnterpriseStorage/IEnterpriseStorage.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/EnterpriseStorage/IEnterpriseStorage.cs @@ -29,6 +29,7 @@ using System; using System.Collections; using WebsitePanel.Providers.OS; +using WebsitePanel.Providers.Web; namespace WebsitePanel.Providers.EnterpriseStorage { @@ -38,10 +39,11 @@ namespace WebsitePanel.Providers.EnterpriseStorage public interface IEnterpriseStorage { SystemFile[] GetFolders(string organizationId); - SystemFile GetFolder(string organizationId, string folder); + SystemFile GetFolder(string organizationId, string folderName); void CreateFolder(string organizationId, string folder); void DeleteFolder(string organizationId, string folder); - void SetFolderQuota(string organizationId, string folder, long quota); + bool SetFolderWebDavRules(string organizationId, string folder, WebDavFolderRule[] rules); + WebDavFolderRule[] GetFolderWebDavRules(string organizationId, string folder); bool CheckFileServicesInstallation(); } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/OS/SystemFile.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/OS/SystemFile.cs index c76cb539..89079c91 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/OS/SystemFile.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/OS/SystemFile.cs @@ -27,7 +27,7 @@ // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using System; - +using WebsitePanel.Providers.Web; namespace WebsitePanel.Providers.OS { /// @@ -44,6 +44,8 @@ namespace WebsitePanel.Providers.OS private long quota; private bool isEmpty; private bool isPublished; + private WebDavFolderRule[] rules; + private string url; public SystemFile() { @@ -108,5 +110,16 @@ namespace WebsitePanel.Providers.OS set { this.isPublished = value; } } + public WebDavFolderRule[] Rules + { + get { return this.rules; } + set { this.rules = value; } + } + + public string Url + { + get { return this.url; } + set { this.url = value; } + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/OS/SystemFilesPaged.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/OS/SystemFilesPaged.cs new file mode 100644 index 00000000..676c8238 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/OS/SystemFilesPaged.cs @@ -0,0 +1,20 @@ +namespace WebsitePanel.Providers.OS +{ + public class SystemFilesPaged + { + int recordsCount; + SystemFile[] pageItems; + + public int RecordsCount + { + get { return this.recordsCount; } + set { this.recordsCount = value; } + } + + public SystemFile[] PageItems + { + get { return this.pageItems; } + set { this.pageItems = value; } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/Web/IWebDav.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Web/IWebDav.cs new file mode 100644 index 00000000..e2536a40 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Web/IWebDav.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using WebsitePanel.Providers.HostedSolution; + +namespace WebsitePanel.Providers.Web +{ + public interface IWebDav + { + void CreateWebDavRule(string organizationId, string folder, WebDavFolderRule rule); + bool DeleteWebDavRule(string organizationId, string folder, WebDavFolderRule rule); + bool DeleteAllWebDavRules(string organizationId, string folder); + bool SetFolderWebDavRules(string organizationId, string folder, WebDavFolderRule[] newRules); + WebDavFolderRule[] GetFolderWebDavRules(string organizationId, string folder); + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/Web/WebDavFolderRule.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Web/WebDavFolderRule.cs new file mode 100644 index 00000000..44815d80 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Web/WebDavFolderRule.cs @@ -0,0 +1,60 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using WebsitePanel.Providers.HostedSolution; + +namespace WebsitePanel.Providers.Web +{ + + public enum WebDavAccess + { + Read = 1, + Source = 16, + Write = 2 + } + + [Serializable] + public class WebDavFolderRule + { + public List Pathes { get; set; } + public List Users { get; set; } + public List Roles { get; set; } + + public int AccessRights + { + get + { + int result = 0; + + if (Read) + { + result |= (int)WebDavAccess.Read; + } + + if (Write) + { + result |= (int)WebDavAccess.Write; + } + + if (Source) + { + result |= (int)WebDavAccess.Source; + } + + return result; + } + } + + public bool Read { get; set; } + public bool Write { get; set; } + public bool Source { get; set; } + + public WebDavFolderRule() + { + Pathes = new List(); + Users = new List(); + Roles = new List(); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj index ebac1619..03eb4bdd 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj @@ -105,6 +105,7 @@ + @@ -315,10 +316,12 @@ + + diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.EnterpriseStorage.Windows2012/WebsitePanel.Providers.EnterpriseStorage.Windows2012.csproj b/WebsitePanel/Sources/WebsitePanel.Providers.EnterpriseStorage.Windows2012/WebsitePanel.Providers.EnterpriseStorage.Windows2012.csproj index 14308c04..b73f0760 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.EnterpriseStorage.Windows2012/WebsitePanel.Providers.EnterpriseStorage.Windows2012.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Providers.EnterpriseStorage.Windows2012/WebsitePanel.Providers.EnterpriseStorage.Windows2012.csproj @@ -39,6 +39,22 @@ {684C932A-6C75-46AC-A327-F3689D89EB42} WebsitePanel.Providers.Base + + {9be0317d-e42e-4ff6-9a87-8c801f046ea1} + WebsitePanel.Providers.Web.IIs60 + + + {1b9dce85-c664-49fc-b6e1-86c63cab88d1} + WebsitePanel.Providers.Web.IIs70 + + + {6e348968-461d-45a1-b235-4f552947b9f1} + WebsitePanel.Providers.Web.IIs80 + + + {ce2df3d7-d6ff-48fa-b2ea-7b836fcbf698} + WebsitePanel.Providers.Web.WebDav + {E91E52F3-9555-4D00-B577-2B1DBDD87CA7} WebsitePanel.Server.Utils diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.EnterpriseStorage.Windows2012/Windows2012.cs b/WebsitePanel/Sources/WebsitePanel.Providers.EnterpriseStorage.Windows2012/Windows2012.cs index 4e919d44..7fcbaa3e 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.EnterpriseStorage.Windows2012/Windows2012.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.EnterpriseStorage.Windows2012/Windows2012.cs @@ -36,63 +36,127 @@ using Microsoft.Win32; using WebsitePanel.Server.Utils; using WebsitePanel.Providers.Utils; using WebsitePanel.Providers.OS; +using WebsitePanel.Providers.Web; namespace WebsitePanel.Providers.EnterpriseStorage { - public class Windows2012 : HostingServiceProviderBase + public class Windows2012 : HostingServiceProviderBase, IEnterpriseStorage { - #region Properties + protected string UsersHome { get { return FileUtils.EvaluateSystemVariables(ProviderSettings["UsersHome"]); } } - #endregion + protected string LocationDrive + { + get { return FileUtils.EvaluateSystemVariables(ProviderSettings["LocationDrive"]); } + } + + protected string UsersDomain + { + get { return FileUtils.EvaluateSystemVariables(ProviderSettings["UsersDomain"]); } + } + + #endregion #region Folders public SystemFile[] GetFolders(string organizationId) { + string rootPath = string.Format("{0}:\\{1}\\{2}", LocationDrive, UsersHome, organizationId); + + DirectoryInfo root = new DirectoryInfo(rootPath); + IWebDav webdav = new Web.WebDav(UsersDomain); ArrayList items = new ArrayList(); - DirectoryInfo root = new DirectoryInfo(string.Format("{0}\\{1}", UsersHome, organizationId)); // get directories DirectoryInfo[] dirs = root.GetDirectories(); foreach (DirectoryInfo dir in dirs) { - string fullName = System.IO.Path.Combine(string.Format("{0}\\{1}", UsersHome, organizationId), dir.Name); - SystemFile fi = new SystemFile(dir.Name, fullName, true, 0, dir.CreationTime, dir.LastWriteTime); - items.Add(fi); + string fullName = System.IO.Path.Combine(rootPath, dir.Name); + + SystemFile folder = new SystemFile(dir.Name, fullName, true, + FileUtils.BytesToMb(FileUtils.CalculateFolderSize(dir.FullName)), dir.CreationTime, dir.LastWriteTime); + + folder.Url = string.Format("https://{0}/{1}/{2}", UsersDomain, organizationId, dir.Name); + folder.Rules = webdav.GetFolderWebDavRules(organizationId, dir.Name); + + items.Add(folder); // check if the directory is empty - fi.IsEmpty = (Directory.GetFileSystemEntries(fullName).Length == 0); + folder.IsEmpty = (Directory.GetFileSystemEntries(fullName).Length == 0); } return (SystemFile[])items.ToArray(typeof(SystemFile)); } - public SystemFile GetFolder(string organizationId, string folder) + public SystemFile GetFolder(string organizationId, string folderName) { - DirectoryInfo root = new DirectoryInfo(string.Format("{0}\\{1}\\{2}", UsersHome, organizationId, folder)); - string fullName = string.Format("{0}\\{1}\\{2}", UsersHome, organizationId, folder); - return new SystemFile(root.Name, fullName, true, 0, root.CreationTime, root.LastWriteTime); + string fullName = string.Format("{0}:\\{1}\\{2}\\{3}", LocationDrive, UsersHome, organizationId, folderName); + + DirectoryInfo root = new DirectoryInfo(fullName); + + SystemFile folder = new SystemFile(root.Name, fullName, true, + FileUtils.BytesToMb( FileUtils.CalculateFolderSize(root.FullName)), root.CreationTime, root.LastWriteTime); + + folder.Url = string.Format("https://{0}/{1}/{2}", UsersDomain, organizationId, folderName); + folder.Rules = GetFolderWebDavRules(organizationId, folderName); + + return folder; } public void CreateFolder(string organizationId, string folder) { - FileUtils.CreateDirectory(string.Format("{0}\\{1}\\{2}", UsersHome, organizationId, folder)); + FileUtils.CreateDirectory(string.Format("{0}:\\{1}\\{2}\\{3}", LocationDrive, UsersHome, organizationId, folder)); } public void DeleteFolder(string organizationId, string folder) { - FileUtils.DeleteDirectoryRecursive(string.Format("{0}\\{1}\\{2}", UsersHome, organizationId, folder)); + string rootPath = string.Format("{0}:\\{1}\\{2}\\{3}", LocationDrive, UsersHome, organizationId, folder); + + DirectoryInfo treeRoot = new DirectoryInfo(rootPath); + + if (treeRoot.Exists) + { + DirectoryInfo[] dirs = treeRoot.GetDirectories(); + while (dirs.Length > 0) + { + foreach (DirectoryInfo dir in dirs) + DeleteFolder(organizationId, folder != string.Empty ? string.Format("{0}\\{1}", folder, dir.Name) : dir.Name); + + dirs = treeRoot.GetDirectories(); + } + + // DELETE THE FILES UNDER THE CURRENT ROOT + string[] files = Directory.GetFiles(treeRoot.FullName); + foreach (string file in files) + { + File.SetAttributes(file, FileAttributes.Normal); + File.Delete(file); + } + + IWebDav webdav = new WebDav(UsersDomain); + + webdav.DeleteAllWebDavRules(organizationId, folder); + + Directory.Delete(treeRoot.FullName, true); + } } - public void SetFolderQuota(string organizationId, string folder, long quota) + public bool SetFolderWebDavRules(string organizationId, string folder, WebDavFolderRule[] rules) { + IWebDav webdav = new WebDav(UsersDomain); + return webdav.SetFolderWebDavRules(organizationId, folder, rules); + } + public WebDavFolderRule[] GetFolderWebDavRules(string organizationId, string folder) + { + IWebDav webdav = new WebDav(UsersDomain); + + return webdav.GetFolderWebDavRules(organizationId, folder); } public bool CheckFileServicesInstallation() @@ -103,6 +167,7 @@ namespace WebsitePanel.Providers.EnterpriseStorage #endregion #region HostingServiceProvider methods + public override string[] Install() { List messages = new List(); @@ -177,5 +242,6 @@ namespace WebsitePanel.Providers.EnterpriseStorage Server.Utils.OS.WindowsVersion version = WebsitePanel.Server.Utils.OS.GetVersion(); return version == WebsitePanel.Server.Utils.OS.WindowsVersion.WindowsServer2012; } + } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Web.WebDav/Properties/AssemblyInfo.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Web.WebDav/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..143b2f15 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Web.WebDav/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("WebsitePanel.Providers.Web.WebDav")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("WebsitePanel.Providers.Web.WebDav")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2013")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("2682cc06-0b09-4b90-80a9-ffb9e936f114")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Web.WebDav/WebDav.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Web.WebDav/WebDav.cs new file mode 100644 index 00000000..3c60b5f6 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Web.WebDav/WebDav.cs @@ -0,0 +1,147 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using WebsitePanel.Providers; +using WebsitePanel.Providers.Web; +using Microsoft.Web.Administration; +using WebsitePanel.Providers.Web.Extensions; + +namespace WebsitePanel.Providers.Web +{ + public class WebDav : IWebDav + { + #region Fields + + private string _usersDomain; + + #endregion + + public WebDav(string domain) + { + _usersDomain = domain; + } + + public void CreateWebDavRule(string organizationId, string folder, WebDavFolderRule rule) + { + using (ServerManager serverManager = new ServerManager()) + { + Configuration config = serverManager.GetApplicationHostConfiguration(); + + ConfigurationSection authoringRulesSection = config.GetSection("system.webServer/webdav/authoringRules", string.Format("{0}/{1}/{2}", _usersDomain, organizationId, folder)); + + ConfigurationElementCollection authoringRulesCollection = authoringRulesSection.GetCollection(); + + ConfigurationElement addElement = authoringRulesCollection.CreateElement("add"); + + if (rule.Users.Any()) + { + addElement["users"] = string.Join(", ", rule.Users.Select(x => x.ToString()).ToArray()); + } + + if (rule.Roles.Any()) + { + addElement["roles"] = string.Join(", ", rule.Roles.Select(x => x.ToString()).ToArray()); + } + + if (rule.Pathes.Any()) + { + addElement["path"] = string.Join(", ", rule.Pathes.ToArray()); + } + + addElement["access"] = rule.AccessRights; + authoringRulesCollection.Add(addElement); + + serverManager.CommitChanges(); + } + } + public bool DeleteWebDavRule(string organizationId, string folder, WebDavFolderRule rule) + { + using (ServerManager serverManager = new ServerManager()) + { + Configuration config = serverManager.GetApplicationHostConfiguration(); + + ConfigurationSection authoringRulesSection = config.GetSection("system.webServer/webdav/authoringRules", string.Format("{0}/{1}/{2}", _usersDomain, organizationId, folder)); + + ConfigurationElementCollection authoringRulesCollection = authoringRulesSection.GetCollection(); + + var toDeleteRule = authoringRulesCollection.FindWebDavRule(rule); + + if (toDeleteRule != null) + { + authoringRulesCollection.Remove(toDeleteRule); + serverManager.CommitChanges(); + return true; + } + return false; + } + } + + public bool SetFolderWebDavRules(string organizationId, string folder, WebDavFolderRule[] newRules) + { + try + { + if (DeleteAllWebDavRules(organizationId, folder)) + { + if (newRules != null) + { + foreach (var rule in newRules) + { + CreateWebDavRule(organizationId, folder, rule); + } + } + + return true; + } + } + catch { } + return false; + } + + public WebDavFolderRule[] GetFolderWebDavRules(string organizationId, string folder) + { + using (ServerManager serverManager = new ServerManager()) + { + Configuration config = serverManager.GetApplicationHostConfiguration(); + + ConfigurationSection authoringRulesSection = config.GetSection("system.webServer/webdav/authoringRules", string.Format("{0}/{1}/{2}", _usersDomain, organizationId, folder)); + + ConfigurationElementCollection authoringRulesCollection = authoringRulesSection.GetCollection(); + + var rules = new List(); + + foreach (var rule in authoringRulesCollection) + { + rules.Add(rule.ToWebDavFolderRule()); + } + + return rules.ToArray(); + } + } + + + public bool DeleteAllWebDavRules(string organizationId, string folder) + { + try + { + using (ServerManager serverManager = new ServerManager()) + { + + Configuration config = serverManager.GetApplicationHostConfiguration(); + //ConfigurationSection authoringRulesSection = config.GetSection("system.webServer/webdav/authoringRules", string.Format("{0}/{1}/{2}", _usersDomain, organizationId, folder)); + + //ConfigurationElementCollection authoringRulesCollection = authoringRulesSection.GetCollection(); + //authoringRulesCollection.Clear(); + + config.RemoveLocationPath(string.Format("{0}/{1}/{2}", _usersDomain, organizationId, folder)); + serverManager.CommitChanges(); + return true; + } + } + catch + { + return false; + } + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Web.WebDav/WebDavExtensions.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Web.WebDav/WebDavExtensions.cs new file mode 100644 index 00000000..4a566c87 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Web.WebDav/WebDavExtensions.cs @@ -0,0 +1,91 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Microsoft.Web.Administration; + +namespace WebsitePanel.Providers.Web.Extensions +{ + public static class WebDavExtensions + { + public static WebDavFolderRule ToWebDavFolderRule(this ConfigurationElement element) + { + var result = new WebDavFolderRule(); + + if(!string.IsNullOrEmpty(element["users"].ToString())) + { + var users = element["users"].ToString().Split(','); + + foreach (var user in users) + { + result.Users.Add(user.Trim()); + } + } + + if (!string.IsNullOrEmpty(element["roles"].ToString())) + { + var roles = element["roles"].ToString().Split(','); + + foreach (var role in roles) + { + result.Roles.Add(role.Trim()); + } + } + + if (!string.IsNullOrEmpty(element["path"].ToString())) + { + var pathes = element["path"].ToString().Split(','); + + foreach (var path in pathes) + { + result.Pathes.Add(path.Trim()); + } + } + + var access = (int)element["access"] ; + + result.Write = (access & (int)WebDavAccess.Write) == (int)WebDavAccess.Write; + result.Read = (access & (int)WebDavAccess.Read) == (int)WebDavAccess.Read; + result.Source = (access & (int)WebDavAccess.Source) == (int)WebDavAccess.Source; + + return result; + } + + public static bool ExistsWebDavRule(this ConfigurationElementCollection collection, WebDavFolderRule settings) + { + return collection.FindWebDavRule(settings) != null; + } + + public static ConfigurationElement FindWebDavRule(this ConfigurationElementCollection collection, WebDavFolderRule settings) + { + return collection.FirstOrDefault(x => + { + var s = x["users"].ToString(); + if (settings.Users.Any() + && x["users"].ToString() != string.Join(", ", settings.Users.ToArray())) + { + return false; + } + + if (settings.Roles.Any() + && x["roles"].ToString() != string.Join(", ", settings.Roles.ToArray())) + { + return false; + } + + if (settings.Pathes.Any() + && x["path"].ToString() != string.Join(", ", settings.Pathes.ToArray())) + { + return false; + } + + //if ((int)x["access"] != settings.AccessRights) + //{ + // return false; + //} + + return true; + }); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Web.WebDav/WebsitePanel.Providers.Web.WebDav.csproj b/WebsitePanel/Sources/WebsitePanel.Providers.Web.WebDav/WebsitePanel.Providers.Web.WebDav.csproj new file mode 100644 index 00000000..79dfc0f3 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Web.WebDav/WebsitePanel.Providers.Web.WebDav.csproj @@ -0,0 +1,63 @@ + + + + + Debug + AnyCPU + {CE2DF3D7-D6FF-48FA-B2EA-7B836FCBF698} + Library + Properties + WebsitePanel.Providers.Web.WebDav + WebsitePanel.Providers.Web.WebDav + v3.5 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + ..\..\Lib\References\Microsoft\Microsoft.Web.Administration.dll + + + + + + + + + + + + + + + + {684c932a-6c75-46ac-a327-f3689d89eb42} + WebsitePanel.Providers.Base + + + + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/EnterpriseStorageProxy.cs b/WebsitePanel/Sources/WebsitePanel.Server.Client/EnterpriseStorageProxy.cs index 15aa090c..f4f10332 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.Client/EnterpriseStorageProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/EnterpriseStorageProxy.cs @@ -25,11 +25,10 @@ // 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. - //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:2.0.50727.6407 +// Runtime Version:2.0.50727.4984 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -37,418 +36,597 @@ //------------------------------------------------------------------------------ // -// This source code was auto-generated by wsdl, Version=2.0.50727.3038. +// This source code was auto-generated by wsdl, Version=2.0.50727.42. // -using WebsitePanel.Providers.Common; -using WebsitePanel.Providers.ResultObjects; using WebsitePanel.Providers.OS; +using WebsitePanel.Providers.Web; -namespace WebsitePanel.Providers.EnterpriseStorage { +namespace WebsitePanel.Providers.EnterpriseStorage +{ using System.Xml.Serialization; using System.Web.Services; using System.ComponentModel; using System.Web.Services.Protocols; using System; using System.Diagnostics; - - + + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - [System.Web.Services.WebServiceBindingAttribute(Name="EnterpriseStorageSoap", Namespace="http://smbsaas/websitepanel/server/")] + [System.Web.Services.WebServiceBindingAttribute(Name = "EnterpriseStorageSoap", Namespace = "http://smbsaas/websitepanel/server/")] [System.Xml.Serialization.XmlIncludeAttribute(typeof(ServiceProviderItem))] - public partial class EnterpriseStorage : Microsoft.Web.Services3.WebServicesClientProtocol { - + public partial class EnterpriseStorage : Microsoft.Web.Services3.WebServicesClientProtocol + { + public ServiceProviderSettingsSoapHeader ServiceProviderSettingsSoapHeaderValue; - + private System.Threading.SendOrPostCallback GetFoldersOperationCompleted; - + private System.Threading.SendOrPostCallback GetFolderOperationCompleted; - + private System.Threading.SendOrPostCallback CreateFolderOperationCompleted; - + private System.Threading.SendOrPostCallback DeleteFolderOperationCompleted; - - private System.Threading.SendOrPostCallback SetFolderQuotaOperationCompleted; - + private System.Threading.SendOrPostCallback CheckFileServicesInstallationOperationCompleted; - + + private System.Threading.SendOrPostCallback SetFolderWebDavRulesOperationCompleted; + + private System.Threading.SendOrPostCallback GetFolderWebDavRulesOperationCompleted; + /// - public EnterpriseStorage() { + public EnterpriseStorage() + { this.Url = "http://localhost:9003/EnterpriseStorage.asmx"; } - + /// public event GetFoldersCompletedEventHandler GetFoldersCompleted; - + /// public event GetFolderCompletedEventHandler GetFolderCompleted; - + /// public event CreateFolderCompletedEventHandler CreateFolderCompleted; - + /// public event DeleteFolderCompletedEventHandler DeleteFolderCompleted; - - /// - public event SetFolderQuotaCompletedEventHandler SetFolderQuotaCompleted; - + /// public event CheckFileServicesInstallationCompletedEventHandler CheckFileServicesInstallationCompleted; - + + /// + public event SetFolderWebDavRulesCompletedEventHandler SetFolderWebDavRulesCompleted; + + /// + public event GetFolderWebDavRulesCompletedEventHandler GetFolderWebDavRulesCompleted; + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetFolders", 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 SystemFile[] GetFolders(string organizationId) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetFolders", 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 SystemFile[] GetFolders(string organizationId) + { object[] results = this.Invoke("GetFolders", new object[] { organizationId}); return ((SystemFile[])(results[0])); } - + /// - public System.IAsyncResult BeginGetFolders(string organizationId, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginGetFolders(string organizationId, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("GetFolders", new object[] { organizationId}, callback, asyncState); } - + /// - public SystemFile[] EndGetFolders(System.IAsyncResult asyncResult) { + public SystemFile[] EndGetFolders(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((SystemFile[])(results[0])); } - + /// - public void GetFoldersAsync(string organizationId) { + public void GetFoldersAsync(string organizationId) + { this.GetFoldersAsync(organizationId, null); } - + /// - public void GetFoldersAsync(string organizationId, object userState) { - if ((this.GetFoldersOperationCompleted == null)) { + public void GetFoldersAsync(string organizationId, object userState) + { + if ((this.GetFoldersOperationCompleted == null)) + { this.GetFoldersOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetFoldersOperationCompleted); } this.InvokeAsync("GetFolders", new object[] { organizationId}, this.GetFoldersOperationCompleted, userState); } - - private void OnGetFoldersOperationCompleted(object arg) { - if ((this.GetFoldersCompleted != null)) { + + private void OnGetFoldersOperationCompleted(object arg) + { + if ((this.GetFoldersCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetFoldersCompleted(this, new GetFoldersCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetFolder", 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 SystemFile GetFolder(string organizationId, string folder) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetFolder", 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 SystemFile GetFolder(string organizationId, string folder) + { object[] results = this.Invoke("GetFolder", new object[] { organizationId, folder}); return ((SystemFile)(results[0])); } - + /// - public System.IAsyncResult BeginGetFolder(string organizationId, string folder, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginGetFolder(string organizationId, string folder, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("GetFolder", new object[] { organizationId, folder}, callback, asyncState); } - + /// - public SystemFile EndGetFolder(System.IAsyncResult asyncResult) { + public SystemFile EndGetFolder(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((SystemFile)(results[0])); } - + /// - public void GetFolderAsync(string organizationId, string folder) { + public void GetFolderAsync(string organizationId, string folder) + { this.GetFolderAsync(organizationId, folder, null); } - + /// - public void GetFolderAsync(string organizationId, string folder, object userState) { - if ((this.GetFolderOperationCompleted == null)) { + public void GetFolderAsync(string organizationId, string folder, object userState) + { + if ((this.GetFolderOperationCompleted == null)) + { this.GetFolderOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetFolderOperationCompleted); } this.InvokeAsync("GetFolder", new object[] { organizationId, folder}, this.GetFolderOperationCompleted, userState); } - - private void OnGetFolderOperationCompleted(object arg) { - if ((this.GetFolderCompleted != null)) { + + private void OnGetFolderOperationCompleted(object arg) + { + if ((this.GetFolderCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.GetFolderCompleted(this, new GetFolderCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateFolder", 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 CreateFolder(string organizationId, string folder) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CreateFolder", 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 CreateFolder(string organizationId, string folder) + { this.Invoke("CreateFolder", new object[] { organizationId, folder}); } - + /// - public System.IAsyncResult BeginCreateFolder(string organizationId, string folder, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginCreateFolder(string organizationId, string folder, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("CreateFolder", new object[] { organizationId, folder}, callback, asyncState); } - + /// - public void EndCreateFolder(System.IAsyncResult asyncResult) { + public void EndCreateFolder(System.IAsyncResult asyncResult) + { this.EndInvoke(asyncResult); } - + /// - public void CreateFolderAsync(string organizationId, string folder) { + public void CreateFolderAsync(string organizationId, string folder) + { this.CreateFolderAsync(organizationId, folder, null); } - + /// - public void CreateFolderAsync(string organizationId, string folder, object userState) { - if ((this.CreateFolderOperationCompleted == null)) { + public void CreateFolderAsync(string organizationId, string folder, object userState) + { + if ((this.CreateFolderOperationCompleted == null)) + { this.CreateFolderOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateFolderOperationCompleted); } this.InvokeAsync("CreateFolder", new object[] { organizationId, folder}, this.CreateFolderOperationCompleted, userState); } - - private void OnCreateFolderOperationCompleted(object arg) { - if ((this.CreateFolderCompleted != null)) { + + private void OnCreateFolderOperationCompleted(object arg) + { + if ((this.CreateFolderCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.CreateFolderCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/DeleteFolder", 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 DeleteFolder(string organizationId, string folder) { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/DeleteFolder", 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 DeleteFolder(string organizationId, string folder) + { this.Invoke("DeleteFolder", new object[] { organizationId, folder}); } - + /// - public System.IAsyncResult BeginDeleteFolder(string organizationId, string folder, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginDeleteFolder(string organizationId, string folder, System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("DeleteFolder", new object[] { organizationId, folder}, callback, asyncState); } - + /// - public void EndDeleteFolder(System.IAsyncResult asyncResult) { + public void EndDeleteFolder(System.IAsyncResult asyncResult) + { this.EndInvoke(asyncResult); } - + /// - public void DeleteFolderAsync(string organizationId, string folder) { + public void DeleteFolderAsync(string organizationId, string folder) + { this.DeleteFolderAsync(organizationId, folder, null); } - + /// - public void DeleteFolderAsync(string organizationId, string folder, object userState) { - if ((this.DeleteFolderOperationCompleted == null)) { + public void DeleteFolderAsync(string organizationId, string folder, object userState) + { + if ((this.DeleteFolderOperationCompleted == null)) + { this.DeleteFolderOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteFolderOperationCompleted); } this.InvokeAsync("DeleteFolder", new object[] { organizationId, folder}, this.DeleteFolderOperationCompleted, userState); } - - private void OnDeleteFolderOperationCompleted(object arg) { - if ((this.DeleteFolderCompleted != null)) { + + private void OnDeleteFolderOperationCompleted(object arg) + { + if ((this.DeleteFolderCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.DeleteFolderCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SetFolderQuota", 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 SetFolderQuota(string organizationId, string folder, long quota) { - this.Invoke("SetFolderQuota", new object[] { - organizationId, - folder, - quota}); - } - - /// - public System.IAsyncResult BeginSetFolderQuota(string organizationId, string folder, long quota, System.AsyncCallback callback, object asyncState) { - return this.BeginInvoke("SetFolderQuota", new object[] { - organizationId, - folder, - quota}, callback, asyncState); - } - - /// - public void EndSetFolderQuota(System.IAsyncResult asyncResult) { - this.EndInvoke(asyncResult); - } - - /// - public void SetFolderQuotaAsync(string organizationId, string folder, long quota) { - this.SetFolderQuotaAsync(organizationId, folder, quota, null); - } - - /// - public void SetFolderQuotaAsync(string organizationId, string folder, long quota, object userState) { - if ((this.SetFolderQuotaOperationCompleted == null)) { - this.SetFolderQuotaOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetFolderQuotaOperationCompleted); - } - this.InvokeAsync("SetFolderQuota", new object[] { - organizationId, - folder, - quota}, this.SetFolderQuotaOperationCompleted, userState); - } - - private void OnSetFolderQuotaOperationCompleted(object arg) { - if ((this.SetFolderQuotaCompleted != null)) { - System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); - this.SetFolderQuotaCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); - } - } - - /// - [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] - [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CheckFileServicesInstallation", 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 bool CheckFileServicesInstallation() { + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CheckFileServicesInstallation", 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 bool CheckFileServicesInstallation() + { object[] results = this.Invoke("CheckFileServicesInstallation", new object[0]); return ((bool)(results[0])); } - + /// - public System.IAsyncResult BeginCheckFileServicesInstallation(System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginCheckFileServicesInstallation(System.AsyncCallback callback, object asyncState) + { return this.BeginInvoke("CheckFileServicesInstallation", new object[0], callback, asyncState); } - + /// - public bool EndCheckFileServicesInstallation(System.IAsyncResult asyncResult) { + public bool EndCheckFileServicesInstallation(System.IAsyncResult asyncResult) + { object[] results = this.EndInvoke(asyncResult); return ((bool)(results[0])); } - + /// - public void CheckFileServicesInstallationAsync() { + public void CheckFileServicesInstallationAsync() + { this.CheckFileServicesInstallationAsync(null); } - + /// - public void CheckFileServicesInstallationAsync(object userState) { - if ((this.CheckFileServicesInstallationOperationCompleted == null)) { + public void CheckFileServicesInstallationAsync(object userState) + { + if ((this.CheckFileServicesInstallationOperationCompleted == null)) + { this.CheckFileServicesInstallationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCheckFileServicesInstallationOperationCompleted); } this.InvokeAsync("CheckFileServicesInstallation", new object[0], this.CheckFileServicesInstallationOperationCompleted, userState); } - - private void OnCheckFileServicesInstallationOperationCompleted(object arg) { - if ((this.CheckFileServicesInstallationCompleted != null)) { + + private void OnCheckFileServicesInstallationOperationCompleted(object arg) + { + if ((this.CheckFileServicesInstallationCompleted != null)) + { System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); this.CheckFileServicesInstallationCompleted(this, new CheckFileServicesInstallationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); } } - + /// - public new void CancelAsync(object userState) { + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SetFolderWebDavRules", 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 bool SetFolderWebDavRules(string organizationId, string folder, WebDavFolderRule[] rules) + { + object[] results = this.Invoke("SetFolderWebDavRules", new object[] { + organizationId, + folder, + rules}); + return ((bool)(results[0])); + } + + /// + public System.IAsyncResult BeginSetFolderWebDavRules(string organizationId, string folder, WebDavFolderRule[] rules, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("SetFolderWebDavRules", new object[] { + organizationId, + folder, + rules}, callback, asyncState); + } + + /// + public bool EndSetFolderWebDavRules(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((bool)(results[0])); + } + + /// + public void SetFolderWebDavRulesAsync(string organizationId, string folder, WebDavFolderRule[] rules) + { + this.SetFolderWebDavRulesAsync(organizationId, folder, rules, null); + } + + /// + public void SetFolderWebDavRulesAsync(string organizationId, string folder, WebDavFolderRule[] rules, object userState) + { + if ((this.SetFolderWebDavRulesOperationCompleted == null)) + { + this.SetFolderWebDavRulesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetFolderWebDavRulesOperationCompleted); + } + this.InvokeAsync("SetFolderWebDavRules", new object[] { + organizationId, + folder, + rules}, this.SetFolderWebDavRulesOperationCompleted, userState); + } + + private void OnSetFolderWebDavRulesOperationCompleted(object arg) + { + if ((this.SetFolderWebDavRulesCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.SetFolderWebDavRulesCompleted(this, new SetFolderWebDavRulesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetFolderWebDavRules", 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 WebDavFolderRule[] GetFolderWebDavRules(string organizationId, string folder) + { + object[] results = this.Invoke("GetFolderWebDavRules", new object[] { + organizationId, + folder}); + return ((WebDavFolderRule[])(results[0])); + } + + /// + public System.IAsyncResult BeginGetFolderWebDavRules(string organizationId, string folder, System.AsyncCallback callback, object asyncState) + { + return this.BeginInvoke("GetFolderWebDavRules", new object[] { + organizationId, + folder}, callback, asyncState); + } + + /// + public WebDavFolderRule[] EndGetFolderWebDavRules(System.IAsyncResult asyncResult) + { + object[] results = this.EndInvoke(asyncResult); + return ((WebDavFolderRule[])(results[0])); + } + + /// + public void GetFolderWebDavRulesAsync(string organizationId, string folder) + { + this.GetFolderWebDavRulesAsync(organizationId, folder, null); + } + + /// + public void GetFolderWebDavRulesAsync(string organizationId, string folder, object userState) + { + if ((this.GetFolderWebDavRulesOperationCompleted == null)) + { + this.GetFolderWebDavRulesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetFolderWebDavRulesOperationCompleted); + } + this.InvokeAsync("GetFolderWebDavRules", new object[] { + organizationId, + folder}, this.GetFolderWebDavRulesOperationCompleted, userState); + } + + private void OnGetFolderWebDavRulesOperationCompleted(object arg) + { + if ((this.GetFolderWebDavRulesCompleted != null)) + { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.GetFolderWebDavRulesCompleted(this, new GetFolderWebDavRulesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + public new void CancelAsync(object userState) + { base.CancelAsync(userState); } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void GetFoldersCompletedEventHandler(object sender, GetFoldersCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetFoldersCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class GetFoldersCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal GetFoldersCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal GetFoldersCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public SystemFile[] Result { - get { + public SystemFile[] Result + { + get + { this.RaiseExceptionIfNecessary(); return ((SystemFile[])(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void GetFolderCompletedEventHandler(object sender, GetFolderCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class GetFolderCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class GetFolderCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal GetFolderCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal GetFolderCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public SystemFile Result { - get { + public SystemFile Result + { + get + { this.RaiseExceptionIfNecessary(); return ((SystemFile)(this.results[0])); } } } - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void CreateFolderCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void DeleteFolderCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] - public delegate void SetFolderQuotaCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); - - /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] public delegate void CheckFileServicesInstallationCompletedEventHandler(object sender, CheckFileServicesInstallationCompletedEventArgs e); - + /// - [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] - public partial class CheckFileServicesInstallationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { - + public partial class CheckFileServicesInstallationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + private object[] results; - - internal CheckFileServicesInstallationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : - base(exception, cancelled, userState) { + + internal CheckFileServicesInstallationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { this.results = results; } - + /// - public bool Result { - get { + public bool Result + { + get + { this.RaiseExceptionIfNecessary(); return ((bool)(this.results[0])); } } } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void SetFolderWebDavRulesCompletedEventHandler(object sender, SetFolderWebDavRulesCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class SetFolderWebDavRulesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal SetFolderWebDavRulesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public bool Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((bool)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetFolderWebDavRulesCompletedEventHandler(object sender, GetFolderWebDavRulesCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class GetFolderWebDavRulesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs + { + + private object[] results; + + internal GetFolderWebDavRulesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) + { + this.results = results; + } + + /// + public WebDavFolderRule[] Result + { + get + { + this.RaiseExceptionIfNecessary(); + return ((WebDavFolderRule[])(this.results[0])); + } + } + } } diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/WebsitePanel.Server.Client.csproj b/WebsitePanel/Sources/WebsitePanel.Server.Client/WebsitePanel.Server.Client.csproj index aa60aede..751a8fe5 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.Client/WebsitePanel.Server.Client.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/WebsitePanel.Server.Client.csproj @@ -127,6 +127,9 @@ true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ShowProgressDialog('Creating folder ...'); + + + Create Folder + + + + + + Folder Name: * + + + Folders + + + Enter Folder Name + + + * + + + Create New Folder In + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/EnterpriseStorageFolderGeneralSettings.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/EnterpriseStorageFolderGeneralSettings.ascx.resx new file mode 100644 index 00000000..1dabc5e0 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/EnterpriseStorageFolderGeneralSettings.ascx.resx @@ -0,0 +1,150 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + ShowProgressDialog('Updating folder settings...'); + + + Save Changes + + + Permissions + + + Notes: + + + Edit Folder + + + Folders + + + Enter Folder Name + + + * + + + Folder Name: + + + Folder Url: + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/EnterpriseStorageFolders.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/EnterpriseStorageFolders.ascx.resx new file mode 100644 index 00000000..0dd3e88c --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/EnterpriseStorageFolders.ascx.resx @@ -0,0 +1,156 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Create New Folder + + + if(!confirm('Are you sure you want to delete selected folder?')) return false; else ShowProgressDialog('Deleting Folder...'); + + + Delete + + + Delete Folder + + + No folders have been added yet. To add a new folder click "Create New Folder" button. + + + + + + Total Folders Allocated: + + + Folders + + + Folder Name + + + Folder Size + + + Folders + + + Url + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageCreateFolder.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageCreateFolder.ascx new file mode 100644 index 00000000..af4e4960 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageCreateFolder.ascx @@ -0,0 +1,46 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EnterpriseStorageCreateFolder.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.EnterpriseStorageCreateFolder" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/EmailAddress.ascx" TagName="EmailAddress" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + +
+
+
+ +
+
+ +
+
+
+
+ + + + +
+
+ + + + + + +
+ + +
+
+ + +
+
+
+
+
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageCreateFolder.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageCreateFolder.ascx.cs new file mode 100644 index 00000000..45fcd5dd --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageCreateFolder.ascx.cs @@ -0,0 +1,72 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +using System; +using WebsitePanel.EnterpriseServer; +using WebsitePanel.Providers.Common; +using WebsitePanel.Providers.HostedSolution; + +namespace WebsitePanel.Portal.ExchangeServer +{ + public partial class EnterpriseStorageCreateFolder : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + Organization org = ES.Services.Organizations.GetOrganization(PanelRequest.ItemID); + + litRootFolder.Text = org.OrganizationId; + } + } + + protected void btnCreate_Click(object sender, EventArgs e) + { + if (!Page.IsValid) + return; + try + { + ResultObject result = ES.Services.EnterpriseStorage.CreateEnterpriseFolder(PanelRequest.ItemID, txtFolderName.Text); + + if (!result.IsSuccess && result.ErrorCodes.Count > 0) + { + messageBox.ShowMessage(result, "ENTERPRISE_STORAGE_FOLDER", "EnterpriseStorage"); + return; + } + + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "enterprisestorage_folder_settings", + "FolderID=" + txtFolderName.Text, + "ItemID=" + PanelRequest.ItemID)); + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("ENTERPRISE_STORAGE_CREATE_FOLDER", ex); + } + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageCreateFolder.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageCreateFolder.ascx.designer.cs new file mode 100644 index 00000000..c701ed96 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageCreateFolder.ascx.designer.cs @@ -0,0 +1,123 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.ExchangeServer { + + + public partial class EnterpriseStorageCreateFolder { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Menu menu; + + /// + /// imgESS control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgESS; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// litRootFolder control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litRootFolder; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// locFolderName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locFolderName; + + /// + /// txtFolderName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtFolderName; + + /// + /// valRequireFolderName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireFolderName; + + /// + /// btnCreate control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCreate; + + /// + /// valSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ValidationSummary valSummary; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageFolderGeneralSettings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageFolderGeneralSettings.ascx new file mode 100644 index 00000000..8352bb9a --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageFolderGeneralSettings.ascx @@ -0,0 +1,71 @@ +<%@ 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/EnterpriseStoragePermissions.ascx" TagName="ESPermissions" TagPrefix="wsp"%> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register TagPrefix="wsp" TagName="CollapsiblePanel" Src="../UserControls/CollapsiblePanel.ascx" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + +
+
+
+ +
+
+ +
+
+
+
+ + + + +
+
+ + + + + + + + + + + + + + + + + + + + +
+ + +
+
+
 
+
+ + +
+
 
+ +
+ +
+ + +
+
+
+
+
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageFolderGeneralSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageFolderGeneralSettings.ascx.cs new file mode 100644 index 00000000..22e4baab --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageFolderGeneralSettings.ascx.cs @@ -0,0 +1,106 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +using System; +using System.Data; +using System.Configuration; +using System.Collections; +using System.Web; +using System.Web.Security; +using System.Web.UI; +using System.Web.UI.WebControls; +using System.Web.UI.WebControls.WebParts; +using System.Web.UI.HtmlControls; + +using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.EnterpriseServer; +using WebsitePanel.Providers.OS; + +namespace WebsitePanel.Portal.ExchangeServer +{ + public partial class EnterpriseStorageFolderGeneralSettings : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + 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}\\{1}", org.OrganizationId, folder.Name); + + // bind form + txtFolderName.Text = folder.Name; + lblFolderUrl.Text = folder.Url; + + var esPermissions = ES.Services.EnterpriseStorage.GetEnterpriseFolderPermissions(PanelRequest.ItemID,folder.Name); + + permissions.SetPermissions(esPermissions); + + txtNotes.Text = folder.GetValue("Notes"); + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("ENETERPRISE_STORAGE_GET_FOLDER_SETTINGS", ex); + } + } + + protected void btnSave_Click(object sender, EventArgs e) + { + if (!Page.IsValid) + return; + + try + { + litFolderName.Text = txtFolderName.Text; + + SystemFile folder = ES.Services.EnterpriseStorage.GetEnterpriseFolder(PanelRequest.ItemID, PanelRequest.FolderID); + + ES.Services.EnterpriseStorage.SetEnterpriseFolderPermissions(PanelRequest.ItemID, folder.Name, permissions.GetPemissions()); + + messageBox.ShowSuccessMessage("ENTERPRISE_STORAGE_UPDATE_FOLDER_SETTINGS"); + } + catch (Exception ex) + { + messageBox.ShowErrorMessage("ENTERPRISE_STORAGE_UPDATE_FOLDER_SETTINGS", ex); + } + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageFolderGeneralSettings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageFolderGeneralSettings.ascx.designer.cs new file mode 100644 index 00000000..9eee6b83 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageFolderGeneralSettings.ascx.designer.cs @@ -0,0 +1,186 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.ExchangeServer { + + + public partial class EnterpriseStorageFolderGeneralSettings { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Menu menu; + + /// + /// Image1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image Image1; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// litFolderName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litFolderName; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// locFolderName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locFolderName; + + /// + /// txtFolderName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtFolderName; + + /// + /// valRequireFolderName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireFolderName; + + /// + /// locFolderUrl control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locFolderUrl; + + /// + /// lblFolderUrl control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblFolderUrl; + + /// + /// PermissionsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.HtmlControls.HtmlGenericControl PermissionsPanel; + + /// + /// PermissionsSection control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize PermissionsSection; + + /// + /// permissions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.EnterpriseStoragePermissions permissions; + + /// + /// locNotes control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locNotes; + + /// + /// txtNotes control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtNotes; + + /// + /// btnSave control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnSave; + + /// + /// valSummary control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ValidationSummary valSummary; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageFolders.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageFolders.ascx new file mode 100644 index 00000000..eff151eb --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageFolders.ascx @@ -0,0 +1,105 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EnterpriseStorageFolders.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.EnterpriseStorageFolders" %> +<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> +<%@ Register Src="UserControls/Breadcrumb.ascx" TagName="Breadcrumb" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/QuotaViewer.ascx" TagName="QuotaViewer" TagPrefix="wsp" %> +<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> + + + +
+
+
+ +
+
+ +
+
+
+
+ + + + +
+
+ + +
+
+ +
+
+ + + + 10 + 20 + 50 + 100 + + + + + +
+
+ + + + + + + + <%# Eval("Name") %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +     + +
+
+
+
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageFolders.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageFolders.ascx.cs new file mode 100644 index 00000000..014972f0 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageFolders.ascx.cs @@ -0,0 +1,127 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +using System; +using System.Web.UI.WebControls; +using WebsitePanel.EnterpriseServer; +using WebsitePanel.Providers.Common; +using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.Providers.OS; + +namespace WebsitePanel.Portal.ExchangeServer +{ + public partial class EnterpriseStorageFolders : WebsitePanelModuleBase + { + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + Organization org = ES.Services.Organizations.GetOrganization(PanelRequest.ItemID); + + litRootFolder.Text = org.OrganizationId; + + BindEnterpriseStorageStats(); + } + } + + public string GetFolderEditUrl(string folderName) + { + return EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "enterprisestorage_folder_settings", + "FolderID=" + folderName, + "ItemID=" + PanelRequest.ItemID); + } + + protected void BindEnterpriseStorageStats() + { + OrganizationStatistics organizationStats = ES.Services.Organizations.GetOrganizationStatisticsByOrganization(PanelRequest.ItemID); + + OrganizationStatistics tenantStats = ES.Services.Organizations.GetOrganizationStatistics(PanelRequest.ItemID); + + foldersQuota.QuotaUsedValue = organizationStats.CreatedEnterpriseStorageFolders; + + foldersQuota.QuotaValue = organizationStats.AllocatedEnterpriseStorageFolders; + + if (organizationStats.AllocatedEnterpriseStorageFolders != -1) + { + int folderAvailable = foldersQuota.QuotaAvailable = tenantStats.AllocatedEnterpriseStorageFolders - tenantStats.CreatedEnterpriseStorageFolders; + + if (folderAvailable <= 0) + { + btnAddFolder.Enabled = false; + } + } + } + + protected void btnAddFolder_Click(object sender, EventArgs e) + { + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "create_enterprisestorage_folder", + "SpaceID=" + PanelSecurity.PackageId)); + } + + protected void gvFolders_RowCommand(object sender, GridViewCommandEventArgs e) + { + if (e.CommandName == "DeleteItem") + { + // delete folder + string folderName = e.CommandArgument.ToString(); + + try + { + ResultObject result = ES.Services.EnterpriseStorage.DeleteEnterpriseFolder(PanelRequest.ItemID, folderName); + if (!result.IsSuccess) + { + messageBox.ShowMessage(result, "ENTERPRISE_STORAGE_FOLDER", "EnterpriseStorage"); + return; + } + + gvFolders.DataBind(); + } + catch (Exception ex) + { + ShowErrorMessage("ENTERPRISE_STORAGE_DELETE_FOLDER", ex); + } + } + } + + protected void odsSecurityGroupsPaged_Selected(object sender, ObjectDataSourceStatusEventArgs e) + { + if (e.Exception != null) + { + messageBox.ShowErrorMessage("ORGANIZATION_GET_SECURITY_GROUP", e.Exception); + e.ExceptionHandled = true; + } + } + + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + gvFolders.PageSize = Convert.ToInt16(ddlPageSize.SelectedValue); + + gvFolders.DataBind(); + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageFolders.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageFolders.ascx.designer.cs new file mode 100644 index 00000000..4c91f0f0 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageFolders.ascx.designer.cs @@ -0,0 +1,168 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.ExchangeServer { + + + public partial class EnterpriseStorageFolders { + + /// + /// asyncTasks control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + + /// + /// breadcrumb control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Breadcrumb breadcrumb; + + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Menu menu; + + /// + /// imgESS control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Image imgESS; + + /// + /// locTitle control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locTitle; + + /// + /// litRootFolder control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Literal litRootFolder; + + /// + /// messageBox control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox; + + /// + /// btnAddFolder control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnAddFolder; + + /// + /// SearchPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel SearchPanel; + + /// + /// locSearch control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locSearch; + + /// + /// ddlPageSize control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlPageSize; + + /// + /// txtSearchValue control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtSearchValue; + + /// + /// cmdSearch control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ImageButton cmdSearch; + + /// + /// gvFolders control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvFolders; + + /// + /// odsEnterpriseFoldersPaged control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ObjectDataSource odsEnterpriseFoldersPaged; + + /// + /// locQuota control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locQuota; + + /// + /// foldersQuota control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.QuotaViewer foldersQuota; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageSpaces.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageSpaces.ascx.designer.cs index 9c027dbd..d78f5ca8 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageSpaces.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/EnterpriseStorageSpaces.ascx.designer.cs @@ -1,32 +1,3 @@ -// Copyright (c) 2012, 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. - - //------------------------------------------------------------------------------ // // This code was generated by a tool. diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/EnterpriseStoragePermissions.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/EnterpriseStoragePermissions.ascx.resx new file mode 100644 index 00000000..2ea94822 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/EnterpriseStoragePermissions.ascx.resx @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Add... + + + Add Accounts + + + Cancel + + + Delete + + + Set Read-Only + + + Set Read-Write + + + Display Name + + + E-mail Address + + + Display Name + + + Email + + + The list of permissions is empty. Click "Add..." button to add permissions. + + + Permissions + + + Users/Groups + + + No accounts found. + + + Organization Accounts + + + Include in search: + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/Menu.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/Menu.ascx.resx index 33a5df4a..59698647 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/Menu.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/Menu.ascx.resx @@ -207,7 +207,7 @@ Enterprise Storage - - Spaces + + Folders \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/EnterpriseStoragePermissions.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/EnterpriseStoragePermissions.ascx new file mode 100644 index 00000000..65064eb2 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/EnterpriseStoragePermissions.ascx @@ -0,0 +1,122 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="EnterpriseStoragePermissions.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.UserControls.EnterpriseStoragePermissions" %> +<%@ Register Src="../../UserControls/PopupHeader.ascx" TagName="PopupHeader" TagPrefix="wsp" %> + + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + +
+ + + + +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/EnterpriseStoragePermissions.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/EnterpriseStoragePermissions.ascx.cs new file mode 100644 index 00000000..1987eae9 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/EnterpriseStoragePermissions.ascx.cs @@ -0,0 +1,287 @@ +// Copyright (c) 2012, Outercurve Foundation. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without modification, +// are permitted provided that the following conditions are met: +// +// - Redistributions of source code must retain the above copyright notice, this +// list of conditions and the following disclaimer. +// +// - Redistributions in binary form must reproduce the above copyright notice, +// this list of conditions and the following disclaimer in the documentation +// and/or other materials provided with the distribution. +// +// - Neither the name of the Outercurve Foundation nor the names of its +// contributors may be used to endorse or promote products derived from this +// software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +using System; +using System.Collections.Generic; +using System.Web.UI; +using System.Web.UI.WebControls; +using WebsitePanel.Providers.HostedSolution; +using System.Linq; +using WebsitePanel.Providers.Web; +using WebsitePanel.EnterpriseServer.Base.HostedSolution; + +namespace WebsitePanel.Portal.ExchangeServer.UserControls +{ + public partial class EnterpriseStoragePermissions : WebsitePanelControlBase + { + public const string DirectionString = "DirectionString"; + + protected enum SelectedState + { + All, + Selected, + Unselected + } + + public void SetPermissions(ESPermission[] permissions) + { + BindAccounts(permissions, false); + } + + public ESPermission[] GetPemissions() + { + return GetGridViewPermissions(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(EnterpriseStoragePermissions), "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 selectedAccounts = GetGridViewPermissions(SelectedState.Unselected); + + BindAccounts(selectedAccounts.ToArray(), false); + } + + protected void btnAddSelected_Click(object sender, EventArgs e) + { + List selectedAccounts = GetGridViewAccounts(); + + List permissions = new List(); + foreach (ExchangeAccount account in selectedAccounts) + { + permissions.Add(new ESPermission + { + Account = account.AccountName, + Access = "Read-Only", + }); + } + + BindAccounts(permissions.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; + case ExchangeAccountType.SecurityGroup: + imgName = "dlist_16.gif"; + break; + case ExchangeAccountType.DefaultSecurityGroup: + imgName = "dlist_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 + "%", ""); + + List newAccounts = new List(); + + accounts = accounts.Where(x => !GetPemissions().Select(p => p.Account).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(ESPermission[] newPermissions, bool preserveExisting) + { + // get binded addresses + List permissions = new List(); + if(preserveExisting) + permissions.AddRange(GetGridViewPermissions(SelectedState.All)); + + // add new accounts + if (newPermissions != null) + { + foreach (ESPermission newPermission in newPermissions) + { + // check if exists + bool exists = false; + foreach (ESPermission permission in permissions) + { + if (String.Compare(newPermission.Account, permission.Account, true) == 0) + { + exists = true; + break; + } + } + + if (exists) + continue; + + permissions.Add(newPermission); + } + } + + gvPermissions.DataSource = permissions; + gvPermissions.DataBind(); + } + + protected List GetGridViewPermissions(SelectedState state) + { + List permissions = new List(); + for (int i = 0; i < gvPermissions.Rows.Count; i++) + { + GridViewRow row = gvPermissions.Rows[i]; + CheckBox chkSelect = (CheckBox)row.FindControl("chkSelect"); + if (chkSelect == null) + continue; + + ExchangeAccount[] accounts = ES.Services.EnterpriseStorage.SearchESAccounts(PanelRequest.ItemID, + ddlSearchColumn.SelectedValue, txtSearchValue.Text + "%", ""); + + ESPermission permission = new ESPermission(); + permission.Account = (string)gvPermissions.DataKeys[i][0]; + permission.Access = ((Literal)row.FindControl("litAccess")).Text; + + if (state == SelectedState.All || + (state == SelectedState.Selected && chkSelect.Checked) || + (state == SelectedState.Unselected && !chkSelect.Checked)) + permissions.Add(permission); + } + + return permissions; + } + + protected List GetGridViewAccounts() + { + List accounts = new List(); + 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 ExchangeAccount + { + AccountName = (string)gvPopupAccounts.DataKeys[i][0] + }); + } + } + + 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); + } + + protected void btn_UpdateAccess(object sender, EventArgs e) + { + if (gvPermissions.HeaderRow != null) + { + CheckBox chkAllSelect = (CheckBox)gvPermissions.HeaderRow.FindControl("chkSelectAll"); + if (chkAllSelect != null) + { + chkAllSelect.Checked = false; + } + } + + for (int i = 0; i < gvPermissions.Rows.Count; i++) + { + GridViewRow row = gvPermissions.Rows[i]; + + CheckBox chkSelect = (CheckBox)row.FindControl("chkSelect"); + Literal litAccess = (Literal)row.FindControl("litAccess"); + + if (chkSelect == null || litAccess == null) + continue; + + if (chkSelect.Checked) + { + chkSelect.Checked = false; + litAccess.Text = ((Button)sender).CommandArgument; + } + } + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/EnterpriseStoragePermissions.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/EnterpriseStoragePermissions.ascx.designer.cs new file mode 100644 index 00000000..3e0081d9 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/EnterpriseStoragePermissions.ascx.designer.cs @@ -0,0 +1,177 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal.ExchangeServer.UserControls { + + + public partial class EnterpriseStoragePermissions { + + /// + /// PermissionsUpdatePanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UpdatePanel PermissionsUpdatePanel; + + /// + /// btnAdd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnAdd; + + /// + /// btnDelete control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnDelete; + + /// + /// gvPermissions control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvPermissions; + + /// + /// btnSetReadOnly control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnSetReadOnly; + + /// + /// btnSetReadWrite control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnSetReadWrite; + + /// + /// AddAccountsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel AddAccountsPanel; + + /// + /// headerAddAccounts control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize headerAddAccounts; + + /// + /// AddAccountsUpdatePanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UpdatePanel AddAccountsUpdatePanel; + + /// + /// SearchPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel SearchPanel; + + /// + /// ddlSearchColumn control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList ddlSearchColumn; + + /// + /// txtSearchValue control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtSearchValue; + + /// + /// cmdSearch control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.ImageButton cmdSearch; + + /// + /// gvPopupAccounts control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvPopupAccounts; + + /// + /// btnAddSelected control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnAddSelected; + + /// + /// btnCancelAdd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnCancelAdd; + + /// + /// btnAddAccountsFake control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnAddAccountsFake; + + /// + /// AddAccountsModal control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::AjaxControlToolkit.ModalPopupExtender AddAccountsModal; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs index 4fa2b70e..5b0221bf 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs @@ -254,7 +254,7 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls MenuGroup enterpriseStorageGroup = new MenuGroup(GetLocalizedString("Text.EnterpriseStorageGroup"), imagePath + "spaces16.png"); - enterpriseStorageGroup.MenuItems.Add(CreateMenuItem("EnterpriseStorageSpaces", "enterprisestorage_spaces")); + enterpriseStorageGroup.MenuItems.Add(CreateMenuItem("EnterpriseStorageFolders", "enterprisestorage_folders")); groups.Add(enterpriseStorageGroup); } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/App_LocalResources/EnterpriseStorage_Settings.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/App_LocalResources/EnterpriseStorage_Settings.ascx.resx index 5e4ec076..9695a9e9 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/App_LocalResources/EnterpriseStorage_Settings.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/App_LocalResources/EnterpriseStorage_Settings.ascx.resx @@ -126,4 +126,7 @@ Enterprise Storage Folder: + + Enterprise Storage Domain: + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/EnterpriseStorage_Settings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/EnterpriseStorage_Settings.ascx index 7ff94ecb..c731bd46 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/EnterpriseStorage_Settings.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/EnterpriseStorage_Settings.ascx @@ -7,6 +7,16 @@ + + + + + + + + + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/EnterpriseStorage_Settings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/EnterpriseStorage_Settings.ascx.cs index 8024ccf6..f448c56d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/EnterpriseStorage_Settings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/EnterpriseStorage_Settings.ascx.cs @@ -64,6 +64,7 @@ namespace WebsitePanel.Portal.ProviderControls { txtFolder.Text = settings["UsersHome"]; txtLocationDrive.Text = settings["LocationDrive"]; + txtDomain.Text = settings["UsersDomain"]; chkEnableHardQuota.Checked = settings["EnableHardQuota"] == "true" ? true : false; } @@ -71,6 +72,7 @@ namespace WebsitePanel.Portal.ProviderControls { settings["UsersHome"] = txtFolder.Text; settings["LocationDrive"] = txtLocationDrive.Text; + settings["UsersDomain"] = txtDomain.Text; settings["EnableHardQuota"] = chkEnableHardQuota.Checked.ToString().ToLower(); } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/EnterpriseStorage_Settings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/EnterpriseStorage_Settings.ascx.designer.cs index 0326da79..a06c075c 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/EnterpriseStorage_Settings.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/EnterpriseStorage_Settings.ascx.designer.cs @@ -1,31 +1,3 @@ -// Copyright (c) 2012, 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. - //------------------------------------------------------------------------------ // // This code was generated by a tool. @@ -58,6 +30,33 @@ namespace WebsitePanel.Portal.ProviderControls { ///
protected global::System.Web.UI.WebControls.TextBox txtFolder; + /// + /// lblDomain control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label lblDomain; + + /// + /// txtDomain control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox txtDomain; + + /// + /// valDomain control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.RequiredFieldValidator valDomain; + /// /// lblLocationDrive control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj index 8353f1a3..c57ce82e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj @@ -169,6 +169,7 @@ + @@ -209,12 +210,26 @@ - - EnterpriseStorageSpaces.ascx + + EnterpriseStorageFolderGeneralSettings.ascx ASPXCodeBehind - - EnterpriseStorageSpaces.ascx + + EnterpriseStorageFolderGeneralSettings.ascx + + + EnterpriseStorageCreateFolder.ascx + ASPXCodeBehind + + + EnterpriseStorageCreateFolder.ascx + + + EnterpriseStorageFolders.ascx + ASPXCodeBehind + + + EnterpriseStorageFolders.ascx OrganizationSecurityGroupMemberOf.ascx @@ -297,6 +312,13 @@ AccountsListWithPermissions.ascx ASPXCodeBehind + + EnterpriseStoragePermissions.ascx + ASPXCodeBehind + + + EnterpriseStoragePermissions.ascx + GroupsList.ascx ASPXCodeBehind @@ -4001,7 +4023,9 @@ - + + + @@ -4014,6 +4038,7 @@ + @@ -5232,11 +5257,18 @@ Designer - - + + Designer + + + Designer + Designer + + + Designer