When the user logs in via FbConnect, the login hook is not called. To fix it, change the function fbconnect_autoconnect_form_validate() to make it look like this in the appropriate section:
elseif ($uid) {
$user = user_load($uid);
user_module_invoke('login', $edit, $user);

watchdog('user',
t('Session opened for %name (via FbConnect).',
array('%name' => $user->name))
);

db_query('UPDATE {users} SET login = %d WHERE uid = %d', time(), $user->uid);

// If the fbconnect_profile module is enabled,
// we checks the imported information's cache.
if (module_exists('fbconnect_profile')) {
fbconnect_profile_check_profile_cache($user->uid);
}
drupal_goto($_GET['q']);
}

It would be great if this could be added officially.

Comments

jaydub’s picture

Version: 5.x-1.x-dev »
StatusFileSize
new830 bytes
new829 bytes

Moving this to 6.x since the code in question is in both.

The attached patches take the above idea and put into patch form. I added in a call to sess_regenerate() since that's what goes on in the user module on login.

LaNets’s picture

Assigned: Unassigned » LaNets
Status: Needs review » Fixed
LaNets’s picture

Assigned: LaNets » Unassigned
Status: Fixed » Closed (fixed)