mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-20 02:37:55 +08:00
Removing unnecessary file copied to the Users module (see UserResolverSelector.cs)
This commit is contained in:
@@ -1,37 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.Users.Models;
|
||||
|
||||
namespace Orchard.Gallery.Services {
|
||||
public class PackageIdentityResolverSelector : IIdentityResolverSelector {
|
||||
private readonly IContentManager _contentManager;
|
||||
|
||||
public PackageIdentityResolverSelector(IContentManager contentManager) {
|
||||
_contentManager = contentManager;
|
||||
}
|
||||
|
||||
public IdentityResolverSelectorResult GetResolver(ContentIdentity contentIdentity) {
|
||||
if (contentIdentity.Has("User.UserName")) {
|
||||
return new IdentityResolverSelectorResult {
|
||||
Priority = 0,
|
||||
Resolve = ResolveIdentity
|
||||
};
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private IEnumerable<ContentItem> ResolveIdentity(ContentIdentity identity) {
|
||||
var identifier = identity.Get("User.UserName");
|
||||
|
||||
if (identifier == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return _contentManager
|
||||
.Query<UserPart, UserPartRecord>()
|
||||
.Where(p => p.NormalizedUserName == identifier)
|
||||
.List<ContentItem>();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user