Hi.I read the
I read the README.txt from start to finish. DF connect is working, it allow me to use fb login but df user management is creating drupal user xxxxx@facebook not using fb name.

did i miss anyting in my setting?

TIA

CommentFileSizeAuthor
#24 user_theme_username.patch1.38 KBlucascaro

Comments

Dave Cohen’s picture

Status: Active » Closed (works as designed)

It'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.

dindon’s picture

ah 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

Dave Cohen’s picture

Yeah, 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.

dindon’s picture

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.

i 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!

gallamine’s picture

I 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

gallamine’s picture

Ok, 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.

Dave Cohen’s picture

Yeah, 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?

gallamine’s picture

Sorry 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.

rootdownmedia’s picture

+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.

gallamine’s picture

rootdownmedia, 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.

chazz’s picture

Is it possible to change username from something like "1072089807@facebook" to something like user-real-name@facebook? or user-first-name@facebook?

Dave Cohen’s picture

The 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().

chazz’s picture

Thank 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

trickpatty’s picture

i 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...

Dave Cohen’s picture

Component: Facebook Connect » Code
Category: bug » feature
Status: Closed (works as designed) » Active

They 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.

Pete Callaghan’s picture

Great module, and I'd like to add my vote for an update that sets the user's email from the FB account values.

BenK’s picture

Subscribing... excited to be able to save user's name!

rgs’s picture

ditto!

fehin’s picture

subscribing

chazz’s picture

So it is possible to use real names now?

Regards

g.k’s picture

+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

brisath’s picture

Subscribing

lucascaro’s picture

subscribing

lucascaro’s picture

StatusFileSize
new1.38 KB

ok, 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.

Jean Rodas’s picture

Is 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.

Dave Cohen’s picture

Status: Active » Fixed

I'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.

acondiff’s picture

was 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.

g.k’s picture

As an option, I am able to use Email registration in conjunction with DFF module to generate user friendly username.

acondiff’s picture

i 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?

Dave Cohen’s picture

The 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.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.