Copied to clipboard

Flag this post as spam?

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


  • Mark Olbert 87 posts 117 karma points
    Dec 15, 2009 @ 06:17
    Mark Olbert
    0

    Duplicate Member, but not showing in Backoffice Member View

    I seem to have created a phantom member on my development site.

    I'm using the built-in membership provider that comes with 4.0. The way I normally create a new member is by doing something like this:

      MembershipCreateStatus status = MembershipCreateStatus.Success;
      MembershipUser memUser = Membership.CreateUser(email, password, email, question, answer, false, null, out status);

      if( status != MembershipCreateStatus.Success ) [ end page processing and notify user ]

      Member newMember = Member.GetMemberFromLoginNameAndPassword(email, password);

    So basically I just use the .NET membership interface, relying on Umbraco to take care of everything in the background.

    This has worked fine (and still is, for that matter). But at some point I created a user that exists so far as Membership.CreateUser() is concerned -- it returns a "duplicate user name" error -- but isn't visible in the backoffice membership view.

    Has anyone else run into this and resolved it? If not, does anyone know which table Umbraco stores the username info in?

    - Mark

  • Mark Olbert 87 posts 117 karma points
    Dec 15, 2009 @ 06:31
    Mark Olbert
    0

    Some additional information...

    A routine I wrote to allow members to change their user name apparently caused the problem. For example, if I create a user with the username "[email protected]" and then run the following code:

                    MembershipUser ASPMember = Membership.GetUser();

                    ASPMember.Email = "[email protected]";
                    Membership.UpdateUser(ASPMember);

                    Member UmbracoMember = Member.GetCurrentMember();
                    UmbracoMember.Email = "[email protected]";
                    UmbracoMember.LoginName = "[email protected]";

                    // have to set this so that UmbracoMember can find the entry
                    // under the new name
                    CurrentUserEmail = "[email protected]";

                    UmbracoMember.Text = "[email protected]";

                    UmbracoMember.Save();

    you end up with a phantom user "[email protected]".

    Perhaps changing the username is not supported by the underlying .NET Membership API? Or is there another field I need to change, too?

    - Mark

Please Sign in or register to post replies

Write your reply to:

Draft