You are here

function fb_user_user_update in Drupal for Facebook 7.3

Implements hook_user_update().

User is about to be updated.

File

./fb_user.module, line 754
This module manages relations between local Drupal user accounts and their accounts on facebook.com.

Code

function fb_user_user_update(&$edit, $account, $category) {
  if (isset($edit['fb_user_map'])) {

    // Only set on account form submit.
    if ($edit['fb_user_map']) {
      _fb_user_set_map($account, $edit['fb_user_map']);
    }
    else {

      // Delete account mapping, because administrator has unchecked the connect option.
      $num_deleted = db_delete('fb_user')
        ->condition('uid', $account->uid)
        ->execute();
      fb_invoke(FB_USER_OP_POST_USER_DISCONNECT, array(
        'account' => $account,
      ), NULL, 'fb_user');
    }
  }
}