This tip will allow any Notes Registered User in the Domino Address Book to change his/her
password.
Dim s As New NotesSession Dim db As NotesDatabase Dim Server As Variant Dim a,b,Servername As String Set db=s.CurrentDatabase 'GetServer Server=db.server a=Strright(Strleft(Cstr(db.Server),"/"),"=") b=Strrightback(Cstr(db.Server),"=") ServerName=a+"/"+b Set notesDatabase = New NotesDatabase( ServerName, "names.nsf" ) Dim view As NotesView Set view=notesdatabase.GetView("($Users)") Dim doc As NotesDocument Set doc=s.documentcontext decrypted=Evaluate("@Password(""" + doc.OldPassword(0)+""")") Dim nabdoc As NotesDocument Set nabdoc=view.GetDocumentbyKey(doc.UserName(0),True) If Not(nabdoc Is Nothing) Then If (nabdoc.HTTPPassword(0)=decrypted(0)) Then decryptednewpass=Evaluate("@Password("""+ doc.NewPassword(0) + """)") If doc.NewPassword(0)=doc.ConfirmPassword(0) Then nabdoc.HTTPPassword=decryptednewpass(0) Call nabdoc.Save(True,False) Else Print "&tlH3>Wrong confirm password&tl/H3>" Print |&tlDIV ALIGN=center>&tlA onClick="history.back() return false;" HREF="">Back&tl/A>&tl/DIV>| Exit Sub End If Else Print "&tlH3>Your old password is incorrect.&tl/H3>" Print |&tlDIV ALIGN=center>&tlA onClick="history.back() return false;" HREF="">Back&tl/A>&tl/DIV>| Exit Sub End If Else Print "&tlH3>Username not found in the Server Address Book&tl/H3>" Exit Sub End If Print "&tlH3>Successfully updated the password of &tlBR>"+doc.UserName(0)+"&tl/H3>" End Sub
This was first published in January 2002