This commit is contained in:
Virtuworks 2013-11-05 18:40:19 -05:00
commit cf889bd90c
65 changed files with 15351 additions and 8460 deletions

View file

@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace WebsitePanel.EnterpriseServer.Base.HostedSolution
{
public class ESPermission
{
string displayName;
string account;
string access;
bool isGroup;
public string DisplayName
{
get { return displayName; }
set { displayName = value; }
}
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; }
}
}
}

View file

@ -234,5 +234,8 @@ order by rg.groupOrder
public const string HELICON_ZOO = "HeliconZoo.*"; public const string HELICON_ZOO = "HeliconZoo.*";
public const string ENTERPRISESTORAGE_DISKSTORAGESPACE = "EnterpriseStorage.DiskStorageSpace";
public const string ENTERPRISESTORAGE_FOLDERS = "EnterpriseStorage.Folders";
} }
} }

View file

@ -117,6 +117,7 @@
<Compile Include="Ecommerce\TriggerSystem\ITriggerHandler.cs" /> <Compile Include="Ecommerce\TriggerSystem\ITriggerHandler.cs" />
<Compile Include="ExchangeServer\ExchangeEmailAddress.cs" /> <Compile Include="ExchangeServer\ExchangeEmailAddress.cs" />
<Compile Include="HostedSolution\AdditionalGroup.cs" /> <Compile Include="HostedSolution\AdditionalGroup.cs" />
<Compile Include="HostedSolution\ESPermission.cs" />
<Compile Include="Log\LogRecord.cs" /> <Compile Include="Log\LogRecord.cs" />
<Compile Include="Packages\HostingPlanContext.cs" /> <Compile Include="Packages\HostingPlanContext.cs" />
<Compile Include="Packages\HostingPlanGroupInfo.cs" /> <Compile Include="Packages\HostingPlanGroupInfo.cs" />

View file

@ -34,6 +34,7 @@ using System.Collections.Specialized;
using System.Text; using System.Text;
using System.Xml; using System.Xml;
using System.Xml.Serialization; using System.Xml.Serialization;
using System.Linq;
using WebsitePanel.Server; using WebsitePanel.Server;
using WebsitePanel.Providers; using WebsitePanel.Providers;
@ -42,13 +43,16 @@ using WebsitePanel.Providers.EnterpriseStorage;
using System.Collections; using System.Collections;
using WebsitePanel.Providers.Common; using WebsitePanel.Providers.Common;
using WebsitePanel.Providers.ResultObjects; using WebsitePanel.Providers.ResultObjects;
using WebsitePanel.Providers.Web;
using WebsitePanel.Providers.HostedSolution;
using WebsitePanel.EnterpriseServer.Base.HostedSolution;
namespace WebsitePanel.EnterpriseServer namespace WebsitePanel.EnterpriseServer
{ {
public class EnterpriseStorageController public class EnterpriseStorageController
{ {
#region Public Methods #region Public Methods
public static SystemFile[] GetFolders(int itemId) public static SystemFile[] GetFolders(int itemId)
{ {
return GetFoldersInternal(itemId); return GetFoldersInternal(itemId);
@ -59,9 +63,19 @@ namespace WebsitePanel.EnterpriseServer
return GetFolderInternal(itemId, folderName); 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) public static ResultObject DeleteFolder(int itemId, string folderName)
@ -69,10 +83,37 @@ namespace WebsitePanel.EnterpriseServer
return DeleteFolderInternal(itemId, folderName); return DeleteFolderInternal(itemId, folderName);
} }
public static ResultObject SetFolderQuota(int itemId, string folderName, long quota) public static List<ExchangeAccount> SearchESAccounts(int itemId, string filterColumn, string filterValue, string sortColumn)
{ {
return SetFolderQuotaInternal(itemId, folderName, quota); return SearchESAccountsInternal(itemId, filterColumn, filterValue, sortColumn);
} }
public static SystemFilesPaged GetEnterpriseFoldersPaged(int itemId, string filterValue, string sortColumn, int startRow, int maximumRows)
{
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(itemId,GetFolderWebDavRulesInternal(itemId, folder));
}
public static bool CheckFileServicesInstallation(int serviceId)
{
EnterpriseStorage es = GetEnterpriseStorage(serviceId);
return es.CheckFileServicesInstallation();
}
public static SystemFile RenameFolder(int itemId, string oldFolder, string newFolder)
{
return RenameFolderInternal(itemId, oldFolder, newFolder);
}
#endregion #endregion
@ -83,37 +124,376 @@ namespace WebsitePanel.EnterpriseServer
return es; return es;
} }
protected static SystemFile[] GetFoldersInternal(int itemId)
private static SystemFile[] GetFoldersInternal(int itemId)
{ {
return new SystemFile[1]; try
{
// load organization
Organization org = OrganizationController.GetOrganization(itemId);
if (org == null)
{
return null;
} }
private static SystemFile GetFolderInternal(int itemId, string folderName) EnterpriseStorage es = GetEnterpriseStorage(GetEnterpriseStorageServiceID(org.PackageId));
return es.GetFolders(org.OrganizationId);
}
catch (Exception ex)
{ {
return new SystemFile(); throw ex;
}
} }
private static ResultObject CreateFolderInternal(int itemId, string folderName, long quota) protected static SystemFile GetFolderInternal(int itemId, string folderName)
{ {
return new ResultObject(); try
{
// load organization
Organization org = OrganizationController.GetOrganization(itemId);
if (org == null)
{
return null;
} }
private static ResultObject DeleteFolderInternal(int itemId, string folderName) EnterpriseStorage es = GetEnterpriseStorage(GetEnterpriseStorageServiceID(org.PackageId));
{
return new ResultObject();
}
private static ResultObject SetFolderQuotaInternal(int itemId, string folderName, long quota) return es.GetFolder(org.OrganizationId, folderName);
}
catch (Exception ex)
{ {
return new ResultObject(); throw ex;
}
} }
public static bool CheckFileServicesInstallation(int serviceId) protected static SystemFile RenameFolderInternal(int itemId, string oldFolder, string newFolder)
{ {
EnterpriseStorage es = GetEnterpriseStorage(serviceId); try
return es.CheckFileServicesInstallation(); {
// load organization
Organization org = OrganizationController.GetOrganization(itemId);
if (org == null)
{
return null;
}
EnterpriseStorage es = GetEnterpriseStorage(GetEnterpriseStorageServiceID(org.PackageId));
return es.RenameFolder(org.OrganizationId, oldFolder, newFolder);
}
catch (Exception ex)
{
throw ex;
}
}
protected static ResultObject CreateFolderInternal(int itemId, string folderName)
{
ResultObject result = TaskManager.StartResultTask<ResultObject>("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;
}
protected static ResultObject DeleteFolderInternal(int itemId, string folderName)
{
ResultObject result = TaskManager.StartResultTask<ResultObject>("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<ExchangeAccount> 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}, {2}", ((int)ExchangeAccountType.SecurityGroup),
(int)ExchangeAccountType.DefaultSecurityGroup, ((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<ExchangeAccount> tmpAccounts = ObjectUtils.CreateListFromDataReader<ExchangeAccount>(
DataProvider.SearchExchangeAccountsByTypes(SecurityContext.User.UserId, itemId,
accountTypes, filterColumn, filterValue, sortColumn));
List<ExchangeAccount> exAccounts = new List<ExchangeAccount>();
foreach (ExchangeAccount tmpAccount in tmpAccounts.ToArray())
{
if (tmpAccount.AccountType == ExchangeAccountType.SecurityGroup || tmpAccount.AccountType == ExchangeAccountType.SecurityGroup
? OrganizationController.GetSecurityGroupGeneralSettings(itemId, tmpAccount.AccountId) == null
: OrganizationController.GetSecurityGroupGeneralSettings(itemId, tmpAccount.AccountId) == null)
continue;
exAccounts.Add(tmpAccount);
}
return exAccounts;
}
protected static SystemFilesPaged GetEnterpriseFoldersPagedInternal(int itemId, string filterValue, string sortColumn,
int startRow, int maximumRows)
{
SystemFilesPaged result = new SystemFilesPaged();
try
{
// load organization
Organization org = OrganizationController.GetOrganization(itemId);
if (org == null)
{
return null;
}
EnterpriseStorage es = GetEnterpriseStorage(GetEnterpriseStorageServiceID(org.PackageId));
List<SystemFile> 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;
}
protected static ResultObject SetFolderWebDavRulesInternal(int itemId, string folder, ESPermission[] permission)
{
ResultObject result = TaskManager.StartResultTask<ResultObject>("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<WebDavFolderRule>();
foreach (var permission in permissions)
{
var rule = new WebDavFolderRule();
var account = ObjectUtils.FillObjectFromDataReader<ExchangeAccount>(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(int itemId, WebDavFolderRule[] rules)
{
var permissions = new List<ESPermission>();
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();
var orgObj = OrganizationController.GetAccountByAccountName(itemId, permission.Account);
if (orgObj == null)
continue;
if (permission.IsGroup)
{
var secGroupObj = OrganizationController.GetSecurityGroupGeneralSettings(itemId, orgObj.AccountId);
if (secGroupObj == null)
continue;
permission.DisplayName = secGroupObj.DisplayName;
}
else
{
var userObj = OrganizationController.GetUserGeneralSettings(itemId, orgObj.AccountId);
if (userObj == null)
continue;
permission.DisplayName = userObj.DisplayName;
}
if (rule.Read && !rule.Write)
{
permission.Access = "Read-Only";
}
if (rule.Write)
{
permission.Access = "Read-Write";
}
permissions.Add(permission);
}
return permissions.ToArray();
} }
} }
} }

View file

@ -910,7 +910,7 @@ namespace WebsitePanel.EnterpriseServer
return users.ToArray(); 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 // check account
@ -929,8 +929,8 @@ namespace WebsitePanel.EnterpriseServer
// disk space quota // disk space quota
// This gets all the disk space allocated for a specific customer // This gets all the disk space allocated for a specific customer
// It includes the package Add Ons * Quatity + Hosting Plan System disk space value. // It includes the package Add Ons * Quatity + Hosting Plan System disk space value. //Quotas.OS_DISKSPACE
QuotaValueInfo diskSpaceQuota = PackageController.GetPackageQuota(packageId, Quotas.OS_DISKSPACE); QuotaValueInfo diskSpaceQuota = PackageController.GetPackageQuota(packageId, quotas);
#region figure Quota Unit #region figure Quota Unit
@ -1014,7 +1014,7 @@ namespace WebsitePanel.EnterpriseServer
continue; continue;
string homeFolder = FilesController.GetHomeFolder(childPackage.PackageId); string homeFolder = FilesController.GetHomeFolder(childPackage.PackageId);
FilesController.SetFolderQuota(childPackage.PackageId, homeFolder, driveName); FilesController.SetFolderQuota(childPackage.PackageId, homeFolder, driveName, Quotas.OS_DISKSPACE);
} }
} }
catch (Exception ex) catch (Exception ex)
@ -1027,7 +1027,6 @@ namespace WebsitePanel.EnterpriseServer
} }
return 0; return 0;
} }
public static int DeleteDirectoryRecursive(int packageId, string rootPath) public static int DeleteDirectoryRecursive(int packageId, string rootPath)

View file

@ -48,6 +48,7 @@ using System.IO;
using System.Xml; using System.Xml;
using System.Xml.Serialization; using System.Xml.Serialization;
using WebsitePanel.EnterpriseServer.Base.HostedSolution; using WebsitePanel.EnterpriseServer.Base.HostedSolution;
using WebsitePanel.Providers.OS;
namespace WebsitePanel.EnterpriseServer namespace WebsitePanel.EnterpriseServer
{ {
@ -417,6 +418,36 @@ namespace WebsitePanel.EnterpriseServer
}; };
PackageController.AddPackageItem(orgDomain); 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) catch (Exception ex)
{ {
@ -714,6 +745,26 @@ namespace WebsitePanel.EnterpriseServer
TaskManager.WriteError(ex); 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 //Cleanup Exchange
try try
@ -741,8 +792,6 @@ namespace WebsitePanel.EnterpriseServer
TaskManager.WriteError(ex); TaskManager.WriteError(ex);
} }
// delete organization domains // delete organization domains
List<OrganizationDomainName> domains = GetOrganizationDomains(itemId); List<OrganizationDomainName> domains = GetOrganizationDomains(itemId);
foreach (OrganizationDomainName domain in domains) foreach (OrganizationDomainName domain in domains)
@ -764,7 +813,6 @@ namespace WebsitePanel.EnterpriseServer
// delete meta-item // delete meta-item
PackageController.DeletePackageItem(itemId); PackageController.DeletePackageItem(itemId);
return successful ? 0 : BusinessErrorCodes.ERROR_ORGANIZATION_DELETE_SOME_PROBLEMS; return successful ? 0 : BusinessErrorCodes.ERROR_ORGANIZATION_DELETE_SOME_PROBLEMS;
} }
catch (Exception ex) catch (Exception ex)
@ -946,7 +994,13 @@ namespace WebsitePanel.EnterpriseServer
stats.CreatedLyncUsers = LyncController.GetLyncUsersCount(org.Id).Value; 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 else
{ {
@ -998,6 +1052,14 @@ namespace WebsitePanel.EnterpriseServer
{ {
stats.CreatedLyncUsers += LyncController.GetLyncUsersCount(o.Id).Value; 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; 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; return stats;
} }
catch (Exception ex) catch (Exception ex)

View file

@ -1011,7 +1011,7 @@ namespace WebsitePanel.EnterpriseServer
return; return;
string homeFolder = FilesController.GetHomeFolder(packageId); string homeFolder = FilesController.GetHomeFolder(packageId);
FilesController.SetFolderQuota(packageId, homeFolder, driveName); FilesController.SetFolderQuota(packageId, homeFolder, driveName, Quotas.OS_DISKSPACE);
} }

