Removes unused and obsoleted code

This commit is contained in:
Shannon
2018-05-01 01:27:25 +10:00
parent c8d2ea141b
commit 6faa2ff177
40 changed files with 11 additions and 1246 deletions
@@ -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; }
}
}
@@ -41,7 +41,7 @@ namespace Umbraco.Core.Configuration.UmbracoSettings
[ConfigurationProperty("authCookieName")]
internal InnerTextConfigurationElement<string> AuthCookieName
{
get { return GetOptionalTextElement("authCookieName", Constants.Web.AuthCookieName); }
get { return GetOptionalTextElement("authCookieName", "UMB_UCONTEXT"); }
}
[ConfigurationProperty("authCookieDomain")]
-7
View File
@@ -23,13 +23,6 @@ namespace Umbraco.Core
public const string InstallerCookieName = "umb_installId";
/// <summary>
/// The auth cookie name
/// </summary>
[Obsolete("DO NOT USE THIS, USE ISecuritySection.AuthCookieName, this will be removed in future versions")]
[EditorBrowsable(EditorBrowsableState.Never)]
public const string AuthCookieName = "UMB_UCONTEXT";
}
}
}
+1 -7
View File
@@ -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);
@@ -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
//{
// /// <summary>
// /// An asynchronous appender based on <see cref="BlockingCollection{T}"/>
// /// </summary>
// /// <remarks>
// /// Borrowed from https://github.com/cjbhaines/Log4Net.Async - will reference Nuget packages directly in v8
// /// </remarks>
// [Obsolete("Use the Log4Net.Async.ParallelForwardingAppender instead this will be removed in future versions")]
// public class ParallelForwardingAppender : Log4Net.Async.ParallelForwardingAppender
// {
// }
//}
@@ -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<string, string> parameters);
string GetImageUrlFromFileName(string specifiedSrc, IDictionary<string, string> parameters);
}
}
@@ -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);
}
}
+2 -14
View File
@@ -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<string> 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);
/// <summary>
/// Exposes the basic profile data
/// </summary>
@@ -65,4 +53,4 @@ namespace Umbraco.Core.Models.Membership
/// </summary>
string TourData { get; set; }
}
}
}
@@ -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<string> Permissions { get; set; }
}
}
-156
View File
@@ -284,162 +284,6 @@ namespace Umbraco.Core.Models.Membership
get { return _allowedSections ?? (_allowedSections = new List<string>(_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<string>(),
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);
}
}
/// <summary>
/// This used purely for hacking backwards compatibility into this class for &lt; 7.7 compat
/// </summary>
@@ -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<string> _permissions;
private static readonly Lazy<PropertySelectors> Ps = new Lazy<PropertySelectors>();
private class PropertySelectors
{
public readonly PropertyInfo NameSelector = ExpressionHelper.GetPropertyInfo<UserType, string>(x => x.Name);
public readonly PropertyInfo AliasSelector = ExpressionHelper.GetPropertyInfo<UserType, string>(x => x.Alias);
public readonly PropertyInfo PermissionsSelector = ExpressionHelper.GetPropertyInfo<UserType, IEnumerable<string>>(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); }
}
/// <summary>
/// The set of default permissions for the user type
/// </summary>
/// <remarks>
/// 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.
/// </remarks>
[DataMember]
public IEnumerable<string> Permissions
{
get { return _permissions; }
set
{
SetPropertyValueAndDetectChanges(value, ref _permissions, Ps.Value.PermissionsSelector,
//Custom comparer for enumerable
new DelegateEqualityComparer<IEnumerable<string>>(
(enum1, enum2) => enum1.UnsortedSequenceEqual(enum2),
enum1 => enum1.GetHashCode()));
}
}
}
}
+1 -19
View File
@@ -14,14 +14,6 @@ namespace Umbraco.Core.Models
/// </summary>
Unknown,
/// <summary>
/// Content Item Type
/// </summary>
[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,
/// <summary>
/// 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???
/// <summary>
/// Content Item
/// </summary>
[UmbracoObjectType(Constants.ObjectTypes.Strings.ContentItem)]
[FriendlyName("Content Item")]
[Obsolete("This is not used and will be removed in future versions")]
[EditorBrowsable(EditorBrowsableState.Never)]
ContentItem,
/// <summary>
/// "Media Type
/// </summary>
@@ -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);
}
}
/// <summary>
/// Returns the culture info associated with this user, based on the language they're assigned to in the back office
/// </summary>
-6
View File
@@ -261,7 +261,6 @@
<Compile Include="Configuration\UmbracoSettings\IDistributedCallSection.cs" />
<Compile Include="Configuration\UmbracoSettings\IFileExtension.cs" />
<Compile Include="Configuration\UmbracoSettings\IImagingAutoFillUploadField.cs" />
<Compile Include="Configuration\UmbracoSettings\ILink.cs" />
<Compile Include="Configuration\UmbracoSettings\ILoggingSection.cs" />
<Compile Include="Configuration\UmbracoSettings\ILogType.cs" />
<Compile Include="Configuration\UmbracoSettings\ImagingAutoFillPropertiesCollection.cs" />
@@ -550,7 +549,6 @@
<Compile Include="Logging\LogProfiler.cs" />
<Compile Include="Logging\OwinLogger.cs" />
<Compile Include="Logging\OwinLoggerFactory.cs" />
<Compile Include="Logging\ParallelForwardingAppender.cs" />
<Compile Include="Logging\ProfilerExtensions.cs" />
<Compile Include="Logging\ProfilingLogger.cs" />
<Compile Include="Logging\RingBuffer.cs" />
@@ -597,9 +595,7 @@
<Compile Include="Media\Exif\Utility.cs" />
<Compile Include="Media\IEmbedProvider.cs" />
<Compile Include="Media\IEmbedSettingProvider.cs" />
<Compile Include="Media\IImageUrlProvider.cs" />
<Compile Include="Media\ImageExtensions.cs" />
<Compile Include="Media\IThumbnailProvider.cs" />
<Compile Include="Media\ProviderSetting.cs" />
<Compile Include="Media\Result.cs" />
<Compile Include="Media\Status.cs" />
@@ -703,7 +699,6 @@
<Compile Include="Models\Membership\IReadOnlyUserGroup.cs" />
<Compile Include="Models\Membership\IUser.cs" />
<Compile Include="Models\Membership\IUserGroup.cs" />
<Compile Include="Models\Membership\IUserType.cs" />
<Compile Include="Models\Membership\MemberCountType.cs" />
<Compile Include="Models\Membership\MembershipScenario.cs" />
<Compile Include="Models\Membership\MembershipUserExtensions.cs" />
@@ -715,7 +710,6 @@
<Compile Include="Models\Membership\UserGroupExtensions.cs" />
<Compile Include="Models\Membership\UserProfile.cs" />
<Compile Include="Models\Membership\UserState.cs" />
<Compile Include="Models\Membership\UserType.cs" />
<Compile Include="Models\MemberType.cs" />
<Compile Include="Models\MemberTypePropertyProfileAccess.cs" />
<Compile Include="Models\MigrationEntry.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");
}
}
}
@@ -549,7 +549,6 @@ namespace Umbraco.Tests.Services
var objectTypeId = Constants.ObjectTypes.ContentItem;
Assert.Throws<NotSupportedException>(() => service.GetAll<IContentBase>());
Assert.Throws<NotSupportedException>(() => service.GetAll(UmbracoObjectTypes.ContentItem));
Assert.Throws<NotSupportedException>(() => service.GetAll(objectTypeId));
}
-4
View File
@@ -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<FilteredControllerFactoryCollection>();
internal static ImageUrlProviderCollection ImageUrlProviders
=> Container.GetInstance<ImageUrlProviderCollection>();
internal static IPublishedSnapshotService PublishedSnapshotService
=> Container.GetInstance<IPublishedSnapshotService>();
-8
View File
@@ -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<HealthCheckCollectionBuilder>();
/// <summary>
/// Gets the image url providers collection builder.
/// </summary>
/// <param name="composition">The composition.</param>
internal static ImageUrlProviderCollectionBuilder ImageUrlProviders(this Composition composition)
=> composition.Container.GetInstance<ImageUrlProviderCollectionBuilder>();
/// <summary>
/// Gets the url providers collection builder.
/// </summary>
@@ -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:
+1 -24
View File
@@ -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<ContentItemBasic<ContentPropertyBasic, IMedia>> 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
/// <summary>
+1 -18
View File
@@ -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<ContentTypeBasic> 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
/// <summary>
-97
View File
@@ -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<string>().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<object>(
string.Format("{0}{1}_{2}", CacheKeys.ContentItemCacheKey, nodeIdInt.ToString(CultureInfo.InvariantCulture), field));
return content;
}
}
}
@@ -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<IImageUrlProvider>
{
public ImageUrlProviderCollection(IEnumerable<IImageUrlProvider> 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;
}
}
}
}
@@ -1,14 +0,0 @@
using LightInject;
using Umbraco.Core.Composing;
using Umbraco.Core.Media;
namespace Umbraco.Web.Media
{
internal class ImageUrlProviderCollectionBuilder : OrderedCollectionBuilderBase<ImageUrlProviderCollectionBuilder, ImageUrlProviderCollection, IImageUrlProvider>
{
public ImageUrlProviderCollectionBuilder(IServiceContainer container) : base(container)
{}
protected override ImageUrlProviderCollectionBuilder This => this;
}
}
@@ -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<string, string> 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<string, string> parameters)
{
var withThumb = AddThumbInfo(specifiedSrc, parameters);
return AddCropInfo(withThumb, parameters);
}
private static string AddThumbInfo(string filename, IDictionary<string, string> 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<string, string> 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;
}
}
}
@@ -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<string> 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);
}
}
@@ -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<string> SupportedExtensions
{
get { return new List<string> { "*" }; }
}
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;
}
}
}
@@ -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<string> SupportedExtensions
{
get { return new List<string> { ".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;
}
}
}
@@ -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<string> SupportedExtensions
{
get { return new List<string> { "*" }; }
}
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;
}
}
}
@@ -52,14 +52,7 @@ namespace Umbraco.Web.Models.ContentEditing
/// Member Group
/// </summary>
MemberGroup,
/// <summary>
/// Content Item
/// </summary>
[Obsolete("This is not used and will be removed in future versions")]
[EditorBrowsable(EditorBrowsableState.Never)]
ContentItem,
/// <summary>
/// "Media Type
/// </summary>
@@ -25,13 +25,7 @@ namespace Umbraco.Web.Models.ContentEditing
/// </summary>
[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; }
@@ -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<IProfile, ContentEditing.UserProfile>()
@@ -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;
-14
View File
@@ -206,7 +206,6 @@
<Compile Include="HealthCheck\Checks\Security\HttpsCheck.cs" />
<Compile Include="HealthCheck\StatusResultType.cs" />
<Compile Include="HealthCheck\Checks\DataIntegrity\XmlDataIntegrityHealthCheck.cs" />
<Compile Include="Media\ImageUrlProviderCollection.cs" />
<Compile Include="Models\BackOfficeTour.cs" />
<Compile Include="Models\BackOfficeTourFile.cs" />
<Compile Include="Models\BackOfficeTourStep.cs" />
@@ -215,7 +214,6 @@
<Compile Include="Models\ContentEditing\BackOfficePreview.cs" />
<Compile Include="Models\ContentEditing\CodeFileDisplay.cs" />
<Compile Include="Models\ContentEditing\ContentRedirectUrl.cs" />
<Compile Include="Media\ImageUrlProviderCollectionBuilder.cs" />
<Compile Include="Models\ContentEditing\ContentVariation.cs" />
<Compile Include="Models\ContentEditing\ContentVariationPublish.cs" />
<Compile Include="Models\ContentEditing\EditorNavigation.cs" />
@@ -467,7 +465,6 @@
<Compile Include="_Legacy\Actions\ActionImport.cs" />
<Compile Include="_Legacy\Actions\ActionMove.cs" />
<Compile Include="_Legacy\Actions\ActionNew.cs" />
<Compile Include="_Legacy\Actions\ActionNewFolder.cs" />
<Compile Include="_Legacy\Actions\ActionNotify.cs" />
<Compile Include="_Legacy\Actions\ActionNull.cs" />
<Compile Include="_Legacy\Actions\ActionPackage.cs" />
@@ -940,8 +937,6 @@
<Compile Include="Macros\PartialViewMacroController.cs" />
<Compile Include="Macros\PartialViewMacroEngine.cs" />
<Compile Include="Macros\PartialViewMacroPage.cs" />
<Compile Include="Media\ImageUrl.cs" />
<Compile Include="Media\ImageUrlProviders\ImageUrlProvider.cs" />
<Compile Include="Models\PartialViewMacroModel.cs" />
<Compile Include="Models\PublishedContentBase.cs" />
<Compile Include="Mvc\AreaRegistrationExtensions.cs" />
@@ -1123,7 +1118,6 @@
<Compile Include="_Legacy\PackageActions\removeStringFromTemplate.cs" />
<Compile Include="_Legacy\Packager\data.cs" />
<Compile Include="_Legacy\Packager\Installer.cs" />
<Compile Include="_Legacy\Packager\Package.cs" />
<Compile Include="_Legacy\Packager\PackageInstance\CreatedPackage.cs" />
<Compile Include="_Legacy\Packager\PackageInstance\InstalledPackage.cs" />
<Compile Include="_Legacy\Packager\PackageInstance\IPackageInstance.cs" />
@@ -1163,9 +1157,6 @@
<Compile Include="umbraco.presentation\umbraco\Default.aspx.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="umbraco.presentation\umbraco\ping.aspx.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="umbraco.presentation\umbraco\developer\Macros\editMacro.aspx.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
@@ -1181,7 +1172,6 @@
<Compile Include="umbraco.presentation\umbraco\masterpages\umbracoDialog.master.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="umbraco.presentation\umbraco\templateControls\Image.cs" />
<Compile Include="UmbracoHelper.cs" />
<Compile Include="Mvc\ViewContextExtensions.cs" />
<Compile Include="Mvc\ViewDataContainerExtensions.cs" />
@@ -1210,10 +1200,6 @@
<Compile Include="Routing\LegacyRequestInitializer.cs" />
<Compile Include="Mvc\ControllerExtensions.cs" />
<Compile Include="Routing\ContentFinderByUrlAlias.cs" />
<Compile Include="Media\ThumbnailProviders\AbstractThumbnailProvider.cs" />
<Compile Include="Media\ThumbnailProviders\MediaTypeIconThumbnailProvider.cs" />
<Compile Include="Media\ThumbnailProviders\FileExtensionIconThumbnailProvider.cs" />
<Compile Include="Media\ThumbnailProviders\ImageThumbnailProvider.cs" />
<Compile Include="Routing\ContentFinderByIdPath.cs" />
<Compile Include="TypeLoaderExtensions.cs" />
<Compile Include="Routing\DomainHelper.cs" />
+1 -13
View File
@@ -890,19 +890,7 @@ namespace Umbraco.Web
{
return StringUtilities.ReplaceLineBreaksForHtml(text);
}
/// <summary>
/// Returns an MD5 hash of the string specified
/// </summary>
/// <param name="text">The text to create a hash from</param>
/// <returns>Md5 has of the string</returns>
[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();
}
/// <summary>
/// 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.
@@ -1,89 +0,0 @@
using System;
using Umbraco.Web.UI.Pages;
namespace Umbraco.Web._Legacy.Actions
{
/// <summary>
/// This action is invoked upon creation of a document
/// </summary>
[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
/// <summary>
/// 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.
/// </summary>
[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
}
}
-145
View File
@@ -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()
{
}
/// <summary>
/// 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
/// </summary>
/// <param name="Id">The internal id.</param>
public Package(int Id)
{
Initialize(Id);
}
public Package(Guid Id)
{
using (var scope = Current.ScopeProvider.CreateScope())
{
int installStatusId = scope.Database.ExecuteScalar<int>(
"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<dynamic>(
"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<int>("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; }
}
}
@@ -398,19 +398,6 @@ namespace umbraco
return GetUmbracoHelper().MemberHasAccess(NodeId, Path);
}
/// <summary>
/// Returns an MD5 hash of the string specified
/// </summary>
/// <param name="text">The text to create a hash from</param>
/// <returns>Md5 hash of the string</returns>
[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();
}
/// <summary>
/// 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.
@@ -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);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
}
#endregion
}
}
@@ -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);
}
}
}
}