博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
改变Notes ID密码
阅读量:4688 次
发布时间:2019-06-09

本文共 1651 字,大约阅读时间需要 5 分钟。

Function ChangePassword(doc As NotesDocument) As Boolean

On Error Goto ErrHandler

Dim sess As New NotesSession

Dim vwNAB As NotesView

Dim docNAB As NotesDocument

Dim temp As Variant

Dim ErrMsg As String

Forall dbNAB In sess.AddressBooks

Call dbNAB.Open("", "")

If dbNAB.IsOpen Then

Set vwNAB = dbNAB.GetView("($Users)")

If Not vwNAB Is Nothing Then

Set docNAB = vwNAB.GetDocumentByKey(doc.UserName(0), True)

If Not docNAB Is Nothing Then Exit Forall

End If

End If

End Forall

If docNAB Is Nothing Then

ErrMsg = "Cannot locate your person document."

Goto ExitPoint

End If

temp = Evaluate({@VerifyPassword("} + doc.OldPassword(0) + {"; "} + docNAB.HTTPPassword(0) + {")})

If temp(0) <> 1 Then

ErrMsg = "Your old password is incorrect."

Goto ExitPoint

End If

If docNAB.~$SecurePassword(0) = "1" Then

temp = Evaluate({@HashPassword(NewPassword)}, doc)

Else

temp = Evaluate({@Password(NewPassword)}, doc)

End If

docNAB.HTTPPassword = temp(0)

If Not docNAB.Save(False, False) Then

ErrMsg = "Error saving the new password."

Goto ExitPoint

End If

Call sess.SendConsoleCommand(db.Server, "show nlcache reset")

ExitPoint:

Print "Content-Type: text/html; charset=utf-8"

Print "<Script>"

If ErrMsg = "" Then

Print "alert('Password changed successfully.')"

Print "window.close()"

Else

Print "alert('" + ErrMsg + "')"

Print "window.location.replace('/" + Replace(doc.ParentDatabase.FilePath, "\", "/") + "/ChangePassword?OpenForm')"

End If

Print "</Script>"

Exit Function

ErrHandler:

If Err = 4060 Then Resume Next

Msgbox "Line " & Cstr(Erl) & " - " & Error$ & " (" & Cstr(Err) & ")"

End Function

转载于:https://www.cnblogs.com/blackbean/archive/2011/10/17/2215143.html

你可能感兴趣的文章
匹配两个空格之间的字符。。。
查看>>
CSS 文字溢出 变成省略号 ...
查看>>
Spring事务
查看>>
java编程基础(三)流程控制语句
查看>>
让数据库跑的更快的7个MySQL优化建议
查看>>
jquery 取id模糊查询
查看>>
解决在vue中,自用mask模态框出来后,下层的元素依旧可以滑动的问题
查看>>
修改node节点名称
查看>>
Java 文件下载
查看>>
图论——读书笔记 (深度优先搜索)
查看>>
PAT(B) 1014 福尔摩斯的约会(Java)
查看>>
PAT甲级题解-1123. Is It a Complete AVL Tree (30)-AVL树+满二叉树
查看>>
项目开发总结报告(GB8567——88)
查看>>
SSH加固
查看>>
端口扫描base
查看>>
iOS IM开发的一些开源、框架和教程等资料
查看>>
FansUnion:共同写博客计划终究还是“流产”了
查看>>
python 二维字典
查看>>
编译原理实验一
查看>>
Git for Android Studio 学习笔记
查看>>