You are here

function _fb_user_get_uid in Drupal for Facebook 7.3

Same name and namespace in other branches
  1. 6.3 fb_user.module \_fb_user_get_uid()
2 calls to _fb_user_get_uid()
fb_user_fb in ./fb_user.module
Implements hook_fb.
fb_user_get_local_user in ./fb_user.module
Given an app and facebook user id, return the corresponding local user.

File

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

Code

function _fb_user_get_uid($fbu, $fb_app = NULL) {
  $result = db_query("SELECT uid FROM {fb_user} WHERE fbu = :fbu", array(
    ':fbu' => $fbu,
  ))
    ->fetchObject();
  if (is_object($result)) {
    return $result->uid;
  }
  else {
    return 0;
  }
}