By using a combination of JavaScript and a LotusScript Agent, users can submit requests to change a Domino Web password and it is automatically changed in the appropriate person document. An administrator can also be e-mailed if any security violations occur.
This code is placed behind the OnClick event of a hotspot on a Form.
var passWin
passwin = window.open ('FormName?OpenForm', '',
'scrollbars=yes,status=yes,width=350,height=250')
*******************************************
In the Form I collect first name, last name and the new password twice. The submit button calls a JavaScript function called 'validate()'
*******************************************
function validate(){
var msg;
var msgflag;
var pswdflag;
msgflag = "false";
pswdflag = "false";
if(document.forms[0].NewPasswd.value != ""){
msgflag="true";
passStr = new String(document.forms[0].NewPasswd.value)
if(passStr.length < 4){
pswdflag = "true";
alert("Password must be a minimum of 4 characters long!");
document.forms[0].NewPasswd.focus()
return;
}
if(document.forms[0].ConfirmPasswd.value == ""){
pswdflag = "true";
alert("Please verify you new password by re-entering it into the New Password
Confirmation field!");
document.forms[0].ConfirmPasswd.focus()
}
if(document.forms[0].ConfirmPasswd.value != ""){
if(document.forms[0].ConfirmPasswd.value !=
document.forms[0].NewPasswd.value){
pswdflag = "true";
alert("The password entered in the New password Confirmation field does match the New
Password!");
document.forms[0].ConfirmPasswd.focus()
}
if(msgflag == "true"){
if(pswdflag == "false") {
document.forms[0].submit()
}
}
} } } *************************************
Finally I schedule the following LotusScript Agent to run every fifteen minutes.
Dim tmpsecurename As String
Dim tmpwebName As String
Dim itemFirst As String
Dim itemLast As String
Dim itemAuthor As String
Dim passChange As String
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim nextDoc As NotesDocument
Dim view As NotesView
Dim i As Variant
Set db = session.CurrentDatabase
Set view = db.GetView("PersonalInfo")
Set doc = view.GetFirstdocument
While Not (doc Is Nothing)
passChange = doc.NewPasswd(0)
itemFirst = doc.FirstName(0)
itemLast = doc.LastName(0)
itemAuthor = doc.Author(0)
tmpwebName = itemFirst & " " & itemLast
tmpsecureName = itemAuthor
Call VerifyName(tmpwebName, tmpsecureName)
Set nextDoc = view.GetNextDocument(doc)
Call doc.remove(True)
Set doc = nextDoc
Wend
End Sub Sub SecurityError
Dim securitylog As NotesLog
Set securitylog = New NotesLog("Security Violations")
Call securitylog.OpenMailLog _
("Admin Name", "Security Violations")
Call securitylog.LogAction( tmpsecureName & " attempted to change the password of " &
_
tmpwebName & ".")
Call securitylog.Close
End Sub
Function VerifyName(webName As String, secureName As String) As String
Dim domDir As New NotesDatabase("", "names.nsf"), personDoc As NotesDocument, passItem As
NotesItem
Dim userView As NotesView, tmpuserFirst As Variant, tmpuserLast As Variant,
userFirst As String, userLast As String, verifiedUser As String
Dim passEncrypt As Variant
webName = tmpwebName
secureName = tmpsecureName
If ebName <> secureName Then
Call SecurityError()
Else
Set userView = domDir.GetView("People")
Set personDoc = userView.GetFirstDocument
While Not (personDoc Is Nothing)
If personDoc.HasItem("FirstName") Then
tmpuserFirst = personDoc.GetItemValue("FirstName")
userFirst = tmpuserFirst(0)
End If
If personDoc.HasItem("LastName") Then
tmpuserLast = personDoc.
This was first published in November 2000