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
    Oct 19, 2009 @ 02:16
    Mark Olbert
    0

    Bug in Implementation of CreateUser?

    When I call Membership.CreateUser(...) and specify "false" for the "is approved" argument the created user is still showing up as having been created in an approved state.

    Is this a bug in Umbraco, or a feature in ASP.NET :) ?

    - Mark

  • skiltz 501 posts 701 karma points
    Oct 19, 2009 @ 02:49
    skiltz
    0

    When I create a new member I use the following method.

    Member newMember = Member.MakeNew("MyNewUserName"

    , mt, new umbraco.BusinessLogic.User(0));

  • Mark Olbert 87 posts 117 karma points
    Oct 19, 2009 @ 03:25
    Mark Olbert
    0

    But how then do you create the user as not approved? I need to do that so I can add an email verification step to the enrollment process.

    - Mark

  • skiltz 501 posts 701 karma points
    Oct 19, 2009 @ 03:35
    skiltz
    0

    To be honest I've never used that property in the Asp.net Membership provider before so I'm not excatly sure how it works. 

    But I have done this kinda of thing with Umbraco before.  I create a property on the MemberType called "MemberApproved" with a datatype of true/false.  When the user registers I set this to false. 

    When the user logins I then check its true. If not send them to a Not Approved page and signout the member.

    I'm guessing the ASP.net Membership way might be the better way to go, but I'm not familiar with it.

    Thanks,

  • Mark Olbert 87 posts 117 karma points
    Oct 19, 2009 @ 05:32
    Mark Olbert
    0

    You know, that's the way every example I could find via google does it...even though the ASP.NET MembershipProvider CreateUser() function is >>supposed<< to be able to create an "unapproved" user :). Apparently it either has a bug that keeps it from working, or the "unapproved" argument really isn't what I think it's supposed to be.

    Anyway, I'm going to give up and implement the approach you described.

    - Mark

  • skiltz 501 posts 701 karma points
    Oct 19, 2009 @ 08:17
    skiltz
    0

    If you don't feel like rolling your own I built a project called osMemberControl which can be download at osmembercontrols.codeplex.com or just steal the bits you need.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies