From 3a17002ec4696c404d2fc0f7dda32713df93256c Mon Sep 17 00:00:00 2001 From: Shannon Date: Fri, 30 Jun 2017 17:21:40 +1000 Subject: [PATCH] fixes build after merge --- src/Umbraco.Core/Models/UserExtensions.cs | 16 ++++++++-------- src/Umbraco.Core/Services/UserService.cs | 8 +------- 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/Umbraco.Core/Models/UserExtensions.cs b/src/Umbraco.Core/Models/UserExtensions.cs index 9c2931ad73..58a844ddf1 100644 --- a/src/Umbraco.Core/Models/UserExtensions.cs +++ b/src/Umbraco.Core/Models/UserExtensions.cs @@ -27,7 +27,7 @@ namespace Umbraco.Core.Models if (user.Avatar.IsNullOrWhiteSpace()) { var gravatarHash = user.Email.ToMd5(); - var gravatarUrl = "https://www.gravatar.com/avatar/" + gravatarHash + "?d=404"; + var gravatarUrl = "https://www.gravatar.com/avatar/" + gravatarHash + "?d=404"; //try gravatar var gravatarAccess = staticCache.GetCacheItem("UserAvatar" + user.Id, () => @@ -61,8 +61,8 @@ namespace Umbraco.Core.Models } return null; - } - + } + //use the custom avatar var avatarUrl = FileSystemProviderManager.Current.MediaFileSystem.GetUrl(user.Avatar); return new[] @@ -74,7 +74,7 @@ namespace Umbraco.Core.Models avatarUrl + "?width=300&height=300&mode=crop" }; - } + } /// /// Returns the culture info associated with this user, based on the language they're assigned to in the back office @@ -122,7 +122,7 @@ namespace Umbraco.Core.Models internal static bool HasPathAccess(string path, int[] startNodeIds, int recycleBinId) { - if (string.IsNullOrWhiteSpace(path)) throw new ArgumentException("Value cannot be null or whitespace.", "path"); + if (string.IsNullOrWhiteSpace(path)) throw new ArgumentException("Value cannot be null or whitespace.", "path"); var formattedPath = "," + path + ","; var formattedRecycleBinId = "," + recycleBinId.ToInvariantString() + ","; @@ -130,14 +130,14 @@ namespace Umbraco.Core.Models //check for root path access //TODO: This logic may change if (startNodeIds.Length == 0 || startNodeIds.Contains(Constants.System.Root)) - return true; + return true; //only users with root access have access to the recycle bin so if the above check didn't pass than access is denied if (formattedPath.Contains(formattedRecycleBinId)) { return false; - } - + } + //check for normal paths foreach (var startNodeId in startNodeIds) { diff --git a/src/Umbraco.Core/Services/UserService.cs b/src/Umbraco.Core/Services/UserService.cs index f0d2183bfb..ab4da10e6c 100644 --- a/src/Umbraco.Core/Services/UserService.cs +++ b/src/Umbraco.Core/Services/UserService.cs @@ -85,13 +85,7 @@ namespace Umbraco.Core.Services /// IUser IMembershipMemberService.CreateWithIdentity(string username, string email, string passwordValue, string memberTypeAlias, bool isApproved) { - var userType = GetUserTypeByAlias(memberTypeAlias); - if (userType == null) - { - throw new EntityNotFoundException("The user type " + memberTypeAlias + " could not be resolved"); - } - - return CreateUserWithIdentity(username, email, passwordValue, userType, isApproved); + return CreateUserWithIdentity(username, email, passwordValue, isApproved); } ///