You are right that the issue stems from users permissioned in a site
collection via a group, and the first time they visit the site, their
display name Is not stored in the UserInfo table as it is in AD.
Your code assumes that the environment is absolutely a Portal server
installation, and not just WSS. I do understand that Moojjoo is running
Portal, so if he is using profiles, and they are up to date it would
work, but also see:
SharePoint Account Management using SPUserUtil - Part 6 - Synchronizing
Display Names and Email Addresses with Active Directory
blogs.msdn.com/.../691488.aspx
I do like the fact that you provide an option to update from the
Profiles rather than going straight to AD.