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

Forum

Subject: Validation Failed
Prev Next
You are not authorized to post a reply.

Author Messages
Uma
Nuke Active Member
Nuke Active Member
Posts:27

29 Jul 2008 8:05 AM  

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 Craig
DNN Creative Staff
Nuke Master V
Nuke Master V
Posts:5331


29 Jul 2008 8:12 AM  
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 the website
Uma
Nuke Active Member
Nuke Active Member
Posts:27

29 Jul 2008 8:18 AM  
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 Craig
DNN Creative Staff
Nuke Master V
Nuke Master V
Posts:5331


29 Jul 2008 8:20 AM  
Have you tried using the "Forgot Password" link and using the password that is sent to you?

Joe Craig
DNN Creative Support
Subscribe to the website
Uma
Nuke Active Member
Nuke Active Member
Posts:27

29 Jul 2008 8:39 AM  
Yes. I tried forgot password also. Still login fails.
Joseph Craig
DNN Creative Staff
Nuke Master V
Nuke Master V
Posts:5331


29 Jul 2008 8:43 AM  
Are you able to login with the Host and Admin accounts?

Joe Craig
DNN Creative Support
Subscribe to the website
Uma
Nuke Active Member
Nuke Active Member
Posts:27

29 Jul 2008 8:47 AM  
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 Craig
DNN Creative Staff
Nuke Master V
Nuke Master V
Posts:5331


29 Jul 2008 8:57 AM  
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 the website
Uma
Nuke Active Member
Nuke Active Member
Posts:27

30 Jul 2008 5: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 Craig
DNN Creative Staff
Nuke Master V
Nuke Master V
Posts:5331


30 Jul 2008 7:37 AM  
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 the website
Uma
Nuke Active Member
Nuke Active Member
Posts:27

30 Jul 2008 7:57 AM  

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 Craig
DNN Creative Staff
Nuke Master V
Nuke Master V
Posts:5331


30 Jul 2008 8:36 AM  
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 the website
You are not authorized to post a reply.



ActiveForums 3.7

Latest Forum Posts

Non Standard Port with DNN 5+ by thejudge
Hello Some time back we started tinkering with DNN v5, however we couldn't get it to work when tr...
RE: Community Edition Question by idesofmarch
Thanks a million! This is my first project in dotnetnuke. I've always done Joomla or Drupal. But I d...
Flash in the HTML Module-Source Code by robmacker
Here is the source Flash files for the implementation question i have below. Thank you for lookin...
Windows 7 Install gone wrong by RichardSletcher
Hi I have just attempted to install DNN 5.2 on Windows 7 Pro. I followed you video tutorial but I n...
RE: Module Advanced Setting by jncraig
The module contents is distinct and separate from the Module's container on a particular page. Wh...
RE: Community Edition Question by jncraig
The UDT Module has a new name: Form and List. Look for that. If it is not installed, it shoul...
DataSpring Opt In Module - Scheduler Question by wynnjon
Hey-I was wondering if anything special had to be done to keep the site alive so that the scheduler ...
RE: the now content not showing and still showing the old one by jncraig
You probably can't. Your browser is caching the old flash file, and CRTL-F5 forces a reload. If yo...
RE: Nav Menu v2 for DotNetNuke v5 - Issue 52 by jncraig
Here is a nice little blog entry on the subject.(Basically, though, this gives you a nice and clean ...
RE: Flash in the HTML Module by robmacker
OK, so i commented out my AC_RunActiveContent.js file and my HTML module runs the same -- telling me...
RE: Flash in the HTML Module by mcmanta
I had the same problem before. I noticed I had some HTML tags from some error text I copied. I was a...
RE: Creating Portals before setting the host by cyborama
Thanks for the reply Joe, The way my hosting company does things they don't have per say host hea...
RE: Flash in the HTML Module by robmacker
Wow, why does the forum format my question to make it basically unreadable?? I certainly did not typ...
Flash in the HTML Module by robmacker
Hello members! I have a simple flash application that was written for an HTML page and i'm trying...
Send email with Dynamic Forms Results by jesp17
Hello, Is there a way to automatically generate a report with all form results and then send this r...
Community Edition Question by idesofmarch
I'm learning a lot just browsing around here. Wish I could delete my question below. Oh well. Wher...
RE: DNN Site crashed after module install by mcmanta
I found a work around. Looks like the module replaces the Telerik.Web.UI located in the bin folder o...
RE: iHostASP by chandirika
Hi,I am reselling account with this http://www.goresellers.com/ site ,for my web site's web hosting...
the now content not showing and still showing the old one by wael_e
after i uploading the new contenct in my website and i uploading static html page have introdaction ...
RE: Regular Expression by jumatthey
Hi, Thank you very much Mark. It is indeed a name I am checking. Thank you for your help, very mu...
AppTheory
RSS Feeds