This commit is contained in:
vfedosevich 2015-01-27 04:52:10 -08:00
commit 07a68d5ba1
52 changed files with 1293 additions and 122 deletions

View file

@ -35236,12 +35236,15 @@ EXEC sp_xml_preparedocument @idoc OUTPUT, @XmlProperties
DELETE FROM ServiceItemProperties
WHERE ItemID = @ItemID
INSERT INTO ServiceItemProperties
(
ItemID,
PropertyName,
PropertyValue
)
-- Add the xml data into a temp table for the capability and robust
IF OBJECT_ID('tempdb..#TempTable') IS NOT NULL DROP TABLE #TempTable
CREATE TABLE #TempTable(
ItemID int,
PropertyName nvarchar(50),
PropertyValue nvarchar(3000))
INSERT INTO #TempTable (ItemID, PropertyName, PropertyValue)
SELECT
@ItemID,
PropertyName,
@ -35252,6 +35255,21 @@ FROM OPENXML(@idoc, '/properties/property',1) WITH
PropertyValue nvarchar(3000) '@value'
) as PV
-- Move data from temp table to real table
INSERT INTO ServiceItemProperties
(
ItemID,
PropertyName,
PropertyValue
)
SELECT
ItemID,
PropertyName,
PropertyValue
FROM #TempTable
DROP TABLE #TempTable
-- remove document
exec sp_xml_removedocument @idoc

View file

@ -8484,3 +8484,81 @@ BEGIN
INSERT INTO [dbo].[ScheduleTasks] ([TaskID], [TaskType], [RoleID]) VALUES (N'SCHEDULE_TASK_DELETE_EXCHANGE_ACCOUNTS', N'WebsitePanel.EnterpriseServer.DeleteExchangeAccountsTask, WebsitePanel.EnterpriseServer.Code', 3)
END
GO
ALTER PROCEDURE [dbo].[UpdateServiceItem]
(
@ActorID int,
@ItemID int,
@ItemName nvarchar(500),
@XmlProperties ntext
)
AS
BEGIN TRAN
-- check rights
DECLARE @PackageID int
SELECT PackageID = @PackageID FROM ServiceItems
WHERE ItemID = @ItemID
IF dbo.CheckActorPackageRights(@ActorID, @PackageID) = 0
RAISERROR('You are not allowed to access this package', 16, 1)
-- update item
UPDATE ServiceItems SET ItemName = @ItemName
WHERE ItemID=@ItemID
DECLARE @idoc int
--Create an internal representation of the XML document.
EXEC sp_xml_preparedocument @idoc OUTPUT, @XmlProperties
-- Execute a SELECT statement that uses the OPENXML rowset provider.
DELETE FROM ServiceItemProperties
WHERE ItemID = @ItemID
-- Add the xml data into a temp table for the capability and robust
IF OBJECT_ID('tempdb..#TempTable') IS NOT NULL DROP TABLE #TempTable
CREATE TABLE #TempTable(
ItemID int,
PropertyName nvarchar(50),
PropertyValue nvarchar(3000))
INSERT INTO #TempTable (ItemID, PropertyName, PropertyValue)
SELECT
@ItemID,
PropertyName,
PropertyValue
FROM OPENXML(@idoc, '/properties/property',1) WITH
(
PropertyName nvarchar(50) '@name',
PropertyValue nvarchar(3000) '@value'
) as PV
-- Move data from temp table to real table
INSERT INTO ServiceItemProperties
(
ItemID,
PropertyName,
PropertyValue
)
SELECT
ItemID,
PropertyName,
PropertyValue
FROM #TempTable
DROP TABLE #TempTable
-- remove document
exec sp_xml_removedocument @idoc
COMMIT TRAN
RETURN
GO

View file

@ -45,7 +45,11 @@ namespace WebsitePanel.Providers.Web.Delegation
using (var srvman = new ServerManager())
{
var adminConfig = srvman.GetAdministrationConfiguration();
//
// return if system.webServer/management/delegation section is not exist in config file
if (!HasDelegationSection(adminConfig))
return;
var delegationSection = adminConfig.GetSection("system.webServer/management/delegation");
//
var rulesCollection = delegationSection.GetCollection();
@ -103,7 +107,11 @@ namespace WebsitePanel.Providers.Web.Delegation
using (var srvman = new ServerManager())
{
var adminConfig = srvman.GetAdministrationConfiguration();
//
// return if system.webServer/management/delegation section is not exist in config file
if (!HasDelegationSection(adminConfig))
return;
var delegationSection = adminConfig.GetSection("system.webServer/management/delegation");
//
var rulesCollection = delegationSection.GetCollection();
@ -142,7 +150,11 @@ namespace WebsitePanel.Providers.Web.Delegation
using (var srvman = new ServerManager())
{
var adminConfig = srvman.GetAdministrationConfiguration();
//
// return if system.webServer/management/delegation section is not exist in config file
if (!HasDelegationSection(adminConfig))
return false;
var delegationSection = adminConfig.GetSection("system.webServer/management/delegation");
//
var rulesCollection = delegationSection.GetCollection();
@ -171,7 +183,11 @@ namespace WebsitePanel.Providers.Web.Delegation
using (var srvman = GetServerManager())
{
var adminConfig = srvman.GetAdministrationConfiguration();
//
// return if system.webServer/management/delegation section is not exist in config file
if (!HasDelegationSection(adminConfig))
return;
var delegationSection = adminConfig.GetSection("system.webServer/management/delegation");
//
var rulesCollection = delegationSection.GetCollection();
@ -245,7 +261,11 @@ namespace WebsitePanel.Providers.Web.Delegation
using (var srvman = GetServerManager())
{
var adminConfig = srvman.GetAdministrationConfiguration();
//
// return if system.webServer/management/delegation section is not exist in config file
if (!HasDelegationSection(adminConfig))
return;
var delegationSection = adminConfig.GetSection("system.webServer/management/delegation");
//
var rulesCollection = delegationSection.GetCollection();
@ -264,5 +284,21 @@ namespace WebsitePanel.Providers.Web.Delegation
}
}
}
private bool HasDelegationSection(Configuration adminConfig)
{
// try to get delegation section in config file (C:\Windows\system32\inetsrv\config\administration.config)
try
{
adminConfig.GetSection("system.webServer/management/delegation");
}
catch (Exception ex)
{
/* skip */
return false;
}
return true;
}
}
}

View file

@ -2072,7 +2072,7 @@ namespace WebsitePanel.Providers.Web
public new void GrantWebDeployPublishingAccess(string siteName, string accountName, string accountPassword)
{
// Web Publishing Access feature requires FullControl permissions on the web site's wwwroot folder
//GrantWebManagementAccessInternally(siteName, accountName, accountPassword, NTFSPermission.FullControl);
GrantWebManagementAccessInternally(siteName, accountName, accountPassword, NTFSPermission.FullControl);
//
EnforceDelegationRulesRestrictions(siteName, accountName);
}
@ -2086,7 +2086,7 @@ namespace WebsitePanel.Providers.Web
public new void RevokeWebDeployPublishingAccess(string siteName, string accountName)
{
// Web Publishing Access feature requires FullControl permissions on the web site's wwwroot folder
//RevokeWebManagementAccess(siteName, accountName);
RevokeWebManagementAccess(siteName, accountName);
//
RemoveDelegationRulesRestrictions(siteName, accountName);
}
@ -4336,13 +4336,13 @@ namespace WebsitePanel.Providers.Web
protected string GetFullQualifiedAccountName(string accountName)
{
if (accountName.IndexOf("\\") != -1)
return accountName; // already has domain information
//
if (!ServerSettings.ADEnabled)
return String.Format(@"{0}\{1}", Environment.MachineName, accountName);
if (accountName.IndexOf("\\") != -1)
return accountName; // already has domain information
// DO IT FOR ACTIVE DIRECTORY MODE ONLY
string domainName = null;
try

View file

@ -1,5 +1,7 @@
using System.Collections.Generic;
using System.Linq;
using WebsitePanel.EnterpriseServer.Base.HostedSolution;
using WebsitePanel.WebDav.Core.Config.WebConfigSections;
using WebsitePanel.WebDavPortal.WebConfigSections;
namespace WebsitePanel.WebDav.Core.Config.Entities
@ -33,6 +35,26 @@ namespace WebsitePanel.WebDav.Core.Config.Entities
}
}
public string UserGroupsKey
{
get
{
SessionKeysElement sessionKey =
_sessionKeys.FirstOrDefault(x => x.Key == SessionKeysElement.UserGroupsKey);
return sessionKey != null ? sessionKey.Value : null;
}
}
public string WebDavRootFoldersPermissions
{
get
{
SessionKeysElement sessionKey =
_sessionKeys.FirstOrDefault(x => x.Key == SessionKeysElement.WebDavRootFolderPermissionsKey);
return sessionKey != null ? sessionKey.Value : null;
}
}
public string ResourseRenderCount
{
get

View file

@ -1,6 +1,6 @@
using System.Configuration;
namespace WebsitePanel.WebDavPortal.WebConfigSections
namespace WebsitePanel.WebDav.Core.Config.WebConfigSections
{
public class SessionKeysElement : ConfigurationElement
{
@ -10,6 +10,8 @@ namespace WebsitePanel.WebDavPortal.WebConfigSections
public const string AccountInfoKey = "AccountInfoSessionKey";
public const string AuthTicketKey = "AuthTicketKey";
public const string WebDavManagerKey = "WebDavManagerSessionKey";
public const string UserGroupsKey = "UserGroupsKey";
public const string WebDavRootFolderPermissionsKey = "WebDavRootFolderPermissionsKey";
public const string ResourseRenderCountKey = "ResourseRenderCountSessionKey";
public const string ItemIdSessionKey = "ItemId";

View file

@ -4,5 +4,19 @@ namespace WebsitePanel.WebDav.Core.Exceptions
{
public class WebDavException : Exception
{
public WebDavException()
: base() { }
public WebDavException(string message)
: base(message) { }
public WebDavException(string format, params object[] args)
: base(string.Format(format, args)) { }
public WebDavException(string message, Exception innerException)
: base(message, innerException) { }
public WebDavException(string format, Exception innerException, params object[] args)
: base(string.Format(format, args), innerException) { }
}
}

View file

@ -148,7 +148,7 @@ namespace WebsitePanel.WebDav.Core
public IResource GetResource(string name)
{
IHierarchyItem item =
_children.Single(i => i.ItemType == ItemType.Resource && i.DisplayName.Trim('/') == name.Trim('/'));
_children.Single(i => i.DisplayName.Trim('/') == name.Trim('/'));
var resource = new WebDavResource();
resource.SetCredentials(_credentials);
resource.SetHierarchyItem(item);

View file

@ -428,6 +428,15 @@ namespace WebsitePanel.WebDav.Core
_lastModified = lastModified;
}
/// <summary>
/// For internal use only.
/// </summary>
/// <param name="comment"></param>
public void SetItemType(ItemType type)
{
_itemType = type;
}
/// <summary>
/// For internal use only.
/// </summary>
@ -541,6 +550,7 @@ namespace WebsitePanel.WebDav.Core
SetHref(item.Href);
SetLastModified(item.LastModified);
SetProperties(item.Properties);
SetItemType(item.ItemType);
}
}
}

