Take a look at www/login-status.tcl & .adp on any recent oacs distribution. It does what you're asking... it displays the user's name or an indication that the user is not logged in.
/Randy