fixed bugs
This commit is contained in:
parent
8784e493d5
commit
ff9e257362
14 changed files with 55 additions and 118 deletions
|
@ -64,12 +64,16 @@ namespace WebsitePanel.Providers.EnterpriseStorage
|
|||
#region Folders
|
||||
public SystemFile[] GetFolders(string organizationId)
|
||||
{
|
||||
ArrayList items = new ArrayList();
|
||||
string rootPath = string.Format("{0}:\\{1}\\{2}", LocationDrive, UsersHome, organizationId);
|
||||
|
||||
if (Directory.Exists(rootPath))
|
||||
{
|
||||
|
||||
DirectoryInfo root = new DirectoryInfo(rootPath);
|
||||
IWebDav webdav = new Web.WebDav(UsersDomain);
|
||||
|
||||
ArrayList items = new ArrayList();
|
||||
|
||||
|
||||
// get directories
|
||||
DirectoryInfo[] dirs = root.GetDirectories();
|
||||
|
@ -88,6 +92,7 @@ namespace WebsitePanel.Providers.EnterpriseStorage
|
|||
// check if the directory is empty
|
||||
folder.IsEmpty = (Directory.GetFileSystemEntries(fullName).Length == 0);
|
||||
}
|
||||
}
|
||||
|
||||
return (SystemFile[])items.ToArray(typeof(SystemFile));
|
||||
}
|
||||
|
@ -95,15 +100,18 @@ namespace WebsitePanel.Providers.EnterpriseStorage
|
|||
public SystemFile GetFolder(string organizationId, string folderName)
|
||||
{
|
||||
string fullName = string.Format("{0}:\\{1}\\{2}\\{3}", LocationDrive, UsersHome, organizationId, folderName);
|
||||
SystemFile folder = new SystemFile();
|
||||
|
||||
if (Directory.Exists(fullName))
|
||||
{
|
||||
DirectoryInfo root = new DirectoryInfo(fullName);
|
||||
|
||||
SystemFile folder = new SystemFile(root.Name, fullName, true,
|
||||
FileUtils.BytesToMb( FileUtils.CalculateFolderSize(root.FullName)), root.CreationTime, root.LastWriteTime);
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -109,11 +109,14 @@ namespace WebsitePanel.Providers.Web
|
|||
ConfigurationElementCollection authoringRulesCollection = authoringRulesSection.GetCollection();
|
||||
|
||||
var rules = new List<WebDavFolderRule>();
|
||||
|
||||
try
|
||||
{
|
||||
foreach (var rule in authoringRulesCollection)
|
||||
{
|
||||
rules.Add(rule.ToWebDavFolderRule());
|
||||
}
|
||||
}
|
||||
catch { }
|
||||
|
||||
return rules.ToArray();
|
||||
}
|
||||
|
@ -128,10 +131,6 @@ namespace WebsitePanel.Providers.Web
|
|||
{
|
||||
|
||||
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();
|
||||
|
|
|
@ -139,6 +139,6 @@
|
|||
<value>*</value>
|
||||
</data>
|
||||
<data name="locTitle" xml:space="preserve">
|
||||
<value>Create New Folder In</value>
|
||||
<value>Create New Folder</value>
|
||||
</data>
|
||||
</root>
|
|
@ -19,9 +19,7 @@
|
|||
<div class="Center">
|
||||
<div class="Title">
|
||||
<asp:Image ID="imgESS" SkinID="EnterpriseStorageSpace48" runat="server" />
|
||||
<asp:Localize ID="locTitle" runat="server" meta:resourcekey="locTitle" Text="Create New Folder In"></asp:Localize>
|
||||
|
||||
<asp:Literal ID="litRootFolder" runat="server" Text="Root" />
|
||||
<asp:Localize ID="locTitle" runat="server" meta:resourcekey="locTitle" Text="Create New Folder"></asp:Localize>
|
||||
</div>
|
||||
<div class="FormBody">
|
||||
<wsp:SimpleMessageBox id="messageBox" runat="server" />
|
||||
|
|
|
@ -35,15 +35,6 @@ 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)
|
||||
{
|
||||
|
|
|
@ -57,15 +57,6 @@ namespace WebsitePanel.Portal.ExchangeServer {
|
|||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Localize locTitle;
|
||||
|
||||
/// <summary>
|
||||
/// litRootFolder control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Literal litRootFolder;
|
||||
|
||||
/// <summary>
|
||||
/// messageBox control.
|
||||
/// </summary>
|
||||
|
|
|
@ -64,7 +64,7 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
SystemFile folder = ES.Services.EnterpriseStorage.GetEnterpriseFolder(
|
||||
PanelRequest.ItemID, PanelRequest.FolderID);
|
||||
|
||||
litFolderName.Text = string.Format("{0}\\{1}", org.OrganizationId, folder.Name);
|
||||
litFolderName.Text = string.Format("{0}", folder.Name);
|
||||
|
||||
// bind form
|
||||
txtFolderName.Text = folder.Name;
|
||||
|
|
|
@ -20,8 +20,6 @@
|
|||
<div class="Title">
|
||||
<asp:Image ID="imgESS" SkinID="EnterpriseStorageSpace48" runat="server" />
|
||||
<asp:Localize ID="locTitle" runat="server" meta:resourcekey="locTitle" Text="Folders"></asp:Localize>
|
||||
|
||||
<asp:Literal ID="litRootFolder" runat="server" Text="Root" />
|
||||
</div>
|
||||
<div class="FormBody">
|
||||
<wsp:SimpleMessageBox id="messageBox" runat="server" />
|
||||
|
|
|
@ -41,10 +41,6 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
Organization org = ES.Services.Organizations.GetOrganization(PanelRequest.ItemID);
|
||||
|
||||
litRootFolder.Text = org.OrganizationId;
|
||||
|
||||
BindEnterpriseStorageStats();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,15 +57,6 @@ namespace WebsitePanel.Portal.ExchangeServer {
|
|||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Localize locTitle;
|
||||
|
||||
/// <summary>
|
||||
/// litRootFolder control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Literal litRootFolder;
|
||||
|
||||
/// <summary>
|
||||
/// messageBox control.
|
||||
/// </summary>
|
||||
|
|
|
@ -120,11 +120,8 @@
|
|||
<data name="chkEnableHardQuota.Text" xml:space="preserve">
|
||||
<value>Enable Hard Quota:</value>
|
||||
</data>
|
||||
<data name="lblLocationDrive.Text" xml:space="preserve">
|
||||
<value>Location Drive:</value>
|
||||
</data>
|
||||
<data name="lblSpacesFolder.Text" xml:space="preserve">
|
||||
<value>Enterprise Storage Folder:</value>
|
||||
<value>Enterprise Storage Path:</value>
|
||||
</data>
|
||||
<data name="lblDomain.Text" xml:space="preserve">
|
||||
<value>Enterprise Storage Domain:</value>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<table cellpadding="1" cellspacing="0" width="100%">
|
||||
<tr>
|
||||
<td class="SubHead" width="200" nowrap>
|
||||
<asp:Label ID="lblSpacesFolder" runat="server" meta:resourcekey="lblSpacesFolder" Text="User Packages Folder:"></asp:Label>
|
||||
<asp:Label ID="lblSpacesFolder" runat="server" meta:resourcekey="lblSpacesFolder" Text="User Packages Path:"></asp:Label>
|
||||
</td>
|
||||
<td width="100%">
|
||||
<asp:TextBox runat="server" ID="txtFolder" Width="300px" CssClass="NormalTextBox"></asp:TextBox></td>
|
||||
|
@ -17,17 +17,6 @@
|
|||
ErrorMessage="*"></asp:RequiredFieldValidator>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="SubHead" width="200" nowrap>
|
||||
<asp:Label ID="lblLocationDrive" runat="server" meta:resourcekey="lblLocationDrive" Text="Location Drive:"></asp:Label>
|
||||
</td>
|
||||
<td width="100%">
|
||||
<asp:TextBox runat="server" ID="txtLocationDrive" Width="50px" MaxLength="1" CssClass="NormalTextBox"></asp:TextBox>
|
||||
<asp:RequiredFieldValidator ID="valLocationDrive" runat="server" ControlToValidate="txtLocationDrive"
|
||||
ErrorMessage="*"></asp:RequiredFieldValidator>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="SubHead" width="200" nowrap></td>
|
||||
<td width="100%">
|
||||
|
|
|
@ -49,8 +49,7 @@ namespace WebsitePanel.Portal.ProviderControls
|
|||
try
|
||||
{
|
||||
chkEnableHardQuota.Enabled = ES.Services.EnterpriseStorage.CheckFileServicesInstallation(PanelRequest.ServiceId);
|
||||
txtLocationDrive.Enabled = chkEnableHardQuota.Enabled;
|
||||
valLocationDrive.Enabled = chkEnableHardQuota.Enabled;
|
||||
txtFolder.Enabled = chkEnableHardQuota.Enabled;
|
||||
if (!chkEnableHardQuota.Enabled)
|
||||
lblFileServiceInfo.Visible = true;
|
||||
}
|
||||
|
@ -62,18 +61,25 @@ namespace WebsitePanel.Portal.ProviderControls
|
|||
|
||||
public void BindSettings(StringDictionary settings)
|
||||
{
|
||||
txtFolder.Text = settings["UsersHome"];
|
||||
txtLocationDrive.Text = settings["LocationDrive"];
|
||||
string path = string.Format("{0}:\\{1}", settings["LocationDrive"], settings["UsersHome"]);
|
||||
|
||||
txtFolder.Text = path;
|
||||
txtDomain.Text = settings["UsersDomain"];
|
||||
chkEnableHardQuota.Checked = settings["EnableHardQuota"] == "true" ? true : false;
|
||||
}
|
||||
|
||||
public void SaveSettings(StringDictionary settings)
|
||||
{
|
||||
settings["UsersHome"] = txtFolder.Text;
|
||||
settings["LocationDrive"] = txtLocationDrive.Text;
|
||||
var drive = System.IO.Path.GetPathRoot(txtFolder.Text);
|
||||
var folder = txtFolder.Text.Replace(drive, string.Empty);
|
||||
|
||||
if (!string.IsNullOrEmpty(drive) && !string.IsNullOrEmpty(folder))
|
||||
{
|
||||
settings["LocationDrive"] = drive.Split(':')[0];
|
||||
settings["UsersHome"] = folder;
|
||||
settings["UsersDomain"] = txtDomain.Text;
|
||||
settings["EnableHardQuota"] = chkEnableHardQuota.Checked.ToString().ToLower();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -57,33 +57,6 @@ namespace WebsitePanel.Portal.ProviderControls {
|
|||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.RequiredFieldValidator valDomain;
|
||||
|
||||
/// <summary>
|
||||
/// lblLocationDrive control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblLocationDrive;
|
||||
|
||||
/// <summary>
|
||||
/// txtLocationDrive 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 txtLocationDrive;
|
||||
|
||||
/// <summary>
|
||||
/// valLocationDrive control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.RequiredFieldValidator valLocationDrive;
|
||||
|
||||
/// <summary>
|
||||
/// chkEnableHardQuota control.
|
||||
/// </summary>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue