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 :) ?
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.
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.
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.
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
When I create a new member I use the following method.
Member newMember = Member.MakeNew("MyNewUserName"
, mt, new umbraco.BusinessLogic.User(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
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,
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
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.
is working on a reply...