diff --git a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Managers/WebDavManager.cs b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Managers/WebDavManager.cs index 0f76a99e..34145c07 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Managers/WebDavManager.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDav.Core/Managers/WebDavManager.cs @@ -51,7 +51,7 @@ namespace WebsitePanel.WebDav.Core.Managers _currentFolder = _webDavSession.OpenFolder(string.Format("{0}{1}/{2}", WebDavAppConfigManager.Instance.WebdavRoot, WspContext.User.OrganizationId, pathPart)); } - children = _currentFolder.GetChildren(); + children = _currentFolder.GetChildren().Where(x => !WebDavAppConfigManager.Instance.ElementsRendering.ElementsToIgnore.Contains(x.DisplayName.Trim('/'))).ToArray(); } List sortedChildren = children.Where(x => x.ItemType == ItemType.Folder).OrderBy(x => x.DisplayName).ToList(); diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/App_Start/RouteConfig.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/App_Start/RouteConfig.cs index 8a6a2d90..ef79cf39 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/App_Start/RouteConfig.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/App_Start/RouteConfig.cs @@ -43,7 +43,7 @@ namespace WebsitePanel.WebDavPortal #endregion routes.MapRoute( - name: "Office365DocumentRoute", + name: FileSystemRouteNames.OfficeOnlinePath, url: "office365/{org}/{*pathPart}", defaults: new { controller = "FileSystem", action = "ShowOfficeDocument", pathPart = UrlParameter.Optional } ); diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Controllers/AccountController.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Controllers/AccountController.cs index d26d43ee..d3d7608d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Controllers/AccountController.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Controllers/AccountController.cs @@ -46,8 +46,6 @@ namespace WebsitePanel.WebDavPortal.Controllers { _authenticationService.CreateAuthenticationTicket(user); - Session[WebDavAppConfigManager.Instance.SessionKeys.WebDavManager] = null; - return RedirectToRoute(FileSystemRouteNames.FilePath, new { org = WspContext.User.OrganizationId }); } @@ -59,8 +57,6 @@ namespace WebsitePanel.WebDavPortal.Controllers { _authenticationService.LogOut(); - Session[WebDavAppConfigManager.Instance.SessionKeys.WebDavManager] = null; - return RedirectToRoute(AccountRouteNames.Login); } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Controllers/FileSystemController.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Controllers/FileSystemController.cs index 70bdfe36..64f9e7e4 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Controllers/FileSystemController.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Controllers/FileSystemController.cs @@ -57,10 +57,9 @@ namespace WebsitePanel.WebDavPortal.Controllers try { - IEnumerable children = _webdavManager.OpenFolder(pathPart).Where(x => !WebDavAppConfigManager.Instance.ElementsRendering.ElementsToIgnore.Contains(x.DisplayName.Trim('/'))); + IEnumerable children = _webdavManager.OpenFolder(pathPart); var model = new ModelForWebDav { Items = children.Take(WebDavAppConfigManager.Instance.ElementsRendering.DefaultCount), UrlSuffix = pathPart }; - Session[WebDavAppConfigManager.Instance.SessionKeys.ResourseRenderCount] = WebDavAppConfigManager.Instance.ElementsRendering.DefaultCount; return View(model); } diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/UI/Routes/FileSystemRouteNames.cs b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/UI/Routes/FileSystemRouteNames.cs index f011561a..3f474fcc 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/UI/Routes/FileSystemRouteNames.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/UI/Routes/FileSystemRouteNames.cs @@ -8,6 +8,7 @@ namespace WebsitePanel.WebDavPortal.UI.Routes public class FileSystemRouteNames { public const string FilePath = "FilePathRoute"; + public const string OfficeOnlinePath = "OfficeOnline"; public const string ShowAdditionalContent = "ShowAdditionalContentRoute"; } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/FileSystem/_ResoursePartial.cshtml b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/FileSystem/_ResoursePartial.cshtml index 2565898b..007ec5f8 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/FileSystem/_ResoursePartial.cshtml +++ b/WebsitePanel/Sources/WebsitePanel.WebDavPortal/Views/FileSystem/_ResoursePartial.cshtml @@ -1,7 +1,9 @@ -@using WebsitePanel.WebDav.Core.Client +@using WebsitePanel.WebDav.Core +@using WebsitePanel.WebDav.Core.Client @using WebsitePanel.WebDav.Core.Config @using WebsitePanel.WebDavPortal.FileOperations @using Ninject; +@using WebsitePanel.WebDavPortal.UI.Routes @model IHierarchyItem @{ @@ -14,7 +16,8 @@ { case FileOpenerType.OfficeOnline: isTargetBlank = true; - href = string.Concat(Url.Action("ShowOfficeDocument", "FileSystem"), Model.DisplayName); + var pathPart = Model.Href.AbsolutePath.Replace("/" + WspContext.User.OrganizationId, ""); + href = string.Concat(Url.RouteUrl(FileSystemRouteNames.OfficeOnlinePath, new { org = WspContext.User.OrganizationId, pathPart = "" }), pathPart); break; default: isTargetBlank = false;