You need to Register for free and Login to post a message in the forum.

Forum

Validation Failed
Last Post 2008-07-30 02:36 PM by Joseph Craig. 11 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
UmaUser is Offline
Nuke Active Member
Nuke Active Member
Posts:27

--
2008-07-29 02:05 PM  

Hi,

I am registering an user thru coding

Code Sample:

NewUser.Username = txtEmail.Text
NewUser.Membership.Password = UserController.GeneratePassword()
Dim createStatus As UserCreateStatus = UserController.CreateUser(NewUser)

User is also registered properly. I  have verified the database also.

If I try to logon with this username and password, I am getting the error message as "Login Failed." (Validateuser function is returning false)

Can you let me know a way to solve this?

Thanks,
Uma

Joseph CraigUser is Offline
DNN Creative Support
Nuke Master VI
Nuke Master VI
Posts:9001
Avatar

--
2008-07-29 02:12 PM  
Here is a chunk of code I found in a blog posting by John Mitchell:

            Dim oUserInfo As New UserInfo
                oUserInfo.PortalID = 0
                oUserInfo.Membership.Username = GetXmlItemValue(xmlItem, "Username")
                oUserInfo.Username = GetXmlItemValue(xmlItem, "Username")
                oUserInfo.Profile.FirstName = GetXmlItemValue(xmlItem, "FirstName")
                oUserInfo.FirstName = GetXmlItemValue(xmlItem, "FirstName")
                oUserInfo.Profile.LastName = GetXmlItemValue(xmlItem, "LastName")
                oUserInfo.LastName = GetXmlItemValue(xmlItem, "LastName")
                oUserInfo.Profile.Unit = GetXmlItemValue(xmlItem, "Unit")
                oUserInfo.Profile.Street = GetXmlItemValue(xmlItem, "Street")
                oUserInfo.Profile.City = GetXmlItemValue(xmlItem, "City")
                oUserInfo.Profile.Region = GetXmlItemValue(xmlItem, "Region")
                oUserInfo.Profile.PostalCode = GetXmlItemValue(xmlItem, "PostalCode")
                oUserInfo.Profile.Country = GetXmlItemValue(xmlItem, "Country")
                oUserInfo.Profile.Telephone = GetXmlItemValue(xmlItem, "Telephone")
                oUserInfo.Membership.Email = GetXmlItemValue(xmlItem, "Email")
                oUserInfo.Email = GetXmlItemValue(xmlItem, "Email")
                oUserInfo.Membership.Approved = True
                oUserInfo.AffiliateID = Null.NullInteger
                oUserInfo.Membership.Password = GetXmlItemValue(xmlItem, "Password")
                Dim createStatus As UserCreateStatus = UserController.CreateUser(oUserInfo)
                If createStatus = UserCreateStatus.Success Then
                    responseBuilder.Append(String.Format("User '{0}' created successfully", oUserInfo.Username))
                Else
                    responseBuilder.Append(String.Format("User '{0}' creation failed: {1}", oUserInfo.Username, [Enum].GetName(GetType(UserCreateStatus), createStatus)))
                End If

Perhaps thinks like PortalID, Email, AffiliateID are necessary ...

Joe Craig, DNN Creative Support

Subscribe to DNNCreative
I recommend PowerDNN for DotNetNuke Hosting.
UmaUser is Offline
Nuke Active Member
Nuke Active Member
Posts:27

--
2008-07-29 02:18 PM  
Joe,

Thanks for your reply.

As like the sample code, I am also passing all the mandatory fields and user is also created succesfully. But when I attempt to login with this  username and system genrated password, I get the error "Login failed"

Please advice

Uma.
Joseph CraigUser is Offline
DNN Creative Support
Nuke Master VI
Nuke Master VI
Posts:9001
Avatar

--
2008-07-29 02:20 PM  
Have you tried using the "Forgot Password" link and using the password that is sent to you?

Joe Craig, DNN Creative Support

Subscribe to DNNCreative
I recommend PowerDNN for DotNetNuke Hosting.
UmaUser is Offline
Nuke Active Member
Nuke Active Member
Posts:27

--
2008-07-29 02:39 PM  
Yes. I tried forgot password also. Still login fails.
Joseph CraigUser is Offline
DNN Creative Support
Nuke Master VI
Nuke Master VI
Posts:9001
Avatar

--
2008-07-29 02:43 PM  
Are you able to login with the Host and Admin accounts?

Joe Craig, DNN Creative Support

Subscribe to DNNCreative
I recommend PowerDNN for DotNetNuke Hosting.
UmaUser is Offline
Nuke Active Member
Nuke Active Member
Posts:27

--
2008-07-29 02:47 PM  
I am able to login as host and all the registered users logins are working fine.

The only thing is that the user created thru coding is not logging in.
Joseph CraigUser is Offline
DNN Creative Support
Nuke Master VI
Nuke Master VI
Posts:9001
Avatar

--
2008-07-29 02:57 PM  
OK, then the problem is in your code that creates the user ... obviously!

If you want to post the entire snippet of code, do that or attach a file. It's hard to debug without being able to see everything.

Joe Craig, DNN Creative Support

Subscribe to DNNCreative
I recommend PowerDNN for DotNetNuke Hosting.
UmaUser is Offline
Nuke Active Member
Nuke Active Member
Posts:27