View file

@ -741,7 +741,6 @@ namespace WebsitePanel.EnterpriseServer
if (res != null) if (res != null)
{ {
res.IsSuccess = false; res.IsSuccess = false;
if (!string.IsNullOrEmpty(errorCode)) if (!string.IsNullOrEmpty(errorCode))
res.ErrorCodes.Add(errorCode); res.ErrorCodes.Add(errorCode);
} }

View file

@ -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) public static int UpdateVirtualDirectory(int siteItemId, WebVirtualDirectory vdir)
{ {
// check account // check account
@ -4528,5 +4619,57 @@ Please ensure the space has been allocated {0} IP address as a dedicated one and
return result; return result;
} }
#endregion #endregion
#region Directory Browsing
public static bool GetDirectoryBrowseEnabled(int itemId, string siteId)
{
// load organization
var org = OrganizationController.GetOrganization(itemId);
if (org == null)
{
return false;
}
siteId = RemoveProtocolFromUrl(siteId);
var webServer = GetWebServer(GetWebServerServiceID(org.PackageId));
return webServer.GetDirectoryBrowseEnabled(siteId);
}
public static void SetDirectoryBrowseEnabled(int itemId, string siteId, bool enabled)
{
// load organization
var org = OrganizationController.GetOrganization(itemId);
if (org == null)
{
return;
}
siteId = RemoveProtocolFromUrl(siteId);
var webServer = GetWebServer(GetWebServerServiceID(org.PackageId));
webServer.SetDirectoryBrowseEnabled(siteId, enabled);
}
private static string RemoveProtocolFromUrl(string input)
{
if (input.Contains("//"))
{
return System.Text.RegularExpressions.Regex.Split(input, "//")[1];
}
return input;
}
#endregion
private static int GetWebServerServiceID(int packageId)
{
return PackageController.GetPackageServiceId(packageId, ResourceGroups.Web);
}
} }
} }

View file

@ -42,6 +42,8 @@ using WebsitePanel.Providers.HostedSolution;
using WebsitePanel.Providers.EnterpriseStorage; using WebsitePanel.Providers.EnterpriseStorage;
using WebsitePanel.Providers.ResultObjects; using WebsitePanel.Providers.ResultObjects;
using WebsitePanel.Providers.OS; using WebsitePanel.Providers.OS;
using WebsitePanel.Providers.Web;
using WebsitePanel.EnterpriseServer.Base.HostedSolution;
namespace WebsitePanel.EnterpriseServer namespace WebsitePanel.EnterpriseServer
{ {
@ -74,12 +76,11 @@ namespace WebsitePanel.EnterpriseServer
} }
[WebMethod] [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] [WebMethod]
public ResultObject DeleteEnterpriseFolder(int itemId, string folderName) public ResultObject DeleteEnterpriseFolder(int itemId, string folderName)
{ {
@ -87,9 +88,33 @@ namespace WebsitePanel.EnterpriseServer
} }
[WebMethod] [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<ExchangeAccount> 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);
}
[WebMethod]
public SystemFile RenameEnterpriseFolder(int itemId, string oldName, string newName)
{
return EnterpriseStorageController.RenameFolder(itemId, oldName, newName);
} }
} }
} }

View file

@ -625,5 +625,22 @@ namespace WebsitePanel.EnterpriseServer
} }
#endregion #endregion
#region Directory Browsing
[WebMethod]
public bool GetDirectoryBrowseEnabled(int itemId, string site)
{
return WebServerController.GetDirectoryBrowseEnabled(itemId, site);
}
[WebMethod]
public void SetDirectoryBrowseEnabled(int itemId, string site, bool enabled)
{
WebServerController.SetDirectoryBrowseEnabled(itemId, site, enabled);
}
#endregion
} }
} }

View file

@ -29,6 +29,7 @@
using System; using System;
using System.Collections; using System.Collections;
using WebsitePanel.Providers.OS; using WebsitePanel.Providers.OS;
using WebsitePanel.Providers.Web;
namespace WebsitePanel.Providers.EnterpriseStorage namespace WebsitePanel.Providers.EnterpriseStorage
{ {
@ -38,10 +39,13 @@ namespace WebsitePanel.Providers.EnterpriseStorage
public interface IEnterpriseStorage public interface IEnterpriseStorage
{ {
SystemFile[] GetFolders(string organizationId); SystemFile[] GetFolders(string organizationId);
SystemFile GetFolder(string organizationId, string folder); SystemFile GetFolder(string organizationId, string folderName);
void CreateFolder(string organizationId, string folder); void CreateFolder(string organizationId, string folder);
SystemFile RenameFolder(string organizationId, string originalFolder, string newFolder);
void DeleteFolder(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(); bool CheckFileServicesInstallation();
} }
} }

View file

@ -27,7 +27,7 @@
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System; using System;
using WebsitePanel.Providers.Web;
namespace WebsitePanel.Providers.OS namespace WebsitePanel.Providers.OS
{ {
/// <summary> /// <summary>
@ -44,6 +44,8 @@ namespace WebsitePanel.Providers.OS
private long quota; private long quota;
private bool isEmpty; private bool isEmpty;
private bool isPublished; private bool isPublished;
private WebDavFolderRule[] rules;
private string url;
public SystemFile() public SystemFile()
{ {
@ -108,5 +110,16 @@ namespace WebsitePanel.Providers.OS
set { this.isPublished = value; } 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; }
}
} }
} }

View file

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

View file

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

View file

@ -32,6 +32,8 @@ using WebsitePanel.Providers.HostedSolution;
using WebsitePanel.Providers.ResultObjects; using WebsitePanel.Providers.ResultObjects;
using WebsitePanel.Providers.WebAppGallery; using WebsitePanel.Providers.WebAppGallery;
using WebsitePanel.Providers.Common; using WebsitePanel.Providers.Common;
using Microsoft.Web.Administration;
using Microsoft.Web.Management.Server;
namespace WebsitePanel.Providers.Web namespace WebsitePanel.Providers.Web
{ {
@ -166,6 +168,8 @@ namespace WebsitePanel.Providers.Web
SSLCertificate ImportCertificate(WebSite website); SSLCertificate ImportCertificate(WebSite website);
bool CheckCertificate(WebSite webSite); bool CheckCertificate(WebSite webSite);
//Directory Browseing
bool GetDirectoryBrowseEnabled(string siteId);
void SetDirectoryBrowseEnabled(string siteId, bool enabled);
} }
} }

View file

@ -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<string> Pathes { get; set; }
public List<string> Users { get; set; }
public List<string> 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<string>();
Users = new List<string>();
Roles = new List<string>();
}
}
}

View file

@ -57,6 +57,14 @@
<WarningsAsErrors>618</WarningsAsErrors> <WarningsAsErrors>618</WarningsAsErrors>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Microsoft.Web.Administration, Version=7.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Web.Administration.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Web.Management, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Web.Management.dll</HintPath>
</Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.DirectoryServices" /> <Reference Include="System.DirectoryServices" />
@ -105,6 +113,7 @@
<Compile Include="HostedSolution\LyncVoicePolicyType.cs" /> <Compile Include="HostedSolution\LyncVoicePolicyType.cs" />
<Compile Include="HostedSolution\OrganizationSecurityGroup.cs" /> <Compile Include="HostedSolution\OrganizationSecurityGroup.cs" />
<Compile Include="HostedSolution\TransactionAction.cs" /> <Compile Include="HostedSolution\TransactionAction.cs" />
<Compile Include="OS\SystemFilesPaged.cs" />
<Compile Include="RemoteDesktopServices\IRemoteDesktopServices.cs" /> <Compile Include="RemoteDesktopServices\IRemoteDesktopServices.cs" />
<Compile Include="ResultObjects\HeliconApe.cs" /> <Compile Include="ResultObjects\HeliconApe.cs" />
<Compile Include="HostedSolution\ExchangeMobileDevice.cs" /> <Compile Include="HostedSolution\ExchangeMobileDevice.cs" />
@ -315,10 +324,12 @@
<Compile Include="Web\HtaccessFolder.cs" /> <Compile Include="Web\HtaccessFolder.cs" />
<Compile Include="Web\HttpError.cs" /> <Compile Include="Web\HttpError.cs" />
<Compile Include="Web\HttpHeader.cs" /> <Compile Include="Web\HttpHeader.cs" />
<Compile Include="Web\IWebDav.cs" />
<Compile Include="Web\IWebServer.cs" /> <Compile Include="Web\IWebServer.cs" />
<Compile Include="Web\MimeMap.cs" /> <Compile Include="Web\MimeMap.cs" />
<Compile Include="Web\SharedSSLFolder.cs" /> <Compile Include="Web\SharedSSLFolder.cs" />
<Compile Include="Web\SSLCertificate.cs" /> <Compile Include="Web\SSLCertificate.cs" />
<Compile Include="Web\WebDavFolderRule.cs" />
<Compile Include="Web\WebFolder.cs" /> <Compile Include="Web\WebFolder.cs" />
<Compile Include="Web\WebGroup.cs" /> <Compile Include="Web\WebGroup.cs" />
<Compile Include="Web\WebSite.cs" /> <Compile Include="Web\WebSite.cs" />

View file

@ -39,6 +39,22 @@
<Project>{684C932A-6C75-46AC-A327-F3689D89EB42}</Project> <Project>{684C932A-6C75-46AC-A327-F3689D89EB42}</Project>
<Name>WebsitePanel.Providers.Base</Name> <Name>WebsitePanel.Providers.Base</Name>
</ProjectReference> </ProjectReference>
<ProjectReference Include="..\WebsitePanel.Providers.Web.IIs60\WebsitePanel.Providers.Web.IIs60.csproj">
<Project>{9be0317d-e42e-4ff6-9a87-8c801f046ea1}</Project>
<Name>WebsitePanel.Providers.Web.IIs60</Name>
</ProjectReference>
<ProjectReference Include="..\WebsitePanel.Providers.Web.IIS70\WebsitePanel.Providers.Web.IIs70.csproj">
<Project>{1b9dce85-c664-49fc-b6e1-86c63cab88d1}</Project>
<Name>WebsitePanel.Providers.Web.IIs70</Name>
</ProjectReference>
<ProjectReference Include="..\WebsitePanel.Providers.Web.IIs80\WebsitePanel.Providers.Web.IIs80.csproj">
<Project>{6e348968-461d-45a1-b235-4f552947b9f1}</Project>
<Name>WebsitePanel.Providers.Web.IIs80</Name>
</ProjectReference>
<ProjectReference Include="..\WebsitePanel.Providers.Web.WebDav\WebsitePanel.Providers.Web.WebDav.csproj">
<Project>{ce2df3d7-d6ff-48fa-b2ea-7b836fcbf698}</Project>
<Name>WebsitePanel.Providers.Web.WebDav</Name>
</ProjectReference>
<ProjectReference Include="..\WebsitePanel.Server.Utils\WebsitePanel.Server.Utils.csproj"> <ProjectReference Include="..\WebsitePanel.Server.Utils\WebsitePanel.Server.Utils.csproj">
<Project>{E91E52F3-9555-4D00-B577-2B1DBDD87CA7}</Project> <Project>{E91E52F3-9555-4D00-B577-2B1DBDD87CA7}</Project>
<Name>WebsitePanel.Server.Utils</Name> <Name>WebsitePanel.Server.Utils</Name>

View file

@ -36,63 +36,142 @@ using Microsoft.Win32;
using WebsitePanel.Server.Utils; using WebsitePanel.Server.Utils;
using WebsitePanel.Providers.Utils; using WebsitePanel.Providers.Utils;
using WebsitePanel.Providers.OS; using WebsitePanel.Providers.OS;
using WebsitePanel.Providers.Web;
namespace WebsitePanel.Providers.EnterpriseStorage namespace WebsitePanel.Providers.EnterpriseStorage
{ {
public class Windows2012 : HostingServiceProviderBase public class Windows2012 : HostingServiceProviderBase, IEnterpriseStorage
{ {
#region Properties #region Properties
protected string UsersHome protected string UsersHome
{ {
get { return FileUtils.EvaluateSystemVariables(ProviderSettings["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 #region Folders
public SystemFile[] GetFolders(string organizationId) 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(); ArrayList items = new ArrayList();
DirectoryInfo root = new DirectoryInfo(string.Format("{0}\\{1}", UsersHome, organizationId));
// get directories // get directories
DirectoryInfo[] dirs = root.GetDirectories(); DirectoryInfo[] dirs = root.GetDirectories();
foreach (DirectoryInfo dir in dirs) foreach (DirectoryInfo dir in dirs)
{ {
string fullName = System.IO.Path.Combine(string.Format("{0}\\{1}", UsersHome, organizationId), dir.Name); string fullName = System.IO.Path.Combine(rootPath, dir.Name);
SystemFile fi = new SystemFile(dir.Name, fullName, true, 0, dir.CreationTime, dir.LastWriteTime);
items.Add(fi); 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 // 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)); 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}\\{3}", LocationDrive, UsersHome, organizationId, folderName);
string fullName = string.Format("{0}\\{1}\\{2}", UsersHome, organizationId, folder);
return new SystemFile(root.Name, fullName, true, 0, root.CreationTime, root.LastWriteTime); 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) 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 SystemFile RenameFolder(string organizationId, string originalFolder, string newFolder)
{
var oldPath = string.Format("{0}:\\{1}\\{2}\\{3}", LocationDrive, UsersHome, organizationId, originalFolder);
var newPath = string.Format("{0}:\\{1}\\{2}\\{3}", LocationDrive, UsersHome, organizationId, newFolder);
FileUtils.MoveFile(oldPath,newPath);
IWebDav webdav = new WebDav(UsersDomain);
//deleting old folder rules
webdav.DeleteAllWebDavRules(organizationId, originalFolder);
return GetFolder(organizationId, newFolder);
} }
public void DeleteFolder(string organizationId, string 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();
} }
public void SetFolderQuota(string organizationId, string folder, long quota) // 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 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() public bool CheckFileServicesInstallation()
@ -103,6 +182,7 @@ namespace WebsitePanel.Providers.EnterpriseStorage
#endregion #endregion
#region HostingServiceProvider methods #region HostingServiceProvider methods
public override string[] Install() public override string[] Install()
{ {
List<string> messages = new List<string>(); List<string> messages = new List<string>();
@ -177,5 +257,6 @@ namespace WebsitePanel.Providers.EnterpriseStorage
Server.Utils.OS.WindowsVersion version = WebsitePanel.Server.Utils.OS.GetVersion(); Server.Utils.OS.WindowsVersion version = WebsitePanel.Server.Utils.OS.GetVersion();
return version == WebsitePanel.Server.Utils.OS.WindowsVersion.WindowsServer2012; return version == WebsitePanel.Server.Utils.OS.WindowsVersion.WindowsServer2012;
} }
} }
} }

View file

@ -3769,6 +3769,27 @@ namespace WebsitePanel.Providers.Web
return itemsDiskspace.ToArray(); return itemsDiskspace.ToArray();
} }
#endregion
#region Directory Browsing
public override bool GetDirectoryBrowseEnabled(string siteId)
{
using (ServerManager srvman = webObjectsSvc.GetServerManager())
{
var enabled = dirBrowseSvc.GetDirectoryBrowseSettings(srvman, siteId)[DirectoryBrowseGlobals.Enabled];
return enabled != null ? (bool)enabled : false;
}
}
public override void SetDirectoryBrowseEnabled(string siteId, bool enabled)
{
dirBrowseSvc.SetDirectoryBrowseEnabled(siteId, enabled);
}
#endregion #endregion
public override bool IsIISInstalled() public override bool IsIISInstalled()

View file

@ -56,6 +56,8 @@ using System.Xml.Serialization;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using WebsitePanel.Providers.Common; using WebsitePanel.Providers.Common;
using System.Collections.Specialized; using System.Collections.Specialized;
using Microsoft.Web.Administration;
using Microsoft.Web.Management.Server;
namespace WebsitePanel.Providers.Web namespace WebsitePanel.Providers.Web
{ {
@ -3412,6 +3414,27 @@ namespace WebsitePanel.Providers.Web
} }
#endregion #endregion
#region Directory Browsing
public virtual bool GetDirectoryBrowseEnabled(string siteId)
{
ManagementObject objVirtDir = wmi.GetObject(String.Format("IIsWebVirtualDirSetting='{0}'", GetVirtualDirectoryPath(siteId, "")));
return objVirtDir.Properties["EnableDirBrowsing"].Value != null ? (bool)objVirtDir.Properties["EnableDirBrowsing"].Value : false;
}
public virtual void SetDirectoryBrowseEnabled(string siteId, bool enabled)
{
ManagementObject objSite = wmi.GetObject(String.Format("IIsWebServerSetting='{0}'", siteId));
WebSite site = GetSite(siteId);
site.EnableDirectoryBrowsing = enabled;
FillWmiObjectFromVirtualDirectory(objSite, site, false);
objSite.Put();
}
#endregion
public virtual bool IsIISInstalled() public virtual bool IsIISInstalled()
{ {
int value = 0; int value = 0;
@ -3737,10 +3760,5 @@ namespace WebsitePanel.Providers.Web
throw new NotSupportedException(); throw new NotSupportedException();
} }
#endregion #endregion
} }
} }

View file

@ -67,11 +67,19 @@
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Lib\Microsoft.Practices.ObjectBuilder.dll</HintPath> <HintPath>..\..\Lib\Microsoft.Practices.ObjectBuilder.dll</HintPath>
</Reference> </Reference>
<Reference Include="Microsoft.Web.Administration, Version=7.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Web.Administration.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Web.Deployment, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <Reference Include="Microsoft.Web.Deployment, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Web.Deployment.dll</HintPath> <HintPath>..\..\Lib\References\Microsoft\Microsoft.Web.Deployment.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="Microsoft.Web.Management, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Web.Management.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Web.PlatformInstaller, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <Reference Include="Microsoft.Web.PlatformInstaller, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Web.PlatformInstaller.dll</HintPath> <HintPath>..\..\Lib\References\Microsoft\Microsoft.Web.PlatformInstaller.dll</HintPath>

View file

@ -30,6 +30,14 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Microsoft.Web.Administration, Version=7.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Web.Administration.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Web.Management, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Web.Management.dll</HintPath>
</Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />

View file

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

View file

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

View file

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

View file

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{CE2DF3D7-D6FF-48FA-B2EA-7B836FCBF698}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>WebsitePanel.Providers.Web.WebDav</RootNamespace>
<AssemblyName>WebsitePanel.Providers.Web.WebDav</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Web.Administration, Version=7.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Web.Administration.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="WebDav.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="WebDavExtensions.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\WebsitePanel.Providers.Base\WebsitePanel.Providers.Base.csproj">
<Project>{684c932a-6c75-46ac-a327-f3689d89eb42}</Project>
<Name>WebsitePanel.Providers.Base</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View file

