add webdav folder quota

This commit is contained in:
vfedosevich 2013-12-24 17:33:33 +03:00
parent 0611d7bf8f
commit 4514eb02e9
18 changed files with 223 additions and 200 deletions

View file

@ -455,7 +455,7 @@ namespace WebsitePanel.EnterpriseServer
// check if it's not root folder
if (!string.IsNullOrEmpty(folderName))
{
UpdateESHardQuota(org.PackageId, org.OrganizationId, folderName, quota);
SetFolderQuota(org.PackageId, org.OrganizationId, folderName, quota);
}
}
catch (Exception ex)
@ -870,33 +870,64 @@ namespace WebsitePanel.EnterpriseServer
}
private static void UpdateESHardQuota(int packageId, string orgId, string folderName, int quotaSize)
private static void SetFolderQuota(int packageId, string orgId, string folderName, int quotaSize)
{
int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);
if (accountCheck < 0)
return;
int packageCheck = SecurityContext.CheckPackage(packageId, DemandPackage.IsActive);
if (packageCheck < 0)
return;
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"];
var orgRootFolder = Path.Combine(usersHome, orgId);
var orgFolder = Path.Combine(usersHome, orgId, folderName);
bool enableHardQuota = (esSesstings["enablehardquota"] != null)
? bool.Parse(esSesstings["enablehardquota"])
: false;
if (enableHardQuota)
{
FSRMQuotaType quotaType = (esSesstings["enablehardquota"] != null)
? bool.Parse(esSesstings["enablehardquota"]) == true ? FSRMQuotaType.Hard : FSRMQuotaType.Soft
: FSRMQuotaType.Soft;
var os = GetOS(packageId);
if (os != null && os.CheckFileServicesInstallation())
{
SetFolderQuotaByQuotaName(packageId, os, orgRootFolder, locationDrive, Quotas.ENTERPRISESTORAGE_DISKSTORAGESPACE);
SetFolderQuotaByQuotaSize(packageId, os, orgFolder, locationDrive, quotaSize, "MB");
TaskManager.StartTask("FILES", "SET_QUOTA_ON_FOLDER", orgFolder, packageId);
try
{
QuotaValueInfo diskSpaceQuota = PackageController.GetPackageQuota(packageId, Quotas.ENTERPRISESTORAGE_DISKSTORAGESPACE);
#region figure Quota Unit
// Quota Unit
string unit = string.Empty;
if (diskSpaceQuota.QuotaDescription.ToLower().Contains("gb"))
unit = "GB";
else if (diskSpaceQuota.QuotaDescription.ToLower().Contains("mb"))
unit = "MB";
else
unit = "KB";
#endregion
os.SetQuotaLimitOnFolder(orgFolder, locationDrive, quotaType, quotaSize.ToString() + unit, 0, String.Empty, String.Empty);
}
catch (Exception ex)
{
TaskManager.WriteError(ex);
}
finally
{
TaskManager.CompleteTask();
}
}
}
@ -947,88 +978,6 @@ namespace WebsitePanel.EnterpriseServer
return null;
}
private static int SetFolderQuotaByQuotaName(int packageId, WebsitePanel.Providers.OS.OperatingSystem os, string path, string driveName, string quotaName)
{
// check account
int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);
if (accountCheck < 0) return accountCheck;
// check package
int packageCheck = SecurityContext.CheckPackage(packageId, DemandPackage.IsActive);
if (packageCheck < 0) return packageCheck;
// place log record
TaskManager.StartTask("FILES", "SET_QUOTA_ON_FOLDER", path, packageId);
try
{
// 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. //Quotas.OS_DISKSPACE
QuotaValueInfo diskSpaceQuota = PackageController.GetPackageQuota(packageId, quotaName);
#region figure Quota Unit
// Quota Unit
string unit = string.Empty;
if (diskSpaceQuota.QuotaDescription.ToLower().Contains("gb"))
unit = "GB";
else if (diskSpaceQuota.QuotaDescription.ToLower().Contains("mb"))
unit = "MB";
else
unit = "KB";
#endregion
os.SetQuotaLimitOnFolder(path, driveName, diskSpaceQuota.QuotaAllocatedValue.ToString() + unit, 0, String.Empty, String.Empty);
return 0;
}
catch (Exception ex)
{
//Log and return a generic error rather than throwing an exception
TaskManager.WriteError(ex);
return BusinessErrorCodes.ERROR_FILE_GENERIC_LOGGED;
}
finally
{
TaskManager.CompleteTask();
}
}
private static int SetFolderQuotaByQuotaSize(int packageId,WebsitePanel.Providers.OS.OperatingSystem os, string path, string driveName, int quotaSize ,string unit)
{
// check account
int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive);
if (accountCheck < 0) return accountCheck;
// check package
int packageCheck = SecurityContext.CheckPackage(packageId, DemandPackage.IsActive);
if (packageCheck < 0) return packageCheck;
// place log record
TaskManager.StartTask("FILES", "SET_QUOTA_ON_FOLDER", path, packageId);
try
{
os.SetQuotaLimitOnFolder(path, driveName, quotaSize.ToString() + unit, 0, String.Empty, String.Empty);
return 0;
}
catch (Exception ex)
{
//Log and return a generic error rather than throwing an exception
TaskManager.WriteError(ex);
return BusinessErrorCodes.ERROR_FILE_GENERIC_LOGGED;
}
finally
{
TaskManager.CompleteTask();
}
}
private static WebsitePanel.Providers.OS.OperatingSystem GetOS(int packageId)
{
var esServiceInfo = ServerController.GetServiceInfo(GetEnterpriseStorageServiceID(packageId));
@ -1037,7 +986,7 @@ namespace WebsitePanel.EnterpriseServer
var osGroups = ServerController.GetResourceGroupByName(ResourceGroups.Os);
var osProviders = ServerController.GetProvidersByGroupID(osGroups.GroupId);
var regexResult = Regex.Match(esProviderInfo.ProviderType,"Windows([0-9]+)");
var regexResult = Regex.Match(esProviderInfo.ProviderType, "Windows([0-9]+)");
if(regexResult.Success)
{
@ -1055,11 +1004,6 @@ namespace WebsitePanel.EnterpriseServer
cnfg.ProviderSettings.ProviderName = osProvider.DisplayName;
cnfg.ProviderSettings.ProviderType = osProvider.ProviderType;
//// set service settings
//StringDictionary serviceSettings = ServerController.GetServiceSettings(serviceId);
//foreach (string key in serviceSettings.Keys)
// cnfg.ProviderSettings.Settings[key] = serviceSettings[key];
ServiceProviderProxy.ServerInit(os, cnfg, esServiceInfo.ServerId);
return os;

View file

@ -948,7 +948,7 @@ namespace WebsitePanel.EnterpriseServer
OS.OperatingSystem os = GetOS(packageId);
os.SetQuotaLimitOnFolder(path, driveName, diskSpaceQuota.QuotaAllocatedValue.ToString() + unit, 0, String.Empty, String.Empty);
os.SetQuotaLimitOnFolder(path, driveName, FSRMQuotaType.Hard, diskSpaceQuota.QuotaAllocatedValue.ToString() + unit, 0, String.Empty, String.Empty);
return 0;
}

View file

@ -150,7 +150,7 @@ namespace WebsitePanel.EnterpriseServer
}
[WebMethod]
public void SetEnterpriseFolderSettings(int itemId, SystemFile folder, ESPermission[] permissions, bool directoyBrowsingEnabled,int quota)
public void SetEnterpriseFolderSettings(int itemId, SystemFile folder, ESPermission[] permissions, bool directoyBrowsingEnabled, int quota)
{
EnterpriseStorageController.SetDirectoryBrowseEnabled(itemId, folder.Url, directoyBrowsingEnabled);
EnterpriseStorageController.SetFolderPermission(itemId, folder.Name, permissions);

View file

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace WebsitePanel.Providers.OS
{
public enum FSRMQuotaType
{
Soft = 1,
Hard = 2
}
}

View file

@ -82,7 +82,7 @@ namespace WebsitePanel.Providers.OS
FolderGraph GetFolderGraph(string path);
void ExecuteSyncActions(FileSyncAction[] actions);
void SetQuotaLimitOnFolder(string folderPath, string shareNameDrive, string quotaLimit, int mode, string wmiUserName, string wmiPassword);
void SetQuotaLimitOnFolder(string folderPath, string shareNameDrive, FSRMQuotaType quotaType, string quotaLimit, int mode, string wmiUserName, string wmiPassword);
int GetQuotaLimitOnFolder(string folderPath, string wmiUserName, string wmiPassword);
void DeleteDirectoryRecursive(string rootPath);

View file

@ -113,6 +113,7 @@
<Compile Include="HostedSolution\LyncVoicePolicyType.cs" />
<Compile Include="HostedSolution\OrganizationSecurityGroup.cs" />
<Compile Include="HostedSolution\TransactionAction.cs" />
<Compile Include="OS\FSRMQuotaType.cs" />
<Compile Include="OS\SystemFilesPaged.cs" />
<Compile Include="RemoteDesktopServices\IRemoteDesktopServices.cs" />
<Compile Include="ResultObjects\HeliconApe.cs" />

View file

@ -80,17 +80,23 @@ namespace WebsitePanel.Providers.EnterpriseStorage
{
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);
SystemFile folder = new SystemFile();
folder.Name = dir.Name;
folder.FullName = dir.FullName;
folder.IsDirectory = true;
folder.Size = windows.GetUsageOnFolder(fullName);
if (folder.Size == -1)
{
folder.Size = FileUtils.BytesToMb(FileUtils.CalculateFolderSize(dir.FullName));
}
folder.Url = string.Format("https://{0}/{1}/{2}", UsersDomain, organizationId, dir.Name);
folder.Rules = webdav.GetFolderWebDavRules(organizationId, dir.Name);
folder.FRSMQuotaMB = windows.GetQuotaLimitOnFolder(fullName, string.Empty, string.Empty);
items.Add(folder);
// check if the directory is empty
folder.IsEmpty = (Directory.GetFileSystemEntries(fullName).Length == 0);
}
}
@ -108,14 +114,23 @@ namespace WebsitePanel.Providers.EnterpriseStorage
{
DirectoryInfo root = new DirectoryInfo(fullName);
folder = new SystemFile(root.Name, fullName, true,
FileUtils.BytesToMb(FileUtils.CalculateFolderSize(root.FullName)), root.CreationTime, root.LastWriteTime);
folder = new SystemFile();
folder.Name = root.Name;
folder.FullName = root.FullName;
folder.IsDirectory = true;
folder.Size = windows.GetUsageOnFolder(fullName);
if (folder.Size == -1)
{
folder.Size = FileUtils.BytesToMb(FileUtils.CalculateFolderSize(root.FullName));
}
folder.Url = string.Format("https://{0}/{1}/{2}", UsersDomain, organizationId, folderName);
folder.Rules = GetFolderWebDavRules(organizationId, folderName);
folder.FRSMQuotaMB = windows.GetQuotaLimitOnFolder(fullName, string.Empty, string.Empty);
}
return folder;
}

