diff --git a/src/Umbraco.Web/Editors/BackOfficeServerVariables.cs b/src/Umbraco.Web/Editors/BackOfficeServerVariables.cs index 870bb4f3f7..e550083f66 100644 --- a/src/Umbraco.Web/Editors/BackOfficeServerVariables.cs +++ b/src/Umbraco.Web/Editors/BackOfficeServerVariables.cs @@ -199,7 +199,7 @@ namespace Umbraco.Web.Editors }, { "logApiBaseUrl", _urlHelper.GetUmbracoApiServiceBaseUrl( - controller => controller.GetEntityLog(0)) + controller => controller.GetPagedEntityLog(0, 0, 0, Core.Persistence.DatabaseModelDefinitions.Direction.Ascending, null)) }, { "memberApiBaseUrl", _urlHelper.GetUmbracoApiServiceBaseUrl( diff --git a/src/Umbraco.Web/Editors/ContentController.cs b/src/Umbraco.Web/Editors/ContentController.cs index 2caa64fc98..2019a87f4d 100644 --- a/src/Umbraco.Web/Editors/ContentController.cs +++ b/src/Umbraco.Web/Editors/ContentController.cs @@ -974,7 +974,7 @@ namespace Umbraco.Web.Editors { var toMove = ValidateMoveOrCopy(move); - Services.ContentService.Move(toMove, move.ParentId); + Services.ContentService.Move(toMove, move.ParentId, Security.GetUserId().ResultOr(0)); var response = Request.CreateResponse(HttpStatusCode.OK); response.Content = new StringContent(toMove.Path, Encoding.UTF8, "application/json"); @@ -991,7 +991,7 @@ namespace Umbraco.Web.Editors { var toCopy = ValidateMoveOrCopy(copy); - var c = Services.ContentService.Copy(toCopy, copy.ParentId, copy.RelateToOriginal, copy.Recursive, Security.CurrentUser.Id); + var c = Services.ContentService.Copy(toCopy, copy.ParentId, copy.RelateToOriginal, copy.Recursive, Security.GetUserId().ResultOr(0)); var response = Request.CreateResponse(HttpStatusCode.OK); response.Content = new StringContent(c.Path, Encoding.UTF8, "application/json"); @@ -1013,7 +1013,7 @@ namespace Umbraco.Web.Editors if (foundContent == null) HandleContentNotFound(id); - var unpublishResult = Services.ContentService.Unpublish(foundContent, culture: culture, userId: Security.CurrentUser.Id); + var unpublishResult = Services.ContentService.Unpublish(foundContent, culture: culture, userId: Security.GetUserId().ResultOr(0)); var content = MapToDisplay(foundContent, culture); diff --git a/src/Umbraco.Web/Editors/LogController.cs b/src/Umbraco.Web/Editors/LogController.cs index 08a21a9364..fa532c5fce 100644 --- a/src/Umbraco.Web/Editors/LogController.cs +++ b/src/Umbraco.Web/Editors/LogController.cs @@ -50,36 +50,7 @@ namespace Umbraco.Web.Editors Items = MapAvatarsAndNames(mapped) }; } - - [Obsolete("Use GetPagedLog instead")] - public IEnumerable GetEntityLog(int id) - { - long totalRecords; - var result = Services.AuditService.GetPagedItemsByEntity(id, 1, int.MaxValue, out totalRecords); - return Mapper.Map>(result); - } - - //TODO: Move to CurrentUserController? - [Obsolete("Use GetPagedCurrentUserLog instead")] - public IEnumerable GetCurrentUserLog(AuditType logType, DateTime? sinceDate) - { - long totalRecords; - var dateQuery = sinceDate.HasValue ? SqlContext.Query().Where(x => x.CreateDate >= sinceDate) : null; - var userId = Security.GetUserId().ResultOr(0); - var result = Services.AuditService.GetPagedItemsByUser(userId, 1, int.MaxValue, out totalRecords, auditTypeFilter: new[] {logType},customFilter: dateQuery); - return Mapper.Map>(result); - } - - [Obsolete("Use GetPagedLog instead")] - public IEnumerable GetLog(AuditType logType, DateTime? sinceDate) - { - if (sinceDate == null) - sinceDate = DateTime.Now.Subtract(new TimeSpan(7, 0, 0, 0, 0)); - - return Mapper.Map>( - Services.AuditService.GetLogs(logType, sinceDate.Value)); - } - + private IEnumerable MapAvatarsAndNames(IEnumerable items) { var userIds = items.Select(x => x.UserId).ToArray(); diff --git a/src/Umbraco.Web/Routing/ContentFinderByUrlAndTemplate.cs b/src/Umbraco.Web/Routing/ContentFinderByUrlAndTemplate.cs index 8f507078b3..0b4c02aa8e 100644 --- a/src/Umbraco.Web/Routing/ContentFinderByUrlAndTemplate.cs +++ b/src/Umbraco.Web/Routing/ContentFinderByUrlAndTemplate.cs @@ -12,6 +12,7 @@ namespace Umbraco.Web.Routing /// Provides an implementation of that handles page nice urls and a template. /// /// + /// This finder allows for an odd routing pattern similar to altTemplate, probably only use case is if there is an alternative mime type template and it should be routable by something like "/hello/world/json" where the JSON template is to be used for the "world" page /// Handles /foo/bar/template where /foo/bar is the nice url of a document, and template a template alias. /// If successful, then the template of the document request is also assigned. /// diff --git a/src/Umbraco.Web/Runtime/WebRuntimeComponent.cs b/src/Umbraco.Web/Runtime/WebRuntimeComponent.cs index 460f881dae..6b9109b7df 100644 --- a/src/Umbraco.Web/Runtime/WebRuntimeComponent.cs +++ b/src/Umbraco.Web/Runtime/WebRuntimeComponent.cs @@ -173,7 +173,7 @@ namespace Umbraco.Web.Runtime .Append() .Append() .Append() - .Append() + //.Append() // disabled, this is an odd finder .Append() .Append(); diff --git a/src/Umbraco.Web/Security/WebSecurity.cs b/src/Umbraco.Web/Security/WebSecurity.cs index ad0c5781a3..5de163b638 100644 --- a/src/Umbraco.Web/Security/WebSecurity.cs +++ b/src/Umbraco.Web/Security/WebSecurity.cs @@ -175,7 +175,7 @@ namespace Umbraco.Web.Security } /// - /// Gets the currnet user's id. + /// Gets the current user's id. /// /// public virtual Attempt GetUserId()