@ -25,11 +25,10 @@
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // 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 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // 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 // Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. // the code is regenerated.
@ -37,14 +36,14 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// //
// 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.OS;
using WebsitePanel.Providers.Web;
namespace WebsitePanel.Providers.EnterpriseStorage { namespace WebsitePanel.Providers.EnterpriseStorage
{
using System.Xml.Serialization; using System.Xml.Serialization;
using System.Web.Services; using System.Web.Services;
using System.ComponentModel; using System.ComponentModel;
@ -54,12 +53,13 @@ namespace WebsitePanel.Providers.EnterpriseStorage {
/// <remarks/> /// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
[System.Diagnostics.DebuggerStepThroughAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")] [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))] [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; public ServiceProviderSettingsSoapHeader ServiceProviderSettingsSoapHeaderValue;
@ -71,13 +71,18 @@ namespace WebsitePanel.Providers.EnterpriseStorage {
private System.Threading.SendOrPostCallback DeleteFolderOperationCompleted; private System.Threading.SendOrPostCallback DeleteFolderOperationCompleted;
private System.Threading.SendOrPostCallback SetFolderQuotaOperationCompleted; private System.Threading.SendOrPostCallback SetFolderWebDavRulesOperationCompleted;
private System.Threading.SendOrPostCallback GetFolderWebDavRulesOperationCompleted;
private System.Threading.SendOrPostCallback CheckFileServicesInstallationOperationCompleted; private System.Threading.SendOrPostCallback CheckFileServicesInstallationOperationCompleted;
private System.Threading.SendOrPostCallback RenameFolderOperationCompleted;
/// <remarks/> /// <remarks/>
public EnterpriseStorage() { public EnterpriseStorage()
this.Url = "http://localhost:9003/EnterpriseStorage.asmx"; {
this.Url = "http://localhost:9004/EnterpriseStorage.asmx";
} }
/// <remarks/> /// <remarks/>
@ -93,48 +98,62 @@ namespace WebsitePanel.Providers.EnterpriseStorage {
public event DeleteFolderCompletedEventHandler DeleteFolderCompleted; public event DeleteFolderCompletedEventHandler DeleteFolderCompleted;
/// <remarks/> /// <remarks/>
public event SetFolderQuotaCompletedEventHandler SetFolderQuotaCompleted; public event SetFolderWebDavRulesCompletedEventHandler SetFolderWebDavRulesCompleted;
/// <remarks/>
public event GetFolderWebDavRulesCompletedEventHandler GetFolderWebDavRulesCompleted;
/// <remarks/> /// <remarks/>
public event CheckFileServicesInstallationCompletedEventHandler CheckFileServicesInstallationCompleted; public event CheckFileServicesInstallationCompletedEventHandler CheckFileServicesInstallationCompleted;
/// <remarks/>
public event RenameFolderCompletedEventHandler RenameFolderCompleted;
/// <remarks/> /// <remarks/>
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [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)] [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) { public SystemFile[] GetFolders(string organizationId)
{
object[] results = this.Invoke("GetFolders", new object[] { object[] results = this.Invoke("GetFolders", new object[] {
organizationId}); organizationId});
return ((SystemFile[])(results[0])); return ((SystemFile[])(results[0]));
} }
/// <remarks/> /// <remarks/>
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[] { return this.BeginInvoke("GetFolders", new object[] {
organizationId}, callback, asyncState); organizationId}, callback, asyncState);
} }
/// <remarks/> /// <remarks/>
public SystemFile[] EndGetFolders(System.IAsyncResult asyncResult) { public SystemFile[] EndGetFolders(System.IAsyncResult asyncResult)
{
object[] results = this.EndInvoke(asyncResult); object[] results = this.EndInvoke(asyncResult);
return ((SystemFile[])(results[0])); return ((SystemFile[])(results[0]));
} }
/// <remarks/> /// <remarks/>
public void GetFoldersAsync(string organizationId) { public void GetFoldersAsync(string organizationId)
{
this.GetFoldersAsync(organizationId, null); this.GetFoldersAsync(organizationId, null);
} }
/// <remarks/> /// <remarks/>
public void GetFoldersAsync(string organizationId, object userState) { public void GetFoldersAsync(string organizationId, object userState)
if ((this.GetFoldersOperationCompleted == null)) { {
if ((this.GetFoldersOperationCompleted == null))
{
this.GetFoldersOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetFoldersOperationCompleted); this.GetFoldersOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetFoldersOperationCompleted);
} }
this.InvokeAsync("GetFolders", new object[] { this.InvokeAsync("GetFolders", new object[] {
organizationId}, this.GetFoldersOperationCompleted, userState); organizationId}, this.GetFoldersOperationCompleted, userState);
} }
private void OnGetFoldersOperationCompleted(object arg) { private void OnGetFoldersOperationCompleted(object arg)
if ((this.GetFoldersCompleted != null)) { {
if ((this.GetFoldersCompleted != null))
{
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); 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)); this.GetFoldersCompleted(this, new GetFoldersCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
} }
@ -142,8 +161,9 @@ namespace WebsitePanel.Providers.EnterpriseStorage {
/// <remarks/> /// <remarks/>
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [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)] [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) { public SystemFile GetFolder(string organizationId, string folder)
{
object[] results = this.Invoke("GetFolder", new object[] { object[] results = this.Invoke("GetFolder", new object[] {
organizationId, organizationId,
folder}); folder});
@ -151,26 +171,31 @@ namespace WebsitePanel.Providers.EnterpriseStorage {
} }
/// <remarks/> /// <remarks/>
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[] { return this.BeginInvoke("GetFolder", new object[] {
organizationId, organizationId,
folder}, callback, asyncState); folder}, callback, asyncState);
} }
/// <remarks/> /// <remarks/>
public SystemFile EndGetFolder(System.IAsyncResult asyncResult) { public SystemFile EndGetFolder(System.IAsyncResult asyncResult)
{
object[] results = this.EndInvoke(asyncResult); object[] results = this.EndInvoke(asyncResult);
return ((SystemFile)(results[0])); return ((SystemFile)(results[0]));
} }
/// <remarks/> /// <remarks/>
public void GetFolderAsync(string organizationId, string folder) { public void GetFolderAsync(string organizationId, string folder)
{
this.GetFolderAsync(organizationId, folder, null); this.GetFolderAsync(organizationId, folder, null);
} }
/// <remarks/> /// <remarks/>
public void GetFolderAsync(string organizationId, string folder, object userState) { public void GetFolderAsync(string organizationId, string folder, object userState)
if ((this.GetFolderOperationCompleted == null)) { {
if ((this.GetFolderOperationCompleted == null))
{
this.GetFolderOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetFolderOperationCompleted); this.GetFolderOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetFolderOperationCompleted);
} }
this.InvokeAsync("GetFolder", new object[] { this.InvokeAsync("GetFolder", new object[] {
@ -178,8 +203,10 @@ namespace WebsitePanel.Providers.EnterpriseStorage {
folder}, this.GetFolderOperationCompleted, userState); folder}, this.GetFolderOperationCompleted, userState);
} }
private void OnGetFolderOperationCompleted(object arg) { private void OnGetFolderOperationCompleted(object arg)
if ((this.GetFolderCompleted != null)) { {
if ((this.GetFolderCompleted != null))
{
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); 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)); this.GetFolderCompleted(this, new GetFolderCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
} }
@ -187,33 +214,39 @@ namespace WebsitePanel.Providers.EnterpriseStorage {
/// <remarks/> /// <remarks/>
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [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)] [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) { public void CreateFolder(string organizationId, string folder)
{
this.Invoke("CreateFolder", new object[] { this.Invoke("CreateFolder", new object[] {
organizationId, organizationId,
folder}); folder});
} }
/// <remarks/> /// <remarks/>
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[] { return this.BeginInvoke("CreateFolder", new object[] {
organizationId, organizationId,
folder}, callback, asyncState); folder}, callback, asyncState);
} }
/// <remarks/> /// <remarks/>
public void EndCreateFolder(System.IAsyncResult asyncResult) { public void EndCreateFolder(System.IAsyncResult asyncResult)
{
this.EndInvoke(asyncResult); this.EndInvoke(asyncResult);
} }
/// <remarks/> /// <remarks/>
public void CreateFolderAsync(string organizationId, string folder) { public void CreateFolderAsync(string organizationId, string folder)
{
this.CreateFolderAsync(organizationId, folder, null); this.CreateFolderAsync(organizationId, folder, null);
} }
/// <remarks/> /// <remarks/>
public void CreateFolderAsync(string organizationId, string folder, object userState) { public void CreateFolderAsync(string organizationId, string folder, object userState)
if ((this.CreateFolderOperationCompleted == null)) { {
if ((this.CreateFolderOperationCompleted == null))
{
this.CreateFolderOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateFolderOperationCompleted); this.CreateFolderOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCreateFolderOperationCompleted);
} }
this.InvokeAsync("CreateFolder", new object[] { this.InvokeAsync("CreateFolder", new object[] {
@ -221,8 +254,10 @@ namespace WebsitePanel.Providers.EnterpriseStorage {
folder}, this.CreateFolderOperationCompleted, userState); folder}, this.CreateFolderOperationCompleted, userState);
} }
private void OnCreateFolderOperationCompleted(object arg) { private void OnCreateFolderOperationCompleted(object arg)
if ((this.CreateFolderCompleted != null)) { {
if ((this.CreateFolderCompleted != null))
{
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); 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)); this.CreateFolderCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
} }
@ -230,33 +265,39 @@ namespace WebsitePanel.Providers.EnterpriseStorage {
/// <remarks/> /// <remarks/>
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [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)] [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) { public void DeleteFolder(string organizationId, string folder)
{
this.Invoke("DeleteFolder", new object[] { this.Invoke("DeleteFolder", new object[] {
organizationId, organizationId,
folder}); folder});
} }
/// <remarks/> /// <remarks/>
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[] { return this.BeginInvoke("DeleteFolder", new object[] {
organizationId, organizationId,
folder}, callback, asyncState); folder}, callback, asyncState);
} }
/// <remarks/> /// <remarks/>
public void EndDeleteFolder(System.IAsyncResult asyncResult) { public void EndDeleteFolder(System.IAsyncResult asyncResult)
{
this.EndInvoke(asyncResult); this.EndInvoke(asyncResult);
} }
/// <remarks/> /// <remarks/>
public void DeleteFolderAsync(string organizationId, string folder) { public void DeleteFolderAsync(string organizationId, string folder)
{
this.DeleteFolderAsync(organizationId, folder, null); this.DeleteFolderAsync(organizationId, folder, null);
} }
/// <remarks/> /// <remarks/>
public void DeleteFolderAsync(string organizationId, string folder, object userState) { public void DeleteFolderAsync(string organizationId, string folder, object userState)
if ((this.DeleteFolderOperationCompleted == null)) { {
if ((this.DeleteFolderOperationCompleted == null))
{
this.DeleteFolderOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteFolderOperationCompleted); this.DeleteFolderOperationCompleted = new System.Threading.SendOrPostCallback(this.OnDeleteFolderOperationCompleted);
} }
this.InvokeAsync("DeleteFolder", new object[] { this.InvokeAsync("DeleteFolder", new object[] {
@ -264,8 +305,10 @@ namespace WebsitePanel.Providers.EnterpriseStorage {
folder}, this.DeleteFolderOperationCompleted, userState); folder}, this.DeleteFolderOperationCompleted, userState);
} }
private void OnDeleteFolderOperationCompleted(object arg) { private void OnDeleteFolderOperationCompleted(object arg)
if ((this.DeleteFolderCompleted != null)) { {
if ((this.DeleteFolderCompleted != null))
{
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); 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)); this.DeleteFolderCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
} }
@ -273,115 +316,247 @@ namespace WebsitePanel.Providers.EnterpriseStorage {
/// <remarks/> /// <remarks/>
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [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)] [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 void SetFolderQuota(string organizationId, string folder, long quota) { public bool SetFolderWebDavRules(string organizationId, string folder, WebDavFolderRule[] rules)
this.Invoke("SetFolderQuota", new object[] { {
object[] results = this.Invoke("SetFolderWebDavRules", new object[] {
organizationId, organizationId,
folder, folder,
quota}); rules});
}
/// <remarks/>
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);
}
/// <remarks/>
public void EndSetFolderQuota(System.IAsyncResult asyncResult) {
this.EndInvoke(asyncResult);
}
/// <remarks/>
public void SetFolderQuotaAsync(string organizationId, string folder, long quota) {
this.SetFolderQuotaAsync(organizationId, folder, quota, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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() {
object[] results = this.Invoke("CheckFileServicesInstallation", new object[0]);
return ((bool)(results[0])); return ((bool)(results[0]));
} }
/// <remarks/> /// <remarks/>
public System.IAsyncResult BeginCheckFileServicesInstallation(System.AsyncCallback callback, object asyncState) { public System.IAsyncResult BeginSetFolderWebDavRules(string organizationId, string folder, WebDavFolderRule[] rules, System.AsyncCallback callback, object asyncState)
return this.BeginInvoke("CheckFileServicesInstallation", new object[0], callback, asyncState); {
return this.BeginInvoke("SetFolderWebDavRules", new object[] {
organizationId,
folder,
rules}, callback, asyncState);
} }
/// <remarks/> /// <remarks/>
public bool EndCheckFileServicesInstallation(System.IAsyncResult asyncResult) { public bool EndSetFolderWebDavRules(System.IAsyncResult asyncResult)
{
object[] results = this.EndInvoke(asyncResult); object[] results = this.EndInvoke(asyncResult);
return ((bool)(results[0])); return ((bool)(results[0]));
} }
/// <remarks/> /// <remarks/>
public void CheckFileServicesInstallationAsync() { public void SetFolderWebDavRulesAsync(string organizationId, string folder, WebDavFolderRule[] rules)
{
this.SetFolderWebDavRulesAsync(organizationId, folder, rules, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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]));
}
/// <remarks/>
public System.IAsyncResult BeginGetFolderWebDavRules(string organizationId, string folder, System.AsyncCallback callback, object asyncState)
{
return this.BeginInvoke("GetFolderWebDavRules", new object[] {
organizationId,
folder}, callback, asyncState);
}
/// <remarks/>
public WebDavFolderRule[] EndGetFolderWebDavRules(System.IAsyncResult asyncResult)
{
object[] results = this.EndInvoke(asyncResult);
return ((WebDavFolderRule[])(results[0]));
}
/// <remarks/>
public void GetFolderWebDavRulesAsync(string organizationId, string folder)
{
this.GetFolderWebDavRulesAsync(organizationId, folder, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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()
{
object[] results = this.Invoke("CheckFileServicesInstallation", new object[0]);
return ((bool)(results[0]));
}
/// <remarks/>
public System.IAsyncResult BeginCheckFileServicesInstallation(System.AsyncCallback callback, object asyncState)
{
return this.BeginInvoke("CheckFileServicesInstallation", new object[0], callback, asyncState);
}
/// <remarks/>
public bool EndCheckFileServicesInstallation(System.IAsyncResult asyncResult)
{
object[] results = this.EndInvoke(asyncResult);
return ((bool)(results[0]));
}
/// <remarks/>
public void CheckFileServicesInstallationAsync()
{
this.CheckFileServicesInstallationAsync(null); this.CheckFileServicesInstallationAsync(null);
} }
/// <remarks/> /// <remarks/>
public void CheckFileServicesInstallationAsync(object userState) { public void CheckFileServicesInstallationAsync(object userState)
if ((this.CheckFileServicesInstallationOperationCompleted == null)) { {
if ((this.CheckFileServicesInstallationOperationCompleted == null))
{
this.CheckFileServicesInstallationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCheckFileServicesInstallationOperationCompleted); this.CheckFileServicesInstallationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCheckFileServicesInstallationOperationCompleted);
} }
this.InvokeAsync("CheckFileServicesInstallation", new object[0], this.CheckFileServicesInstallationOperationCompleted, userState); this.InvokeAsync("CheckFileServicesInstallation", new object[0], this.CheckFileServicesInstallationOperationCompleted, userState);
} }
private void OnCheckFileServicesInstallationOperationCompleted(object arg) { private void OnCheckFileServicesInstallationOperationCompleted(object arg)
if ((this.CheckFileServicesInstallationCompleted != null)) { {
if ((this.CheckFileServicesInstallationCompleted != null))
{
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); 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)); this.CheckFileServicesInstallationCompleted(this, new CheckFileServicesInstallationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
} }
} }
/// <remarks/> /// <remarks/>
public new void CancelAsync(object userState) { [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/RenameFolder", 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 RenameFolder(string organizationId, string originalFolder, string newFolder)
{
object[] results = this.Invoke("RenameFolder", new object[] {
organizationId,
originalFolder,
newFolder});
return ((SystemFile)(results[0]));
}
/// <remarks/>
public System.IAsyncResult BeginRenameFolder(string organizationId, string originalFolder, string newFolder, System.AsyncCallback callback, object asyncState)
{
return this.BeginInvoke("RenameFolder", new object[] {
organizationId,
originalFolder,
newFolder}, callback, asyncState);
}
/// <remarks/>
public SystemFile EndRenameFolder(System.IAsyncResult asyncResult)
{
object[] results = this.EndInvoke(asyncResult);
return ((SystemFile)(results[0]));
}
/// <remarks/>
public void RenameFolderAsync(string organizationId, string originalFolder, string newFolder)
{
this.RenameFolderAsync(organizationId, originalFolder, newFolder, null);
}
/// <remarks/>
public void RenameFolderAsync(string organizationId, string originalFolder, string newFolder, object userState)
{
if ((this.RenameFolderOperationCompleted == null))
{
this.RenameFolderOperationCompleted = new System.Threading.SendOrPostCallback(this.OnRenameFolderOperationCompleted);
}
this.InvokeAsync("RenameFolder", new object[] {
organizationId,
originalFolder,
newFolder}, this.RenameFolderOperationCompleted, userState);
}
private void OnRenameFolderOperationCompleted(object arg)
{
if ((this.RenameFolderCompleted != null))
{
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.RenameFolderCompleted(this, new RenameFolderCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
public new void CancelAsync(object userState)
{
base.CancelAsync(userState); base.CancelAsync(userState);
} }
} }
/// <remarks/> /// <remarks/>
[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); public delegate void GetFoldersCompletedEventHandler(object sender, GetFoldersCompletedEventArgs e);
/// <remarks/> /// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
[System.Diagnostics.DebuggerStepThroughAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")] [System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class GetFoldersCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { public partial class GetFoldersCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs
{
private object[] results; private object[] results;
internal GetFoldersCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : internal GetFoldersCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) { base(exception, cancelled, userState)
{
this.results = results; this.results = results;
} }
/// <remarks/> /// <remarks/>
public SystemFile[] Result { public SystemFile[] Result
get { {
get
{
this.RaiseExceptionIfNecessary(); this.RaiseExceptionIfNecessary();
return ((SystemFile[])(this.results[0])); return ((SystemFile[])(this.results[0]));
} }
@ -389,25 +564,29 @@ namespace WebsitePanel.Providers.EnterpriseStorage {
} }
/// <remarks/> /// <remarks/>
[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); public delegate void GetFolderCompletedEventHandler(object sender, GetFolderCompletedEventArgs e);
/// <remarks/> /// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
[System.Diagnostics.DebuggerStepThroughAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")] [System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class GetFolderCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { public partial class GetFolderCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs
{
private object[] results; private object[] results;
internal GetFolderCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : internal GetFolderCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) { base(exception, cancelled, userState)
{
this.results = results; this.results = results;
} }
/// <remarks/> /// <remarks/>
public SystemFile Result { public SystemFile Result
get { {
get
{
this.RaiseExceptionIfNecessary(); this.RaiseExceptionIfNecessary();
return ((SystemFile)(this.results[0])); return ((SystemFile)(this.results[0]));
} }
@ -415,40 +594,130 @@ namespace WebsitePanel.Providers.EnterpriseStorage {
} }
/// <remarks/> /// <remarks/>
[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); public delegate void CreateFolderCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
/// <remarks/> /// <remarks/>
[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); public delegate void DeleteFolderCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
/// <remarks/> /// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void SetFolderQuotaCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); public delegate void SetFolderWebDavRulesCompletedEventHandler(object sender, SetFolderWebDavRulesCompletedEventArgs e);
/// <remarks/> /// <remarks/>
[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);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
[System.Diagnostics.DebuggerStepThroughAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")] [System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class CheckFileServicesInstallationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { public partial class SetFolderWebDavRulesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs
{
private object[] results; private object[] results;
internal CheckFileServicesInstallationCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : internal SetFolderWebDavRulesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) { base(exception, cancelled, userState)
{
this.results = results; this.results = results;
} }
/// <remarks/> /// <remarks/>
public bool Result { public bool Result
get { {
get
{
this.RaiseExceptionIfNecessary(); this.RaiseExceptionIfNecessary();
return ((bool)(this.results[0])); return ((bool)(this.results[0]));
} }
} }
} }
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void GetFolderWebDavRulesCompletedEventHandler(object sender, GetFolderWebDavRulesCompletedEventArgs e);
/// <remarks/>
[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;
}
/// <remarks/>
public WebDavFolderRule[] Result
{
get
{
this.RaiseExceptionIfNecessary();
return ((WebDavFolderRule[])(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void CheckFileServicesInstallationCompletedEventHandler(object sender, CheckFileServicesInstallationCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
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)
{
this.results = results;
}
/// <remarks/>
public bool Result
{
get
{
this.RaiseExceptionIfNecessary();
return ((bool)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void RenameFolderCompletedEventHandler(object sender, RenameFolderCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class RenameFolderCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs
{
private object[] results;
internal RenameFolderCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState)
{
this.results = results;
}
/// <remarks/>
public SystemFile Result
{
get
{
this.RaiseExceptionIfNecessary();
return ((SystemFile)(this.results[0]));
}
}
}
} }

View file

@ -127,6 +127,9 @@
<Install>true</Install> <Install>true</Install>
</BootstrapperPackage> </BootstrapperPackage>
</ItemGroup> </ItemGroup>
<ItemGroup>
<WCFMetadata Include="Service References\" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets. Other similar extension points exist, see Microsoft.Common.targets.

View file

@ -777,6 +777,11 @@ namespace WebsitePanel.Providers.Utils
return CalculateFolderSize(path, out files, out folders); return CalculateFolderSize(path, out files, out folders);
} }
public static int BytesToMb(long bytes)
{
return (int)bytes / (1024 * 1024);
}
private static long CalculateFolderSize(string path, out int files, out int folders) private static long CalculateFolderSize(string path, out int files, out int folders)
{ {
files = 0; files = 0;
@ -874,8 +879,6 @@ namespace WebsitePanel.Providers.Utils
Directory.Delete(treeRoot.FullName, true); Directory.Delete(treeRoot.FullName, true);
} }
} }
public static void SetQuotaLimitOnFolder(string folderPath, string shareNameDrive, string quotaLimit, int mode, string wmiUserName, string wmiPassword) public static void SetQuotaLimitOnFolder(string folderPath, string shareNameDrive, string quotaLimit, int mode, string wmiUserName, string wmiPassword)

View file

@ -140,6 +140,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebsitePanel.Providers.Ente
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebsitePanel.Providers.HostedSolution.Lync2013HP", "WebsitePanel.Providers.HostedSolution.Lync2013HP\WebsitePanel.Providers.HostedSolution.Lync2013HP.csproj", "{D92F6235-8E5D-47C1-B96A-A2BE40E17889}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebsitePanel.Providers.HostedSolution.Lync2013HP", "WebsitePanel.Providers.HostedSolution.Lync2013HP\WebsitePanel.Providers.HostedSolution.Lync2013HP.csproj", "{D92F6235-8E5D-47C1-B96A-A2BE40E17889}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebsitePanel.Providers.Web.WebDav", "WebsitePanel.Providers.Web.WebDav\WebsitePanel.Providers.Web.WebDav.csproj", "{CE2DF3D7-D6FF-48FA-B2EA-7B836FCBF698}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -720,6 +722,16 @@ Global
{D92F6235-8E5D-47C1-B96A-A2BE40E17889}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {D92F6235-8E5D-47C1-B96A-A2BE40E17889}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{D92F6235-8E5D-47C1-B96A-A2BE40E17889}.Release|Mixed Platforms.Build.0 = Release|Any CPU {D92F6235-8E5D-47C1-B96A-A2BE40E17889}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{D92F6235-8E5D-47C1-B96A-A2BE40E17889}.Release|x86.ActiveCfg = Release|Any CPU {D92F6235-8E5D-47C1-B96A-A2BE40E17889}.Release|x86.ActiveCfg = Release|Any CPU
{CE2DF3D7-D6FF-48FA-B2EA-7B836FCBF698}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CE2DF3D7-D6FF-48FA-B2EA-7B836FCBF698}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CE2DF3D7-D6FF-48FA-B2EA-7B836FCBF698}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{CE2DF3D7-D6FF-48FA-B2EA-7B836FCBF698}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{CE2DF3D7-D6FF-48FA-B2EA-7B836FCBF698}.Debug|x86.ActiveCfg = Debug|Any CPU
{CE2DF3D7-D6FF-48FA-B2EA-7B836FCBF698}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CE2DF3D7-D6FF-48FA-B2EA-7B836FCBF698}.Release|Any CPU.Build.0 = Release|Any CPU
{CE2DF3D7-D6FF-48FA-B2EA-7B836FCBF698}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{CE2DF3D7-D6FF-48FA-B2EA-7B836FCBF698}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{CE2DF3D7-D6FF-48FA-B2EA-7B836FCBF698}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE

View file

@ -123,19 +123,34 @@ namespace WebsitePanel.Server
} }
} }
[WebMethod, SoapHeader("settings")] [WebMethod, SoapHeader("settings")]
public void SetFolderQuota(string organizationId, string folder, long quota) public bool SetFolderWebDavRules(string organizationId, string folder, Providers.Web.WebDavFolderRule[] rules)
{ {
try try
{ {
Log.WriteStart("'{0}' SetFolderQuota", ProviderSettings.ProviderName); Log.WriteStart("'{0}' SetFolderWebDavRules", ProviderSettings.ProviderName);
EnterpriseStorageProvider.SetFolderQuota(organizationId, folder,quota); return EnterpriseStorageProvider.SetFolderWebDavRules(organizationId, folder, rules);
Log.WriteEnd("'{0}' SetFolderQuota", ProviderSettings.ProviderName); Log.WriteEnd("'{0}' SetFolderWebDavRules", ProviderSettings.ProviderName);
} }
catch (Exception ex) catch (Exception ex)
{ {
Log.WriteError(String.Format("'{0}' SetFolderQuota", ProviderSettings.ProviderName), ex); Log.WriteError(String.Format("'{0}' SetFolderWebDavRules", ProviderSettings.ProviderName), ex);
throw;
}
}
[WebMethod, SoapHeader("settings")]
public Providers.Web.WebDavFolderRule[] GetFolderWebDavRules(string organizationId, string folder)
{
try
{
Log.WriteStart("'{0}' GetFolderWebDavRules", ProviderSettings.ProviderName);
return EnterpriseStorageProvider.GetFolderWebDavRules(organizationId, folder);
Log.WriteEnd("'{0}' GetFolderWebDavRules", ProviderSettings.ProviderName);
}
catch (Exception ex)
{
Log.WriteError(String.Format("'{0}' GetFolderWebDavRules", ProviderSettings.ProviderName), ex);
throw; throw;
} }
} }
@ -156,6 +171,20 @@ namespace WebsitePanel.Server
} }
} }
[WebMethod, SoapHeader("settings")]
public SystemFile RenameFolder(string organizationId, string originalFolder, string newFolder)
{
try
{
Log.WriteStart("'{0}' RenameFolder", ProviderSettings.ProviderName);
return EnterpriseStorageProvider.RenameFolder(organizationId, originalFolder, newFolder);
Log.WriteEnd("'{0}' RenameFolder", ProviderSettings.ProviderName);
}
catch (Exception ex)
{
Log.WriteError(String.Format("'{0}' RenameFolder", ProviderSettings.ProviderName), ex);
throw;
}
}
} }
} }

