Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • bob baty-barr 1180 posts 1294 karma points MVP
    Apr 12, 2012 @ 21:33
    bob baty-barr
    0

    Contour with Member tools saving two usernames and two passwords

    Not sure why this is happening, but when contour saves the data with the memberLogin fields and compare textbox it puts a comma delimited list of two identical memberLogins and passwords... and subsequently fails on creating the member...

    any thoughts?

  • Josh Reid 182 posts 257 karma points
    Jun 10, 2012 @ 01:56
    Josh Reid
    0

    I had the same problem here! The member wasn't being saved if i entered the same email as an existing member, even though I was using username as the unique value and there was 2 entries for each of the password and username being entered...

    I grabbed the source and edited the file: SaveAsUmbracoMember.cs

     if (mt != null)
    {

                    Member m = Member.MakeNew(nameMapping, loginMapping, emailMapping, mt, new umbraco.BusinessLogic.User(0));
                    m.Password = passwordMapping;

    ...

    Became...

     if (mt != null && Membership.FindUsersByName(nameMapping).Count == 0)
    {

                    Member m = Member.MakeNew(nameMapping, mt, new umbraco.BusinessLogic.User(0));

                    m.LoginName = loginMapping;
                    m.Password = passwordMapping;
                    m.Email = emailMapping;

    ...

    This has solved the issue for me, though I'm not 100% sure why. I also added a catch by counting the Membership.FindUsersByName(nameMapping) to ensure no double ups.

    Also while on it VS gives warnings that the Member.MakeNew method is obsolete, but if I create the member with: 

    MembershipUser mu = Membership.CreateUser(loginMapping,passwordMapping);

    How do I then get this new member as a umbraco.cms.businesslogic.member.Member to set the GenericProperties ?

    Any thoughts?

Please Sign in or register to post replies

Write your reply to:

Draft