The userentry class allows you to look up entries from /etc/passwd and /etc/shadow or from elsewhere if you're using the Name Service Switch.