|
|
|
|
|
|
|
|
|
|
|
|
|
|
How to audit your address book: more code (continued)
Dim fullnamecommonname As Variant
fullnamecommonname = False
Dim fullnamefirstlast As Variant
fullnamefirstlast = False
'3 check that Id file common name appears in Fullname
'4 check that firstname/lastname appears in fullname
Forall thing In pers.fullname
If Lcase(thing) = Lcase(realfullname.common) Then fullnamecommonname = True
If Lcase(Trim(thing)) = Lcase(Trim(pers.firstname(0) & " " & pers.lastname(0))) Then fullnamefirstlast = True
End Forall
If fullnamecommonname = False Then
Call reportdocbody.addtab(1)
Call ReportDocBody.appendtext("(1): Common name from ID is not found in the Username field: " & realfullname.common)
Call reportdocbody.addnewline(1)
sev(1) = True
End If
If fullnamefirstlast = False Then
Call reportdocbody.addtab(1)
Call ReportDocBody.appendtext("(1): Firstname/Lastname not found in the Username field: " & Trim(pers.firstname(0) & " " & pers.lastname(0)))
Call reportdocbody.addnewline(1)
sev(1) = True
End If
|
Now we check that the shortname is as expected: first initial and the lastname. If that's not your standard, you might want to change this.
'5 check that the shortname is what we might expect
If Lcase(pers.shortname(0)) <> Lcase(Mid(pers.firstname(0),1,1) & pers.lastname(0)) Then
Call reportdocbody.addtab(1)
Call ReportDocBody.appendtext("(2): Shortname is not 1st inital/lastname: " & pers.shortname(0))
Call reportdocbody.addnewline(1)
sev(2) = True
End If
|
At this point we should have validated that the canonical name we assume is on the ID file matches the first Fullname value. We've checked that the common name form of that is one of the Fullname values, and we've also checked the Shortname. Now we reverse the checks and look at all the Fullname values, trying to match each against something else on the person record. We do this as a case-insensitive match by lower-casing everything. We do this by looping through all the fullname field values and turn each one into a Notesname. Then we check each of the following possibilities:
- Abbreviated name of the entry matches the expected abbreviated name of the person;
- Common name of the entry matches the expected abbreviated name of the person;
- The entry is the shortname or the Internet address, or it matches the firstname/lastname entries.
So, if the value found in fullname isn't one of these, it's something that we can't rationalize. It may be a nickname that has been edited into the person document. Or it may be junk. We report it.
'6 check each value in Fullname and see if we can rationalise it against other things
Forall thing In pers.fullname
Dim thingname As New notesname(thing)
'eliminate...
If Lcase(thingname.abbreviated) = Lcase(realfullname.abbreviated) _ 'canonical name
Or Lcase(thingname.common) = Lcase(realfullname.common) _ 'common name
Or Lcase(thing) = Lcase(pers.shortname(0)) _ 'shortname
Or Lcase(thing) = Lcase(pers.internetaddress(0)) _ 'internet address
Or Lcase(thing) = Lcase(pers.firstname(0) & " " & pers.lastname(0)) Then
Else
Call reportdocbody.addtab(1)
Call ReportDocBody.appendtext("(3): Username value does not match other fields: " & thing)
Call reportdocbody.addnewline(1)
sev(3) = True
End If
End Forall
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- Advertisement --
Learn Notes and Domino 8 at your place and pace!
Learn Notes and Domino in your office and/or home! TLCC's highly acclaimed distance learning courses for users, developers, and admins will enhance your career and your resume.
The many included activities and demos will make you a pro! Expert instructor help is a click away.
Click here to try a FREE demo course!! |
-- Advertisement --
Mark your calendar for in-depth Lotus training, May 12-14, Boston
Join experts and peers May 12-14 in Boston for educational and networking events that deliver real-world Lotus training so you can increase productivity and efficiency in your company, advance your skills, and squeeze the most from your current environment. One registration gets you into THE VIEW's Admin2010 and Lotus Developer2010.
Register by April 10 to save $200. |
|
|
|
|
|
|
|
|
|
|