Skip to content

Commit

Permalink
Fixes: U4-5456 Cannot access all properties of member via MembershipH…
Browse files Browse the repository at this point in the history
…elper methods
  • Loading branch information
Shazwazza committed Oct 2, 2014
1 parent b90f287 commit d2592bd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
13 changes: 12 additions & 1 deletion src/Umbraco.Web/PublishedCache/MemberPublishedContent.cs
@@ -1,9 +1,12 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Web.Security;
using Umbraco.Core;
using Umbraco.Core.Dynamics;
using Umbraco.Core.Models;
using Umbraco.Core.Models.Membership;
using Umbraco.Core.Models.PublishedContent;
Expand All @@ -16,7 +19,7 @@ namespace Umbraco.Web.PublishedCache
/// <summary>
/// Exposes a member object as IPublishedContent
/// </summary>
internal class MemberPublishedContent : PublishedContentBase
public sealed class MemberPublishedContent : PublishedContentBase
{

private readonly IMember _member;
Expand Down Expand Up @@ -126,6 +129,14 @@ public override IPublishedProperty GetProperty(string alias, bool recurse)

public override IPublishedProperty GetProperty(string alias)
{
switch (alias)
{
case "Email":
return new PropertyResult("Email", Email, PropertyResultType.CustomProperty);
case "UserName":
return new PropertyResult("UserName", UserName, PropertyResultType.CustomProperty);
}

return _properties.FirstOrDefault(x => x.PropertyTypeAlias.InvariantEquals(alias));
}

Expand Down
1 change: 0 additions & 1 deletion src/Umbraco.Web/Security/MembershipHelper.cs
Expand Up @@ -293,7 +293,6 @@ public IPublishedContent GetCurrentMember()
return null;
}
var result = GetCurrentPersistedMember();
var provider = MPE.GetMembersMembershipProvider();
return result == null ? null : new MemberPublishedContent(result).CreateModel();
}

Expand Down

0 comments on commit d2592bd

Please sign in to comment.