Closed (fixed)
Project:
Drupal for Facebook
Version:
6.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
23 Oct 2009 at 05:41 UTC
Updated:
8 Oct 2010 at 03:40 UTC
Jump to comment: Most recent file
Comments
Comment #1
Dave Cohen commentedIt's against the facebook terms of service to save into your database their username on facebook.
Also, Drupal's names must be unique, and facebook names are not. So if we tried to save the user's name, there would be cases where we have to deal with this. And I certainly don't know the best way to resolve those conflicts.
The goal of these modules is to create names like NNNNNN@facebook, but always display the user's real name, by overriding theme('username', ...). Unfortunately in Drupal 6 there are places where the username is displayed without theming and therefore cannot be overridden. There is a patch pending in D7 to fix this.
You can also configure the app so that these module do not create the user automatically. In this case, simply direct the user to user/register after they have logged into Facebook Connect. They complete the regular user form, and from then on they can log in via Facebook Connect.
All that said, if you don't like this choice, implement hook_fb, look for $op == FB_OP_PRE_USER. In that hook you can change the username before the user is created.
Comment #2
dindon commentedah thanks!!!
i have another problemn i am sorry if this may be not related. how to delete fb user? i have delete one in drupal user, delete mysql record (fb_app_user) but it still automatically create new one if i already auth with my facebook.
THanks
Comment #3
Dave Cohen commentedYeah, that's what it does, automatically create one if configured to do so.
Just log in as admin in another browser, where you're not logged into facebook, and delete the user from there.
Comment #4
dindon commentedi can not find the setting page to direct user to registration page after Facebook connect, where is it?
Also how to implemnet that hook_fb?
Thanks alot!
Comment #5
gallamine commentedI can't find the settings to enable a registration page after FB connect either. Help?
But, you can read about the hooks here: http://drupal.org/node/312195
Comment #6
gallamine commentedOk, it looks like you need to turn off the setting "Create Local Account: " under the "Facebook user settings" area of the Facebook application node settings.
That done, I don't know how to get DFF to redirect a user to the registration page after signing in using DFF.
Comment #7
Dave Cohen commentedYeah, the idea is to turn off the automatic account creation, the "Create Local Account" setting.
Then the user can use the Facebook Connect button. If the facebook user id is known, they will be logged into that account. But if not, no new account is created. Instead, have them fill out the form at user/register, just like they would if they were not FB Connected. At that point Drupal will create the account, and the DFF module will add an entry in the authmap table. So the next time that user logs in via facebook connect they will be logged into the Drupal account.
There's no special "automatically forward the user to the register page" feature. Just provide a link for the user to click. Is there a need for a feature like that?
Comment #8
gallamine commentedSorry for the super-long reply time - I had a new baby! Anyway, YES, I think it would be a useful feature to somehow force the user to create a Drupal account with a username. Some sort of automatic forwarding to user/register *after* the Facebook Connect has finished. Either that, or some way of forcing the newly registered user to pick a proper username.
Comment #9
rootdownmedia commented+1. It is critical for a user to create a Drupal account on my site as well.
My use case: I run an e-commerce site with single sign on. User can login with DFF but in order to access e-commerce features, they need to have a valid email.
Comment #10
gallamine commentedrootdownmedia, perhaps this thread (http://drupal.org/node/616514) will help you? I wrote a simple module (based on Dave's code) that redirects new FB Connectors to the user/register page.
Comment #11
chazz commentedIs it possible to change username from something like "1072089807@facebook" to something like user-real-name@facebook? or user-first-name@facebook?
Comment #12
Dave Cohen commentedThe default is NNNNNNNNN@facebook for two reasons.
1) facebook user name are not unique, but Drupal user names have to be. (Drupal should support non-unique names but that's another topic.)
2) facebook's terms of service prevented us from saving the name, as learned from its APIs.
About a month ago, facebook changed the terms of service. So I'd like to change the module to make saving the real username an option. But that's not in there yet.
So in the meantime, you can change the name by implementing hook_fb. When $op==FB_OP_PRE_USER, you have a chance to change all the data that fb_user.module will pass to
user_save().Comment #13
chazz commentedThank you for your message,
Can you write some kind of step by step guide how to implement that hook_fb please? I don't have idea how to do this...
Regards
Comment #14
trickpatty commentedi second that.
it would be great to see an example of what one might do to actually implement hook_fb and override the username that gets stored in the database.
i wouldn't even mind if it violated the TOS a little bit...
Comment #15
Dave Cohen commentedThey changed the TOS at the last f8 conference. So now you are allowed to save the user's name. I plan to make this configurable in modules/fb, just haven't gotten around to it yet.
Comment #16
Pete Callaghan commentedGreat module, and I'd like to add my vote for an update that sets the user's email from the FB account values.
Comment #17
BenK commentedSubscribing... excited to be able to save user's name!
Comment #18
rgsditto!
Comment #19
fehin commentedsubscribing
Comment #20
chazz commentedSo it is possible to use real names now?
Regards
Comment #21
g.k commented+1 for realname module support. I'm getting this error after enabling DFF module
warning: Invalid argument supplied for foreach() in /var/www/sites/all/modules/realname/realname.module on line 325
Comment #22
brisath commentedSubscribing
Comment #23
lucascaro commentedsubscribing
Comment #24
lucascaro commentedok, if anyone is interested, i've created a small patch for the user module so it will use theme('username',...) for the navigation and for the user profile page title.
I know i'm not supposed to touch the core modules, but i think this could help all of us for now.
cheers.
Comment #25
Jean Rodas commentedIs there a way to change the comment author name too, i mean in views because views print the NNNNNNNNN@facebook and i don't know how to change it.
Comment #26
Dave Cohen commentedI'm pleased to announce a new feature just checked in....
Under admin >> site building >> facebook apps >> user managment, you may select one of two formats for the username. The machine-friendly option is the current format, i.e. 1234...@facebook. The human-friendly option is new. It will attempt to name the user account with the user's full name, as learned from facebook. It will append a number when the user name is already taken in the local users table.
If you consider the 1234@facebook names to be a problem, please try the new feature. Be sure to report problems to this issue queue if you encounter them.
Comment #27
acondiff commentedwas a new version of this module released for this feature or is it included in my version. I just downloaded the module yesterday night (wednesday).
thanks.
Comment #28
g.k commentedAs an option, I am able to use Email registration in conjunction with DFF module to generate user friendly username.
Comment #29
acondiff commentedi just installed the update for this new feature and i am getting a white screen of death.
these are the steps i took in the update:
mv fb /tmp
downloaded and extracted tarball
backed up db
ran update.php which gave me a link for a manual update
it said that i didnt have the php facebook lib installed so i put that in my fb folder
i clicked update again and I got a white screen of death.
i ran update.php again and i still got a white screen.
any ideas as to why this is happening?
Comment #30
Dave Cohen commentedThe white screen of death almost always has an error message associated with it. Usually in an error log somewhere. Maybe you need to configure php to report all errors.
If you can get any details, please report it in another issue. Let's keep this thread about usernames only.