View file

@ -12,5 +12,6 @@ namespace WebsitePanel.WebDav.Core.Interfaces.Managers
void UploadFile(string path, HttpPostedFileBase file);
IResource GetResource(string path);
string GetFileUrl(string path);
void DeleteResource(string path);
}
}

View file

@ -13,6 +13,7 @@ using WebsitePanel.WebDav.Core.Config;
using WebsitePanel.WebDav.Core.Exceptions;
using WebsitePanel.WebDav.Core.Extensions;
using WebsitePanel.WebDav.Core.Interfaces.Managers;
using WebsitePanel.WebDav.Core.Resources;
using WebsitePanel.WebDav.Core.Security.Cryptography;
using WebsitePanel.WebDav.Core.Wsp.Framework;
@ -70,7 +71,7 @@ namespace WebsitePanel.WebDav.Core.Managers
_cryptography.Decrypt(WspContext.User.EncryptedPassword),
WebDavAppConfigManager.Instance.UserDomain);
_currentFolder = _webDavSession.OpenFolder(string.Format("{0}{1}/{2}", WebDavAppConfigManager.Instance.WebdavRoot, WspContext.User.OrganizationId, pathPart));
_currentFolder = _webDavSession.OpenFolder(string.Format("{0}{1}/{2}", WebDavAppConfigManager.Instance.WebdavRoot, WspContext.User.OrganizationId, pathPart.TrimStart('/')));
}
children = _currentFolder.GetChildren().Where(x => !WebDavAppConfigManager.Instance.ElementsRendering.ElementsToIgnore.Contains(x.DisplayName.Trim('/'))).ToArray();
@ -95,15 +96,9 @@ namespace WebsitePanel.WebDav.Core.Managers
OpenFolder(folder);
try
{
IResource resource = _currentFolder.GetResource(resourceName);
return true;
}
catch (Exception e){}
return false;
return resource.ItemType != ItemType.Folder;
}
@ -148,6 +143,27 @@ namespace WebsitePanel.WebDav.Core.Managers
resource.Upload(bytes);
}
public void DeleteResource(string path)
{
path = RemoveLeadingFromPath(path, "office365");
path = RemoveLeadingFromPath(path, WspContext.User.OrganizationId);
string folderPath = GetFileFolder(path);
OpenFolder(folderPath);
var resourceName = GetResourceName(path);
IResource resource = _currentFolder.GetResource(resourceName);
if (resource.ItemType == ItemType.Folder && GetFoldersItemsCount(path) > 0)
{
throw new WebDavException(string.Format(WebDavResources.FolderIsNotEmptyFormat, resource.DisplayName));
}
resource.Delete();
}
public IResource GetResource(string path)
{
try
@ -210,8 +226,20 @@ namespace WebsitePanel.WebDav.Core.Managers
return rootFolders;
}
private int GetFoldersItemsCount(string path)
{
var items = OpenFolder(path);
return items.Count();
}
#region Helpers
private string RemoveLeadingFromPath(string pathPart, string toRemove)
{
return pathPart.StartsWith('/' + toRemove) ? pathPart.Substring(toRemove.Length + 1) : pathPart;
}
private byte[] ReadFully(Stream input)
{
var buffer = new byte[16 * 1024];

View file

@ -0,0 +1,72 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.33440
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WebsitePanel.WebDav.Core.Resources {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class WebDavResources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal WebDavResources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WebsitePanel.WebDav.Core.Resources.WebDavResources", typeof(WebDavResources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized string similar to Folder {0} is not empty..
/// </summary>
internal static string FolderIsNotEmptyFormat {
get {
return ResourceManager.GetString("FolderIsNotEmptyFormat", resourceCulture);
}
}
}
}

View file

@ -0,0 +1,123 @@
<?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="FolderIsNotEmptyFormat" xml:space="preserve">
<value>Folder {0} is not empty.</value>
</data>
</root>

View file

@ -33,7 +33,7 @@ namespace WebsitePanel.WebDav.Core.Security.Authentication
var user = UserPrincipal.FindByIdentity(_principalContext, IdentityType.UserPrincipalName, login);
if (_principalContext.ValidateCredentials(login, password) == false && user != null)
if (user == null || _principalContext.ValidateCredentials(login, password) == false)
{
return null;
}

View file

@ -1,5 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using WebsitePanel.EnterpriseServer.Base.HostedSolution;
using WebsitePanel.Providers.HostedSolution;
using WebsitePanel.WebDav.Core.Config;
using WebsitePanel.WebDav.Core.Interfaces.Security;
using WebsitePanel.WebDav.Core.Security.Authentication.Principals;
using WebsitePanel.WebDav.Core.Security.Authorization.Enums;
@ -27,18 +32,9 @@ namespace WebsitePanel.WebDav.Core.Security.Authorization
var rootFolder = GetRootFolder(path);
var userGroups = WSP.Services.Organizations.GetSecurityGroupsByMember(principal.ItemId, principal.AccountId);
var userGroups = GetUserSecurityGroups(principal);
var rootFolders = WSP.Services.EnterpriseStorage.GetEnterpriseFolders(principal.ItemId);
var esRootFolder = rootFolders.FirstOrDefault(x => x.Name == rootFolder);
if (esRootFolder == null)
{
return WebDavPermissions.None;
}
var permissions = WSP.Services.EnterpriseStorage.GetEnterpriseFolderPermissions(principal.ItemId, esRootFolder.Name);
var permissions = GetFolderEsPermissions(principal, rootFolder);
foreach (var permission in permissions)
{
@ -65,5 +61,44 @@ namespace WebsitePanel.WebDav.Core.Security.Authorization
{
return path.Split(new[]{'/'}, StringSplitOptions.RemoveEmptyEntries)[0];
}
private IEnumerable<ESPermission> GetFolderEsPermissions(WspPrincipal principal, string rootFolderName)
{
var dictionary = HttpContext.Current.Session[WebDavAppConfigManager.Instance.SessionKeys.WebDavRootFoldersPermissions] as
Dictionary<string, IEnumerable<ESPermission>>;
if (dictionary == null)
{
dictionary = new Dictionary<string, IEnumerable<ESPermission>>();
var rootFolders = WSP.Services.EnterpriseStorage.GetEnterpriseFolders(principal.ItemId);
foreach (var rootFolder in rootFolders)
{
var permissions = WSP.Services.EnterpriseStorage.GetEnterpriseFolderPermissions(principal.ItemId, rootFolder.Name);
dictionary.Add(rootFolder.Name, permissions);
}
HttpContext.Current.Session[WebDavAppConfigManager.Instance.SessionKeys.WebDavRootFoldersPermissions] = dictionary;
}
return dictionary.ContainsKey(rootFolderName) ? dictionary[rootFolderName] : new ESPermission[0];
}
private IEnumerable<ExchangeAccount> GetUserSecurityGroups(WspPrincipal principal)
{
var groups = HttpContext.Current.Session[WebDavAppConfigManager.Instance.SessionKeys.UserGroupsKey] as
IEnumerable<ExchangeAccount>;
if (groups == null)
{
groups = WSP.Services.Organizations.GetSecurityGroupsByMember(principal.ItemId, principal.AccountId);
HttpContext.Current.Session[WebDavAppConfigManager.Instance.SessionKeys.UserGroupsKey] = groups;
}
return groups ?? new ExchangeAccount[0];
}
}
}

View file

@ -147,6 +147,11 @@
<DesignTime>True</DesignTime>
<DependentUpon>HttpErrors.resx</DependentUpon>
</Compile>
<Compile Include="Resources\WebDavResources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>WebDavResources.resx</DependentUpon>
</Compile>
<Compile Include="Security\Authorization\Enums\WebDavPermissions.cs" />
<Compile Include="Security\Authorization\WebDavAuthorizationService.cs" />
<Compile Include="Security\Cryptography\CryptoUtils.cs" />
@ -175,6 +180,10 @@
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>HttpErrors.Designer.cs</LastGenOutput>
</EmbeddedResource>
<EmbeddedResource Include="Resources\WebDavResources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>WebDavResources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />

View file

