Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Avoid Duplicate UserIDsAvoid Duplicate UserIDs
Previous
 
Next
New Post
9/3/2008 10:41 AM
 

I have a custom module where a user can create their own sub users to login and have limited access to their portal.  I have it working well, except I need to handle the case of duplicate userIDs for example the user 'andy' already exists so if a user tries to create a sub user also called 'andy' I get an error along the lines of Conflict in table "dbo.Users", column 'UserID'. The statement has been terminated.  Does DNN have a built in feature to catch this, if not I can build my own.

 
New Post
9/3/2008 12:02 PM
 

That is interesting that you are receiving that error at all because UserID is an autogenerated integer for all users in the portal. I'm guessing your error is actually something different (maybe about the unique constraint on the "username" column)?

One thing DNN does that *should* catch for you (assuming you aren't trying to manually created the user yourself direct in the database but rather, you are using the DotNetNuke.Entities.Users.UserController methods) is return a DotNetNuke.Security.Membership.UserCreateStatus enum which has, among the many values, a DuplicateUserName value.  This returns when using the UserController.CreateUser(ref userInfo) method.

So the question becomes how are you creating your users?  Are you using the providing functionality in the framework or are you skirting that and using your own methods?


-- Jon Seeley
DotNetNuke Modules
Custom DotNetNuke and .NET Development
http://www.seeleyware.com
 
New Post
9/3/2008 1:03 PM
 

I am using Dim userCreateStatus As DotNetNuke.Security.Membership.UserCreateStatus = DotNetNuke.Security.Membership.UserCreateStatus.AddUser  Dim objNewUser As New UserInfo, and then passing a number of textboxes to the objNewUser, and finally userCreateStatus = UserController.CreateUser(objNewUser) then I return the UserID and send them an email and put them in the appropriate roll. 

It seems to work unless I put a username in that I know already exists, then I get the UserID conflict, but I do have an additional custom security table granting acces to different portions of the portal, so that may also be causing trouble.

does DNN have anything that automatically suggests an alternate login for a user so if I entered "andy" it might suggest "andy2" or other avaiable usernames?  I already wrote a custom if statement that checks the Users table and prompts the user to try again, but I would prefer to not frustrate my users by asking them to try again several times before they get an username that is not taken.

Thanks for the help.

 

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Avoid Duplicate UserIDsAvoid Duplicate UserIDs


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

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

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. 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.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out