Changes LoginStatusModel to use the correct api and updates the new membership provider stuff to ensure that the provideruserkey is the int id of the model for backwards compatibility.

This commit is contained in:
Shannon
2014-01-28 16:13:05 +11:00
parent e4e76eb0bf
commit 28d8fd0531
3 changed files with 13 additions and 9 deletions

View File

@@ -25,7 +25,7 @@ namespace Umbraco.Core.Persistence.Factories
CreateDate = dto.CreateDate,
UpdateDate = dto.UpdateDate,
Name = dto.Text,
ProviderUserKey = dto.UniqueId.Value,
ProviderUserKey = dto.NodeId,
Trashed = dto.Trashed,
Key = dto.UniqueId.Value,
CreatorId = dto.UserId.HasValue ? dto.UserId.Value : 0,

View File

@@ -625,7 +625,7 @@ namespace Umbraco.Core.Services
throw new ArgumentException(string.Format("No MemberType matching the passed in Alias: '{0}' was found", memberTypeAlias));
}
return CreateMemberWithIdentity(email, username, password, memberType, raiseEvents);
return CreateMemberWithIdentity(username, email, password, memberType, raiseEvents);
}
/// <summary>

View File

@@ -1,4 +1,6 @@
using umbraco.cms.businesslogic.member;
using System.Web;
using umbraco.cms.businesslogic.member;
using Umbraco.Core;
namespace Umbraco.Web.Models
{
@@ -6,17 +8,19 @@ namespace Umbraco.Web.Models
{
public LoginStatusModel()
{
//TODO Use new Member API
if (Member.IsLoggedOn())
if (HttpContext.Current != null
&& HttpContext.Current.User != null
&& HttpContext.Current.User.Identity.IsAuthenticated)
{
var member = Member.GetCurrentMember();
var member = ApplicationContext.Current.Services.MemberService.GetByUsername(
HttpContext.Current.User.Identity.Name);
if (member != null)
{
this.Name = member.Text;
this.Username = member.LoginName;
this.Name = member.Name;
this.Username = member.Username;
this.Email = member.Email;
this.IsLoggedIn = true;
}
}
}
}