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
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
Aspose - The .NET & Java component publisher
 


  Sponsors  

Meet Our Sponsors

AspDotNetStoreFront - E-Commerce by Design - The Leading ASP.NET shopping cart platform for developers!
Click here to go to dev.live.com for Windows Live developer resources
SteadyRain
DataSprings - Great Ideas. Always Flowing.
R2integrated - formerly bi4ce
Jango Studios - Skins, Modules and Hosting for DotNetNuke
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Create new user account with API
Previous Previous
 
Next Next
New Post 7/4/2008 7:17 PM
Unresolved
User is offline TillmanZ
38 posts
10th Ranked


Create new user account with API 

Hi there,

I need to create user accounts with certain group-memberships from within my module.

Is there a way to do this via the API or do I have to "hack" this directly into the database?

 

Best regards,

Tillman

 
New Post 7/5/2008 3:07 PM
User is offline Baatezu
164 posts
9th Ranked


Re: Create new user account with API 

Quick Answer:
DotNetNuke.Entities.Users
DotNetNuke.Security.Roles
Slightly Longer Answer
Fill a UserInfo object
Use UserController.CreateUser(your filled userinfo object)
Get Role information with a RoleInfo object and Add/Delete roles to users with a RoleController object.

 

I hope that helps point you in the right direction.

 
New Post 7/5/2008 7:28 PM
User is offline TillmanZ
38 posts
10th Ranked


Re: Create new user account with API 

Great! That sounds exactly like what I need.

Cheers,

 

Tillman

 
New Post 7/6/2008 1:09 PM
User is offline Vlado
28 posts
10th Ranked


Re: Create new user account with API 

 Baatezu wrote

Quick Answer:
DotNetNuke.Entities.Users
DotNetNuke.Security.Roles
Slightly Longer Answer
Fill a UserInfo object
Use UserController.CreateUser(your filled userinfo object)
Get Role information with a RoleInfo object and Add/Delete roles to users with a RoleController object.

I tried that with following code:

 

        Dim objUser As UserInfo = New UserInfo()
        objUser.FirstName = "test"
        objUser.LastName = "Tester"
        objUser.Username = "Tester"
        objUser.Email = "tester@domain.com"
 
        Dim st As UserCreateStatus
        st = UserController.CreateUser(objUser)

but got

st = “InvalidPassword”

I do not see the way how to assign the password to objUser. Could somebody please submit a bit of code?
Thanks

Vlado
 
New Post 7/6/2008 1:22 PM
User is offline Michael Washington
2641 posts
ADefWebserver.com
5th Ranked










Re: Create new user account with API 

see:

http://www.codeplex.com/IWeb/SourceControl/FileView.aspx?itemId=6339&changeSetId=10644

Dim oUserInfo As New UserInfo()
            oUserInfo.PortalID = IWebCredentials.PortalID
            oUserInfo.Membership.Username = NewUsername
            oUserInfo.Username = NewUsername
            oUserInfo.FirstName = FirstName
            oUserInfo.LastName = LastName
            oUserInfo.DisplayName = DisplayName
            oUserInfo.Membership.Email = email
            oUserInfo.Email = email
            oUserInfo.Membership.Approved = True
            oUserInfo.AffiliateID = Null.NullInteger
            oUserInfo.Membership.Password = Newpassword

            Dim objUserCreateStatus As Security.Membership.UserCreateStatus = IWebUser.CreateUser(oUserInfo)

            If objUserCreateStatus = Security.Membership.UserCreateStatus.Success Then
                objResponse = "Success"
            Else
                objResponse = [String].format("Error: {0}", objUserCreateStatus.ToString())
            End If



Michael Washington
* ADefWebserver.com
* DNN Module Developer's Guide
* IWEB - DNN Web Services
* Silverlight and DotNetNuke
 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Create new user account with API
 


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.

 


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
CrystalTech
CrystalTech Web Hosting™ provides first-class service and support. Our value-packed ASP.NET plans offer DNN installation, SQL 2005 and up to 100 domain names starting at only $16.95 per month!
CrystalTech.com

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