View file

@ -210,7 +210,7 @@ namespace WebsitePanel.Providers.OS
ServerSettings, usersOU, null);
}
public virtual void SetQuotaLimitOnFolder(string folderPath, string shareNameDrive, string quotaLimit, int mode, string wmiUserName, string wmiPassword)
public virtual void SetQuotaLimitOnFolder(string folderPath, string shareNameDrive, FSRMQuotaType quotaType, string quotaLimit, int mode, string wmiUserName, string wmiPassword)
{
FileUtils.SetQuotaLimitOnFolder(folderPath, shareNameDrive, quotaLimit, mode, wmiUserName, wmiPassword);
}

View file

@ -74,7 +74,7 @@ namespace WebsitePanel.Providers.OS
|| version == WebsitePanel.Server.Utils.OS.WindowsVersion.Windows81;
}
public override void SetQuotaLimitOnFolder(string folderPath, string shareNameDrive, string quotaLimit, int mode, string wmiUserName, string wmiPassword)
public override void SetQuotaLimitOnFolder(string folderPath, string shareNameDrive, FSRMQuotaType quotaType, string quotaLimit, int mode, string wmiUserName, string wmiPassword)
{
Log.WriteStart("SetQuotaLimitOnFolder");
Log.WriteInfo("FolderPath : {0}", folderPath);
@ -82,7 +82,6 @@ namespace WebsitePanel.Providers.OS
Log.WriteInfo("QuotaLimit : {0}", quotaLimit);
string path = Path.Combine(shareNameDrive + @":\", folderPath);
var quota = CalculateQuota(quotaLimit);
Runspace runSpace = null;
try
@ -94,24 +93,33 @@ namespace WebsitePanel.Providers.OS
if (!FileUtils.DirectoryExists(path))
FileUtils.CreateDirectory(path);
if (quotaLimit.Contains("-"))
{
RemoveOldQuotaOnFolder(runSpace, path);
}
else
{
var quota = CalculateQuota(quotaLimit);
switch (mode)
{
//deleting old quota and creating new one
case 0:
{
RemoveOldQuotaOnFolder(runSpace, path);
ChangeQuotaOnFolder(runSpace, "New-FsrmQuota", path, quota);
ChangeQuotaOnFolder(runSpace, "New-FsrmQuota", path, quotaType, quota);
break;
}
//modifying folder quota
case 1:
{
ChangeQuotaOnFolder(runSpace, "Set-FsrmQuota", path, quota);
ChangeQuotaOnFolder(runSpace, "Set-FsrmQuota", path, quotaType, quota);
break;
}
}
}
}
}
catch (Exception ex)
{
Log.WriteError("SetQuotaLimitOnFolder", ex);
@ -132,7 +140,7 @@ namespace WebsitePanel.Providers.OS
Runspace runSpace = null;
int quota = 0;
int quota = -1;
try
{
@ -165,6 +173,45 @@ namespace WebsitePanel.Providers.OS
return quota;
}
public int GetUsageOnFolder(string folderPath)
{
Log.WriteStart("GetUsageOnFolder");
Log.WriteInfo("FolderPath : {0}", folderPath);
Runspace runSpace = null;
int size = -1;
try
{
runSpace = OpenRunspace();
if (folderPath.IndexOfAny(Path.GetInvalidPathChars()) == -1)
{
Command cmd = new Command("Get-FsrmQuota");
cmd.Parameters.Add("Path", folderPath);
var result = ExecuteShellCommand(runSpace, cmd, false);
if (result.Count > 0)
{
size = ConvertBytesToMB(Convert.ToInt64(GetPSObjectProperty(result[0], "usage")));
}
}
}
catch (Exception ex)
{
Log.WriteError("GetUsageOnFolder", ex);
throw;
}
finally
{
CloseRunspace(runSpace);
}
Log.WriteEnd("GetUsageOnFolder");
return size;
}
public UInt64 CalculateQuota(string quota)
{
@ -217,11 +264,17 @@ namespace WebsitePanel.Providers.OS
catch { /* do nothing */ }
}
public void ChangeQuotaOnFolder(Runspace runSpace, string command, string path, UInt64 quota)
public void ChangeQuotaOnFolder(Runspace runSpace, string command, string path, FSRMQuotaType quotaType, UInt64 quota)
{
Command cmd = new Command(command);
cmd.Parameters.Add("Path", path);
cmd.Parameters.Add("Size", quota);
if (quotaType == FSRMQuotaType.Soft)
{
cmd.Parameters.Add("SoftLimit", true);
}
ExecuteShellCommand(runSpace, cmd, false);
}

View file

@ -1741,11 +1741,12 @@ namespace WebsitePanel.Providers.OS
/// <remarks/>
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SetQuotaLimitOnFolder", 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 SetQuotaLimitOnFolder(string folderPath, string shareNameDrive, string quotaLimit, int mode, string wmiUserName, string wmiPassword)
public void SetQuotaLimitOnFolder(string folderPath, string shareNameDrive, FSRMQuotaType quotaType, string quotaLimit, int mode, string wmiUserName, string wmiPassword)
{
this.Invoke("SetQuotaLimitOnFolder", new object[] {
folderPath,
shareNameDrive,
quotaType,
quotaLimit,
mode,
wmiUserName,
@ -1753,11 +1754,12 @@ namespace WebsitePanel.Providers.OS
}
/// <remarks/>
public System.IAsyncResult BeginSetQuotaLimitOnFolder(string folderPath, string shareNameDrive, string quotaLimit, int mode, string wmiUserName, string wmiPassword, System.AsyncCallback callback, object asyncState)
public System.IAsyncResult BeginSetQuotaLimitOnFolder(string folderPath, string shareNameDrive, FSRMQuotaType quotaType, string quotaLimit, int mode, string wmiUserName, string wmiPassword, System.AsyncCallback callback, object asyncState)
{
return this.BeginInvoke("SetQuotaLimitOnFolder", new object[] {
folderPath,
shareNameDrive,
quotaType,
quotaLimit,
mode,
wmiUserName,
@ -1771,13 +1773,13 @@ namespace WebsitePanel.Providers.OS
}
/// <remarks/>
public void SetQuotaLimitOnFolderAsync(string folderPath, string shareNameDrive, string quotaLimit, int mode, string wmiUserName, string wmiPassword)
public void SetQuotaLimitOnFolderAsync(string folderPath, string shareNameDrive, FSRMQuotaType quotaType, string quotaLimit, int mode, string wmiUserName, string wmiPassword)
{
this.SetQuotaLimitOnFolderAsync(folderPath, shareNameDrive, quotaLimit, mode, wmiUserName, wmiPassword, null);
this.SetQuotaLimitOnFolderAsync(folderPath, shareNameDrive, quotaType, quotaLimit, mode, wmiUserName, wmiPassword, null);
}
/// <remarks/>
public void SetQuotaLimitOnFolderAsync(string folderPath, string shareNameDrive, string quotaLimit, int mode, string wmiUserName, string wmiPassword, object userState)
public void SetQuotaLimitOnFolderAsync(string folderPath, string shareNameDrive, FSRMQuotaType quotaType, string quotaLimit, int mode, string wmiUserName, string wmiPassword, object userState)
{
if ((this.SetQuotaLimitOnFolderOperationCompleted == null))
{
@ -1786,6 +1788,7 @@ namespace WebsitePanel.Providers.OS
this.InvokeAsync("SetQuotaLimitOnFolder", new object[] {
folderPath,
shareNameDrive,
quotaType,
quotaLimit,
mode,
wmiUserName,

View file

@ -536,12 +536,12 @@ namespace WebsitePanel.Server
[WebMethod, SoapHeader("settings")]
public void SetQuotaLimitOnFolder(string folderPath, string shareNameDrive, string quotaLimit, int mode, string wmiUserName, string wmiPassword)
public void SetQuotaLimitOnFolder(string folderPath, string shareNameDrive, FSRMQuotaType quotaType, string quotaLimit, int mode, string wmiUserName, string wmiPassword)
{
try
{
Log.WriteStart("'{0}' SetQuotaLimitOnFolder", ProviderSettings.ProviderName);
OsProvider.SetQuotaLimitOnFolder(folderPath, shareNameDrive, quotaLimit, mode, wmiUserName, wmiPassword);
OsProvider.SetQuotaLimitOnFolder(folderPath, shareNameDrive, quotaType, quotaLimit, mode, wmiUserName, wmiPassword);
Log.WriteEnd("'{0}' SetQuotaLimitOnFolder", ProviderSettings.ProviderName);
}
catch (Exception ex)

View file

@ -147,4 +147,13 @@
<data name="locFolderUrl.Text" xml:space="preserve">
<value>Folder Url:</value>
</data>
<data name="locFolderSize" xml:space="preserve">
<value>Folder Limit Size (Mb):</value>
</data>
<data name="valNumericFolderSize" xml:space="preserve">
<value>*</value>
</data>
<data name="valNumericFolderSize.ErrorMessage" xml:space="preserve">
<value>Enter Folder Size</value>
</data>
</root>

View file

@ -30,13 +30,23 @@
<tr>
<td class="FormLabel150"><asp:Localize ID="locFolderName" runat="server" meta:resourcekey="locFolderName" Text="Folder Name:"></asp:Localize></td>
<td>
<asp:TextBox ID="txtFolderName" runat="server" CssClass="HugeTextBox200"></asp:TextBox>
<asp:TextBox ID="txtFolderName" runat="server" CssClass="HugeTextBox200" ></asp:TextBox>
<asp:RequiredFieldValidator ID="valRequireFolderName" runat="server" meta:resourcekey="valRequireFolderName" ControlToValidate="txtFolderName"
ErrorMessage="Enter Folder Name" ValidationGroup="EditFolder" Display="Dynamic" Text="*" SetFocusOnError="True"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<td class="FormLabel150"><asp:Localize ID="locFolderSize" runat="server" meta:resourcekey="locFolderSize" Text="Folder Limit Size (Mb):"></asp:Localize></td>
<td>
<asp:TextBox ID="txtFolderSize" runat="server" CssClass="HugeTextBox200"></asp:TextBox>
<asp:CompareValidator ID="valNumericFolderSize" runat="server" meta:resourcekey="valNumericFolderSize" ControlToValidate="txtFolderSize"
Type="Integer" Operator="DataTypeCheck" ValidationGroup="EditFolder" Display="Dynamic" Text="*" SetFocusOnError="True"
ErrorMessage="Enter Folder Size" />
<br />
<br />
</td>
</tr>
<tr>
<td class="FormLabel150"><asp:Localize ID="locFolderUrl" runat="server" meta:resourcekey="locFolderUrl" Text="Folder Url:"></asp:Localize></td>
<td><asp:Label runat="server" ID="lblFolderUrl" /></td>

View file

@ -76,6 +76,11 @@ namespace WebsitePanel.Portal.ExchangeServer
txtFolderName.Text = folder.Name;
lblFolderUrl.Text = folder.Url;
if (folder.FRSMQuotaMB != -1)
{
txtFolderSize.Text = folder.FRSMQuotaMB.ToString();
}
var esPermissions = ES.Services.EnterpriseStorage.GetEnterpriseFolderPermissions(PanelRequest.ItemID,folder.Name);
chkDirectoryBrowsing.Checked = ES.Services.EnterpriseStorage.GetDirectoryBrowseEnabled(PanelRequest.ItemID, folder.Url);
@ -122,7 +127,8 @@ namespace WebsitePanel.Portal.ExchangeServer
folder = ES.Services.EnterpriseStorage.RenameEnterpriseFolder(PanelRequest.ItemID, PanelRequest.FolderID, txtFolderName.Text);
}
ES.Services.EnterpriseStorage.SetEnterpriseFolderSettings(PanelRequest.ItemID, folder, permissions.GetPemissions(), chkDirectoryBrowsing.Checked, 100);
ES.Services.EnterpriseStorage.SetEnterpriseFolderSettings(PanelRequest.ItemID, folder, permissions.GetPemissions(),
chkDirectoryBrowsing.Checked, txtFolderSize.Text.Length == 0 ? -1 : int.Parse(txtFolderSize.Text));
Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "enterprisestorage_folders",

View file

@ -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.
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
@ -130,6 +102,33 @@ namespace WebsitePanel.Portal.ExchangeServer {
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireFolderName;
/// <summary>
/// locFolderSize control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locFolderSize;
/// <summary>
/// txtFolderSize control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtFolderSize;
/// <summary>
/// valNumericFolderSize control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.CompareValidator valNumericFolderSize;
/// <summary>
/// locFolderUrl control.
/// </summary>

View file

@ -251,7 +251,7 @@
<asp:HyperLink ID="lnkEnterpriseStorageSpace" runat="server" meta:resourcekey="lnkEnterpriseStorageSpace" />
</td>
<td>
<wsp:QuotaViewer ID="enterpriseStorageSpaceStats" QuotaTypeId="2" runat="server" DisplayGauge="true" />
<wsp:QuotaViewer ID="enterpriseStorageSpaceStats" QuotaTypeId="3" runat="server" DisplayGauge="true" />
</td>
</tr>
<tr class="OrgStatsRow">

View file

@ -300,9 +300,7 @@ namespace WebsitePanel.Portal.ExchangeServer
private void BindEnterpriseStorageStats(OrganizationStatistics stats, OrganizationStatistics tenantStats)
{
enterpriseStorageSpaceStats.QuotaValue = stats.AllocatedEnterpriseStorageSpace;
enterpriseStorageSpaceStats.QuotaUsedValue = stats.UsedEnterpriseStorageSpace;
if (stats.AllocatedEnterpriseStorageSpace != -1) enterpriseStorageSpaceStats.QuotaAvailable = tenantStats.AllocatedEnterpriseStorageSpace - tenantStats.UsedEnterpriseStorageSpace;
enterpriseStorageSpaceStats.QuotaValue = stats.UsedEnterpriseStorageSpace;
lnkBESUsers.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "enterprisestorage_folders",
"SpaceID=" + PanelSecurity.PackageId.ToString());

View file

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