View file

@ -42,6 +42,8 @@ using WebsitePanel.Server.Utils;
using WebsitePanel.Providers.ResultObjects; using WebsitePanel.Providers.ResultObjects;
using WebsitePanel.Providers.WebAppGallery; using WebsitePanel.Providers.WebAppGallery;
using WebsitePanel.Providers.Common; using WebsitePanel.Providers.Common;
using Microsoft.Web.Administration;
using Microsoft.Web.Management.Server;
namespace WebsitePanel.Server namespace WebsitePanel.Server
{ {
@ -1621,5 +1623,21 @@ namespace WebsitePanel.Server
return WebProvider.CheckCertificate(webSite); return WebProvider.CheckCertificate(webSite);
} }
#endregion #endregion
#region Directory Browsing
[WebMethod, SoapHeader("settings")]
public bool GetDirectoryBrowseEnabled(string siteId)
{
return WebProvider.GetDirectoryBrowseEnabled(siteId);
}
[WebMethod, SoapHeader("settings")]
public void SetDirectoryBrowseEnabled(string siteId, bool enabled)
{
WebProvider.SetDirectoryBrowseEnabled(siteId, enabled);
}
#endregion
} }
} }

View file

@ -47,11 +47,19 @@
<WarningsAsErrors>618</WarningsAsErrors> <WarningsAsErrors>618</WarningsAsErrors>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Microsoft.Web.Administration, Version=7.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Web.Administration.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Web.Deployment, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <Reference Include="Microsoft.Web.Deployment, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Web.Deployment.dll</HintPath> <HintPath>..\..\Lib\References\Microsoft\Microsoft.Web.Deployment.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="Microsoft.Web.Management, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Web.Management.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Web.PlatformInstaller, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <Reference Include="Microsoft.Web.PlatformInstaller, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Web.PlatformInstaller.dll</HintPath> <HintPath>..\..\Lib\References\Microsoft\Microsoft.Web.PlatformInstaller.dll</HintPath>

View file

@ -550,7 +550,9 @@
<Control key="secur_group_settings" src="WebsitePanel/ExchangeServer/OrganizationSecurityGroupGeneralSettings.ascx" title="OrganizationSecurityGroup" type="View" /> <Control key="secur_group_settings" src="WebsitePanel/ExchangeServer/OrganizationSecurityGroupGeneralSettings.ascx" title="OrganizationSecurityGroup" type="View" />
<Control key="secur_group_memberof" src="WebsitePanel/ExchangeServer/OrganizationSecurityGroupMemberOf.ascx" title="OrganizationSecurityGroupMemberOf" type="View" /> <Control key="secur_group_memberof" src="WebsitePanel/ExchangeServer/OrganizationSecurityGroupMemberOf.ascx" title="OrganizationSecurityGroupMemberOf" type="View" />
<Control key="enterprisestorage_spaces" src="WebsitePanel/ExchangeServer/EnterpriseStorageSpaces.ascx" title="EnterpriseStorageSpaces" type="View" /> <Control key="enterprisestorage_folders" src="WebsitePanel/ExchangeServer/EnterpriseStorageFolders.ascx" title="Enterprise Storage Folders" type="View" />
<Control key="create_enterprisestorage_folder" src="WebsitePanel/ExchangeServer/EnterpriseStorageCreateFolder.ascx" title="Create New ES Folder" type="View" />
<Control key="enterprisestorage_folder_settings" src="WebsitePanel/ExchangeServer/EnterpriseStorageFolderGeneralSettings.ascx" title="Edit ES Folder" type="View" />
</Controls> </Controls>
</ModuleDefinition> </ModuleDefinition>

