DNN Forums

Ask questions about your website to get help learning DNN and help resolve issues.

Adding Users when you are not a Superuser

 5 Replies
 2 Subscribed to this topic
 37 Subscribed to this forum
Sort:
Author
Messages
New Around Here
Posts: 26
New Around Here

Hi

There used to be an excellent module on the DNN Store that allowed you to bulk upload users, which was very useful when you did not want to give full admin rights to a user

This module is no longer available and the previous version does not work with V9 and above.

I've used SQL profiler to find find the Stored Procedures that run when a user is manually added, but there is obviously something going on behind the scenes e.g.

declare @p12 uniqueidentifier
set @p12='EC9D3AD1-FB87-4B7A-AD03-CB37A1917C39'
exec dbo.aspnet_Membership_CreateUser @ApplicationName=N'DotNetNuke',@UserName=N'TestOne',@Password=N'jCWRjKtHvfNjpp0hoFTvP7ctT38=',@PasswordSalt=N'7QUNgLy6Ttyqm3d++aSUeQ==',@Email=N'[email protected]',@PasswordQuestion=NULL,@PasswordAnswer=NULL,@IsApproved=1,@UniqueEmail=0,@PasswordFormat=1,@CurrentTimeUtc='2021-11-07 15:56:40',@UserId=@p12 output
select @p12
exec sp_executesql N';Exec dbo.AddUser @0, @1, @2, @3, @4, @5, @6, @7, @8, @9, @10',N'@0 int,@1 nvarchar(4000),@2 nvarchar(4000),@3 nvarchar(4000),@4 nvarchar(4000),@5 int,@6 nvarchar(4000),@7 nvarchar(4000),@8 int,@9 int,@10 int',@0=0,@1=N'TestOne',@2=N'Test',@3=N'One',@4=NULL,@5=0,@6=N'[email protected]',@7=N'Test One',@8=0,@9=1,@10=1
exec sp_executesql N';Exec dbo.UpdateUserProfileProperty @0, @1, @2, @3, @4, @5, @6',N'@0 nvarchar(4000),@1 int,@2 int,@3 nvarchar(4000),@4 int,@5 nvarchar(4000),@6 datetime',@0=NULL,@1=2,@2=23,@3=N'Test',@4=0,@5=N'',@6='2021-11-07 15:56:40.557'

Does anyone know where I can find the documentation to tell me about this.

If I can  get this information I believe I will be able to allow a Role based site user to Add new Users

This could be via a form (I use DataSprings Dynamic Forms - many other good alternatives exist) or I could allow the upload of a CSV file.

Thanks in advance

Dave

 

 

Veteran Member
Posts: 1182
Veteran Member
MVP
MVP
You're an MVP!

I created a script for generating 999 Test Users in DNN a while ago - it is available here: MaiklT/GenerateDNNTestUsers: An SQL script to create 999 Test Users for DNN (github.com). This should give you the idea what's going on behind the scenes...

Happy DNNing!
Michael

Michael Tobisch
DNN★MVP

DNN Connect
Veteran Member
Posts: 838
Veteran Member
3 Helpful Replier
Helpful Replier
Thanks for being such a helpful replier!
New Poster
New Poster
Congrats on posting!
Hi Dave

I always use a form for this. The action onSubmit is 'add user' and/or 'grant role'.
ActionForm (DNN Sharp) supports this (might need an add on) and I think Live Forms (Mandeeps) supports this as well. ActionForm has more options but Live Forms has a better price point and is easier to the eye (better UX).
Senior Member
Posts: 1607
Senior Member
MVP
MVP
You're an MVP!
New Poster
New Poster
Congrats on posting!

Yeah... Only administrators and superusers can add new users by default. 

Otherwise, you have to use another third-party or custom extension to do that.  I'd always suggest avoiding using a SQL script directly.  Unless you're very familiar with what does and doesn't happen under the covers in DNN, you may be missing steps that the server-side API is doing in addition to the one thing you intended to happen.  

In the meantime, Mandeeps has a User Management module that has this feature available.  

New Around Here
Posts: 26
New Around Here
Thank you to everyone for your responses I will investigate and provide feedback :-)
New Around Here
Posts: 26
New Around Here

Hi Michael

Just had a very quick look at your script. I believe what you have has given me sufficient information to generate a solution.

My thoughts are this

Create a Stored Procedure that Adds say 10 new users to my Portal. Trigger that through the standard Reports module. I can then use a Form type module (Datasprings Dynamic or Action Forms there are many excellent ones out there) to provide my Site "controller" to change the username and Display names to "add" their own users.

I'll share my solution with you when produced.

Dave

 

 

These Forums are for the discussion of the open source CMS DNN platform and ecosystem.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. If you have (suspected) security issues, please DO NOT post them in the forums but instead follow the official DNN security policy
  2. No Advertising. This includes the promotion of commercial and non-commercial products or services which are not directly related to DNN.
  3. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  4. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  5. No Flaming or Trolling.
  6. No Profanity, Racism, or Prejudice.
  7. Site Moderators have the final word on approving / removing a thread or post or comment.
  8. English language posting only, please.

Would you like to help us?

Awesome! Simply post in the forums using the link below and we'll get you started.

Get Involved