Hi all, All users from my websites had been permanently deleted, these users had a re-occuring payment via paypal. Each Payment would send a notification to the website, extending a expiry date for the subscription role on that user. The Unique identifier is the "UserID".
Once a user is deleted the UserID is gone. I can create a user via SQL scipt below - I then update DBO.profile, DBO.userprofile, DBO.Userportal,DBO.Userroles. - which shows the profile in DNN. But when I try to login to a user - i'm having password Issues. Any help is much appricated!!!!
SET IDENTITY_INSERT dbo.Users ON INSERT INTO dbo.Users (UserID, Username, FirstName, LastName, IsSuperUser, AffiliateId, Email, DisplayName, UpdatePassword, LastIPAddress, IsDeleted, CreatedByUserID, CreatedOnDate, LastModifiedByUserID, LastModifiedOnDate, PasswordResetToken, PasswordResetExpiration) VALUES ( 01, '[email protected]', 'name', 'name', 0, NULL, 'Email@email', 'Name', 0, NULL, 0, 1, NULL, 1, NULL, NULL, NULL);Go
SET IDENTITY_INSERT dbo.Users OFF GO
How do I set a password or send a password reset link for a user created via SQL? Is there another table i am missing?
Hi, this is not an easy task, anyway, it should be possible. A while ago I created an SQL script that generates 999 users for testing purposes (GitHub - MaiklT/GenerateDNNTestUsers: An SQL script to create 999 Test Users for DNN), have a look at it, it should give you the idea.
To create a password (I used the same for all users), you have to create a user the "normal" way and use the password hash and salt in the aspnet_membership table.
Don't forget to restart the application pool when you're done - and I would strongly recommend to try this in a testing environment (copy of your web site) before you do it in production. And always create a backup before you do it, in the testing environment as well as in the production environment.
Happy DNNing! Michael
The script is only meant for creating users in a testing environment, it is not an example of how to create a user using SQL (even if is doing exactly this). In a production environment you should use the API.
To create a custom registration form you can either follow the steps described here: Replacing Registration page with custom and blocking the default Register Page (dnnsoftware.com) or use a third-party module, eg Action Form - Custom DNN Forms | DNN Sharp.
These Forums are dedicated to the discussion of DNN Platform.
For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:
Awesome! Simply post in the forums using the link below and we'll get you started.