View file

@ -191,5 +191,9 @@ namespace WebsitePanel.Portal
get { return HttpContext.Current.Request["Context"]; } get { return HttpContext.Current.Request["Context"]; }
} }
public static string FolderID
{
get { return HttpContext.Current.Request["FolderID"] ?? ""; }
}
} }
} }

View file

@ -0,0 +1,29 @@
using WebsitePanel.Providers.OS;
namespace WebsitePanel.Portal
{
public class EnterpriseStorageHelper
{
#region Folders
SystemFilesPaged folders;
public int GetEnterpriseFoldersPagedCount(int itemId, string filterValue)
{
return folders.RecordsCount;
}
public SystemFile[] GetEnterpriseFoldersPaged(int itemId, string filterValue,
int maximumRows, int startRowIndex, string sortColumn)
{
filterValue = filterValue ?? string.Empty;
folders = ES.Services.EnterpriseStorage.GetEnterpriseFoldersPaged(itemId,
filterValue, sortColumn, startRowIndex, maximumRows);
return folders.PageItems;
}
#endregion
}
}

View file

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

View file

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

View file

@ -0,0 +1,156 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="btnAddFolder.Text" xml:space="preserve">
<value>Create New Folder</value>
</data>
<data name="cmdDelete.OnClientClick" xml:space="preserve">
<value>if(!confirm('Are you sure you want to delete selected folder?')) return false; else ShowProgressDialog('Deleting Folder...');</value>
</data>
<data name="cmdDelete.Text" xml:space="preserve">
<value>Delete</value>
</data>
<data name="cmdDelete.ToolTip" xml:space="preserve">
<value>Delete Folder</value>
</data>
<data name="gvFolders.Empty" xml:space="preserve">
<value>No folders have been added yet. To add a new folder click "Create New Folder" button.</value>
</data>
<data name="HSFormComments.Text" xml:space="preserve">
<value />
</data>
<data name="locQuota.Text" xml:space="preserve">
<value>Total Folders Allocated:</value>
</data>
<data name="Text.PageName" xml:space="preserve">
<value>Folders</value>
</data>
<data name="gvFolderName.Header" xml:space="preserve">
<value>Folder Name</value>
</data>
<data name="gvFolderSize.Header" xml:space="preserve">
<value>Folder Size</value>
</data>
<data name="locTitle" xml:space="preserve">
<value>Folders</value>
</data>
<data name="gvFolderUrl.Header" xml:space="preserve">
<value>Url</value>
</data>
</root>

View file

@ -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" %>
<wsp:EnableAsyncTasksSupport id="asyncTasks" runat="server"/>
<div id="ExchangeContainer">
<div class="Module">
<div class="Header">
<wsp:Breadcrumb id="breadcrumb" runat="server" PageName="Text.PageName" />
</div>
<div class="Left">
<wsp:Menu id="menu" runat="server" SelectedItem="esfolders" />
</div>
<div class="Content">
<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" />
</div>
<div class="FormBody">
<wsp:SimpleMessageBox id="messageBox" runat="server" />
<table>
<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:RequiredFieldValidator ID="valRequireFolderName" runat="server" meta:resourcekey="valRequireFolderName" ControlToValidate="txtFolderName"
ErrorMessage="Enter Folder Name" ValidationGroup="CreateFolder" Display="Dynamic" Text="*" SetFocusOnError="True"></asp:RequiredFieldValidator>
</td>
</tr>
</table>
<div class="FormFooterClean">
<asp:Button id="btnCreate" runat="server" Text="Create Folder" CssClass="Button1" meta:resourcekey="btnCreate" ValidationGroup="CreateFolder" OnClick="btnCreate_Click"></asp:Button>
<asp:ValidationSummary ID="valSummary" runat="server" ShowMessageBox="True" ShowSummary="False" ValidationGroup="CreateFolder" />
</div>
</div>
</div>
</div>
</div>
</div>

View file

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

View file

@ -0,0 +1,151 @@
// 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.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WebsitePanel.Portal.ExchangeServer {
public partial class EnterpriseStorageCreateFolder {
/// <summary>
/// asyncTasks control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks;
/// <summary>
/// breadcrumb control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Breadcrumb breadcrumb;
/// <summary>
/// menu control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Menu menu;
/// <summary>
/// imgESS control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Image imgESS;
/// <summary>
/// locTitle control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locTitle;
/// <summary>
/// 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>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox;
/// <summary>
/// locFolderName 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 locFolderName;
/// <summary>
/// txtFolderName 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 txtFolderName;
/// <summary>
/// valRequireFolderName 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 valRequireFolderName;
/// <summary>
/// btnCreate control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnCreate;
/// <summary>
/// valSummary control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.ValidationSummary valSummary;
}
}

View file

@ -0,0 +1,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" %>
<wsp:EnableAsyncTasksSupport id="asyncTasks" runat="server"/>
<div id="ExchangeContainer">
<div class="Module">
<div class="Header">
<wsp:Breadcrumb id="breadcrumb" runat="server" PageName="Text.PageName" />
</div>
<div class="Left">
<wsp:Menu id="menu" runat="server" SelectedItem="esfolders" />
</div>
<div class="Content">
<div class="Center">
<div class="Title">
<asp:Image ID="Image1" SkinID="ExchangeList48" runat="server" />
<asp:Localize ID="locTitle" runat="server" meta:resourcekey="locTitle" Text="Edit Folder"></asp:Localize>
<asp:Literal ID="litFolderName" runat="server" Text="Folder" />
</div>
<div class="FormBody">
<wsp:SimpleMessageBox id="messageBox" runat="server" />
<table>
<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:RequiredFieldValidator ID="valRequireFolderName" runat="server" meta:resourcekey="valRequireFolderName" ControlToValidate="txtFolderName"
ErrorMessage="Enter Folder Name" ValidationGroup="EditFolder" Display="Dynamic" Text="*" SetFocusOnError="True"></asp:RequiredFieldValidator>
<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>
</tr>
<tr><td>&nbsp;</td></tr>
<tr>
<td class="FormLabel150"><asp:Localize ID="locDirectoryBrowsing" runat="server" meta:resourcekey="locDirectoryBrowsing" Text="Enable Directory Browsing:"></asp:Localize></td>
<td>
<asp:CheckBox id="chkDirectoryBrowsing" runat="server"></asp:CheckBox>
</td>
</tr>
<tr><td>&nbsp;</td></tr>
<tr>
<td colspan="2">
<fieldset id="PermissionsPanel" runat="server">
<legend><asp:Localize ID="PermissionsSection" runat="server" meta:resourcekey="locPermissionsSection" Text="Permissions"></asp:Localize></legend>
<wsp:ESPermissions id="permissions" runat="server" />
</fieldset>
</tr>
<tr><td>&nbsp;</td></tr>
</table>
<div class="FormFooterClean">
<asp:Button id="btnSave" runat="server" Text="Save Changes" CssClass="Button1" meta:resourcekey="btnSave" ValidationGroup="EditFolder" OnClick="btnSave_Click"></asp:Button>
<asp:ValidationSummary ID="valSummary" runat="server" ShowMessageBox="True" ShowSummary="False" ValidationGroup="EditFolder" />
</div>
</div>
</div>
</div>
</div>
</div>

View file

@ -0,0 +1,129 @@
// 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);
chkDirectoryBrowsing.Checked = ES.Services.WebServers.GetDirectoryBrowseEnabled(PanelRequest.ItemID, folder.Url);
permissions.SetPermissions(esPermissions);
}
catch (Exception ex)
{
messageBox.ShowErrorMessage("ENETERPRISE_STORAGE_GET_FOLDER_SETTINGS", ex);
}
}
protected void btnSave_Click(object sender, EventArgs e)
{
if (!Page.IsValid)
return;
try
{
bool redirectNeeded = false;
litFolderName.Text = txtFolderName.Text;
// SystemFile folder = ES.Services.EnterpriseStorage.GetEnterpriseFolder(PanelRequest.ItemID, PanelRequest.FolderID);
SystemFile folder = new SystemFile();
if (PanelRequest.FolderID != txtFolderName.Text)
{
if (txtFolderName.Text.Contains("\\"))
{
throw new Exception("Wrong file name");
}
folder = ES.Services.EnterpriseStorage.RenameEnterpriseFolder(PanelRequest.ItemID, PanelRequest.FolderID, txtFolderName.Text);
redirectNeeded = true;
}
ES.Services.EnterpriseStorage.SetEnterpriseFolderPermissions(PanelRequest.ItemID, redirectNeeded ? folder.Name : PanelRequest.FolderID, permissions.GetPemissions());
ES.Services.WebServers.SetDirectoryBrowseEnabled(PanelRequest.ItemID, redirectNeeded ? folder.Url : lblFolderUrl.Text, chkDirectoryBrowsing.Checked);
if (redirectNeeded)
{
Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "enterprisestorage_folders",
"ItemID=" + PanelRequest.ItemID));
}
messageBox.ShowSuccessMessage("ENTERPRISE_STORAGE_UPDATE_FOLDER_SETTINGS");
}
catch (Exception ex)
{
messageBox.ShowErrorMessage("ENTERPRISE_STORAGE_UPDATE_FOLDER_SETTINGS", ex);
}
}
}
}

View file

@ -0,0 +1,214 @@
// 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.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WebsitePanel.Portal.ExchangeServer {
public partial class EnterpriseStorageFolderGeneralSettings {
/// <summary>
/// asyncTasks control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks;
/// <summary>
/// breadcrumb control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Breadcrumb breadcrumb;
/// <summary>
/// menu control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Menu menu;
/// <summary>
/// Image1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Image Image1;
/// <summary>
/// locTitle control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locTitle;
/// <summary>
/// litFolderName control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal litFolderName;
/// <summary>
/// messageBox control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox;
/// <summary>
/// locFolderName 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 locFolderName;
/// <summary>
/// txtFolderName 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 txtFolderName;
/// <summary>
/// valRequireFolderName 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 valRequireFolderName;
/// <summary>
/// locFolderUrl 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 locFolderUrl;
/// <summary>
/// lblFolderUrl 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 lblFolderUrl;
/// <summary>
/// locDirectoryBrowsing 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 locDirectoryBrowsing;
/// <summary>
/// chkDirectoryBrowsing 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.CheckBox chkDirectoryBrowsing;
/// <summary>
/// PermissionsPanel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlGenericControl PermissionsPanel;
/// <summary>
/// PermissionsSection control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize PermissionsSection;
/// <summary>
/// permissions control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.EnterpriseStoragePermissions permissions;
/// <summary>
/// btnSave control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnSave;
/// <summary>
/// valSummary control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.ValidationSummary valSummary;
}
}

View file

