changing the way username gets registered to database

edited December 2016 in phpBB
I use phpBB 3.0 and I want to change the default behavior of registering usernames to the database.

I did a bit of research and found out it's the task of /includes/functions_oa_social_login.php and then especially this bit;

// Setup user details. $user_row = array ( 'group_id' => $group_id, 'user_type' => $user_type, 'user_actkey' => $user_actkey, 'user_password' => phpbb_hash ($new_password), 'user_ip' => $user->ip, 'user_inactive_reason' => $user_inactive_reason, 'user_inactive_time' => $user_inactive_time, 'user_lastvisit' => time (), 'user_lang' => $user_row ['user_lang'], 'username' => $user_data ['user_login'], 'user_email' => $user_data ['user_email'], 'user_from' => $user_data ['user_location'], 'user_interests' => implode (', ', $user_data ['user_interests_simple']), 'user_website' => $user_data ['user_website'] ); // Register user.

If I look what $user_data ['user_login'] is being made out of then I find this;

// Username is mandatory. if (! isset ($user_data ['user_login']) || strlen (trim ($user_data ['user_login'])) == 0) { $user_data ['user_login'] = $user_data ['identity_provider'] . 'User'; } // Username must be unique. if (oa_social_login::get_user_id_by_username ($user_data ['user_login']) !== false) { $i = 1; $user_login_tmp = $user_data ['user_login'] . ($i); while (oa_social_login::get_user_id_by_username ($user_login_tmp) !== false) { $user_login_tmp = $user_data ['user_login'] . ($i++); } $user_data ['user_login'] = $user_login_tmp;

Which I don't understand.. $user_data ['identity_provider'] . 'User' does this correspond in any way with the API? If so where can I find this info. It doesn't look like I can find it here; https://docs.oneall.com/api/basic/identity-structure/ because I cannot find any key named identity_provider.User ?

The goal is a more anonymous username registration like only the use of the first name added with a random three digit number instead of the first name.last name what it is doing now.

Best Answer

Answers

  • Funny... As soon as I start to form my question to the internet I find the answer myself.



    public static function extract_social_network_profile ($social_data)

    At the
    // Preferred Username.
    section to be exact.

    If someone else wants to know.

    OK, thanks.. Have a nice day!
Sign In or Register to comment.