@ -27,7 +27,11 @@ namespace WebsitePanel.WebDavPortal
"~/Scripts/appScripts/recalculateResourseHeight.js",
"~/Scripts/appScripts/uploadingData2.js",
"~/Scripts/appScripts/authentication.js",
"~/Scripts/appScripts/dialogs.js"));
"~/Scripts/appScripts/messages.js",
"~/Scripts/appScripts/fileBrowsing.js",
"~/Scripts/appScripts/dialogs.js",
"~/Scripts/appScripts/wsp.js"
));
bundles.Add(new ScriptBundle("~/bundles/authScripts").Include(
"~/Scripts/appScripts/authentication.js"));

View file

@ -42,6 +42,12 @@ namespace WebsitePanel.WebDavPortal
#endregion
routes.MapRoute(
name: FileSystemRouteNames.DeleteFiles,
url: "files-group-action/delete",
defaults: new { controller = "FileSystem", action = "DeleteFiles" }
);
routes.MapRoute(
name: FileSystemRouteNames.UploadFile,
url: "upload-file/{org}/{*pathPart}",

View file

@ -26,6 +26,32 @@ textarea {
.element-container {
margin-bottom: 15px;
text-align:center;
cursor: pointer;
}
.element-container .element {
position: relative;
text-align:center;
}
.selected-file .element {
position: relative;
box-sizing:border-box;
-moz-box-sizing:border-box;
-webkit-box-sizing:border-box;
border: 1px solid rgb(80, 152, 249);
padding: 3px;
}
.selected-file .element div.selected-element-overlay {
position:absolute;
top:0px;
left: 0px;
width:100%;
height:100%;
background:rgb(200, 224, 255);
opacity:0.3;
pointer-events: none;
}
#errorMessage {
@ -55,3 +81,17 @@ textarea {
.modal-vertical-centered {
margin-top: 25%;
}
.file-actions-menu {
margin-top: 10px;
margin-bottom: 15px;
}
.file-actions-menu .file-deletion {
display: none;
}
#message-area {
margin-top: 15px;
}

View file

@ -6,6 +6,8 @@ using WebsitePanel.WebDav.Core.Config;
using WebsitePanel.WebDav.Core.Security.Authentication;
using WebsitePanel.WebDav.Core.Security.Cryptography;
using WebsitePanel.WebDavPortal.Models;
using WebsitePanel.WebDavPortal.Models.Common;
using WebsitePanel.WebDavPortal.Models.Common.Enums;
using WebsitePanel.WebDavPortal.UI.Routes;
using WebsitePanel.WebDav.Core.Interfaces.Security;
using WebsitePanel.WebDav.Core;

View file

@ -19,6 +19,10 @@ using WebsitePanel.WebDavPortal.CustomAttributes;
using WebsitePanel.WebDavPortal.Extensions;
using WebsitePanel.WebDavPortal.Models;
using System.Net;
using WebsitePanel.WebDavPortal.Models.Common;
using WebsitePanel.WebDavPortal.Models.Common.Enums;
using WebsitePanel.WebDavPortal.Models.FileSystem;
using WebsitePanel.WebDavPortal.UI;
using WebsitePanel.WebDavPortal.UI.Routes;
namespace WebsitePanel.WebDavPortal.Controllers
@ -72,7 +76,7 @@ namespace WebsitePanel.WebDavPortal.Controllers
return View(model);
}
catch (UnauthorizedException)
catch (UnauthorizedException e)
{
throw new HttpException(404, "Not Found");
}
@ -121,5 +125,39 @@ namespace WebsitePanel.WebDavPortal.Controllers
return RedirectToRoute(FileSystemRouteNames.ShowContentPath);
}
[HttpPost]
public JsonResult DeleteFiles(IEnumerable<string> filePathes = null)
{
var model = new DeleteFilesModel();
if (filePathes == null)
{
model.AddMessage(MessageType.Error, Resources.NoFilesAreSelected);
return Json(model);
}
foreach (var file in filePathes)
{
try
{
_webdavManager.DeleteResource(Server.UrlDecode(file));
model.DeletedFiles.Add(file);
}
catch (WebDavException exception)
{
model.AddMessage(MessageType.Error, exception.Message);
}
}
if (model.DeletedFiles.Any())
{
model.AddMessage(MessageType.Success, string.Format(Resources.ItemsWasRemovedFormat, model.DeletedFiles.Count));
}
return Json(model);
}
}
}

View file

@ -0,0 +1,21 @@
using System.Reflection;
using System.Web.Mvc;
namespace WebsitePanel.WebDavPortal.CustomAttributes
{
public class FormValueRequiredAttribute : ActionMethodSelectorAttribute
{
private readonly string _submitButtonName;
public FormValueRequiredAttribute(string submitButtonName)
{
_submitButtonName = submitButtonName;
}
public override bool IsValidForRequest(ControllerContext controllerContext, MethodInfo methodInfo)
{
var value = controllerContext.HttpContext.Request.Form[_submitButtonName];
return !string.IsNullOrEmpty(value);
}
}
}

View file

