function uuid_user in Universally Unique IDentifier 5
Same name and namespace in other branches
- 6 uuid.module \uuid_user()
Implementation of hook_user().
File
- ./
uuid.module, line 34
Code
function uuid_user($op, &$edit, &$user, $category = NULL) {
switch ($op) {
case 'load':
$user->uuid = db_result(db_query('SELECT uuid FROM {uuid_users} WHERE uid = %d', $user->uid));
break;
case 'insert':
db_query('INSERT INTO {uuid_users} (uid, uuid) VALUES (%d, UUID())', $user->uid);
break;
case 'delete':
db_query('DELETE FROM {uuid_users} WHERE uid = %d', $node->uid);
break;
}
}