You are here

function _is_fbconnect_user in Facebook Connect 7.2

Same name and namespace in other branches
  1. 8.2 fbconnect_login/fbconnect_login.module \_is_fbconnect_user()
  2. 5 fbconnect.module \_is_fbconnect_user()
  3. 6 fbconnect.module \_is_fbconnect_user()

Check if user already registered in the fbconnect_users table

Parameters

Int $fbuid: Facebook user id

Return value

Int $uid

9 calls to _is_fbconnect_user()
fbconnect_login_authorize_page in fbconnect_login/fbconnect_login.pages.inc
Menu callback. Called when user perform Facebook registration
fbconnect_login_autoconnect_form_submit in fbconnect_login/fbconnect_login.module
Submit handler for autoconnect form.
fbconnect_login_init in fbconnect_login/fbconnect_login.module
Implements hook_init().
fbconnect_login_login_page in fbconnect_login/fbconnect_login.pages.inc
Menu callback. Logs user into site or redirects.
fbconnect_login_redirect_submit in fbconnect_login/fbconnect_login.module
Redirects the user to the account linking page. @todo refactor it

... See full list

File

fbconnect_login/fbconnect_login.module, line 633
Login functionality for Facebook Connect module

Code

function _is_fbconnect_user($fbuid) {
  if ($fbuid) {
    $query = db_select('fbconnect_users', 'fbu')
      ->fields('fbu', array(
      'uid',
    ))
      ->condition('fbuid', $fbuid, '=');
    $user_registered = $query
      ->execute()
      ->fetchField();
    if (!empty($user_registered)) {
      return $user_registered;
    }
  }
}