Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0objUserInfo.Membership.PasswordAnswer returns NothingobjUserInfo.Membership.PasswordAnswer returns Nothing
Previous
 
Next
New Post
3/17/2008 8:42 PM
 

Hello,

I am attempting to retrieve the password reminder answer and change the user password programatically with this code:  I have a requirement for custom registration functionality with built-in workflow - the registration peice works just fine - now I need to give the user the ability to change their password.  Normally I'd just do this with core functionality - but because of the requirements for the work I'm doing - this isn't feasible.

********************

Dim objUserInfo As DotNetNuke.Entities.Users.UserInfo
objUserInfo = DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo()
 Dim strPasswordAnswer As String = objUserInfo.Membership.PasswordAnswer
If strPasswordAnswer Is Nothing Then
      strPasswordAnswer = "Blah"
End If
Dim strNewPassword As String = Me.txtPassword.Text.Trim
Dim strOldPassword As String = String.Empty
strOldPassword = DotNetNuke.Entities.Users.UserController.GetPassword(objUserInfo, objUserInfo.Membership.PasswordAnswer.ToString)
If strOldPassword <> Me.txtOldPassword.Text.Trim Then
     Me.lblError.Text = "Current password is incorrect !"
     Me.rowError.Visible = True
     Me.rowSuccess.Visible = False
     Exit Sub
End If
           
DotNetNuke.Entities.Users.UserController.ChangePassword(objUserInfo, strOldPassword, strNewPassword)
objUserInfo.Membership.UpdatePassword = True
Me.rowSuccess.Visible = True

 

********************

strPasswordAnswer comes back as Nothing - even though for the user I'm testing with - there is an encrypted password answer in field 'PasswordAnswer' in table 'aspnet_Membership'.  In this example, the password answer I'm testing with is "Blah" - when I pass this string to retrieve the current password, it works - I am able to get the current password for the user - and subsequently change the password.  I don't know why Dim strPasswordAnswer As String = objUserInfo.Membership.PasswordAnswer  returns nothing...

Any idea what I'm doing wrong?  My development environment is using DNN 4.7.0

Thanks in advance, Al

 

 
New Post
9/22/2011 5:02 PM
 
I am having a Similar issue, did you ever resolve this problem?


Thank you
 
New Post
3/1/2012 4:46 AM
 

Can any one suggest how to change any user password by our own module for admin, we want to customize this for helping some users those who doesn't know how to change their password.

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0objUserInfo.Membership.PasswordAnswer returns NothingobjUserInfo.Membership.PasswordAnswer returns Nothing


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, 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 DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out