diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/ILink.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/ILink.cs deleted file mode 100644 index c4b5781ca3..0000000000 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/ILink.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.ComponentModel; - -namespace Umbraco.Core.Configuration.UmbracoSettings -{ - [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("This is no longer used and will be removed in future versions")] - public interface ILink - { - string Application { get; } - - string ApplicationUrl { get; } - - string Language { get; } - - string UserType { get; } - - string HelpUrl { get; } - } -} diff --git a/src/Umbraco.Core/Configuration/UmbracoSettings/SecurityElement.cs b/src/Umbraco.Core/Configuration/UmbracoSettings/SecurityElement.cs index 8ae5816569..9ce88a8f75 100644 --- a/src/Umbraco.Core/Configuration/UmbracoSettings/SecurityElement.cs +++ b/src/Umbraco.Core/Configuration/UmbracoSettings/SecurityElement.cs @@ -41,7 +41,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings [ConfigurationProperty("authCookieName")] internal InnerTextConfigurationElement AuthCookieName { - get { return GetOptionalTextElement("authCookieName", Constants.Web.AuthCookieName); } + get { return GetOptionalTextElement("authCookieName", "UMB_UCONTEXT"); } } [ConfigurationProperty("authCookieDomain")] diff --git a/src/Umbraco.Core/Constants-Web.cs b/src/Umbraco.Core/Constants-Web.cs index a5f140ddba..0da5431e91 100644 --- a/src/Umbraco.Core/Constants-Web.cs +++ b/src/Umbraco.Core/Constants-Web.cs @@ -23,13 +23,6 @@ namespace Umbraco.Core public const string InstallerCookieName = "umb_installId"; - /// - /// The auth cookie name - /// - [Obsolete("DO NOT USE THIS, USE ISecuritySection.AuthCookieName, this will be removed in future versions")] - [EditorBrowsable(EditorBrowsableState.Never)] - public const string AuthCookieName = "UMB_UCONTEXT"; - } } } diff --git a/src/Umbraco.Core/IO/MasterPageHelper.cs b/src/Umbraco.Core/IO/MasterPageHelper.cs index e619ec98d8..049db04b9a 100644 --- a/src/Umbraco.Core/IO/MasterPageHelper.cs +++ b/src/Umbraco.Core/IO/MasterPageHelper.cs @@ -27,13 +27,7 @@ namespace Umbraco.Core.IO { return _masterPageFileSystem.FileExists(GetFilePath(t)); } - - [Obsolete("This is only used for legacy purposes and will be removed in future versions")] - internal string GetPhysicalFilePath(ITemplate t) - { - return _masterPageFileSystem.GetFullPath(GetFilePath(t.Alias)); - } - + private string GetFilePath(ITemplate t) { return GetFilePath(t.Alias); diff --git a/src/Umbraco.Core/Logging/ParallelForwardingAppender.cs b/src/Umbraco.Core/Logging/ParallelForwardingAppender.cs deleted file mode 100644 index e8dad743e1..0000000000 --- a/src/Umbraco.Core/Logging/ParallelForwardingAppender.cs +++ /dev/null @@ -1,21 +0,0 @@ -// fixme - remove this file -//using log4net.Core; -//using log4net.Util; -//using System; -//using System.Collections.Concurrent; -//using System.Threading; -//using System.Threading.Tasks; - -//namespace Umbraco.Core.Logging -//{ -// /// -// /// An asynchronous appender based on -// /// -// /// -// /// Borrowed from https://github.com/cjbhaines/Log4Net.Async - will reference Nuget packages directly in v8 -// /// -// [Obsolete("Use the Log4Net.Async.ParallelForwardingAppender instead this will be removed in future versions")] -// public class ParallelForwardingAppender : Log4Net.Async.ParallelForwardingAppender -// { -// } -//} diff --git a/src/Umbraco.Core/Media/IImageUrlProvider.cs b/src/Umbraco.Core/Media/IImageUrlProvider.cs deleted file mode 100644 index 4a51edd412..0000000000 --- a/src/Umbraco.Core/Media/IImageUrlProvider.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Umbraco.Core.Media -{ - // note: because this interface is obsolete is is *not* IDiscoverable, and in case the - // TypeLoader is asked to find types implementing this interface it will fall back - // to a complete scan. - - [Obsolete("IImageUrlProvider is no longer used and will be removed in future versions")] - public interface IImageUrlProvider // IDiscoverable - { - string Name { get; } - string GetImageUrlFromMedia(int mediaId, IDictionary parameters); - string GetImageUrlFromFileName(string specifiedSrc, IDictionary parameters); - } -} diff --git a/src/Umbraco.Core/Media/IThumbnailProvider.cs b/src/Umbraco.Core/Media/IThumbnailProvider.cs deleted file mode 100644 index 1e5a59bb39..0000000000 --- a/src/Umbraco.Core/Media/IThumbnailProvider.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; - -namespace Umbraco.Core.Media -{ - // note: because this interface is obsolete is is *not* IDiscoverable, and in case the - // TypeLoader is asked to find types implementing this interface it will fall back - // to a complete scan. - - [Obsolete("Thumbnails are generated by ImageProcessor, use that instead")] - public interface IThumbnailProvider // : IDiscoverable - { - bool CanProvideThumbnail(string fileUrl); - string GetThumbnailUrl(string fileUrl); - } - -} diff --git a/src/Umbraco.Core/Models/Membership/IUser.cs b/src/Umbraco.Core/Models/Membership/IUser.cs index 8219af17b9..f3092a0106 100644 --- a/src/Umbraco.Core/Models/Membership/IUser.cs +++ b/src/Umbraco.Core/Models/Membership/IUser.cs @@ -18,11 +18,7 @@ namespace Umbraco.Core.Models.Membership int[] StartContentIds { get; set; } int[] StartMediaIds { get; set; } string Language { get; set; } - - [Obsolete("This should not be used it exists for legacy reasons only, use user groups instead, it will be removed in future versions")] - [EditorBrowsable(EditorBrowsableState.Never)] - IUserType UserType { get; set; } - + DateTime? EmailConfirmedDate { get; set; } DateTime? InvitedDate { get; set; } @@ -37,14 +33,6 @@ namespace Umbraco.Core.Models.Membership IEnumerable AllowedSections { get; } - [Obsolete("This should not be used it exists for legacy reasons only, use user groups instead, it will be removed in future versions")] - [EditorBrowsable(EditorBrowsableState.Never)] - void RemoveAllowedSection(string sectionAlias); - - [Obsolete("This should not be used it exists for legacy reasons only, use user groups instead, it will be removed in future versions")] - [EditorBrowsable(EditorBrowsableState.Never)] - void AddAllowedSection(string sectionAlias); - /// /// Exposes the basic profile data /// @@ -65,4 +53,4 @@ namespace Umbraco.Core.Models.Membership /// string TourData { get; set; } } -} \ No newline at end of file +} diff --git a/src/Umbraco.Core/Models/Membership/IUserType.cs b/src/Umbraco.Core/Models/Membership/IUserType.cs deleted file mode 100644 index 118d66074f..0000000000 --- a/src/Umbraco.Core/Models/Membership/IUserType.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using Umbraco.Core.Models.Entities; - -namespace Umbraco.Core.Models.Membership -{ - [Obsolete("This should not be used it exists for legacy reasons only, use user groups instead, it will be removed in future versions")] - [EditorBrowsable(EditorBrowsableState.Never)] - public interface IUserType : IEntity - { - string Alias { get; set; } - string Name { get; set; } - IEnumerable Permissions { get; set; } - - } -} diff --git a/src/Umbraco.Core/Models/Membership/User.cs b/src/Umbraco.Core/Models/Membership/User.cs index 0e3ab70e0a..cc91f5ed47 100644 --- a/src/Umbraco.Core/Models/Membership/User.cs +++ b/src/Umbraco.Core/Models/Membership/User.cs @@ -284,162 +284,6 @@ namespace Umbraco.Core.Models.Membership get { return _allowedSections ?? (_allowedSections = new List(_userGroups.SelectMany(x => x.AllowedSections).Distinct())); } } - [Obsolete("This should not be used it exists for legacy reasons only, use user groups instead, it will be removed in future versions")] - [EditorBrowsable(EditorBrowsableState.Never)] - IUserType IUser.UserType - { - get - { - //the best we can do here is to return the user's first user group as a IUserType object - //but we should attempt to return any group that is the built in ones first - var groups = Groups.ToArray(); - if (groups.Length == 0) - { - //In backwards compatibility land, a user type cannot be null! so we need to return a fake one. - return new UserType - { - Alias = "temp", - Id = int.MinValue, - Key = Guid.Empty, - CreateDate = default(DateTime), - DeleteDate = null, - Name = "Temp", - Permissions = new List(), - UpdateDate = default(DateTime) - }; - } - var builtIns = new[] { Constants.Security.AdminGroupAlias, "writer", "editor", "translator" }; - var foundBuiltIn = groups.FirstOrDefault(x => builtIns.Contains(x.Alias)); - IUserGroup realGroup; - if (foundBuiltIn != null) - { - //if the group isn't IUserGroup we'll need to look it up - realGroup = foundBuiltIn as IUserGroup ?? Current.Services.UserService.GetUserGroupById(foundBuiltIn.Id); - - //return a mapped version of the group - return new UserType - { - Alias = realGroup.Alias, - Id = realGroup.Id, - Key = realGroup.Key, - CreateDate = realGroup.CreateDate, - DeleteDate = realGroup.DeleteDate, - Name = realGroup.Name, - Permissions = realGroup.Permissions, - UpdateDate = realGroup.UpdateDate - }; - } - - //otherwise return the first - //if the group isn't IUserGroup we'll need to look it up - realGroup = groups[0] as IUserGroup ?? Current.Services.UserService.GetUserGroupById(groups[0].Id); - //return a mapped version of the group - return new UserType - { - Alias = realGroup.Alias, - Id = realGroup.Id, - Key = realGroup.Key, - CreateDate = realGroup.CreateDate, - DeleteDate = realGroup.DeleteDate, - Name = realGroup.Name, - Permissions = realGroup.Permissions, - UpdateDate = realGroup.UpdateDate - }; - } - set - { - //if old APIs are still using this lets first check if the user is part of the user group with the alias specified - if (Groups.Any(x => x.Alias == value.Alias)) - return; - - //the only other option we have here is to lookup the group (and we'll need to use singletons here :( ) - var found = Current.Services.UserService.GetUserGroupByAlias(value.Alias); - if (found == null) - throw new InvalidOperationException("No user group was found with the alias " + value.Alias + ", this API (IUser.UserType) is obsolete, use user groups instead"); - - //if it's found, all we can do is add it, we can't really replace them - AddGroup(found.ToReadOnlyGroup()); - } - } - - [Obsolete("This should not be used it exists for legacy reasons only, use user groups instead, it will be removed in future versions")] - [EditorBrowsable(EditorBrowsableState.Never)] - void IUser.RemoveAllowedSection(string sectionAlias) - { - //don't do anything if they aren't allowed it already - if (AllowedSections.Contains(sectionAlias) == false) - return; - - var groups = Groups.ToArray(); - //our only option here is to check if a custom group is created for this user, if so we can remove it from that group, otherwise we'll throw - //now we'll check if the user has a special 1:1 user group created for itself. This will occur if this method is used and also during an upgrade. - //this comes in the alias form of userName + 'Group' - var customUserGroup = groups.FirstOrDefault(x => x.Alias == (Username + "Group")); - if (customUserGroup != null) - { - //if the group isn't IUserGroup we'll need to look it up - var realGroup = customUserGroup as IUserGroup ?? Current.Services.UserService.GetUserGroupById(customUserGroup.Id); - realGroup.RemoveAllowedSection(sectionAlias); - //now we need to flag this for saving (hack!) - GroupsToSave.Add(realGroup); - } - else - { - throw new InvalidOperationException("Cannot remove the allowed section using this obsolete API. Modify the user's groups instead"); - } - - } - - [Obsolete("This should not be used it exists for legacy reasons only, use user groups instead, it will be removed in future versions")] - [EditorBrowsable(EditorBrowsableState.Never)] - void IUser.AddAllowedSection(string sectionAlias) - { - //don't do anything if they are allowed it already - if (AllowedSections.Contains(sectionAlias)) - return; - - //This is here for backwards compat only. - //First we'll check if the user is part of the 'admin' group. If so then we can ensure that the admin group has this section available to it. - //otherwise, the only thing we can do is create a custom user group for this user and add this section. - //We are checking for admin here because if the user is an admin and an allowed section is being added, then it's assumed it's to be added - //for the whole admin group (i.e. Forms installer does this for admins) - var groups = Groups.ToArray(); - var admin = groups.FirstOrDefault(x => x.Alias == Constants.Security.AdminGroupAlias); - if (admin != null) - { - //if the group isn't IUserGroup we'll need to look it up - var realGroup = admin as IUserGroup ?? Current.Services.UserService.GetUserGroupById(admin.Id); - realGroup.AddAllowedSection(sectionAlias); - //now we need to flag this for saving (hack!) - GroupsToSave.Add(realGroup); - } - else - { - //now we'll check if the user has a special 1:1 user group created for itself. This will occur if this method is used and also during an upgrade. - //this comes in the alias form of userName + 'Group' - var customUserGroup = groups.FirstOrDefault(x => x.Alias == (Username + "Group")); - if (customUserGroup != null) - { - //if the group isn't IUserGroup we'll need to look it up - var realGroup = customUserGroup as IUserGroup ?? Current.Services.UserService.GetUserGroupById(customUserGroup.Id); - realGroup.AddAllowedSection(sectionAlias); - //now we need to flag this for saving (hack!) - GroupsToSave.Add(realGroup); - } - - //ok, so the user doesn't have a 1:1 group, we'll need to flag it for creation - var newUserGroup = new UserGroup - { - Alias = Username + "Group", - Name = "Group for " + Username - }; - newUserGroup.AddAllowedSection(sectionAlias); - //add this user to this new group - AddGroup(newUserGroup); - GroupsToSave.Add(newUserGroup); - } - } - /// /// This used purely for hacking backwards compatibility into this class for < 7.7 compat /// diff --git a/src/Umbraco.Core/Models/Membership/UserType.cs b/src/Umbraco.Core/Models/Membership/UserType.cs deleted file mode 100644 index d2e4a8f6cb..0000000000 --- a/src/Umbraco.Core/Models/Membership/UserType.cs +++ /dev/null @@ -1,78 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Reflection; -using System.Runtime.Serialization; -using Umbraco.Core.Models.Entities; -using Umbraco.Core.Strings; - -namespace Umbraco.Core.Models.Membership -{ - [Obsolete("This should not be used it exists for legacy reasons only, use user groups instead, it will be removed in future versions")] - [EditorBrowsable(EditorBrowsableState.Never)] - [Serializable] - [DataContract(IsReference = true)] - internal class UserType : EntityBase, IUserType - { - private string _alias; - private string _name; - private IEnumerable _permissions; - private static readonly Lazy Ps = new Lazy(); - private class PropertySelectors - { - public readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo(x => x.Name); - public readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo(x => x.Alias); - public readonly PropertyInfo PermissionsSelector = ExpressionHelper.GetPropertyInfo>(x => x.Permissions); - } - - public UserType(string name, string alias) - { - Name = name; - Alias = alias; - } - - public UserType() - { - } - - [DataMember] - public string Alias - { - get { return _alias; } - set - { - SetPropertyValueAndDetectChanges( - value.ToCleanString(CleanStringType.Alias | CleanStringType.UmbracoCase), - ref _alias, - Ps.Value.AliasSelector); - } - } - - [DataMember] - public string Name - { - get { return _name; } - set { SetPropertyValueAndDetectChanges(value, ref _name, Ps.Value.NameSelector); } - } - - /// - /// The set of default permissions for the user type - /// - /// - /// By default each permission is simply a single char but we've made this an enumerable{string} to support a more flexible permissions structure in the future. - /// - [DataMember] - public IEnumerable Permissions - { - get { return _permissions; } - set - { - SetPropertyValueAndDetectChanges(value, ref _permissions, Ps.Value.PermissionsSelector, - //Custom comparer for enumerable - new DelegateEqualityComparer>( - (enum1, enum2) => enum1.UnsortedSequenceEqual(enum2), - enum1 => enum1.GetHashCode())); - } - } - } -} diff --git a/src/Umbraco.Core/Models/UmbracoObjectTypes.cs b/src/Umbraco.Core/Models/UmbracoObjectTypes.cs index 31b5f2e513..817ef3ace8 100644 --- a/src/Umbraco.Core/Models/UmbracoObjectTypes.cs +++ b/src/Umbraco.Core/Models/UmbracoObjectTypes.cs @@ -14,14 +14,6 @@ namespace Umbraco.Core.Models /// Unknown, - /// - /// Content Item Type - /// - [UmbracoObjectType(Constants.ObjectTypes.Strings.ContentItemType)] - [FriendlyName("Content Item Type")] - [Obsolete("This is not used and will be removed in future versions")] - [EditorBrowsable(EditorBrowsableState.Never)] - ContentItemType, /// /// Root @@ -69,17 +61,7 @@ namespace Umbraco.Core.Models [FriendlyName("Member Group")] [UmbracoUdiType(Constants.UdiEntityType.MemberGroup)] MemberGroup, - - //TODO: What is a 'Content Item' supposed to be??? - /// - /// Content Item - /// - [UmbracoObjectType(Constants.ObjectTypes.Strings.ContentItem)] - [FriendlyName("Content Item")] - [Obsolete("This is not used and will be removed in future versions")] - [EditorBrowsable(EditorBrowsableState.Never)] - ContentItem, - + /// /// "Media Type /// diff --git a/src/Umbraco.Core/Models/UserExtensions.cs b/src/Umbraco.Core/Models/UserExtensions.cs index f78de43f01..00dd3273bf 100644 --- a/src/Umbraco.Core/Models/UserExtensions.cs +++ b/src/Umbraco.Core/Models/UserExtensions.cs @@ -112,15 +112,6 @@ namespace Umbraco.Core.Models } - public static void ClearAllowedSections(this IUser user) - { - var allowed = user.AllowedSections.ToArray(); - foreach (var s in allowed) - { - user.RemoveAllowedSection(s); - } - } - /// /// Returns the culture info associated with this user, based on the language they're assigned to in the back office /// diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index 448acce472..411e4db1bf 100644 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -261,7 +261,6 @@ - @@ -550,7 +549,6 @@ - @@ -597,9 +595,7 @@ - - @@ -703,7 +699,6 @@ - @@ -715,7 +710,6 @@ - diff --git a/src/Umbraco.Tests/Configurations/UmbracoSettings/SecurityElementTests.cs b/src/Umbraco.Tests/Configurations/UmbracoSettings/SecurityElementTests.cs index d419d9d320..429aa28bb7 100644 --- a/src/Umbraco.Tests/Configurations/UmbracoSettings/SecurityElementTests.cs +++ b/src/Umbraco.Tests/Configurations/UmbracoSettings/SecurityElementTests.cs @@ -33,7 +33,7 @@ namespace Umbraco.Tests.Configurations.UmbracoSettings [Test] public void AuthCookieName() { - Assert.IsTrue(SettingsSection.Security.AuthCookieName == Constants.Web.AuthCookieName); + Assert.IsTrue(SettingsSection.Security.AuthCookieName == "UMB_UCONTEXT"); } } } diff --git a/src/Umbraco.Tests/Services/EntityServiceTests.cs b/src/Umbraco.Tests/Services/EntityServiceTests.cs index 8d8e127131..0546eb3c7b 100644 --- a/src/Umbraco.Tests/Services/EntityServiceTests.cs +++ b/src/Umbraco.Tests/Services/EntityServiceTests.cs @@ -549,7 +549,6 @@ namespace Umbraco.Tests.Services var objectTypeId = Constants.ObjectTypes.ContentItem; Assert.Throws(() => service.GetAll()); - Assert.Throws(() => service.GetAll(UmbracoObjectTypes.ContentItem)); Assert.Throws(() => service.GetAll(objectTypeId)); } diff --git a/src/Umbraco.Web/Composing/Current.cs b/src/Umbraco.Web/Composing/Current.cs index e1317a902b..d327d1f70c 100644 --- a/src/Umbraco.Web/Composing/Current.cs +++ b/src/Umbraco.Web/Composing/Current.cs @@ -23,7 +23,6 @@ using Umbraco.Web.Cache; using Umbraco.Web.Editors; using Umbraco.Web.HealthCheck; using Umbraco.Web.Media; -using Umbraco.Web.Media.ThumbnailProviders; using Umbraco.Web.Mvc; using Umbraco.Web.PublishedCache; using Umbraco.Web.Routing; @@ -134,9 +133,6 @@ namespace Umbraco.Web.Composing public static FilteredControllerFactoryCollection FilteredControllerFactories => Container.GetInstance(); - internal static ImageUrlProviderCollection ImageUrlProviders - => Container.GetInstance(); - internal static IPublishedSnapshotService PublishedSnapshotService => Container.GetInstance(); diff --git a/src/Umbraco.Web/CompositionExtensions.cs b/src/Umbraco.Web/CompositionExtensions.cs index e172af7b8a..332380009d 100644 --- a/src/Umbraco.Web/CompositionExtensions.cs +++ b/src/Umbraco.Web/CompositionExtensions.cs @@ -6,7 +6,6 @@ using Umbraco.Core.Macros; using Umbraco.Web.Editors; using Umbraco.Web.HealthCheck; using Umbraco.Web.Media; -using Umbraco.Web.Media.ThumbnailProviders; using Umbraco.Web.Mvc; using Umbraco.Web.PublishedCache; using Umbraco.Web.Routing; @@ -65,13 +64,6 @@ namespace Umbraco.Core.Components public static HealthCheckCollectionBuilder HealthChecks(this Composition composition) => composition.Container.GetInstance(); - /// - /// Gets the image url providers collection builder. - /// - /// The composition. - internal static ImageUrlProviderCollectionBuilder ImageUrlProviders(this Composition composition) - => composition.Container.GetInstance(); - /// /// Gets the url providers collection builder. /// diff --git a/src/Umbraco.Web/Editors/EntityController.cs b/src/Umbraco.Web/Editors/EntityController.cs index a558648ffc..53689c9052 100644 --- a/src/Umbraco.Web/Editors/EntityController.cs +++ b/src/Umbraco.Web/Editors/EntityController.cs @@ -843,8 +843,6 @@ namespace Umbraco.Web.Editors return UmbracoObjectTypes.MediaType; case UmbracoEntityTypes.MemberGroup: return UmbracoObjectTypes.MemberGroup; - case UmbracoEntityTypes.ContentItem: - return UmbracoObjectTypes.ContentItem; case UmbracoEntityTypes.MediaType: return UmbracoObjectTypes.MediaType; case UmbracoEntityTypes.DocumentType: diff --git a/src/Umbraco.Web/Editors/MediaController.cs b/src/Umbraco.Web/Editors/MediaController.cs index fb09cefd03..5458070260 100644 --- a/src/Umbraco.Web/Editors/MediaController.cs +++ b/src/Umbraco.Web/Editors/MediaController.cs @@ -55,7 +55,7 @@ namespace Umbraco.Web.Editors { controllerSettings.Services.Replace(typeof(IHttpActionSelector), new ParameterSwapControllerActionSelector( new ParameterSwapControllerActionSelector.ParameterSwapInfo("GetById", "id", typeof(int), typeof(Guid), typeof(Udi)), - new ParameterSwapControllerActionSelector.ParameterSwapInfo("GetChildren", "id", typeof(int), typeof(Guid), typeof(Udi), typeof(string)))); + new ParameterSwapControllerActionSelector.ParameterSwapInfo("GetChildren", "id", typeof(int), typeof(Guid), typeof(Udi)))); } } @@ -369,29 +369,6 @@ namespace Umbraco.Web.Editors throw new HttpResponseException(HttpStatusCode.NotFound); } - [Obsolete("Do not use this method, use either the overload with INT or GUID instead, this will be removed in future versions")] - [EditorBrowsable(EditorBrowsableState.Never)] - [UmbracoTreeAuthorize(Constants.Trees.MediaTypes, Constants.Trees.Media)] - public PagedResult> GetChildren(string id, - int pageNumber = 0, - int pageSize = 0, - string orderBy = "SortOrder", - Direction orderDirection = Direction.Ascending, - bool orderBySystemField = true, - string filter = "") - { - foreach (var type in new[] { typeof(int), typeof(Guid) }) - { - var parsed = id.TryConvertTo(type); - if (parsed) - { - //oooh magic! will auto select the right overload - return GetChildren((dynamic)parsed.Result); - } - } - - throw new HttpResponseException(HttpStatusCode.NotFound); - } #endregion /// diff --git a/src/Umbraco.Web/Editors/MediaTypeController.cs b/src/Umbraco.Web/Editors/MediaTypeController.cs index 0751faa217..a98a2183b2 100644 --- a/src/Umbraco.Web/Editors/MediaTypeController.cs +++ b/src/Umbraco.Web/Editors/MediaTypeController.cs @@ -40,7 +40,7 @@ namespace Umbraco.Web.Editors public void Initialize(HttpControllerSettings controllerSettings, HttpControllerDescriptor controllerDescriptor) { controllerSettings.Services.Replace(typeof(IHttpActionSelector), new ParameterSwapControllerActionSelector( - new ParameterSwapControllerActionSelector.ParameterSwapInfo("GetAllowedChildren", "contentId", typeof(int), typeof(Guid), typeof(Udi), typeof(string)))); + new ParameterSwapControllerActionSelector.ParameterSwapInfo("GetAllowedChildren", "contentId", typeof(int), typeof(Guid), typeof(Udi)))); } } @@ -260,23 +260,6 @@ namespace Umbraco.Web.Editors throw new HttpResponseException(HttpStatusCode.NotFound); } - [Obsolete("Do not use this method, use either the overload with INT, GUID or UDI instead, this will be removed in future versions")] - [EditorBrowsable(EditorBrowsableState.Never)] - [UmbracoTreeAuthorize(Constants.Trees.MediaTypes, Constants.Trees.Media)] - public IEnumerable GetAllowedChildren(string contentId) - { - foreach (var type in new[] { typeof(int), typeof(Guid) }) - { - var parsed = contentId.TryConvertTo(type); - if (parsed) - { - //oooh magic! will auto select the right overload - return GetAllowedChildren((dynamic)parsed.Result); - } - } - - throw new HttpResponseException(HttpStatusCode.NotFound); - } #endregion /// diff --git a/src/Umbraco.Web/Media/ImageUrl.cs b/src/Umbraco.Web/Media/ImageUrl.cs deleted file mode 100644 index 3606af5eda..0000000000 --- a/src/Umbraco.Web/Media/ImageUrl.cs +++ /dev/null @@ -1,97 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Specialized; -using System.Globalization; -using System.Linq; -using System.Web; -using Umbraco.Core; -using Umbraco.Core.Cache; -using Umbraco.Core.Media; -using umbraco; -using Umbraco.Web.Composing; - -namespace Umbraco.Web.Media -{ - [Obsolete("This is no longer used and will be removed in future versions")] - public class ImageUrl - { - [Obsolete("Use TryGetImageUrl() instead")] - public static string GetImageUrl(string specifiedSrc, string field, string provider, string parameters, int? nodeId = null) - { - string url; - var found = TryGetImageUrl(specifiedSrc, field, provider, parameters, nodeId, out url); - - return found ? url : string.Empty; - } - - public static bool TryGetImageUrl(string specifiedSrc, string field, string provider, string parameters, int? nodeId, out string url) - { - var imageUrlProvider = GetProvider(provider); - - var parsedParameters = string.IsNullOrEmpty(parameters) ? new NameValueCollection() : HttpUtility.ParseQueryString(parameters); - - var queryValues = parsedParameters.Keys.Cast().ToDictionary(key => key, key => parsedParameters[key]); - - if (string.IsNullOrEmpty(field)) - { - url = imageUrlProvider.GetImageUrlFromFileName(specifiedSrc, queryValues); - return true; - } - else - { - var fieldValue = string.Empty; - if (nodeId.HasValue) - { - var contentFromCache = GetContentFromCache(nodeId.GetValueOrDefault(), field); - if (contentFromCache != null) - { - fieldValue = contentFromCache.ToString(); - } - else - { - var p = UmbracoContext.Current.ContentCache.GetById(nodeId.GetValueOrDefault()); - var v = p.Value(field); - fieldValue = v == null ? string.Empty : v.ToString(); - } - } - else - { - var context = HttpContext.Current; - if (context != null) - { - var elements = context.Items["pageElements"] as Hashtable; - if (elements != null) - { - var value = elements[field]; - fieldValue = value != null ? value.ToString() : string.Empty; - } - } - } - - if (!string.IsNullOrWhiteSpace(fieldValue)) - { - int mediaId; - url = int.TryParse(fieldValue, out mediaId) - ? imageUrlProvider.GetImageUrlFromMedia(mediaId, queryValues) - : imageUrlProvider.GetImageUrlFromFileName(fieldValue, queryValues); - return true; - } - } - - url = string.Empty; - return false; - } - - private static IImageUrlProvider GetProvider(string provider) - { - return Current.ImageUrlProviders[provider]; - } - - private static object GetContentFromCache(int nodeIdInt, string field) - { - var content = Current.ApplicationCache.RuntimeCache.GetCacheItem( - string.Format("{0}{1}_{2}", CacheKeys.ContentItemCacheKey, nodeIdInt.ToString(CultureInfo.InvariantCulture), field)); - return content; - } - } -} diff --git a/src/Umbraco.Web/Media/ImageUrlProviderCollection.cs b/src/Umbraco.Web/Media/ImageUrlProviderCollection.cs deleted file mode 100644 index 5d20fbda4f..0000000000 --- a/src/Umbraco.Web/Media/ImageUrlProviderCollection.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Umbraco.Core; -using Umbraco.Core.Composing; -using Umbraco.Core.Media; -using Umbraco.Web.Media.ImageUrlProviders; - -namespace Umbraco.Web.Media -{ - // fixme - kill entirely we should not use this anymore - internal class ImageUrlProviderCollection : BuilderCollectionBase - { - public ImageUrlProviderCollection(IEnumerable items) - : base(items) - { } - - public IImageUrlProvider this[string name] - { - get - { - if (string.IsNullOrWhiteSpace(name)) name = ImageUrlProvider.DefaultName; - var provider = this.FirstOrDefault(x => x.Name.InvariantEquals(name)); - if (provider == null) throw new InvalidOperationException($"No provider exists with name \"{name}\"."); - return provider; - } - } - } -} diff --git a/src/Umbraco.Web/Media/ImageUrlProviderCollectionBuilder.cs b/src/Umbraco.Web/Media/ImageUrlProviderCollectionBuilder.cs deleted file mode 100644 index 79fb489e40..0000000000 --- a/src/Umbraco.Web/Media/ImageUrlProviderCollectionBuilder.cs +++ /dev/null @@ -1,14 +0,0 @@ -using LightInject; -using Umbraco.Core.Composing; -using Umbraco.Core.Media; - -namespace Umbraco.Web.Media -{ - internal class ImageUrlProviderCollectionBuilder : OrderedCollectionBuilderBase - { - public ImageUrlProviderCollectionBuilder(IServiceContainer container) : base(container) - {} - - protected override ImageUrlProviderCollectionBuilder This => this; - } -} diff --git a/src/Umbraco.Web/Media/ImageUrlProviders/ImageUrlProvider.cs b/src/Umbraco.Web/Media/ImageUrlProviders/ImageUrlProvider.cs deleted file mode 100644 index fa2209b278..0000000000 --- a/src/Umbraco.Web/Media/ImageUrlProviders/ImageUrlProvider.cs +++ /dev/null @@ -1,93 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Xml.XPath; -using Umbraco.Core.Configuration; -using Umbraco.Core.Media; -using umbraco; -using Umbraco.Core; - -namespace Umbraco.Web.Media.ImageUrlProviders -{ - [Obsolete("IImageUrlProvider is no longer used and will be removed in future versions")] - public class ImageUrlProvider : IImageUrlProvider - { - public const string DefaultName = "umbracoUpload"; - - public string Name - { - get { return DefaultName; } - } - - public string GetImageUrlFromMedia(int mediaId, IDictionary parameters) - { - var url = string.Empty; - - var nodeIterator = library.GetMedia(mediaId, false); - - if (nodeIterator.Current != null) - { - var filename = GetProperty(nodeIterator, Constants.Conventions.Media.File); - var withThumb = AddThumbInfo(filename, parameters); - url = AddCropInfo(withThumb, parameters); - } - - return url; - } - - public string GetImageUrlFromFileName(string specifiedSrc, IDictionary parameters) - { - var withThumb = AddThumbInfo(specifiedSrc, parameters); - return AddCropInfo(withThumb, parameters); - } - - private static string AddThumbInfo(string filename, IDictionary parameters) - { - var thumb = string.Empty; - if (parameters.ContainsKey("thumb")) - thumb = parameters["thumb"]; - - if (!string.IsNullOrEmpty(thumb) && filename.Contains(".")) - { - var lastIndexOf = filename.LastIndexOf('.'); - var name = filename.Substring(0, lastIndexOf); - var extension = filename.Substring(lastIndexOf, filename.Length - lastIndexOf); - return string.Format("{0}_thumb_{1}{2}", name, thumb, extension); - } - return filename; - } - - private static string AddCropInfo(string filename, IDictionary parameters) - { - var crop = string.Empty; - if (parameters.ContainsKey("crop")) - crop = parameters["crop"]; - - if (!string.IsNullOrEmpty(crop) && filename.Contains(".")) - { - var lastIndexOf = filename.LastIndexOf('.'); - var name = filename.Substring(0, lastIndexOf); - - //var extension = filename.Substring(lastIndexOf, filename.Length - lastIndexOf); - //Built in cropper currently always uses jpg as an extension - - const string extension = ".jpg"; - return string.Format("{0}_{1}{2}", name, crop, extension); - } - - return filename; - } - - - private static string GetProperty(XPathNodeIterator nodeIterator, string fileProp) - { - var xpath = string.Format(".//{0}", fileProp); - - var file = string.Empty; - var selectSingleNode = nodeIterator.Current.SelectSingleNode(xpath); - if (selectSingleNode != null) - file = selectSingleNode.InnerXml; - - return file; - } - } -} diff --git a/src/Umbraco.Web/Media/ThumbnailProviders/AbstractThumbnailProvider.cs b/src/Umbraco.Web/Media/ThumbnailProviders/AbstractThumbnailProvider.cs deleted file mode 100644 index 5ed103fe9b..0000000000 --- a/src/Umbraco.Web/Media/ThumbnailProviders/AbstractThumbnailProvider.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using Umbraco.Core; -using Umbraco.Core.Media; - -namespace Umbraco.Web.Media.ThumbnailProviders -{ - public abstract class AbstractThumbnailProvider : IThumbnailProvider - { - protected abstract IEnumerable SupportedExtensions { get; } - - public bool CanProvideThumbnail(string fileUrl) - { - string thumbUrl; - return TryGetThumbnailUrl(fileUrl, out thumbUrl); - } - - public string GetThumbnailUrl(string fileUrl) - { - string thumbUrl; - TryGetThumbnailUrl(fileUrl, out thumbUrl); - return thumbUrl; - } - - protected bool IsSupportedExtension(string ext) - { - return SupportedExtensions.InvariantContains(ext) || - SupportedExtensions.InvariantContains("*"); - } - - protected abstract bool TryGetThumbnailUrl(string fileUrl, out string thumbUrl); - } -} diff --git a/src/Umbraco.Web/Media/ThumbnailProviders/FileExtensionIconThumbnailProvider.cs b/src/Umbraco.Web/Media/ThumbnailProviders/FileExtensionIconThumbnailProvider.cs deleted file mode 100644 index ea3a13a3c2..0000000000 --- a/src/Umbraco.Web/Media/ThumbnailProviders/FileExtensionIconThumbnailProvider.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using Umbraco.Core.Composing; -using Umbraco.Core.IO; - -namespace Umbraco.Web.Media.ThumbnailProviders -{ - [Weight(2000)] - public class FileExtensionIconThumbnailProvider : AbstractThumbnailProvider - { - protected override IEnumerable SupportedExtensions - { - get { return new List { "*" }; } - } - - protected override bool TryGetThumbnailUrl(string fileUrl, out string thumbUrl) - { - // Set thumbnail url to empty strin initially - thumbUrl = string.Empty; - - // Make sure file has an extension - var ext = Path.GetExtension(fileUrl); - if (string.IsNullOrEmpty(ext)) - return false; - - // Make sure it has a supported file extension - if (!IsSupportedExtension(ext)) - return false; - - // Make sure the thumbnail exists - var tmpThumbUrl = IOHelper.ResolveUrl(SystemDirectories.Umbraco + "/images/mediaThumbnails/"+ ext.TrimStart('.') +".png"); - if (!File.Exists(IOHelper.MapPath(tmpThumbUrl))) - return false; - - // We've got this far, so thumbnail must exist - thumbUrl = tmpThumbUrl; - return true; - } - } -} diff --git a/src/Umbraco.Web/Media/ThumbnailProviders/ImageThumbnailProvider.cs b/src/Umbraco.Web/Media/ThumbnailProviders/ImageThumbnailProvider.cs deleted file mode 100644 index 4fea0a6b5f..0000000000 --- a/src/Umbraco.Web/Media/ThumbnailProviders/ImageThumbnailProvider.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using Umbraco.Core; -using Umbraco.Core.Composing; -using Umbraco.Core.IO; - -namespace Umbraco.Web.Media.ThumbnailProviders -{ - [Weight(1000)] - public class ImageThumbnailProvider : AbstractThumbnailProvider - { - private readonly MediaFileSystem _mediaFileSystem; - - public ImageThumbnailProvider(MediaFileSystem mediaFileSystem) - { - _mediaFileSystem = mediaFileSystem; - } - - protected override IEnumerable SupportedExtensions - { - get { return new List { ".jpeg", ".jpg", ".gif", ".bmp", ".png", ".tiff", ".tif" }; } - } - - protected override bool TryGetThumbnailUrl(string fileUrl, out string thumbUrl) - { - // Set thumbnail url to empty strin initially - thumbUrl = string.Empty; - - // Make sure file has an extension - var ext = Path.GetExtension(fileUrl); - if (string.IsNullOrEmpty(ext)) - return false; - - // Make sure it has a supported file extension - if (!IsSupportedExtension(ext)) - return false; - - // Make sure the thumbnail exists - var tmpThumbUrl = fileUrl.Replace(ext, "_thumb" + ext); - - try - { - var fs = _mediaFileSystem; - var relativeThumbPath = fs.GetRelativePath(tmpThumbUrl); - if (!fs.FileExists(relativeThumbPath)) - return false; - } - catch (Exception) - { - // If something odd happens, just return false and move on - return false; - } - - // We've got this far, so thumbnail must exist - thumbUrl = tmpThumbUrl; - return true; - } - } -} diff --git a/src/Umbraco.Web/Media/ThumbnailProviders/MediaTypeIconThumbnailProvider.cs b/src/Umbraco.Web/Media/ThumbnailProviders/MediaTypeIconThumbnailProvider.cs deleted file mode 100644 index 0ecaaf8ff3..0000000000 --- a/src/Umbraco.Web/Media/ThumbnailProviders/MediaTypeIconThumbnailProvider.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using Umbraco.Core.Composing; -using Umbraco.Core.IO; - -namespace Umbraco.Web.Media.ThumbnailProviders -{ - [Weight(3000)] - public class MediaTypeIconThumbnailProvider : AbstractThumbnailProvider - { - - protected override IEnumerable SupportedExtensions - { - get { return new List { "*" }; } - } - - protected override bool TryGetThumbnailUrl(string fileUrl, out string thumbUrl) - { - // Set thumbnail url to empty strin initially - thumbUrl = string.Empty; - - // Make sure file has an extension - var ext = Path.GetExtension(fileUrl); - if (string.IsNullOrEmpty(ext)) - return false; - - // Make sure it has a supported file extension - if (!IsSupportedExtension(ext)) - return false; - - // Make sure the thumbnail exists - var tmpThumbUrl = IOHelper.ResolveUrl(SystemDirectories.Umbraco + "/images/mediaThumbnails/"+ ext.TrimStart('.') +".png"); - if (!File.Exists(IOHelper.MapPath(tmpThumbUrl))) - return false; - - // We've got this far, so thumbnail must exist - thumbUrl = tmpThumbUrl; - return true; - } - } -} diff --git a/src/Umbraco.Web/Models/ContentEditing/UmbracoEntityTypes.cs b/src/Umbraco.Web/Models/ContentEditing/UmbracoEntityTypes.cs index 5f4414d919..2d778ca61c 100644 --- a/src/Umbraco.Web/Models/ContentEditing/UmbracoEntityTypes.cs +++ b/src/Umbraco.Web/Models/ContentEditing/UmbracoEntityTypes.cs @@ -52,14 +52,7 @@ namespace Umbraco.Web.Models.ContentEditing /// Member Group /// MemberGroup, - - /// - /// Content Item - /// - [Obsolete("This is not used and will be removed in future versions")] - [EditorBrowsable(EditorBrowsableState.Never)] - ContentItem, - + /// /// "Media Type /// diff --git a/src/Umbraco.Web/Models/ContentEditing/UserDetail.cs b/src/Umbraco.Web/Models/ContentEditing/UserDetail.cs index dc240bfb78..232dee818e 100644 --- a/src/Umbraco.Web/Models/ContentEditing/UserDetail.cs +++ b/src/Umbraco.Web/Models/ContentEditing/UserDetail.cs @@ -25,13 +25,7 @@ namespace Umbraco.Web.Models.ContentEditing /// [DataMember(Name = "emailHash")] public string EmailHash { get; set; } - - [Obsolete("This should not be used it exists for legacy reasons only, use user groups instead, it will be removed in future versions")] - [EditorBrowsable(EditorBrowsableState.Never)] - [ReadOnly(true)] - [DataMember(Name = "userType")] - public string UserType { get; set; } - + [ReadOnly(true)] [DataMember(Name = "userGroups")] public string[] UserGroups { get; set; } diff --git a/src/Umbraco.Web/Models/Mapping/UserMapperProfile.cs b/src/Umbraco.Web/Models/Mapping/UserMapperProfile.cs index ad4eaa5b52..213a1a5e3a 100644 --- a/src/Umbraco.Web/Models/Mapping/UserMapperProfile.cs +++ b/src/Umbraco.Web/Models/Mapping/UserMapperProfile.cs @@ -47,7 +47,6 @@ namespace Umbraco.Web.Models.Mapping .ForMember(detail => detail.TourData, opt => opt.Ignore()) .ForMember(dest => dest.SessionTimeout, opt => opt.Ignore()) .ForMember(dest => dest.EmailConfirmedDate, opt => opt.Ignore()) - .ForMember(dest => dest.UserType, opt => opt.Ignore()) .ForMember(dest => dest.InvitedDate, opt => opt.Ignore()) .ForMember(dest => dest.SecurityStamp, opt => opt.Ignore()) .ForMember(dest => dest.Avatar, opt => opt.Ignore()) @@ -79,7 +78,6 @@ namespace Umbraco.Web.Models.Mapping .ForMember(detail => detail.TourData, opt => opt.Ignore()) .ForMember(dest => dest.StartContentIds, opt => opt.Ignore()) .ForMember(dest => dest.StartMediaIds, opt => opt.Ignore()) - .ForMember(dest => dest.UserType, opt => opt.Ignore()) .ForMember(dest => dest.Language, opt => opt.Ignore()) .ForMember(dest => dest.Username, opt => opt.Ignore()) .ForMember(dest => dest.PasswordQuestion, opt => opt.Ignore()) @@ -332,26 +330,6 @@ namespace Umbraco.Web.Models.Mapping var groups = user.Groups.ToArray(); detail.UserGroups = user.Groups.Select(x => x.Alias).ToArray(); - if (groups.Length == 0) - { - //In backwards compatibility land, a user type cannot be null! so we need to return a fake one. - detail.UserType = "temp"; - } - else - { - var builtIns = new[] { Constants.Security.AdminGroupAlias, "writer", "editor", Constants.Security.TranslatorGroupAlias }; - var foundBuiltIn = groups.FirstOrDefault(x => builtIns.Contains(x.Alias)); - if (foundBuiltIn != null) - { - detail.UserType = foundBuiltIn.Alias; - } - else - { - //otherwise return the first - detail.UserType = groups[0].Alias; - } - } - }); CreateMap() diff --git a/src/Umbraco.Web/Runtime/WebRuntimeComponent.cs b/src/Umbraco.Web/Runtime/WebRuntimeComponent.cs index e408a46db5..196fd10650 100644 --- a/src/Umbraco.Web/Runtime/WebRuntimeComponent.cs +++ b/src/Umbraco.Web/Runtime/WebRuntimeComponent.cs @@ -38,7 +38,6 @@ using Umbraco.Web.Features; using Umbraco.Web.HealthCheck; using Umbraco.Web.Install; using Umbraco.Web.Media; -using Umbraco.Web.Media.ThumbnailProviders; using Umbraco.Web.Mvc; using Umbraco.Web.PublishedCache; using Umbraco.Web.Routing; diff --git a/src/Umbraco.Web/Umbraco.Web.csproj b/src/Umbraco.Web/Umbraco.Web.csproj index d1ebf54a87..efb94856b9 100644 --- a/src/Umbraco.Web/Umbraco.Web.csproj +++ b/src/Umbraco.Web/Umbraco.Web.csproj @@ -206,7 +206,6 @@ - @@ -215,7 +214,6 @@ - @@ -467,7 +465,6 @@ - @@ -940,8 +937,6 @@ - - @@ -1123,7 +1118,6 @@ - @@ -1163,9 +1157,6 @@ ASPXCodeBehind - - ASPXCodeBehind - ASPXCodeBehind @@ -1181,7 +1172,6 @@ ASPXCodeBehind - @@ -1210,10 +1200,6 @@ - - - - diff --git a/src/Umbraco.Web/UmbracoHelper.cs b/src/Umbraco.Web/UmbracoHelper.cs index fca5c200b7..043584e6d9 100644 --- a/src/Umbraco.Web/UmbracoHelper.cs +++ b/src/Umbraco.Web/UmbracoHelper.cs @@ -890,19 +890,7 @@ namespace Umbraco.Web { return StringUtilities.ReplaceLineBreaksForHtml(text); } - - /// - /// Returns an MD5 hash of the string specified - /// - /// The text to create a hash from - /// Md5 has of the string - [Obsolete("Please use the CreateHash method instead. This may be removed in future versions")] - [EditorBrowsable(EditorBrowsableState.Never)] - public string CreateMd5Hash(string text) - { - return text.ToMd5(); - } - + /// /// Generates a hash based on the text string passed in. This method will detect the /// security requirements (is FIPS enabled) and return an appropriate hash. diff --git a/src/Umbraco.Web/_Legacy/Actions/ActionNewFolder.cs b/src/Umbraco.Web/_Legacy/Actions/ActionNewFolder.cs deleted file mode 100644 index b4f16b3dd0..0000000000 --- a/src/Umbraco.Web/_Legacy/Actions/ActionNewFolder.cs +++ /dev/null @@ -1,89 +0,0 @@ -using System; -using Umbraco.Web.UI.Pages; - -namespace Umbraco.Web._Legacy.Actions -{ - /// - /// This action is invoked upon creation of a document - /// - [Obsolete("This class is no longer used and will be removed in future versions")] - public class ActionNewFolder : IAction - { - //create singleton -#pragma warning disable 612,618 - private static readonly ActionNewFolder m_instance = new ActionNewFolder(); -#pragma warning restore 612,618 - - /// - /// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons. - /// All Umbraco assemblies should use the singleton instantiation (this.Instance) - /// When this applicatio is refactored, this constuctor should be made private. - /// - [Obsolete("Use the singleton instantiation instead of a constructor")] - public ActionNewFolder() { } - - public static ActionNewFolder Instance - { - get { return m_instance; } - } - - #region IAction Members - - public char Letter - { - get - { - return '!'; - } - } - - public string JsFunctionName - { - get - { - return string.Format("{0}.actionNewFolder()", ClientTools.Scripts.GetAppActions); - } - } - - public string JsSource - { - get - { - return null; - } - } - - public string Alias - { - get - { - return "createFolder"; - } - } - - public string Icon - { - get - { - return "plus-sign-alt"; - } - } - - public bool ShowInNotifier - { - get - { - return false; - } - } - public bool CanBePermissionAssigned - { - get - { - return false; - } - } - - #endregion - } -} diff --git a/src/Umbraco.Web/_Legacy/Packager/Package.cs b/src/Umbraco.Web/_Legacy/Packager/Package.cs deleted file mode 100644 index 2116e64ea1..0000000000 --- a/src/Umbraco.Web/_Legacy/Packager/Package.cs +++ /dev/null @@ -1,145 +0,0 @@ -using System; -using System.ComponentModel; -using System.Linq; -using System.Runtime.CompilerServices; -using Umbraco.Core.Composing; -using Umbraco.Core.Models.Membership; - -namespace umbraco.cms.businesslogic.packager -{ - [Obsolete("This class is not used and will be removed in future versions")] - [EditorBrowsable(EditorBrowsableState.Never)] - public class Package - { - public Package() - { - } - - /// - /// Initialize package install status object by specifying the internal id of the installation. - /// The id is specific to the local umbraco installation and cannot be used to identify the package in general. - /// Use the Package(Guid) constructor to check whether a package has been installed - /// - /// The internal id. - public Package(int Id) - { - Initialize(Id); - } - - public Package(Guid Id) - { - using (var scope = Current.ScopeProvider.CreateScope()) - { - int installStatusId = scope.Database.ExecuteScalar( - "select id from umbracoInstalledPackages where package = @package and upgradeId = 0", new { package = Id}); - - if (installStatusId > 0) - Initialize(installStatusId); - else - throw new ArgumentException("Package with id '" + Id.ToString() + "' is not installed"); - - scope.Complete(); - } - } - - private void Initialize(int id) - { - using (var scope = Current.ScopeProvider.CreateScope()) - { - var f = scope.Database.Fetch( - "select id, uninstalled, upgradeId, installDate, userId, package, versionMajor, versionMinor, versionPatch from umbracoInstalledPackages where id = @id", - new { id }).FirstOrDefault(); - if (f != null) - { - Id = id; - Uninstalled = f.uninstalled; - UpgradeId = f.upgradeId; - InstallDate = f.installDate; - User = Current.Services.UserService.GetUserById(f.userId); - PackageId = f.package; - VersionMajor = f.versionMajor; - VersionMinor = f.versionMinor; - VersionPatch = f.versionPatch; - } - - scope.Complete(); - } - } - - [MethodImpl(MethodImplOptions.Synchronized)] // ;-(( - public void Save() - { - using (var scope = Current.ScopeProvider.CreateScope()) - { - // check if package status exists - if (Id == 0) - { - // The method is synchronized - scope.Database.Execute("INSERT INTO umbracoInstalledPackages (uninstalled, upgradeId, installDate, userId, versionMajor, versionMinor, versionPatch) VALUES (@uninstalled, @upgradeId, @installDate, @userId, @versionMajor, @versionMinor, @versionPatch)", - new - { - uninstalled = Uninstalled, - upgradeId = UpgradeId, - installData = InstallDate, - userId = User.Id, - versionMajor = VersionMajor, - versionMinor = VersionMinor, - versionPath = VersionPatch, - id = Id - }); - Id = scope.Database.ExecuteScalar("SELECT MAX(id) FROM umbracoInstalledPackages"); - } - - scope.Database.Execute( - "update umbracoInstalledPackages set " + - "uninstalled = @uninstalled, " + - "upgradeId = @upgradeId, " + - "installDate = @installDate, " + - "userId = @userId, " + - "versionMajor = @versionMajor, " + - "versionMinor = @versionMinor, " + - "versionPatch = @versionPatch " + - "where id = @id", - new - { - uninstalled = Uninstalled, - upgradeId = UpgradeId, - installData = InstallDate, - userId = User.Id, - versionMajor = VersionMajor, - versionMinor = VersionMinor, - versionPath = VersionPatch, - id = Id - }); - - scope.Complete(); - } - } - - public bool Uninstalled { get; set; } - - - public IUser User { get; set; } - - - public DateTime InstallDate { get; set; } - - - public int Id { get; set; } - - - public int UpgradeId { get; set; } - - - public Guid PackageId { get; set; } - - - public int VersionPatch { get; set; } - - - public int VersionMinor { get; set; } - - - public int VersionMajor { get; set; } - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/library.cs b/src/Umbraco.Web/umbraco.presentation/library.cs index 4f8084e409..9b9d4df938 100644 --- a/src/Umbraco.Web/umbraco.presentation/library.cs +++ b/src/Umbraco.Web/umbraco.presentation/library.cs @@ -398,19 +398,6 @@ namespace umbraco return GetUmbracoHelper().MemberHasAccess(NodeId, Path); } - - /// - /// Returns an MD5 hash of the string specified - /// - /// The text to create a hash from - /// Md5 hash of the string - [Obsolete("Please use the CreateHash method instead. This may be removed in future versions")] - [EditorBrowsable(EditorBrowsableState.Never)] - public static string md5(string text) - { - return text.ToMd5(); - } - /// /// Generates a hash based on the text string passed in. This method will detect the /// security requirements (is FIPS enabled) and return an appropriate hash. diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/ping.aspx.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/ping.aspx.cs deleted file mode 100644 index 3d8f80ef97..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/ping.aspx.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Collections; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Web; -using System.Web.SessionState; -using System.Web.UI; -using System.Web.UI.WebControls; -using System.Web.UI.HtmlControls; - -namespace umbraco.presentation -{ - - [Obsolete("This class will be removed in future versions.")] - [EditorBrowsable(EditorBrowsableState.Never)] - public partial class ping : System.Web.UI.Page - { - #region Web Form Designer generated code - override protected void OnInit(EventArgs e) - { - // - // CODEGEN: This call is required by the ASP.NET Web Form Designer. - // - InitializeComponent(); - base.OnInit(e); - } - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - } - #endregion - } -} diff --git a/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Image.cs b/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Image.cs deleted file mode 100644 index 020a555fbc..0000000000 --- a/src/Umbraco.Web/umbraco.presentation/umbraco/templateControls/Image.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Web.UI; -using System.Web.UI.HtmlControls; -using Umbraco.Core.Media; -using Umbraco.Web.Media; - -namespace umbraco.presentation.templateControls -{ - [Obsolete("This is no longer used and will be removed in future versions")] - public class Image : HtmlImage - { - public string NodeId { get; set; } - public string Field { get; set; } - public string Provider { get; set; } - public string Parameters { get; set; } - - protected override void Render(HtmlTextWriter writer) - { - int id; - bool hasid = int.TryParse(NodeId, out id); - int? nodeId = hasid ? id : (int?)null; - - string url; - bool imageFound = ImageUrl.TryGetImageUrl(Src, Field, Provider, Parameters, nodeId, out url); - Src = url; - if (imageFound) - { - base.Render(writer); - } - } - } -}