× Joomla Facebook Connect support forum

Topic-icon Confused about usernames

Active Subscriptions:

None
15 years 11 months ago #4009 by JMCN
Hi,

I've just started using JFBConnect so apologies if this is a stupid/much-asked question (I've searched the forum but not found quite the answer I was after)....

I have integrated with CB and I don't understand this: when an unregistered user wants to join my site by clicking on "Log in using Facebook", and they then are asked to fill in a username, email and password - why is the username they choose not then used as their CB username? Eg: If their name is John Smith but they choose a username of MrX (because they don't want their real name as their username on my site), why is their CB username made John Smith not MrX? Is there anything I can do to change this? I'm sure I must have done something wrong because they wouldn't be offered the option of a username for no reason would they.

Thankyou!
The topic has been locked.
Active Subscriptions:

None
15 years 11 months ago #4011 by asus
Replied by asus on topic Confused about usernames
I second this request.
I don't know whether this is a misconfiguration issue, a bug or the intended behaviour, but it's really confusing and misleading.

Is there a way to use the username supplied by customers during the registration through facebook as their CB username?

Thank you
The topic has been locked.
Support Specialist
15 years 11 months ago #4021 by alzander
Replied by alzander on topic Confused about usernames
Hmmm. We're not aware of this issue, in all honesty. On our demo site, the username's are unique and what are entered. Please test and let us know if this isn't the case, or we're not understanding exactly what you're saying.

Either way, if this is happening to you, we'd love to check out your configuration of both JFBConnect and Community Builer. If you could let us know how the following are set on your site, that may help us test. The answers in ( ) are how the demo site is setup, just so you know:
* JFBConnect - Create New Users - yes or no? (Yes)
* CB - Name style (Single Name Field)
* CB - Name format (username only)

After we get these answers, we may ask for super admin access to one of your sites to see and test some other things.

Thanks!
The topic has been locked.
Active Subscriptions:

None
15 years 11 months ago #4023 by asus
Replied by asus on topic Confused about usernames

alzander wrote: Hmmm. We're not aware of this issue, in all honesty. On our demo site, the username's are unique and what are entered. Please test and let us know if this isn't the case, or we're not understanding exactly what you're saying.


I've tested your live demo site and I noticed that everything is working there, so it must be some kind of misconfiguration/problem on my site.

* JFBConnect - Create New Users - yes or no? (Yes)
* CB - Name style (Single Name Field)
* CB - Name format (username only)


We've the same configuration.
Our CB version is 1.2.2 and we also have joomfish installed.
In the CB configuration we have "Allow User Registration" set to "yes, independently of global site settings", and "No" to "Allow User Registration" in the Joomla global site settings panel.

I've found out that if I set "Enable Community Builder" to "no", the user is created with the supplied username, but only in the joomla user table (the user is not added to the comprofiler table).
The topic has been locked.
Support Specialist
15 years 11 months ago #4027 by alzander
Replied by alzander on topic Confused about usernames
Thanks for sending your configuration settings. Our demo site does not use the same registration settings (Joomla registration enabled, CB registration uses Joomla setting). Not sure how that changes it, but I can easily see that be the root cause for the problem.

Let us investigate a little and we'll let you know what we come up with. Please understand it won't be fixed 'today' as this is the first we've heard of it, but we will fix it.

JMCN:
If you're configured the same way (or even differently) we'd love to hear just so that we know we've actually found the likely cause.

Thanks!
The topic has been locked.
Active Subscriptions:

None
15 years 11 months ago #4028 by asus
Replied by asus on topic Confused about usernames

alzander wrote: Thanks for sending your configuration settings. Our demo site does not use the same registration settings (Joomla registration enabled, CB registration uses Joomla setting).


A flash update on the issue: these settings doesn't seem to solve the problem.

I've found where the problem arises in the code, it's this line
$cbUser->saveSafely( $array, $ui, $reason );
from com_jfbconnect/helpers/communitybuilderhelper.php
in the createNewCBUser() function.

saveSafely ignores the 'username' parameter even if it's set correctly in the $array structure, because my CB configuration disables username changes after a successful registration.

I tried a fix by setting $reason to "register" instead of "edit", but it doesn't work ('cause I'm probably missing something important) and allowing users to change their username is not an option in my environment, even if it completely solves the problem.

Is there a better patch than using
$dbo->execute("UPDATE #__users SET username="
.$dbo->quote($jUser->username)
." WHERE id='{$jUser->id}'"
);
a few lines below?

Thank you
The topic has been locked.
Support Specialist
15 years 11 months ago #4049 by alzander
Replied by alzander on topic Confused about usernames
I'm sure there's a better patch than what you describe, but I think what you say would work. We wouldn't use it as a 'release' solution.. however, ours may take a little longer to figure out something elegant.

Thanks for the investigation and diagnosis. This definitely helps. We plan to deep-dive this issue within the next few days and hopefully have a tested fix early next week.

I'm still unsure why your environment is acting differently, which is the biggest conundrum. If I missed something above where you've mentioned it, please let me know.
The topic has been locked.
Active Subscriptions:

None
15 years 11 months ago #4052 by JMCN
Replied by JMCN on topic Confused about usernames

alzander wrote: Either way, if this is happening to you, we'd love to check out your configuration of both JFBConnect and Community Builer. If you could let us know how the following are set on your site, that may help us test. The answers in ( ) are how the demo site is setup, just so you know:
* JFBConnect - Create New Users - yes or no? (Yes)
* CB - Name style (Single Name Field)
* CB - Name format (username only)


My settings are:

* JFBConnect - Create New Users - yes or no? (Yes)
* CB - Name style (First and Last Name Field)
* CB - Name format (username only)

Thanks for looking into this.
The topic has been locked.
Active Subscriptions:

None
15 years 11 months ago #4053 by asus
Replied by asus on topic Confused about usernames

alzander wrote: I'm still unsure why your environment is acting differently, which is the biggest conundrum. If I missed something above where you've mentioned it, please let me know.


The setting that seems to cause the issue is "Username" and can be found in the "CB Configuration Manager", under the "User Profile" tab.
If I set "Username" (whose explanation is: Set to "Yes" to allow the username to be changed. If set to "No" then the username will not be editable after registration.) to "No", the CB saveSafely() function changes the username chosen during registration.

In fact, the supplied username is effectively used to register the user in Joomla (#__users), but when saveSafely() is invoked in your code, the username is overwritten by CB into the #__users table.

Hope this explains things a little.
The topic has been locked.