4
as you found out $xoopsUser is an object. To be exact, it is an instance of the XoopsUser class. To access properties of the $xoopsUser object there are two handy functions:
$xoopsUser->getVar('varname');
$xoopsUser->setVar('varname', 'value');
each database field can be accessed through these two functions. So if the information you want to access is in the 'uid' database field:
$uid = $xoopsUser->getVar('uid');
in your two specific examples there are 3 different fields you may be interested in:
$xoopsUser->getVar('uname'); //The login name for the current user
$xoopsUser->getVar('name'); //The name of the current user (optional)
$xoopsUser->getVar('uid'); //The id of the current user