You are here

function uuid_link_get_uid in UUID Link 6

Returns the uid for a user based on a given uuid.

Parameters

string $uuid: The uuid that needs to be mapped.

1 call to uuid_link_get_uid()
uuid_link_replace_callback in ./uuid_link.module
Replace callback for uuid link tokens.

File

./uuid_link.module, line 238
Provides a filter and UI for adding links to entities that are not affected by changes in URL alias.

Code

function uuid_link_get_uid($uuid) {
  static $static_cache = array();
  if (empty($static_cache['uuid'])) {
    $uid = db_result(db_query("SELECT u.uid\n       FROM {users} AS u\n       INNER JOIN {uuid_users} AS uu ON u.uid = uu.uid\n       WHERE uu.uuid = '%s'", $uuid));
    $static_cache[$uuid] = $uid;
  }
  return $static_cache[$uuid];
}