Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Create a Form, name it as "FORM CHANGE PASSWORD"
- strExistingPassword = doc.existingPassword(0)
- strPassword1 = doc.password1(0)
- strPassword2 = doc.password2(0)
- */
- ' docPersonDocument is person document from NAB
- Dim strExistingPasswordFromNAB As String
- strExistingPasswordFromNAB = docPersonDocument.Httppassword(0)
- ' strExistingPasswordFromNAB is encrypted
- Dim strFormulaExistingPassword As String
- strFormulaExistingPassword = "@hashpassword(" + Chr(34) + strExistingPassword + Chr(34) + ")"
- 'strExistingPassword is field value from FORM CHANGE PASSWORD
- Dim varExistingPassword As Variant
- varExistingPassword = Evaluate(strFormulaExistingPassword)
- ' "$$ existing password is " + varExistingPassword(0)
- Dim strVerifyPassword As String
- strVerifyPassword = "@verifypassword( "+Chr(34)+strExistingPassword+Chr(34)+";"+Chr(34)+strExistingPasswordFromNAB+Chr(34)+" )"
- Dim varVerify As variant
- varVerify = evaluate(strVerifyPassword)
- ' act = "$$ strVerifyPassword = " + strVerifyPassword
- act = "result strVerifyPassword " + varVerify(0)
- If GlobaldebugFlag Then Call doCreateLogAction(GlobalLogProgramName,act)
- If varVerify(0) = 0 Then
- 'password existing does not match!
- exit sub
- End If
- ' "$$ new password is " + strPassword1
- Dim strNewPassword As String
- strNewPassword = "@hashpassword(" + Chr(34) + strPassword1 + Chr(34) + ")"
- ' act = "$$ str NewP " + strNewPassword
- Dim varNewPassword As Variant
- varNewPassword = Evaluate(strNewPassword)
- ' act = "new password is " + varNewPassword(0) + "<-- encrypted "
- 'saving / update new password to NAB!
- Call docPersonDocument.Replaceitemvalue("HTTPPassword", varNewPassword(0))
- Call docPersonDocument.save(True,True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement