It seems that most probably your qa_get_logged_in_user() function is not correctly set up to retrieve the session data from your master app.
You need to tweak this function so that (depending on the session record process of your fiverrscript), it can retrieve id, username, email, access_level from your master app.
So this is not just about changing the usernme table in the function.
Say your session mecanism relies on some cookie called, my_app_cookie and that in your app data to retrieve are located in my_app_user_table as follow
- id
- username
- email
- cookie_session_id
-access_level (if any for admin / standard user)
Something like the following should do the trick.
Note that this is a rough idea given as is that you need to adapt.
function qa_get_logged_in_user()
{
if ($_COOKIE['my_app_cookie']) {
$qa_db_connection=qa_db_connection();
$result=mysql_fetch_assoc(
mysql_query(
"SELECT id, username, email, access_level FROM my_app_user_table WHERE cookie_session_id='".$_COOKIE['my_app_cookie']."'",
$qa_db_connection
)
);
if (is_array($result))
return array(
'userid' => $result['id'],
'publicusername' => $result['username'],
'email' => $result['email'],
'level' => $result['access_level'] ? QA_USER_LEVEL_ADMIN : QA_USER_LEVEL_BASIC
);
}
return null;
}