问一下,我想写一个web修改http密码的表单,包括下面四个域userName:文本
oldPassword:口令
newPassword:口令
newPasswordAgain:口令
在提交时运行下面的代理:
Sub Initialize
Dim ss As New NotesSession
Dim db As NotesDatabase
Set db = ss.CurrentDatabase
Dim doc As NotesDocument
Set doc = ss.DocumentConText
Dim mydb As NotesDatabase
Dim myView As NotesView
Dim mydoc As NotesDocument
Set mydb = New NotesDatabase(db.Server,"names.nsf")
Set myView = mydb.GetView("People")
get the users information from the form
filled by the user that change his own password
userName = doc.userName(0)
oldpass = doc.oldPassword(0)
newpass = doc.newPassword(0)
If newpass <> doc.newPasswordAgain(0) Then
Print "<a href=javascript:history.go(-1) target=_self>your two new password is not same!</a>"
Exit Sub
End If
Set mydoc = myView.GetDocumentByKey(userName)
If mydoc Is Nothing Then
Print "<a href=javascript:history.go(-1) target=_self>the user is not exit!</a>"
Exit Sub
Else
macro$ = "@password("+oldpass+")"
result = Evaluate(macro$)
If result(0) <> mydoc.HTTPPassword(0) Then
Print "<a href=javascript:history.go(-1) target=_self>your old password error!</a>"
Exit Sub
End If
macro$ = "@password("+newpass+")"
result = Evaluate(macro$)
mydoc.HTTPPassword = result(0)
Call mydoc.Save(True,True)
Print "<META HTTP-EQUIV=""Expires"" CONTENT=""0"">"
Print "<title>system</title>"
Print "</head>"
Print "<body>"
Print "<br>"
Print "<br>"
Print "<form>"
Print "<p align=""center""><font size=""2"">the change of password is ended,please logon again!</p>"
Print "<p align=""center""><input type=""button"" value=""Longon Again"" name=""OK"" onclick=""okclick()""> </p>"
Print "</form>"
Print "</body>"
Print "<SCRIPT LANGUAGE = JavaScript>"
Print "function okclick()"
Print "{"
Print "window.close()"
Print "}"
Print "</SCRIPT>"
Print "</html>"
End If
End Sub
为什么总是说 HTTP Web Server: Lotus Notes Exception - Unsupported trigger and search in the background or embedded agent [/GroupManger.nsf/Changepasswo
rd?OpenForm&Seq=1]
你这个问题可能是代理属性设置得不对。
你试试改改看。
Runtime属性的Trigger改为on event,另外"Agent list selection",目标none
还有,你那个提交按钮的公式代码里的代理名称前后可以加一对小括号试试