× Joomla Facebook Connect support forum

Topic-icon Change default username "fb_1234567"

Active Subscriptions:

None
13 years 2 weeks ago #8878 by marcusfive
Hi,
i would like to change the default method to generate the username, i don't like: "fb_1234567"
Now the method of creation is: fb _ alphanumeric string.
I wish the usernmae was created like this: real name on facebook _ alphanumeric string.

how can do?

Thank you.
The topic has been locked.
Support Specialist
13 years 2 weeks ago #8885 by alzander
We were hoping to make that a configurable option for the 3.2 release, but ran out of time. It will be a part of the next release though. If you'd like to hard-code a different format, it's pretty simple though. Simply modify the /plugins/authentication/jfbconnectauth.php file. At line 130, you'll see:
$username = "fb_" . $fbUserId;
To change that to what you ask for above, use:
$username = str_replace(" ", "_", $fullname)."_".$fbUserId;
That replaces the spaces in the user's name with underscores, which is recommended for a username. You can also use just $fbUser (without the str_replace function) if you wanted firstname_1234.

Hope that helps, make sure you test, and good luck!
The topic has been locked.
Active Subscriptions:

None
13 years 2 weeks ago #8899 by marcusfive
Thank you, it work very well!
The topic has been locked.
Support Specialist
13 years 2 weeks ago #8906 by alzander
Great! Glad to hear it. It's a simple manual change, but harder for us to provide a configuration option. However, we'll have some ability to customize it in the next release.

Thanks!
The topic has been locked.