Hi I have created my own registration module which works fine when I link to the hosted site directly. The issue I have is that my client owns the domain name the site will use. They have redelegated the domain to point to my hosted site. When I try to use the redelegated domain name, my registration module creates new users ok and reports that the user has logged in successfully. When I try to redirect the user with either Navigateurl or Applicationurl the redirection send me to the login page with no indication that the user is logged in.
Here is the code that is running. Any hints on where to look since the site is now live my client is not happy.
Private Sub createuser()
Dim user As UserInfo = New UserInfo()
user.Username =
Me.txtuserID.Value
user.PortalID = PortalSettings.PortalId
user.FirstName =
Me.FirstName.Value
user.LastName =
Me.LastName.Value
user.Membership.Username =
Me.txtuserID.Value
user.Membership.UpdatePassword =
False
user.Membership.Password =
Me.password.Value
user.Membership.Approved = isValidPromoCode()
user.IsSuperUser =
False
user.Email =
Me.email.Value
user.DisplayName =
Me.FirstName.Value + " " + Me.LastName.Value
user.Profile.Unit =
Me.unit.Value
user.Profile.Street =
Me.street.Value
user.Profile.City =
Me.city.Value
user.Profile.Region = State.SelectedValue
user.Profile.PostalCode =
Me.Postcode.Value
If Request.IsAuthenticated Then
DotNetNuke.Security.Membership.MembershipProvider.Instance().UpdateUser(user)
Else
Dim UserCreateStatus As DotNetNuke.Security.Membership.UserCreateStatus = Security.Membership.MembershipProvider.Instance().CreateUser(user)
If RespondtoCreateuserstatus(UserCreateStatus) Then
Exit Sub
End If
'validate username/password combination
Dim myUser As DotNetNuke.Entities.Users.UserInfo = New DotNetNuke.Entities.Users.UserInfo()
Dim userLoginStatus As DotNetNuke.Security.Membership.UserLoginStatus = New DotNetNuke.Security.Membership.UserLoginStatus()
myUser = DotNetNuke.Entities.Users.UserController.ValidateUser(PortalSettings.PortalId, user.Username, user.Membership.Password,
"", "", "", userLoginStatus)
If (userLoginStatus = DotNetNuke.Security.Membership.UserLoginStatus.LOGIN_SUCCESS Or _
userLoginStatus = DotNetNuke.Security.Membership.UserLoginStatus.LOGIN_SUPERUSER
Or _
userLoginStatus = DotNetNuke.Security.Membership.UserLoginStatus.LOGIN_USERNOTAPPROVED)
Then
DotNetNuke.Entities.Users.UserController.UserLogin(PortalId, myUser,
"", "", False)
Dim roleprovider As DotNetNuke.Security.Membership.DNNRoleProvider = New DotNetNuke.Security.Membership.DNNRoleProvider
Dim objRoleController As DotNetNuke.Security.Roles.RoleController
objRoleController =
New DotNetNuke.Security.Roles.RoleController
objRoleController.AddUserRole(PortalId, myUser.UserID, GetRoleID(), Null.NullDate, Null.NullDate)
If userLoginStatus = DotNetNuke.Security.Membership.UserLoginStatus.LOGIN_USERNOTAPPROVED Then
Response.Redirect(ApplicationURL(GetRedirect(
False)), True)
Else
Response.Redirect(ApplicationURL(GetRedirect(
True)), True)
End If
End If
End If
End Sub