[源碼系列]修改用戶登錄密碼 //******************************************************************************* // Written by Fan [源碼系列]修改用戶登錄密碼 // APP: http://item.taobao.com/auction/item_detail.htm?item_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(;@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
[火星人
]
[源碼系列]修改用戶登錄密碼 已經有280 次圍觀
本文地址: http://coctec.com/docs/service/show-post-17693.html