A client of ours required a change Internet password feature on the Portal so that users can change their passwords whenever they want. So I made a change password form where the user can enter his old and new password and wrote an agent which checks the current logged in user and changes "HTTPPassword" field in the users document of names.nsf with the new password on webquerysave of the form.
This option, the code for which is below, works fine. But later I got another simpler way to do the same thing -- you can just redirect the user to "http://servername:port/names.nsf?changepassword" and use the default Notes feature to change the password. By using custom login forms and domcfg.nsf, you will be able to change the look and feel of the form as well.
Code
Web Query Save:
Sub Initialize
On Error Goto hell
Dim session As New NotesSession
Dim Empdoc As NotesDocument
Dim namesdb As New NotesDatabase
("","names.nsf")
Dim namesview As NotesView
Dim Empname As New NotesName
(session.EffectiveUserName)
Dim doc As NotesDocument
Set db =session.CurrentDatabase
Set doc=session.DocumentContext
Set namesview=namesdb.
GetView("($VIMPeople)")
If Not namesview Is Nothing Then
Set EmpDoc=namesview.
GetDocumentByKey(Empname.Abbreviated)
If Not empdoc Is Nothing Then
empdoc.HTTPPassword=doc.NewPass(0)
empdoc.SaveOptions="1"
Call empdoc.ComputeWithForm(True,True)
Call empdoc.save(True,True)
End If
End If
Exit Sub
hell: Print Error() & "..............." & Erl()
Exit Sub
End Sub
Do you have comments on this tip? Let us know.
This tip was submitted to the SearchDomino.com tip exchange by member Hemang Kapadia. Please let others know how useful it is via the rating scale below. Do you have a useful Notes/Domino tip or code to share? Submit it to our bimonthly tip contest and you could win a prize and a spot in our Hall of Fame.