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


  Ads  
Active Modules -- Active Forums for DotNetNuke
 


  Sponsors  

Meet Our Sponsors

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
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.
 


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
172 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
29 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
2750 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.

 


AFUEGO!
Looking for Free DNN Hosting?
www.AFUEGO.com
Code 5 Systems, LLC.
The DNN Missing Link: A Form Module. Form Master 1.6 is an intuitive Form Creation Module at a great price. Quality Custom Module development, and DNN consulting services.
www.code5systems.com
SSL Enabled and Amazingly FAST...
SSL enable your DNN web site with SSLRedirect, compress your DNN web site HTTP data flow by up to 75%-90% with HttpCompressionAgent, and monitor your DNN web site's performance with WebKeepAlive...
www.sanibellogic.com

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