Patch checks if we are in quick registration mode, and if the email is the same as an existing user, it registers it and loggs the user.

Patch also cleans up other unneeded stuff.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

amitaibu’s picture

Slight change in logic when passing the form.

amitaibu’s picture

Status: Needs review » Needs work

Something still doesn't work, will check.

amitaibu’s picture

Status: Needs work » Needs review
FileSize
6.23 KB

Ok, this one seems to work.

doka’s picture

Status: Needs review » Needs work

Patch fails on fbconnect.pages.inc, if your other patch (http://drupal.org/node/1291924) is previously applied.

git apply -v 1291920-fb-quick-register-3.patch
Checking patch fbconnect.module...
Checking patch fbconnect.pages.inc...
error: while searching for:
  $data = fbconnect_get_user_info(array('name', 'email'));
  // User not logged into facebook we dont have any information for them, let them log in.
  if (empty($data)) {
      return facebook_login_page($form, $form_state);
  }
  //check if user has allready registered with thier facebook account
  $user_id = _is_fbconnect_user($data['id']);
  if ($user_id) {
    //user allready registered facebook account to site, log them in
    $form_state['uid'] = $user_id;
    user_login_submit($form, $form_state);
  }
  elseif ( _email_allready_exist($data['email'])) {
    //the user was not found in the fbconnect_users table, but the emial from facebook might allready have an account on coracle.
    //Redirect user to the login page with a message.
    drupal_set_message(t('This email address is allready registered to an account. Please log in to this account with the username and password provided during registration'));
    $options = array('query' => array(
      'fbconnect' => 'true'
    ));

error: patch failed: fbconnect.pages.inc:85
error: fbconnect.pages.inc: patch does not apply
amitaibu’s picture

Status: Needs work » Needs review

> if your other patch (http://drupal.org/node/1291924) is previously applied.

You don't need to apply the other patch. Each patch is in its own.

giorgio79’s picture

Status: Needs review » Closed (duplicate)
amitaibu’s picture

Status: Closed (duplicate) » Needs review
FileSize
1.75 KB

It's actually not fixed. Attached patch allows auto-linking. Note that the same code already appears in fbconnect_autoconnect_form_submit() indicating there is some very flow going on in the module right now.. :/

giorgio79’s picture

Status: Needs review » Needs work

Possible typo?

elseif ($uid_from_email = _email_allready_exist($data['email'])) {

should be:

elseif ($uid_from_email == _email_allready_exist($data['email'])) {

Not sure if an issue I just found relates with this one, but I noticed a user is never created in the Drupal db after user clicks on FBConnect in fast registration mode (or without it #1323268: User not created in Drupal after FB Connect). The user image appears indicating connection with FB but the user is never logged in to Drupal and no drupal account is created...

amitaibu’s picture

Status: Needs work » Needs review

Not a typo, we populate the variable inside the IF.

amitaibu’s picture

This is now in my sanbox -- https://github.com/amitaibu/fbconnect , which overhauls some of the messy parts of fbconnect.

jcisio’s picture

Status: Needs review » Needs work

I think if there is a user with the same email, we should ask user to enter password to link to that account as it is safer: If user loses his Facebook account, he won't lose his account in every Drupal site.