How to add 'Welcome {username}' in blocks with Drupal 7
Either in a block or in a custom module that adds a block, add the following code:

if (user_is_logged_in() == TRUE) {
    global $user;

    print "Welcome " . $user-&gt;name;
}
else {
    print "Please log in.";
}


This is more useful if you want CURRENT user information.  Possibly this as well for the user_is_logged_in function.