@ -1,10 +1,11 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using WebsitePanel.Providers.HostedSolution;
using WebsitePanel.WebDavPortal.Models.Common;
namespace WebsitePanel.WebDavPortal.Models
{
public class AccountModel
public class AccountModel : BaseModel
{
[Required]
[Display(Name = @"Login")]

View file

@ -0,0 +1,25 @@
using System.Collections.Generic;
using System.Web.Mvc;
using WebsitePanel.WebDavPortal.Models.Common.Enums;
namespace WebsitePanel.WebDavPortal.Models.Common
{
public class BaseModel
{
public BaseModel()
{
Messages = new List<Message>();
}
public List<Message> Messages { get; private set; }
public void AddMessage(MessageType type, string value)
{
Messages.Add(new Message
{
Type =type,
Value = value
});
}
}
}

View file

@ -0,0 +1,10 @@
namespace WebsitePanel.WebDavPortal.Models.Common.Enums
{
public enum MessageType
{
Success,
Info,
Warning,
Error
}
}

View file

@ -0,0 +1,10 @@
using WebsitePanel.WebDavPortal.Models.Common.Enums;
namespace WebsitePanel.WebDavPortal.Models.Common
{
public class Message
{
public MessageType Type {get;set;}
public string Value { get; set; }
}
}

View file

@ -1,8 +1,9 @@
using System;
using WebsitePanel.WebDavPortal.Models.Common;
namespace WebsitePanel.WebDavPortal.Models
{
public class ErrorModel
public class ErrorModel : BaseModel
{
public int HttpStatusCode { get; set; }
public string Message { get; set; }

View file

@ -0,0 +1,15 @@
using System.Collections.Generic;
using WebsitePanel.WebDavPortal.Models.Common;
namespace WebsitePanel.WebDavPortal.Models.FileSystem
{
public class DeleteFilesModel : BaseModel
{
public DeleteFilesModel()
{
DeletedFiles = new List<string>();
}
public List<string> DeletedFiles { get; set; }
}
}

View file

@ -1,10 +1,11 @@
using System.Collections.Generic;
using WebsitePanel.WebDav.Core.Client;
using WebsitePanel.WebDav.Core.Security.Authorization.Enums;
using WebsitePanel.WebDavPortal.Models.Common;
namespace WebsitePanel.WebDavPortal.Models
{
public class ModelForWebDav
public class ModelForWebDav : BaseModel
{
public IEnumerable<IHierarchyItem> Items { get; set; }
public string UrlSuffix { get; set; }

View file

@ -1,6 +1,8 @@
namespace WebsitePanel.WebDavPortal.Models
using WebsitePanel.WebDavPortal.Models.Common;
namespace WebsitePanel.WebDavPortal.Models
{
public class OfficeOnlineModel
public class OfficeOnlineModel : BaseModel
{
public string Url { get; set; }
public string FileName { get; set; }

View file

@ -1,20 +1,79 @@
var processDialog;
processDialog = processDialog || (function () {
var processDialogDiv = $('#processDialog');
function WspDialogs() {
this.settings = { dialogId: "#confirm-dialog", processDialogId: "#processDialog" };
}
WspDialogs.prototype =
{
showConfirmDialog: function(title, content, positiveButton, positiveClickFunction, dialogId) {
dialogId = dialogId || this.settings.dialogId;
//title replace
if (title) {
$(dialogId).find('.modal-title').empty();
$(dialogId).find('.modal-title').text(title);
}
//body replace
$(dialogId).find('.modal-body').empty();
$(dialogId).find('.modal-body').html(content);
//title replace
if (positiveButton) {
$(dialogId).find('.modal-footer .positive-button').empty();
$(dialogId).find('.modal-footer .positive-button').text(positiveButton);
}
//binding click event
$(dialogId).find('.modal-footer .positive-button').unbind('click');
$(dialogId).find('.modal-footer .positive-button').click(positiveClickFunction);
$(dialogId).modal();
},
showProcessDialog: function() {
$(this.settings.processDialogId).modal();
},
hideProcessDialog: function() {
$(this.settings.processDialogId).modal('hide');
}
};
/*
wsp.dialogs = wsp.dialogs || (function () {
var settings = { dialogId: "#confirm-dialog" };
return {
showPleaseWait: function () {
settings: settings,
showConfirmDialog : function (title, content, positiveButton, positiveClickFunction, dialogId) {
dialogId = dialogId || this.settings.dialogId;
//title replace
if (title) {
$(dialogId).find('.modal-title').empty();
$(dialogId).find('.modal-title').text(title);
}
//body replace
$(dialogId).find('.modal-body').empty();
$(dialogId).find('.modal-body').html(content);
//title replace
if (positiveButton) {
$(dialogId).find('.modal-footer .positive-button').empty();
$(dialogId).find('.modal-footer .positive-button').text(positiveButton);
}
//binding click event
$(dialogId).find('.modal-footer .positive-button').unbind('click');
$(dialogId).find('.modal-footer .positive-button').click(positiveClickFunction);
$(dialogId).modal();
},
showProcessDialog: function () {
$('#processDialog').modal();
},
hidePleaseWait: function () {
$('#processDialog').modal('hide');
},
}
};
})();
$(document).ready(function() {
$('.processing-dialog').click(function () {
processDialog.showPleaseWait();
});
});
})();*/

View file

@ -0,0 +1,89 @@
function WspFileBrowser() {
this.settings = { deletionBlockSelector: ".file-actions-menu .file-deletion", deletionUrl: "files-group-action/delete1" };
}
WspFileBrowser.prototype = {
setSettings: function(options) {
this.settings = $.extend(this.settings, options);
},
clearAllSelectedItems: function() {
$('.element-container').removeClass("selected-file");
},
selectItem: function(item) {
$(item).addClass("selected-file");
},
openItem: function(item) {
var links = $(item).find('.file-link');
if (links.length != 0) {
links[0].click();
}
},
getSelectedItemsCount: function() {
return $('.element-container.selected-file').length;
},
getSelectedItemsPaths: function() {
return $('.element-container.selected-file a').map(function() {
return $(this).attr('href');
}).get();
},
deleteSelectedItems: function(e) {
$.ajax({
type: 'POST',
url: wsp.fileBrowser.settings.deletionUrl,
data: { filePathes: wsp.fileBrowser.getSelectedItemsPaths() },
dataType: "json",
success: function(model) {
wsp.messages.showMessages(model.Messages);
wsp.fileBrowser.clearDeletedItems(model.DeletedFiles);
wsp.fileBrowser.refreshDeletionBlock();
wsp.dialogs.hideProcessDialog();
},
error: function(jqXHR, textStatus, errorThrown) {
wsp.messages.addErrorMessage(errorThrown);
wsp.fileBrowser.refreshDeletionBlock();
wsp.dialogs.hideProcessDialog();
}
});
wsp.dialogs.showProcessDialog();
},
clearDeletedItems: function(items) {
$.each(items, function(i, item) {
$('.element-container').has('a[href="' + item + '"]').remove();
});
},
refreshDeletionBlock: function() {
if (this.getSelectedItemsCount() > 0) {
$(this.settings.deletionBlockSelector).css('display', 'inline-block');
} else {
$(this.settings.deletionBlockSelector).hide();
}
}
};

View file

@ -0,0 +1,55 @@
function WspMessager(messageDivId) {
this.settings = {
messageDivId: messageDivId,
successClass: "alert-success",
infoClass: "alert-info",
warningClass: "alert-warning",
dangerClass: "alert-danger",
messageDivtemplate: '<div class="alert {0} alert-dismissible" role="alert"><button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>{1}</div>'
};
}
WspMessager.prototype = {
addMessage: function(cssClass, message) {
var messageDiv = jQuery.validator.format(this.settings.messageDivtemplate, cssClass, message);
$(messageDiv).appendTo(this.settings.messageDivId);
},
addSuccessMessage: function(message) {
this.addMessage(this.settings.successClass, message);
},
addInfoMessage: function(message) {
this.addMessage(this.settings.infoClass, message);
},
addWarningMessage : function (message) {
this.addMessage(this.settings.warningClass, message);
},
addErrorMessage: function (message) {
this.addMessage(this.settings.dangerClass, message);
},
showMessages: function (messages) {
var objthis = this;
$.each(messages, function(i, message) {
if ((message.Type == 0)) {
objthis.addSuccessMessage(message.Value);
}
else if (message.Type == 1) {
objthis.addInfoMessage(message.Value);
}
else if (message.Type == 2) {
objthis.addWarningMessage(message.Value);
}
else if (message.Type == 3) {
objthis.addErrorMessage(message.Value);
}
}
);
}
};

View file

@ -6,6 +6,10 @@
maxHeight = Math.max.apply(null, heights);
if (maxHeight < 135) {
maxHeight = 135;
}
$(".element-container").height(maxHeight);
});
}

View file

@ -0,0 +1,54 @@
var wsp = {
messages: new WspMessager('#message-area'),
fileBrowser: new WspFileBrowser(),
dialogs: new WspDialogs()
};
$(document).ready(function () {
$('.processing-dialog').click(function () {
wsp.dialogs.showProcessDialog();
});
});
//Toggle file select + Ctrl multiselect
$(document).on('click', '.element-container', function (e) {
if (e.ctrlKey) {
$(this).toggleClass("selected-file");
} else {
wsp.fileBrowser.clearAllSelectedItems();
wsp.fileBrowser.selectItem(this);
}
wsp.fileBrowser.refreshDeletionBlock();
});
//Double click file open
$(document).on('dblclick', '.element-container', function (e) {
wsp.fileBrowser.openItem(this);
});
//Delete button click
$(document).on('click', '.file-deletion #delete-button', function (e) {
var dialogId = $(this).data('target');
var buttonText = $(this).data('target-positive-button-text');
var content = $(this).data('target-content');
var title = $(this).data('target-title-text');
content = jQuery.validator.format(content, wsp.fileBrowser.getSelectedItemsCount());
wsp.dialogs.showConfirmDialog(title, content, buttonText, wsp.fileBrowser.deleteSelectedItems, dialogId);
});
$(document).click(function (event) {
if (!$(event.target).closest('.element-container, .prevent-deselect').length) {
wsp.fileBrowser.clearAllSelectedItems();
wsp.fileBrowser.refreshDeletionBlock();
}
})

View file

@ -69,6 +69,15 @@ namespace WebsitePanel.WebDavPortal.UI {
}
}
/// <summary>
/// Looks up a localized string similar to Cancel.
/// </summary>
public static string Cancel {
get {
return ResourceManager.GetString("Cancel", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Close.
/// </summary>
@ -78,6 +87,42 @@ namespace WebsitePanel.WebDavPortal.UI {
}
}
/// <summary>
/// Looks up a localized string similar to Confirm.
/// </summary>
public static string Confirm {
get {
return ResourceManager.GetString("Confirm", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Delete.
/// </summary>
public static string Delete {
get {
return ResourceManager.GetString("Delete", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Delete File?.
/// </summary>
public static string DeleteFileQuestion {
get {
return ResourceManager.GetString("DeleteFileQuestion", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Are you sure you want to delete {0} item(s)?.
/// </summary>
public static string DialogsContentConfrimFileDeletion {
get {
return ResourceManager.GetString("DialogsContentConfrimFileDeletion", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to File Upload.
/// </summary>
@ -96,6 +141,24 @@ namespace WebsitePanel.WebDavPortal.UI {
}
}
/// <summary>
/// Looks up a localized string similar to {0} items was removed..
/// </summary>
public static string ItemsWasRemovedFormat {
get {
return ResourceManager.GetString("ItemsWasRemovedFormat", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to No files are selected..
/// </summary>
public static string NoFilesAreSelected {
get {
return ResourceManager.GetString("NoFilesAreSelected", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Processing.
/// </summary>
@ -122,5 +185,14 @@ namespace WebsitePanel.WebDavPortal.UI {
return ResourceManager.GetString("Upload", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Yes.
/// </summary>
public static string Yes {
get {
return ResourceManager.GetString("Yes", resourceCulture);
}
}
}
}

View file

@ -120,15 +120,36 @@
<data name="Actions" xml:space="preserve">
<value>Actions</value>
</data>
<data name="Cancel" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="Close" xml:space="preserve">
<value>Close</value>
</data>
<data name="Confirm" xml:space="preserve">
<value>Confirm</value>
</data>
<data name="Delete" xml:space="preserve">
<value>Delete</value>
</data>
<data name="DeleteFileQuestion" xml:space="preserve">
<value>Delete File?</value>
</data>
<data name="DialogsContentConfrimFileDeletion" xml:space="preserve">
<value>Are you sure you want to delete {0} item(s)?</value>
</data>
<data name="FileUpload" xml:space="preserve">
<value>File Upload</value>
</data>
<data name="GigabyteShort" xml:space="preserve">
<value>Gb</value>
</data>
<data name="ItemsWasRemovedFormat" xml:space="preserve">
<value>{0} items was removed.</value>
</data>
<data name="NoFilesAreSelected" xml:space="preserve">
<value>No files are selected.</value>
</data>
<data name="Processing" xml:space="preserve">
<value>Processing</value>
</data>
@ -138,4 +159,7 @@
<data name="Upload" xml:space="preserve">
<value>Upload</value>
</data>
<data name="Yes" xml:space="preserve">
<value>Yes</value>
</data>
</root>

View file

@ -12,5 +12,7 @@ namespace WebsitePanel.WebDavPortal.UI.Routes
public const string ShowAdditionalContent = "ShowAdditionalContentRoute";
public const string UploadFile = "UplaodFIleRoute";
public const string DeleteFiles = "DeleteFilesRoute";
}
}

View file

@ -12,12 +12,7 @@
var webDavManager = DependencyResolver.Current.GetService<IWebDavManager>();
ViewBag.Title = WebDavAppConfigManager.Instance.ApplicationName;
}
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/appScripts")
<script>
recalculateResourseHeight();
</script>
<br />
@if (Model != null && !string.IsNullOrEmpty(Model.Error))
@ -26,36 +21,35 @@
}
else
{
<div class="container">
<div class="container prevent-deselect">
@if (Model != null)
{
string header = WspContext.User.OrganizationId;
<a href="/@header/" class="btn btn-primary btn-sm active" role="button">@header</a>
string[] elements = Model.UrlSuffix.Split(new[] {"/"}, StringSplitOptions.RemoveEmptyEntries);
string[] elements = Model.UrlSuffix.Split(new[] { "/" }, StringSplitOptions.RemoveEmptyEntries);
for (int i = 0; i < elements.Length; i++)
{
<span class="glyphicon glyphicon-chevron-right" style="top: 2px;"></span>
<a href="@string.Concat("/" + header + "/", string.Join("/", elements.Take(i + 1)))" class="btn btn-primary btn-sm active" role="button">@elements[i]</a>
}
if (Model.Permissions.HasFlag(WebDavPermissions.Write))
{
@*<a id="upload-button" class="btn btn-success btn-sm active" data-toggle="modal" data-target="#file-upload" role="button">@Resources.FileUpload</a>*@
<div class="dropdown navbar-right">
<button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-expanded="true">
@Resources.Actions
<span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
<li role="presentation"><a id="upload-button" data-toggle="modal" data-target="#file-upload" role="menuitem" tabindex="-1" href="#">@Resources.FileUpload</a></li>
</ul>
</div>
}
</div>
<div class="container file-actions-menu prevent-deselect">
@if (Model.Permissions.HasFlag(WebDavPermissions.Write))
{
<div class="file-deletion navbar-left">
<a id="delete-button" class="btn btn-danger btn-sm active" role="button"
data-target="#confirm-dialog"
data-target-positive-button-text="@Resources.Delete"
data-target-title-text="@Resources.DeleteFileQuestion"
data-target-content="@Resources.DialogsContentConfrimFileDeletion">@Resources.Delete</a>
</div>
<a id="upload-button" class="btn btn-success btn-sm active navbar-right" data-toggle="modal" data-target="#file-upload" role="button">@Resources.FileUpload</a>
}
</div>
<br />
<div class="container">
<div class="row" id="resourcesDiv">
@if (Model != null)
{
@ -68,6 +62,13 @@ else
</div>
}
@section scripts{
<script>
wsp.fileBrowser.setSettings({ deletionUrl: "@Url.RouteUrl(FileSystemRouteNames.DeleteFiles)" });
recalculateResourseHeight();
</script>
}
@section popups
{
@ -93,4 +94,5 @@ else
</div>
@Html.Partial("_ProcessDialog", null)
@Html.Partial("_ConfirmDialog")
}

View file

@ -17,12 +17,12 @@
{
case FileOpenerType.OfficeOnline:
isTargetBlank = true;
var pathPart = Model.Href.AbsolutePath.Replace("/" + WspContext.User.OrganizationId, "");
var pathPart = Model.Href.AbsolutePath.Replace("/" + WspContext.User.OrganizationId, "").TrimStart('/');
href = string.Concat(Url.RouteUrl(FileSystemRouteNames.ShowOfficeOnlinePath, new { org = WspContext.User.OrganizationId, pathPart = "" }), pathPart);
break;
default:
isTargetBlank = false;
href = Model.Href.AbsolutePath;
href = Model.Href.LocalPath;
break;
}
@ -39,17 +39,24 @@
}
<div class="col-sm-2 element-container">
<a href="@href" @Html.Raw(isTargetBlank ? "target=\"_blank\"" : string.Empty) title="@name">
<div class="element">
<img class="icon-size" src="@Url.Content(actualPath)" />
<a href="@href" @Html.Raw(isTargetBlank ? "target=\"_blank\"" : string.Empty) class="file-link" title="@name">
<p style="word-wrap: break-word;">@name</p>
</a>
@if (showStatistic)
{
<div class="progress web-dav-folder-progress">
<div class="progress-bar" role="progressbar" aria-valuenow="@percent" aria-valuemin="0" aria-valuemax="100" style="width: @percent%;">
@percent%
<p class="progress-text">@percent%</p>
</div>
</div>
<p>@Math.Round(Convert.ToDecimal(resource.ContentLength) / 1024, 2) / @Math.Round(Convert.ToDecimal(resource.AllocatedSpace) / 1024, 2) @Resources.GigabyteShort</p>
}
<div class="selected-element-overlay">
</div>
</div>
</div>

View file

@ -0,0 +1,20 @@
@using WebsitePanel.WebDavPortal.UI
<div class="modal fade" id="confirm-dialog" tabindex="-1" role="dialog" aria-labelledby="confirm-dalog-label" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="confirm-dalog-label">@Resources.Confirm</h4>
</div>
<div class="modal-body">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">@Resources.Cancel</button>
<a href="#" class="btn btn-danger danger positive-button" data-dismiss="modal">@Resources.Yes</a>
</div>
</div>
</div>
</div>

View file

@ -1,9 +1,11 @@
@using Ninject
@using System.Web.Script.Serialization
@using Ninject
@using WebsitePanel.WebDav.Core
@using WebsitePanel.WebDav.Core.Config
@using WebsitePanel.WebDavPortal.DependencyInjection
@using WebsitePanel.WebDavPortal.Models
@using WebsitePanel.WebDavPortal.UI.Routes;
@model WebsitePanel.WebDavPortal.Models.Common.BaseModel
<!DOCTYPE html>
<html>
@ -15,8 +17,8 @@
@Scripts.Render("~/bundles/modernizr")
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar navbar-inverse navbar-fixed-top prevent-deselect">
<div class="container top-container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
@ -32,18 +34,25 @@
<a id="logout" class="nav navbar-text navbar-right" href="@Url.RouteUrl(AccountRouteNames.Logout)" title="Log out"><i class="glyphicon glyphicon-log-out"></i></a>
<h4 id="username" class="nav navbar-text navbar-right">@WspContext.User.Login</h4>
}
}
}
</div>
</div>
</div>
<div class="container body-content">
<div id="message-area" class="container prevent-deselect"> </div>
@RenderBody()
</div>
<div class="prevent-deselect">
@RenderSection("popups", required: false)
</div>
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/jqueryval")
@Scripts.Render("~/bundles/bootstrap")
@Scripts.Render("~/bundles/appScripts")
@if (WspContext.User != null)
{
@ -54,6 +63,15 @@
</script>
}
@if (Model != null)
{
<script>
wsp.messages.showMessages(@Html.Raw(Json.Encode(Model.Messages)));
</script>
}
@RenderSection("scripts", required: false)

View file

@ -46,8 +46,10 @@
<sessionKeys>
<add key="AccountInfoSessionKey" value="AccountInfo" />
<add key="WebDavManagerSessionKey" value="WebDavManager" />
<add key="WebDavRootFolderPermissionsKey" value="WebDavRootFolderPermissions" />
<add key="ResourseRenderCountSessionKey" value="ResourseRenderCount" />
<add key="ItemIdSessionKey" value="ItemId" />
<add key="UserGroupsKey" value="UserGroups" />
</sessionKeys>
<fileIcons defaultPath="~/Content/Images/other-icon.png">
<add extension=".txt" path="~/Content/Images/txt-icon.png" />

View file

@ -145,6 +145,7 @@
<Compile Include="Controllers\ErrorController.cs" />
<Compile Include="Controllers\FileSystemController.cs" />
<Compile Include="Controllers\OwaController.cs" />
<Compile Include="CustomAttributes\FormValueRequiredAttribute.cs" />
<Compile Include="CustomAttributes\LdapAuthorizationAttribute.cs" />
<Compile Include="DependencyInjection\NinjectDependecyResolver.cs" />
<Compile Include="DependencyInjection\PortalDependencies.cs" />
@ -159,8 +160,12 @@
</Compile>
<Compile Include="HttpHandlers\FileTransferRequestHandler.cs" />
<Compile Include="Models\AccountModel.cs" />
<Compile Include="Models\Common\BaseModel.cs" />
<Compile Include="Models\Common\Enums\MessageType.cs" />
<Compile Include="Models\Common\Message.cs" />
<Compile Include="Models\DirectoryIdentity.cs" />
<Compile Include="Models\ErrorModel.cs" />
<Compile Include="Models\FileSystem\DeleteFilesModel.cs" />
<Compile Include="Models\ModelForWebDav.cs" />
<Compile Include="Models\OfficeOnlineModel.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
@ -225,8 +230,11 @@
<None Include="Scripts\jquery-2.1.1.intellisense.js" />
<Content Include="Scripts\appScripts\authentication.js" />
<Content Include="Scripts\appScripts\dialogs.js" />
<Content Include="Scripts\appScripts\fileBrowsing.js" />
<Content Include="Scripts\appScripts\messages.js" />
<Content Include="Scripts\appScripts\recalculateResourseHeight.js" />
<Content Include="Scripts\appScripts\uploadingData2.js" />
<Content Include="Scripts\appScripts\wsp.js" />
<Content Include="Scripts\bootstrap.js" />
<Content Include="Scripts\bootstrap.min.js" />
<Content Include="Scripts\jquery-2.1.1.js" />
@ -265,6 +273,7 @@
<Content Include="Views\FileSystem\_ResourseCollectionPartial.cshtml" />
<Content Include="Views\FileSystem\_ResoursePartial.cshtml" />
<Content Include="Views\Shared\_ProcessDialog.cshtml" />
<Content Include="Views\Shared\_ConfirmDialog.cshtml" />
</ItemGroup>
<ItemGroup>
<Folder Include="Views\Owa\" />

View file

@ -117,36 +117,42 @@
</Compile>
<Compile Include="BillingCycles.ascx.cs">
<DependentUpon>BillingCycles.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="BillingCycles.ascx.designer.cs">
<DependentUpon>BillingCycles.ascx</DependentUpon>
</Compile>
<Compile Include="BillingCyclesAddCycle.ascx.cs">
<DependentUpon>BillingCyclesAddCycle.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="BillingCyclesAddCycle.ascx.designer.cs">
<DependentUpon>BillingCyclesAddCycle.ascx</DependentUpon>
</Compile>
<Compile Include="BillingCyclesEditCycle.ascx.cs">
<DependentUpon>BillingCyclesEditCycle.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="BillingCyclesEditCycle.ascx.designer.cs">
<DependentUpon>BillingCyclesEditCycle.ascx</DependentUpon>
</Compile>
<Compile Include="Categories.ascx.cs">
<DependentUpon>Categories.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Categories.ascx.designer.cs">
<DependentUpon>Categories.ascx</DependentUpon>
</Compile>
<Compile Include="CategoriesAddCategory.ascx.cs">
<DependentUpon>CategoriesAddCategory.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="CategoriesAddCategory.ascx.designer.cs">
<DependentUpon>CategoriesAddCategory.ascx</DependentUpon>
</Compile>
<Compile Include="CategoriesEditCategory.ascx.cs">
<DependentUpon>CategoriesEditCategory.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="CategoriesEditCategory.ascx.designer.cs">
<DependentUpon>CategoriesEditCategory.ascx</DependentUpon>
@ -158,8 +164,12 @@
<Compile Include="Code\Framework\CheckoutBasePage.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Code\Framework\ecControlBase.cs" />
<Compile Include="Code\Framework\ecModuleBase.cs" />
<Compile Include="Code\Framework\ecControlBase.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Code\Framework\ecModuleBase.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Code\Framework\ecPanelFormatter.cs" />
<Compile Include="Code\Framework\ecPanelGlobals.cs" />
<Compile Include="Code\Framework\ecPanelRequest.cs" />
@ -186,150 +196,175 @@
</Compile>
<Compile Include="CustomerPaymentProfile.ascx.cs">
<DependentUpon>CustomerPaymentProfile.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="CustomerPaymentProfile.ascx.designer.cs">
<DependentUpon>CustomerPaymentProfile.ascx</DependentUpon>
</Compile>
<Compile Include="CustomersInvoices.ascx.cs">
<DependentUpon>CustomersInvoices.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="CustomersInvoices.ascx.designer.cs">
<DependentUpon>CustomersInvoices.ascx</DependentUpon>
</Compile>
<Compile Include="CustomersInvoicesViewInvoice.ascx.cs">
<DependentUpon>CustomersInvoicesViewInvoice.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="CustomersInvoicesViewInvoice.ascx.designer.cs">
<DependentUpon>CustomersInvoicesViewInvoice.ascx</DependentUpon>
</Compile>
<Compile Include="CustomersPayments.ascx.cs">
<DependentUpon>CustomersPayments.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="CustomersPayments.ascx.designer.cs">
<DependentUpon>CustomersPayments.ascx</DependentUpon>
</Compile>
<Compile Include="CustomersServices.ascx.cs">
<DependentUpon>CustomersServices.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="CustomersServices.ascx.designer.cs">
<DependentUpon>CustomersServices.ascx</DependentUpon>
</Compile>
<Compile Include="CustomersServicesUpgradeService.ascx.cs">
<DependentUpon>CustomersServicesUpgradeService.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="CustomersServicesUpgradeService.ascx.designer.cs">
<DependentUpon>CustomersServicesUpgradeService.ascx</DependentUpon>
</Compile>
<Compile Include="CustomersServicesViewService.ascx.cs">
<DependentUpon>CustomersServicesViewService.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="CustomersServicesViewService.ascx.designer.cs">
<DependentUpon>CustomersServicesViewService.ascx</DependentUpon>
</Compile>
<Compile Include="DomainNames.ascx.cs">
<DependentUpon>DomainNames.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="DomainNames.ascx.designer.cs">
<DependentUpon>DomainNames.ascx</DependentUpon>
</Compile>
<Compile Include="DomainNamesAddDomain.ascx.cs">
<DependentUpon>DomainNamesAddDomain.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="DomainNamesAddDomain.ascx.designer.cs">
<DependentUpon>DomainNamesAddDomain.ascx</DependentUpon>
</Compile>
<Compile Include="DomainNamesEditDomain.ascx.cs">
<DependentUpon>DomainNamesEditDomain.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="DomainNamesEditDomain.ascx.designer.cs">
<DependentUpon>DomainNamesEditDomain.ascx</DependentUpon>
</Compile>
<Compile Include="DomainRegistrarDirecti.ascx.cs">
<DependentUpon>DomainRegistrarDirecti.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="DomainRegistrarDirecti.ascx.designer.cs">
<DependentUpon>DomainRegistrarDirecti.ascx</DependentUpon>
</Compile>
<Compile Include="DomainRegistrarEnom.ascx.cs">
<DependentUpon>DomainRegistrarEnom.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="DomainRegistrarEnom.ascx.designer.cs">
<DependentUpon>DomainRegistrarEnom.ascx</DependentUpon>
</Compile>
<Compile Include="EcommerceSystemSettings.ascx.cs">
<DependentUpon>EcommerceSystemSettings.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="EcommerceSystemSettings.ascx.designer.cs">
<DependentUpon>EcommerceSystemSettings.ascx</DependentUpon>
</Compile>
<Compile Include="HostingAddons.ascx.cs">
<DependentUpon>HostingAddons.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="HostingAddons.ascx.designer.cs">
<DependentUpon>HostingAddons.ascx</DependentUpon>
</Compile>
<Compile Include="HostingAddonsAddAddon.ascx.cs">
<DependentUpon>HostingAddonsAddAddon.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="HostingAddonsAddAddon.ascx.designer.cs">
<DependentUpon>HostingAddonsAddAddon.ascx</DependentUpon>
</Compile>
<Compile Include="HostingAddonsEditAddon.ascx.cs">
<DependentUpon>HostingAddonsEditAddon.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="HostingAddonsEditAddon.ascx.designer.cs">
<DependentUpon>HostingAddonsEditAddon.ascx</DependentUpon>
</Compile>
<Compile Include="HostingPlans.ascx.cs">
<DependentUpon>HostingPlans.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="HostingPlans.ascx.designer.cs">
<DependentUpon>HostingPlans.ascx</DependentUpon>
</Compile>
<Compile Include="HostingPlansAddPlan.ascx.cs">
<DependentUpon>HostingPlansAddPlan.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="HostingPlansAddPlan.ascx.designer.cs">
<DependentUpon>HostingPlansAddPlan.ascx</DependentUpon>
</Compile>
<Compile Include="HostingPlansEditPlan.ascx.cs">
<DependentUpon>HostingPlansEditPlan.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="HostingPlansEditPlan.ascx.designer.cs">
<DependentUpon>HostingPlansEditPlan.ascx</DependentUpon>
</Compile>
<Compile Include="NotificationNewInvoice.ascx.cs">
<DependentUpon>NotificationNewInvoice.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="NotificationNewInvoice.ascx.designer.cs">
<DependentUpon>NotificationNewInvoice.ascx</DependentUpon>
</Compile>
<Compile Include="NotificationPaymentReceived.ascx.cs">
<DependentUpon>NotificationPaymentReceived.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="NotificationPaymentReceived.ascx.designer.cs">
<DependentUpon>NotificationPaymentReceived.ascx</DependentUpon>
</Compile>
<Compile Include="NotificationServiceActivated.ascx.cs">
<DependentUpon>NotificationServiceActivated.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="NotificationServiceActivated.ascx.designer.cs">
<DependentUpon>NotificationServiceActivated.ascx</DependentUpon>
</Compile>
<Compile Include="NotificationServiceCancelled.ascx.cs">
<DependentUpon>NotificationServiceCancelled.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="NotificationServiceCancelled.ascx.designer.cs">
<DependentUpon>NotificationServiceCancelled.ascx</DependentUpon>
</Compile>
<Compile Include="NotificationServiceSuspended.ascx.cs">
<DependentUpon>NotificationServiceSuspended.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="NotificationServiceSuspended.ascx.designer.cs">
<DependentUpon>NotificationServiceSuspended.ascx</DependentUpon>
</Compile>
<Compile Include="OrderFailed.ascx.cs">
<DependentUpon>OrderFailed.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="OrderFailed.ascx.designer.cs">
<DependentUpon>OrderFailed.ascx</DependentUpon>
@ -343,48 +378,56 @@
</Compile>
<Compile Include="PaymentMethod2Checkout.ascx.cs">
<DependentUpon>PaymentMethod2Checkout.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="PaymentMethod2Checkout.ascx.designer.cs">
<DependentUpon>PaymentMethod2Checkout.ascx</DependentUpon>
</Compile>
<Compile Include="PaymentMethodCreditCard.ascx.cs">
<DependentUpon>PaymentMethodCreditCard.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="PaymentMethodCreditCard.ascx.designer.cs">
<DependentUpon>PaymentMethodCreditCard.ascx</DependentUpon>
</Compile>
<Compile Include="PaymentMethodOffline.ascx.cs">
<DependentUpon>PaymentMethodOffline.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="PaymentMethodOffline.ascx.designer.cs">
<DependentUpon>PaymentMethodOffline.ascx</DependentUpon>
</Compile>
<Compile Include="PaymentMethodPayPalAccount.ascx.cs">
<DependentUpon>PaymentMethodPayPalAccount.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="PaymentMethodPayPalAccount.ascx.designer.cs">
<DependentUpon>PaymentMethodPayPalAccount.ascx</DependentUpon>
</Compile>
<Compile Include="PaymentMethods\2CO_Payment.ascx.cs">
<DependentUpon>2CO_Payment.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="PaymentMethods\2CO_Payment.ascx.designer.cs">
<DependentUpon>2CO_Payment.ascx</DependentUpon>
</Compile>
<Compile Include="PaymentMethods\CreditCard_Payment.ascx.cs">
<DependentUpon>CreditCard_Payment.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="PaymentMethods\CreditCard_Payment.ascx.designer.cs">
<DependentUpon>CreditCard_Payment.ascx</DependentUpon>
</Compile>
<Compile Include="PaymentMethods\Offline_Payment.ascx.cs">
<DependentUpon>Offline_Payment.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="PaymentMethods\Offline_Payment.ascx.designer.cs">
<DependentUpon>Offline_Payment.ascx</DependentUpon>
</Compile>
<Compile Include="PaymentMethods\PPAccount_Payment.ascx.cs">
<DependentUpon>PPAccount_Payment.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="PaymentMethods\PPAccount_Payment.ascx.designer.cs">
<DependentUpon>PPAccount_Payment.ascx</DependentUpon>
@ -398,30 +441,35 @@
</Compile>
<Compile Include="ProductControls\DomainName_ServiceDetails.ascx.cs">
<DependentUpon>DomainName_ServiceDetails.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="ProductControls\DomainName_ServiceDetails.ascx.designer.cs">
<DependentUpon>DomainName_ServiceDetails.ascx</DependentUpon>
</Compile>
<Compile Include="ProductControls\HostingAddon_ServiceDetails.ascx.cs">
<DependentUpon>HostingAddon_ServiceDetails.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="ProductControls\HostingAddon_ServiceDetails.ascx.designer.cs">
<DependentUpon>HostingAddon_ServiceDetails.ascx</DependentUpon>
</Compile>
<Compile Include="ProductControls\HostingPlan_Brief.ascx.cs">
<DependentUpon>HostingPlan_Brief.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="ProductControls\HostingPlan_Brief.ascx.designer.cs">
<DependentUpon>HostingPlan_Brief.ascx</DependentUpon>
</Compile>
<Compile Include="ProductControls\HostingPlan_Highlights.ascx.cs">
<DependentUpon>HostingPlan_Highlights.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="ProductControls\HostingPlan_Highlights.ascx.designer.cs">
<DependentUpon>HostingPlan_Highlights.ascx</DependentUpon>
</Compile>
<Compile Include="ProductControls\HostingPlan_ServiceDetails.ascx.cs">
<DependentUpon>HostingPlan_ServiceDetails.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="ProductControls\HostingPlan_ServiceDetails.ascx.designer.cs">
<DependentUpon>HostingPlan_ServiceDetails.ascx</DependentUpon>
@ -429,24 +477,28 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ProvisioningSettingsEdit.ascx.cs">
<DependentUpon>ProvisioningSettingsEdit.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="ProvisioningSettingsEdit.ascx.designer.cs">
<DependentUpon>ProvisioningSettingsEdit.ascx</DependentUpon>
</Compile>
<Compile Include="QuickSignup.ascx.cs">
<DependentUpon>QuickSignup.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="QuickSignup.ascx.designer.cs">
<DependentUpon>QuickSignup.ascx</DependentUpon>
</Compile>
<Compile Include="OrderComplete.ascx.cs">
<DependentUpon>OrderComplete.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="OrderComplete.ascx.designer.cs">
<DependentUpon>OrderComplete.ascx</DependentUpon>
</Compile>
<Compile Include="OrderCheckout.ascx.cs">
<DependentUpon>OrderCheckout.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="OrderCheckout.ascx.designer.cs">
<DependentUpon>OrderCheckout.ascx</DependentUpon>
@ -458,102 +510,119 @@
</Compile>
<Compile Include="SkinControls\CatalogBreadCrumb.ascx.cs">
<DependentUpon>CatalogBreadCrumb.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="SkinControls\CatalogBreadCrumb.ascx.designer.cs">
<DependentUpon>CatalogBreadCrumb.ascx</DependentUpon>
</Compile>
<Compile Include="StorefrontMenu.ascx.cs">
<DependentUpon>StorefrontMenu.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="StorefrontMenu.ascx.designer.cs">
<DependentUpon>StorefrontMenu.ascx</DependentUpon>
</Compile>
<Compile Include="StorefrontOrderProduct.ascx.cs">
<DependentUpon>StorefrontOrderProduct.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="StorefrontOrderProduct.ascx.designer.cs">
<DependentUpon>StorefrontOrderProduct.ascx</DependentUpon>
</Compile>
<Compile Include="StorefrontViewCategory.ascx.cs">
<DependentUpon>StorefrontViewCategory.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="StorefrontViewCategory.ascx.designer.cs">
<DependentUpon>StorefrontViewCategory.ascx</DependentUpon>
</Compile>
<Compile Include="StorefrontWelcome.ascx.cs">
<DependentUpon>StorefrontWelcome.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="StorefrontWelcome.ascx.designer.cs">
<DependentUpon>StorefrontWelcome.ascx</DependentUpon>
</Compile>
<Compile Include="StorefrontWelcomeEdit.ascx.cs">
<DependentUpon>StorefrontWelcomeEdit.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="StorefrontWelcomeEdit.ascx.designer.cs">
<DependentUpon>StorefrontWelcomeEdit.ascx</DependentUpon>
</Compile>
<Compile Include="SupportedPlugins\2Checkout_Settings.ascx.cs">
<DependentUpon>2Checkout_Settings.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="SupportedPlugins\2Checkout_Settings.ascx.designer.cs">
<DependentUpon>2Checkout_Settings.ascx</DependentUpon>
</Compile>
<Compile Include="SupportedPlugins\AuthorizeNet_Settings.ascx.cs">
<DependentUpon>AuthorizeNet_Settings.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="SupportedPlugins\AuthorizeNet_Settings.ascx.designer.cs">
<DependentUpon>AuthorizeNet_Settings.ascx</DependentUpon>
</Compile>
<Compile Include="SupportedPlugins\OfflinePayment_Settings.ascx.cs">
<DependentUpon>OfflinePayment_Settings.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="SupportedPlugins\OfflinePayment_Settings.ascx.designer.cs">
<DependentUpon>OfflinePayment_Settings.ascx</DependentUpon>
</Compile>
<Compile Include="SupportedPlugins\PayPalPro_Settings.ascx.cs">
<DependentUpon>PayPalPro_Settings.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="SupportedPlugins\PayPalPro_Settings.ascx.designer.cs">
<DependentUpon>PayPalPro_Settings.ascx</DependentUpon>
</Compile>
<Compile Include="SupportedPlugins\PayPalStandard_Settings.ascx.cs">
<DependentUpon>PayPalStandard_Settings.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="SupportedPlugins\PayPalStandard_Settings.ascx.designer.cs">
<DependentUpon>PayPalStandard_Settings.ascx</DependentUpon>
</Compile>
<Compile Include="Taxations.ascx.cs">
<DependentUpon>Taxations.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Taxations.ascx.designer.cs">
<DependentUpon>Taxations.ascx</DependentUpon>
</Compile>
<Compile Include="TaxationsAddTax.ascx.cs">
<DependentUpon>TaxationsAddTax.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="TaxationsAddTax.ascx.designer.cs">
<DependentUpon>TaxationsAddTax.ascx</DependentUpon>
</Compile>
<Compile Include="TaxationsEditTax.ascx.cs">
<DependentUpon>TaxationsEditTax.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="TaxationsEditTax.ascx.designer.cs">
<DependentUpon>TaxationsEditTax.ascx</DependentUpon>
</Compile>
<Compile Include="TermsAndConditions.ascx.cs">
<DependentUpon>TermsAndConditions.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="TermsAndConditions.ascx.designer.cs">
<DependentUpon>TermsAndConditions.ascx</DependentUpon>
</Compile>
<Compile Include="TermsAndConditionsEdit.ascx.cs">
<DependentUpon>TermsAndConditionsEdit.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="TermsAndConditionsEdit.ascx.designer.cs">
<DependentUpon>TermsAndConditionsEdit.ascx</DependentUpon>
</Compile>
<Compile Include="UserControls\AddonProducts.ascx.cs">
<DependentUpon>AddonProducts.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="UserControls\AddonProducts.ascx.designer.cs">
<DependentUpon>AddonProducts.ascx</DependentUpon>
@ -570,120 +639,140 @@
</Compile>
<Compile Include="UserControls\ChoosePaymentMethod.ascx.cs">
<DependentUpon>ChoosePaymentMethod.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="UserControls\ChoosePaymentMethod.ascx.designer.cs">
<DependentUpon>ChoosePaymentMethod.ascx</DependentUpon>
</Compile>
<Compile Include="UserControls\CreateUserAccount.ascx.cs">
<DependentUpon>CreateUserAccount.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="UserControls\CreateUserAccount.ascx.designer.cs">
<DependentUpon>CreateUserAccount.ascx</DependentUpon>
</Compile>
<Compile Include="UserControls\CustomerInvoiceTemplated.ascx.cs">
<DependentUpon>CustomerInvoiceTemplated.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="UserControls\CustomerInvoiceTemplated.ascx.designer.cs">
<DependentUpon>CustomerInvoiceTemplated.ascx</DependentUpon>
</Compile>
<Compile Include="UserControls\DomainNameBillingCycles.ascx.cs">
<DependentUpon>DomainNameBillingCycles.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="UserControls\DomainNameBillingCycles.ascx.designer.cs">
<DependentUpon>DomainNameBillingCycles.ascx</DependentUpon>
</Compile>
<Compile Include="UserControls\EmailNotificationEditor.ascx.cs">
<DependentUpon>EmailNotificationEditor.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="UserControls\EmailNotificationEditor.ascx.designer.cs">
<DependentUpon>EmailNotificationEditor.ascx</DependentUpon>
</Compile>
<Compile Include="UserControls\HostingAddonOneTimeFee.ascx.cs">
<DependentUpon>HostingAddonOneTimeFee.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="UserControls\HostingAddonOneTimeFee.ascx.designer.cs">
<DependentUpon>HostingAddonOneTimeFee.ascx</DependentUpon>
</Compile>
<Compile Include="UserControls\HostingPlanBillingCycles.ascx.cs">
<DependentUpon>HostingPlanBillingCycles.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="UserControls\HostingPlanBillingCycles.ascx.designer.cs">
<DependentUpon>HostingPlanBillingCycles.ascx</DependentUpon>
</Compile>
<Compile Include="UserControls\HostingPlanQuotas.ascx.cs">
<DependentUpon>HostingPlanQuotas.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="UserControls\HostingPlanQuotas.ascx.designer.cs">
<DependentUpon>HostingPlanQuotas.ascx</DependentUpon>
</Compile>
<Compile Include="UserControls\LoginUserAccount.ascx.cs">
<DependentUpon>LoginUserAccount.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="UserControls\LoginUserAccount.ascx.designer.cs">
<DependentUpon>LoginUserAccount.ascx</DependentUpon>
</Compile>
<Compile Include="UserControls\ManualPaymentAdd.ascx.cs">
<DependentUpon>ManualPaymentAdd.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="UserControls\ManualPaymentAdd.ascx.designer.cs">
<DependentUpon>ManualPaymentAdd.ascx</DependentUpon>
</Compile>
<Compile Include="UserControls\PlanDomainOption.ascx.cs">
<DependentUpon>PlanDomainOption.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="UserControls\PlanDomainOption.ascx.designer.cs">
<DependentUpon>PlanDomainOption.ascx</DependentUpon>
</Compile>
<Compile Include="UserControls\PlanHostingAddons.ascx.cs">
<DependentUpon>PlanHostingAddons.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="UserControls\PlanHostingAddons.ascx.designer.cs">
<DependentUpon>PlanHostingAddons.ascx</DependentUpon>
</Compile>
<Compile Include="UserControls\ProductHighlights.ascx.cs">
<DependentUpon>ProductHighlights.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="UserControls\ProductHighlights.ascx.designer.cs">
<DependentUpon>ProductHighlights.ascx</DependentUpon>
</Compile>
<Compile Include="UserControls\QuickHostingAddon.ascx.cs">
<DependentUpon>QuickHostingAddon.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="UserControls\QuickHostingAddon.ascx.designer.cs">
<DependentUpon>QuickHostingAddon.ascx</DependentUpon>
</Compile>
<Compile Include="UserControls\QuickHostingPlanCycles.ascx.cs">
<DependentUpon>QuickHostingPlanCycles.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="UserControls\QuickHostingPlanCycles.ascx.designer.cs">
<DependentUpon>QuickHostingPlanCycles.ascx</DependentUpon>
</Compile>
<Compile Include="UserControls\QuickHostingPlans.ascx.cs">
<DependentUpon>QuickHostingPlans.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="UserControls\QuickHostingPlans.ascx.designer.cs">
<DependentUpon>QuickHostingPlans.ascx</DependentUpon>
</Compile>
<Compile Include="UserControls\PathBreadCrumb.ascx.cs">
<DependentUpon>PathBreadCrumb.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="UserControls\PathBreadCrumb.ascx.designer.cs">
<DependentUpon>PathBreadCrumb.ascx</DependentUpon>
</Compile>
<Compile Include="UserControls\ProductCategories.ascx.cs">
<DependentUpon>ProductCategories.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="UserControls\ProductCategories.ascx.designer.cs">
<DependentUpon>ProductCategories.ascx</DependentUpon>
</Compile>
<Compile Include="UserControls\UserAccountDetails.ascx.cs">
<DependentUpon>UserAccountDetails.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="UserControls\UserAccountDetails.ascx.designer.cs">
<DependentUpon>UserAccountDetails.ascx</DependentUpon>
</Compile>
<Compile Include="ViewProductDetails.ascx.cs">
<DependentUpon>ViewProductDetails.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="ViewProductDetails.ascx.designer.cs">
<DependentUpon>ViewProductDetails.ascx</DependentUpon>

View file

@ -46,7 +46,7 @@ namespace WebsitePanel.Portal
/// <summary>
/// Summary description for Utils.
/// </summary
public class Utils
public static class Utils
{
public const string ModuleName = "WebsitePanel";
@ -335,7 +335,7 @@ namespace WebsitePanel.Portal
/// <param name="paramName">Name of the parameter to add.</param>
/// <param name="paramValue">Value for the parameter to add.</param>
/// <returns>Url with added parameter.</returns>
public static Uri AddParameterToUrl(Uri url, string paramName, string paramValue)
public static Uri AddParameter(this Uri url, string paramName, string paramValue)
{
var uriBuilder = new UriBuilder(url);
var query = HttpUtility.ParseQueryString(uriBuilder.Query);

View file

@ -51,7 +51,7 @@
</asp:TemplateField>
<asp:TemplateField SortExpression="ExternalIP" HeaderText="gvIPAddressesExternalIP">
<ItemTemplate>
<asp:hyperlink NavigateUrl='<%# EditUrl("AddressID", DataBinder.Eval(Container.DataItem, "AddressID").ToString(), "edit_ip") %>' runat="server" ID="Hyperlink2">
<asp:hyperlink NavigateUrl='<%# EditUrl("AddressID", DataBinder.Eval(Container.DataItem, "AddressID").ToString(), "edit_ip", "ReturnUrl=" + GetReturnUrl()) %>' runat="server" ID="Hyperlink2">
<%# Eval("ExternalIP") %>
</asp:hyperlink>
</ItemTemplate>

View file

@ -45,6 +45,8 @@ namespace WebsitePanel.Portal
gvIPAddresses.PageSize = UsersHelper.GetDisplayItemsPerPage();
ddlItemsPerPage.SelectedValue = gvIPAddresses.PageSize.ToString();
gvIPAddresses.PageIndex = PageIndex;
// pool
if (!String.IsNullOrEmpty(PanelRequest.PoolId))
ddlPools.SelectedValue = PanelRequest.PoolId;
@ -69,6 +71,7 @@ namespace WebsitePanel.Portal
bool vps = ddlPools.SelectedIndex > 1;
gvIPAddresses.Columns[3].Visible = vps;
}
protected void odsIPAddresses_Selected(object sender, ObjectDataSourceStatusEventArgs e)
{
if (e.Exception != null)
@ -84,10 +87,23 @@ namespace WebsitePanel.Portal
return PortalUtils.GetSpaceHomePageUrl(spaceId);
}
public string GetReturnUrl()
{
var returnUrl = Request.Url.AddParameter("Page", gvIPAddresses.PageIndex.ToString());
return Uri.EscapeDataString("~" + returnUrl.PathAndQuery);
}
public int PageIndex
{
get
{
return PanelRequest.GetInt("Page", 0);
}
}
protected void btnAddItem_Click(object sender, EventArgs e)
{
Response.Redirect(EditUrl("PoolID", ddlPools.SelectedValue, "add_ip"), true);
Response.Redirect(EditUrl("PoolID", ddlPools.SelectedValue, "add_ip", "ReturnUrl=" + GetReturnUrl()), true);
}
protected void ddlItemsPerPage_SelectedIndexChanged(object sender, EventArgs e)

View file

@ -43,6 +43,18 @@ namespace WebsitePanel.Portal
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
gvIPAddresses.PageIndex = PageIndex;
}
}
public int PageIndex
{
get
{
return PanelRequest.GetInt("IpAddressesPage", 0);
}
}
public string EditModuleUrl(string key, string keyVal, string ctrlKey)
@ -57,7 +69,10 @@ namespace WebsitePanel.Portal
public string GetReturnUrl()
{
var returnUrl = Utils.AddParameterToUrl(Request.Url, "IpAddressesCollapsed", "False");
var returnUrl = Request.Url
.AddParameter("IpAddressesCollapsed", "False")
.AddParameter("IpAddressesPage", gvIPAddresses.PageIndex.ToString());
return Uri.EscapeDataString("~" + returnUrl.PathAndQuery);
}

View file

@ -58,10 +58,10 @@ namespace WebsitePanel.Portal
ShowErrorMessage("SERVER_GET_SERVER", ex);
return;
}
}
IPAddressesHeader.IsCollapsed = IsIpAddressesCollapsed;
}
}
private void BindTools()
{

View file

@ -48,6 +48,7 @@ namespace WebsitePanel.Portal
{
XmlNodeList xmlIcons = null;
DataSet myPackages;
int currentPackage;
protected void Page_Load(object sender, EventArgs e)
{
@ -68,6 +69,15 @@ namespace WebsitePanel.Portal
ddlPackageSelect.DataTextField = myPackages.Tables[0].Columns[2].ColumnName;
ddlPackageSelect.DataValueField = myPackages.Tables[0].Columns[0].ColumnName;
ddlPackageSelect.DataBind();
if(Session["currentPackage"] == null) {
if(ddlPackageSelect.Items.Count > 0) {
Session["currentPackage"] = ddlPackageSelect.Items[0].Value;
currentPackage = int.Parse(Session["currentPackage"].ToString());
}
} else {
currentPackage = int.Parse(Session["currentPackage"].ToString());
ddlPackageSelect.SelectedValue = currentPackage.ToString();
}
}
// USER
UserPackagesPanel.Visible = true;
@ -78,7 +88,7 @@ namespace WebsitePanel.Portal
EmptyPackagesList.Visible = true;
} else {
ddlPackageSelect.Visible = true;
myPackages = new PackagesHelper().GetMyPackage(int.Parse(ddlPackageSelect.SelectedValue));
myPackages = new PackagesHelper().GetMyPackage(currentPackage);
PackagesList.DataSource = myPackages;
PackagesList.DataBind();
}
@ -241,8 +251,8 @@ namespace WebsitePanel.Portal
}
public void openSelectedPackage(Object sender, EventArgs e) {
PackagesList.DataSource = new PackagesHelper().GetMyPackage(int.Parse(ddlPackageSelect.SelectedValue));
PackagesList.DataBind();
Session["currentPackage"] = int.Parse(ddlPackageSelect.SelectedValue);
Response.Redirect(Request.RawUrl);
}
}
}

View file

@ -546,7 +546,7 @@ namespace WebsitePanel.Portal
WDeployPublishingConfirmPasswordTextBox,
WDeployPublishingAccountRequiredFieldValidator);
WDeployPublishingAccountTextBox.Text = AutoSuggestWmSvcAccontName(item, "_dploy");
WDeployPublishingAccountTextBox.Text = AutoSuggestWmSvcAccontName(item, "_deploy");
//
WDeployPublishingAccountRequiredFieldValidator.Enabled = true;
//