nacho10f
nacho10f

Reputation: 5886

Help with asp.net membership in mvc 3

I need two things that the Membership Provider I'm sure is capable of doing. Firstly I need to initially set users that have just registered to have a IsApproved value of False.

Obviously I also need an admin to be able to change that status to true.

Please help

Upvotes: 2

Views: 896

Answers (2)

santiagoIT
santiagoIT

Reputation: 9431

You don't need to create your custom provider. Just register the users manually using the MembershipProvider API.

public abstract MembershipUser MembershipProvider.CreateUser(
    string username,
    string password,
    string email,
    string passwordQuestion,
    string passwordAnswer,
    bool isApproved,
    Object providerUserKey,
    out MembershipCreateStatus status
)

MembershipUser has an IsApproved property. Your admins can use:

MembershipProvider.UpdateUser(MembershipUser);

to approve them.

Upvotes: 2

Nick DeVore
Nick DeVore

Reputation: 10176

I'm pretty sure it does not support that. You'd have to write your own custom provider to do that. Though, writing your own for SQL is not terribly complex and heavily documented in multiple places throughout the blogesphere.

Upvotes: 0

Related Questions