- 论坛徽章:
- 0
|
//*******************************************************************************
// Written by Fan [源码系列]修改用户登录密码
// APP: http://item.taobao.com/auction/i ... m_num_id=5105121621
//********************************************************************************
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim nDb As NotesDatabase
Dim doc As NotesDocument
Dim sstr As String
Set db=session.currentDatabase
Set doc=session.documentContext
''''''''''
cssStr="<style type=""text/css"">" &_
"body {font-size:12pt}" &_
"a:link {font-size:12pt; text-decoration: 000000;}" &_
"a:visited {font-size:12pt; text-decoration:none;color: 000000;}" &_
"a:hover { font-size:12pt; text-decoration: underline;color: red}"&_
"</style>"
''''''''''
userName=doc.UserName(0)
Password1=Evaluate("@password("""+doc.oldPassword(0)+""")")
oldPassword=Password1(0)
newPassword=doc.newPassword(0)
serverName=db.server
dbName="names.nsf"
Set nDb=New NotesDatabase(serverName,dbName)
'Print "server name:" & ndb.title
'Exit Sub
sstr="select form = ""Person"" & @name([abbreviate];@subset(FullName;1)) ="""+userName+""" & httppassword="""+oldPassword+""""
'Print sstr
'Exit Sub
Set collection=nDb.Search(sstr,Nothing, 0)
'Print "server name:" & Cstr(collection.count)
'Exit Sub
If collection.count>=1 Then
Set doc=collection.GetlastDocument
Else
Set doc=Nothing
End If
If Not (doc Is Nothing) Then
Password1=Evaluate("@password("""+newPassword+""")")
newPassword=Password1(0)
Call doc.replaceItemValue("HTTPPassword",newPassword)
Call doc.save(True,False)
'Print "<OBJECT id=closes type=""application/x-oleobject"" classid=""clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"">"&_
'"<param name=""Command"" value=""Close""></object>"
Print "<script>"
Print "alert(""密码修改成功!几分钟后新密码生效."")"
Print "self.close();"
Print "</script>"
Else
'Print "<OBJECT id=closes type=""application/x-oleobject"" classid=""clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"">"&_
'"<param name=""Command"" value=""Close""></object>"
Print "<script>"
Print "alert(""旧密码错误!"");"
'Print "window.closes.Click();"
Print "self.close();"
Print "</script>"
End If
End Sub |
|