@ -0,0 +1,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" %>
<wsp:EnableAsyncTasksSupport id="asyncTasks" runat="server"/>
<div id="ExchangeContainer">
<div class="Module">
<div class="Header">
<wsp:Breadcrumb id="breadcrumb" runat="server" PageName="Text.PageName" />
</div>
<div class="Left">
<wsp:Menu id="menu" runat="server" SelectedItem="esfolders" />
</div>
<div class="Content">
<div class="Center">
<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" />
<div class="FormButtonsBarClean">
<div class="FormButtonsBarCleanLeft">
<asp:Button ID="btnAddFolder" runat="server" meta:resourcekey="btnAddFolder"
Text="Create New Folder" CssClass="Button1" OnClick="btnAddFolder_Click" />
</div>
<div class="FormButtonsBarCleanRight">
<asp:Panel ID="SearchPanel" runat="server" DefaultButton="cmdSearch">
<asp:Localize ID="locSearch" runat="server" meta:resourcekey="locSearch" Visible="false"></asp:Localize>
<asp:DropDownList ID="ddlPageSize" runat="server" AutoPostBack="True"
onselectedindexchanged="ddlPageSize_SelectedIndexChanged">
<asp:ListItem>10</asp:ListItem>
<asp:ListItem Selected="True">20</asp:ListItem>
<asp:ListItem>50</asp:ListItem>
<asp:ListItem>100</asp:ListItem>
</asp:DropDownList>
<asp:TextBox ID="txtSearchValue" runat="server" CssClass="NormalTextBox" Width="100">
</asp:TextBox><asp:ImageButton ID="cmdSearch" Runat="server" meta:resourcekey="cmdSearch" SkinID="SearchButton" CausesValidation="false"/>
</asp:Panel>
</div>
</div>
<asp:GridView ID="gvFolders" runat="server" AutoGenerateColumns="False" EnableViewState="true"
Width="100%" EmptyDataText="gvFolders" CssSelectorClass="NormalGridView"
OnRowCommand="gvFolders_RowCommand" AllowPaging="True" AllowSorting="True"
DataSourceID="odsEnterpriseFoldersPaged" PageSize="20">
<Columns>
<asp:TemplateField HeaderText="gvFolderName" SortExpression="Name">
<ItemStyle Width="30%"></ItemStyle>
<ItemTemplate>
<asp:hyperlink id="lnkFolderName" runat="server"
NavigateUrl='<%# GetFolderEditUrl(Eval("Name").ToString()) %>'>
<%# Eval("Name") %>
</asp:hyperlink>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="gvFolderSize" SortExpression="Size">
<ItemStyle Width="20%"></ItemStyle>
<ItemTemplate>
<asp:Literal id="litFolderSize" runat="server" Text='<%# Eval("Size").ToString() + " Mb" %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="gvFolderUrl">
<ItemStyle Width="50%"></ItemStyle>
<ItemTemplate>
<asp:Literal id="litFolderUrl" runat="server" Text='<%# Eval("Url").ToString() %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:ImageButton ID="imgDelFolder" runat="server" Text="Delete" SkinID="ExchangeDelete"
CommandName="DeleteItem" CommandArgument='<%# Eval("Name") %>'
meta:resourcekey="cmdDelete" OnClientClick="return confirm('Are you sure you want to delete selected folder?')"></asp:ImageButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:ObjectDataSource ID="odsEnterpriseFoldersPaged" runat="server" EnablePaging="True"
SelectCountMethod="GetEnterpriseFoldersPagedCount"
SelectMethod="GetEnterpriseFoldersPaged"
SortParameterName="sortColumn"
TypeName="WebsitePanel.Portal.EnterpriseStorageHelper">
<SelectParameters>
<asp:QueryStringParameter Name="itemId" QueryStringField="ItemID" DefaultValue="0" />
<asp:ControlParameter Name="filterValue" ControlID="txtSearchValue" PropertyName="Text" />
</SelectParameters>
</asp:ObjectDataSource>
<br />
<asp:Localize ID="locQuota" runat="server" meta:resourcekey="locQuota" Text="Total Folders Used:"></asp:Localize>
&nbsp;&nbsp;&nbsp;
<wsp:QuotaViewer ID="foldersQuota" runat="server" QuotaTypeId="2" />
</div>
</div>
</div>
</div>
</div>

View file

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

View file

@ -0,0 +1,196 @@
// 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.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WebsitePanel.Portal.ExchangeServer {
public partial class EnterpriseStorageFolders {
/// <summary>
/// asyncTasks control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks;
/// <summary>
/// breadcrumb control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Breadcrumb breadcrumb;
/// <summary>
/// menu control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Menu menu;
/// <summary>
/// imgESS control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Image imgESS;
/// <summary>
/// locTitle control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locTitle;
/// <summary>
/// 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>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox;
/// <summary>
/// btnAddFolder control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnAddFolder;
/// <summary>
/// SearchPanel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Panel SearchPanel;
/// <summary>
/// locSearch 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 locSearch;
/// <summary>
/// ddlPageSize control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.DropDownList ddlPageSize;
/// <summary>
/// txtSearchValue control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtSearchValue;
/// <summary>
/// cmdSearch control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.ImageButton cmdSearch;
/// <summary>
/// gvFolders control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.GridView gvFolders;
/// <summary>
/// odsEnterpriseFoldersPaged 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.ObjectDataSource odsEnterpriseFoldersPaged;
/// <summary>
/// locQuota 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 locQuota;
/// <summary>
/// foldersQuota control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.QuotaViewer foldersQuota;
}
}

View file

@ -26,7 +26,6 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.

View file

@ -0,0 +1,171 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="btnAdd.Text" xml:space="preserve">
<value>Add...</value>
</data>
<data name="btnAddSelected.Text" xml:space="preserve">
<value>Add Accounts</value>
</data>
<data name="btnCancel.Text" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="btnDelete.Text" xml:space="preserve">
<value>Delete</value>
</data>
<data name="btnSetReadOnly.Text" xml:space="preserve">
<value>Set Read-Only</value>
</data>
<data name="btnSetReadWrite.Text" xml:space="preserve">
<value>Set Read-Write</value>
</data>
<data name="ddlSearchColumnDisplayName.Text" xml:space="preserve">
<value>Display Name</value>
</data>
<data name="ddlSearchColumnEmail.Text" xml:space="preserve">
<value>E-mail Address</value>
</data>
<data name="gvAccountsDisplayName.HeaderText" xml:space="preserve">
<value>Display Name</value>
</data>
<data name="gvAccountsEmail.HeaderText" xml:space="preserve">
<value>Email</value>
</data>
<data name="gvPermissions.EmptyDataText" xml:space="preserve">
<value>The list of permissions is empty. Click "Add..." button to add permissions.</value>
</data>
<data name="gvPermissionsAccess.HeaderText" xml:space="preserve">
<value>Permissions</value>
</data>
<data name="gvPermissionsAccount.HeaderText" xml:space="preserve">
<value>Users/Groups</value>
</data>
<data name="gvPopupAccounts.EmptyDataText" xml:space="preserve">
<value>No accounts found.</value>
</data>
<data name="headerAddAccounts.Text" xml:space="preserve">
<value>Organization Accounts</value>
</data>
<data name="locDirectoryBrowsing" xml:space="preserve">
<value>Enable Directory Browsing:</value>
</data>
<data name="locIncludeSearch.Text" xml:space="preserve">
<value>Include in search:</value>
</data>
</root>

View file

@ -207,7 +207,7 @@
<data name="Text.EnterpriseStorageGroup" xml:space="preserve"> <data name="Text.EnterpriseStorageGroup" xml:space="preserve">
<value>Enterprise Storage</value> <value>Enterprise Storage</value>
</data> </data>
<data name="Text.EnterpriseStorageSpaces" xml:space="preserve"> <data name="Text.EnterpriseStorageFolders" xml:space="preserve">
<value>Spaces</value> <value>Folders</value>
</data> </data>
</root> </root>

View file

@ -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" %>
<asp:UpdatePanel ID="PermissionsUpdatePanel" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
<ContentTemplate>
<div class="FormButtonsBarClean">
<asp:Button ID="btnAdd" runat="server" Text="Add..." CssClass="Button1" OnClick="btnAdd_Click" meta:resourcekey="btnAdd" />
<asp:Button ID="btnDelete" runat="server" Text="Delete" CssClass="Button1" OnClick="btnDelete_Click" meta:resourcekey="btnDelete"/>
</div>
<asp:GridView ID="gvPermissions" runat="server" meta:resourcekey="gvPermissions" AutoGenerateColumns="False"
Width="600px" CssSelectorClass="NormalGridView"
DataKeyNames="Account">
<Columns>
<asp:TemplateField>
<HeaderTemplate>
<asp:CheckBox ID="chkSelectAll" runat="server" onclick="javascript:SelectAllCheckboxes(this);" />
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="chkSelect" runat="server" />
</ItemTemplate>
<ItemStyle Width="10px" />
</asp:TemplateField>
<asp:TemplateField meta:resourcekey="gvPermissionsAccount" HeaderText="gvPermissionsAccount">
<ItemStyle Width="60%" Wrap="false">
</ItemStyle>
<ItemTemplate>
<asp:Literal ID="litAccount" runat="server" Text='<%# Eval("DisplayName") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField meta:resourcekey="gvPermissionsAccess" HeaderText="gvPermissionsAccess">
<ItemStyle Width="40%" Wrap="false">
</ItemStyle>
<ItemTemplate>
<asp:Literal ID="litAccess" runat="server" Text='<%# Eval("Access") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<br />
<div class="FormButtonsBarClean">
<asp:Button ID="btnSetReadOnly" runat="server" Text="Set Read-Only" CssClass="Button1" OnClick="btn_UpdateAccess" CommandArgument="Read-Only" meta:resourcekey="btnSetReadOnly" />
<asp:Button ID="btnSetReadWrite" runat="server" Text="Set Read-Write" CssClass="Button1" OnClick="btn_UpdateAccess" CommandArgument="Read-Write" meta:resourcekey="btnSetReadWrite"/>
</div>
<asp:Panel ID="AddAccountsPanel" runat="server" CssClass="Popup" style="display:none">
<table class="Popup-Header" cellpadding="0" cellspacing="0">
<tr>
<td class="Popup-HeaderLeft"></td>
<td class="Popup-HeaderTitle">
<asp:Localize ID="headerAddAccounts" runat="server" meta:resourcekey="headerAddAccounts"></asp:Localize>
</td>
<td class="Popup-HeaderRight"></td>
</tr>
</table>
<div class="Popup-Content">
<div class="Popup-Body">
<br />
<asp:UpdatePanel ID="AddAccountsUpdatePanel" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
<ContentTemplate>
<div class="FormButtonsBarClean">
<div class="FormButtonsBarCleanRight">
<asp:Panel ID="SearchPanel" runat="server" DefaultButton="cmdSearch">
<asp:DropDownList ID="ddlSearchColumn" runat="server" CssClass="NormalTextBox">
<asp:ListItem Value="DisplayName" meta:resourcekey="ddlSearchColumnDisplayName">DisplayName</asp:ListItem>
<asp:ListItem Value="PrimaryEmailAddress" meta:resourcekey="ddlSearchColumnEmail">Email</asp:ListItem>
</asp:DropDownList><asp:TextBox ID="txtSearchValue" runat="server" CssClass="NormalTextBox" Width="100"></asp:TextBox><asp:ImageButton ID="cmdSearch" Runat="server" meta:resourcekey="cmdSearch" SkinID="SearchButton"
CausesValidation="false" OnClick="cmdSearch_Click"/>
</asp:Panel>
</div>
</div>
<div class="Popup-Scroll">
<asp:GridView ID="gvPopupAccounts" runat="server" meta:resourcekey="gvPopupAccounts" AutoGenerateColumns="False"
Width="100%" CssSelectorClass="NormalGridView"
DataKeyNames="AccountName">
<Columns>
<asp:TemplateField>
<HeaderTemplate>
<asp:CheckBox ID="chkSelectAll" runat="server" onclick="javascript:SelectAllCheckboxes(this);" />
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="chkSelect" runat="server" />
<asp:Literal ID="litAccountType" runat="server" Visible="false" Text='<%# Eval("AccountType") %>'></asp:Literal>
</ItemTemplate>
<ItemStyle Width="10px" />
</asp:TemplateField>
<asp:TemplateField meta:resourcekey="gvAccountsDisplayName">
<ItemStyle Width="50%"></ItemStyle>
<ItemTemplate>
<asp:Image ID="imgAccount" runat="server" ImageUrl='<%# GetAccountImage((int)Eval("AccountType")) %>' ImageAlign="AbsMiddle" />
<asp:Literal ID="litDisplayName" runat="server" Text='<%# Eval("DisplayName") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField meta:resourcekey="gvAccountsEmail">
<ItemStyle Width="50%"></ItemStyle>
<ItemTemplate>
<asp:Literal ID="litPrimaryEmailAddress" runat="server" Text='<%# Eval("PrimaryEmailAddress") %>'></asp:Literal>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</div>
</ContentTemplate>
</asp:UpdatePanel>
<br />
</div>
<div class="FormFooter">
<asp:Button ID="btnAddSelected" runat="server" CssClass="Button1" meta:resourcekey="btnAddSelected" Text="Add Accounts" OnClick="btnAddSelected_Click" />
<asp:Button ID="btnCancelAdd" runat="server" CssClass="Button1" meta:resourcekey="btnCancel" Text="Cancel" CausesValidation="false" />
</div>
</div>
</asp:Panel>
<asp:Button ID="btnAddAccountsFake" runat="server" style="display:none;" />
<ajaxToolkit:ModalPopupExtender ID="AddAccountsModal" runat="server"
TargetControlID="btnAddAccountsFake" PopupControlID="AddAccountsPanel"
BackgroundCssClass="modalBackground" DropShadow="false" CancelControlID="btnCancelAdd" />
</ContentTemplate>
</asp:UpdatePanel>

View file

