You are here

function casetracker_get_uid in Case Tracker 6

Same name and namespace in other branches
  1. 5 casetracker.module \casetracker_get_uid()
  2. 7 casetracker.module \casetracker_get_uid()

Given a user name, returns the uid of that account. If the passed name is not found, returns 0. See also casetracker_get_name().

3 calls to casetracker_get_uid()
casetracker_comment in ./casetracker.module
Implementation of hook_comment().
casetracker_default_assign_to_validate in ./casetracker_admin.inc
Element validate for the default assign to value.
casetracker_nodeapi in ./casetracker.module
Implementation of hook_nodeapi().

File

./casetracker.module, line 1032
Enables the handling of projects and their cases.

Code

function casetracker_get_uid($name = NULL, $reset = FALSE) {
  static $users = array();
  if (!isset($users[$name]) || $reset) {
    $result = db_result(db_query("SELECT uid FROM {users} WHERE name = '%s'", $name));
    $users[$name] = $result ? $result : 0;
  }
  return $users[$name];
}