--
2008-07-30 11:10 AM  
I am pasting my code to create an user

Dim NewUser As New UserInfo()
NewUser.PortalID = PortalId
NewUser.Membership.Username = tbEmail.Text
NewUser.Username = tbEmail.Text
NewUser.Profile.FirstName = tbFirstName.Text
NewUser.FirstName = tbFirstName.Text
NewUser.Profile.LastName = tbLastName.Text
NewUser.LastName = tbLastName.Text
NewUser.Email = tbEmail.Text
NewUser.Membership.Email = tbEmail.Text
NewUser.DisplayName = tbFirstName.Text &
NewUser.AffiliateID = Null.NullInteger
NewUser.Membership.Approved =
True
NewUser.Membership.Password = "password"
Dim createStatus As UserCreateStatus = UserController.CreateUser(NewUser)

If I edit the user's in Admin->User Account, I can able to login successfully.

Please let me know where the problem is.

Thanks
Uma

Joseph CraigUser is Offline
DNN Creative Support
Nuke Master VI
Nuke Master VI
Posts:9001
Avatar

--
2008-07-30 01:37 PM  
You might want to look at what is returned by CreateUser.

Also, you say that after editing the user's account, you can login. What do you edit in the user's account to make this happen?

Joe Craig, DNN Creative Support

Subscribe to DNNCreative
I recommend PowerDNN for DotNetNuke Hosting.
UmaUser is Offline
Nuke Active Member
Nuke Active Member
Posts:27

--
2008-07-30 01:57 PM  

In Admin -> User Account, I have changed the password and logged in with this new password successfuly.

CreateUser() is returning success after inserting the user details into the database.

Login fails only If i try with password that I have given during creating the user.

I have tried both static password and GeneratePassword()

Joseph CraigUser is Offline
DNN Creative Support
Nuke Master VI
Nuke Master VI
Posts:9001
Avatar

--
2008-07-30 02:36 PM  
I suggest that you download John Mitchell's tool from here.  Try using it to create a single user.  See if that works.  If it does, then the problem is in your script.  If it fails, then we need to look at your DotNetNuke installation.  This will, at the least, tell us where to look.

Joe Craig, DNN Creative Support

Subscribe to DNNCreative
I recommend PowerDNN for DotNetNuke Hosting.
You are not authorized to post a reply.

Active Forums 4.3

Latest Forum Posts

Admin menu problem by alireza arabiyan
hi i installed dnn 6 on localhost and move it in my host, all link's , pages and modules are ok,
Re: SQL SERVER 2008 R2 Remote connection by Prakasam Srinivasan
I have successfully configured MSSQL Server 2008 r2 remote connection. I am using windows 7 and it h
RE: dnn 4.4 upgrade issue by imran shaikh
Thanks you all it is done by renaming release.config to web.config procedure
RE: dnn 4.4 upgrade issue by imran shaikh
Thanks you all it is done by renaming release.config to web.config
dnn 4.4 upgrade issue by imran shaikh
hi this is imran i am upgrading dnn 4.4 to dnn 6.0.2 and getting this error please help me for this
RE: How to build Skins for DNN 6.x by Joseph Craig
I'd recommend that you try replacing the hard-coded text with the DotNetNuke Text skin object. That
RE: Module permission does not work! by Joseph Craig
What permissions have you give to that role?
RE: DNN nav issue by Joseph Craig
Are you using a custom skin? How often does this happen?
RE: Friendly URLs Broken by Joseph Craig
I don't entirely understand this, but I'm glad you got things working.
RE: How to build Skins for DNN 6.x by Christopher Adamakis
Dear all, I have one more question regarding greek fonts. If you check my site http://www.expertsoft
RE: Dnn local setup problem by imran shaikh
this is error is resolve now now getting this one Server Error in '/cooperpharma.ma' Applicat
RE: Module permission does not work! by Abraham Tameru
I created a special role for the user to administer the site. The user is not a member of the Admini
Dnn local setup problem by imran shaikh
Hi All i have just installed the new site files on my local computer set the connection strin
RE: Firefox has detected that the server is redirecting the request for this address in a way that will never complete. by imran shaikh
Hi i have the same issue Firefox has detected that the server is redirecting the request for thi
DNN nav issue by imran shaikh
Hi All This is imran i am using DNN 6.0 in which issue is that while i am refreshing the site nav
RE: Problem After Attaching/Detaching Database.mdf by Prakasam Srinivasan
thanks joe! But I have connect with database.mdf file in App_Data. I detach the database from
RE: Ventrian News Article by Collin Stefani
Posted By Joseph Craig on 2012-01-18 10:51 AM I'm not sure that you can with the built-in UI.
RE: Friendly URLs Broken by Vistalogix Corporation
Well, we figured out that the problem is related to .Net framework 3.5. Friendly URLs works fine und
RE: Problem After Attaching/Detaching Database.mdf by Joseph Craig
That behavior of running the installation wizard indicates a problem connecting to the database.
RE: Friendly URLs Broken by Vistalogix Corporation
Nope, just a straight-up DNN install and configured in Host -> Friendly URLs as described in my orig
You are not logged in.
You must log in to access all 
650+ videos, tutorials, podcasts, and more.
RSS Feeds