function casetracker_get_uid in Case Tracker 5
Same name and namespace in other branches
- 6 casetracker.module \casetracker_get_uid()
- 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_mail_send in ./
casetracker_mail.module - Sends out emails. Woot! Do people still say woot? Man, I'm old.
- casetracker_nodeapi in ./
casetracker.module - Implementation of hook_nodeapi().
File
- ./
casetracker.module, line 1413 - Enables the handling of projects and their cases.
Code
function casetracker_get_uid($name = NULL) {
// If it looks like a uid, it is a uid. So developers can node_load and then
// node_save().
if (is_numeric($name)) {
return $name;
}
$uid = db_result(db_query("SELECT uid FROM {users} WHERE name = '%s'", $name));
return $uid ? $uid : 0;
}