I created a new content type which anonymous users are allowed to create. However, they can only do so if they are authenticated into Facebook. What is a good way of associating the particular node with the user? Right now Drupal is assigning a uid of 0 to these anonymous users. Is it possible to overwrite that uid with the id of my Facebook login table? How else can i create a relationship?
1 Answer
The user ID Drupal uses is contained in the uid field of the {users} table. On that table, the user ID for the anonymous users is 0.
You cannot alter the user ID to be a different value, especially if that value is not even contained in the {users} table. If you alter the user ID associated with a node, you are changing the author of that node.
I don't think it is even possible to associate an anonymous user with a Facebook account. What for Drupal is an anonymous user is not really a single user but a multitude of users that access a Drupal site without logging in; also the Google bot is an anonymous user, and associating it with a Facebook account would not make sense.
-
Ok so do you suggest i make the users drupal users as well once they authenticate with facebook? Commented Jul 24, 2012 at 20:30
-
That is what I would do. In that way, you can also track the posts they create, as they would not be associated with a generic anonymous user.– avpaderno ♦Commented Jul 24, 2012 at 20:52