fb_user_create_local_user() does not declare $fb_app as global.
When is invoked, the "authname" field of authmap table get the form "$fbu-@facebook.com" instead of "$fbu-$fb_app->apikey@facebook.com", so fb_user_get_local_user($fbu,$fb_app) called from outside fb_user module does not work.

CommentFileSizeAuthor
#3 195586.diff5.09 KBDave Cohen

Comments

Dave Cohen’s picture

Thanks for pointing this out. I'm sure it worked at some point, but it's been a while since I've used the app-specific setting.

I'll change that function to take the fb_app as a parameter, instead of the app_specific flag.

Dave Cohen’s picture

Assigned: Unassigned » Dave Cohen
Dave Cohen’s picture

Status: Active » Needs review
StatusFileSize
new5.09 KB

Here's how I'm thinking of changing fb_user_create_local_user. I'm changing the way local accounts are named, in order to avoid name collisions. I'm also allowing third-party modules implementing hook_fb to alter the suggested name, in case folks are not happy with the change. And I'm changing the signature of fb_user_create_local_user to make it future-compatable.

nlowhor’s picture

Ok, I just applied this patch. For the most part it seems to work. The first time I installed my app using a duplicate name I got what looked like an error I got before I installed the simplexml stuff. However, I then clicked my app name and it loaded it fine and everything seemed great. The user was added to the db with a name of fbu@facebook. This is fine with me as it will encourage users to select a username and keep them anonymous before they do that.

I deleted the app and the db entries and reinstalled it twice but could not duplicate that initial error.

Excellent work!

nlowhor’s picture

Is there any security/privacy concern with exposing a facebook user id? In my case, any user that doesn't change their username will have that ID exposed as author for any content they add.

Thanks.

Dave Cohen’s picture

Nathan,

If you get an error like you described in #4, please copy and paste the text of the error here. Also, when you say the name is fbu@facebook, do you mean literally "fbu@facebook" or do you mean 1234...@facebook?

Regarding #5, it's easy to learn a facebook user's id number, even for users who are not a friend.

I plan to change the name scheme to be "John Doe 123456789@facebook", instead of just "123456789@facebook", before checking in this patch. That is, include the name, but append the fbu to ensure uniqueness

nlowhor’s picture

Dave,

If that error pops up again, I'll definitely post it. Sorry, I would've copied it, but I clicked through and it went away....and hasn't been back.

The name has the actual number in it, like it should.

And based on what you said, it doesn't seem like having the facebook user number visible is a big deal. The way you have the patch working now is fine with me; if you change it later, that should be ok too. :)

Thanks.

Letharion’s picture

Status: Needs review » Closed (won't fix)

Since Drupal 5 is no longer supported, I'm taking the liberty to close all FB D5 issues. Issues that haven't moved since D5 are unlikely to still be valid.