× Joomla Facebook Connect support forum

Topic-icon full joomla user registration

Active Subscriptions:

None
15 years 1 month ago #9041 by fb_644061421
1) pulling FB name as joomla-username
when a user registers via the FB button as full joomla user, id like to pre-populate the username field (just like the email is pre-filled). ive modified line 52 of components/com_jfbconnect/views/loginregister/tmpl/default.php and added "echo $this->fbUserProfile" (enclosed with php tags; cant post php code here) to the value of username:

class="inputbox" id="username"name="username" value=" PHP open tag echo $this->fbUserProfile PHP close tag" size="20" onblur="jfbc.register.checkUsernameAvailable()" />


ive tried it and it seems to work. was there a reason why this field was not pre-filled per default like in the welcome heading and email field?

2) uncheck newsletter checkbox

a) i've created a newsletter checkbox (similar to the radio button on the screenshot , set it to required, published etc. when i uncheck it during registration, no FB data is imported and account activation is necessary (despite contrary settings).

b) ive also tried to pre-fill a radio button (YES/NO) (setting the default value in mysql to YES), but its not getting pre-filled (the value is prefilled when one clicks the CB registration link).

regarding a) and assuming no value is prefilled with the radio buttons, can you confirm that FB data is imported correctly when no value is selected?
The topic has been locked.
Support Specialist
15 years 1 month ago #9049 by alzander
1) There's 2 reasons we don't pre-populate the username field, but neither of them are reasons why you shouldn't do it.
* We'd need to make it configurable. For an upcoming release, we'll be adding a configuration option for the Facebook User Only automatic username creation to have some basic options for different automatic usernames. For sites that use Full Joomla Users, it's usually because they want 'better' usernames, so if we auto-generated it, we'd get a lot of requests to change it. If you know what you want (or need help coming up with something else), just let us know.
* Generally, I don't like usernames with spaces. Honestly, I can't tell you why, since Joomla uses them just fine, but I avoid them.
* There's no guarantee of uniqueness in those names. Since it's customizeable, that's not a problem, but we'd recommend a check to make sure that username doesn't already exist.. or it could be confusing for the user that the recommended name doesn't work. (ie if 2 John Smith's sign up, the 2nd wouldn't be able to save with that name)

Again, not deal-breakers, and this is something that will likely be an option in the future.. thanks for the feedback!

2) This is likely a bug we'll have to investigate more. Unfortunately, Community Builder is quite annoying in that we can't save a user's profile if it contains a required field that's blank. By not setting those values at registration, this is likely what's happening, which then would prevent a lot of other things (activation, profile import, etc) from functioning properly. We'll see what we can do... the fields at registration was meant to help this situation, but we missed testing with missing fields.

Likely, we'll redirect the user back to the reg/login page with a notice stating "All fields required" if we detect fields that aren't set. Please let me know if you see any issues with that solution. We'll also look into making sure the defaults work for field values.

Thanks for all the feedback, and sorry for the issue!
The topic has been locked.
Active Subscriptions:

None
15 years 1 month ago #9050 by fb_644061421

alzander wrote: * There's no guarantee of uniqueness in those names. Since it's customizeable, that's not a problem, but we'd recommend a check to make sure that username doesn't already exist.. or it could be confusing for the user that the recommended name doesn't work. (ie if 2 John Smith's sign up, the 2nd wouldn't be able to save with that name)missing fields.


hello!
i guess (unfortunately) it'll take a while until this occurs on my little site, but still...
what's the command onblur="jfbc.register.checkUsernameAvailable()" in line 52 about? isnt this already a working username check? i noticed in the email check there is also an 'emailSuccess'. any hints regarding the uniqueness are very appreciated.
The topic has been locked.
Support Specialist
15 years 1 month ago #9063 by alzander
That is a uniqueness check, and it will work. The only issue with that is that it's a Javascript validation only, and it only occurs when someone leaves the field. So, if they never put there cursor (or tab through) the username field, that JS will never be called, and they won't be alerted that the username is already taken. When they submit the form, they'll get booted back to the page stating that their account couldn't be saved, so nothing 'bad' would happen on your end.. but may be confusing.

The emailSuccess is another check we already perform. Here's a much better example of the validation we would implement on the username field (as well as a glimpse into what makes JFBConnect even more complex under the hood than you might think):
* We fetch the user's email from Facebook
* We check if the email address already exists in your Joomla site
* If it does, and automatic linking by email is enabled, we map that user's account and bypass the registration form altogether. If not, move on
**** Show the registration/login form
* If "Show Email At Regsitration" is enabled, we'll show the field pre-populated with their Facebook email address UNLESS that email address is already taken, then we show the field, but with it blank
* If "Show Email at Registration" is disabled, we hide the field UNLESS that email address is already taken, then we show the field, but with it blank

So in the above cases, if the email is already taken, we make the user have to type it, forcing them to see the Javascript and/or realize that they may already have an account on the site.

Hope that makes sense. We do like the idea of auto-generating a username as less steps to register is always a goal of ours. I'm sure it will be in one of the nearer-term feature releases.

Good luck!
The topic has been locked.
Active Subscriptions:

None
15 years 1 month ago #9097 by fb_644061421
thx for the clarifications. but looks as this is beyond my coding skills (have been briefly looking into hardcoding a setfocus, but its not gonna be an issue for me any time soon, so i'll leave it to the experts and wait patiently.
The topic has been locked.