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  |  

The best choice for your web site host, email hosting, and domain registration.
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
Active Modules -- Active Forums for DotNetNuke
 


  Sponsors  

Meet Our Sponsors

.: CounterSoft :.
telerik
ExactTarget email software solutions
Merak Mail Server
WebSecureStores -- ASP.NET & DotNetNuke Hosting Solutions
FCKeditor Project
 


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
Online now... 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
27 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.

 


Ultra Media Gallery & Video Gallery
The most popular photo gallery and video gallery module. with Flash interface.
www.bizmodules.net
WDK Solutions
Quality modules for the DotNetNuke community. Check out our 'wild' modules!
wdkns.com
UK - DotNetNuke providers
UK providers of DNN module development and skin package design. Oxford Information Labs provides cost-effective solutions for businesses and organisations specialising in Skin design and bespoke module development.
www.oxil.co.uk

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