ok thanks
here is what i'm trying to do. correct me if i'm worng.
I am authenticating users through an API, if they are a valid user, then i want to call your routine that creates the new user. then log then in DNN as that new user
So i want to place this code in the login in module right above where DNN authenticates users?
here is my code this not working i dont know what i'm doing wrong.
Dim oUser = New UserInfo()
oUser.PortalID = Me.PortalId
oUser.IsSuperUser = False
oUser.FirstName = "FirstName"
oUser.LastName = "LastName"
oUser.Email = "test@test.com"
oUser.Username = "MyUsername"
oUser.DisplayName = "FirstName LastName"
'Fill MINIMUM Profile Items (KEY PIECE)
oUser.Profile.PreferredLocale = PortalSettings.DefaultLanguage
oUser.Profile.TimeZone = PortalSettings.TimeZoneOffset
oUser.Profile.FirstName = oUser.FirstName
oUser.Profile.LastName = oUser.LastName
'//'Set Membership
Dim oNewMembership = New UserMembership()
oNewMembership.Approved = True
oNewMembership.CreatedDate = System.DateTime.Now
oNewMembership.Email = oUser.Email
oNewMembership.IsOnLine = False
oNewMembership.Username = oUser.Username
oNewMembership.Password = "test"
'//Bind membership to user
oUser.Membership = oNewMembership
UserController.CreateUser(oUser)
Response.Write(UserController.CreateUser(oUser))
'//Add the user, ensure it was successful
'if UserCreateStatus.Success == UserControfller.CreateUser(ref oUser) then
If UserCreateStatus.Success = UserController.CreateUser(oUser) Then
Response.Write(UserController.CreateUser(oUser))
End If