× Joomla Facebook Connect support forum

Topic-icon Email as username

Active Subscriptions:

None
14 years 9 months ago #13162 by m.iannozzi
Email as username was created by m.iannozzi
Hello,
is possible to have a username equal to email at user registration?
There is any way to have it?
The topic has been locked.
Support Specialist
14 years 9 months ago #13168 by alzander
Replied by alzander on topic Email as username
What registration mode are you using, Full Joomla User or Facebook User Only? It should be easy to hard-code that in a few different ways.

The only problem I can see is that if the user chooses not to grant access to their real email address, their username will be a very long email address that Facebook uses to filter emails to that user. It should work, but it's a very, very long and strange looking email (and hence username), which may cause problems with any components you're using which may show the user's username.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
14 years 9 months ago #13172 by m.iannozzi
Replied by m.iannozzi on topic Email as username
Hello Alex,
I'm using "Facebook User Only". I understand email address grant problem but I would like have user equal to email :-) If you can tell me what I need to change I try to do it :-)
Also my user are confused when receive registration email because they read something like
"From now on you can connect to XXX using username and password with which you registered."
The problem is that email doesn't contain username and password and they don't understand what username and password they can use.
Will be good if in email can be included username and password created by facebook login in registration process so If they want use instead facebook login for future access....they can....
The topic has been locked.
Support Specialist
14 years 9 months ago #13185 by alzander
Replied by alzander on topic Email as username
The code change is below. Just so you know, in the 4.0 release (due out today/tomorrow), this code will be different. You'll still be able to do exactly what you're looking for, but the code to modify has been moved to a much better location. When you move to 4.0, just let us know, and we'll provide a similar (easy) code change.

To make the username automatically be the email address for Facebook User's Only in JFBC v3.4, edit the /plugins/authentication/jfbconnnectauth.php file. At line 149, you'll see the following.
$username = $this->_getAutoUsername($fbUser, $fbUserId);
                    $user['username'] = $username;
Change that to:
//         $username = $this->_getAutoUsername($fbUser, $fbUserId);
                    $user['username'] = $newEmail;
The first line you're just commenting out so you don't run unnecessary code generating the 'new' username (that won't be used).

Let us know how that goes, and good luck!
Alex
The topic has been locked.
Support Specialist
14 years 9 months ago #13187 by alzander
Replied by alzander on topic Email as username
I've added a note to our case tracker to look into the emails that we're sending to see if they can be improved. Right now, we're using the standard Joomla new user emails, but can understand how that may be a problem. It won't be fixed in 4.0, but can see improving it shortly thereafter.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
14 years 9 months ago #13220 by m.iannozzi
Replied by m.iannozzi on topic Email as username
Hello Alex. Thansk a lot. It works very good. I have updated to 4.0 and I have found below code in components/com_jfbconnect/controllers/loginregister.php
$username = $loginRegisterModel->getAutoUsername($fbUser, $fbUserId, $usernamePrefixFormat);
$user = $username;

I have modified it as below:
if ($fbUser != null)
{
$user = $fbUser;
} else {
$username = $loginRegisterModel->getAutoUsername($fbUser, $fbUserId, $usernamePrefixFormat);
$user = $username;
}

Thanks a lot also for try to improve email register notification. Will be good if user receive username and password (generated automatically at registration phase) so he can choose to continuous login with facebook or use their username and password.
Thanks a lot again.
The topic has been locked.
Support Specialist
14 years 9 months ago #13224 by alzander
Replied by alzander on topic Email as username
Yeah, we've considered adding the automatic password in the past. It's actually pretty easy to do in that same section. I'll try to rummage up the code and post it here soon. Hopefully, everything with 4.0 is working fine for you.. but if you run into issues, just let us know. So far, so (mostly good) though :)

Finally, please consider leaving a rating and review on the Joomla Extension Directory for JFBConnect, or our support. It's certainly not required, but very appreciated!
extensions.joomla.org/extensions/social-...ook-integration/7215

Thanks, and best of luck,
Alex
The topic has been locked.
Active Subscriptions:

None
14 years 9 months ago #13226 by m.iannozzi
Replied by m.iannozzi on topic Email as username
Thanks a lot Alex. I'have posted my review :-)
At this moment for me 4.0 works without problem.
Great works. I will wait for code or for a future implementation of it in next release :-)
The topic has been locked.
Support Specialist
14 years 8 months ago #13233 by alzander
Replied by alzander on topic Email as username
Thanks for the review and feedback. Glad to hear everything is going well!

Good luck with your site,
Alex
The topic has been locked.