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  |  

DotNetNuke Marketplace
  Ads  
Webhost4Life - $4.95 Windows Hosting
 


  Sponsors  

Meet Our Sponsors

Jango Studios - Skins, Modules and Hosting for DotNetNuke
eUKhost.com is commited to offer exceptional UK Windows Web Hosting solutions with quality 24x7 technical support.Our plans support ASP.Net, ASP, ASP.NET Ajax extensions, XML, MSSQL, MySQL, PHP,DNN, multiple domains and Shared SSL as standard.
SmarterTools
The Official Microsoft ASP.NET Website
Portal Webhosting - Hosting For Developers
Red-Gate Software
 


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.

 


$7.16/mo - Powerful DotNetNuke / DNN Hosting
Powerful DotNetNuke / DNN Hosting on Windows 2008 and 2003 servers, starting at under $8/mo with FREE SQL 2008 on certain plans and FREE SQL 2005 on all plans with FREE Installation and expert support.
www.re-invent.com
ASP.NET Web Hosting for $3.95
3 Month FREE ASP.NET Hosting! FREE Setup! DNN Support! FREE Domain Name! FREE Components! Host multiple websites on 1 plan! 30 Days Money Back Guarantee!
www.dailyrazor.com
Cestus Websites
DotNetNuke websites en services in Nederland. Cestus Websites levert websites, projectmanagent, skins, modules, training en gespecialiseerde hosting op basis van het CMS DotNetNuke.
www.dotnetnuke-websites.nl

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