1

I have tried solutions like here How do you update the aspnetdb membership IsApproved value? But it still doesn't work for me. isAprproved always passes true for new member.

I am creating a member here:

MembershipUser member = Membership.Providers[providerAlias].CreateUser("aaa", password, email, null, null, false, null, out newStatus);
            Member.ChangeUsername("aaa", email);
            member.IsApproved = false;
            Membership.UpdateUser(member);

but still my new member can login. I am not using CreateUserWizard because I had lots of problems with it.

I have my own registration form and create a member, then log him automatically to update the profile with the input values and log out. I;m not sure it makes any difference - some posts suggested it does but I need to login the member to save his profile data, don't I?

Also, even if I deliberately change isApproved for existing member:

    MembershipUser user = Membership.GetUser(_currentProfile.UserName);
    if (user != null)
    {
        user.IsApproved = false;
        Membership.UpdateUser(user);

        Response.Write(user.IsApproved.ToString());
    }

it also doesn't change and stays always true.

How can I update isApproved property so my member cannot login until his registration is validated by an admin?

I am using Umbraco 6.

Thank you

Community
  • 1
  • 1
nickornotto
  • 1,946
  • 4
  • 36
  • 68

1 Answers1

0

Ok, resolved based on this article: http://umbraco.miketaylor.eu/2010/08/29/authenticating-new-members-part-2/

I didn't know I need to set isApproved property in member type or in web.config Now it's working fine

nickornotto
  • 1,946
  • 4
  • 36
  • 68
  • See also my comment here: http://stackoverflow.com/questions/17568681/approve-user-umbraco-membership-system/17588880#17588880 – nickornotto Jan 06 '14 at 17:01