No idea what changes you've made, but the below can build the current users object and give you access to all of the CB user object variables such as the username.
Code:
$user = CBuser::getMyUserDataInstance()
$username = $user->username;
This isn't going to do anything if the user isn't logged in though. So for registration your chances of getting this info are basically slim to none. I've no idea if the template files have access to any variables outside of themselves. If they do just try accessing $user and see if that works.