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  
Webhost4Life - $4.95 Windows Hosting
 


  Sponsors  

Meet Our Sponsors

SourceGear - Tools for Developers
.: CounterSoft :.
telerik
ExactTarget email software solutions
Merak Mail Server
FCKeditor Project
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Create User Programmatically in 4.7
Previous Previous
 
Next Next
New Post 2/27/2008 10:05 AM
User is offline Carlos Rodriguez
490 posts
www.almacigo.com
8th Ranked


Create User Programmatically in 4.7 

I need to create users in a module I'm doing in 4.7.  I have seen code posted here but it is not working for me, lots of missing objects and I cannot figure out what is going on. 

Is anybody creating users with their own code in DNN 4.7???  Would you share the code?

Thanks.

Carlos

 

 
New Post 2/27/2008 10:14 AM
User is offline mpdan
28 posts
10th Ranked


Re: Create User Programmatically in 4.7 

If you download the source code package, you can see precisely how it works.  

The code you're looking to use is in the library/components/users folder.

There's a Shared method named CreateUser(ByRef objUser As UserInfo)

So... create your UserInfo object (also in the same folder) and call UserController.CreateUser(userInfoObject)

 

 
New Post 2/27/2008 6:47 PM
User is offline Carlos Rodriguez
490 posts
www.almacigo.com
8th Ranked


Re: Create User Programmatically in 4.7 

Yes I know, I tried looking at the source code but it is so modularized and complex, that my setup was not working properly and some classes were not working right so I could not follow and see how they are defined.  And to be honest, I cannot dedicate the time at the moment to go through the whole thing, I'm looking for help because of that exact reason.

Thanks anyway.

Carlos

 

 
New Post 2/28/2008 4:28 AM
User is offline Michael Washington
2535 posts
ADefWebserver.com
5th Ranked










Re: Create User Programmatically in 4.7 

see:

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

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
 
New Post 2/28/2008 4:56 AM
User is offline Carlos Rodriguez
490 posts
www.almacigo.com
8th Ranked


Re: Create User Programmatically in 4.7 

Michael:

Thanks once more for your help.  I will give that code a try later today, from what I have seen that may be all I need.

By the way, the reason I want to do this, and this need has been presented here before, is to allow a non DNN Admin to create user accounts for the specific application  I'm doing (the DNN module).  Maybe this could be a built-in role in the future, Accounts Admin without the privilege to modify anything in the site.  Also, and this is part of my module design, I added a boolean field to the Users table as a flag to my module to see what accounts were created from the module's Accounts Admin.  In that way the Application Admin can only modify accounts created from within the module.

Thanks again.

Carlos

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Create User Programmatically in 4.7
 


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.

 


DotNetNuke® in Sweden
All service of DotNetNuke® in Sweden.
Olsmar Konsult
Overlook Technology
Website Development, DotNetNuke Consulting, Module Development, Portal Management
OverlookTechnology.com
DeutschNetNuke = DotNetNuke in German
DeutschNetNuke provides all DotNetNuke related services in German (and English).
www.DeutschNetNuke.de

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