Replace "guest name"-field with variable

I have a website with a basic login system. I dont want to integrate minibb completely. I just want to check if a session_id is set already , and when its set go get the username and post it instead of letting guests choose their nickname.Does anyone know wich file i'll want to edit?

- bb_func_login.php - contains the code to handle the login routine itself, i.e. when a user submits the "Login" button after entering Username/Password on the main page, or internal thread pages. Most of the routine could be caught in setup_options.php or bb_specials.php, if you have something significantly different. In other cases, it's better to leave this file by default, then it will be easier in upgrades. But it's up to you.

- bb_cookie.php - the set of functions, which read the authorization cookie, parse its value and consider, if user is logged or not.

Most possibly you should take a look in both of files. Hope you know what to do next.Good luck!