Here is a little background…I am trying to build a ‘Forgot Password’ link on our home page. How I envision it working is a two step process. (First step) A person will fill in a form containing: first initial
last name
last 4 of the ssn
answers to 3 challenge questions
Then when the user forgets their password, they will click on a link on our login page (2nd step) This link will bring them to a page asking for their first initial, last name and last 4 of the social. Then they hit a refresh button, there is a lookup that happens and if the lookup is successful, (containing the user name and answers they provided in the first step) a second set of fields shows up (the previous challenge questions) After they answer the questions, a set of change password fields come up. I have populated the username with the username from the database but they still haven’t authenticated with our server. Then they are supposed to enter the new password and confirm and then submit.
Here is my question: The submit runs but returns “Your name could not be located in the address book”. Below is the webquerysave agent that actually changes the http password. ( I downloaded the password change db from the sandbox…)
Dim session As Notessession
Dim curdoc As NotesDocument
Dim dbNames As NotesDatabase
Dim viewNames As NotesView
Dim docNames As NotesDocument
Dim newPassword As String
Dim encodedNewPassword As String
Dim passwordInAddressBook As String
Dim temp As Variant
Sub Initialize
Set session = New Notessession
' Gets the current document
Set curdoc = session.DocumentContext
' Gets the primary address book
Set dbNames = session.GetDatabase("","names.nsf")
' Gets the hidden view of person documents
Set viewNames = dbNames.GetView("($VIMPeople)")
' Gets the person document for the user
Set docNames = viewNames.GetDocumentByKey(curdoc.GetItemValue("UserName")(0), True)
' Give error if user is not located in address book
' This can happen if user has not logged in the server or if username is in some secondary address book
If docNames Is Nothing Then
Print "[/" & curdoc.GetItemValue("DbPath")(0) & "/message?OpenForm&1]"
Exit Sub
End If
' Gets the new password entered by user
newPassword = curdoc.GetItemValue("NewPassword")(0)
' Gets the encoded password stored in user's person document
passwordInAddressBook = docNames.HTTPPassword(0)
' Gets the encoded form of the new password
temp = Evaluate({@Password(NewPassword)}, curdoc)
encodedNewPassword = temp(0)
' Updates the person document
docNames.HTTPPassword = encodedNewPassword
Call docNames.Save(True, False)
Print "[/" & curdoc.GetItemValue("DbPath")(0) & "/message?OpenForm&3]"
' End
End Sub