Elena Jianu 26.Oct.10 11:11 AM a Web browser Domino Designer6.5.4 FP1All Platforms
I have a big problem with VerifyPassword method while comparing the current password (encrypted with @HashPassword) with the one from HTTPPassword.
By now, all passwords were encrypted with @password and I need to add a few hundreds of users that have their passwords encrypted with @HashPassword. I need this when users wants to change their own passwords.
The code I use is:
If(curNabDoc.HTTPPassword(0) <> req.chkEncodedPasswd(0)) Then
Error message
Else <change password>
The new condition which is not working is:
If(curNabDoc.HTTPPassword(0) <> req.chkEncodedPasswd(0) Or Not(s.VerifyPassword( req.curPasswd(0), curNabDoc.HTTPPassword(0)))) Then
Error message
Else <change password>
Where curPasswd is the password that the user entered on the change password form and chkEncodedPasswd is @Password(@Trim(curPasswd))
The VerifyPassword is always false. Do you have any suggestion that would help me?
More code in case it helps
Dim session As New NotesSession
Dim req As notesDocument
Set req = session.DocumentContext
Sub findUserInPublicNab(s As notesSession, req As notesDocument)
Dim curUser As New notesName(req.Remote_User(0))
Dim curNabView As notesView
Dim curNabDoc As notesDocument
Dim allNabs As Variant
Dim count As Integer
Dim curNab As notesDatabase
Set curNab = s.CurrentDatabase
sLocation = "/" + curNab.FileName
Set curNabView = curNab.GetView("($VimPeople)")
Set curNabDoc = curNabView.getDocumentByKey(curUser.Abbreviated, True)
'Msgbox curUser.Abbreviated
If Not(curNabDoc Is Nothing) Then
'if we find a matching person doc we check if the supplied
'password matches the one found in the person doc.
If(curNabDoc.HTTPPassword(0) <> req.chkEncodedPasswd(0) Or Not(s.VerifyPassword( req.curPasswd(0), curNabDoc.HTTPPassword(0)))) Then
Call WebReturnAlert (ERR)
Exit Sub
Else
'if the passwords matches we update the person doc with the new password.
Call updatePasswd(curNabDoc, req)
Call updateNabSystemView ( curNab )
Exit Sub
End If
Else
Call WebReturnAlert (ERR_PERSONNOTFOUND)
End If
End Sub