Manually activate user account in asp.net

I have a (difficult to work) client who created an account on our website, however he cannot log in because he has not yet clicked on the account activation link. for some reason he doesn’t want to click it (he thinks about his virus)

In any case, I want to manually configure the account to activate through the database .. how to do it? thank!

(I mean, which fields need to be changed to which values?)

+3
source share
4 answers

Can you temporarily assign your own account address and resend the activation URL? Perhaps he can forward you mail, and you can click on the link. Think it's easier than hacking your way into a membership provider.

Also calling your client dumb is not a very good way to deal with your customers;)

+1
source

I took a few steps around the aspnet membership table and found out how to activate an account manually!

update aspnetdb.dbo.aspnet_Membership set IsApproved = 1 where UserId = (select UserId From aspnetdb.dbo.aspnet_Users where UserName = @Username)

userid is ridiculously long, so it was easier for me to select it from the username from the users table.

+4
source

MemberhipProvider.

        Membership.GetUser().UnlockUser();
        Membership.GetUser().IsApproved = true;
+4

I had the same problem recently, and I found that when you make a call Membership.CreateUser, you can make the user automatically create as true by inserting it like this:

Membership.CreateUser(userName, Password, eMail, passwordQuestion, passwordAnswer, isApproved)

isApproved is a bool and can be set to true when the create user is called.

+2
source

Source: https://habr.com/ru/post/1752421/


All Articles