@ -0,0 +1,292 @@
// 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<ESPermission> selectedAccounts = GetGridViewPermissions(SelectedState.Unselected);
BindAccounts(selectedAccounts.ToArray(), false);
}
protected void btnAddSelected_Click(object sender, EventArgs e)
{
List<ExchangeAccount> selectedAccounts = GetGridViewAccounts();
List<ESPermission> permissions = new List<ESPermission>();
foreach (ExchangeAccount account in selectedAccounts)
{
permissions.Add(new ESPermission
{
Account = account.AccountName,
DisplayName = account.DisplayName,
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<ExchangeAccount> newAccounts = new List<ExchangeAccount>();
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<ESPermission> permissions = new List<ESPermission>();
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<ESPermission> GetGridViewPermissions(SelectedState state)
{
List<ESPermission> permissions = new List<ESPermission>();
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;
permission.DisplayName = ((Literal)row.FindControl("litAccount")).Text;
if (state == SelectedState.All ||
(state == SelectedState.Selected && chkSelect.Checked) ||
(state == SelectedState.Unselected && !chkSelect.Checked))
permissions.Add(permission);
}
return permissions;
}
protected List<ExchangeAccount> GetGridViewAccounts()
{
List<ExchangeAccount> accounts = new List<ExchangeAccount>();
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],
DisplayName = ((Literal)row.FindControl("litDisplayName")).Text
});
}
}
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;
}
}
}
}
}

View file

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

View file

@ -254,7 +254,7 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls
MenuGroup enterpriseStorageGroup = MenuGroup enterpriseStorageGroup =
new MenuGroup(GetLocalizedString("Text.EnterpriseStorageGroup"), imagePath + "spaces16.png"); 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); groups.Add(enterpriseStorageGroup);
} }

View file

@ -126,4 +126,7 @@
<data name="lblSpacesFolder.Text" xml:space="preserve"> <data name="lblSpacesFolder.Text" xml:space="preserve">
<value>Enterprise Storage Folder:</value> <value>Enterprise Storage Folder:</value>
</data> </data>
<data name="lblDomain.Text" xml:space="preserve">
<value>Enterprise Storage Domain:</value>
</data>
</root> </root>

View file

@ -7,6 +7,16 @@
<td width="100%"> <td width="100%">
<asp:TextBox runat="server" ID="txtFolder" Width="300px" CssClass="NormalTextBox"></asp:TextBox></td> <asp:TextBox runat="server" ID="txtFolder" Width="300px" CssClass="NormalTextBox"></asp:TextBox></td>
</tr> </tr>
<tr>
<td class="SubHead" width="200" nowrap>
<asp:Label ID="lblDomain" runat="server" meta:resourcekey="lblDomain" Text="User domain:"></asp:Label>
</td>
<td width="100%">
<asp:TextBox runat="server" ID="txtDomain" Width="300px" CssClass="NormalTextBox"></asp:TextBox>
<asp:RequiredFieldValidator ID="valDomain" runat="server" ControlToValidate="txtDomain"
ErrorMessage="*"></asp:RequiredFieldValidator>
</td>
</tr>
<tr> <tr>
<td class="SubHead" width="200" nowrap> <td class="SubHead" width="200" nowrap>
<asp:Label ID="lblLocationDrive" runat="server" meta:resourcekey="lblLocationDrive" Text="Location Drive:"></asp:Label> <asp:Label ID="lblLocationDrive" runat="server" meta:resourcekey="lblLocationDrive" Text="Location Drive:"></asp:Label>

View file

@ -64,6 +64,7 @@ namespace WebsitePanel.Portal.ProviderControls
{ {
txtFolder.Text = settings["UsersHome"]; txtFolder.Text = settings["UsersHome"];
txtLocationDrive.Text = settings["LocationDrive"]; txtLocationDrive.Text = settings["LocationDrive"];
txtDomain.Text = settings["UsersDomain"];
chkEnableHardQuota.Checked = settings["EnableHardQuota"] == "true" ? true : false; chkEnableHardQuota.Checked = settings["EnableHardQuota"] == "true" ? true : false;
} }
@ -71,6 +72,7 @@ namespace WebsitePanel.Portal.ProviderControls
{ {
settings["UsersHome"] = txtFolder.Text; settings["UsersHome"] = txtFolder.Text;
settings["LocationDrive"] = txtLocationDrive.Text; settings["LocationDrive"] = txtLocationDrive.Text;
settings["UsersDomain"] = txtDomain.Text;
settings["EnableHardQuota"] = chkEnableHardQuota.Checked.ToString().ToLower(); settings["EnableHardQuota"] = chkEnableHardQuota.Checked.ToString().ToLower();
} }
} }

View file

@ -58,6 +58,33 @@ namespace WebsitePanel.Portal.ProviderControls {
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtFolder; protected global::System.Web.UI.WebControls.TextBox txtFolder;
/// <summary>
/// lblDomain 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 lblDomain;
/// <summary>
/// txtDomain 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 txtDomain;
/// <summary>
/// valDomain 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 valDomain;
/// <summary> /// <summary>
/// lblLocationDrive control. /// lblLocationDrive control.
/// </summary> /// </summary>

View file

@ -169,6 +169,7 @@
<Compile Include="Code\Framework\Utils.cs" /> <Compile Include="Code\Framework\Utils.cs" />
<Compile Include="Code\Helpers\AuditLogHelper.cs" /> <Compile Include="Code\Helpers\AuditLogHelper.cs" />
<Compile Include="Code\Helpers\BlackBerryHelper.cs" /> <Compile Include="Code\Helpers\BlackBerryHelper.cs" />
<Compile Include="Code\Helpers\EnterpriseStorageHelper.cs" />
<Compile Include="Code\Helpers\LyncHelper.cs" /> <Compile Include="Code\Helpers\LyncHelper.cs" />
<Compile Include="Code\Helpers\VirtualMachinesForPCHelper.cs" /> <Compile Include="Code\Helpers\VirtualMachinesForPCHelper.cs" />
<Compile Include="Code\Helpers\CRMHelper.cs" /> <Compile Include="Code\Helpers\CRMHelper.cs" />
@ -209,12 +210,26 @@
<Compile Include="Code\ReportingServices\IResourceStorage.cs" /> <Compile Include="Code\ReportingServices\IResourceStorage.cs" />
<Compile Include="Code\ReportingServices\ReportingServicesUtils.cs" /> <Compile Include="Code\ReportingServices\ReportingServicesUtils.cs" />
<Compile Include="Code\UserControls\Tab.cs" /> <Compile Include="Code\UserControls\Tab.cs" />
<Compile Include="ExchangeServer\EnterpriseStorageSpaces.ascx.cs"> <Compile Include="ExchangeServer\EnterpriseStorageFolderGeneralSettings.ascx.cs">
<DependentUpon>EnterpriseStorageSpaces.ascx</DependentUpon> <DependentUpon>EnterpriseStorageFolderGeneralSettings.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType> <SubType>ASPXCodeBehind</SubType>
</Compile> </Compile>
<Compile Include="ExchangeServer\EnterpriseStorageSpaces.ascx.designer.cs"> <Compile Include="ExchangeServer\EnterpriseStorageFolderGeneralSettings.ascx.designer.cs">
<DependentUpon>EnterpriseStorageSpaces.ascx</DependentUpon> <DependentUpon>EnterpriseStorageFolderGeneralSettings.ascx</DependentUpon>
</Compile>
<Compile Include="ExchangeServer\EnterpriseStorageCreateFolder.ascx.cs">
<DependentUpon>EnterpriseStorageCreateFolder.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="ExchangeServer\EnterpriseStorageCreateFolder.ascx.designer.cs">
<DependentUpon>EnterpriseStorageCreateFolder.ascx</DependentUpon>
</Compile>
<Compile Include="ExchangeServer\EnterpriseStorageFolders.ascx.cs">
<DependentUpon>EnterpriseStorageFolders.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="ExchangeServer\EnterpriseStorageFolders.ascx.designer.cs">
<DependentUpon>EnterpriseStorageFolders.ascx</DependentUpon>
</Compile> </Compile>
<Compile Include="ExchangeServer\OrganizationSecurityGroupMemberOf.ascx.cs"> <Compile Include="ExchangeServer\OrganizationSecurityGroupMemberOf.ascx.cs">
<DependentUpon>OrganizationSecurityGroupMemberOf.ascx</DependentUpon> <DependentUpon>OrganizationSecurityGroupMemberOf.ascx</DependentUpon>
@ -297,6 +312,13 @@
<DependentUpon>AccountsListWithPermissions.ascx</DependentUpon> <DependentUpon>AccountsListWithPermissions.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType> <SubType>ASPXCodeBehind</SubType>
</Compile> </Compile>
<Compile Include="ExchangeServer\UserControls\EnterpriseStoragePermissions.ascx.cs">
<DependentUpon>EnterpriseStoragePermissions.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="ExchangeServer\UserControls\EnterpriseStoragePermissions.ascx.designer.cs">
<DependentUpon>EnterpriseStoragePermissions.ascx</DependentUpon>
</Compile>
<Compile Include="ExchangeServer\UserControls\GroupsList.ascx.cs"> <Compile Include="ExchangeServer\UserControls\GroupsList.ascx.cs">
<DependentUpon>GroupsList.ascx</DependentUpon> <DependentUpon>GroupsList.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType> <SubType>ASPXCodeBehind</SubType>
@ -4008,7 +4030,9 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="ApplyEnableHardQuotaFeature.ascx" /> <Content Include="ApplyEnableHardQuotaFeature.ascx" />
<Content Include="ExchangeServer\EnterpriseStorageSpaces.ascx" /> <Content Include="ExchangeServer\EnterpriseStorageFolderGeneralSettings.ascx" />
<Content Include="ExchangeServer\EnterpriseStorageCreateFolder.ascx" />
<Content Include="ExchangeServer\EnterpriseStorageFolders.ascx" />
<Content Include="ExchangeServer\OrganizationSecurityGroupMemberOf.ascx" /> <Content Include="ExchangeServer\OrganizationSecurityGroupMemberOf.ascx" />
<Content Include="ExchangeServer\ExchangeDistributionListMemberOf.ascx" /> <Content Include="ExchangeServer\ExchangeDistributionListMemberOf.ascx" />
<Content Include="ExchangeServer\ExchangeMailboxMemberOf.ascx" /> <Content Include="ExchangeServer\ExchangeMailboxMemberOf.ascx" />
@ -4021,6 +4045,7 @@
<Content Include="ExchangeServer\OrganizationSecurityGroupGeneralSettings.ascx" /> <Content Include="ExchangeServer\OrganizationSecurityGroupGeneralSettings.ascx" />
<Content Include="ExchangeServer\OrganizationSecurityGroups.ascx" /> <Content Include="ExchangeServer\OrganizationSecurityGroups.ascx" />
<Content Include="ExchangeServer\OrganizationUserMemberOf.ascx" /> <Content Include="ExchangeServer\OrganizationUserMemberOf.ascx" />
<Content Include="ExchangeServer\UserControls\EnterpriseStoragePermissions.ascx" />
<Content Include="ExchangeServer\UserControls\GroupsList.ascx" /> <Content Include="ExchangeServer\UserControls\GroupsList.ascx" />
<Content Include="ExchangeServer\UserControls\SecurityGroupTabs.ascx" /> <Content Include="ExchangeServer\UserControls\SecurityGroupTabs.ascx" />
<Content Include="ExchangeServer\UserControls\UsersList.ascx" /> <Content Include="ExchangeServer\UserControls\UsersList.ascx" />
@ -5240,11 +5265,18 @@
<Content Include="ExchangeServer\UserControls\App_LocalResources\GroupsList.ascx.resx"> <Content Include="ExchangeServer\UserControls\App_LocalResources\GroupsList.ascx.resx">
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Content> </Content>
<Content Include="ProviderControls\App_LocalResources\EnterpriseStorage_Settings.ascx.resx" /> <Content Include="ProviderControls\App_LocalResources\EnterpriseStorage_Settings.ascx.resx">
<Content Include="ExchangeServer\App_LocalResources\EnterpriseStorageSpaces.ascx.resx" /> <SubType>Designer</SubType>
</Content>
<Content Include="ExchangeServer\App_LocalResources\EnterpriseStorageFolders.ascx.resx">
<SubType>Designer</SubType>
</Content>
<Content Include="UserControls\App_LocalResources\OrgPolicyEditor.ascx.resx"> <Content Include="UserControls\App_LocalResources\OrgPolicyEditor.ascx.resx">
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Content> </Content>
<Content Include="ExchangeServer\App_LocalResources\EnterpriseStorageCreateFolder.ascx.resx" />
<Content Include="ExchangeServer\App_LocalResources\EnterpriseStorageFolderGeneralSettings.ascx.resx" />
<Content Include="ExchangeServer\UserControls\App_LocalResources\EnterpriseStoragePermissions.ascx.resx" />
<EmbeddedResource Include="UserControls\App_LocalResources\EditDomainsList.ascx.resx"> <EmbeddedResource Include="UserControls\App_LocalResources\EditDomainsList.ascx.resx">
<SubType>Designer</SubType> <SubType>Designer</SubType>
</EmbeddedResource> </EmbeddedResource>