Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

AspDotNetStoreFront
  Ads  
r2i.ntegrated
 


  Sponsors  

Meet Our Sponsors

Salaro -- Skins and more
OnyakTech
The best choice for your web site host, email hosting, and domain registration.
CrystalTech Web Hosting™
Webhost4life, specialists in DNN hosting
Mad Development is a full service interactive agency focusing on the merge of design, technology, e-commerce, and affiliate marketing by providing total website solutions.
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Avoid Duplicate UserIDs
Previous Previous
 
Next Next
New Post 9/3/2008 8:41 AM
User is offline andym
9 posts
10th Ranked


Avoid Duplicate UserIDs 

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 10:02 AM
User is offline Fooberichu
467 posts
www.seeleyware.com
8th Ranked


Re: Avoid Duplicate UserIDs 

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?


-- Fooberichu
http://www.seeleyware.com
 
New Post 9/3/2008 11:03 AM
User is offline andym
9 posts
10th Ranked


Re: Avoid Duplicate UserIDs 

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 Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Avoid Duplicate UserIDs
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


MaximumASP
MaximumASP provides a wide array of web hosting plans to fit any hosting need. We also provide software and services needed to keep it running optimally.
MaximumASP.com
Mad Development: dotnetnuke design and development
We are an expert Dotnetnuke shop specializing in developing solutions that merge the requirements of design and branding, content management, ecommerce, search engine optimization and business logic.
www.MadDevelopment.com
telerik
telerik r.a.d.controls suite is the most innovative and comprehensive toolset for ASP.NET development, tailored for seamless integration with the DotNetNuke project. This integrated collection of controls allows professionals to build web-solutions with the UI richness and responsiveness of desktop applications.
dnn.telerik.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP