Search DominoPower's 11,433 Lotus-related article archive 
Home
EasyPrint
News details Click here for the RSS feed's XML code. This is not a browser URL.
Articles-only Click here for the RSS feed's XML code. This is not a browser URL.
Twitter Feed Click here for the Twitter feed.
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


« Previous  ·  1  ·  2  ·  3  ·  4  ·  5  ·  Next »
Other articles you might like
Home > Lotus Technologies > LotusScript (64 articles)
   When the debugger won't debug hidden code that isn't hidden
   What to do if the LotusScript debugger won't single-step over code
   Little known traps about Lotus Notes fields
Get Weekly Email Updates
Subscribe to our regular weekly email newsletter. It's packed with tips, reviews, deep analysis, and the latest news.
 
Recent DominoPower Articles
Application development, William Shatner, and the origin of the universe
Learn Domino Designer 8.5 for free
The (near) future of Sametime, Quickr, Connections, and Symphony
Inside the IBM Innovations lab
Lotusphere 2010: Hot fixes and cool news for Notes, Domino, and LotusLive
Lotusphere 2010: mobility and collaboration
2010: A Lotusphere of change
Latest Lotus Headlines
Remember Young Admins...there are 2 files
WebSphere Portal 6.1.0.2 and Lotus Domino 8.5
The CKEditor - with Domino
How not to crash in LotusScript
IBM Lotus to Google Apps Migration Remorse
Webcast Series: Mobile Collaboration with Lotus Software
Domino Login Control for Mobile Apps
>> Read all the news
More from the ZATZ journals
Computing Unplugged: The iPad defenders have spoken
David Gewirtz Online: CNN commentary and analysis
OutlookPower: More about disappearing text
-- 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.
ZATZ Home  ·  News  ·  Back Issues  ·  Credits/Trademarks ·  Link To Us
Copyright © 1998-2010, ZATZ Publishing. All rights reserved worldwide.
Editor's Login