<?php

global $user;
if ($user->uid) {
    $fullData = user_load($user->uid);
    $imageUrl = ($fullData->picture == NULL) ? 'user_profile_icon_v3.png' : $fullData->picture->uri;
    $userImage = theme('image_style', array('style_name' => 'user_profile_icon', 'path' => $imageUrl));
    $fullName = $fullData->field_user_first_name[LANGUAGE_NONE][0]['value'];
    if (isset($fullData->field_user_last_name[LANGUAGE_NONE][0]['value'])) {
        $fullName .= ' ' . $fullData->field_user_last_name[LANGUAGE_NONE][0]['value'];
    }
    echo $userImage . '<div class="admin-logout-section">'
    . l($fullName, 'user/' . $fullData->uid) . " |  "
    . l('&nbsp;', 'user', array('attributes' => array('class' => 'fn-user-settings'), 'html' => TRUE))
    . l('&nbsp;', 'user/logout', array('attributes' => array('class' => 'fn-user-logout'), 'html' => TRUE)) . '</div>';
}
?>